Bug 234601 - rpm -q $PACKAGE.$ARCH fails too silently
rpm -q $PACKAGE.$ARCH fails too silently
Status: CLOSED DUPLICATE of bug 124016
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
6
All Linux
medium Severity medium
: ---
: ---
Assigned To: Paul Nasrat
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-03-30 10:52 EDT by Ben Slusky
Modified: 2007-11-30 17:12 EST (History)
0 users

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


Attachments (Terms of Use)

  None (edit)
Description Ben Slusky 2007-03-30 10:52:50 EDT
Description of problem:

"rpm -q $PACKAGE.$ARCH" should print "package $PACKAGE.$ARCH is not installed"
and exit with status 1 if $PACKAGE.$ARCH is not installed. But if
$PACKAGE.$ARCH2 is installed for some $ARCH2 != $ARCH, it prints nothing and
exits with status 0 instead.


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

rpm-4.4.2-32 and earlier versions (tested on FC6, FC5, and CentOS4)


How reproducible:

Always.


Steps to Reproduce:

I observed this problem on x86_64 trying to query i386 packages from a shell
script, but it can be reproduced using any $ARCH, including noarch:

1. rpm -q fedora-release ; echo $?
2. rpm -q fedora-release.noarch ; echo $?
3. rpm -q fedora-release.i386 ; echo $?
4. rpm -q this-pkg-doesnt-exist-wtf ; echo $?
5. rpm -q this-pkg-doesnt-exist-wtf.i386 ; echo $?


Actual results:

fedora-release-6-4
0
fedora-release-6-4
0
0
package this-pkg-doesnt-exist-wtf is not installed
1
package this-pkg-doesnt-exist-wtf.i386 is not installed
1


Expected results:

fedora-release-6-4
0
fedora-release-6-4
0
package fedora-release.i386 is not installed
1
package this-pkg-doesnt-exist-wtf is not installed
1
package this-pkg-doesnt-exist-wtf.i386 is not installed
1
Comment 1 Jeff Johnson 2007-03-30 15:43:33 EDT
rpm4-.4.9 behavior (since rpm-4.4.7 iirc):

+ rpm -q fedora-release
fedora-release-6.92-1.noarch
+ echo 0
0
+ rpm -q fedora-release.noarch
fedora-release-6.92-1.noarch
+ echo 0
0
+ rpm -q fedora-release.i386
package fedora-release.i386 is not installed
+ echo 1
1
+ rpm -q this-pkg-doesnt-exist-wtf
package this-pkg-doesnt-exist-wtf is not installed
+ echo 1
1
+ rpm -q this-pkg-doesnt-exist-wtf.i386
package this-pkg-doesnt-exist-wtf.i386 is not installed
+ echo 1
1
[jbj@jack rpm44]$ rpm --version
RPM version 4.4.9

UPSTREAM
Comment 2 Panu Matilainen 2007-06-11 10:32:50 EDT

*** This bug has been marked as a duplicate of 124016 ***

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