[SCM] Debian package checker branch, master, updated. 2.0.0-29-gac85d00
The following commit has been merged in the master branch:
commit 0767041358f434f6d8444da0602d7ded8958c412
Author: Frank Lichtenheld <djpig@debian.org>
Date: Wed Oct 8 20:52:20 2008 +0200
Migrate lib/* from Pipeline to Lintian::Command
diff --git a/lib/Dep.pm b/lib/Dep.pm
index ef3bd94..8119324 100644
--- a/lib/Dep.pm
+++ b/lib/Dep.pm
@@ -16,12 +16,12 @@
# "packagename (=version)", or if it has a Provides line, as
# "packagename (=version) | provide1 | provide2 | provide3".
+package Dep;
+
use strict;
use lib "$ENV{'LINTIAN_ROOT'}/lib";
-use Pipeline;
-
-package Dep;
+use Lintian::Command qw(spawn);
# ---------------------------------
# public routines
@@ -531,7 +531,7 @@ sub versions_gt {
}
sub get_version_cmp {
- return ::spawn('dpkg', '--compare-versions', @_) == 0;
+ return spawn(undef, ['dpkg', '--compare-versions', @_]);
}
# ---------------------------------
diff --git a/lib/Lab.pm b/lib/Lab.pm
index c854885..8bf8184 100644
--- a/lib/Lab.pm
+++ b/lib/Lab.pm
@@ -22,9 +22,9 @@
package Lab;
use strict;
-use Pipeline;
use Util;
use Lintian::Output qw(:messages);
+use Lintian::Command qw(spawn);
use File::Temp;
@@ -142,15 +142,15 @@ sub populate_with_dist {
my $v = $Lintian::Output::GLOBAL->verbose ? '-v' : '';
- spawn("$LINTIAN_ROOT/unpack/list-binpkg",
- "$self->{dir}/info/binary-packages", $v) == 0
- or fail("cannot create binary package list");
- spawn("$LINTIAN_ROOT/unpack/list-srcpkg",
- "$self->{dir}/info/source-packages", $v) == 0
- or fail("cannot create source package list");
- spawn("$LINTIAN_ROOT/unpack/list-udebpkg",
- "$self->{dir}/info/udeb-packages", $v) == 0
- or fail("cannot create udeb package list");
+ spawn(undef, ["$LINTIAN_ROOT/unpack/list-binpkg",
+ "$self->{dir}/info/binary-packages", $v])
+ or fail("cannot create binary package list");
+ spawn(undef, ["$LINTIAN_ROOT/unpack/list-srcpkg",
+ "$self->{dir}/info/source-packages", $v])
+ or fail("cannot create source package list");
+ spawn(undef, ["$LINTIAN_ROOT/unpack/list-udebpkg",
+ "$self->{dir}/info/udeb-packages", $v])
+ or fail("cannot create udeb package list");
return 1;
}
@@ -214,11 +214,11 @@ sub delete_force {
}
# looks ok.
- if (spawn('rm', '-rf', '--',
- "$self->{dir}/binary",
- "$self->{dir}/source",
- "$self->{dir}/udeb",
- "$self->{dir}/info") != 0) {
+ unless (spawn(undef, ['rm', '-rf', '--',
+ "$self->{dir}/binary",
+ "$self->{dir}/source",
+ "$self->{dir}/udeb",
+ "$self->{dir}/info"])) {
warning("cannot remove lab directory $self->{dir} (please remove it yourself)");
}
diff --git a/lib/Util.pm b/lib/Util.pm
index f5a6866..0b8f91d 100644
--- a/lib/Util.pm
+++ b/lib/Util.pm
@@ -36,7 +36,7 @@ our @EXPORT = qw(parse_dpkg_control
perm2oct);
use FileHandle;
-use Pipeline;
+use Lintian::Command qw(spawn);
use Lintian::Output qw(string);
use Digest::MD5;
@@ -138,13 +138,13 @@ sub get_deb_info {
}
# `dpkg-deb -f $file' is very slow. Instead, we use ar and tar.
- my $CONTROL = FileHandle->new;
- pipeline_open($CONTROL,
- (sub { exec 'ar', 'p', $file, 'control.tar.gz' }),
- (sub { exec 'tar', '--wildcards', '-xzO', '-f', '-', '*control' }))
- or fail("cannot fork to unpack $file: $!\n");
- my @data = parse_dpkg_control($CONTROL);
- close($CONTROL) or fail("broken input pipe for unpacking $file: $!");
+ my $opts = { pipe_out => FileHandle->new };
+ spawn($opts,
+ ['ar', 'p', $file, 'control.tar.gz'],
+ '|', ['tar', '--wildcards', '-xzO', '-f', '-', '*control'])
+ or fail("cannot fork to unpack $file: $opts->{exception}\n");
+ my @data = parse_dpkg_control($opts->{pipe_out});
+ $opts->{harness}->finish();
return $data[0];
}
--
Debian package checker
Reply to: