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

[SCM] Debian package checker branch, master, updated. 2.5.4-122-ga475ec5



The following commit has been merged in the master branch:
commit 30ee49aa3dea5e065c3b27d2f7d363e45d99eb7d
Author: Jakub Wilk <jwilk@debian.org>
Date:   Sat Jan 28 18:36:57 2012 +0100

    shared-libs: Move hwcap-dirs into a data-file
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/checks/shared-libs b/checks/shared-libs
index fe9f089..efc000d 100644
--- a/checks/shared-libs
+++ b/checks/shared-libs
@@ -32,8 +32,7 @@ use Util;
 # Libraries that should only be used in the presence of certain capabilities
 # may be located in subdirectories of the standard ldconfig search path with
 # one of the following names.
-my %hwcap_dir = map { $_ => 1 }
-    qw(i486 i586 i686 cmov tls);
+my $HWCAP_DIRS = Lintian::Data->new ('shared-libs/hwcap-dirs');
 
 # The following architectures should always have a STACK setting in shared
 # libraries to disable executable stack.  Other architectures don't always add
@@ -140,7 +139,7 @@ for my $cur_file (@{$info->sorted_index}) {
         do {
             $dirname =~ s%/([^/]+)$%%;
             $last = $1;
-        } while ($last && $hwcap_dir{$last});
+        } while ($last && $HWCAP_DIRS->known ($last));
         $dirname .= "/$last" if $last;
         if ($ldconfig_dirs->known($dirname)) {
             # yes! so postinst must call ldconfig
diff --git a/data/shared-libs/hwcap-dirs b/data/shared-libs/hwcap-dirs
new file mode 100644
index 0000000..a9e45b7
--- /dev/null
+++ b/data/shared-libs/hwcap-dirs
@@ -0,0 +1,86 @@
+# List of all known hwcap.
+#
+# Last updated: 2012-01-28
+# Generated by private/refresh-hwcap
+
+4xxmac
+acpi
+altivec
+apic
+arch_2_05
+arch_2_06
+booke
+cellbe
+clflush
+cmov
+cx8
+dfp
+dts
+efpdouble
+efpsingle
+eimm
+esan3
+etf3enh
+ev4
+ev5
+ev56
+ev6
+ev67
+flush
+fpu
+fxsr
+g5
+highgprs
+hpage
+ht
+i386
+i486
+i586
+i686
+ic_snoop
+ldisp
+loongson2e
+loongson2f
+mca
+mmu
+mmx
+msa
+mtrr
+muldiv
+notb
+octeon
+octeon2
+pa6t
+pat
+pbe
+pge
+pn
+power4
+power5
+power5+
+power6x
+ppc32
+ppc601
+ppc64
+pse36
+sep
+smt
+spe
+ss
+sse
+sse2
+stbar
+stfle
+swap
+tm
+ucache
+ultra3
+v9
+v9v
+v9v2
+vsx
+z10
+z9-109
+z900
+z990
+zarch
diff --git a/debian/changelog b/debian/changelog
index 3159f34..c2e0ff1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -94,6 +94,7 @@ lintian (2.5.5) UNRELEASED; urgency=low
   * checks/shared-libs{,.desc}:
     + [JW] Check for Multi-Arch foreign packages shipping shared
       libraries in public library directories.  (Closes: #650444)
+    + [NT] Use the new hwcap-dirs data file to determine hwcap dirs.
   * checks/source-copyright:
     + [JW] Allow a trailing slash in the DEP-5 1.0 URL.
       (Closes: #649813)
@@ -133,6 +134,8 @@ lintian (2.5.5) UNRELEASED; urgency=low
   * data/fields/archive-sections:
     + [NT] Added new sections.  Thanks to Michael Biebl for the
       reminder.  (Closes: #652123)
+  * data/shared-libs/hwcap-dirs:
+    + [JW] New data file for listing known hwcap dirs.
   * data/shared-libs/ldconfig-dirs:
     + [NT] Auto-generate file with help from dpkg-architecture.
       (Closes: #653832)
@@ -223,6 +226,8 @@ lintian (2.5.5) UNRELEASED; urgency=low
 
   * private/refresh-archs:
     + [NT] Rewritten.
+  * private/refresh-hwcap:
+    + [JW] New file.
 
   * reporting/harness:
     + [NT] Removed useless "TODO" message from the log output.
diff --git a/private/refresh-hwcap b/private/refresh-hwcap
new file mode 100755
index 0000000..8efafda
--- /dev/null
+++ b/private/refresh-hwcap
@@ -0,0 +1,50 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use POSIX qw(strftime);
+
+my $datadir = shift;
+my $man = shift // '/usr/share/man/man8/ld.so.8.gz';
+my %caps;
+
+die "Usage: $0 path/to/lintian/data.\n" unless $datadir;
+
+open my $manpage, '-|', 'zcat', $man or die "zcat $man: $!";
+while (<$manpage>) {
+    next unless /^\.SH HARDWARE CAPABILITIES/;
+    last;
+}
+while (<$manpage>) {
+    next unless /^\.B/;
+    last;
+}
+while (<$manpage>) {
+    last if /^\.SH /;
+    next if /^\./;
+    chomp;
+    $caps{$_} = 1 foreach split /,\s*/;
+}
+close $manpage or die "zcat: $!";
+
+my $path = "$datadir/shared-libs/hwcap-dirs";
+my $date = strftime '%Y-%m-%d', gmtime;
+open my $fp, '>', $path or die "Opening $path: $!";
+print $fp <<EOF ;
+# List of all known hwcap.
+#
+# Last updated: $date
+# Generated by $0
+
+EOF
+foreach (sort keys %caps) {
+    print $fp "$_\n";
+}
+close $fp or die "Closing $path: $!";
+
+# Local Variables:
+# indent-tabs-mode: nil
+# cperl-indent-level: 4
+# End:
+# vim: syntax=perl sw=4 sts=4 sr et

-- 
Debian package checker


Reply to: