diff -Nru debootstrap-1.0.20ubuntu1.4/debian/changelog debootstrap-1.0.20ubuntu1.5/debian/changelog --- debootstrap-1.0.20ubuntu1.4/debian/changelog 2011-10-24 17:58:57.000000000 +0200 +++ debootstrap-1.0.20ubuntu1.5/debian/changelog 2013-02-15 11:13:36.000000000 +0100 @@ -1,3 +1,12 @@ +debootstrap (1.0.20ubuntu1.5) lucid-proposed; urgency=low + + * Fix Packages was corrupt warning on preseed install + + Backport fix for Debian bug #618920 to solve LP: #1023069. Patch + slightly reworked to adapt to older codebase. + + -- Louis Bouchard Fri, 15 Feb 2013 11:12:31 +0100 + debootstrap (1.0.20ubuntu1.4) lucid-proposed; urgency=low * Add (Ubuntu) precise as a symlink to gutsy (LP: #880926). diff -Nru debootstrap-1.0.20ubuntu1.4/functions debootstrap-1.0.20ubuntu1.5/functions --- debootstrap-1.0.20ubuntu1.4/functions 2009-09-24 20:43:44.000000000 +0200 +++ debootstrap-1.0.20ubuntu1.5/functions 2013-02-15 11:11:44.000000000 +0100 @@ -283,6 +283,7 @@ local typ="$(eval echo \${$(( $a+2 ))})" local from local dest + local iters=0 case "$typ" in bz2) from="$1.bz2"; dest="$2.bz2" ;; @@ -298,24 +299,29 @@ dest2="${dest2%/*}/partial/${dest2##*/}" fi - info RETRIEVING "Retrieving %s" "$displayname" - if ! just_get "$from" "$dest2"; then continue; fi - if [ "$md5" != "" ]; then - info VALIDATING "Validating %s" "$displayname" - if check_md5 "$dest2" "$md5" "$siz"; then - md5="" + while [ "$iters" -lt 10 ]; do + info RETRIEVING "Retrieving %s" "$displayname" + if ! just_get "$from" "$dest2"; then continue 2; fi + if [ "$md5" != "" ]; then + info VALIDATING "Validating %s" "$displayname" + if check_md5 "$dest2" "$md5" "$siz"; then + md5="" + fi fi - fi - if [ -z "$md5" ]; then - [ "$dest2" = "$dest" ] || mv "$dest2" "$dest" - case "$typ" in - gz) gunzip "$dest" ;; - bz2) bunzip2 "$dest" ;; - esac - return 0 - else - warning CORRUPTFILE "%s was corrupt" "$from" - fi + if [ -z "$md5" ]; then + [ "$dest2" = "$dest" ] || mv "$dest2" "$dest" + case "$typ" in + gz) gunzip "$dest" ;; + bz2) bunzip2 "$dest" ;; + esac + return 0 + else + rm -f "$dest2" + warning RETRYING "Retrying failed download of %s" "$from" + iters="$(($iters + 1))" + fi + done + warning CORRUPTFILE "%s was corrupt" "$from" done return 1 } @@ -331,13 +337,6 @@ # http/ftp mirror if wgetprogress -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 -c -O "$dest" "$from"; then break; fi - iters="$(($iters + 1))" - done else rm -f "$dest" return 1