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

[lintian] 01/01: Check for packages including "?rev=0&sc=0" in Vcs-Browser. (Closes; #681713)



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

lamby pushed a commit to branch master
in repository lintian.

commit d8a828ac8b5740257314cfc40340b1c2d72f2911
Author: Chris Lamb <lamby@debian.org>
Date:   Sun Sep 3 09:18:38 2017 +0100

    Check for packages including "?rev=0&sc=0" in Vcs-Browser. (Closes; #681713)
---
 checks/fields.desc                                 | 8 ++++++++
 checks/fields.pm                                   | 2 ++
 debian/changelog                                   | 2 ++
 t/tests/fields-vcs-fields/debian/debian/control.in | 2 +-
 t/tests/fields-vcs-fields/desc                     | 1 +
 t/tests/fields-vcs-fields/tags                     | 1 +
 6 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/checks/fields.desc b/checks/fields.desc
index bfab0bd..cfe7b0c 100644
--- a/checks/fields.desc
+++ b/checks/fields.desc
@@ -1095,6 +1095,14 @@ Info: The Vcs-* field uses an unencrypted transport protocol for the
  might not be possible to use an alternative url and still have a
  working (anonymous read-only) repository.
 
+Tag: vcs-browser-links-to-empty-view
+Severity: normal
+Certainty: certain
+Info: The VCS-Browser links to an an empty view of the repository due to
+ it including a suffix such as <tt>?rev=0&sc=0</tt>.
+ .
+ You should remove this suffix from the field.
+
 Tag: lib-recommends-documentation
 Severity: normal
 Certainty: possible
diff --git a/checks/fields.pm b/checks/fields.pm
index f625abc..3fff009 100644
--- a/checks/fields.pm
+++ b/checks/fields.pm
@@ -1303,6 +1303,8 @@ sub run {
                     tag $tag, $parts[0], $canonicalized;
                 }
             }
+            tag 'vcs-browser-links-to-empty-view', $uri
+              if $vcs eq 'browser' and $uri =~ m%rev=0&sc=0%;
         }
     }
 
diff --git a/debian/changelog b/debian/changelog
index 656401f..8565bbe 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -56,6 +56,8 @@ lintian (2.5.53) UNRELEASED; urgency=medium
       just python2-foo.  (Closes: #870272)
     + [RG] Do no longer require debug packages to be priority extra.
     + [BR] Use Lintian::Data for name/section mapping
+    + [CL] Check for packages including "?rev=0&sc=0" in Vcs-Browser.
+      (Closes: #681713)
   * checks/files.{pm,desc}:
     + [BR] Avoid privacy-breach-generic false positives for legal.xml.
     + [BR] Detect install of node package under /usr/lib/nodejs/[^/]*$
diff --git a/t/tests/fields-vcs-fields/debian/debian/control.in b/t/tests/fields-vcs-fields/debian/debian/control.in
index d535751..0ff1db2 100644
--- a/t/tests/fields-vcs-fields/debian/debian/control.in
+++ b/t/tests/fields-vcs-fields/debian/debian/control.in
@@ -4,7 +4,7 @@ Section: {$section}
 Maintainer: {$author}
 Standards-Version: {$standards_version}
 Build-Depends: {$build_depends}
-Vcs-Browser: https://anonscm.debian.org/viewvc/foobar/trunk
+Vcs-Browser: https://anonscm.debian.org/viewvc/foobar/trunk?rev=0&sc=0
 Vcs-Svn: svn://anonscm.debian.org/foobar/trunk
 Vcs-Mtn: www.example.org org.debian.foobar
 Vcs-Hg: https://anonscm.debian.org/hg/foobar/pkg/foobar
diff --git a/t/tests/fields-vcs-fields/desc b/t/tests/fields-vcs-fields/desc
index ce5c2ad..a4a0dd2 100644
--- a/t/tests/fields-vcs-fields/desc
+++ b/t/tests/fields-vcs-fields/desc
@@ -10,3 +10,4 @@ Test-Against:
  vcs-git-uses-invalid-user-uri
 Test-For:
  vcs-field-uses-insecure-uri
+ vcs-browser-links-to-empty-view
diff --git a/t/tests/fields-vcs-fields/tags b/t/tests/fields-vcs-fields/tags
index 692df5d..d7fe58e 100644
--- a/t/tests/fields-vcs-fields/tags
+++ b/t/tests/fields-vcs-fields/tags
@@ -1,3 +1,4 @@
 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
+W: fields-vcs-fields source: vcs-browser-links-to-empty-view https://anonscm.debian.org/viewvc/foobar/trunk?rev=0&sc=0

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


Reply to: