mirror of
https://github.com/Project-OSS-Revival/alien.git
synced 2026-04-24 14:00:17 +00:00
* Added a note about a sticky library dependancy issue that I can't fix.
* Applied a patch from Chris Gorman to deal with spaces in directory
names, spaces in conffile names (!!), and accented characters
everywhere in deb -> rpm conversions.
* Fixed numerous problems when converting from .deb w/o dpkg installed.
This commit is contained in:
@@ -77,6 +77,28 @@ sub install {
|
|||||||
die "Unable to install";
|
die "Unable to install";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
=item getcontrolfile
|
||||||
|
|
||||||
|
Helper method. Pass it the name of a control file, and it will pull it out
|
||||||
|
of the deb and return it.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
|
sub getcontrolfile {
|
||||||
|
my $this=shift;
|
||||||
|
my $controlfile=shift;
|
||||||
|
my $file=$this->filename;
|
||||||
|
|
||||||
|
if ($this->have_dpkg_deb) {
|
||||||
|
return `dpkg-deb --info $file $controlfile 2>/dev/null`;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
# Have to handle old debs without a leading ./ and
|
||||||
|
# new ones with it.
|
||||||
|
return `ar p $file control.tar.gz | tar Oxzf - $controlfile ./$controlfile 2>/dev/null`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
=item scan
|
=item scan
|
||||||
|
|
||||||
Implement the scan method to read a deb file.
|
Implement the scan method to read a deb file.
|
||||||
@@ -88,16 +110,7 @@ sub scan {
|
|||||||
$this->SUPER::scan(@_);
|
$this->SUPER::scan(@_);
|
||||||
my $file=$this->filename;
|
my $file=$this->filename;
|
||||||
|
|
||||||
# Extract the control file from the deb file.
|
my @control=$this->getcontrolfile('control');
|
||||||
my @control;
|
|
||||||
if ($this->have_dpkg_deb) {
|
|
||||||
@control = `dpkg-deb --info $file control`;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
# It can have one of two names, depending on the tar
|
|
||||||
# version the .deb was built from.
|
|
||||||
@control = `ar p $file control.tar.gz | tar Oxzf - control [./]control`;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Parse control file and extract fields. Use a translation table
|
# Parse control file and extract fields. Use a translation table
|
||||||
# to map between the debian names and the internal field names,
|
# to map between the debian names and the internal field names,
|
||||||
@@ -137,18 +150,11 @@ sub scan {
|
|||||||
$this->group("unknown") if ! $this->group;
|
$this->group("unknown") if ! $this->group;
|
||||||
$this->distribution("Debian");
|
$this->distribution("Debian");
|
||||||
$this->origformat("deb");
|
$this->origformat("deb");
|
||||||
$this->binary_info(scalar `dpkg --info $file`);
|
$this->binary_info(scalar $this->getcontrolfile('control'));
|
||||||
|
|
||||||
# Read in the list of conffiles, if any.
|
# Read in the list of conffiles, if any.
|
||||||
my @conffiles;
|
my @conffiles;
|
||||||
if ($this->have_dpkg_deb) {
|
@conffiles=map { chomp; $_ } $this->getcontrolfile('conffiles');
|
||||||
@conffiles=map { chomp; $_ }
|
|
||||||
`dpkg-deb --info $file conffiles 2>/dev/null`;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
@conffiles=map { chomp; $_ }
|
|
||||||
`ar p $file control.tar.gz | tar Oxzf - conffiles 2>/dev/null`;
|
|
||||||
}
|
|
||||||
$this->conffiles(\@conffiles);
|
$this->conffiles(\@conffiles);
|
||||||
|
|
||||||
# Read in the list of all files.
|
# Read in the list of all files.
|
||||||
@@ -166,12 +172,7 @@ sub scan {
|
|||||||
|
|
||||||
# Read in the scripts, if any.
|
# Read in the scripts, if any.
|
||||||
foreach my $field (qw{postinst postrm preinst prerm}) {
|
foreach my $field (qw{postinst postrm preinst prerm}) {
|
||||||
if ($this->have_dpkg_deb) {
|
$this->$field(scalar $this->getcontrolfile($field));
|
||||||
$this->$field(scalar `dpkg-deb --info $file $field 2>/dev/null`);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$this->$field(scalar `ar p $file control.tar.gz | tar Oxzf - $field 2>/dev/null`);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
@@ -219,14 +219,21 @@ sub prep {
|
|||||||
my @conffiles = @{$this->conffiles};
|
my @conffiles = @{$this->conffiles};
|
||||||
my $filelist;
|
my $filelist;
|
||||||
foreach my $fn (@{$this->filelist}) {
|
foreach my $fn (@{$this->filelist}) {
|
||||||
|
# Unquote any escaped characters in filenames - needed for
|
||||||
|
# non ascii characters. (eg. iso_8859-1 latin set)
|
||||||
|
if ($fn =~ /\\/) {
|
||||||
|
$fn=eval qq{"$fn"};
|
||||||
|
}
|
||||||
|
|
||||||
|
# Note all filenames are quoted in case they contain
|
||||||
|
# spaces.
|
||||||
if ($fn =~ m:/$:) {
|
if ($fn =~ m:/$:) {
|
||||||
$filelist.="%dir $fn\n";
|
$filelist.=qq{%dir "$fn"\n};
|
||||||
}
|
}
|
||||||
elsif (grep(m:^\Q$fn\E$:,@conffiles)) { # it's a conffile
|
elsif (grep(m:^\Q$fn\E$:,@conffiles)) { # it's a conffile
|
||||||
$filelist.="%config $fn\n";
|
$filelist.=qq{%config "$fn"\n};
|
||||||
}
|
}
|
||||||
else { # normal file
|
else { # normal file
|
||||||
# Quote filename in case it has spaces in it.
|
|
||||||
$filelist.=qq{"$fn"\n};
|
$filelist.=qq{"$fn"\n};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
13
README
13
README
@@ -41,6 +41,19 @@ Other things you'll need:
|
|||||||
The Stampede version is at
|
The Stampede version is at
|
||||||
ftp://ykbsb2.yk.psu.edu/pub/alien/alien-extra.slp
|
ftp://ykbsb2.yk.psu.edu/pub/alien/alien-extra.slp
|
||||||
|
|
||||||
|
Note:
|
||||||
|
|
||||||
|
Alien is really designed to be used to convert from alien file formats to
|
||||||
|
the packaging format used by the distribution you run it on. Of course,
|
||||||
|
it can also convert from your distribution's native format to alien
|
||||||
|
formats, or from one alien format to another. Do be warned though, that
|
||||||
|
if these latter types of conversions are done, the generated packages may
|
||||||
|
have incorrect dependancy information. This is known to be true if you
|
||||||
|
convert a rpm into a deb on a Red Hat system, for example. Even with
|
||||||
|
alien-extra installed, dpkg will be unable to properly calculate library
|
||||||
|
dependancies for the deb it is creating, and you will get a package
|
||||||
|
without any library dependancies.
|
||||||
|
|
||||||
Programs that use alien:
|
Programs that use alien:
|
||||||
|
|
||||||
I know of one program that acts as a frontend to alien - kpackviewer is a
|
I know of one program that acts as a frontend to alien - kpackviewer is a
|
||||||
|
|||||||
10
debian/changelog
vendored
10
debian/changelog
vendored
@@ -1,3 +1,13 @@
|
|||||||
|
alien (7.6) unstable; urgency=low
|
||||||
|
|
||||||
|
* Added a note about a sticky library dependancy issue that I can't fix.
|
||||||
|
* Applied a patch from Chris Gorman to deal with spaces in directory
|
||||||
|
names, spaces in conffile names (!!), and accented characters
|
||||||
|
everywhere in deb -> rpm conversions.
|
||||||
|
* Fixed numerous problems when converting from .deb w/o dpkg installed.
|
||||||
|
|
||||||
|
-- Joey Hess <joeyh@debian.org> Thu, 20 Jul 2000 15:12:08 -0700
|
||||||
|
|
||||||
alien (7.5) unstable; urgency=low
|
alien (7.5) unstable; urgency=low
|
||||||
|
|
||||||
* Fixed an uninitialized value when converting from a .src.rpm.
|
* Fixed an uninitialized value when converting from a .src.rpm.
|
||||||
|
|||||||
Reference in New Issue
Block a user