Bug 51727 - rpm 4.0.2 returns 0 status despite error message
rpm 4.0.2 returns 0 status despite error message
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
David Lawrence
Depends On:
  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:
Last Closed: 2001-08-14 10:23:11 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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:

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

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

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.