diff options
author | Miguel Figueiredo <elmig-guest@users.alioth.debian.org> | 2010-09-10 20:53:27 +0000 |
---|---|---|
committer | Miguel Figueiredo <elmig-guest@users.alioth.debian.org> | 2010-09-10 20:53:27 +0000 |
commit | dccd27ed8bf4da446db68e274d211f28489b654a (patch) | |
tree | 18d0e7623dc6daec620b0a2a4cce3373a5ef1fc4 /functions | |
parent | a595b2efa082da386e04a181f449657bfab2d9f1 (diff) | |
download | debootstrap-dccd27ed8bf4da446db68e274d211f28489b654a.tar.gz |
support for https on debootstrap
r64676
Diffstat (limited to 'functions')
-rw-r--r-- | functions | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -70,7 +70,7 @@ wgetprogress () { wget "$@" 2>&1 >/dev/null | $PKGDETAILS "WGET%" $PROGRESS_NOW $PROGRESS_NEXT $PROGRESS_END "$PROGRESS_WHAT" >&3 ret=$? else - wget $QSWITCH "$@" + wget $QSWITCH "$@" ret=$? fi return $ret @@ -342,6 +342,21 @@ just_get () { rm -f "$dest" return 1 fi + elif [ "${from#https://}" != "$from" ] ; then + # http/ftp mirror + if wgetprogress $CHECKCERTIF $CERTIFICATE $PRIVATEKEY -O "$dest" "$from"; then + return 0 + elif [ -s "$dest" ]; then + local iters=0 + while [ "$iters" -lt 3 ]; do + warning RETRYING "Retrying failed download of %s" "$from" + if wgetprogress $CHECKCERTIF $CERTIFICATE $PRIVATEKEY -c -O "$dest" "$from"; then break; fi + iters="$(($iters + 1))" + done + else + rm -f "$dest" + return 1 + fi elif [ "${from#file:}" != "$from" ]; then local base="${from#file:}" if [ "${base#//}" != "$base" ]; then |