summaryrefslogtreecommitdiff
path: root/sysutils/debootstrap/files/patch-debootstrap
blob: 32e164a075f3941e83ac2dc6d4116ba5ed13bdb7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
--- debootstrap.orig	2022-10-14 11:16:30 UTC
+++ debootstrap
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!%%LOCALBASE%%/bin/bash
 set -e
 
 VERSION='@VERSION@'
@@ -14,7 +14,7 @@ if [ -z "$DEBOOTSTRAP_DIR" ]; then
 	if [ -x /debootstrap/debootstrap ]; then
 		DEBOOTSTRAP_DIR=/debootstrap
 	else
-		DEBOOTSTRAP_DIR=/usr/share/debootstrap
+		DEBOOTSTRAP_DIR=%%DATADIR%%
 	fi
 fi
 
@@ -379,8 +379,8 @@ if [ $# != 0 ] ; then
 		shift
 		;;
 	    --keyring|--keyring=?*)
-		if ! gpgv --version >/dev/null 2>&1; then
-			error 1 NEEDGPGV "gpgv not installed, but required for Release verification"
+		if ! gpgv2 --version >/dev/null 2>&1; then
+			error 1 NEEDGPGV "gpgv2 not installed, but required for Release verification"
 		fi
 		if [ "$1" = "--keyring" ] && [ -n "$2" ]; then
 			KEYRING="$2"
@@ -536,13 +536,7 @@ fi
 
 ###########################################################################
 
-if in_path dpkg && \
-     dpkg --print-architecture >/dev/null 2>&1; then
-	HOST_ARCH=$(/usr/bin/dpkg --print-architecture)
-elif in_path udpkg && \
-     udpkg --print-architecture >/dev/null 2>&1; then
-	HOST_ARCH=$(/usr/bin/udpkg --print-architecture)
-elif [ -e "$DEBOOTSTRAP_DIR/arch" ]; then
+if [ -e "$DEBOOTSTRAP_DIR/arch" ]; then
 	HOST_ARCH=$(cat "$DEBOOTSTRAP_DIR/arch")
 fi
 HOST_OS="$HOST_ARCH"
@@ -562,6 +556,14 @@ if [ -z "$HOST_OS" ]; then
 			HOST_OS=freebsd
 		;;
 	esac
+fi
+
+if [ "$HOST_OS" = "freebsd" -a -z "$HOST_ARCH" ]; then
+	HOST_ARCH=`/sbin/sysctl -n hw.machine_arch`
+	if [ "$HOST_ARCH" = "aarch64" ]; then
+		HOST_ARCH=arm64
+	fi
+	EXTRACTOR_OVERRIDE=ar
 fi
 
 if [ -z "$ARCH" ]; then