add no_proxy when debootstrap trying to use proxy

Most of the time,no useing no_proxy is ok,but sometime this will cause problem.
Add no_proxy here will increase the robustness of the program .

Change-Id: I976e689760d2e6de9e2081fcdee4f71299e8470e
This commit is contained in:
Xiang Chen 2016-07-22 14:17:46 +08:00
parent 71c68bf18d
commit 6ae60b2e8f

View File

@ -46,6 +46,7 @@ DIB_DEBIAN_COMPONENTS=${DIB_DEBIAN_COMPONENTS:-main}
DIB_DEBOOTSTRAP_EXTRA_ARGS=${DIB_DEBOOTSTRAP_EXTRA_ARGS:-} DIB_DEBOOTSTRAP_EXTRA_ARGS=${DIB_DEBOOTSTRAP_EXTRA_ARGS:-}
DEBOOTSTRAP_TARBALL=$DIB_IMAGE_CACHE/debootstrap-${DISTRO_NAME}-${DIB_RELEASE}-${ARCH}-${KERNEL}.tar.gz DEBOOTSTRAP_TARBALL=$DIB_IMAGE_CACHE/debootstrap-${DISTRO_NAME}-${DIB_RELEASE}-${ARCH}-${KERNEL}.tar.gz
http_proxy=${http_proxy:-} http_proxy=${http_proxy:-}
no_proxy=${no_proxy:-}
if [ -n "$DIB_OFFLINE" -o -n "${DIB_DEBIAN_USE_DEBOOTSTRAP_CACHE:-}" ] && [ -f $DEBOOTSTRAP_TARBALL ] ; then if [ -n "$DIB_OFFLINE" -o -n "${DIB_DEBIAN_USE_DEBOOTSTRAP_CACHE:-}" ] && [ -f $DEBOOTSTRAP_TARBALL ] ; then
echo $DEBOOTSTRAP_TARBALL found in cache. Using. echo $DEBOOTSTRAP_TARBALL found in cache. Using.
@ -60,7 +61,7 @@ else
# Have to --include=python because of dib-run-parts # Have to --include=python because of dib-run-parts
# Have to --include=sudo for pre-install.d use of sudoers files # Have to --include=sudo for pre-install.d use of sudoers files
# Have to --include=busybox because initramfs needs it # Have to --include=busybox because initramfs needs it
sudo sh -c "http_proxy=$http_proxy debootstrap --verbose \ sudo sh -c "http_proxy=$http_proxy no_proxy=$no_proxy debootstrap --verbose \
--variant=minbase \ --variant=minbase \
--include=python,sudo,busybox,$KERNEL_PACKAGE \ --include=python,sudo,busybox,$KERNEL_PACKAGE \
--components=${DIB_DEBIAN_COMPONENTS} \ --components=${DIB_DEBIAN_COMPONENTS} \