Subject: Re: NetBSD master CVS tree commits
To: Mike Long <mikel@shore.net>
From: Jonathan Stone <jonathan@DSG.Stanford.EDU>
List: current-users
Date: 12/05/1997 12:59:50
>>jonathan
>>Fri Dec  5 06:01:13 PST 1997
>>Update of /a/cvsroot/src/distrib/utils/sysinst
>
>>Modified Files:
>>       defs.h disks.c label.c menus.mi.eng msg.mi.eng net.c target.c 
>>       upgrade.c util.c 
>>Log Message:
>
>>* GNU tar returns a successful status if its gunzip child dies.
>>  Add short sleep() after tar commands in case of undetected errors.
>
>Perhaps we should fix this in src/gnu/usr.bin/tar, and send the fix to
>the FSF?  (I'm assuming there is not already a fix in later versions
>of gnutar.)


I'd like that.  It depends on whether the release engineers decide
it's critical enough to pull up for the 1.3 branch :).  

I don't think the fix I committed is complete (or ``correct''); it's
in there now so

	a) People beta-testing sysinst can make progress and
	   actually *see* any messages from real tar errors, since
	   that's been a common complaint.

	b) Because I don't know what *other* errors tar will
	   silently return an exit status of zero for.
	   (gnu tar does print an error message saying its gunzip
	   child returned a status of 1; but then it  exits with zero(!))


I also added an explicit check that the tarball actually exists.
That will catch the most likely cause of errors.

The tests I've been doing just use a zero-length tarfile.  I haven't
tried a trucnated or corrupted .tgz yet; maybe tar behaves diffrently
if it gets some input from gunzip.

Guenther Grau <Guenther.Grau@bk.bosch.de> also suggested using

	gzip -c -d file.tar.gz | tar -xf - 

(unzip, I'd guess, and the tar flags need changing) but I haven't
tested that yet.

Interrupting the tar (with Cntrl-C) does return a useful error status,
but so far that's all I've found that does ;-)