FS#12712 - [rpmextract] 1.0-2 won't extract rpm files anymore
Attached to Project:
Arch Linux
Opened by Lee Jackson (ProfessorTomoe) - Thursday, 08 January 2009, 15:13 GMT
Last edited by Jan de Groot (JGC) - Saturday, 06 June 2009, 21:18 GMT
Opened by Lee Jackson (ProfessorTomoe) - Thursday, 08 January 2009, 15:13 GMT
Last edited by Jan de Groot (JGC) - Saturday, 06 June 2009, 21:18 GMT
|
Details
The change made in Revision 23362 of rpm2cpio breaks normal
rpm extraction. Extraction errors out with the following:
"gzip: stdin: not in gzip format" I discovered this when trying a rebuild of the bin32-wine-suse package in AUR. Downgrading to 1.0-1 fixes the issue. Steps to reproduce: 1. Install rpmextract 1.0-2 2. Download the bin32-wine-suse PKGBUILD from AUR 3. Run makepkg - error occurs here under 1.0-2, but not with 1.0-1 |
This task depends upon
Closed by Jan de Groot (JGC)
Saturday, 06 June 2009, 21:18 GMT
Reason for closing: Fixed
Additional comments about closing: libarchive supports lzma/xz now, file-roller has been patched to use bsdtar for rpm extracting.
Saturday, 06 June 2009, 21:18 GMT
Reason for closing: Fixed
Additional comments about closing: libarchive supports lzma/xz now, file-roller has been patched to use bsdtar for rpm extracting.
The solution for your bug is to open rpm2cpio and remove the "|gunzip" part from it. To fix this issue completely, we should write out the stream to a temporary file, find out if it's compressed and then gunzip it.
That's essentially what downgrading to 1.0-1 does - the rpm2cpio files are identical otherwise.
>>To fix this issue completely, we should write out the stream to a temporary file, find out if it's compressed and then gunzip it.
While you're at it, there are some newer RPM files that won't rpmextract fails on because they're compressed with LZMA. Try this file as an example:
http://download.opensuse.org/repositories/Emulators:/Wine/openSUSE_11.1/i586/wine-1.1.12-2.1.i586.rpm
The weird part is that LZMA won't decompress the above file, but 7-Zip will unpack it to wine-1.1.12-2.1.i586.cpio.lzma. LZMA will then recognize and decompress it. Of course, none of this works with rpmextract since it's not written to work with 7-Zip or LZMA.
Any chance of a fix for this, please?
rpm2cpio wine-*.i586.rpm | lzma -d | cpio -idmuv || return 1
$ cat /usr/bin/rpmextract.sh
#!/bin/sh
# Extract RPM's with gunzip and cpio
if [ "$1" = "" -o ! -e "$1" ]; then
echo "no package supplied" 1>&2
exit 1
fi
rpm2cpio $1 | gunzip | cpio -idmuv
$ cat /usr/bin/rpmbsdtarextract.sh
#!/bin/sh
# Archlinux Way with bsdtar
if [ "$1" = "" -o ! -e "$1" ]; then
echo "no package supplied" 1>&2
exit 1
fi
rpm2cpio $1 | bsdtar -xf -
$ cat /usr/bin/rpmlzmaextract.sh
#!/bin/sh
# Extract RPM's with lzma and cpio
if [ "$1" = "" -o ! -e "$1" ]; then
echo "no package supplied" 1>&2
exit 1
fi
rpm2cpio $1 | lzma -d | cpio -idmuv
Personally i found this better than searching the info in a wiki or somewhere else but this be only my 2c. Perhaps in the future bsdtar can handle such cases better and this would be the best solution.
I'll see what I can do with other file formats, as this gives nice possibilities: every file that can be handled by bsdtar will be handled by bsdtar, which means users don't need extra tools like unzip.
It's up to the maintainer of libarchive to include lzma support. For core, we don't need it, but for possibilities like this, it's a welcome feature.