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

[lintian] 06/12: c/debhelper: Attempt to classify build system



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

nthykier pushed a commit to branch master
in repository lintian.

commit a6bfb9f3f748f81b45b6a6e0b8002c480cea157f
Author: Niels Thykier <niels@thykier.net>
Date:   Sun Mar 6 18:32:18 2016 +0000

    c/debhelper: Attempt to classify build system
    
    Signed-off-by: Niels Thykier <niels@thykier.net>
---
 checks/debhelper.desc             |  6 ++++++
 checks/debhelper.pm               | 18 ++++++++++++++++--
 t/tests/debhelper-compat-old/desc |  3 ++-
 t/tests/debhelper-compat-old/tags |  1 +
 4 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/checks/debhelper.desc b/checks/debhelper.desc
index c5bb0cb..4cf3fa0 100644
--- a/checks/debhelper.desc
+++ b/checks/debhelper.desc
@@ -354,3 +354,9 @@ Info: The package uses one (or more) of the obsolete dh parameters
  Please refer to the debhelper documentation for more information.
 Ref: https://lists.debian.org/debian-devel-changes/2011/08/msg00519.html,
  debhelper(7)
+
+Tag: debian-build-system
+Severity: classification
+Certainty: certain
+Info: This is the build system that Lintian believes the package is
+ using.
diff --git a/checks/debhelper.pm b/checks/debhelper.pm
index 9f953ef..0ef7d90 100644
--- a/checks/debhelper.pm
+++ b/checks/debhelper.pm
@@ -65,8 +65,7 @@ sub run {
     my $dhcompatvalue;
     my $inclcdbs = 0;
 
-    my $bdepends_noarch;
-    my $bdepends;
+    my ($bdepends_noarch, $bdepends, %build_systems);
     my $seen_dh = 0;
     my $seen_python_helper = 0;
     my $seen_python3_helper = 0;
@@ -89,6 +88,8 @@ sub run {
 
         if (m/^\s+-?(dh_\S+)/) {
             my $dhcommand = $1;
+            $build_systems{'debhelper'} = 1
+              if not exists($build_systems{'dh'});
 
             if ($dhcommand eq 'dh_pysupport') {
                 tag 'dh_pysupport-is-obsolete', "line $.";
@@ -128,6 +129,8 @@ sub run {
             $seencommand = 1;
             $needbuilddepends = 1;
         } elsif (m,^\s+dh\s+,) {
+            $build_systems{'dh'} = 1;
+            delete($build_systems{'debhelper'});
             $seen_dh = 1;
             $seencommand = 1;
             $needbuilddepends = 1;
@@ -160,6 +163,8 @@ sub run {
                 $seen_python_helper = -1; # maybe; we'll check that later
             }
         } elsif (m,^include\s+/usr/share/cdbs/1/rules/debhelper.mk,) {
+            $build_systems{'cdbs-with-debhelper.mk'} = 1;
+            delete($build_systems{'cdbs-without-debhelper.mk'});
             $seencommand = 1;
             $needbuilddepends = 1;
             $needtomodifyscripts = 1;
@@ -182,6 +187,8 @@ sub run {
         } elsif (m,^include\s+/usr/share/cdbs/,
             or m,^include\s+/usr/share/R/debian/r-cran.mk,o) {
             $inclcdbs = 1;
+            $build_systems{'cdbs-without-debhelper.mk'} = 1
+              if not exists($build_systems{'cdbs-with-debhelper.mk'});
         }
     }
     close($rules_fd);
@@ -192,6 +199,13 @@ sub run {
         tag 'unused-build-dependency-on-cdbs' if ($bdepends->implies('cdbs'));
     }
 
+    if (%build_systems) {
+        my @systems = sort(keys(%build_systems));
+        tag 'debian-build-system', join(', ', @systems);
+    } else {
+        tag 'debian-build-system', 'other';
+    }
+
     return unless $seencommand;
 
     my @pkgs = $info->binaries;
diff --git a/t/tests/debhelper-compat-old/desc b/t/tests/debhelper-compat-old/desc
index 562d890..f5b021d 100644
--- a/t/tests/debhelper-compat-old/desc
+++ b/t/tests/debhelper-compat-old/desc
@@ -3,7 +3,8 @@ Sequence: 6000
 Version: 1.0
 Description: Test for old debian/compat file
 Skeleton: pedantic
-Options: --pedantic -I -E
+Options: --pedantic -I -E -L +classification
 Test-Depends: debhelper (>= 9),
 Test-For:
  package-uses-old-debhelper-compat-version
+ debian-build-system
diff --git a/t/tests/debhelper-compat-old/tags b/t/tests/debhelper-compat-old/tags
index a1195ab..caf93d0 100644
--- a/t/tests/debhelper-compat-old/tags
+++ b/t/tests/debhelper-compat-old/tags
@@ -1 +1,2 @@
+C: debhelper-compat-old source: debian-build-system dh
 P: debhelper-compat-old source: package-uses-old-debhelper-compat-version 8

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


Reply to: