Support extracting lzma compressed RPMs. (Patch by unnamed person on some bug tracking system I don't frequent.)

This commit is contained in:
Joey Hess
2010-05-17 20:24:19 -04:00
parent b4bdd3818d
commit 38bf42863d
2 changed files with 10 additions and 2 deletions

View File

@@ -159,7 +159,13 @@ sub unpack {
$this->SUPER::unpack(@_); $this->SUPER::unpack(@_);
my $workdir=$this->unpacked_tree; my $workdir=$this->unpacked_tree;
$this->do("rpm2cpio ".$this->filename." | (cd $workdir; cpio --extract --make-directories --no-absolute-filenames --preserve-modification-time) 2>&1") # Check if we need to use lzma to uncompress the cpio archive
my $decomp='';
if ($this->do("rpm2cpio ".$this->filename." | lzma -t -q > /dev/null 2>&1")) {
$decomp = 'lzma -d -q |';
}
$this->do("rpm2cpio ".$this->filename." | (cd $workdir; $decomp cpio --extract --make-directories --no-absolute-filenames --preserve-modification-time) 2>&1")
or die "Unpacking of '".$this->filename."' failed"; or die "Unpacking of '".$this->filename."' failed";
# cpio does not necessarily store all parent directories in an # cpio does not necessarily store all parent directories in an
@@ -168,7 +174,7 @@ sub unpack {
# Find those directories and make them mode 755, which is more # Find those directories and make them mode 755, which is more
# reasonable. # reasonable.
my %seenfiles; my %seenfiles;
open (RPMLIST, "rpm2cpio ".$this->filename." | cpio -it --quiet |") open (RPMLIST, "rpm2cpio ".$this->filename." | $decomp cpio -it --quiet |")
or die "File list of '".$this->filename."' failed"; or die "File list of '".$this->filename."' failed";
while (<RPMLIST>) { while (<RPMLIST>) {
chomp; chomp;

2
debian/changelog vendored
View File

@@ -3,6 +3,8 @@ alien (8.81) UNRELEASED; urgency=low
* Avoid uninitialized value warning when debian/rules fails to run * Avoid uninitialized value warning when debian/rules fails to run
due to alien being run in a noexec directory. Closes: #579216 due to alien being run in a noexec directory. Closes: #579216
* Prevent DESTROY stomping on alien's exit code sometimes. * Prevent DESTROY stomping on alien's exit code sometimes.
* Support extracting lzma compressed RPMs.
(Patch by unnamed person on some bug tracking system I don't frequent.)
-- Joey Hess <joeyh@debian.org> Wed, 28 Apr 2010 11:29:19 -0400 -- Joey Hess <joeyh@debian.org> Wed, 28 Apr 2010 11:29:19 -0400