* 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.
This commit is contained in:
joey
2001-07-15 14:23:13 +00:00
parent 208a920b24
commit 97355db858
6 changed files with 26 additions and 12 deletions

View File

@@ -72,7 +72,7 @@ sub install {
my $this=shift; my $this=shift;
my $deb=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"; or die "Unable to install";
} }
@@ -189,7 +189,7 @@ sub unpack {
my $file=$this->filename; my $file=$this->filename;
if ($this->have_dpkg_deb) { 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: $!"; or die "Unpacking of `$file' failed: $!";
} }
else { else {
@@ -256,7 +256,7 @@ sub prep {
# Look for .rej files. # Look for .rej files.
die "patch failed with .rej files; giving up" die "patch failed with .rej files; giving up"
if `find $dir -name "*.rej"`; if `find $dir -name "*.rej"`;
system('find . -name \'*.orig\' -exec rm {} \\;'); system('find', '.', '-name', '*.orig', '-exec', 'rm', '{}', ';');
chmod 0755, "$dir/debian/rules"; chmod 0755, "$dir/debian/rules";
return; return;
} }
@@ -384,8 +384,10 @@ sub build {
my $this=shift; my $this=shift;
chdir $this->unpacked_tree; chdir $this->unpacked_tree;
system("debian/rules binary >/dev/null") == 0 my $log=`debian/rules binary`;
or die "package build failed: $!"; if ($?) {
die "Package build failed. Here's the log:\n", $log;
}
chdir ".."; chdir "..";
return $this->name."_".$this->version."-".$this->release."_".$this->arch.".deb"; return $this->name."_".$this->version."-".$this->release."_".$this->arch.".deb";
@@ -401,7 +403,7 @@ sub cleantree {
my $this=shift; my $this=shift;
my $dir=$this->unpacked_tree || die "The package must be unpacked first!"; my $dir=$this->unpacked_tree || die "The package must be unpacked first!";
system("rm -rf $dir/debian"); system("rm", "-rf", "$dir/debian");
} }
=item package =item package

View File

@@ -352,8 +352,11 @@ sub build {
} }
$opts.=" $ENV{RPMBUILDOPTS}" if exists $ENV{RPMBUILDOPTS}; $opts.=" $ENV{RPMBUILDOPTS}" if exists $ENV{RPMBUILDOPTS};
system("cd $dir; rpm $opts -bb ".$this->name."-".$this->version."-".$this->release.".spec >/dev/null") == 0 my $command="cd $dir; rpm $opts -bb ".$this->name."-".$this->version."-".$this->release.".spec >/dev/null";
or die "package build failed"; my $log=`$command`;
if ($?) {
die "Package build failed. Here's the log:\n", $log;
}
return $rpm; return $rpm;
} }

View File

@@ -114,7 +114,7 @@ sub install {
my $this=shift; my $this=shift;
my $slp=shift; my $slp=shift;
system("slpi $slp") == 0 system("slpi", $slp) == 0
or die "Unable to install"; or die "Unable to install";
} }

View File

@@ -66,7 +66,7 @@ sub install {
my $tgz=shift; my $tgz=shift;
if (-x "/sbin/installpkg") { if (-x "/sbin/installpkg") {
system("/sbin/installpkg $tgz") == 0 system("/sbin/installpkg", "$tgz") == 0
or die "Unable to install"; or die "Unable to install";
} }
else { else {

View File

@@ -364,7 +364,7 @@ foreach my $file (@ARGV) {
# Make .orig.tar.gz directory? # Make .orig.tar.gz directory?
if ($format eq 'deb' && ! $single && $generate) { if ($format eq 'deb' && ! $single && $generate) {
# Make .orig.tar.gz directory. # 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"; or die "cp -fa failed";
} }

9
debian/changelog vendored
View File

@@ -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 <joeyh@debian.org> Sun, 15 Jul 2001 10:16:20 -0400
alien (7.25) unstable; urgency=low alien (7.25) unstable; urgency=low
* Treat 'armv4l' arch rpm's as arm architecture. * Treat 'armv4l' arch rpm's as arm architecture.