mirror of
https://github.com/Project-OSS-Revival/alien.git
synced 2026-04-24 14:00:17 +00:00
Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
574490fb79 | ||
|
|
e7e9f10486 | ||
|
|
a320ae144c | ||
|
|
f6529d9be0 | ||
|
|
38bf42863d | ||
|
|
b4bdd3818d | ||
|
|
7e84fd2a26 | ||
|
|
55edc3f59a | ||
|
|
cc5ff87ef6 | ||
|
|
e75140dc5f | ||
|
|
2f50988983 | ||
|
|
6049930109 | ||
|
|
f581595af6 | ||
|
|
72599080d2 |
@@ -331,6 +331,8 @@ package was unpacked, it is time now to wipe out the temporary directory.
|
||||
sub DESTROY {
|
||||
my $this=shift;
|
||||
|
||||
my $exitcode=$?;
|
||||
|
||||
return if (! defined $this->unpacked_tree || $this->unpacked_tree eq '');
|
||||
# This should never happen, but it pays to check.
|
||||
if ($this->unpacked_tree eq '/') {
|
||||
@@ -345,6 +347,8 @@ sub DESTROY {
|
||||
$this->do('rm', '-rf', $this->unpacked_tree)
|
||||
or die "unable to delete temporary directory '".$this->unpacked_tree."': $!";
|
||||
$this->unpacked_tree('');
|
||||
|
||||
$?=$exitcode;
|
||||
}
|
||||
|
||||
=item AUTOLOAD
|
||||
|
||||
@@ -491,10 +491,14 @@ sub build {
|
||||
|
||||
chdir $this->unpacked_tree;
|
||||
my $log=$this->runpipe(1, "debian/rules binary 2>&1");
|
||||
if ($?) {
|
||||
chdir "..";
|
||||
my $err=$?;
|
||||
if ($err) {
|
||||
if (! defined $log) {
|
||||
die "Package build failed; could not run generated debian/rules file.\n";
|
||||
}
|
||||
die "Package build failed. Here's the log:\n", $log;
|
||||
}
|
||||
chdir "..";
|
||||
|
||||
return $this->name."_".$this->version."-".$this->release."_".$this->arch.".deb";
|
||||
}
|
||||
|
||||
@@ -76,13 +76,15 @@ sub scan {
|
||||
POSTIN => 'postinst',
|
||||
PREUN => 'prerm',
|
||||
POSTUN => 'postrm',
|
||||
LICENSE => 'copyright',
|
||||
);
|
||||
|
||||
# Use --queryformat to pull out all the fields we need.
|
||||
foreach my $field (qw{NAME VERSION RELEASE ARCH CHANGELOGTEXT
|
||||
SUMMARY DESCRIPTION COPYRIGHT PREFIXES},
|
||||
SUMMARY DESCRIPTION PREFIXES},
|
||||
keys(%fieldtrans)) {
|
||||
my $value=$this->runpipe(0, "LANG=C rpm -qp --queryformat \%{$field} $file");
|
||||
next if $? || $value eq '(none)';
|
||||
my $key;
|
||||
if (exists $fieldtrans{$field}) {
|
||||
$key=$fieldtrans{$field};
|
||||
@@ -90,7 +92,6 @@ sub scan {
|
||||
else {
|
||||
$key=lc($field);
|
||||
}
|
||||
$value='' if $value eq '(none)';
|
||||
$this->$key($value);
|
||||
}
|
||||
|
||||
@@ -122,12 +123,18 @@ sub scan {
|
||||
$this->summary('Converted RPM package');
|
||||
}
|
||||
}
|
||||
unless (defined $this->copyright) {
|
||||
$this->copyright('unknown');
|
||||
}
|
||||
unless (defined $this->description) {
|
||||
$this->description($this->summary);
|
||||
}
|
||||
unless (defined $this->copyright) {
|
||||
# Older rpms have no licence tag, but have a copyright.
|
||||
$this->copyright($this->runpipe(0, "LANG=C rpm -qp --queryformat \%{COPYRIGHT} $file"));
|
||||
|
||||
# Fallback.
|
||||
if (! $this->copyright) {
|
||||
$this->copyright('unknown');
|
||||
}
|
||||
}
|
||||
if (! defined $this->release || ! defined $this->version ||
|
||||
! defined $this->name) {
|
||||
die "Error querying rpm file";
|
||||
@@ -152,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
|
||||
@@ -161,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 (<RPMLIST>) {
|
||||
chomp;
|
||||
@@ -258,15 +271,20 @@ sub unpack {
|
||||
}
|
||||
$gid=0;
|
||||
}
|
||||
if (defined($owninfo{$file}) && ($mode & 07000 > 0)) {
|
||||
if (defined($owninfo{$file}) && (($mode & 07000) > 0)) {
|
||||
$modeinfo{$file} = sprintf "%lo", $mode;
|
||||
}
|
||||
if ($> == 0) {
|
||||
$this->do("chown", "$uid:$gid", "$workdir/$file")
|
||||
|| die "failed chowning $file to $uid\:$gid\: $!";
|
||||
# Note that ghost files exist in the metadata but not
|
||||
# in the cpio archive, so check that the file exists
|
||||
# before trying to access it
|
||||
if (-e "$workdir/$file") {
|
||||
if ($> == 0) {
|
||||
$this->do("chown", "$uid:$gid", "$workdir/$file")
|
||||
|| die "failed chowning $file to $uid\:$gid\: $!";
|
||||
}
|
||||
$this->do("chmod", sprintf("%lo", $mode), "$workdir/$file")
|
||||
|| die "failed changing mode of $file to $mode\: $!";
|
||||
}
|
||||
$this->do("chmod", sprintf("%lo", $mode), "$workdir/$file")
|
||||
|| die "failed changing mode of $file to $mode\: $!";
|
||||
}
|
||||
$this->owninfo(\%owninfo);
|
||||
$this->modeinfo(\%modeinfo);
|
||||
|
||||
31
alien.pl
31
alien.pl
@@ -67,6 +67,9 @@ standard linux directory tree. Do NOT run B<alien> on tar files with source
|
||||
code in them, unless you want this source code to be installed in your root
|
||||
directory when you install the package!
|
||||
|
||||
When using B<alien> to convert a tgz package, all files in /etc in are assumed
|
||||
to be configuration files.
|
||||
|
||||
=item pkg
|
||||
|
||||
To manipulate packages in the Solaris pkg format (which is really the SV
|
||||
@@ -127,6 +130,16 @@ Like B<-g>, but do not generate the packagename.orig directory. This is only
|
||||
useful when you are very low on disk space and are generating a debian
|
||||
package.
|
||||
|
||||
=item B<-c>, B<--scripts>
|
||||
|
||||
Try to convert the scripts that are meant to be run when the
|
||||
package is installed and removed. Use this with caution, because these
|
||||
scripts might be designed to work on a system unlike your own, and could
|
||||
cause problems. It is recommended that you examine the scripts by hand
|
||||
and check to see what they do before using this option.
|
||||
|
||||
This is enabled by default when converting from lsb packages.
|
||||
|
||||
=item B<--patch=>I<patch>
|
||||
|
||||
Specify the patch to be used instead of automatically looking the patch up
|
||||
@@ -156,16 +169,6 @@ information.
|
||||
|
||||
Note that without an argument, this displays the version of B<alien> instead.
|
||||
|
||||
=item B<-c>, B<--scripts>
|
||||
|
||||
Try to convert the scripts that are meant to be run when the
|
||||
package is installed and removed. Use this with caution, because these
|
||||
scripts might be designed to work on a system unlike your own, and could
|
||||
cause problems. It is recommended that you examine the scripts by hand
|
||||
and check to see what they do before using this option.
|
||||
|
||||
This is enabled by default when converting from lsb packages.
|
||||
|
||||
=item B<-T>, B<--test>
|
||||
|
||||
Test the generated packages. Currently this is only supported for debian
|
||||
@@ -258,14 +261,6 @@ included in generated debian packages.
|
||||
|
||||
=back
|
||||
|
||||
=head1 NOTES
|
||||
|
||||
When using B<alien> to convert a tgz package, all files in /etc in are assumed
|
||||
to be configuration files.
|
||||
|
||||
If B<alien> is not run as root, the files in the generated package will have
|
||||
incorrect owners and permissions.
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
B<alien> was written by Christoph Lameter, B<<clameter@debian.org>>.
|
||||
|
||||
26
debian/changelog
vendored
26
debian/changelog
vendored
@@ -1,3 +1,29 @@
|
||||
alien (8.81) unstable; 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.)
|
||||
* Suggest lzma. If not installed, alien will still fail to decompress
|
||||
RPMs using it, but will support most rpms, which are not.
|
||||
* Fix precedence problem that prevented alien from preserving permissions
|
||||
of suid/sgid binaries that are not owned by root.
|
||||
(Patch by Duane Waddle, on a bug tracking system I don't frequent, that
|
||||
was about the "expire" it 4 days from now. We got lucky Duane, but please
|
||||
use the Debian BTS next time!)
|
||||
* Support RPMs containing ghost files.
|
||||
(Patch by Ben Webb, who would get his patches applied quicker if he
|
||||
actually communicated them to the program's author.)
|
||||
|
||||
-- Joey Hess <joeyh@debian.org> Mon, 17 May 2010 20:56:59 -0400
|
||||
|
||||
alien (8.80) unstable; urgency=low
|
||||
|
||||
* Support querying rpm LICENSE field. (Alexey Khoroshilov)
|
||||
|
||||
-- Joey Hess <joeyh@debian.org> Sun, 18 Apr 2010 15:44:52 -0400
|
||||
|
||||
alien (8.79) unstable; urgency=low
|
||||
|
||||
* Typo. Closes: #554379
|
||||
|
||||
4
debian/control
vendored
4
debian/control
vendored
@@ -3,7 +3,7 @@ Section: admin
|
||||
Priority: optional
|
||||
Build-Depends: debhelper (>= 7.0.50)
|
||||
Maintainer: Joey Hess <joeyh@debian.org>
|
||||
Standards-Version: 3.8.3
|
||||
Standards-Version: 3.8.4
|
||||
Vcs-Git: git://git.kitenet.net/alien
|
||||
Homepage: http://kitenet.net/~joey/code/alien/
|
||||
|
||||
@@ -11,7 +11,7 @@ Package: alien
|
||||
Architecture: all
|
||||
Section: admin
|
||||
Depends: debhelper (>= 3), ${misc:Depends}, ${perl:Depends}, rpm (>= 2.4.4-2), dpkg-dev, make, cpio, rpm2cpio
|
||||
Suggests: patch, bzip2, lsb-rpm, lintian
|
||||
Suggests: patch, bzip2, lsb-rpm, lintian, lzma
|
||||
Description: convert and install rpm and other packages
|
||||
Alien allows you to convert LSB, Red Hat, Stampede and Slackware Packages
|
||||
into Debian packages, which can be installed with dpkg.
|
||||
|
||||
Reference in New Issue
Block a user