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

Bug#732628: Please support squid-deb-proxy-client



Hello Michael,

Michael Vogt <mvo@debian.org> (2013-12-19):
> It would be nice if deboostrap would support the proxy auto discovery
> from apt-get. Attached is a patch that adds it, please let me know if
> that sounds reasonable and if the patch looks ok. Happy to adjust it
> if you have any suggestions.
> 
> Cheers,
>  Michael

> >From 628f55068a60c72666dc45f3ff22f82346c60b35 Mon Sep 17 00:00:00 2001
> From: Michael Vogt <mvo@debian.org>
> Date: Thu, 19 Dec 2013 15:36:58 +0100
> Subject: [PATCH] try to auto-detect proxy if available
> 
> ---
>  debootstrap | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/debootstrap b/debootstrap
> index dfa0abc..7bbb15e 100755
> --- a/debootstrap
> +++ b/debootstrap
> @@ -48,6 +48,17 @@ PRIVATEKEY=""
>  
>  DEF_MIRROR="http://ftp.us.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
> +    fi
> +fi
> +
>  export LANG USE_COMPONENTS

Thanks for the patch.

I'm a bit unconvinced by the eval + shell + $() dance, but I might just
be lacking some coffee (it's not like I know much about apt-config or
squid-deb-proxy-client anyway). ;)

Mraw,
KiBi.

Attachment: signature.asc
Description: Digital signature


Reply to: