diff --git a/Alien/Package/Rpm.pm b/Alien/Package/Rpm.pm index f0c9f1d..a3a6b47 100644 --- a/Alien/Package/Rpm.pm +++ b/Alien/Package/Rpm.pm @@ -147,6 +147,8 @@ 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"; @@ -178,16 +180,27 @@ sub unpack { $this->do("mv", @filelist, "$workdir/".$this->prefixes) or die "error moving unpacked files into the default prefix directory: $!"; } + + # Deal with relocating conffiles. + my @cf; + foreach my $cf (@{$this->conffiles}) { + $cf=$this->prefixes.$cf; + push @cf, $cf; + } + $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, may come out mode 700. Here I just chown all - # extracted 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. And such - # data should always exist, so this is probably a no-op. - $this->do("find $workdir -type d -perm 700 -print0 | xargs --no-run-if-empty -0 chmod 700"); + # 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 aa281cb..c7b29ba 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +alien (8.49) unstable; urgency=low + + * Add support for config files in relocatale directories. Relocate + filenames in the conffiles list. Closes: #283774 + * Correct permissions fixup code for parent directories from rpms to + take the umask into account when searching for such directories. And + make such directories mode 755, not 700. Closes: #271903 + + -- Joey Hess Mon, 6 Dec 2004 16:09:11 -0500 + alien (8.48) unstable; urgency=low * Support cross-building rpms, output rpm should always be same arch as