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

Re: Bug#4974: Bug in dpkg Version: 1.4.0.3



On Mon, 4 Nov 1996, Chris Fearnley wrote:

> 'Dale Scheetz wrote:'
> >
> >On Mon, 4 Nov 1996, Heiko Schlittermann wrote:
> >
> >> Christoph Lameter wrote:
> >> : 
> >> : Package: dpkg
> >> : Version: 1.4.0.3
> >> : dpkg -s <packagename>
> >> : where packagename is nonexistant still returns a result code of 0.
> >> 
> >> ... I dived somewhat in the source ... it seems not to be expected, that
> >> someone will ask for the return code after 'dpkg -s somewhat'.
> >> 
> >I have had the same problem with the -I option and dpkg. I hope you are
> >not defending this behavior. Programs that do not return proper error
> >codes should be considered broken in this regard. It would be nice if dpkg
> >would return proper error conditions.
> 
> I just tested dpkg-1.4.0.3 and the -s option is the only one it fails
> to return a non-zero value on failure.  I tried -I, -c and -s.
> 
I just wrote this test program for the -I feature:

------------------------begin paste---------------
#!/usr/bin/perl -w
#
use strict;
use English;
#
my($command);
$command=`dpkg -I $ARGV[0]`;
        if ( "$CHILD_ERROR" eq "256" )
           {
           system("echo 'ERROR'");
           }
        else
           {
           system("echo 'No error'");
           }
--------------------------------end paste-----------------------------
and here is a sample of the results when this is run:

root[08:21:23]~# ./try gnat
dpkg-deb: failed to read archive `gnat': No such file or directory
No error
root[08:21:32]~# ./try /cdrom/rex/binary-i#386/devel/gnat*.deb
No error

It seems clear that dpkg returns a zero error code for both the failure
and the success. This is not correct.

Luck,

Dwarf

------------                                          --------------

aka   Dale Scheetz                   Phone:   1 (904) 877-0257
      Flexible Software              Fax:     NONE 
      Black Creek Critters           e-mail:  dwarf@polaris.net

------------ If you don't see what you want, just ask --------------

--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-REQUEST@lists.debian.org . Trouble? e-mail to Bruce@Pixar.com


Reply to: