[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[SCM] Debian package checker branch, master, updated. 2.5.0-rc2-122-g12888e8



The following commit has been merged in the master branch:
commit c5d4594f24b2a976ee2a4569fb4c2c28f6396c47
Author: Niels Thykier <niels@thykier.net>
Date:   Tue Jan 11 01:28:42 2011 +0100

    Create two new collections from unpack scripts
    
    Created bin-pkg-control to extract control.tar from the deb and
    create the control/ directory plus the control-index.  Also created
    fields, which generates the fields/ directory.  Note currently
    fields skips source packages entirely, since the unpack script for
    source packages has not been updated yet.

diff --git a/checks/binaries.desc b/checks/binaries.desc
index 987f657..c904f2a 100644
--- a/checks/binaries.desc
+++ b/checks/binaries.desc
@@ -2,7 +2,7 @@ Check-Script: binaries
 Author: Christian Schwarz <schwarz@debian.org>
 Abbrev: bin
 Type: binary, udeb
-Needs-Info: objdump-info, file-info, strings
+Needs-Info: objdump-info, file-info, strings, fields
 Info: This script checks binaries and object files for bugs.
 
 Tag: arch-independent-package-contains-binary-or-object
diff --git a/checks/changelog-file.desc b/checks/changelog-file.desc
index 6da8042..5fe73fa 100644
--- a/checks/changelog-file.desc
+++ b/checks/changelog-file.desc
@@ -2,7 +2,7 @@ Check-Script: changelog-file
 Author: Christian Schwarz <schwarz@debian.org>
 Abbrev: chg
 Type: binary
-Needs-Info: file-info, changelog-file
+Needs-Info: file-info, changelog-file, fields
 Info: This script checks if a binary package conforms to policy
  with regards to changelog files.
  .
diff --git a/checks/changes-file.desc b/checks/changes-file.desc
index d0709f7..67cde0c 100644
--- a/checks/changes-file.desc
+++ b/checks/changes-file.desc
@@ -1,6 +1,7 @@
 Check-Script: changes-file
 Abbrev: chng
 Type: changes
+Needs-info: fields
 Info: This script checks for various problems with .changes files
 
 Tag: malformed-changes-file
diff --git a/checks/control-files.desc b/checks/control-files.desc
index 02b5ab4..14eadfd 100644
--- a/checks/control-files.desc
+++ b/checks/control-files.desc
@@ -3,6 +3,7 @@ Author: Christian Schwarz <schwarz@debian.org>
 Abbrev: ctl
 Type: binary, udeb
 Info: Check for unknown control files in the binary package.
+Needs-info: bin-pkg-control
 
 Tag: unknown-control-file
 Severity: normal
diff --git a/checks/copyright-file.desc b/checks/copyright-file.desc
index ab86bd8..8e1b02f 100644
--- a/checks/copyright-file.desc
+++ b/checks/copyright-file.desc
@@ -2,7 +2,7 @@ Check-Script: copyright-file
 Author: Christian Schwarz <schwarz@debian.org>
 Abbrev: cpy
 Type: binary
-Needs-Info: copyright-file
+Needs-Info: copyright-file, fields
 Info: This script checks if a binary package conforms to policy
  with regard to copyright files.
  .
diff --git a/checks/cruft.desc b/checks/cruft.desc
index cca37b2..b5b530e 100644
--- a/checks/cruft.desc
+++ b/checks/cruft.desc
@@ -3,7 +3,7 @@ Author: Sean 'Shaleh' Perry <shaleh@debian.org>
 Abbrev: deb
 Type: source
 Info: This looks for cruft in Debian packaging or upstream source
-Needs-Info: unpacked, debfiles, diffstat, file-info
+Needs-Info: unpacked, debfiles, diffstat, file-info, fields
 
 Tag: native-package-with-dash-version
 Severity: normal
diff --git a/checks/deb-format.desc b/checks/deb-format.desc
index 09bf450..f6f702a 100644
--- a/checks/deb-format.desc
+++ b/checks/deb-format.desc
@@ -2,7 +2,7 @@ Check-Script: deb-format
 Author: Russ Allbery <rra@debian.org>
 Abbrev: dfmt
 Type: binary, udeb
-Needs-Info: unpacked, changelog-file
+Needs-Info: unpacked, changelog-file, bin-pkg-control
 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 e9a6559..a9e095e 100644
--- a/checks/debconf.desc
+++ b/checks/debconf.desc
@@ -3,7 +3,7 @@ Author: Colin Watson <cjwatson@debian.org>
 Abbrev: dc
 Type: binary, udeb, source
 Info: This looks for common mistakes in packages using debconf.
-Needs-Info: debfiles, unpacked, scripts
+Needs-Info: debfiles, unpacked, scripts, fields
 
 Tag: missing-debconf-dependency
 Severity: normal
diff --git a/checks/debhelper.desc b/checks/debhelper.desc
index bf163d9..bf85117 100644
--- a/checks/debhelper.desc
+++ b/checks/debhelper.desc
@@ -3,7 +3,7 @@ Author: Joey Hess <joeyh@debian.org>
 Abbrev: dh
 Type: source
 Info: This looks for common mistakes in debhelper source packages.
-Needs-Info: debfiles, source-control-file
+Needs-Info: debfiles, source-control-file, fields
 
 Tag: maintainer-script-lacks-debhelper-token
 Severity: normal
diff --git a/checks/description.desc b/checks/description.desc
index 225c419..2caf187 100644
--- a/checks/description.desc
+++ b/checks/description.desc
@@ -2,6 +2,7 @@ Check-Script: description
 Author: Christian Schwarz <schwarz@debian.org>
 Abbrev: des
 Type: binary, udeb
+Needs-info: fields
 Info: Check if the Description control field of a binary package conforms
  to the rules in the Policy Manual (section 3.4).
 
diff --git a/checks/etcfiles.desc b/checks/etcfiles.desc
index b992bd5..237ccf9 100644
--- a/checks/etcfiles.desc
+++ b/checks/etcfiles.desc
@@ -4,6 +4,7 @@ Abbrev: etc
 Type: binary
 Info: Checks if all files in /etc that are shipped with the package are
  marked as conffiles as required by policy.
+Needs-info: bin-pkg-control
 
 Tag: file-in-etc-not-marked-as-conffile
 Severity: serious
diff --git a/checks/fields.desc b/checks/fields.desc
index 719e1da..ab71235 100644
--- a/checks/fields.desc
+++ b/checks/fields.desc
@@ -2,7 +2,7 @@ Check-Script: fields
 Author: Marc 'HE' Brockschmidt <marc@marcbrockschmidt.de>
 Abbrev: fld
 Type: binary, udeb, source
-Needs-Info: debfiles, source-control-file
+Needs-Info: debfiles, source-control-file, fields
 Info: This script checks the syntax of the fields in package control files,
  as described in the Policy Manual.
 
diff --git a/checks/files.desc b/checks/files.desc
index 5f5e97c..0a326a2 100644
--- a/checks/files.desc
+++ b/checks/files.desc
@@ -2,7 +2,7 @@ Check-Script: files
 Author: Christian Schwarz <schwarz@debian.org>
 Abbrev: fil
 Type: binary, udeb
-Needs-Info: unpacked, objdump-info, scripts, file-info
+Needs-Info: unpacked, objdump-info, scripts, file-info, fields
 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 6f0cc63..e383b8d 100644
--- a/checks/huge-usr-share.desc
+++ b/checks/huge-usr-share.desc
@@ -2,6 +2,7 @@ Check-Script: huge-usr-share
 Author: Jeroen van Wolffelaar <jeroen@wolffelaar.nl>
 Abbrev: hus
 Type: binary
+Needs-info: fields
 Info: This script checks whether an architecture-dependent package has
  large amounts of data in /usr/share.
 
diff --git a/checks/init.d.desc b/checks/init.d.desc
index f53c1b8..8e8d2e4 100644
--- a/checks/init.d.desc
+++ b/checks/init.d.desc
@@ -4,7 +4,7 @@ Abbrev: ini
 Type: binary
 Info: Check if a binary package conforms to policy with respect to
  scripts in /etc/init.d.
-Needs-Info: init.d
+Needs-Info: init.d, bin-pkg-control
 
 Tag: duplicate-updaterc.d-calls-in-postinst
 Severity: important
diff --git a/checks/md5sums.desc b/checks/md5sums.desc
index ca0e572..50f4b24 100644
--- a/checks/md5sums.desc
+++ b/checks/md5sums.desc
@@ -2,7 +2,7 @@ Check-Script: md5sums
 Author: Christian Schwarz <schwarz@debian.org>
 Abbrev: md5
 Type: binary
-Needs-Info: md5sums
+Needs-Info: md5sums, bin-pkg-control
 Info: This script checks if md5sum control files are valid, if they are
  provided by a binary package.
 
diff --git a/checks/menus.desc b/checks/menus.desc
index 3568bd0..e48ce72 100644
--- a/checks/menus.desc
+++ b/checks/menus.desc
@@ -4,7 +4,7 @@ Abbrev: men
 Type: binary
 Info: Check if a binary package conforms to policy with respect to
  <b>menu</b> and <b>doc-base</b> files.
-Needs-Info: doc-base-files
+Needs-Info: doc-base-files, bin-pkg-control
 
 Tag: postinst-should-not-set-usr-doc-link
 Severity: normal
diff --git a/checks/nmu.desc b/checks/nmu.desc
index 2ea03bb..1d8d02a 100644
--- a/checks/nmu.desc
+++ b/checks/nmu.desc
@@ -2,7 +2,7 @@ Check-Script: nmu
 Author: Jeroen van Wolffelaar <jeroen@wolffelaar.nl>
 Abbrev: nmu
 Type: source
-Needs-Info: debfiles
+Needs-Info: debfiles, fields
 Info: This script checks if a source package is consistent about its NMU-ness.
 
 Tag: orphaned-package-should-not-have-uploaders
diff --git a/checks/patch-systems.desc b/checks/patch-systems.desc
index f04a9bd..c985a8a 100644
--- a/checks/patch-systems.desc
+++ b/checks/patch-systems.desc
@@ -3,7 +3,7 @@ Author: Marc Brockschmidt <he@debian.org>
 Abbrev: pat
 Type: source
 Info: This script checks for various possible problems when using patch systems
-Needs-Info: debfiles, diffstat
+Needs-Info: debfiles, diffstat, fields
 
 Tag: dpatch-build-dep-but-no-patch-list
 Severity: normal
diff --git a/checks/rules.desc b/checks/rules.desc
index 7dd263f..06439c0 100644
--- a/checks/rules.desc
+++ b/checks/rules.desc
@@ -1,7 +1,7 @@
 Check-Script: rules
 Author: Russ Allbery <rra@debian.org>
 Type: source
-Needs-Info: debfiles, source-control-file
+Needs-Info: debfiles, source-control-file, fields
 Info: Check targets and actions in debian/rules.
 Abbrev: rul
 
diff --git a/checks/scripts.desc b/checks/scripts.desc
index 6d653d0..f6262b0 100644
--- a/checks/scripts.desc
+++ b/checks/scripts.desc
@@ -3,7 +3,7 @@ Author: Richard Braakman <dark@xs4all.nl>
 Abbrev: scr
 Type: binary
 Info: This script checks the #! lines of scripts in a package.
-Needs-Info: unpacked, file-info, scripts
+Needs-Info: unpacked, file-info, scripts, bin-pkg-control, fields
 
 Tag: script-without-interpreter
 Severity: important
diff --git a/checks/shared-libs.desc b/checks/shared-libs.desc
index f00288c..9a8169d 100644
--- a/checks/shared-libs.desc
+++ b/checks/shared-libs.desc
@@ -2,7 +2,7 @@ Check-Script: shared-libs
 Author: Christian Schwarz <schwarz@debian.org>
 Abbrev: shl
 Type: binary, udeb
-Needs-Info: unpacked, file-info, objdump-info
+Needs-Info: unpacked, file-info, objdump-info, bin-pkg-control, fields
 Info: This script checks if a binary package conforms to shared library policy.
 
 Tag: shlib-with-executable-bit
diff --git a/checks/standards-version.desc b/checks/standards-version.desc
index 1c9beed..7640f43 100644
--- a/checks/standards-version.desc
+++ b/checks/standards-version.desc
@@ -4,7 +4,7 @@ Abbrev: std
 Type: source
 Info: This script checks if a source package contains a valid
  Standards-Version field.
-Needs-Info: debfiles, source-control-file
+Needs-Info: debfiles, source-control-file, fields
 
 Tag: no-standards-version-field
 Severity: important
diff --git a/checks/version-substvars.desc b/checks/version-substvars.desc
index 8d5fa5e..82ef3f3 100644
--- a/checks/version-substvars.desc
+++ b/checks/version-substvars.desc
@@ -2,7 +2,7 @@ Check-Script: version-substvars
 Author: Adeodato Simó <dato@net.com.org.es>
 Abbrev: v-s
 Type: source
-Needs-Info: debfiles, source-control-file
+Needs-Info: debfiles, source-control-file, fields
 Info: This script checks for correct use of the various
  <tt>*Version</tt> substvars, e.g. deprecated substvars,
  or usage that can cause un-binNMUability
diff --git a/checks/watch-file.desc b/checks/watch-file.desc
index 5f8b607..f05c1a5 100644
--- a/checks/watch-file.desc
+++ b/checks/watch-file.desc
@@ -2,7 +2,7 @@ Check-Script: watch-file
 Author: Patrick Schoenfeld <schoenfeld@in-medisa-res.com>
 Abbrev: watch
 Type: source
-Needs-Info: debfiles
+Needs-Info: debfiles, fields
 Info: Check debian/watch files in source packages.
 
 Tag: debian-watch-file-is-missing
diff --git a/collection/ar-info.desc b/collection/ar-info.desc
index 45c1d7b..cef7299 100644
--- a/collection/ar-info.desc
+++ b/collection/ar-info.desc
@@ -2,5 +2,5 @@ Collector-Script: ar-info
 Author: Stéphane Glondu <steph@glondu.net>
 Info: This script runs the "ar t" command over all .a files of package.
 Type: binary
-Needs-Info: unpacked
+Needs-Info: unpacked, fields
 Version: 1
diff --git a/collection/bin-pkg-control b/collection/bin-pkg-control
new file mode 100755
index 0000000..b846985
--- /dev/null
+++ b/collection/bin-pkg-control
@@ -0,0 +1,73 @@
+#!/usr/bin/perl -w
+# bin-pkg-control -- lintian collector script
+
+# Copyright (C) 1998 Christian Schwarz
+#
+# 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;
+
+($#ARGV == 1) or fail("syntax: bin-pkg-control <pkg> <type>");
+my $pkg = shift;
+my $type = shift;
+my (@jobs, $job);
+
+use lib "$ENV{'LINTIAN_ROOT'}/lib";
+use Util;
+use Lintian::Command qw(spawn reap);
+
+if (-e "control"){
+    delete_dir("control") or fail("Cannot remove old control dir");
+}
+
+mkdir("control", 0777) or fail("mkdir control: $!");
+
+# The following calls use knowledge of the .deb format for speed
+
+# (replaces dpkg-deb -e)
+# extract control files' tarball
+spawn({ fail => 'error', out => "control.tar" },
+      ['ar', 'p', 'deb', 'control.tar.gz'],
+      '|', ['gzip', '-dc']);
+
+$job = { fail => 'error', err => "control-errors" };
+push @jobs, $job;
+# extract the tarball's contents
+spawn($job,
+      ["tar", "xf", "control.tar", "-C", "control", '&']);
+
+$job = { fail => 'error',
+         out  => "control-index",
+         err  => "control-index-errors" };
+
+push @jobs, $job;
+# create index of control.tar.gz
+spawn($job,
+      ["tar", "tvf", "control.tar"],
+      '|', ["sort", "-k", "6"], '&');
+
+reap(@jobs);
+undef @jobs;
+# clean up control.tar
+unlink("control.tar") or fail();
+
+# fix permissions
+spawn({ fail => 'error' },
+      ["chmod", "-R", "u+rX,o-w", "control"]);
+
+exit 0;
+
diff --git a/collection/bin-pkg-control.desc b/collection/bin-pkg-control.desc
new file mode 100644
index 0000000..ac97c7b
--- /dev/null
+++ b/collection/bin-pkg-control.desc
@@ -0,0 +1,5 @@
+Collector-Script: bin-pkg-control
+Info: This script extracts the contents of control.tar into the control/
+ and creates control-index as well.
+Type: binary, udeb
+Version: 1
diff --git a/collection/changelog-file.desc b/collection/changelog-file.desc
index caa6950..83640f0 100644
--- a/collection/changelog-file.desc
+++ b/collection/changelog-file.desc
@@ -5,4 +5,4 @@ Info: This script copies the <tt>changelog</tt> file and
  directory.
 Type: binary
 Version: 1
-Needs-Info: unpacked
+Needs-Info: unpacked, fields
diff --git a/collection/copyright-file.desc b/collection/copyright-file.desc
index beda287..3ba7317 100644
--- a/collection/copyright-file.desc
+++ b/collection/copyright-file.desc
@@ -4,4 +4,4 @@ Info: This script copies the <tt>copyright</tt> file of a package into the
  lintian directory.
 Type: binary
 Version: 1
-Needs-Info: unpacked
+Needs-Info: unpacked, fields
diff --git a/collection/debian-readme.desc b/collection/debian-readme.desc
index 0fd103d..5438017 100644
--- a/collection/debian-readme.desc
+++ b/collection/debian-readme.desc
@@ -4,4 +4,4 @@ Info: This script copies the <tt>README.Debian</tt> file of a package into
  the lintian directory.
 Type: binary
 Version: 1
-Needs-Info: unpacked
+Needs-Info: unpacked, fields
diff --git a/collection/diffstat.desc b/collection/diffstat.desc
index a714306..d6ecbc3 100644
--- a/collection/diffstat.desc
+++ b/collection/diffstat.desc
@@ -4,3 +4,4 @@ Info: This script extracts the Debian diff of a source package, and runs
  diffstat on it, leaving the result in the diffstat output file
 Type: source
 Version: 1
+Needs-info: fields
diff --git a/collection/doc-base-files.desc b/collection/doc-base-files.desc
index ee4652d..e82bb01 100644
--- a/collection/doc-base-files.desc
+++ b/collection/doc-base-files.desc
@@ -4,4 +4,4 @@ Info: This script copies the contents of /usr/share/doc-base into the
  lintian doc-base/ directory.
 Type: binary
 Version: 1
-Needs-Info: unpacked
+Needs-Info: unpacked, fields
diff --git a/collection/fields b/collection/fields
new file mode 100755
index 0000000..d22e73f
--- /dev/null
+++ b/collection/fields
@@ -0,0 +1,89 @@
+#!/usr/bin/perl -w
+# bin-pkg-control -- lintian collector script
+
+# Copyright (C) 1998 Christian Schwarz
+#
+# 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 lib "$ENV{'LINTIAN_ROOT'}/lib";
+use Util;
+
+($#ARGV == 1) or fail("syntax: fields <pkg> <type>");
+my $pkg = shift;
+my $type = shift;
+my $file;
+my $data;
+
+exit 0 if ($type eq 'source'); #FIXME
+
+if ($type eq 'changes'){
+    $file = 'changes';
+} elsif ($type eq 'binary' or $type eq 'udeb'){
+    $file = 'control/control';
+} else {
+
+
+}
+
+if (!defined($file)) {
+    fail("Cannot extract files for $type") unless ($type =~ m/^remove-/);
+} elsif (not -e $file) {
+    fail("fields invoked in the wrong directory");
+}
+
+if (-d 'fields'){
+    delete_dir('fields') or fail("Could not remove old fields directory");
+}
+
+# Exit now if we are just removing.
+exit 0 unless (defined($file));
+
+mkdir("fields", 0777) or fail("mkdir fields: $!");
+
+if($type eq 'changes'){
+    $data = get_dsc_info($file);
+} elsif ($type eq 'binary' or $type eq 'udeb'){
+    $data = (read_dpkg_control($file))[0];
+    $data->{'source'} or ($data->{'source'} = $data->{'package'});
+}
+    
+# create control field files
+for my $field (keys %$data) {
+    my $value = $data->{$field};
+    # checks/fields will convert colons into slashes
+    $field =~ s,/,:,g;
+    my $field_file = "fields/$field";
+    open(F, '>', $field_file) or fail("cannot open file $field_file for writing: $!");
+    print F $value,"\n";
+    close(F) or fail("Could not write $field_file: $!");
+}
+
+if($type eq 'binary' or $type eq 'udeb'){
+    # FIXME - the LAB really ought to handle this as it involves
+    # cross-pkg LAB layout.
+
+    # create symlink to source package
+    $data->{'source'} =~ s/\s*\(.*\)\s*$//;
+    # but only create it if it doesn't traverse directories
+    if ($data->{'source'} !~ m,/,) {
+        symlink("../../source/$data->{'source'}","source")
+            or fail("symlink: $!");
+    }
+}
+    
+exit 0;
diff --git a/collection/fields.desc b/collection/fields.desc
new file mode 100644
index 0000000..60d5717
--- /dev/null
+++ b/collection/fields.desc
@@ -0,0 +1,6 @@
+Collector-Script: fields
+Info: This script extracts the contents of the control file into
+ fields/<tt>field</tt>.
+Type: binary, udeb, source, changes
+Needs-info: bin-pkg-control
+Version: 1
diff --git a/collection/file-info.desc b/collection/file-info.desc
index 0bed903..d943008 100644
--- a/collection/file-info.desc
+++ b/collection/file-info.desc
@@ -3,4 +3,4 @@ Author: Richard Braakman <dark@xs4all.nl>
 Info: This script runs the file(1) command over all files of any kind of package.
 Type: binary, udeb, source
 Version: 1
-Needs-Info: unpacked
+Needs-Info: unpacked, fields
diff --git a/collection/init.d.desc b/collection/init.d.desc
index d56c188..9d29608 100644
--- a/collection/init.d.desc
+++ b/collection/init.d.desc
@@ -4,4 +4,4 @@ Info: This script copies the etc/init.d directory into the lintian
  directory.
 Type: binary
 Version: 1
-Needs-Info: unpacked
+Needs-Info: unpacked, fields
diff --git a/collection/md5sums.desc b/collection/md5sums.desc
index e47f8a1..bb2a40d 100644
--- a/collection/md5sums.desc
+++ b/collection/md5sums.desc
@@ -3,4 +3,4 @@ Author: Richard Braakman <dark@xs4all.nl>
 Info: This script runs the md5sums(1) over all files in a binary package.
 Type: binary, udeb
 Version: 1
-Needs-Info: unpacked
+Needs-Info: unpacked, fields
diff --git a/collection/menu-files.desc b/collection/menu-files.desc
index cce2451..ee0dd01 100644
--- a/collection/menu-files.desc
+++ b/collection/menu-files.desc
@@ -3,4 +3,4 @@ Author: Richard Braakman <dark@xs4all.nl>
 Info: This script copies the contents of /usr/lib/menu into the lintian menu/ directory.
 Type: binary
 Version: 2
-Needs-Info: unpacked
+Needs-Info: unpacked, fields
diff --git a/collection/scripts.desc b/collection/scripts.desc
index 2ea8d3b..6f43a8d 100644
--- a/collection/scripts.desc
+++ b/collection/scripts.desc
@@ -7,4 +7,4 @@ Info: This script scans a binary package for scripts that start with #! and
  because linux only looks at the first word when executing a script.
 Type: binary, udeb
 Version: 1
-Needs-Info: unpacked
+Needs-Info: unpacked, bin-pkg-control
diff --git a/unpack/unpack-binpkg-l1 b/unpack/unpack-binpkg-l1
index 7123481..245310a 100755
--- a/unpack/unpack-binpkg-l1
+++ b/unpack/unpack-binpkg-l1
@@ -43,42 +43,9 @@ my (@jobs, $job);
 # create directory in lab
 print "N: Creating directory $base_dir ...\n" if $verbose;
 mkdir("$base_dir", 0777) or fail("mkdir $base_dir: $!");
-mkdir("$base_dir/control", 0777) or fail("mkdir $base_dir/control: $!");
 mkdir("$base_dir/fields", 0777) or fail("mkdir $base_dir/fields: $!");
 symlink($file,"$base_dir/deb") or fail("symlink: $!");
 
-# The following calls use knowledge of the .deb format for speed
-
-# (replaces dpkg-deb -e)
-# extract control files' tarball
-spawn({ fail => 'error', out => "$base_dir/control.tar" },
-      ['ar', 'p', $file, 'control.tar.gz'],
-      '|', ['gzip', '-dc']);
-
-$job = { fail => 'error', err => "$base_dir/control-errors" };
-push @jobs, $job;
-# extract the tarball's contents
-spawn($job,
-      ["tar", "xf", "$base_dir/control.tar", "-C", "$base_dir/control", '&']);
-
-$job = { fail => 'error',
-         out  => "$base_dir/control-index",
-         err  => "$base_dir/control-index-errors" };
-push @jobs, $job;
-# create index of control.tar.gz
-spawn($job,
-      ["tar", "tvf", "$base_dir/control.tar"],
-      '|', ["sort", "-k", "6"], '&');
-
-reap(@jobs);
-undef @jobs;
-# clean up control.tar
-unlink("$base_dir/control.tar") or fail();
-
-# fix permissions
-spawn({ fail => 'error' },
-      ["chmod", "-R", "u+rX,o-w", "$base_dir/control"]);
-
 $job = { fail => 'error',
          out  => "$base_dir/index",
          err  => "$base_dir/index-errors" };
@@ -103,28 +70,7 @@ spawn($job,
       '|', ["sed", "-e", "s/^h/-/"],
       '|', ["sort", "-k", "6"], '&');
 
-# get package control information
-my $data = (read_dpkg_control("$base_dir/control/control"))[0];
-$data->{'source'} or ($data->{'source'} = $data->{'package'});
-
-# create control field files
-for my $field (keys %$data) {
-    my $value = $data->{$field};
-    # checks/fields will convert colons into slashes
-    $field =~ s,/,:,g;
-    my $field_file = "$base_dir/fields/$field";
-    open(F, '>', $field_file) or fail("cannot open file $field_file for writing: $!");
-    print F $value,"\n";
-    close(F);
-}
 
-# create symlink to source package
-$data->{'source'} =~ s/\s*\(.*\)\s*$//;
-# but only create it if it doesn't traverse directories
-if ($data->{'source'} !~ m,/,) {
-    symlink("../../source/$data->{'source'}","$base_dir/source")
-        or fail("symlink: $!");
-}
 
 reap(@jobs);
 undef @jobs;
diff --git a/unpack/unpack-changes-l1 b/unpack/unpack-changes-l1
index 7d777bc..b80548f 100755
--- a/unpack/unpack-changes-l1
+++ b/unpack/unpack-changes-l1
@@ -38,25 +38,9 @@ use Util;
 # stat $file
 (my @stat = stat $file) or fail("$file: cannot stat: $!");
 
-# get package control information
-my $data = get_dsc_info($file);
-
 # create directory in lab
 print "N: Creating directory $base_dir ...\n" if $verbose;
 mkdir("$base_dir", 0777) or fail("mkdir $base_dir: $!");
-mkdir("$base_dir/fields", 0777) or fail("mkdir $base_dir/fields: $!");
-
-# create control field files
-for my $field (keys %$data) {
-    my $value = $data->{$field};
-    # avoid path traversal if $field contains slashes
-    $field =~ s,/,:,g;
-    my $field_file = "$base_dir/fields/$field";
-    open(F, '>', $field_file)
-        or fail("cannot open file $field_file for writing: $!");
-    print F $value,"\n";
-    close(F);
-}
 
 symlink($file,"$base_dir/changes") or fail("cannot symlink changes file: $!");
 

-- 
Debian package checker


Reply to: