rpm2cpio should handle compressed archives
Task Info (Flyspray) | |
---|---|
Opened By | Joe Stringer (joestringer) |
Task ID | 49905 |
Type | Feature Request |
Project | Arch Linux |
Category | Packages: Extra |
Version | None |
OS | All |
Opened | 2016-07-01 14:17:25 UTC |
Status | Assigned |
Assignee | Tobias Powalowski (tpowa) |
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?