mirror of
https://github.com/Project-OSS-Revival/alien.git
synced 2026-04-24 14:00:17 +00:00
tons of bugfixes
This commit is contained in:
@@ -74,7 +74,7 @@ sub install {
|
|||||||
my $deb=shift;
|
my $deb=shift;
|
||||||
|
|
||||||
system("dpkg --no-force-overwrite -i $deb") &&
|
system("dpkg --no-force-overwrite -i $deb") &&
|
||||||
die "Unable to install: $!";
|
die "Unable to install";
|
||||||
}
|
}
|
||||||
|
|
||||||
=item scan
|
=item scan
|
||||||
|
|||||||
@@ -52,8 +52,8 @@ sub install {
|
|||||||
my $this=shift;
|
my $this=shift;
|
||||||
my $rpm=shift;
|
my $rpm=shift;
|
||||||
|
|
||||||
system("rpm -ivh $ENV{RPMINSTALLOPT} $rpm") &&
|
system("rpm -ivh ".(exists $ENV{RPMINSTALLOPT} ? $ENV{RPMINSTALLOPT} : '').$rpm) &&
|
||||||
die "Unable to install: $!";
|
die "Unable to install";
|
||||||
}
|
}
|
||||||
|
|
||||||
=item scan
|
=item scan
|
||||||
@@ -298,14 +298,14 @@ sub build {
|
|||||||
$rpmarch='noarch' if $this->arch eq 'all';
|
$rpmarch='noarch' if $this->arch eq 'all';
|
||||||
|
|
||||||
my $rpm=$this->name."-".$this->version."-".$this->release.".$rpmarch.rpm";
|
my $rpm=$this->name."-".$this->version."-".$this->release.".$rpmarch.rpm";
|
||||||
my $buildarch;
|
my $opts='';
|
||||||
if ($rpmdir) {
|
if ($rpmdir) {
|
||||||
# Old versions of rpm toss it off in the middle of nowhere.
|
# Old versions of rpm toss it off in the middle of nowhere.
|
||||||
$rpm="$rpmdir/$rpmarch/$rpm";
|
$rpm="$rpmdir/$rpmarch/$rpm";
|
||||||
|
|
||||||
# This is the old command line argument to make noarch
|
# This is the old command line argument to make noarch
|
||||||
# rpms.
|
# rpms.
|
||||||
$buildarch="--buildarch noarch" if $rpmarch eq 'noarch';
|
$opts="--buildarch noarch" if $rpmarch eq 'noarch';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
# Presumably we're delaing with rpm 3.0 or above, which
|
# Presumably we're delaing with rpm 3.0 or above, which
|
||||||
@@ -317,10 +317,12 @@ sub build {
|
|||||||
|
|
||||||
# This is the new command line arcgument to make noarch
|
# This is the new command line arcgument to make noarch
|
||||||
# rpms. It appeared in rpm version 3.
|
# rpms. It appeared in rpm version 3.
|
||||||
$buildarch="--target noarch" if $rpmarch eq 'noarch';
|
$opts="--target noarch" if $rpmarch eq 'noarch';
|
||||||
}
|
}
|
||||||
|
|
||||||
system("cd $dir; rpm $buildarch -bb $ENV{RPMBUILDOPT} ".$this->name."-".$this->version."-".$this->release.".spec") &&
|
$opts.=" $ENV{RPMBUILDOPTS}" if exists $ENV{RPMBUILDOPTS};
|
||||||
|
|
||||||
|
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;
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ sub install {
|
|||||||
my $this=shift;
|
my $this=shift;
|
||||||
my $slp=shift;
|
my $slp=shift;
|
||||||
|
|
||||||
system("slpi $slp") && die "Unable to install: $!";
|
system("slpi $slp") && die "Unable to install";
|
||||||
}
|
}
|
||||||
|
|
||||||
=item getfooter
|
=item getfooter
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ tgz's.
|
|||||||
=cut
|
=cut
|
||||||
|
|
||||||
use constant
|
use constant
|
||||||
scriptrans => {
|
scripttrans => {
|
||||||
postinst => 'doinst.sh',
|
postinst => 'doinst.sh',
|
||||||
postrm => 'delete.sh',
|
postrm => 'delete.sh',
|
||||||
prerm => 'predelete.sh',
|
prerm => 'predelete.sh',
|
||||||
@@ -73,7 +73,7 @@ sub install {
|
|||||||
|
|
||||||
if (-x "/sbin/installpkg") {
|
if (-x "/sbin/installpkg") {
|
||||||
system("/sbin/installpkg $tgz") &&
|
system("/sbin/installpkg $tgz") &&
|
||||||
die "Unable to install: $!";
|
die "Unable to install";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
die "Sorry, I cannot install the generated .tgz file because /sbin/installpkg is not present. You can use tar to install it yourself.\n"
|
die "Sorry, I cannot install the generated .tgz file because /sbin/installpkg is not present. You can use tar to install it yourself.\n"
|
||||||
@@ -183,18 +183,18 @@ sub prep {
|
|||||||
my $dir=$this->unpacked_tree || die "The package must be unpacked first!";
|
my $dir=$this->unpacked_tree || die "The package must be unpacked first!";
|
||||||
|
|
||||||
my $install_made=0;
|
my $install_made=0;
|
||||||
foreach my $script (keys %{scriptrans()}) {
|
foreach my $script (keys %{scripttrans()}) {
|
||||||
my $data=$this->$script();
|
my $data=$this->$script();
|
||||||
|
my $out=$this->unpacked_tree."/install/".${scripttrans()}{$script};
|
||||||
next if ! defined $data || $data =~ m/^\s*$/;
|
next if ! defined $data || $data =~ m/^\s*$/;
|
||||||
if (!$install_made) {
|
if (!$install_made) {
|
||||||
mkdir $this->unpacked_tree."/install", 0755;
|
mkdir $this->unpacked_tree."/install", 0755;
|
||||||
$install_made=1;
|
$install_made=1;
|
||||||
}
|
}
|
||||||
open (OUT, ">".$this->unpacked_tree."/install/$script") ||
|
open (OUT, ">$out") || die "$out: $!";
|
||||||
die $this->unpacked_tree."/install/$script: $!";
|
|
||||||
print OUT $data;
|
print OUT $data;
|
||||||
close OUT;
|
close OUT;
|
||||||
chmod 0755, $this->unpacked_tree."/install/$script";
|
chmod 0755, $out;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -208,7 +208,8 @@ sub build {
|
|||||||
my $this=shift;
|
my $this=shift;
|
||||||
my $tgz=$this->name."-".$this->version.".tgz";
|
my $tgz=$this->name."-".$this->version.".tgz";
|
||||||
|
|
||||||
system("cd ".$this->unpacked_tree."; tar czf ../$tgz");
|
system("cd ".$this->unpacked_tree."; tar czf ../$tgz .") &&
|
||||||
|
die "Package build failed";
|
||||||
|
|
||||||
return $tgz;
|
return $tgz;
|
||||||
}
|
}
|
||||||
|
|||||||
13
alien
13
alien
@@ -299,8 +299,7 @@ if ($> ne 0) {
|
|||||||
die "Must run as root to convert to .deb format (or you may use fakeroot).\n";
|
die "Must run as root to convert to .deb format (or you may use fakeroot).\n";
|
||||||
}
|
}
|
||||||
print STDERR "Warning: alien is not running as root!\n";
|
print STDERR "Warning: alien is not running as root!\n";
|
||||||
print STDERR "Ownerships of files in the generated packages will\n";
|
print STDERR "Ownerships of files in the generated packages will probably be messed up.\n";
|
||||||
print STDERR "probably be messed up.\n";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach my $file (@ARGV) {
|
foreach my $file (@ARGV) {
|
||||||
@@ -318,7 +317,7 @@ foreach my $file (@ARGV) {
|
|||||||
}
|
}
|
||||||
elsif (Alien::Package::Tgz->checkfile($file)) {
|
elsif (Alien::Package::Tgz->checkfile($file)) {
|
||||||
$package=Alien::Package::Tgz->new(filename => $file);
|
$package=Alien::Package::Tgz->new(filename => $file);
|
||||||
$package->description($tgzdescription) if $tgzdescription ne '';
|
$package->description($tgzdescription) if defined $tgzdescription;
|
||||||
}
|
}
|
||||||
elsif (Alien::Package::Slp->checkfile($file)) {
|
elsif (Alien::Package::Slp->checkfile($file)) {
|
||||||
$package=Alien::Package::Slp->new(filename => $file);
|
$package=Alien::Package::Slp->new(filename => $file);
|
||||||
@@ -328,16 +327,16 @@ foreach my $file (@ARGV) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Kill scripts from the package, unless they were enabled.
|
# Kill scripts from the package, unless they were enabled.
|
||||||
unless ($scripts) {
|
unless (defined $scripts) {
|
||||||
$package->postinst('');
|
$package->postinst('');
|
||||||
$package->postrm('');
|
$package->postrm('');
|
||||||
$package->preinst('');
|
$package->preinst('');
|
||||||
$package->prerm('');
|
$package->prerm('');
|
||||||
}
|
}
|
||||||
|
|
||||||
# Increment revision.
|
# Increment release.
|
||||||
unless ($keepversion) {
|
unless (defined $keepversion) {
|
||||||
$package->revision($package->revision + 1);
|
$package->release($package->release + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach my $format (keys %destformats) {
|
foreach my $format (keys %destformats) {
|
||||||
|
|||||||
Reference in New Issue
Block a user