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

Re: Malformed Release file [revised patch]

On Mon, Dec 17, 2001 at 08:58:41AM +0000, Phil Blundell wrote:
> An additional suggestion: maybe add a check for the exit status of wget (in
> /usr/lib/debootstrap/functions somewhere) so that the destination file is
> automatically deleted if downloading fails.  Wget has the bad habit of
> creating its output file as zero-length even if there was a gross failure
> like an invalid hostname in the URL.

I checked the busybox wget source, it makes every effort to delete
_and_ unlink any imcomplete files for whatever reason. 

However testing my original patch, I found it was stupid. Here is a
tested one which also adds another message and corrects a return code.
I tested this by both exiting with control-C and unplugging the
network cable for several minutes. In both cases it recovered well. I
also used an editor to empty the Release file. The added rm -f allows
recovery for that condition on a restart, where before it was
unrecoverable. I still don't know what would originally cause the
Release file to become invalid or empty.

--- functions.orig	Sat Dec 15 21:20:23 2001
+++ functions.new	Mon Dec 17 23:03:16 2001
@@ -139,7 +139,8 @@
     info "Retrieving $from"
-    if ! just_get "$from" "$dest"; then return 1; fi
+    if ! just_get "$from" "$dest"; then return 0; fi
+    info "Validating $dest"
     if [ "$md5" = "" ] || check_md5 $dest $md5 $siz; then
       case "$typ" in
         "gz") gunzip "$dest" ;;
@@ -279,8 +280,9 @@
-  if [ "$COMPONENTS" = "" ]; then
-    error 1 "Malformed release file $m1/dists/$SUITE/Release"
+  if [ "$COMPONENTS" = "" ]; then 
+    rm -f $reldest
+    error 1 "Malformed release file $m1/dists/$SUITE/Release (was deleted, try again)"
   progress 100 100 "Downloading Release file"

*------v--------- Installing Debian GNU/Linux 3.0 --------v------*
|      <http://www.debian.org/releases/woody/installmanual>      |
|   debian-imac (potato): <http://debian-imac.sourceforge.net>   |
|            Chris Tillman        tillman@azstarnet.com          |
|                   May the Source be with you                   |

Reply to: