[SCM] Debian package checker branch, master, updated. 2.2.18-62-gbabdc55
The following commit has been merged in the master branch:
commit 75a669cbbabcbde4592059c5c5820b5f2e36f7ed
Author: Stephane Glondu <steph@glondu.net>
Date: Mon Jul 20 10:01:41 2009 +0200
Add ar-info collection script
To detect dangling .cmx (#528367), we need to know the list of files
inside .a files. This information might useful for other, not
OCaml-related, checks.
Signed-off-by: Stephane Glondu <steph@glondu.net>
diff --git a/collection/md5sums b/collection/ar-info
similarity index 59%
copy from collection/md5sums
copy to collection/ar-info
index 4a3af6f..c88ce25 100755
--- a/collection/md5sums
+++ b/collection/ar-info
@@ -1,18 +1,18 @@
#!/usr/bin/perl -w
-# md5sums -- lintian collection script
-
-# Copyright (C) 1998 Richard Braakman
-#
+# ar-info -- lintian collection script
+#
+# Copyright © 2009 Stéphane Glondu
+#
# 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
@@ -21,39 +21,34 @@
use strict;
-use FileHandle;
-use lib "$ENV{'LINTIAN_ROOT'}/lib";
-use Lintian::Command qw(spawn reap);
-use Util;
-
-($#ARGV == 1) or fail("syntax: md5sums <pkg> <type>");
+($#ARGV == 1) or fail("syntax: ar-info <pkg> <type>");
my $pkg = shift;
my $type = shift;
--f "fields/package" or fail("md5sums invoked in wrong directory");
+-f "fields/source" or fail("ar-info invoked in wrong directory");
-unlink("md5sums");
+unlink("ar-info");
chdir("unpacked")
or fail("cannot chdir to unpacked directory: $!");
-my %opts = ( pipe_in => FileHandle->new,
- out => '../md5sums',
- fail => 'error' );
-spawn(\%opts, ['xargs', '-0r', 'md5sum'] );
-$opts{pipe_in}->blocking(1);
open(INDEX, '<', "../index")
or fail("cannot open index file: $!");
+open(OUT, '>', "../ar-info");
+
while (<INDEX>) {
- next unless m/^-/;
- chop;
- $_ = (split(" ", $_, 6))[5];
- s/ link to .*//;
- s/\\(\d+)/chr(oct($1))/eg;
- s/\\\\/\\/g;
- printf {$opts{pipe_in}} "%s\0", $_;
+ chomp;
+ next unless /\.a$/;
+ my $file = (split(" ", $_, 6))[5];
+ open(OBJS, '-|', "ar t $file")
+ or fail("cannot read file: $!");
+ print OUT "$file:";
+ while (<OBJS>) {
+ chomp;
+ print OUT " $_";
+ }
+ close(OBJS);
+ print OUT "\n";
}
-close(INDEX);
-
-close $opts{pipe_in};
-reap(\%opts);
+close(INDEX);
+close(OUT);
diff --git a/collection/ar-info.desc b/collection/ar-info.desc
new file mode 100644
index 0000000..eaecfcf
--- /dev/null
+++ b/collection/ar-info.desc
@@ -0,0 +1,7 @@
+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
+Unpack-Level: 2
+Version: 1
+Order: 1
--
Debian package checker
Reply to: