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

[lintian] 01/02: Prepare detection of pkgconfig with multiarch problems



This is an automated email from the git hooks/post-receive script.

nthykier pushed a commit to branch master
in repository lintian.

commit 37774bb101dd81140cf1193c48068c81dca741cc
Author: Bastien ROUCARIÈS <roucaries.bastien@gmail.com>
Date:   Wed Aug 14 15:16:37 2013 +0200

    Prepare detection of pkgconfig with multiarch problems
    
    * Move data/binaries/multiarch-dirs -> data/common/multiarch-dirs
    * Add an hash value to $MULTIARCH_DIRS
    
    Signed-off-by: Niels Thykier <niels@thykier.net>
---
 checks/binaries.pm                       |   17 +++++++++++------
 data/{binaries => common}/multiarch-dirs |    0
 private/refresh-archs                    |    2 +-
 3 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/checks/binaries.pm b/checks/binaries.pm
index 2f017eb..c57e431 100644
--- a/checks/binaries.pm
+++ b/checks/binaries.pm
@@ -79,7 +79,8 @@ our $EMBEDDED_LIBRARIES
   = Lintian::Data->new('binaries/embedded-libs', qr/\s*+\|\|/,
     \&_embedded_libs);
 
-our $MULTIARCH_DIRS = Lintian::Data->new('binaries/multiarch-dirs', '\s+');
+our $MULTIARCH_DIRS = Lintian::Data->new('common/multiarch-dirs', qr/\s++/,
+    sub { return { 'dir' => $_[1], 'match' => qr/\Q$_[1]\E/ } });
 
 sub _split_hash {
     my (undef, $val) = @_;
@@ -179,12 +180,16 @@ sub run {
     # This avoids false positives with plugins like Apache modules,
     # which may have their own SONAMEs but which don't matter for the
     # purposes of this check.  Also filter out nsswitch modules
-    $madir = $MULTIARCH_DIRS->value($arch);
+    if (defined($MULTIARCH_DIRS->value($arch))) {
+        $madir = $MULTIARCH_DIRS->value($arch)->{'dir'};
+    } else {
+        # In the case that the architecture is "all" or unknown (or we do
+        # not know the multi-arch path for a known architecture) , we assume
+        # it the multi-arch path to be this (hopefully!) non-existent path to
+        # avoid warnings about uninitialized variables.
+        $madir = './!non-existant-path!/./';
+    }
 
-    # In the case that the architecture is "all" or unknown (or we do
-    # not know the multi-arch path for a known architecture) , we assume
-    # it the multi-arch path to be this (hopefully!) non-existent path to
-    # avoid warnings about uninitialized variables.
     $madir = './!non-existant-path!/./' unless defined $madir;
 
     $gnu_triplet_re = quotemeta $madir;
diff --git a/data/binaries/multiarch-dirs b/data/common/multiarch-dirs
similarity index 100%
rename from data/binaries/multiarch-dirs
rename to data/common/multiarch-dirs
diff --git a/private/refresh-archs b/private/refresh-archs
index e301751..05a9be1 100755
--- a/private/refresh-archs
+++ b/private/refresh-archs
@@ -56,7 +56,7 @@ my (%archs, %files);
 #
 
 add_data_file(
-    'filename' => 'binaries/multiarch-dirs',
+    'filename' => 'common/multiarch-dirs',
     'line-spec' => ['@DEB_HOST_ARCH@ @DEB_HOST_MULTIARCH@'],
     'header'  => <<EOF
 # List of "Multiarch dirs" relationships as provided by

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git


Reply to: