mirror of
https://github.com/Project-OSS-Revival/alien.git
synced 2026-04-24 14:00:17 +00:00
* When converting from rpm, do parent directory 755 chmods first, then
known permissions setting from rpm --queryformat, so that it can override
any directories that do indeed have a permission set.
* Fixed MakeFile.PL to work with perl 5.8.
This commit is contained in:
@@ -176,31 +176,6 @@ sub unpack {
|
||||
or die "error moving unpacked files into the default prefix directory: $!";
|
||||
}
|
||||
|
||||
if ($> == 0) {
|
||||
# rpm files have two sets of permissions; the set in the cpio
|
||||
# archive, and the set in the control data; which override them.
|
||||
# The set in the control data are more correct, so let's use those.
|
||||
open (GETPERMS, 'rpm --queryformat \'[%{FILEMODES} %{FILEUSERNAME} %{FILEGROUPNAME} %{FILENAMES}\n]\' -qp '.$this->filename.' |');
|
||||
while (<GETPERMS>) {
|
||||
chomp;
|
||||
my ($mode, $owner, $group, $file) = split(/ /, $_, 4);
|
||||
$mode = $mode & 07777; # remove filetype
|
||||
my $uid = getpwnam($owner);
|
||||
if (! defined $uid) {
|
||||
print STDERR "WARNING: $file is owned by a user ($owner) not on this system; using root instead";
|
||||
$uid=0;
|
||||
}
|
||||
my $gid = getgrnam($group);
|
||||
if (! defined $gid) {
|
||||
print STDERR "WARNING: $file is owned by a group ($group) not on this system; using group root instead";
|
||||
$gid=0;
|
||||
}
|
||||
next unless -e "$workdir/$file"; # skip broken links
|
||||
chown($uid, $gid, "$workdir/$file") || die "failed chowning $file to $uid\:$gid\: $!";
|
||||
chmod($mode, "$workdir/$file") || die "failed changing mode of $file to $mode\: $!";
|
||||
}
|
||||
}
|
||||
|
||||
# When cpio extracts the file, any child directories that are
|
||||
# present, but whose parent directories are not, end up mode 700.
|
||||
# This next block corrects that to 755, which is more reasonable.
|
||||
@@ -234,6 +209,31 @@ sub unpack {
|
||||
}
|
||||
chmod 0755, keys %tochmod if %tochmod;
|
||||
|
||||
if ($> == 0) {
|
||||
# rpm files have two sets of permissions; the set in the cpio
|
||||
# archive, and the set in the control data; which override them.
|
||||
# The set in the control data are more correct, so let's use those.
|
||||
open (GETPERMS, 'rpm --queryformat \'[%{FILEMODES} %{FILEUSERNAME} %{FILEGROUPNAME} %{FILENAMES}\n]\' -qp '.$this->filename.' |');
|
||||
while (<GETPERMS>) {
|
||||
chomp;
|
||||
my ($mode, $owner, $group, $file) = split(/ /, $_, 4);
|
||||
$mode = $mode & 07777; # remove filetype
|
||||
my $uid = getpwnam($owner);
|
||||
if (! defined $uid) {
|
||||
print STDERR "WARNING: $file is owned by a user ($owner) not on this system; using root instead\n";
|
||||
$uid=0;
|
||||
}
|
||||
my $gid = getgrnam($group);
|
||||
if (! defined $gid) {
|
||||
print STDERR "WARNING: $file is owned by a group ($group) not on this system; using group root instead\n";
|
||||
$gid=0;
|
||||
}
|
||||
next unless -e "$workdir/$file"; # skip broken links
|
||||
chown($uid, $gid, "$workdir/$file") || die "failed chowning $file to $uid\:$gid\: $!";
|
||||
chmod($mode, "$workdir/$file") || die "failed changing mode of $file to $mode\: $!";
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
13
Makefile.PL
13
Makefile.PL
@@ -17,6 +17,11 @@ sub MY::postamble {
|
||||
|
||||
VER=$(shell perl -e '$$_=<>;print m/\((.*?)\)/'<debian/changelog)
|
||||
|
||||
all:: extra_build
|
||||
clean:: extra_build
|
||||
install:: extra_install
|
||||
pure_install:: extra_install
|
||||
|
||||
extra_build:
|
||||
perl -i -pe "s/\@version\@/$(VER)/g" <alien.lsm.in >alien.lsm
|
||||
perl -i -pe "s/\@version\@/$(VER)/g" <alien.spec.in >alien.spec
|
||||
@@ -39,13 +44,5 @@ alien:
|
||||
WriteMakefile(
|
||||
'NAME' => 'Alien',
|
||||
'EXE_FILES' => ['alien'],
|
||||
# Pure evil. Hook into build and install targets
|
||||
'depend' => {'all:' => 'extra_build',
|
||||
# Why build on clean? Because I want to ensure the spec file
|
||||
# gets put in the tarball, and so it has to happen in debian/rules
|
||||
# clean
|
||||
'clean:' => 'extra_build',
|
||||
'install:' => 'extra_install',
|
||||
'pure_install:' => 'extra_install'},
|
||||
'clean' => {FILES => 'alien'},
|
||||
);
|
||||
|
||||
3
README
3
README
@@ -66,7 +66,8 @@ Programs that use alien:
|
||||
package viewer that can convert between package formats by using alien. Its
|
||||
homepage is at http://www.momentus.com.br/users/hook/kpackviewer.html
|
||||
|
||||
Corel also appears to have something in Corel linux that uses alien.
|
||||
Corel also appears to have (or had) something in Corel linux that
|
||||
uses alien.
|
||||
|
||||
Please report any bugs in alien to the author:
|
||||
|
||||
|
||||
9
debian/changelog
vendored
9
debian/changelog
vendored
@@ -1,3 +1,12 @@
|
||||
alien (8.17) unstable; urgency=low
|
||||
|
||||
* When converting from rpm, do parent directory 755 chmods first, then
|
||||
known permissions setting from rpm --queryformat, so that it can override
|
||||
any directories that do indeed have a permission set.
|
||||
* Fixed MakeFile.PL to work with perl 5.8.
|
||||
|
||||
-- Joey Hess <joeyh@debian.org> Mon, 19 Aug 2002 12:49:04 -0400
|
||||
|
||||
alien (8.16) unstable; urgency=low
|
||||
|
||||
* Fixed rpm unpacking.
|
||||
|
||||
Reference in New Issue
Block a user