#112 fedpkg should allow adding options to rpmbuild command line
Closed: Invalid 7 years ago Opened 13 years ago by ndim.

There should be a way to give fedpkg a few options to pass on to the rpmbuild command line fedpkg ends up calling.

This should come in quite useful when there is a need to debug something with e.g. --without doc or --define "foo check".

As many of fedpkg's subcommands internally call rpmbuild (e.g. local, install, verify-files, prep, and even mockbuild), it would make sense to make this either a global option or an equally global environment variable:

$ env RPMBUILD_OPTS="--without doc --define 'foo check'" fedpkg -v local
$ fedpkg --rpmbuild --without --rpmbuild doc --rpmbuild --define --rpmbuild "foo check" -v local
$ fedpkg --rpmbuild "--without doc" --rpmbuild "--define 'foo check'" -v local

Mock has an interface like follows which avoids the quoting issues obvious in the above examples:

$ mock --without doc --define 'foo bar' --rebuild NVR.srpm

Any better ideas for a user interface are welcome.

In any case, I want to do something less error prone than editing pyfedpkg/__init__.py every time I need a special rpmbuild option for debugging package builds.

Implementation of the mock like options --define, --with, --without for fedpkg:

branch rpmbuild-option-passthrough


Citing the new fedpkg --help output:

optional arguments:
-h, --help show this help message and exit
--dist DIST Override the distribution, eg f15 or el6
-u USER, --user USER Override the username found in the fedora cert
-D 'MACRO EXPR', --define 'MACRO EXPR'
define an rpm macro for rpmbuild
--with RPMWITH enable configure option for rpmbuild
--without RPMWITHOUT disable configure option for rpmbuild
--path PATH Directory to interact with instead of current dir
-v Run with verbose debug output
-q Run quietly only displaying errors

Perhaps the global options should be reordered a bit, but at least this work.

Filed as fedpkg#11, but it should really be done in rpkg.

@lsedlar changed the status to Closed

7 years ago

Login to comment on this ticket.