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
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.
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.
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.
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
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.