[SCM] Debian package checker branch, master, updated. 2.5.0-6-gc95ad8d
The following commit has been merged in the master branch:
commit c95ad8db7473c1876790f1ae78c7dbaf782562f6
Author: Niels Thykier <niels@thykier.net>
Date: Fri May 20 17:29:52 2011 +0200
Re-enable dpkg-source as default dsc unpacker
diff --git a/collection/unpacked b/collection/unpacked
index a98a65c..f07594d 100755
--- a/collection/unpacked
+++ b/collection/unpacked
@@ -48,7 +48,7 @@ if ($type =~ m/^remove-/) {
if ($type eq 'source') {
# Ignore STDOUT of the child process because older versions of
# dpkg-source print things out even with -q.
- if (0) {
+ if (check_path('dpkg-source')) {
my $opts = { out => '/dev/null', err => 'unpacked-errors' };
unless (spawn($opts, ['dpkg-source', '-q', '-x', 'dsc', 'unpacked'])) {
open(ERRORS, '<', 'unpacked-errors')
@@ -60,7 +60,6 @@ if ($type eq 'source') {
} else {
- print STDERR "N: Using libdpkg-perl.\n";
libdpkg_unpack_dsc ('dsc', 'unpacked');
}
@@ -101,6 +100,8 @@ sub libdpkg_unpack_dsc {
$srcpkg->check_checksums();
+ # FIXME: check signatures if present.
+
# Unpack the source package (delegated to Dpkg::Source::Package::*)
$srcpkg->extract($target);
return 1;
diff --git a/lib/Util.pm b/lib/Util.pm
index e6b48b0..63216d3 100644
--- a/lib/Util.pm
+++ b/lib/Util.pm
@@ -44,7 +44,8 @@ BEGIN {
copy_dir
gunzip_file
touch_file
- perm2oct);
+ perm2oct
+ check_path);
}
use FileHandle;
@@ -314,6 +315,24 @@ sub fail {
die $str;
}
+#check_path($command)>
+#
+#Return true if and only if $command is on the executable search path.
+#
+
+sub check_path {
+ my $command = shift;
+
+ return 0 unless exists $ENV{PATH};
+ for my $element (split ':', $ENV{PATH}) {
+ next unless length $element;
+ return 1 if -f "$element/$command" and -x _;
+ }
+ return 0;
+}
+
+
+
1;
# Local Variables:
--
Debian package checker
Reply to: