tons of bugfixes

This commit is contained in:
joey
2000-04-22 00:56:50 +00:00
parent d982c7357b
commit d384a93c99
5 changed files with 25 additions and 23 deletions

View File

@@ -74,7 +74,7 @@ sub install {
my $deb=shift;
system("dpkg --no-force-overwrite -i $deb") &&
die "Unable to install: $!";
die "Unable to install";
}
=item scan

View File

@@ -52,8 +52,8 @@ sub install {
my $this=shift;
my $rpm=shift;
system("rpm -ivh $ENV{RPMINSTALLOPT} $rpm") &&
die "Unable to install: $!";
system("rpm -ivh ".(exists $ENV{RPMINSTALLOPT} ? $ENV{RPMINSTALLOPT} : '').$rpm) &&
die "Unable to install";
}
=item scan
@@ -259,7 +259,7 @@ sub prep {
print OUT "\%description\n";
print OUT $this->description."\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";
print OUT "\n";
print OUT "%files\n";
print OUT $filelist;
@@ -298,14 +298,14 @@ sub build {
$rpmarch='noarch' if $this->arch eq 'all';
my $rpm=$this->name."-".$this->version."-".$this->release.".$rpmarch.rpm";
my $buildarch;
my $opts='';
if ($rpmdir) {
# Old versions of rpm toss it off in the middle of nowhere.
$rpm="$rpmdir/$rpmarch/$rpm";
# This is the old command line argument to make noarch
# rpms.
$buildarch="--buildarch noarch" if $rpmarch eq 'noarch';
$opts="--buildarch noarch" if $rpmarch eq 'noarch';
}
else {
# 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
# 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: $!";
return $rpm;

View File

@@ -115,7 +115,7 @@ sub install {
my $this=shift;
my $slp=shift;
system("slpi $slp") && die "Unable to install: $!";
system("slpi $slp") && die "Unable to install";
}
=item getfooter

View File

@@ -28,7 +28,7 @@ tgz's.
=cut
use constant
scriptrans => {
scripttrans => {
postinst => 'doinst.sh',
postrm => 'delete.sh',
prerm => 'predelete.sh',
@@ -73,7 +73,7 @@ sub install {
if (-x "/sbin/installpkg") {
system("/sbin/installpkg $tgz") &&
die "Unable to install: $!";
die "Unable to install";
}
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"
@@ -183,18 +183,18 @@ sub prep {
my $dir=$this->unpacked_tree || die "The package must be unpacked first!";
my $install_made=0;
foreach my $script (keys %{scriptrans()}) {
foreach my $script (keys %{scripttrans()}) {
my $data=$this->$script();
my $out=$this->unpacked_tree."/install/".${scripttrans()}{$script};
next if ! defined $data || $data =~ m/^\s*$/;
if (!$install_made) {
mkdir $this->unpacked_tree."/install", 0755;
$install_made=1;
}
open (OUT, ">".$this->unpacked_tree."/install/$script") ||
die $this->unpacked_tree."/install/$script: $!";
open (OUT, ">$out") || die "$out: $!";
print OUT $data;
close OUT;
chmod 0755, $this->unpacked_tree."/install/$script";
chmod 0755, $out;
}
}
@@ -208,7 +208,8 @@ sub build {
my $this=shift;
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;
}