From 4572a96112e3d162029805a0a7d68cd3b616994a Mon Sep 17 00:00:00 2001 From: joey Date: Sun, 27 Nov 2005 22:41:08 +0000 Subject: [PATCH] releasing version 8.60 --- Alien/Package/Rpm.pm | 34 ++++++++++++++++++++-------------- debian/changelog | 7 +++++++ 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/Alien/Package/Rpm.pm b/Alien/Package/Rpm.pm index e08ede3..6f7e43d 100644 --- a/Alien/Package/Rpm.pm +++ b/Alien/Package/Rpm.pm @@ -147,11 +147,29 @@ 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") or die "Unpacking of '".$this->filename."' failed"; + # cpio does not necessarily store all parent directories in an + # archive, and so some directories, if it has to make them and has + # no permission info, will come out with some random permissions. + # Find those directories and make them mode 755, which is more + # reasonable. + my %seenfiles; + open (RPMLIST, "rpm2cpio ".$this->filename." | cpio -it --quiet |") + or die "File list of '".$this->filename."' failed"; + while () { + chomp; + $seenfiles{$_}=1; + } + close RPMLIST; + foreach my $file (`cd $workdir; find ./`) { + chomp $file; + if (! $seenfiles{$file} && -d $file && ! -l $file) { + $this->do("chmod 755 $file"); + } + } + # If the package is relocatable. We'd like to move it to be under # the $this->prefixes directory. However, it's possible that that # directory is in the package - it seems some rpm's are marked as @@ -189,18 +207,6 @@ sub unpack { } $this->conffiles([@cf]); } - - # cpio does not necessarily store all parent directories in an - # archive, and so some directories, if it has to make them and has - # no permission info, will come out with whatever the default mode - # is for the current umask. Here I just chown all such directories - # to mode 755, which is more reasonable. Note that the next section - # overrides these default permissions, if override data exists in - # the rpm permissions info, but it won't always exist for parent - # directories. - $this->do("find $workdir -type d -perm ". - (sprintf "%lo", 0777 &~ umask). - " -print0 | xargs --no-run-if-empty -0 chmod 755"); # rpm files have two sets of permissions; the set in the cpio # archive, and the set in the control data; which override them. diff --git a/debian/changelog b/debian/changelog index b88cef1..6f21806 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +alien (8.60) unstable; urgency=low + + * Make cpio leading directory permission fixup code work with new cpio + default permissions too. Closes: #340588 + + -- Joey Hess Sun, 27 Nov 2005 17:02:41 -0500 + alien (8.59) unstable; urgency=low * Hmm, seems rpm renamed Copyright to License and fails w/o the new field.