FS#49905 - [rpmextract] rpm2cpio should handle compressed archives

Attached to Project: Arch Linux
Opened by Joe Stringer (joestringer) - Friday, 01 July 2016, 14:17 GMT
Last edited by Buggy McBugFace (bugbot) - Saturday, 25 November 2023, 20:24 GMT
Task Type Feature Request
Category Packages: Extra
Status Closed
Assigned To Tobias Powalowski (tpowa)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

rpmextract 1.0-7 comes with two tools:
- rpm2cpio translates an rpm directly into cpio
- rpmextract.sh uses rpm2cpio and pipes the output through bsdtar to ensure that the output is decompressed.

On other distributions, rpm2cpio is more featureful and can detect and automatically decompress. So, various tools have begun to rely upon this whenever they invoke rpm2cpio. For example, libabigail will use rpm2cpio to switch the rpm to the cpio format, *and* decompress; with the decompressed cpio, they can pass the output into the 'cpio' tool to render the files to the filesystem.

On Archlinux, the rpm2cpio tool does not do decompression, which breaks the users that expect this behaviour from the tool. For regular execution directly by users there is the rpmextract.sh tool, which is useful. Unfortunately this is insufficient when tools rely upon the decompression provided by the popular rpm2cpio implementations.

If I amend the rpm2cpio script to pass the output into bsdtar, then back through cpio, then the output is as expected. IE, the final line looks like this:

dd if=$pkg ibs=$o skip=1 2>/dev/null | bsdtar -xf - | cpio -o

There's some more detail below where I attempted to report the issue upstream, but I think it is reasonable for them to expect this behaviour from rpm2cpio since the most popular implementations of this tool already handle this case.
https://sourceware.org/bugzilla/show_bug.cgi?id=20299

Can we amend the rpm2cpio tool to ensure that the cpio it outputs is also decompressed?
This task depends upon

Closed by  Buggy McBugFace (bugbot)
Saturday, 25 November 2023, 20:24 GMT
Reason for closing:  Moved
Additional comments about closing:  https://gitlab.archlinux.org/archlinux/p ackaging/packages/rpmextract/issues/1
Comment by Victor Engmark (l0b0) - Saturday, 24 December 2016, 22:13 GMT
Related bug: <https://bugs.archlinux.org/task/7491>. Looks like only rpmextract.sh was fixed.
Comment by Victor Engmark (l0b0) - Thursday, 29 December 2016, 10:56 GMT
Would it be possible to use <https://github.com/ruda/rpm2cpio> instead of the existing shell script for rpm2cpio? It's readable, supports several formats, and actually works. That is, after a simple `sudo make install` and changing the shebang line to use `python2` it worked seamlessly with a script developed for Fedora/CentOS which did `rpm2cpio <package> | cpio -idv` on RPMs from official CentOS repositories.
Comment by Buggy McBugFace (bugbot) - Tuesday, 08 August 2023, 19:11 GMT
This is an automated comment as this bug is open for more then 2 years. Please reply if you still experience this bug otherwise this issue will be closed after 1 month.

Loading...