diff --git a/Alien/Package/Deb.pm b/Alien/Package/Deb.pm index ed62e94..e108794 100644 --- a/Alien/Package/Deb.pm +++ b/Alien/Package/Deb.pm @@ -72,7 +72,7 @@ sub install { my $this=shift; my $deb=shift; - system("dpkg --no-force-overwrite -i $deb") == 0 + system("dpkg", "--no-force-overwrite", "-i", $deb) == 0 or die "Unable to install"; } @@ -189,7 +189,7 @@ sub unpack { my $file=$this->filename; if ($this->have_dpkg_deb) { - system("dpkg-deb -x $file ".$this->unpacked_tree) == 0 + system("dpkg-deb", "-x", $file, $this->unpacked_tree) == 0 or die "Unpacking of `$file' failed: $!"; } else { @@ -256,8 +256,8 @@ sub prep { # Look for .rej files. die "patch failed with .rej files; giving up" if `find $dir -name "*.rej"`; - system('find . -name \'*.orig\' -exec rm {} \\;'); - chmod 0755,"$dir/debian/rules"; + system('find', '.', '-name', '*.orig', '-exec', 'rm', '{}', ';'); + chmod 0755, "$dir/debian/rules"; return; } @@ -384,8 +384,10 @@ sub build { my $this=shift; chdir $this->unpacked_tree; - system("debian/rules binary >/dev/null") == 0 - or die "package build failed: $!"; + my $log=`debian/rules binary`; + if ($?) { + die "Package build failed. Here's the log:\n", $log; + } chdir ".."; return $this->name."_".$this->version."-".$this->release."_".$this->arch.".deb"; @@ -401,7 +403,7 @@ sub cleantree { my $this=shift; my $dir=$this->unpacked_tree || die "The package must be unpacked first!"; - system("rm -rf $dir/debian"); + system("rm", "-rf", "$dir/debian"); } =item package diff --git a/Alien/Package/Rpm.pm b/Alien/Package/Rpm.pm index df88b7e..975398c 100644 --- a/Alien/Package/Rpm.pm +++ b/Alien/Package/Rpm.pm @@ -352,8 +352,11 @@ sub build { } $opts.=" $ENV{RPMBUILDOPTS}" if exists $ENV{RPMBUILDOPTS}; - system("cd $dir; rpm $opts -bb ".$this->name."-".$this->version."-".$this->release.".spec >/dev/null") == 0 - or die "package build failed"; + my $command="cd $dir; rpm $opts -bb ".$this->name."-".$this->version."-".$this->release.".spec >/dev/null"; + my $log=`$command`; + if ($?) { + die "Package build failed. Here's the log:\n", $log; + } return $rpm; } diff --git a/Alien/Package/Slp.pm b/Alien/Package/Slp.pm index 88f3f78..d380dfc 100644 --- a/Alien/Package/Slp.pm +++ b/Alien/Package/Slp.pm @@ -114,7 +114,7 @@ sub install { my $this=shift; my $slp=shift; - system("slpi $slp") == 0 + system("slpi", $slp) == 0 or die "Unable to install"; } diff --git a/Alien/Package/Tgz.pm b/Alien/Package/Tgz.pm index 9f3de83..abcdedc 100644 --- a/Alien/Package/Tgz.pm +++ b/Alien/Package/Tgz.pm @@ -66,7 +66,7 @@ sub install { my $tgz=shift; if (-x "/sbin/installpkg") { - system("/sbin/installpkg $tgz") == 0 + system("/sbin/installpkg", "$tgz") == 0 or die "Unable to install"; } else { diff --git a/alien.pl b/alien.pl index 88f0c3d..5c4df77 100755 --- a/alien.pl +++ b/alien.pl @@ -364,7 +364,7 @@ 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") == 0 + system("cp", "-fa", $package->unpacked_tree, $package->unpacked_tree.".orig") == 0 or die "cp -fa failed"; } diff --git a/debian/changelog b/debian/changelog index a5301c6..6d61fbb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +alien (7.26) unstable; urgency=low + + * Moved as many system calls as I can over to shellless execution. + There are still a lot that use shell tricks. Should deal with screwey + rpms and file names better though. Closes: #105283 + * Display build logs after build failures. + + -- Joey Hess Sun, 15 Jul 2001 10:16:20 -0400 + alien (7.25) unstable; urgency=low * Treat 'armv4l' arch rpm's as arm architecture.