Red Hat Bugzilla – Bug 49461
rpm/popt options parsing incorrectly
Last modified: 2008-05-01 11:38:00 EDT
Description of Problem:
popt not parsing options on cli correctly
Steps to Reproduce:
1. rpm -ba logjam.spec --target i386,i586,i686
Building target platforms: logjam.spec
Building for target logjam.spec
error: failed to stat /usr/src/redhat/SPECS/i386,i586,i686: No such file or
rpms to be built for target architectures.
this works if the syntax is moved around to:
rpm -ba --target i386,i586,i686 logjam.spec
but it shouldn't discriminate on order.
oh yeah. version of popt is popt-1.6.3-0.74, rpm is rpm-4.0.3-0.74
1) Specify --target first (as you've found)
2) Execute rpmbuild directly.
Popt magic glue is execing rpmbuild for you for legacy compatible reasons,
and there's no way to reorder the args as desired until the legacy
compatibility is removed (not yet, or so I'm told).
rpm -ba --target i386,i586,i686 --define 'withgnome 1' logjam.spec
this breaks, with a similar message
Building target platforms: --define
Building for target --define
error: failed to stat /usr/src/redhat/SPECS/withgnome 1: No such file or directory
this brings the conclusion that any options placed between --target and the
.spec are parsed as targets. this is a bad thing (tm).
this works when reordered as
rpm -ba --define 'withgnome 1' --target=i386,i586,i686 logjam.spec
Again, the build modes (i.e. -ba) moved out of rpm over a year ago,
but, for legacy reasons, there is still some pokery jiggery to achieve
backeward compatibility. The intent is to move the build modes from
rpm to rpmbuild, so start typing "rpmbuild -ba ...", not "rpm -ba ...".