[SCM] Debian package checker branch, master, updated. 2.3.0-15-g8b74548
The following commit has been merged in the master branch:
commit 170840f3938a7a190d126db37afb0a484386df14
Author: Raphael Geissert <atomo64@gmail.com>
Date: Thu Sep 3 12:51:36 2009 -0500
Replace the unpack-level 2 level with the unpacked collection script
This obsoletes most of the unpack-level infrastructure, and the
removal of the remainings of the unpack-level concept should go away
soon.
diff --git a/checks/cruft.desc b/checks/cruft.desc
index 5903841..fe7aedd 100644
--- a/checks/cruft.desc
+++ b/checks/cruft.desc
@@ -2,9 +2,9 @@ Check-Script: cruft
Author: Sean 'Shaleh' Perry <shaleh@debian.org>
Abbrev: deb
Type: source
-Unpack-Level: 2
+Unpack-Level: 1
Info: This looks for cruft in Debian packaging or upstream source
-Needs-Info: debfiles, diffstat, file-info
+Needs-Info: unpacked, debfiles, diffstat, file-info
Tag: native-package-with-dash-version
Severity: normal
diff --git a/checks/deb-format.desc b/checks/deb-format.desc
index dd0ad04..af07371 100644
--- a/checks/deb-format.desc
+++ b/checks/deb-format.desc
@@ -2,7 +2,8 @@ Check-Script: deb-format
Author: Russ Allbery <rra@debian.org>
Abbrev: dfmt
Type: binary, udeb
-Unpack-Level: 2
+Unpack-Level: 1
+Needs-Info: unpacked
Info: This script checks the format of the deb ar archive itself.
Tag: malformed-deb-archive
diff --git a/checks/debconf.desc b/checks/debconf.desc
index 072cdd3..b02a919 100644
--- a/checks/debconf.desc
+++ b/checks/debconf.desc
@@ -2,9 +2,9 @@ Check-Script: debconf
Author: Colin Watson <cjwatson@debian.org>
Abbrev: dc
Type: binary, udeb, source
-Unpack-Level: 2
+Unpack-Level: 1
Info: This looks for common mistakes in packages using debconf.
-Needs-Info: scripts
+Needs-Info: unpacked, scripts
Tag: missing-debconf-dependency
Severity: normal
diff --git a/checks/files.desc b/checks/files.desc
index 6ac96a4..5337f04 100644
--- a/checks/files.desc
+++ b/checks/files.desc
@@ -2,8 +2,8 @@ Check-Script: files
Author: Christian Schwarz <schwarz@debian.org>
Abbrev: fil
Type: binary, udeb
-Unpack-Level: 2
-Needs-Info: objdump-info, scripts, file-info
+Unpack-Level: 1
+Needs-Info: unpacked, objdump-info, scripts, file-info
Info: This script checks if a binary package conforms to policy
WRT to files and directories.
diff --git a/checks/huge-usr-share.desc b/checks/huge-usr-share.desc
index 35d09ec..b23dc62 100644
--- a/checks/huge-usr-share.desc
+++ b/checks/huge-usr-share.desc
@@ -2,7 +2,8 @@ Check-Script: huge-usr-share
Author: Jeroen van Wolffelaar <jeroen@wolffelaar.nl>
Abbrev: hus
Type: binary
-Unpack-Level: 2
+Unpack-Level: 1
+Needs-Info: unpacked
Info: This script checks whether an architecture-dependent package has
large amounts of data in /usr/share.
diff --git a/checks/infofiles.desc b/checks/infofiles.desc
index 79fd436..f182beb 100644
--- a/checks/infofiles.desc
+++ b/checks/infofiles.desc
@@ -2,8 +2,8 @@ Check-Script: infofiles
Author: Josip Rodin <jrodin@jagor.srce.hr>
Abbrev: info
Type: binary
-Unpack-Level: 2
-Needs-Info: file-info
+Unpack-Level: 1
+Needs-Info: unpacked, file-info
Info: This script checks if a binary package conforms to info document policy.
Tag: info-document-not-compressed
diff --git a/checks/manpages.desc b/checks/manpages.desc
index e3b93cb..69261c2 100644
--- a/checks/manpages.desc
+++ b/checks/manpages.desc
@@ -2,8 +2,8 @@ Check-Script: manpages
Author: Christian Schwarz <schwarz@debian.org>
Abbrev: man
Type: binary
-Unpack-Level: 2
-Needs-Info: file-info
+Unpack-Level: 1
+Needs-Info: unpacked, file-info
Info: This script checks if a binary package conforms to manual page policy.
Tag: bad-link-to-undocumented-manpage
diff --git a/checks/menu-format.desc b/checks/menu-format.desc
index 95d5874..8b575e2 100644
--- a/checks/menu-format.desc
+++ b/checks/menu-format.desc
@@ -1,9 +1,9 @@
Check-Script: menu-format
Author: Joey Hess <joeyh@master.debian.org>
Abbrev: mnf
-Needs-Info: menu-files
+Needs-Info: unpacked, menu-files
Type: binary
-Unpack-Level: 2
+Unpack-Level: 1
Info: This script validates the format of menu files.
Tag: old-format-menu-file
diff --git a/checks/scripts.desc b/checks/scripts.desc
index be80188..9d6ec21 100644
--- a/checks/scripts.desc
+++ b/checks/scripts.desc
@@ -2,9 +2,9 @@ Check-Script: scripts
Author: Richard Braakman <dark@xs4all.nl>
Abbrev: scr
Type: binary
-Unpack-Level: 2
+Unpack-Level: 1
Info: This script checks the #! lines of scripts in a package.
-Needs-Info: file-info, scripts
+Needs-Info: unpacked, file-info, scripts
Tag: script-without-interpreter
Severity: important
diff --git a/checks/shared-libs.desc b/checks/shared-libs.desc
index 01fecd0..46c5169 100644
--- a/checks/shared-libs.desc
+++ b/checks/shared-libs.desc
@@ -2,8 +2,8 @@ Check-Script: shared-libs
Author: Christian Schwarz <schwarz@debian.org>
Abbrev: shl
Type: binary, udeb
-Unpack-Level: 2
-Needs-Info: file-info, objdump-info
+Unpack-Level: 1
+Needs-Info: unpacked, file-info, objdump-info
Info: This script checks if a binary package conforms to shared library policy.
Tag: shlib-with-executable-bit
diff --git a/collection/changelog-file.desc b/collection/changelog-file.desc
index 66af738..3e8499f 100644
--- a/collection/changelog-file.desc
+++ b/collection/changelog-file.desc
@@ -4,6 +4,7 @@ Info: This script copies the <tt>changelog</tt> file and
<tt>NEWS.Debian</tt> file (if any) of a package into the lintian
directory.
Type: binary
-Unpack-Level: 2
+Unpack-Level: 1
Version: 1
Order: 1
+Needs-Info: unpacked
diff --git a/collection/copyright-file.desc b/collection/copyright-file.desc
index 47ed372..70fe48f 100644
--- a/collection/copyright-file.desc
+++ b/collection/copyright-file.desc
@@ -3,6 +3,7 @@ Author: Richard Braakman <dark@xs4all.nl>
Info: This script copies the "copyright" file of a package into the
lintian directory.
Type: binary
-Unpack-Level: 2
+Unpack-Level: 1
Version: 1
Order: 1
+Needs-Info: unpacked
diff --git a/collection/debfiles.desc b/collection/debfiles.desc
index 316b542..a01028c 100644
--- a/collection/debfiles.desc
+++ b/collection/debfiles.desc
@@ -3,6 +3,7 @@ Author: Joey Hess <joeyh@debian.org>
Info: This script collects files shipped in the source of the
package.
Type: source
-Unpack-Level: 2
+Unpack-Level: 1
Version: 1
Order: 1
+Needs-Info: unpacked
diff --git a/collection/debian-readme.desc b/collection/debian-readme.desc
index af28493..437c454 100644
--- a/collection/debian-readme.desc
+++ b/collection/debian-readme.desc
@@ -2,6 +2,7 @@ Collector-Script: debian-readme
Author: Richard Braakman <dark@xs4all.nl>
Info: This script copies the 'README.Debian' file of a package into the lintian directory.
Type: binary
-Unpack-Level: 2
+Unpack-Level: 1
Version: 1
Order: 1
+Needs-Info: unpacked
diff --git a/collection/doc-base-files.desc b/collection/doc-base-files.desc
index 71fabca..c5c60d6 100644
--- a/collection/doc-base-files.desc
+++ b/collection/doc-base-files.desc
@@ -3,6 +3,7 @@ Author: Josip Rodin <jrodin@jagor.srce.hr>
Info: This script copies the contents of /usr/share/doc-base into the
lintian doc-base/ directory.
Type: binary
-Unpack-Level: 2
+Unpack-Level: 1
Version: 1
Order: 1
+Needs-Info: unpacked
diff --git a/collection/file-info.desc b/collection/file-info.desc
index 08e513e..82d99aa 100644
--- a/collection/file-info.desc
+++ b/collection/file-info.desc
@@ -2,6 +2,7 @@ Collector-Script: file-info
Author: Richard Braakman <dark@xs4all.nl>
Info: This script runs the "file" command over all files of any kind of package.
Type: binary, udeb, source
-Unpack-Level: 2
+Unpack-Level: 1
Version: 1
Order: 1
+Needs-Info: unpacked
diff --git a/collection/init.d.desc b/collection/init.d.desc
index ccc4c6c..c50b882 100644
--- a/collection/init.d.desc
+++ b/collection/init.d.desc
@@ -3,6 +3,7 @@ Author: Richard Braakman <dark@xs4all.nl>
Info: This script copies the "etc/init.d" directory into the lintian
directory.
Type: binary
-Unpack-Level: 2
+Unpack-Level: 1
Version: 1
Order: 1
+Needs-Info: unpacked
diff --git a/collection/md5sums.desc b/collection/md5sums.desc
index 4e5e52f..cc95e62 100644
--- a/collection/md5sums.desc
+++ b/collection/md5sums.desc
@@ -2,6 +2,7 @@ Collector-Script: md5sums
Author: Richard Braakman <dark@xs4all.nl>
Info: This script runs the "md5sums" over all files in a binary package.
Type: binary, udeb
-Unpack-Level: 2
+Unpack-Level: 1
Version: 1
Order: 1
+Needs-Info: unpacked
diff --git a/collection/menu-files.desc b/collection/menu-files.desc
index dfcdf6d..66c06eb 100644
--- a/collection/menu-files.desc
+++ b/collection/menu-files.desc
@@ -2,6 +2,7 @@ Collector-Script: menu-files
Author: Richard Braakman <dark@xs4all.nl>
Info: This script copies the contents of /usr/lib/menu into the lintian menu/ directory.
Type: binary
-Unpack-Level: 2
+Unpack-Level: 1
Version: 2
Order: 1
+Needs-Info: unpacked
diff --git a/collection/objdump-info.desc b/collection/objdump-info.desc
index c0b7321..0dc56fe 100644
--- a/collection/objdump-info.desc
+++ b/collection/objdump-info.desc
@@ -3,7 +3,7 @@ Author: Christian Schwarz <schwarz@debian.org>
Info: This script runs "objdump" over all binaries and object files of a
binary package.
Type: binary, udeb
-Unpack-Level: 2
+Unpack-Level: 1
Version: 1
Order: 2
-Needs-Info: file-info
+Needs-Info: file-info, unpacked
diff --git a/collection/override-file.desc b/collection/override-file.desc
index ff1e744..e1b27d2 100644
--- a/collection/override-file.desc
+++ b/collection/override-file.desc
@@ -3,6 +3,7 @@ Author: Darren Benham <gecko@debian.org>
Info: This script copies the "override" file of a package into the lintian
directory.
Type: binary, udeb, source
-Unpack-Level: 2
+Unpack-Level: 1
Version: 1
Order: 1
+Needs-Info: unpacked
diff --git a/collection/scripts.desc b/collection/scripts.desc
index 3469335..9a9eb74 100644
--- a/collection/scripts.desc
+++ b/collection/scripts.desc
@@ -6,6 +6,7 @@ Info: This script scans a binary package for scripts that start with #! and
Note that the filename might contain spaces, but the scriptpath will not,
because linux only looks at the first word when executing a script.
Type: binary, udeb
-Unpack-Level: 2
+Unpack-Level: 1
Version: 1
Order: 1
+Needs-Info: unpacked
diff --git a/collection/strings.desc b/collection/strings.desc
index 12f36d9..2857097 100644
--- a/collection/strings.desc
+++ b/collection/strings.desc
@@ -3,7 +3,7 @@ Author: Raphael Geissert <atomo64@gmail.com>
Info: This script runs the "strings" command over all files of a binary
package.
Type: binary, udeb
-Unpack-Level: 2
+Unpack-Level: 1
Version: 1
Order: 2
-Needs-Info: file-info
+Needs-Info: unpacked, file-info
diff --git a/collection/unpacked b/collection/unpacked
new file mode 100755
index 0000000..2288c41
--- /dev/null
+++ b/collection/unpacked
@@ -0,0 +1,87 @@
+#!/usr/bin/perl
+# unpacked -- lintian collector/unpack script
+#
+
+# Copyright (C) 1998 Christian Schwarz and Richard Braakman
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+use strict;
+use warnings;
+use vars qw($verbose);
+
+use lib "$ENV{'LINTIAN_ROOT'}/lib";
+use Lintian::Command qw(spawn);
+use Util;
+
+($#ARGV == 1) or fail("syntax: unpacked <package> <type>");
+
+my $pkg = shift;
+my $type = shift;
+
+print STDERR "unpacked $pkg $type\n";
+if ($type =~ m/^remove-/) {
+ print STDERR "removing $pkg 's unpacked/...";
+ print STDERR delete_dir("unpacked/"), "\n";
+ if (-d "unpacked/") {
+ fail("failed to remove unpacked directory of $pkg");
+ } else {
+ print STDERR "good, unpacked/ is gone\n";
+ }
+ exit 0;
+}
+
+if ($type eq "source") {
+ # Ignore STDOUT of the child process because older versions of
+ # dpkg-source print things out even with -q.
+ my $opts = { out => '/dev/null', err => 'unpacked-errors' };
+ unless (spawn($opts, ['dpkg-source', '-q', '-x', 'dsc', 'unpacked'])) {
+ open(ERRORS, '<', 'unpacked-errors')
+ or fail("cannot open unpacked-errors: $!");
+ print STDERR while <ERRORS>;
+ close ERRORS;
+ fail("dpkg-source -x failed with status ", $opts->{harness}->result);
+ }
+
+ # fix permissions
+ spawn({ fail => 'error' },
+ ['chmod', '-R', 'u+rwX,o+rX,o-w', 'unpacked']);
+
+} else {
+ mkdir("unpacked", 0777) or fail("mkdir $base_dir/unpacked: $!");
+
+ # avoid using dpkg-deb -x; this pipeline is far faster. I got a factor 2
+ # improvement on large debs, and factor 1.5 on small debs.
+ # I heard it's because dpkg-deb syncs while writing. -- Richard
+
+ my $opts = { err => "$base_dir/unpacked-errors" };
+ spawn($opts,
+ ['dpkg-deb', '--fsys-tarfile', "deb"],
+ '|', ['tar', 'xf', '-', '-C', "unpacked"]);
+ unless ($opts->{success}) {
+ open(ERRORS, '<', "$base_dir/unpacked-errors")
+ or fail("cannot open $base_dir/unpacked-errors: $!");
+ print STDERR while <ERRORS>;
+ close ERRORS;
+ fail("dpkg-deb | tar failed with status ", $opts->{harness}->result);
+ }
+
+ # fix permissions
+ spawn({ fail => 'error' },
+ ['chmod', '-R', 'u+rwX,go-w', "unpacked"]);
+}
+
diff --git a/collection/unpacked.desc b/collection/unpacked.desc
new file mode 100644
index 0000000..f57be67
--- /dev/null
+++ b/collection/unpacked.desc
@@ -0,0 +1,8 @@
+Collector-Script: unpacked
+Author: Raphael Geissert <atomo64@gmail.com>
+Info: This script unpacks the package under the unpacked/ directory
+Type: binary, udeb, source
+Unpack-Level: 1
+Version: 1
+Order: 0
+Auto-Remove: yes
diff --git a/doc/desc-files b/doc/desc-files
index 077ff45..789c7a8 100644
--- a/doc/desc-files
+++ b/doc/desc-files
@@ -3,10 +3,11 @@ Description record for collection scripts:
Collector-Script: <file name of collector script>
Info: <description of what this script does>
Type: comma-separated list of <binary | source | udeb>
- Unpack-Level: <1 | 2>
+ Unpack-Level: <1>
Version: <integer to be bumped when a change that requires script to be re-run is made>
Order: <order--necessary if this script needs info from other scripts, see Needs-Info>
Needs-Info: <info this scripts needs from other collector scripts>
+ [ Auto-Remove <yes> ]
Description record for checks scripts:
@@ -15,7 +16,7 @@ Description record for checks scripts:
Info: <description of what this check does>
Type: comma-separated list of <binary | source | udeb>
Standards-Version: <standards-version for which this check has been designed>
- Unpack-Level: <1 | 2>
+ Unpack-Level: <1>
Needs-Info: <info this script needs>
Description record of a Lintian tag:
diff --git a/frontend/lintian b/frontend/lintian
index 9951892..3019c9b 100755
--- a/frontend/lintian
+++ b/frontend/lintian
@@ -433,12 +433,6 @@ if (defined $LINTIAN_ROOT) {
$LINTIAN_ROOT = '/usr/share/lintian';
}
-# keep-lab implies unpack-level=2 unless explicetly
-# given otherwise
-if ($keep_lab and not defined $unpack_level) {
- $unpack_level = 2;
-}
-
# option --all and packages specified at the same time?
if (($check_everything or $packages_file) and $#ARGV+1 > 0) {
print STDERR "warning: options -a or -p can't be mixed with package parameters!\n";
@@ -1071,6 +1065,7 @@ for my $f (readdir COLLDIR) {
set_value($f,$p,'unpack-level',$secs[0],1);
set_value($f,$p,'order',$secs[0],1);
set_value($f,$p,'version',$secs[0],1);
+ set_value($f,$p,'auto-remove',$secs[0],0);
if (exists $secs[0]->{'needs-info'} && defined $secs[0]->{'needs-info'}) {
for (split(/\s*,\s*/o,$secs[0]->{'needs-info'})) {
@@ -1087,7 +1082,7 @@ for my $f (readdir COLLDIR) {
warning("unused tag $_ in description file $f");
}
- debug_msg(2, map( { "$_: $p->{$_}" } sort keys %$p ));
+ debug_msg(2, map( { "$_: $p->{$_}" if defined($p->{$_}) } sort keys %$p ));
}
closedir(COLLDIR);
@@ -1589,6 +1584,28 @@ foreach my $pkg_info ($schedule->get_all) {
next PACKAGE;
}
}
+ # if the package's basedir was not removed then run the
+ # auto-remove: yes collection scripts
+ if (-d "$base") {
+ chdir($base);
+ for my $coll (keys %collection_info) {
+ my $ci = $collection_info{$coll};
+ if (defined($ci->{'auto-remove'}) && $ci->{'auto-remove'} eq "yes") {
+ next if $keep_lab;
+ next unless (-f "$base/.${coll}-$ci->{'version'}");
+ my $script = "$LINTIAN_ROOT/collection/$ci->{'script'}";
+ unless (spawn({}, [ $script, $pkg, "remove-$long_type"])) {
+ warning("removing collect info $coll about package $pkg failed",
+ "skipping cleanup of $long_type package $pkg");
+ $exit_code = 2;
+ next PACKAGE;
+ }
+ unlink("$base/.${coll}-$ci->{'version'}")
+ or fail("failed to remove status file of collect info $coll about package $pkg");
+ }
+ }
+ chdir($LINTIAN_ROOT);
+ }
# create Lintian status file
if (($act_unpack_level > 0) and (not -f "$base/.lintian-status")) {
@@ -1677,19 +1694,9 @@ sub unpack_pkg {
$cur_level = 1;
}
- if ( ($new_level >= 2) and
- (not defined ($cur_level) or ($cur_level < 2)) ) {
- # unpack package contents
- debug_msg(1, "Unpacking package to level 2 ...");
- if (($type eq 'b') || ($type eq 'u')) {
- spawn({}, ["$LINTIAN_ROOT/unpack/unpack-binpkg-l2", $base])
- or return -1;
- } else {
- debug_msg(1, "$LINTIAN_ROOT/unpack/unpack-srcpkg-l2 $base");
- spawn({}, ["$LINTIAN_ROOT/unpack/unpack-srcpkg-l2", $base])
- or return -1;
- }
- $cur_level = 2;
+ if ($new_level >= 2) {
+ warning("Requested no longer existent unpack-level 2, expect errors");
+ return $cur_level;
}
return $cur_level;
diff --git a/man/lintian.1 b/man/lintian.1
index 297f3a2..7560a55 100644
--- a/man/lintian.1
+++ b/man/lintian.1
@@ -118,7 +118,7 @@ For details, see the CHECKS section below.
.TP
.BR \-u ", " \-\-unpack
Unpack the specified packages up to the current unpack level.
-The default unpack level is 1 for this option. See the UNPACK
+The default and only unpack level is 1 for this option. See the UNPACK
LEVELS section below.
.TP
@@ -420,7 +420,8 @@ source package files.
.TP
.B "2 (contents)"
-The actual package contents are unpacked as well.
+This unpack level is deprecated and no longer functional. The
+\fIunpacked\fR collection script replaced it.
.PP
Lintian will unpack packages as far as is necessary to do its checks,
diff --git a/t/scripts/unpack-level.t b/t/scripts/unpack-level.t
index 0b0abf3..981238a 100755
--- a/t/scripts/unpack-level.t
+++ b/t/scripts/unpack-level.t
@@ -25,7 +25,7 @@ use Util qw(read_dpkg_control slurp_entire_file);
# check per description.
our @DESCS = (<$ENV{LINTIAN_ROOT}/collection/*.desc>,
<$ENV{LINTIAN_ROOT}/checks/*.desc>);
-plan tests => scalar(@DESCS);
+plan tests => scalar(@DESCS) * 2;
my @l2refs = (
qr<unpacked/>,
@@ -41,23 +41,34 @@ for my $desc (@DESCS) {
if ($desc =~ m/lintian\.desc$/) {
ok(1, "lintian.desc has valid unpack-level");
+ ok(1, "lintian.desc has valid needs-info for unpack level");
next;
}
my $level = $header->{'unpack-level'};
chomp $level;
+ my $info = $header->{'needs-info'} || '';
+ chomp $info;
+ my %ninfo = map {$_ => 1} split(/\s*,\s*/, $info);
my ($file) = split(/\.desc$/, $desc);
my $code = slurp_entire_file($file);
- my $requiredlevel = 1;
+ my $requires_unpacked = 0;
for my $l2ref (@l2refs) {
if ($code =~ m/$l2ref/) {
- $requiredlevel = 2;
+ $requires_unpacked = 1;
last;
}
}
my $short = $desc;
- $short =~ s/^\Q$ENV{LINTIAN_ROOT}//;
+ $short =~ s,^\Q$ENV{LINTIAN_ROOT}\E/?,,;
- ok($level eq $requiredlevel, "$short has valid unpack-level ($level eq $requiredlevel)");
+ # it is ok that collection/unpacked doesn't depend on itself :)
+ $requires_unpacked = 0 if ($short eq 'collection/unpacked.desc');
+
+ # no script should be using unpack-level: 2 anymore
+ ok($level eq 1, "$short has valid unpack-level");
+
+ ok($requires_unpacked? defined($ninfo{'unpacked'}) : !defined($ninfo{'unpacked'}),
+ "$short has valid needs-info for unpack level");
}
diff --git a/unpack/unpack-binpkg-l2 b/unpack/unpack-binpkg-l2
deleted file mode 100755
index 0305338..0000000
--- a/unpack/unpack-binpkg-l2
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/usr/bin/perl
-# unpack-binpkg-l2 -- lintian unpack script (binary packages level 2)
-#
-# syntax: unpack-binpkg-l <base-dir>
-
-# Copyright (C) 1998 Christian Schwarz and Richard Braakman
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, you can find it on the World Wide
-# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
-# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
-# MA 02110-1301, USA.
-
-use strict;
-use vars qw($verbose);
-
-($#ARGV == 0) or fail("syntax: unpack-binpkg-l2 <base-dir>");
-my $base_dir = shift;
-
-use lib "$ENV{'LINTIAN_ROOT'}/lib";
-use Lintian::Command qw(spawn);
-use Util;
-
-print "N: Unpacking binary packages in directory $base_dir ...\n" if $verbose;
-mkdir("$base_dir/unpacked", 0777) or fail("mkdir $base_dir/unpacked: $!");
-
-# avoid using dpkg-deb -x; this pipeline is far faster. I got a factor 2
-# improvement on large debs, and factor 1.5 on small debs. I heard it's
-# because dpkg-deb syncs while writing. -- Richard
-my $opts = { err => "$base_dir/unpacked-errors" };
-spawn($opts,
- ['dpkg-deb', '--fsys-tarfile', "$base_dir/deb"],
- '|', ['tar', 'xf', '-', '-C', "$base_dir/unpacked"]);
-unless ($opts->{success}) {
- open(ERRORS, '<', "$base_dir/unpacked-errors")
- or fail("cannot open $base_dir/unpacked-errors: $!");
- print STDERR while <ERRORS>;
- close ERRORS;
- fail("dpkg-deb | tar failed with status ", $opts->{harness}->result);
-}
-
-# fix permissions
-spawn({ fail => 'error' },
- ['chmod', '-R', 'u+rwX,go-w', "$base_dir/unpacked"]);
diff --git a/unpack/unpack-srcpkg-l2 b/unpack/unpack-srcpkg-l2
deleted file mode 100755
index dbd571b..0000000
--- a/unpack/unpack-srcpkg-l2
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/usr/bin/perl
-# unpack-srcpkg-l2 -- lintian unpack script (source packages level 2)
-#
-# syntax: unpack-srcpkg-l2 <base-dir>
-
-# Copyright (C) 1998 Christian Schwarz and Richard Braakman
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, you can find it on the World Wide
-# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
-# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
-# MA 02110-1301, USA.
-
-use strict;
-use vars qw($verbose);
-
-use lib "$ENV{'LINTIAN_ROOT'}/lib";
-use Lintian::Command qw(spawn);
-use Util;
-
-($#ARGV == 0) or fail("syntax: unpack-srcpkg-l2 <base-dir>");
-my $base_dir = shift;
-
-print "N: Unpacking source package in directory $base_dir ...\n" if $verbose;
-chdir($base_dir);
-
-# Ignore STDOUT of the child process because older versions of dpkg-source
-# print things out even with -q.
-my $opts = { out => '/dev/null', err => 'unpacked-errors' };
-unless (spawn($opts, ['dpkg-source', '-q', '-x', 'dsc', 'unpacked'])) {
- open(ERRORS, '<', 'unpacked-errors')
- or fail("cannot open unpacked-errors: $!");
- print STDERR while <ERRORS>;
- close ERRORS;
- fail("dpkg-source -x failed with status ", $opts->{harness}->result);
-}
-
-# fix permissions
-spawn({ fail => 'error' },
- ['chmod', '-R', 'u+rwX,o+rX,o-w', 'unpacked']);
-
-# Local Variables:
-# indent-tabs-mode: nil
-# cperl-indent-level: 4
-# End:
-# vim: syntax=perl sw=4 sts=4 ts=4 et shiftround
--
Debian package checker
Reply to: