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

[lintian] 01/01: Ignore Multi-Arch: foreign packages for development-package-ships-elf-binary-in-path.



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

lamby pushed a commit to branch master
in repository lintian.

commit 8705ed43bd19cb40ada45897333ca56fcd187738
Author: Chris Lamb <lamby@debian.org>
Date:   Sun Dec 10 09:59:35 2017 +0000

    Ignore Multi-Arch: foreign packages for development-package-ships-elf-binary-in-path.
---
 checks/binaries.desc                               | 20 ++++++++-------
 checks/binaries.pm                                 |  3 ++-
 .../debian/debian/control.in                       | 30 ++++++++++++++++++++--
 .../debian/debian/libmultiarch-foreign-dev.install |  2 ++
 .../debian/debian/libmultiarch-none-dev.install    |  2 ++
 .../debian/debian/libmultiarch-same-dev.install    |  2 ++
 .../debian/debian/rules                            | 15 +++--------
 .../tags                                           | 17 +++++++++---
 8 files changed, 64 insertions(+), 27 deletions(-)

diff --git a/checks/binaries.desc b/checks/binaries.desc
index 8dbca37..dc18b0c 100644
--- a/checks/binaries.desc
+++ b/checks/binaries.desc
@@ -473,17 +473,19 @@ Tag: development-package-ships-elf-binary-in-path
 Severity: minor
 Certainty: possible
 Experimental: yes
-Info: This package installs the specified ELF binary in <tt>$PATH</tt> and is
- development package in the <tt>libdevel</tt> section of the archive.
+Info: This development package (in the <tt>libdevel</tt> section of the
+ archive) installs an ELF binary within <tt>$PATH</tt>.
  .
- When performing a cross build, host architecture binaries are generally not
- executable. However development packages need to be installed for the host
- architecture; such executables are thus useless for cross builds.
- .
- (Commonly, executables in development packages provide values that are
+ Commonly, executables in development packages provide values that are
  relevant for using the library. Source packages that use such
  development packages tend to execute those executables to discover how
- to use the library.)
+ to use the library.
+ .
+ When performing a cross build, host architecture binaries are generally not
+ executable. However, development packages need to be installed on the host
+ architecture so such files are useless.
+ .
  .
- An alternative approach is to use pkg-config(1).
+ An alternative approach is to use pkg-config(1) or to specify
+ <tt>Multi-Arch: foreign</tt>.
 Ref: #794295, #794103
diff --git a/checks/binaries.pm b/checks/binaries.pm
index c3e30bf..7930413 100644
--- a/checks/binaries.pm
+++ b/checks/binaries.pm
@@ -347,7 +347,8 @@ sub run {
 
         tag 'development-package-ships-elf-binary-in-path', $file
           if exists($PATH_DIRECTORIES{$file->dirname})
-          and $info->field('section', 'NONE') eq 'libdevel';
+          and $info->field('section', 'NONE') eq 'libdevel'
+          and $info->field('multi-arch', 'NONE') ne 'foreign';
 
         $objdump = $info->objdump_info->{$fname};
 
diff --git a/t/tests/binaries-development-package-ships-elf-binary-in-path/debian/debian/control.in b/t/tests/binaries-development-package-ships-elf-binary-in-path/debian/debian/control.in
index e0cbc76..b2ec2ee 100644
--- a/t/tests/binaries-development-package-ships-elf-binary-in-path/debian/debian/control.in
+++ b/t/tests/binaries-development-package-ships-elf-binary-in-path/debian/debian/control.in
@@ -6,11 +6,37 @@ Standards-Version: {$standards_version}
 Build-Depends: {$build_depends}
 Rules-Requires-Root: no
 
-Package: libfoo-dev
+Package: libmultiarch-none-dev
 Architecture: any
 Section: libdevel
 Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
-Description: {$description}
+Description: {$description} (M-A: none)
  This is a test package designed to exercise some feature or tag of
  Lintian.  It is part of the Lintian test suite and may do very odd
  things.  It should not be installed like a regular package.
+ .
+ This package does not specify a Multi-Arch field.
+
+Package: libmultiarch-foreign-dev
+Architecture: any
+Section: libdevel
+Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
+Multi-Arch: foreign
+Description: {$description} (M-A: foreign)
+ This is a test package designed to exercise some feature or tag of
+ Lintian.  It is part of the Lintian test suite and may do very odd
+ things.  It should not be installed like a regular package.
+ .
+ This package specifies Multi-Arch: foreign.
+
+Package: libmultiarch-same-dev
+Architecture: any
+Section: libdevel
+Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
+Multi-Arch: same
+Description: {$description} (M-A: same)
+ This is a test package designed to exercise some feature or tag of
+ Lintian.  It is part of the Lintian test suite and may do very odd
+ things.  It should not be installed like a regular package.
+ .
+ This package specifies Multi-Arch: same.
diff --git a/t/tests/binaries-development-package-ships-elf-binary-in-path/debian/debian/libmultiarch-foreign-dev.install b/t/tests/binaries-development-package-ships-elf-binary-in-path/debian/debian/libmultiarch-foreign-dev.install
new file mode 100644
index 0000000..d39e1f5
--- /dev/null
+++ b/t/tests/binaries-development-package-ships-elf-binary-in-path/debian/debian/libmultiarch-foreign-dev.install
@@ -0,0 +1,2 @@
+foreign	/usr/bin
+foreign	/var/lib/private
diff --git a/t/tests/binaries-development-package-ships-elf-binary-in-path/debian/debian/libmultiarch-none-dev.install b/t/tests/binaries-development-package-ships-elf-binary-in-path/debian/debian/libmultiarch-none-dev.install
new file mode 100644
index 0000000..5c549c1
--- /dev/null
+++ b/t/tests/binaries-development-package-ships-elf-binary-in-path/debian/debian/libmultiarch-none-dev.install
@@ -0,0 +1,2 @@
+none	/usr/bin
+none	/var/lib/private
diff --git a/t/tests/binaries-development-package-ships-elf-binary-in-path/debian/debian/libmultiarch-same-dev.install b/t/tests/binaries-development-package-ships-elf-binary-in-path/debian/debian/libmultiarch-same-dev.install
new file mode 100644
index 0000000..9cb82fa
--- /dev/null
+++ b/t/tests/binaries-development-package-ships-elf-binary-in-path/debian/debian/libmultiarch-same-dev.install
@@ -0,0 +1,2 @@
+same	/usr/bin
+same	/var/lib/private
diff --git a/t/tests/binaries-development-package-ships-elf-binary-in-path/debian/debian/rules b/t/tests/binaries-development-package-ships-elf-binary-in-path/debian/debian/rules
index 83d7b16..2006e7e 100755
--- a/t/tests/binaries-development-package-ships-elf-binary-in-path/debian/debian/rules
+++ b/t/tests/binaries-development-package-ships-elf-binary-in-path/debian/debian/rules
@@ -1,16 +1,9 @@
 #!/usr/bin/make -f
 
-DESTDIR := debian/$(shell dh_listpackages)
-
 %:
 	dh $@
 
-override_dh_install:
-	mkdir -p $(DESTDIR)/usr/bin
-	cp -a /bin/true $(DESTDIR)/usr/bin/elf-binary
-	
-	mkdir -p $(DESTDIR)/var/lib/private
-	cp -a /bin/true $(DESTDIR)/var/lib/private/elf-binary
-	
-	dh_shlibdeps
-	dh_install
+override_dh_auto_build:
+	cp /bin/true none
+	cp /bin/true same
+	cp /bin/true foreign
diff --git a/t/tests/binaries-development-package-ships-elf-binary-in-path/tags b/t/tests/binaries-development-package-ships-elf-binary-in-path/tags
index 1dd4a24..16f219f 100644
--- a/t/tests/binaries-development-package-ships-elf-binary-in-path/tags
+++ b/t/tests/binaries-development-package-ships-elf-binary-in-path/tags
@@ -1,4 +1,13 @@
-I: libfoo-dev: hardening-no-bindnow usr/bin/elf-binary
-I: libfoo-dev: hardening-no-bindnow var/lib/private/elf-binary
-W: libfoo-dev: binary-without-manpage usr/bin/elf-binary
-X: libfoo-dev: development-package-ships-elf-binary-in-path usr/bin/elf-binary
+E: libmultiarch-same-dev: arch-dependent-file-not-in-arch-specific-directory usr/bin/same
+E: libmultiarch-same-dev: arch-dependent-file-not-in-arch-specific-directory var/lib/private/same
+I: libmultiarch-foreign-dev: hardening-no-bindnow usr/bin/foreign
+I: libmultiarch-foreign-dev: hardening-no-bindnow var/lib/private/foreign
+I: libmultiarch-none-dev: hardening-no-bindnow usr/bin/none
+I: libmultiarch-none-dev: hardening-no-bindnow var/lib/private/none
+I: libmultiarch-same-dev: hardening-no-bindnow usr/bin/same
+I: libmultiarch-same-dev: hardening-no-bindnow var/lib/private/same
+W: libmultiarch-foreign-dev: binary-without-manpage usr/bin/foreign
+W: libmultiarch-none-dev: binary-without-manpage usr/bin/none
+W: libmultiarch-same-dev: binary-without-manpage usr/bin/same
+X: libmultiarch-none-dev: development-package-ships-elf-binary-in-path usr/bin/none
+X: libmultiarch-same-dev: development-package-ships-elf-binary-in-path usr/bin/same

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


Reply to: