Bug 234601

Summary: rpm -q $PACKAGE.$ARCH fails too silently
Product: [Fedora] Fedora Reporter: Ben Slusky <sluskyb>
Component: rpmAssignee: Paul Nasrat <nobody+pnasrat>
Status: CLOSED DUPLICATE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-06-11 14:32:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ben Slusky 2007-03-30 14:52:50 UTC
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 19:43:33 UTC
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 14:32:50 UTC

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