mirror of
https://github.com/Project-OSS-Revival/alien.git
synced 2026-04-24 14:00:17 +00:00
* Corrected return code of system check.
* Corrected logic error in relocatable rpm handling that was making
converting such rpms not work. (Closes: #71155)
This commit is contained in:
@@ -73,8 +73,8 @@ sub install {
|
||||
my $this=shift;
|
||||
my $deb=shift;
|
||||
|
||||
system("dpkg --no-force-overwrite -i $deb") &&
|
||||
die "Unable to install";
|
||||
system("dpkg --no-force-overwrite -i $deb") == 0
|
||||
or die "Unable to install";
|
||||
}
|
||||
|
||||
=item getcontrolfile
|
||||
@@ -190,12 +190,12 @@ sub unpack {
|
||||
my $file=$this->filename;
|
||||
|
||||
if ($this->have_dpkg_deb) {
|
||||
system("dpkg-deb -x $file ".$this->unpacked_tree) &&
|
||||
die "Unpacking of `$file' failed: $!";
|
||||
system("dpkg-deb -x $file ".$this->unpacked_tree) == 0
|
||||
or die "Unpacking of `$file' failed: $!";
|
||||
}
|
||||
else {
|
||||
system ("ar p $file data.tar.gz | (cd ".$this->unpacked_tree."; tar zxpf -)") &&
|
||||
die "Unpacking of `$file' failed: $!";
|
||||
system("ar p $file data.tar.gz | (cd ".$this->unpacked_tree."; tar zxpf -)") == 0
|
||||
or die "Unpacking of `$file' failed: $!";
|
||||
}
|
||||
|
||||
return 1;
|
||||
@@ -252,8 +252,8 @@ sub prep {
|
||||
if (defined $this->patchfile) {
|
||||
# The -f passed to zcat makes it pass uncompressed files
|
||||
# through without error.
|
||||
system("zcat -f ".$this->patchfile." | (cd $dir; patch -p1)") &&
|
||||
die "patch error: $!";
|
||||
system("zcat -f ".$this->patchfile." | (cd $dir; patch -p1)") == 0
|
||||
or die "patch error: $!";
|
||||
# Look for .rej files.
|
||||
die "patch failed with .rej files; giving up"
|
||||
if `find $dir -name "*.rej"`;
|
||||
@@ -379,7 +379,8 @@ sub build {
|
||||
my $this=shift;
|
||||
|
||||
chdir $this->unpacked_tree;
|
||||
system("debian/rules binary >/dev/null") && die "package build failed: $!";
|
||||
system("debian/rules binary >/dev/null") == 0
|
||||
or die "package build failed: $!";
|
||||
chdir "..";
|
||||
|
||||
return $this->name."_".$this->version."-".$this->release."_".$this->arch.".deb";
|
||||
|
||||
@@ -52,8 +52,8 @@ sub install {
|
||||
my $this=shift;
|
||||
my $rpm=shift;
|
||||
|
||||
system("rpm -ivh ".(exists $ENV{RPMINSTALLOPT} ? $ENV{RPMINSTALLOPT} : '').$rpm) &&
|
||||
die "Unable to install";
|
||||
system("rpm -ivh ".(exists $ENV{RPMINSTALLOPT} ? $ENV{RPMINSTALLOPT} : '').$rpm) == 0
|
||||
or die "Unable to install";
|
||||
}
|
||||
|
||||
=item scan
|
||||
@@ -138,8 +138,8 @@ sub unpack {
|
||||
$this->SUPER::unpack(@_);
|
||||
my $workdir=$this->unpacked_tree;
|
||||
|
||||
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";
|
||||
system("rpm2cpio ".$this->filename." | (cd $workdir; cpio --extract --make-directories --no-absolute-filenames --preserve-modification-time) 2>/dev/null") == 0
|
||||
or die "Unpacking of `".$this->filename."' failed";
|
||||
|
||||
# If the package is relocatable. We'd like to move it to be under
|
||||
# the $this->prefixes directory. However, it's possible that that
|
||||
@@ -160,13 +160,13 @@ sub unpack {
|
||||
my $collect=$workdir;
|
||||
foreach (split m:/:, $this->prefixes) {
|
||||
if ($_ ne '') { # this keeps us from using anything but relative paths.
|
||||
$collect.="$_/";
|
||||
$collect.="/$_";
|
||||
mkdir $collect,0755 || die "unable to mkdir $collect: $!";
|
||||
}
|
||||
}
|
||||
# Now move all files in the package to the directory we made.
|
||||
system "mv", @filelist, "$workdir/".$this->prefixes &&
|
||||
die "error moving unpacked files into the default prefix directory: $!";
|
||||
system("mv", @filelist, "$workdir/".$this->prefixes) == 0
|
||||
or die "error moving unpacked files into the default prefix directory: $!";
|
||||
}
|
||||
|
||||
# When cpio extracts the file, any child directories that are
|
||||
@@ -345,8 +345,8 @@ sub build {
|
||||
}
|
||||
|
||||
$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";
|
||||
system("cd $dir; rpm $opts -bb ".$this->name."-".$this->version."-".$this->release.".spec >/dev/null") == 0
|
||||
or die "package build failed";
|
||||
|
||||
return $rpm;
|
||||
}
|
||||
|
||||
@@ -115,7 +115,8 @@ sub install {
|
||||
my $this=shift;
|
||||
my $slp=shift;
|
||||
|
||||
system("slpi $slp") && die "Unable to install";
|
||||
system("slpi $slp") == 0
|
||||
or die "Unable to install";
|
||||
}
|
||||
|
||||
=item getfooter
|
||||
@@ -251,8 +252,8 @@ sub build {
|
||||
# something like that, becuase it results in a tar file where all
|
||||
# the files in it start with "./", which is consitent with how
|
||||
# normal stampede files look.
|
||||
system("(cd ".$this->unpacked_tree."; tar cf - ./*) | bzip2 - > $slp") &&
|
||||
die "package build failed: $!";
|
||||
system("(cd ".$this->unpacked_tree."; tar cf - ./*) | bzip2 - > $slp") == 0
|
||||
or die "package build failed: $!";
|
||||
|
||||
# Now append the footer.
|
||||
open (OUT,">>$slp") || die "$slp: $!";
|
||||
|
||||
@@ -67,8 +67,8 @@ sub install {
|
||||
my $tgz=shift;
|
||||
|
||||
if (-x "/sbin/installpkg") {
|
||||
system("/sbin/installpkg $tgz") &&
|
||||
die "Unable to install";
|
||||
system("/sbin/installpkg $tgz") == 0
|
||||
or 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"
|
||||
@@ -163,8 +163,8 @@ sub unpack {
|
||||
$this->SUPER::unpack(@_);
|
||||
my $file=$this->filename;
|
||||
|
||||
system("cat $file | (cd ".$this->unpacked_tree."; tar zxpf -)") &&
|
||||
die "Unpacking of `$file' failed: $!";
|
||||
system("cat $file | (cd ".$this->unpacked_tree."; tar zxpf -)") == 0
|
||||
or die "Unpacking of `$file' failed: $!";
|
||||
# Delete the install directory that has slackware info in it.
|
||||
system("cd ".$this->unpacked_tree."; rm -rf ./install");
|
||||
|
||||
@@ -207,8 +207,8 @@ sub build {
|
||||
my $this=shift;
|
||||
my $tgz=$this->name."-".$this->version.".tgz";
|
||||
|
||||
system("cd ".$this->unpacked_tree."; tar czf ../$tgz .") &&
|
||||
die "Package build failed";
|
||||
system("cd ".$this->unpacked_tree."; tar czf ../$tgz .") == 0
|
||||
or die "Package build failed";
|
||||
|
||||
return $tgz;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user