Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 244236 - Incorrect return code
Incorrect return code
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: rpm (Show other bugs)
All Linux
low Severity medium
: ---
: ---
Assigned To: Panu Matilainen
Depends On: 454887
  Show dependency treegraph
Reported: 2007-06-14 13:00 EDT by Jan Hutař
Modified: 2009-01-20 15:49 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-01-20 15:49:21 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2009:0079 normal SHIPPED_LIVE rpm bug fix update 2009-01-20 11:04:16 EST

  None (edit)
Description Jan Hutař 2007-06-14 13:00:09 EDT
Description of problem:
"rpm -qp not_a_file" returns incorrect return code

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. rm -f not_a_file
2. rpm -qp not_a_file
3. echo $?

Actual results:

Expected results:

Additional info:
I tried on RHEL-4 and it is OK (returns 1). On Fedora Development rpm returns 0 
Comment 1 Jeff Johnson 2007-06-15 03:31:04 EDT
Comment 2 Panu Matilainen 2007-06-15 07:09:33 EDT
Yup.. rpmgiNext() stops the iteration on errors and doesn't differentiate the
error case vs normal end of iteration, making accurate error reporting
impossible  AFAICT unless api or at least rpmgiNext() return semantics are changed.
Comment 3 Jeff Johnson 2007-06-15 22:42:41 EDT
The semantics will be changed this weekend ;-)

Thanks for 
    changeset 6020:	7db24f0e47a5
Comment 4 Jan Hutař 2007-06-21 11:01:28 EDT
just noticed this (on x86_64 system where are no *.s390 packages):

$ rpm -q libbonobo.s390
$ echo $?

But libbonobo i386 & x86_64 packages are installed:

$ rpm -q libbonobo

Probably this is relevant to this bug?
Comment 5 Jeff Johnson 2007-06-21 13:29:10 EDT
Actually, your example in #4 is a different flaw, fixed in other ways quite some
time ago in rpm-4.4.9, and recently in as well.
Comment 6 Denise Dumas 2008-07-16 10:17:39 EDT
The RPM rebase in 5.3 / Fedora 9 includes a fix for this issue 
Comment 7 RHEL Product and Program Management 2008-07-16 10:31:31 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
Comment 12 errata-xmlrpc 2009-01-20 15:49:21 EST
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.


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