Bug 49461 - rpm/popt options parsing incorrectly
Summary: rpm/popt options parsing incorrectly
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: popt   
(Show other bugs)
Version: 7.3
Hardware: i386 Linux
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2001-07-19 18:16 UTC by Tom "spot" Callaway
Modified: 2008-05-01 15:38 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-07-19 18:17:25 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Tom "spot" Callaway 2001-07-19 18:16:09 UTC
Description of Problem:
popt not parsing options on cli correctly

How Reproducible:

Steps to Reproduce:
1. rpm -ba logjam.spec --target i386,i586,i686

Actual Results:
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

Expected Results:

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.

Comment 1 Tom "spot" Callaway 2001-07-19 18:17:19 UTC
oh yeah. version of popt is popt-1.6.3-0.74, rpm is rpm-4.0.3-0.74

Comment 2 Jeff Johnson 2001-07-19 18:28:41 UTC
	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).

Comment 3 Tom "spot" Callaway 2001-07-19 18:39:32 UTC
OK, addendum:

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

Comment 4 Jeff Johnson 2001-07-19 18:47:13 UTC
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 ...".

Note You need to log in before you can comment on or make changes to this bug.