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

[lintian] 01/01: c/fields: Emit tag for priority extra



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

nthykier pushed a commit to branch master
in repository lintian.

commit 52766dc7364d318bcc1a6daeea514f3c9d017a62
Author: Niels Thykier <niels@thykier.net>
Date:   Sun Oct 8 06:26:39 2017 +0000

    c/fields: Emit tag for priority extra
    
    Signed-off-by: Niels Thykier <niels@thykier.net>
---
 checks/fields.desc                                    | 10 ++++++++++
 checks/fields.pm                                      |  9 ++++++++-
 data/common/priorities                                | 14 --------------
 data/fields/priorities                                |  9 +++++++++
 debian/changelog                                      |  7 +++++++
 t/tests/fields-bad-homepage/debian/debian/control.in  | 19 -------------------
 t/tests/fields-bad-homepage/desc                      |  6 ------
 t/tests/fields-bad-homepage/tags                      |  2 --
 t/tests/fields-debug-bad/desc                         |  5 -----
 t/tests/fields-debug-bad/tags                         |  5 -----
 .../debian/debian/control.in                          | 17 +++++++++++------
 t/tests/fields-general/desc                           |  9 +++++++++
 t/tests/fields-general/tags                           |  5 +++++
 13 files changed, 59 insertions(+), 58 deletions(-)

diff --git a/checks/fields.desc b/checks/fields.desc
index 0bd8cf9..43f10f0 100644
--- a/checks/fields.desc
+++ b/checks/fields.desc
@@ -1321,3 +1321,13 @@ Info: The Built-Using field contains invalid fields.
  .
  Only first issue is shown.
 Ref: policy 7.8
+
+Tag: priority-extra-is-replaced-by-priority-optional
+Severity: minor
+Certainty: certain
+Info: Since Debian Policy version 4.0.1, the priority <tt>extra</tt>
+ has been deprecated.
+ .
+ Please update <tt>debian/control</tt> and replace all instances of
+ <tt>Priority: extra</tt> with <tt>Priority: optional</tt>.
+Ref: policy 2.5
diff --git a/checks/fields.pm b/checks/fields.pm
index ae60df5..cd9790f 100644
--- a/checks/fields.pm
+++ b/checks/fields.pm
@@ -54,7 +54,7 @@ our $KNOWN_BUILD_PROFILES = Lintian::Data->new('fields/build-profiles');
 
 our %KNOWN_ARCHIVE_PARTS = map { $_ => 1 } ('non-free', 'contrib');
 
-my $KNOWN_PRIOS = Lintian::Data->new('common/priorities', qr/\s*=\s*/o);
+my $KNOWN_PRIOS = Lintian::Data->new('fields/priorities');
 
 our @supported_source_formats = (qr/1\.0/, qr/3\.0\s*\((quilt|native)\)/);
 
@@ -577,6 +577,13 @@ sub run {
 
         unfold('priority', \$priority);
 
+        if ($priority eq 'extra') {
+            tag 'priority-extra-is-replaced-by-priority-optional';
+            # Re-map to optional to avoid an additional warning from
+            # lintian
+            $priority = 'optional';
+        }
+
         tag 'unknown-priority', $priority
           unless $KNOWN_PRIOS->known($priority);
     }
diff --git a/data/common/priorities b/data/common/priorities
deleted file mode 100644
index 937b9dc..0000000
--- a/data/common/priorities
+++ /dev/null
@@ -1,14 +0,0 @@
-# Manually maintained map of priorities
-#
-# It is used by checks/fields to validate the priority fields and
-# checks/group-checks to check policy §2.5.  The numbers are used for
-# the latter (allowing a trivial <= comparison)
-#
-# Do not use a non-integer nor a false-value on the right-hand side.
-
-required  = 5
-important = 4
-standard  = 3
-optional  = 2
-extra     = 1
-
diff --git a/data/fields/priorities b/data/fields/priorities
new file mode 100644
index 0000000..47412d1
--- /dev/null
+++ b/data/fields/priorities
@@ -0,0 +1,9 @@
+# Manually maintained map of priorities
+#
+# It is used by checks/fields to validate the priority fields.
+
+required
+important
+standard
+optional
+
diff --git a/debian/changelog b/debian/changelog
index 15c151c..cc6c065 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -9,6 +9,9 @@ lintian (2.5.55) UNRELEASED; urgency=medium
   * checks/debhelper.pm:
     + [AB] Also recognize dh-exec's "=>" arrow if surrounded by tabs.
       (Closes: #877905)
+  * checks/fields.{desc,pm}:
+    + [NT] Add an info tag for packages that use "Priority: extra".  Thanks
+      to Mattia Rizzolo for the suggestion.  (Closes: #870898)
   * checks/files.pm:
     + [CL] Ignore privacy breach violations in comments.  (Closes: #877421)
   * checks/{files,manpages,menu-format}.{desc,pm}:
@@ -38,10 +41,14 @@ lintian (2.5.55) UNRELEASED; urgency=medium
     + [CL] Warn for debian/watch files using insecure URIs such as HTTP or
       FTP, similar to vcs-field-uses-insecure-uri.  (Closes: #849515)
 
+  * data/{common => fields}/priorities:
+   + [NT] Rename file.
   * data/fields/essential:
     + [MR] Remove 'mount' from the essential packages.  Starting with
       util-linux version 2.29.2-3 the Essential flag has been removed.
       (Closes: #877511)
+  * data/fields/priorities:
+    + [NT] Remove "extra".
 
   * commands/lintian.pm:
     + [NT] Simplify handling of uncaught exceptions.
diff --git a/t/tests/fields-bad-homepage/debian/debian/control.in b/t/tests/fields-bad-homepage/debian/debian/control.in
deleted file mode 100644
index 7d23acb..0000000
--- a/t/tests/fields-bad-homepage/debian/debian/control.in
+++ /dev/null
@@ -1,19 +0,0 @@
-Source: {$source}
-Priority: optional
-Section: {$section}
-Maintainer: {$author}
-Standards-Version: {$standards_version}
-Build-Depends: {$build_depends}
-# Whoops, typo
-Homepage: ttp://lintian.debian.org/
-
-Package: {$source}
-Architecture: {$architecture}
-Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
-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
- things.  It should not be installed like a regular package.  It may
- be an empty package.
-# ... and some unneeded <>
-Homepage: <http://lintian.debian.org/>
diff --git a/t/tests/fields-bad-homepage/desc b/t/tests/fields-bad-homepage/desc
deleted file mode 100644
index 17302f0..0000000
--- a/t/tests/fields-bad-homepage/desc
+++ /dev/null
@@ -1,6 +0,0 @@
-Testname: fields-bad-homepage
-Version: 1.0
-Description: Test for invalid Homepage protocol
-Test-For:
- bad-homepage
- superfluous-clutter-in-homepage
diff --git a/t/tests/fields-bad-homepage/tags b/t/tests/fields-bad-homepage/tags
deleted file mode 100644
index 88c1ce9..0000000
--- a/t/tests/fields-bad-homepage/tags
+++ /dev/null
@@ -1,2 +0,0 @@
-W: fields-bad-homepage source: bad-homepage ttp://lintian.debian.org/
-W: fields-bad-homepage: superfluous-clutter-in-homepage <http://lintian.debian.org/>
diff --git a/t/tests/fields-debug-bad/desc b/t/tests/fields-debug-bad/desc
deleted file mode 100644
index f2632fb..0000000
--- a/t/tests/fields-debug-bad/desc
+++ /dev/null
@@ -1,5 +0,0 @@
-Testname: fields-debug-bad
-Version: 1.0
-Description: Test for tags related to debug pkgs
-Test-For:
- dbg-package-missing-depends
diff --git a/t/tests/fields-debug-bad/tags b/t/tests/fields-debug-bad/tags
deleted file mode 100644
index 6007dbc..0000000
--- a/t/tests/fields-debug-bad/tags
+++ /dev/null
@@ -1,5 +0,0 @@
-I: fields-debug-bad source: duplicate-long-description fields-debug-bad-dbg fields-debug-bad-debug
-I: fields-debug-bad source: duplicate-short-description fields-debug-bad-dbg fields-debug-bad-debug
-W: fields-debug-bad source: dbg-package-missing-depends fields-debug-bad-dbg
-W: fields-debug-bad-debug: wrong-section-according-to-package-name fields-debug-bad-debug
-X: fields-debug-bad source: debian-control-has-obsolete-dbg-package fields-debug-bad-dbg
diff --git a/t/tests/fields-debug-bad/debian/debian/control.in b/t/tests/fields-general/debian/debian/control.in
similarity index 73%
rename from t/tests/fields-debug-bad/debian/debian/control.in
rename to t/tests/fields-general/debian/debian/control.in
index 81b1e1e..c434c11 100644
--- a/t/tests/fields-debug-bad/debian/debian/control.in
+++ b/t/tests/fields-general/debian/debian/control.in
@@ -4,37 +4,42 @@ Section: {$section}
 Maintainer: {$author}
 Standards-Version: {$standards_version}
 Build-Depends: {$build_depends}
+Homepage: http://lintian.debian.org/
 
 Package: {$source}
 Architecture: {$architecture}
-Depends: $\{misc:Depends\}
+Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
 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
  things.  It should not be installed like a regular package.  It may
  be an empty package.
+# Whoops, typo
+Homepage: ttp://lintian.debian.org/
 
 Package: {$source}-dbg
 Section: debug
 Architecture: {$architecture}
-Depends: $\{misc:Depends\}
+Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
 Description: {$description} (dbg)
  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
  things.  It should not be installed like a regular package.  It may
  be an empty package.
  .
- The debug package.
+ The debug package (dbg)g.
+# ... and some unneeded <>
+Homepage: <http://lintian.debian.org/>
 
 Package: {$source}-debug
 Section: debug
 Architecture: {$architecture}
-Depends: $\{misc:Depends\}
-Description: {$description} (dbg)
+Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
+Description: {$description} (debug)
  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
  things.  It should not be installed like a regular package.  It may
  be an empty package.
  .
- The debug package.
+ The debug package (debug).
 
diff --git a/t/tests/fields-general/desc b/t/tests/fields-general/desc
new file mode 100644
index 0000000..d68c06f
--- /dev/null
+++ b/t/tests/fields-general/desc
@@ -0,0 +1,9 @@
+Testname: fields-general
+Version: 1.0
+Description: Test for tags related to minor field issues
+Test-For:
+ bad-homepage
+ dbg-package-missing-depends
+ debian-control-has-obsolete-dbg-package
+ superfluous-clutter-in-homepage
+ wrong-section-according-to-package-name
diff --git a/t/tests/fields-general/tags b/t/tests/fields-general/tags
new file mode 100644
index 0000000..7d914ca
--- /dev/null
+++ b/t/tests/fields-general/tags
@@ -0,0 +1,5 @@
+W: fields-general source: dbg-package-missing-depends fields-general-dbg
+W: fields-general-dbg: superfluous-clutter-in-homepage <http://lintian.debian.org/>
+W: fields-general-debug: wrong-section-according-to-package-name fields-general-debug
+W: fields-general: bad-homepage ttp://lintian.debian.org/
+X: fields-general source: debian-control-has-obsolete-dbg-package fields-general-dbg

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


Reply to: