* 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:
joey
2000-09-11 23:27:32 +00:00
parent 76c64b4c99
commit 2e2a7060af
9 changed files with 47 additions and 33 deletions

View File

@@ -293,8 +293,8 @@ sub DESTROY {
if ($this->unpacked_tree eq '/') {
die "alien internal error: unpacked_tree is set to `/'. Please file a bug report!";
}
system ('rm', '-rf', $this->unpacked_tree) &&
die "unable to delete temporary directory `".$this->unpacked_tree."`: $!";
system('rm', '-rf', $this->unpacked_tree) == 0
or die "unable to delete temporary directory `".$this->unpacked_tree."`: $!";
$this->unpacked_tree('');
}

View File

@@ -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";

View File

@@ -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;
}

View File

@@ -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: $!";

View File

@@ -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;
}

5
README
View File

@@ -32,8 +32,9 @@ Other things you'll need:
Attention, Slackware, Red Hat, and Stampede users: Bruce S. Babcock
<babcock@math.psu.edu> has put together an "alien-extra"
package of all the extra files you need to use alien on
a Red Hat or Slackware system. (Debian systems automatically have the
a Red Hat or Slackware system. (Debian systems automatically have all
required files.)
The Slackware version is at
ftp://ykbsb2.yk.psu.edu/pub/alien/alien-extra.tgz
The RedHat version is at
@@ -60,6 +61,8 @@ Programs that use alien:
package viewer that can convert between package formats by using alien. Its
homepage is at http://www.momentus.com.br/users/hook/kpackviewer.html
Corel also appears to have something in Corel linux that uses alien.
Please report any bugs in alien to the author:
Joey Hess <joeyh@debian.org>

View File

@@ -364,8 +364,8 @@ foreach my $file (@ARGV) {
# Make .orig.tar.gz directory?
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";
system("cp -fa ".$package->unpacked_tree." ".$package->unpacked_tree.".orig") == 0
or die "cp -fa failed";
}
# See if a patch file should be used.

9
debian/changelog vendored
View File

@@ -1,3 +1,11 @@
alien (7.7) unstable; urgency=low
* Corrected return code of system check.
* Corrected logic error in relocatable rpm handling that was making
converting such rpms not work. (Closes: #71155)
-- Joey Hess <joeyh@debian.org> Mon, 11 Sep 2000 16:19:22 -0700
alien (7.6) unstable; urgency=low
* Added a note about a sticky library dependancy issue that I can't fix.
@@ -5,6 +13,7 @@ alien (7.6) unstable; urgency=low
names, spaces in conffile names (!!), and accented characters
everywhere in deb -> rpm conversions.
* Fixed numerous problems when converting from .deb w/o dpkg installed.
* Fixed "2 files on 1 line" error when converting deb -> rpm.
-- Joey Hess <joeyh@debian.org> Thu, 20 Jul 2000 15:12:08 -0700

2
debian/control vendored
View File

@@ -3,7 +3,7 @@ Section: admin
Priority: optional
Build-Depends-Indep: debhelper
Maintainer: Joey Hess <joeyh@debian.org>
Standards-Version: 3.1.1.1
Standards-Version: 3.2.1.0
Package: alien
Architecture: all