[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: debootstrap 1.0.93+nmu5



On Tue, 3 Apr 2018 11:20:43 +0200
Raphael Hertzog <hertzog@debian.org> wrote:
> In most postinst snippets, it is used like this:
> 
> 	if which apt-config >/dev/null 2>&1; then
> 
> I don't see the need for a sub-shell.

 I've tried which command on NetBSD, it failed. So just check "test -e"
 for /usr/bin/apt-config as below.


diff --git a/debootstrap b/debootstrap
index 083473d..dfdff4b 100755
--- a/debootstrap
+++ b/debootstrap
@@ -51,15 +51,16 @@ DEF_HTTPS_MIRROR="https://deb.debian.org/debian";
 
 # do auto proxy discovery
 AUTOPROXY=""
-eval $(apt-config shell AUTOPROXY Acquire::http::ProxyAutoDetect)
-if [ -z "$http_proxy" ] && [ -x "$AUTOPROXY" ]; then
-    http_proxy="$($AUTOPROXY)"
-    if [ -n "$http_proxy" ]; then
-        echo "Using auto-detected proxy: $http_proxy"
-        export http_proxy
+if [ -e /usr/bin/apt-config ]; then
+    eval $(apt-config shell AUTOPROXY Acquire::http::ProxyAutoDetect)
+    if [ -z "$http_proxy" ] && [ -x "$AUTOPROXY" ]; then
+        http_proxy="$($AUTOPROXY)"
+        if [ -n "$http_proxy" ]; then
+            echo "Using auto-detected proxy: $http_proxy"
+            export http_proxy
+        fi
     fi
 fi
-


Reply to: