#622 Extract source RPMs with rpm2archive if possible
Merged by onosek. Opened by praiskup.
praiskup/rpkg rpm2archive  into  master

Download 622.patch

The output format from rpm2archive is not bound with the 4GB file size
limit, like the rpm2cpio is.

Related: https://pagure.io/copr/copr/issue/2225
Signed-off-by: Pavel Raiskup praiskup@redhat.com

While rpm2cpio is given the SRPM path as argument, the rpm2archive command wants to read it from stdin. When executed, nothing is passed to stdin though.

Good catch!

rebased onto bb40b97f9ddd406335683a76a5b5a2db11d835a7

Hi,
I manually tested your change (because unit tests indicated failures):

[root@e1b146584ade SRPMS]# ls
docpkg-0.2-1.fc33.src.rpm
[root@e1b146584ade SRPMS]# rpm2archive -n - < docpkg-0.2-1.fc33.src.rpm | tar xf -
rpm2archive: -n: No such file or directory
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors
[root@e1b146584ade SRPMS]# rpm2archive - < docpkg-0.2-1.fc33.src.rpm | tar xf -
tar: Archive is compressed. Use -z option
tar: Error is not recoverable: exiting now
[root@e1b146584ade SRPMS]# ls
docpkg-0.2-1.fc33.src.rpm
[root@e1b146584ade SRPMS]# rpm -qa rpm
rpm-4.16.1.3-1.fc33.x86_64
[root@e1b146584ade SRPMS]# rpm2archive --help
Usage: rpm2archive [file.rpm ...]
[root@e1b146584ade SRPMS]#

It seems older versions of rpm have issues with the command. They don't have -n parameter implemented. In rpkg the code is common for Fedora (and epel7/8) and for older RHEL releases (like RHEL-7 and RHEL-8) as well. And when some versions of rpm2archive have such issues, the code needs some mechanism to work on all releases.

rebased onto aa084d504466a8c87abebefdf212cb8ec05e6285

Ah, :-( yeah F34 and EPEL8 are missing the needed options (F33 EOL). I'm not sure about the "runtime" fix, please take a look.

How can I read the output from the CI testsuite?

rebased onto c4bc9f6edd2af1640a3850f268198867533d0a42

rebased onto e4fd6dae0fad2be998e3708856eabdfba90624dd

Looks good. Thanks.

Pull-Request has been merged by onosek

Metadata