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

[lintian] 01/03: Checks for files with the same name installed in / and /usr



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

broucaries-guest pushed a commit to branch master
in repository lintian.

commit 243623131144eac70076dddaac79b86e75d3724f
Author: Marco d'Itri <md@linux.it>
Date:   Sun Jan 10 14:53:32 2016 +0100

    Checks for files with the same name installed in / and /usr
    
    Signed-off-by: Bastien ROUCARIÈS <roucaries.bastien+debian@gmail.com>
---
 checks/usrmerge.desc         | 32 +++++++++++++++++++++++++++
 checks/usrmerge.pm           | 52 ++++++++++++++++++++++++++++++++++++++++++++
 profiles/debian/main.profile |  2 +-
 3 files changed, 85 insertions(+), 1 deletion(-)

diff --git a/checks/usrmerge.desc b/checks/usrmerge.desc
new file mode 100644
index 0000000..9aeae48
--- /dev/null
+++ b/checks/usrmerge.desc
@@ -0,0 +1,32 @@
+Check-Script: usrmerge
+Author: Marco d'Itri <md@linux.it>
+Abbrev: usr
+Type: binary
+Needs-Info: unpacked
+Info: This script checks for files with the same name installed in / and /usr.
+
+Tag: file-in-root-and-usr
+Severity: important
+Certainty: certain
+Info: The package ships two files with the same name installed both in
+ /{bin,sbin,lib*}/ and /usr/{bin,sbin,lib*}/.
+ This is incompatible with the merged /usr directories scheme.
+ .
+ Packages with conflicting files must remove one of them if possible or
+ make it a symlink to the other and manage the links in the maintainer
+ scripts.
+Ref: https://wiki.debian.org/UsrMerge,
+     http://anonscm.debian.org/cgit/users/md/usrmerge.git/plain/debian/README.Debian
+
+Tag: library-in-root-and-usr
+Severity: important
+Certainty: certain
+Info: The package ships two files with the same name installed both in
+ /lib*/ and /usr/lib*/ (or their subdirectories).
+ This is not useful and is incompatible with the merged /usr directories
+ scheme.
+ .
+ Shared library files, both static and dynamic, must be installed in
+ the correct directories as documented in Policy 8.1.
+Ref: https://wiki.debian.org/UsrMerge,
+     policy 8.1
diff --git a/checks/usrmerge.pm b/checks/usrmerge.pm
new file mode 100644
index 0000000..d35ff7d
--- /dev/null
+++ b/checks/usrmerge.pm
@@ -0,0 +1,52 @@
+# usrmerge -- lintian check script -*- perl -*-
+
+# Copyright (C) 2016 Marco d'Itri
+#
+# 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
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+package Lintian::usrmerge;
+use strict;
+use warnings;
+use autodie;
+
+use Lintian::Tags qw(tag);
+
+sub run {
+    my (undef, undef, $info) = @_;
+
+    foreach my $file1 ($info->sorted_index) {
+        next unless $file1 =~ m,^(?:s?bin|lib(?:|[ox]?32|64))/,;
+        my $file2 = $info->index("usr/$file1") or next;
+        next if $file1->is_dir and $file2->is_dir;
+
+        if ($file1 =~ m,^lib.+\.(?:so[\.0-9]*|a)$,) {
+            tag 'library-in-root-and-usr', $file1, $file2;
+        } else {
+            tag 'file-in-root-and-usr', $file1, $file2;
+        }
+    }
+
+    return;
+}
+
+1;
+
+# Local Variables:
+# indent-tabs-mode: nil
+# cperl-indent-level: 4
+# End:
+# vim: syntax=perl sw=4 sts=4 sr et
diff --git a/profiles/debian/main.profile b/profiles/debian/main.profile
index d28bf3e..92adb0d 100644
--- a/profiles/debian/main.profile
+++ b/profiles/debian/main.profile
@@ -8,6 +8,6 @@ Enable-Tags-From-Check: apache2, application-not-library, automake, binaries,
  group-checks, huge-usr-share, infofiles, init.d, java, lintian, manpages,
  md5sums, menu-format, menus, nmu, obsolete-sites, ocaml, patch-systems, phppear,
  po-debconf, rules, scripts, shared-libs, source-copyright, standards-version,
- symlinks, systemd, testsuite, version-substvars, watch-file
+ symlinks, systemd, testsuite, usrmerge, version-substvars, watch-file
 Disable-Tags: hardening-no-stackprotector
 

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


Reply to: