Changeset View
Changeset View
Standalone View
Standalone View
sysutils/debootstrap/files/patch-debootstrap
--- debootstrap.orig 2018-06-13 13:00:11 UTC | --- debootstrap.orig 2019-07-06 12:22:30.000000000 +0100 | ||||
+++ debootstrap | +++ debootstrap 2020-07-08 20:02:43.929251000 +0100 | ||||
@@ -1,4 +1,4 @@ | |||||
-#!/bin/sh | |||||
+#!%%LOCALBASE%%/bin/bash | |||||
0mp: This should be %%LOCALBASE%%/bin/bash. Maybe add %%BASH%% here and then use REINPLACE_CMD to… | |||||
0mpUnsubmitted Not Done Inline ActionsActually, you may consider using a more standardized mechanism for it like USES=shebangfix. Perhaps something along the lines of the following would work: USES= shebangfix SHEBANG_LANG= bash bash_OLD_CMD= /bin/sh SHEBANG_FILES= debootstrap 0mp: Actually, you may consider using a more standardized mechanism for it like USES=shebangfix. | |||||
set -e | |||||
VERSION='@VERSION@' | |||||
@@ -14,7 +14,7 @@ if [ -z "$DEBOOTSTRAP_DIR" ]; then | @@ -14,7 +14,7 @@ if [ -z "$DEBOOTSTRAP_DIR" ]; then | ||||
if [ -x /debootstrap/debootstrap ]; then | if [ -x /debootstrap/debootstrap ]; then | ||||
DEBOOTSTRAP_DIR=/debootstrap | DEBOOTSTRAP_DIR=/debootstrap | ||||
else | else | ||||
- DEBOOTSTRAP_DIR=/usr/share/debootstrap | - DEBOOTSTRAP_DIR=/usr/share/debootstrap | ||||
+ DEBOOTSTRAP_DIR=%%DATADIR%% | + DEBOOTSTRAP_DIR=%%DATADIR%% | ||||
fi | fi | ||||
fi | fi | ||||
@@ -474,13 +474,7 @@ fi | @@ -498,13 +498,7 @@ fi | ||||
########################################################################### | ########################################################################### | ||||
-if in_path dpkg && \ | -if in_path dpkg && \ | ||||
- dpkg --print-architecture >/dev/null 2>&1; then | - dpkg --print-architecture >/dev/null 2>&1; then | ||||
- HOST_ARCH=$(/usr/bin/dpkg --print-architecture) | - HOST_ARCH=$(/usr/bin/dpkg --print-architecture) | ||||
-elif in_path udpkg && \ | -elif in_path udpkg && \ | ||||
- udpkg --print-architecture >/dev/null 2>&1; then | - udpkg --print-architecture >/dev/null 2>&1; then | ||||
- HOST_ARCH=$(/usr/bin/udpkg --print-architecture) | - HOST_ARCH=$(/usr/bin/udpkg --print-architecture) | ||||
-elif [ -e "$DEBOOTSTRAP_DIR/arch" ]; then | -elif [ -e "$DEBOOTSTRAP_DIR/arch" ]; then | ||||
+if [ -e "$DEBOOTSTRAP_DIR/arch" ]; then | +if [ -e "$DEBOOTSTRAP_DIR/arch" ]; then | ||||
HOST_ARCH=$(cat "$DEBOOTSTRAP_DIR/arch") | HOST_ARCH=$(cat "$DEBOOTSTRAP_DIR/arch") | ||||
fi | fi | ||||
HOST_OS="$HOST_ARCH" | HOST_OS="$HOST_ARCH" | ||||
@@ -502,6 +496,11 @@ if [ -z "$HOST_OS" ]; then | @@ -524,6 +518,11 @@ if [ -z "$HOST_OS" ]; then | ||||
HOST_OS=freebsd | |||||
;; | |||||
esac | esac | ||||
fi | +fi | ||||
+ | |||||
+if [ "$HOST_OS" = "freebsd" -a -z "$HOST_ARCH" ]; then | +if [ "$HOST_OS" = "freebsd" -a -z "$HOST_ARCH" ]; then | ||||
+ HOST_ARCH=kfreebsd-`/sbin/sysctl -n hw.machine_arch` | + HOST_ARCH=kfreebsd-`/sbin/sysctl -n hw.machine_arch` | ||||
+ EXTRACTOR_OVERRIDE=ar | + EXTRACTOR_OVERRIDE=ar | ||||
+fi | |||||
+ | |||||
if [ -z "$ARCH" ]; then | |||||
ARCH="$HOST_ARCH" | |||||
fi | fi | ||||
if [ -z "$ARCH" ]; then |
This should be %%LOCALBASE%%/bin/bash. Maybe add %%BASH%% here and then use REINPLACE_CMD to replace %%BASH%% with ${LOCALBASE}/bin/bash during post-patch.