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

[lintian] 03/03: Move bugs-field-does-not-refer-to-debian-infrastructure to fields.pm and split tests, only checking the source paragraph.



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

lamby pushed a commit to branch master
in repository lintian.

commit 5be9719613bb0155248edd856070bd3e696c184c
Author: Chris Lamb <lamby@debian.org>
Date:   Fri Dec 22 22:31:06 2017 +0000

    Move bugs-field-does-not-refer-to-debian-infrastructure to fields.pm and split tests, only checking the source paragraph.
---
 checks/control-file.desc                                       | 10 ----------
 checks/control-file.pm                                         |  3 ---
 checks/fields.desc                                             | 10 ++++++++++
 checks/fields.pm                                               |  3 +++
 debian/changelog                                               |  7 +++----
 t/tests/control-file-pedantic/debian/debian/control.in         |  2 --
 t/tests/control-file-pedantic/desc                             |  1 -
 t/tests/control-file-pedantic/tags                             |  3 +--
 .../debian/debian/control.in                                   |  7 ++-----
 .../desc                                                       |  5 +++++
 .../tags                                                       |  0
 .../debian/debian/control.in                                   |  7 ++-----
 .../desc                                                       |  5 +++++
 .../tags                                                       |  1 +
 14 files changed, 32 insertions(+), 32 deletions(-)

diff --git a/checks/control-file.desc b/checks/control-file.desc
index 45d0c9f..000f148 100644
--- a/checks/control-file.desc
+++ b/checks/control-file.desc
@@ -330,13 +330,3 @@ Severity: classification
 Certainty: certain
 Info: Package requires fakeroot or similar to build binary targets and explicitly declares it.
 Ref: /usr/share/doc/dpkg-dev/rootless-builds.txt.gz
-
-Tag: bugs-field-does-not-refer-to-debian-infrastructure
-Severity: normal
-Certainty: possible
-Info: The <tt>debian/control</tt> file contains an Bugs field that does
- not refer to Debian infrastructure. This is recognized by the string
- ".debian.org".
- .
- This can likely to make reportbug unable to report bugs.
-Ref: #740944
diff --git a/checks/control-file.pm b/checks/control-file.pm
index e6b7f96..0976964 100644
--- a/checks/control-file.pm
+++ b/checks/control-file.pm
@@ -101,9 +101,6 @@ sub run {
             if ($field eq 'xc-package-type') {
                 tag 'xc-package-type-in-debian-control', "line $.";
             }
-            if ($field eq 'bugs' and not m/\.debian\.org/) {
-                tag 'bugs-field-does-not-refer-to-debian-infrastructure', "line $.";
-            }
             unless (/^\S+: \S/ || /^\S+:$/) {
                 tag 'debian-control-has-unusual-field-spacing', "line $.";
             }
diff --git a/checks/fields.desc b/checks/fields.desc
index 64f4e6d..ec64837 100644
--- a/checks/fields.desc
+++ b/checks/fields.desc
@@ -1361,3 +1361,13 @@ Tag: vcs-fields-use-more-than-one-vcs
 Severity: wishlist
 Certainty: possible
 Info: The Vcs-* fields mix more than one version control system.
+
+Tag: bugs-field-does-not-refer-to-debian-infrastructure
+Severity: normal
+Certainty: possible
+Info: The <tt>debian/control</tt> file contains an Bugs field that does
+ not refer to Debian infrastructure. This is recognized by the string
+ ".debian.org".
+ .
+ This can likely to make reportbug unable to report bugs.
+Ref: #740944
diff --git a/checks/fields.pm b/checks/fields.pm
index 8c8a749..5651b94 100644
--- a/checks/fields.pm
+++ b/checks/fields.pm
@@ -1235,6 +1235,9 @@ sub run {
 
         tag 'redundant-bugs-field'
           if $bugs =~ m,^debbugs://bugs.debian.org/?$,i;
+
+        tag 'bugs-field-does-not-refer-to-debian-infrastructure', "line $."
+          if $bugs !~ m,\.debian\.org,;
     }
 
     #----- Python-Version
diff --git a/debian/changelog b/debian/changelog
index bb75512..f6b5704 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,10 +2,6 @@ lintian (2.5.66) UNRELEASED; urgency=medium
 
   XXX: generate tag summary
 
-  * checks/control-file.{pm,desc}:
-    + [CL] Warn when packages specify a "Bugs" field in debian/control that
-      does not refer to official Debian infrastructure as this can make
-      reportbug unable to report bugs.  (Closes: #741071)
   * checks/cruft.{pm,desc}:
     + [CL] Check for packages that invoke AC_PATH_PROG without considering
       cross-compilation. Thanks to Helmut Grohne for the idea and
@@ -13,6 +9,9 @@ lintian (2.5.66) UNRELEASED; urgency=medium
   * 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)
+    + [CL] Warn when packages specify a "Bugs" field in debian/control that
+      does not refer to official Debian infrastructure as this can make
+      reportbug unable to report bugs.  (Closes: #741071)
   * 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/control-file-pedantic/debian/debian/control.in b/t/tests/control-file-pedantic/debian/debian/control.in
index b581755..d5c5a1b 100644
--- a/t/tests/control-file-pedantic/debian/debian/control.in
+++ b/t/tests/control-file-pedantic/debian/debian/control.in
@@ -6,14 +6,12 @@ Standards-Version: {$standards_version}
 Build-Depends: {$build_depends}
 Rules-Requires-Root: no
 Homepage: https://lintian.debian.org/
-Bugs: https://example.org/
 
 Package: {$source}-udeb
 Section: debian-installer
 Architecture: {$architecture}
 Depends: $\{misc:Depends\}
 XC-Package-Type: udeb
-Bugs: debbugs://bugs.debian.org/
 Description: {$description}
  This is a test package designed to exercise some feature or tag of
  Lintian.  It is part of the Lintian test suite and may do very odd
diff --git a/t/tests/control-file-pedantic/desc b/t/tests/control-file-pedantic/desc
index be929c5..4847b55 100644
--- a/t/tests/control-file-pedantic/desc
+++ b/t/tests/control-file-pedantic/desc
@@ -4,5 +4,4 @@ Skeleton: pedantic
 Options: --pedantic -I -E
 Description: Pedantic tests for control file issues
 Test-For:
- bugs-field-does-not-refer-to-debian-infrastructure
  xc-package-type-in-debian-control
diff --git a/t/tests/control-file-pedantic/tags b/t/tests/control-file-pedantic/tags
index dc8318f..9d820b2 100644
--- a/t/tests/control-file-pedantic/tags
+++ b/t/tests/control-file-pedantic/tags
@@ -1,2 +1 @@
-P: control-file-pedantic source: xc-package-type-in-debian-control line 15
-W: control-file-pedantic source: bugs-field-does-not-refer-to-debian-infrastructure line 9
+P: control-file-pedantic source: xc-package-type-in-debian-control line 14
diff --git a/t/tests/control-file-pedantic/debian/debian/control.in b/t/tests/fields-bugs-field-does-not-refer-to-debian-infrastructure-unrel/debian/debian/control.in
similarity index 79%
copy from t/tests/control-file-pedantic/debian/debian/control.in
copy to t/tests/fields-bugs-field-does-not-refer-to-debian-infrastructure-unrel/debian/debian/control.in
index b581755..88a4eb6 100644
--- a/t/tests/control-file-pedantic/debian/debian/control.in
+++ b/t/tests/fields-bugs-field-does-not-refer-to-debian-infrastructure-unrel/debian/debian/control.in
@@ -6,14 +6,11 @@ Standards-Version: {$standards_version}
 Build-Depends: {$build_depends}
 Rules-Requires-Root: no
 Homepage: https://lintian.debian.org/
-Bugs: https://example.org/
+Bugs: mailto:debian-backports@lists.debian.org
 
-Package: {$source}-udeb
-Section: debian-installer
+Package: {$source}
 Architecture: {$architecture}
 Depends: $\{misc:Depends\}
-XC-Package-Type: udeb
-Bugs: debbugs://bugs.debian.org/
 Description: {$description}
  This is a test package designed to exercise some feature or tag of
  Lintian.  It is part of the Lintian test suite and may do very odd
diff --git a/t/tests/fields-bugs-field-does-not-refer-to-debian-infrastructure-unrel/desc b/t/tests/fields-bugs-field-does-not-refer-to-debian-infrastructure-unrel/desc
new file mode 100644
index 0000000..47fa408
--- /dev/null
+++ b/t/tests/fields-bugs-field-does-not-refer-to-debian-infrastructure-unrel/desc
@@ -0,0 +1,5 @@
+Testname: fields-bugs-field-does-not-refer-to-debian-infrastructure-unrel
+Version: 1.0
+Description: Check for Bugs: field parsing false positive
+Test-Against:
+ bugs-field-does-not-refer-to-debian-infrastructure
diff --git a/t/tests/fields-bugs-field-does-not-refer-to-debian-infrastructure-unrel/tags b/t/tests/fields-bugs-field-does-not-refer-to-debian-infrastructure-unrel/tags
new file mode 100644
index 0000000..e69de29
diff --git a/t/tests/control-file-pedantic/debian/debian/control.in b/t/tests/fields-bugs-field-does-not-refer-to-debian-infrastructure/debian/debian/control.in
similarity index 79%
copy from t/tests/control-file-pedantic/debian/debian/control.in
copy to t/tests/fields-bugs-field-does-not-refer-to-debian-infrastructure/debian/debian/control.in
index b581755..5255130 100644
--- a/t/tests/control-file-pedantic/debian/debian/control.in
+++ b/t/tests/fields-bugs-field-does-not-refer-to-debian-infrastructure/debian/debian/control.in
@@ -6,14 +6,11 @@ Standards-Version: {$standards_version}
 Build-Depends: {$build_depends}
 Rules-Requires-Root: no
 Homepage: https://lintian.debian.org/
-Bugs: https://example.org/
+Bugs: https://upstream.org/
 
-Package: {$source}-udeb
-Section: debian-installer
+Package: {$source}
 Architecture: {$architecture}
 Depends: $\{misc:Depends\}
-XC-Package-Type: udeb
-Bugs: debbugs://bugs.debian.org/
 Description: {$description}
  This is a test package designed to exercise some feature or tag of
  Lintian.  It is part of the Lintian test suite and may do very odd
diff --git a/t/tests/fields-bugs-field-does-not-refer-to-debian-infrastructure/desc b/t/tests/fields-bugs-field-does-not-refer-to-debian-infrastructure/desc
new file mode 100644
index 0000000..f9432b3
--- /dev/null
+++ b/t/tests/fields-bugs-field-does-not-refer-to-debian-infrastructure/desc
@@ -0,0 +1,5 @@
+Testname: fields-bugs-field-does-not-refer-to-debian-infrastructure
+Version: 1.0
+Description: Check for packages with invalid Bugs fields
+Test-For:
+ bugs-field-does-not-refer-to-debian-infrastructure
diff --git a/t/tests/fields-bugs-field-does-not-refer-to-debian-infrastructure/tags b/t/tests/fields-bugs-field-does-not-refer-to-debian-infrastructure/tags
new file mode 100644
index 0000000..c589b02
--- /dev/null
+++ b/t/tests/fields-bugs-field-does-not-refer-to-debian-infrastructure/tags
@@ -0,0 +1 @@
+W: fields-bugs-field-does-not-refer-to-debian-infrastructure: bugs-field-does-not-refer-to-debian-infrastructure line 11

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


Reply to: