Bug 56366

Summary: rpm -ihv wrong_pkg_name* (note wildcard) reports no error
Product: [Retired] Red Hat Linux Reporter: Ralph Rodriguez <ralphr>
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED WONTFIX QA Contact:
Severity: low Docs Contact:
Priority: medium    
Version: 7.2   
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-11-16 06:20:24 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 Ralph Rodriguez 2001-11-16 06:20:18 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.76 [en] (X11; U; Linux 2.4.2-2 i686)

Description of problem:
Run the following commands in succession:
     rpm -ihv wrong_pkg_name*
     echo $?
The first command should report an error message; it does not.
The second command should report a non-zero status; it reports a zero
status.
If the wildcard is not used, system acts appropriately.
Under 7.1, system acts appropriately.
It seems to be a 7.2 specific problem.
Same result with rpm -Uhv; I have not tested rpm -Fhv or without the -hv.
I have tried it using an ftp url for the pkg name and the problem exists
there as well.

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


How reproducible:
Always

Steps to Reproduce:
1. rpm -ihv wrong_pkg_file*
2.echo $?
3.
	

Actual Results:  First command reported no error.
Second command reports error status of zero.

Expected Results:  First command should report an error.
Second command should report a non-zero status.

Additional info:

Although it is not a serious bug, it is confusing to new users.

Comment 1 Jeff Johnson 2001-11-19 23:04:00 UTC
rpm-4.0.3 includes support for manifests, i.e. files with lists
of glob expressions, so non-package files are now permitted
on the command line. So a non-package file, even one that
cannot be interpreted a a list of glob expressions, is no longer
an error. And, since a manifest file can contain multiple
package instances, the traditional rpm return code of
	Number of failed packages
really doesn't apply anymore. Should the exit code be
1 or 10 if a manifest includes 10 packages? And, if
the object doesn't exist at all (this case), shouldn't the
return code be 0 == the number of failing objects?

The bottom line is that your script is gonna have to do more
than check the return code for pathological input.