Bug 51727 - rpm 4.0.2 returns 0 status despite error message
rpm 4.0.2 returns 0 status despite error message
Status: CLOSED WORKSFORME
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
6.1
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-08-14 10:23 EDT by Tim Freeman
Modified: 2007-04-18 12:35 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-08-14 10:23:11 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Tim Freeman 2001-08-14 10:23:06 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.72 [en] (X11; U; Linux 2.2.13-tim i686; Nav)

Description of problem:
In some cases, when rpm 4.0.2 prints a verbose error message,
it returns exit status 0, which causes programs like make to 
assume that it succeeded when it did not.

How reproducible:
Always

Steps to Reproduce:
Here's how I can reproduce the problem on my system.  Comments added
afterward are in >>><<<'s.

   [tim@fungible ~]$ rpm --target
   RPM version 4.0.2
   Copyright (C) 1998-2000 - Red Hat, Inc.
   This program may be freely redistributed under the terms of the GNU GPL
   
   Usage: rpm {--help}
	  rpm {--version}
	  >>>Blah, blah, blah<<<
	  rpm {--rebuilddb} [--rcfile <file>] [--dbpath <dir>]
	  rpm {--querytags}
   [tim@fungible ~]$ echo $status
   0 >>>Should have been nonzero<<<
   [tim@fungible ~]$ rpm --version
   RPM version 4.0.2
   [tim@fungible ~]$ uname -a
   Linux fungible.com 2.2.13-tim #13 Sat Apr 8 10:30:17 PDT 2000 i686
unknown


Actual Results:  Exit status 0

Expected Results:  Any other exit status.

Additional info:

Trivial bug, but also probably a trivial fix, so probably worth doing.
Comment 1 Jeff Johnson 2001-08-14 13:08:01 EDT
The exit status of rpm has always been the number of failed
operations/objects, not a boolean "bad operation" like
many programs return. In addition, --target is not actually
known to the /bin/rpm executable, it's a configurable popt alias that
execs /usr/bin/rpmbuild. That executable returns a non-zero
exit status:

bash$ rpmbuild --target || echo yeah
--target: missing argument
yeah

In fact, it looks like you have not installed the rpm-build package


Note You need to log in before you can comment on or make changes to this bug.