rpmspec: -i: unknown option
pmatilai at laiskiainen.org
Sat Dec 8 09:45:04 UTC 2012
On 11/29/2012 11:28 PM, David Abdurachmanov wrote:
> I have updated from RPM 4.8.X to 4.10.1.
> My scripts used to get not yet build package information with the following command:
> rpm -qi --specfile /build/tmp/tmpspec-gcc --define "A 1" --define "B 1"
> It worked fine on 4.8.X, yet with 4.10.1, I get the following error:
> rpmspec: -i: unknown option
> Yet doing:
> rpm -q --info --specfile /build/tmp/tmpspec-gcc --define "A 1" --define "B 1"
> works on 4.10.1 and 4.8.X
> According to the man page:
> .SS "query-options"
> [\fB--changelog\fR] [\fB-c,--configfiles\fR] [\fB--conflicts\fR]
> [\fB-d,--docfiles\fR] [\fB--dump\fR] [\fB--filesbypkg\fR] [\fB-i,--info\fR]
> --info === -i
> Could someone explain why the behavior has changed?
It's (unintentional) fallout from splitting out the spec query
functionality to the new 'rpmspec' utility in rpm >= 4.9.x:
a) splitting it allowed eliminating librpmbuild dependency from the main
b) splitting it gives a whole lot of freedom to add spec-specific
switches, the main rpm executable is already severely overloaded with
them, and some of the switches are overloaded too: for example '-i'
stands for both --install and --info depending on context.
rpmspec knows neither -i or --info as the output isn't particularly
useful with half the fields non-populated. That it happens to work with
'rpm -q --specfile --info' is because --info is popt alias for a
specific --queryformat but -i can't be handled like that as it is
overloaded and popt doesn't know the context.
If that sounds like a hysteric pile of historical goo... that's exactly
what it is, and some/much of it is not really fixable. I'd recommend
using 'rpmspec' directly for all specfile queries on versions that have
it, 'rpmspec' can be easily extended but the --specfile switch to main
rpm executable can not, and is likely to be dropped entirely at some
point in the future.
- Panu -
More information about the Rpm-list