#432 RFE: Add a common way to pass additional arguments to underplaying commands
Closed: Fixed 4 years ago by onosek. Opened 5 years ago by churchyard.

See

I wonder whether it would be more convenient to support arbitrary command line arguments delegation to the underlaying comamnd. I.e. I could do stuff like:

$ fedpkg clone foo -- --depth=1 --branch f30 --single-branch
$ fedpkg mockbuild -- --enable-network
$ fedpkg update -- --stable-karma 8

And rpkg/fedpkg would add these command line arguments to the underlying command (git, mock, bodhi in the examples).


Another useful use case:

$ fedpkg srpm -- --undefine python

To be able to SRPM certain EL 7 specs that fail to SRPM on current Fedora.

Awesome. Looking forward for testing this!

BTW Do you have a copr repo with development version, so I don't need to wait for the next release?

I am afraid it doesn't work properly:

$ fedpkg clone rpm -- depth=1 --branch f30 --single-branch
Cloning into 'depth=1'...
remote: Counting objects: 3783, done.
remote: Compressing objects: 100% (3037/3037), done.
remote: Total 3783 (delta 1659), reused 2005 (delta 699)
Receiving objects: 100% (3783/3783), 1.19 MiB | 2.09 MiB/s, done.
Resolving deltas: 100% (1659/1659), done.
Could not execute clone: Cmd('git') not found due to: FileNotFoundError('[Errno 2] No such file or directory: '/home/churchyard/tmp/rpm'')
  cmdline: git config credential.helper /usr/bin/fedpkg gitcred

(The example here is wrong, sorry.)

$ fedpkg update -- --stable-karma 8
...
# Enable request automation based on the stable/unstable karma thresholds
autokarma=True
stable_karma=3
unstable_karma=-3
...

This one works:

$ fedpkg mockbuild -N
...
+ ping pagure.io
ping: socket: Operation not permitted

$ fedpkg mockbuild -N -- --enable-network
...
+ ping pagure.io
PING pagure.io(2620:52:3:1:dead:beef:cafe:fed5 (2620:52:3:1:dead:beef:cafe:fed5)) 56 data bytes
64 bytes from 2620:52:3:1:dead:beef:cafe:fed5 (2620:52:3:1:dead:beef:cafe:fed5): icmp_seq=1 ttl=52 time=122 ms
...

$ fedpkg mockbuild -N -- --enable-network
...
+ ping pagure.io
PING pagure.io(2620:52:3:1:dead:beef:cafe:fed5 (2620:52:3:1:dead:beef:cafe:fed5)) 56 data bytes
64 bytes from 2620:52:3:1:dead:beef:cafe:fed5 (2620:52:3:1:dead:beef:cafe:fed5): icmp_seq=1 ttl=52 time=122 ms
...

Oh, the $ fedpkg clone rpm -- depth=1 --branch f30 --single-branch example was wrong. Trying again:

[tmp]$ fedpkg clone rpm -- --depth=1 --branch f30 --single-branch
Cloning into 'rpm'...
remote: Counting objects: 19, done.
remote: Compressing objects: 100% (19/19), done.
remote: Total 19 (delta 0), reused 1 (delta 0)
Receiving objects: 100% (19/19), 33.34 KiB | 3.33 MiB/s, done.
[tmp]$ cd rpm/
[rpm (f30)]$ git l
* 1ef0586 2019-08-29 Panu Matilainen - Fix minidebuginfo generation on PIE executables with file >= 5.33 (#1713866) (grafted, HEAD -> f30, origin/f30)
[rpm (f30)]$

It works.

This one doesn't work either:

[python3-setuptools ((a3177ef...))]$ fedpkg --release epel7 srpm
error: line 54: %package -n python3-setuptools: package python3-setuptools already exists
error: query of specfile /home/churchyard/rpmbuild/fedora-scm/python3-setuptools/python3-setuptools.spec failed, can't parse

Could not execute srpm: Could not get n-v-r-e from /home/churchyard/rpmbuild/fedora-scm/python3-setuptools/python3-setuptools.spec

[python3-setuptools ((a3177ef...))]$ fedpkg --release epel7 srpm -- --define "python3_pkgversion 36" --define "python3_other_pkgversion 34"
error: line 54: %package -n python3-setuptools: package python3-setuptools already exists
error: query of specfile /home/churchyard/rpmbuild/fedora-scm/python3-setuptools/python3-setuptools.spec failed, can't parse

Could not execute srpm: Could not get n-v-r-e from /home/churchyard/rpmbuild/fedora-scm/python3-setuptools/python3-setuptools.spec

The example with git clone has a typo: -- is missing for the depth argument. That causes git to clone the content into a location not expected by rpkg, so it all breaks.

neither does this one:

[python-twisted-web (rhel-7.7)]$ rhpkg srpm -- --undefine python
error: Cannot use %python if %__python wasn't redefined to something other than /usr/bin/python.
error: lua script failed: [string "<lua>"]:4: error expanding macro
error: query of specfile /home/churchyard/rpmbuild/rhpkg/python-twisted-web/python-twisted-web.spec failed, can't parse

Could not execute srpm: Could not get n-v-r-e from /home/churchyard/rpmbuild/rhpkg/python-twisted-web/python-twisted-web.spec

Metadata Update from @churchyard:
- Issue status updated to: Open (was: Closed)

4 years ago

The example with git clone has a typo: -- is missing for the depth argument. That causes git to clone the content into a location not expected by rpkg, so it all breaks.

Yes, I've corrected that in a later comment, sorry about that.

The srpm case is unfortunate. The error happens before rpmbuild is invoked (which is the command that would get the options). It fails when trying to extract version from spec file.

It fails when trying to extract version from spec file.

Oh, right.

Metadata Update from @onosek:
- Issue set to the milestone: 1.61

4 years ago

Metadata Update from @onosek:
- Issue close_status updated to: Fixed
- Issue status updated to: Closed (was: Open)

4 years ago

Log in to comment on this ticket.

Metadata
Related Pull Requests
  • #497 Merged 4 years ago