diff --git a/Alien/Package/Rpm.pm b/Alien/Package/Rpm.pm index a9dc05c..c842419 100644 --- a/Alien/Package/Rpm.pm +++ b/Alien/Package/Rpm.pm @@ -159,7 +159,13 @@ sub unpack { $this->SUPER::unpack(@_); 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"; # 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 # reasonable. 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"; while () { chomp; diff --git a/debian/changelog b/debian/changelog index 59fffac..95e4981 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,8 @@ alien (8.81) UNRELEASED; urgency=low * Avoid uninitialized value warning when debian/rules fails to run due to alien being run in a noexec directory. Closes: #579216 * 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 Wed, 28 Apr 2010 11:29:19 -0400