Bug 7751

Summary: rpm requires rpmrc for even `rpm --help` ?!?
Product: [Retired] Red Hat Linux Reporter: Marc Tamsky <marc-redhatbugzilla20060919>
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 4.2   
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: 1999-12-12 01:02:05 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 Marc Tamsky 1999-12-11 08:37:47 UTC
I came across a bootstrap situation where I had an rpm binary and rpmrc in
/tmp and was trying to install the RPM package...

I couldn't get `rpm --help` to tell me its syntax for directing it
to the rcfile in /tmp... unless I did a `touch /usr/lib/rpm/rpmrc`
first.

For other suggestions... see bug#536

Comment 1 Jeff Johnson 1999-12-11 14:50:59 UTC
This is rpm-2.5.x correct? If so, you are correct that rpm requires
/usr/lib/rpm/rpmrc to exist, even for --help, since the path was hard-wired
in the executable. Rpm-3.0.x extends the --rpmrc option to include
a colon separated list of rpmrc files to read, but the 1st file in the
list (usually /usr/lib/rpm/rpmrc) must still exist even for --help.

BTW, rpm makes extensive use of the popt facility, so many of rpm's commands
are not even resident in the rpm binary, hence the counterintuitive need for
configuration files even for --help.

Comment 2 Marc Tamsky 1999-12-12 00:47:59 UTC
I was speaking for both 2.5 and 3.0.x...

> Rpm-3.0.x extends the --rpmrc option to include
> a colon separated list of rpmrc files to read, but the 1st file in the
> list (usually /usr/lib/rpm/rpmrc) must still exist even for --help.

Read what you wrote, and tell me that this isn't a bug.

1. '--help' should provide at least a minimally useful set of feedback
   no matter what the state of "required" configuration files.

2. if everything isn't in place as RPM is expecting, it _should_ tell you
   what you need to do to get a proper '--help' listing.
   -- it should not issue an error message stating only that things are FUBAR.

Comment 3 Jeff Johnson 1999-12-12 01:02:59 UTC
I cannot change the legacy behavior -- rpm *needs* the arch/os compatibility
tables from the 1st rpmrc file, hence the requirement that the 1st file exist.

Second, a large number of rpm options are implemented using popt aliases read in
from a set of configuration files. That means that "--help" is not simply a
loop over a set of strings ala getopt_long.

Comment 4 Marc Tamsky 1999-12-12 06:55:59 UTC
I understand all the legacy and popt reasons... at a minimum
rpm --help without any config files should print:

rpm: config files missing, use option [--rpmrc filename] if needed

Comment 5 Jeff Johnson 1999-12-12 12:54:59 UTC
Which is not a whole lot different than
    bash$ rpm --help
    Unable to open /usr/lib/rpm/rpmrc for reading: No such file or directory.
except that your text creates yet another legacy expectation of how rpm
should behave. The config file /usr/lib/rpm/rpmrc is going to be eliminated,
and the rate limiting step is not coding, but managing legacy expectations.