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

[lintian] 02/03: Import application-not-library check from pkg-perl-tools



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

abe pushed a commit to branch ppt-lc-mover
in repository lintian.

commit 544462e8b76ce20f97f5a65bc3ae2345e9f2a379
Author: Axel Beckert <abe@deuxchevaux.org>
Date:   Tue Aug 11 13:57:56 2015 +0200

    Import application-not-library check from pkg-perl-tools
    
    Changes compared to what was in pkg-perl-tools:
    
    * Prefix "pkg-perl" respectively "pkg_perl" removed.
    * Added check to debian main profile.
---
 checks/application-not-library.desc | 51 ++++++++++++++++++++++++
 checks/application-not-library.pm   | 79 +++++++++++++++++++++++++++++++++++++
 profiles/debian/main.profile        | 16 ++++----
 3 files changed, 138 insertions(+), 8 deletions(-)

diff --git a/checks/application-not-library.desc b/checks/application-not-library.desc
new file mode 100644
index 0000000..8cbabf8
--- /dev/null
+++ b/checks/application-not-library.desc
@@ -0,0 +1,51 @@
+Check-Script: application-not-library
+Author: Axel Beckert <abe@debian.org>
+Type: binary
+Info: application packaged like a library
+
+Tag: libapp-perl-package-name
+Severity: important
+Certainty: certain
+Info: This package contains a program in $PATH and is named
+ libapp-*-perl which usually implies that the upstream project on CPAN
+ is under the App:: hierachy for applications. Instead of
+ libfoo-bar-perl it should be named foo-bar.
+ .
+ People tend to skip library-like named packages when looking for
+ applications in the package list and hence wouldn't notice this
+ package.  See
+ http://pkg-perl.alioth.debian.org/policy.html#package_naming_policy
+ for some more reasoning and details.
+
+Tag: library-package-name-for-application
+Severity: normal
+Certainty: possible
+Experimental: yes
+Info: This package contains a program in $PATH but is named like a
+ library. E.g. instead of libfoo-bar-perl it should be named just
+ foo-bar.
+ .
+ People tend to skip library-like named packages when looking for
+ applications in the package list and hence wouldn't notice this
+ package.  See
+ http://pkg-perl.alioth.debian.org/policy.html#package_naming_policy
+ for some (not perl-specific) reasoning.
+ .
+ In case the program in $PATH is only a helper tool and the package is
+ primarily a library, please add a lintian override for this tag.
+
+Tag: application-in-library-section
+Severity: normal
+Certainty: possible
+Experimental: yes
+Info: This package contains a binary in $PATH but is in a section just
+ thought for libraries. It likely should be in another section like
+ e.g. utils, text, devel, misc, etc., but not in e.g. perl, ruby or
+ python.
+ .
+ People tend to skip these package sections when looking for
+ applications in the package list and hence wouldn't notice this
+ package.
+ .
+ In case the program in $PATH is only a helper tool and the package is
+ primarily a library, please add a lintian override for this tag.
diff --git a/checks/application-not-library.pm b/checks/application-not-library.pm
new file mode 100644
index 0000000..01dbaa7
--- /dev/null
+++ b/checks/application-not-library.pm
@@ -0,0 +1,79 @@
+# application-not-library -- find applications packaged like a library -*- perl -*-
+#
+# Copyright © 2014 Axel Beckert <abe@debian.org>
+#
+# 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::application_not_library;
+
+use strict;
+use warnings;
+
+use Lintian::Tags qw(tag);
+
+sub run {
+    my ( $pkg, $type, $info, $proc, $group ) = @_;
+
+    return if # Big exception list for all tags
+        $pkg =~ /^perl(-base)?$/                    or # perl itself
+        $pkg =~ /^ruby[\d.]*$/                      or # ruby itself
+        $pkg =~ /^python[\d.]*(-dev|-minimal)?$/    or # python itself
+        $pkg =~ /^cpan(plus|minus)$/                or # cpan package managers
+        $pkg =~ /^libmodule-.*-perl$/               or # perl module tools
+        $pkg =~ /^libdevel-.*-perl$/                or # perl debugging tools
+        $pkg =~ /^libperl.*-perl$/                  or # perl-handling tools
+        $pkg =~ /^libtest-.*-perl$/                 or # perl testing tools
+        $pkg =~ /^python[\d.]*-(stdeb|setuptools)$/ or # python packaging stuff
+        $pkg =~ /^gem2deb/                          or # ruby packaging stuff
+        $pkg =~ /^xulrunner/                        or # rendering engine
+        $pkg =~ /^lib.*-(utils|tools|bin|dev)/      or # generic library helpers
+        grep { $pkg eq $_ } qw(rake bundler coderay kdelibs-bin); # whitelist
+
+    my @programs = ();
+    foreach my $binpath (qw(bin sbin usr/bin usr/sbin usr/games)) {
+        my $bindir = $info->index("$binpath/");
+        next unless $bindir;
+
+        push(@programs,
+             grep { !/update$/ }     # ignore library maintenance tools
+             grep { !/properties$/ } # ignore library configuration tools
+             map { $_->name; }
+             grep { $_->basename !~ /^dh_/ } # ignore debhelper plugins
+             $bindir->children);
+    }
+
+    return unless @programs;
+
+    # Check for library style package names
+    if ($pkg =~ /^lib(.+)-perl$|^ruby-|^python[\d.]*-/) {
+        if ($pkg =~ /^libapp(.+)-perl$/) {
+            tag('libapp-perl-package-name', @programs);
+        } else {
+            tag('library-package-name-for-application', @programs);
+        }
+    }
+
+    # Check for wrong section
+    my $section = $info->field('section');
+    if ($section =~ /perl|python|ruby|^libs/) { # oldlibs is ok
+        tag('application-in-library-section', "$section", @programs);
+    }
+
+    return;
+}
+
+1;
diff --git a/profiles/debian/main.profile b/profiles/debian/main.profile
index 7c27ff3..42617fd 100644
--- a/profiles/debian/main.profile
+++ b/profiles/debian/main.profile
@@ -1,13 +1,13 @@
 # This profile is auto-generated
 Profile: debian/main
 Extends: debian/ftp-master-auto-reject
-Enable-Tags-From-Check: apache2, automake, binaries, changelog-file, changes-file,
- conffiles, control-file, control-files, copyright-file, cruft, dbus, deb-format,
- debconf, debhelper, debian-readme, debian-source-dir, description,
- duplicate-files, fields, filename-length, files, group-checks, huge-usr-share,
- infofiles, init.d, java, lintian, manpages, md5sums, menu-format, menus, nmu,
- ocaml, patch-systems, phppear, po-debconf, rules, scripts, shared-libs,
- source-copyright, standards-version, symlinks, systemd, testsuite,
- version-substvars, watch-file
+Enable-Tags-From-Check: apache2, application-not-library, automake, binaries,
+ changelog-file, changes-file, conffiles, control-file, control-files,
+ copyright-file, cruft, dbus, deb-format, debconf, debhelper, debian-readme,
+ debian-source-dir, description, duplicate-files, fields, filename-length, files,
+ group-checks, huge-usr-share, infofiles, init.d, java, lintian, manpages,
+ md5sums, menu-format, menus, nmu, ocaml, patch-systems, phppear, po-debconf,
+ rules, scripts, shared-libs, source-copyright, standards-version, symlinks,
+ systemd, testsuite, 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: