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

[SCM] Debian package checker branch, master, updated. 2.3.2-10-g2b5273b



The following commit has been merged in the master branch:
commit 076d5e5e1ea4349b6c004b886c8f22aefaa16daf
Author: Raphael Geissert <atomo64@gmail.com>
Date:   Thu Jan 28 20:04:45 2010 -0600

    Warn about packages with files in an incorrect <triplet> dir
    
    * checks/files{,.desc}:
      + [RG] Warn about packages containing (/usr)/lib/<triplet>
        directories for a <triplet> that isn't the one of the
        architecture of the package, per Policy 3.8.4 requirement.

diff --git a/checks/files b/checks/files
index d821d98..a00cb3a 100644
--- a/checks/files
+++ b/checks/files
@@ -25,6 +25,7 @@ use Lintian::Data;
 use Lintian::Tags qw(tag);
 
 our $FONT_PACKAGES;
+our $TRIPLETS;
 
 # A list of known packaged Javascript libraries
 # and the packages providing them
@@ -624,6 +625,16 @@ foreach my $file (sort keys %{$info->index}) {
 	}
     }
 
+    if ($file =~ m,^(?:usr/)lib/([^/]+)/$,) {
+	my $subdir = $1;
+	$TRIPLETS = Lintian::Data->new('files/triplets', '\s+')
+	    unless defined($FONT_PACKAGES);
+	if ($TRIPLETS->known($subdir)) {
+	    tag 'triplet-dir-and-architecture-mismatch', "$file is for", $TRIPLETS->value($subdir)
+		if ($info->field('architecture') ne $TRIPLETS->value($subdir));
+	}
+    }
+
     # ---------------- .pyc (compiled python files
     if ($file =~ m,^usr/lib/python\d\.\d/.*.pyc$,) {
 	tag "package-installs-python-pyc", "$file"
diff --git a/checks/files.desc b/checks/files.desc
index 68fad41..6bbebed 100644
--- a/checks/files.desc
+++ b/checks/files.desc
@@ -1101,3 +1101,13 @@ Info: This package ships a <tt>.ini</tt> file used to configure php but
  .
  Since version 5.3, the PHP interpreter warns about the use of the
  old style of comment separator.
+
+Tag: triplet-dir-and-architecture-mismatch
+Severity: important
+Certainty: possible
+Ref: policy 9.1.1
+Info: This package contains a directory under <tt>/lib</tt> or
+ <tt>/usr/lib</tt> which doesn't match the proper triplet for the
+ binary package's architecture.  This is very likely to be a mistake
+ when indicating the underlying build system where the files should be
+ installed.
diff --git a/debian/changelog b/debian/changelog
index 334357e..9ecca0b 100755
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,7 @@ lintian (2.3.3) UNRELEASED; urgency=low
     + Added:
       - missing-dependency-on-phpapi
       - obsolete-comments-style-in-php-ini
+      - triplet-dir-and-architecture-mismatch
 
   * data/files/triplets:
     + [RG] New file with a list of triplet<->architecture
@@ -21,6 +22,9 @@ lintian (2.3.3) UNRELEASED; urgency=low
       libraries.
     + [RG] Don't warn about packages containing /sys or /selinux
       directories.  Policy 3.8.4 grants an exception to the FHS.
+    + [RG] Warn about packages containing (/usr)/lib/<triplet>
+      directories for a <triplet> that isn't the one of the
+      architecture of the package, per Policy 3.8.4 requirement.
 
   * debian/control:
     + [RG] Update standards version to 3.8.4 (no changes required).
diff --git a/t/tests/binaries-multiarch/debian/Makefile b/t/tests/binaries-multiarch/debian/Makefile
new file mode 100644
index 0000000..61aab6a
--- /dev/null
+++ b/t/tests/binaries-multiarch/debian/Makefile
@@ -0,0 +1,24 @@
+
+TRIPLETT = $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+
+ifeq (i486-linux-gnu,$(TRIPLETT))
+    WRONG_TRIPLETT = x86_64-linux-gnu
+else
+    WRONG_TRIPLETT = i486-linux-gnu
+endif
+
+all:
+	gcc -o basic basic.c
+
+install:
+	# install it once under the correct triplet directory
+	install -d $(DESTDIR)/usr/lib/$(TRIPLETT)
+	install -m 755 -c basic $(DESTDIR)/usr/lib/$(TRIPLETT)/basic
+	# and one more time under the wrong triplet directory
+	install -d $(DESTDIR)/usr/lib/$(WRONG_TRIPLETT)
+	install -m 755 -c basic $(DESTDIR)/usr/lib/$(WRONG_TRIPLETT)/basic
+
+clean distclean:
+	rm -f basic
+
+check test:
diff --git a/t/tests/binaries-general/debian/basic.c b/t/tests/binaries-multiarch/debian/basic.c
similarity index 100%
copy from t/tests/binaries-general/debian/basic.c
copy to t/tests/binaries-multiarch/debian/basic.c
diff --git a/t/tests/binaries-multiarch/desc b/t/tests/binaries-multiarch/desc
new file mode 100644
index 0000000..296c568
--- /dev/null
+++ b/t/tests/binaries-multiarch/desc
@@ -0,0 +1,6 @@
+Testname: binaries-multiarch
+Sequence: 6000
+Version: 1.0
+Description: Multiarch-related tests but not multiarch itself
+Architecture: any
+Test-For: triplet-dir-and-architecture-mismatch
diff --git a/t/tests/binaries-multiarch/tags b/t/tests/binaries-multiarch/tags
new file mode 100644
index 0000000..a2c835a
--- /dev/null
+++ b/t/tests/binaries-multiarch/tags
@@ -0,0 +1 @@
+E: binaries-multiarch: triplet-dir-and-architecture-mismatch usr/lib/x86_64-linux-gnu/ is for amd64

-- 
Debian package checker


Reply to: