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

[lintian] 01/01: Emit a wishlist warning for packages that mix-and-match more than one version control system in Vcs-* headers. (Closes: #884503)



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

lamby pushed a commit to branch master
in repository lintian.

commit ca4acd2a093faa4037512308397d95c15ee8e921
Author: Chris Lamb <lamby@debian.org>
Date:   Thu Dec 21 17:28:28 2017 +0000

    Emit a wishlist warning for packages that mix-and-match more than one version control system in Vcs-* headers. (Closes: #884503)
---
 checks/fields.desc                       | 5 +++++
 checks/fields.pm                         | 4 ++++
 debian/changelog                         | 3 +++
 t/tests/fields-malformed-vcs-fields/desc | 1 +
 t/tests/fields-malformed-vcs-fields/tags | 1 +
 t/tests/fields-vcs-fields/desc           | 1 +
 t/tests/fields-vcs-fields/tags           | 1 +
 7 files changed, 16 insertions(+)

diff --git a/checks/fields.desc b/checks/fields.desc
index 7a16d2c..64f4e6d 100644
--- a/checks/fields.desc
+++ b/checks/fields.desc
@@ -1356,3 +1356,8 @@ Info: The given package appears to be a library package, but it has "Priority"
  .
  Please update <tt>debian/control</tt> and downgrade the severity to, for
  example, <tt>Priority: optional</tt>.
+
+Tag: vcs-fields-use-more-than-one-vcs
+Severity: wishlist
+Certainty: possible
+Info: The Vcs-* fields mix more than one version control system.
diff --git a/checks/fields.pm b/checks/fields.pm
index 37c4a90..8c8a749 100644
--- a/checks/fields.pm
+++ b/checks/fields.pm
@@ -1292,6 +1292,7 @@ sub run {
 
     #----- Vcs-*
 
+    my %seen_vcs;
     while (my ($vcs, $splitter) = each %VCS_EXTRACT) {
         if (defined $info->field("vcs-$vcs")) {
             my $uri = $info->field("vcs-$vcs");
@@ -1331,8 +1332,11 @@ sub run {
             }
             tag 'vcs-browser-links-to-empty-view', $uri
               if $vcs eq 'browser' and $uri =~ m%rev=0&sc=0%;
+            $seen_vcs{$vcs}++ if $vcs ne 'browser';
         }
     }
+    tag 'vcs-fields-use-more-than-one-vcs', sort keys %seen_vcs
+      if keys %seen_vcs > 1;
 
     #---- Checksums
 
diff --git a/debian/changelog b/debian/changelog
index c53ed25..96b31b6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,9 @@ lintian (2.5.66) UNRELEASED; urgency=medium
 
   XXX: generate tag summary
 
+  * checks/fields.{pm,desc}:
+    + [CL] Emit a wishlist warning for packages that mix-and-match more
+      than one version control system in Vcs-* headers.  (Closes: #884503)
   * checks/init.d.{pm,desc}:
     + [CL] Don't emit init.d-script-needs-depends-on-lsb-base if the
       package ships a Systemd service file.  (Closes: #864999)
diff --git a/t/tests/fields-malformed-vcs-fields/desc b/t/tests/fields-malformed-vcs-fields/desc
index 92a1bd9..0598c43 100644
--- a/t/tests/fields-malformed-vcs-fields/desc
+++ b/t/tests/fields-malformed-vcs-fields/desc
@@ -5,3 +5,4 @@ Test-For:
  vcs-field-uses-not-recommended-uri-format
  vcs-field-uses-unknown-uri-format
  vcs-field-has-unexpected-spaces
+ vcs-fields-use-more-than-one-vcs
diff --git a/t/tests/fields-malformed-vcs-fields/tags b/t/tests/fields-malformed-vcs-fields/tags
index 1530422..c2075a3 100644
--- a/t/tests/fields-malformed-vcs-fields/tags
+++ b/t/tests/fields-malformed-vcs-fields/tags
@@ -1,3 +1,4 @@
+I: fields-malformed-vcs-fields source: vcs-fields-use-more-than-one-vcs git svn
 W: fields-malformed-vcs-fields source: vcs-field-has-unexpected-spaces vcs-git https://anonscm.debian.org/test/test.git --branch wrong
 W: fields-malformed-vcs-fields source: vcs-field-uses-not-recommended-uri-format vcs-svn svn+ssh://svn.debian.org/svn/foobar/trunk
 W: fields-malformed-vcs-fields source: vcs-field-uses-unknown-uri-format vcs-browser svn.debian.org/wsvn/foobar/trunk
diff --git a/t/tests/fields-vcs-fields/desc b/t/tests/fields-vcs-fields/desc
index d6bf5c4..a34ed14 100644
--- a/t/tests/fields-vcs-fields/desc
+++ b/t/tests/fields-vcs-fields/desc
@@ -11,3 +11,4 @@ Test-For:
  vcs-field-uses-insecure-uri
  vcs-field-uses-not-recommended-uri-format
  vcs-browser-links-to-empty-view
+ vcs-fields-use-more-than-one-vcs
diff --git a/t/tests/fields-vcs-fields/tags b/t/tests/fields-vcs-fields/tags
index 5065151..248a083 100644
--- a/t/tests/fields-vcs-fields/tags
+++ b/t/tests/fields-vcs-fields/tags
@@ -1,5 +1,6 @@
 I: fields-vcs-fields source: vcs-field-uses-insecure-uri vcs-bzr nosmart+http://anonscm.debian.org/bzr/collab-maint/foobar
 I: fields-vcs-fields source: vcs-field-uses-insecure-uri vcs-cvs :pserver:anonymous@anonscm.debian.org:/cvs/foobar module
 I: fields-vcs-fields source: vcs-field-uses-insecure-uri vcs-svn svn://anonscm.debian.org/foobar/trunk
+I: fields-vcs-fields source: vcs-fields-use-more-than-one-vcs bzr cvs git hg mtn svn
 W: fields-vcs-fields source: vcs-browser-links-to-empty-view https://anonscm.debian.org/viewvc/foobar/trunk?rev=0&sc=0
 W: fields-vcs-fields source: vcs-field-uses-not-recommended-uri-format vcs-mtn www.example.org org.debian.foobar

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


Reply to: