mirror of
https://github.com/Project-OSS-Revival/alien.git
synced 2026-04-24 14:00:17 +00:00
more bugfixes
This commit is contained in:
@@ -285,7 +285,7 @@ sub prep {
|
|||||||
print OUT "Depends: \${shlibs:Depends}\n";
|
print OUT "Depends: \${shlibs:Depends}\n";
|
||||||
print OUT "Description: ".$this->summary."\n";
|
print OUT "Description: ".$this->summary."\n";
|
||||||
print OUT $this->description."\n";
|
print OUT $this->description."\n";
|
||||||
print OUT ".\n";
|
print OUT " .\n";
|
||||||
print OUT " (Converted from a .".$this->origformat." package by alien.)\n";
|
print OUT " (Converted from a .".$this->origformat." package by alien.)\n";
|
||||||
close OUT;
|
close OUT;
|
||||||
|
|
||||||
@@ -378,7 +378,7 @@ sub build {
|
|||||||
my $this=shift;
|
my $this=shift;
|
||||||
|
|
||||||
chdir $this->unpacked_tree;
|
chdir $this->unpacked_tree;
|
||||||
system("debian/rules binary") && die "package build failed: $!";
|
system("debian/rules binary >/dev/null") && die "package build failed: $!";
|
||||||
chdir "..";
|
chdir "..";
|
||||||
|
|
||||||
return $this->name."_".$this->version."-".$this->release."_".$this->arch.".deb";
|
return $this->name."_".$this->version."-".$this->release."_".$this->arch.".deb";
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ sub unpack {
|
|||||||
my $workdir=$this->unpacked_tree;
|
my $workdir=$this->unpacked_tree;
|
||||||
|
|
||||||
system ("rpm2cpio ".$this->filename." | (cd $workdir; cpio --extract --make-directories --no-absolute-filenames --preserve-modification-time) 2>/dev/null") &&
|
system ("rpm2cpio ".$this->filename." | (cd $workdir; cpio --extract --make-directories --no-absolute-filenames --preserve-modification-time) 2>/dev/null") &&
|
||||||
die "Unpacking of `".$this->filename."' failed: $!";
|
die "Unpacking of `".$this->filename."' failed";
|
||||||
|
|
||||||
# If the package is relocatable. We'd like to move it to be under
|
# If the package is relocatable. We'd like to move it to be under
|
||||||
# the $this->prefixes directory. However, it's possible that that
|
# the $this->prefixes directory. However, it's possible that that
|
||||||
@@ -215,8 +215,7 @@ sub prep {
|
|||||||
my $filelist;
|
my $filelist;
|
||||||
foreach my $fn (@{$this->filelist}) {
|
foreach my $fn (@{$this->filelist}) {
|
||||||
if ($fn =~ m:/$:) {
|
if ($fn =~ m:/$:) {
|
||||||
# a directory.
|
# a directory. Skip entirely.
|
||||||
$filelist.="%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.="%config $fn\n";
|
||||||
@@ -323,7 +322,7 @@ sub build {
|
|||||||
$opts.=" $ENV{RPMBUILDOPTS}" if exists $ENV{RPMBUILDOPTS};
|
$opts.=" $ENV{RPMBUILDOPTS}" if exists $ENV{RPMBUILDOPTS};
|
||||||
|
|
||||||
system("cd $dir; rpm $opts -bb ".$this->name."-".$this->version."-".$this->release.".spec >/dev/null") &&
|
system("cd $dir; rpm $opts -bb ".$this->name."-".$this->version."-".$this->release.".spec >/dev/null") &&
|
||||||
die "package build failed: $!";
|
die "package build failed";
|
||||||
|
|
||||||
return $rpm;
|
return $rpm;
|
||||||
}
|
}
|
||||||
@@ -391,19 +390,19 @@ sub _script_helper {
|
|||||||
}
|
}
|
||||||
sub postinst {
|
sub postinst {
|
||||||
my $this=shift;
|
my $this=shift;
|
||||||
$this->_script_helper($this, 'postinst', @_);
|
$this->_script_helper('postinst', @_);
|
||||||
}
|
}
|
||||||
sub postrm {
|
sub postrm {
|
||||||
my $this=shift;
|
my $this=shift;
|
||||||
$this->_script_helper($this, 'postrm', @_);
|
$this->_script_helper('postrm', @_);
|
||||||
}
|
}
|
||||||
sub preinst {
|
sub preinst {
|
||||||
my $this=shift;
|
my $this=shift;
|
||||||
$this->_script_helper($this, 'preinst', @_);
|
$this->_script_helper('preinst', @_);
|
||||||
}
|
}
|
||||||
sub prerm {
|
sub prerm {
|
||||||
my $this=shift;
|
my $this=shift;
|
||||||
$this->_script_helper($this, 'prerm', @_);
|
$this->_script_helper('prerm', @_);
|
||||||
}
|
}
|
||||||
|
|
||||||
=item arch
|
=item arch
|
||||||
|
|||||||
@@ -164,15 +164,19 @@ sub scan {
|
|||||||
my @filelist;
|
my @filelist;
|
||||||
# FIXME: support gzip files too!
|
# FIXME: support gzip files too!
|
||||||
foreach (`bzip2 -d < $file | tar -tf -`) {
|
foreach (`bzip2 -d < $file | tar -tf -`) {
|
||||||
|
chomp;
|
||||||
s:^\./:/:;
|
s:^\./:/:;
|
||||||
$_="/$_" unless m:^/:;
|
$_="/$_" unless m:^/:;
|
||||||
push @filelist, $_;
|
push @filelist, $_;
|
||||||
}
|
}
|
||||||
|
$this->filelist(\@filelist);
|
||||||
|
|
||||||
# TODO: read in postinst script.
|
# TODO: read in postinst script.
|
||||||
|
|
||||||
$this->distribution('Stampede');
|
$this->distribution('Stampede');
|
||||||
$this->origformat('slp');
|
$this->origformat('slp');
|
||||||
|
$this->changelogtext('');
|
||||||
|
$this->binary_info(`ls -l $file`);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -191,12 +195,10 @@ sub unpack {
|
|||||||
my $compresstype=$this->compresstype;
|
my $compresstype=$this->compresstype;
|
||||||
|
|
||||||
if ($compresstype == 0) {
|
if ($compresstype == 0) {
|
||||||
system("bzip2 -d $file | (cd ".$this->unpacked_tree."; tar xpf -") &&
|
system("bzip2 -d < $file | (cd ".$this->unpacked_tree."; tar xpf -)")
|
||||||
die "unpack failed";
|
|
||||||
}
|
}
|
||||||
elsif ($compresstype == 1) {
|
elsif ($compresstype == 1) {
|
||||||
system("cat $file | (cd ".$this->unpacked_tree."; tar zxpf -") &&
|
system("cat $file | (cd ".$this->unpacked_tree."; tar zxpf -)")
|
||||||
die "unpack failed";
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
die "package uses an unknown compression type, $compresstype (please file a bug report)";
|
die "package uses an unknown compression type, $compresstype (please file a bug report)";
|
||||||
|
|||||||
@@ -114,6 +114,8 @@ sub scan {
|
|||||||
$this->release(1);
|
$this->release(1);
|
||||||
$this->distribution("Slackware");
|
$this->distribution("Slackware");
|
||||||
$this->origformat('tgz');
|
$this->origformat('tgz');
|
||||||
|
$this->changelogtext('');
|
||||||
|
$this->binary_info(`ls -l $file`);
|
||||||
|
|
||||||
# Now figure out the conffiles. Assume anything in etc/ is a
|
# Now figure out the conffiles. Assume anything in etc/ is a
|
||||||
# conffile.
|
# conffile.
|
||||||
|
|||||||
26
alien
26
alien
@@ -263,7 +263,7 @@ GetOptions(
|
|||||||
"to-slp", sub { $destformats{slp}=1 },
|
"to-slp", sub { $destformats{slp}=1 },
|
||||||
"generate|g", \$generate,
|
"generate|g", \$generate,
|
||||||
"install|i", \$install,
|
"install|i", \$install,
|
||||||
"single|s", sub { $single=1; $generate =1 },
|
"single|s", sub { $single=1; $generate=1 },
|
||||||
"scripts|c", \$scripts,
|
"scripts|c", \$scripts,
|
||||||
"patch|p=s", \$patchfile,
|
"patch|p=s", \$patchfile,
|
||||||
"nopatch", \$nopatch,
|
"nopatch", \$nopatch,
|
||||||
@@ -348,7 +348,28 @@ foreach my $file (@ARGV) {
|
|||||||
# Mutate package into desired format.
|
# Mutate package into desired format.
|
||||||
bless($package, "Alien::Package::".ucfirst($format));
|
bless($package, "Alien::Package::".ucfirst($format));
|
||||||
|
|
||||||
|
if ($format eq 'deb' && ! $single && $generate) {
|
||||||
|
# Make .orig.tar.gz directory.
|
||||||
|
system("cp -fa ".$package->unpacked_tree." ".$package->unpacked_tree.".orig") &&
|
||||||
|
die "cp -fa failed";
|
||||||
|
}
|
||||||
|
|
||||||
$package->prep;
|
$package->prep;
|
||||||
|
|
||||||
|
# If generating build tree only, stop here with message.
|
||||||
|
if ($generate) {
|
||||||
|
if ($format eq 'deb' && ! $single) {
|
||||||
|
print "Directories ".$package->unpacked_tree." and ".$package->unpacked_tree.".orig prepared.\n"
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
print "Directory ".$package->unpacked_tree." prepared.\n";
|
||||||
|
}
|
||||||
|
# Make sure $package does not whipe out the
|
||||||
|
# directory when it is destroyed.
|
||||||
|
$package->unpacked_tree('');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
my $newfile=$package->build;
|
my $newfile=$package->build;
|
||||||
if ($install) {
|
if ($install) {
|
||||||
$package->install($newfile);
|
$package->install($newfile);
|
||||||
@@ -365,8 +386,5 @@ foreach my $file (@ARGV) {
|
|||||||
# Note I don't unlink it. I figure that might annoy
|
# Note I don't unlink it. I figure that might annoy
|
||||||
# people, since it was an input file.
|
# people, since it was an input file.
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
print "$file already exists\n";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user