summaryrefslogtreecommitdiff
path: root/functions
diff options
context:
space:
mode:
authorMiguel Figueiredo <elmig-guest@users.alioth.debian.org>2010-09-10 20:53:27 +0000
committerMiguel Figueiredo <elmig-guest@users.alioth.debian.org>2010-09-10 20:53:27 +0000
commitdccd27ed8bf4da446db68e274d211f28489b654a (patch)
tree18d0e7623dc6daec620b0a2a4cce3373a5ef1fc4 /functions
parenta595b2efa082da386e04a181f449657bfab2d9f1 (diff)
downloaddebootstrap-dccd27ed8bf4da446db68e274d211f28489b654a.tar.gz
support for https on debootstrap
r64676
Diffstat (limited to 'functions')
-rw-r--r--functions17
1 files changed, 16 insertions, 1 deletions
diff --git a/functions b/functions
index 14f86ff..07b56d2 100644
--- a/functions
+++ b/functions
@@ -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