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

[SCM] Debian package checker branch, master, updated. 2.2.8-9-g91585f2



The following commit has been merged in the master branch:
commit 91585f28775234c9310aa3db63f89d74d9f27989
Author: Frank Lichtenheld <djpig@debian.org>
Date:   Sat Mar 28 16:54:15 2009 +0100

    check/fields: Add package name checks for the new sections
    
    Use this  opportunity to move all these checks to one tag
    "wrong-section-according-to-package-name" instead of one tag per section.

diff --git a/checks/fields b/checks/fields
index 221eae9..ba66428 100644
--- a/checks/fields
+++ b/checks/fields
@@ -191,6 +191,23 @@ my @GLOBAL_CLEAN_BYPASS = (
 	qr'^\s+dh\s+'
 );
 
+# Mapping of package names to section names
+my @NAME_SECTION_MAPPINGS = (
+    [ qr/-docs?$/      => 'doc'      ],
+    [ qr/-dbg$/        => 'debug'    ],
+    [ qr/^python-/     => 'python'   ],
+    [ qr/^r-cran-/     => 'gnu-r'    ],
+    [ qr/^lib.*-perl$/ => 'perl'     ],
+    [ qr/^lib.*-cil$/  => 'cli-mono' ],
+    [ qr/^lib.*-java$/ => 'java'     ],
+    [ qr/^(?:lib)php-/ => 'php'      ],
+    [ qr/^lib(?:hugs|ghc6)-/ => 'haskell'   ],
+    [ qr/^lib.*-ruby(?:1\.\d)?$/ => 'ruby'  ],
+    [ qr/^lib.*-ocaml-dev$/ => 'ocaml'      ],
+    [ qr/^lib.*-dev$/  => 'libdevel' ],
+);
+
+
 our $PERL_CORE_PROVIDES = Lintian::Data->new('fields/perl-provides', '\s+');
 our $OBSOLETE_PACKAGES  = Lintian::Data->new('fields/obsolete-packages');
 our $VIRTUAL_PACKAGES   = Lintian::Data->new('fields/virtual-packages');
@@ -432,19 +449,13 @@ if (not defined $info->field('section')) {
 	    }
 
 	    # Check package name <-> section.
-	    if ($pkg =~ /-docs?$/) {
-		tag "doc-package-should-be-section-doc", $pkg
-		    unless $parts[-1] eq 'doc';
-	    } elsif ($pkg =~ /^lib.*-perl$/) {
-		tag "perl-package-should-be-section-perl", $pkg
-		    unless $parts[-1] eq 'perl';
-	    } elsif ($pkg =~ /^python-/) {
-		tag "python-package-should-be-section-python", $pkg
-		    unless $parts[-1] eq 'python';
-	    } elsif ($pkg =~ /^lib.*-dev$/) {
-                tag "dev-package-should-be-section-libdevel", $pkg
-                    unless $parts[-1] eq 'libdevel';
-            }
+	    foreach my $map (@NAME_SECTION_MAPPINGS) {
+		if ($pkg =~ $map->[0]) {
+		    tag "wrong-section-according-to-package-name", "$pkg => $map->[1]"
+			unless $parts[-1] eq $map->[1];
+		    last;
+		}
+	    }
         }
 }
 
diff --git a/checks/fields.desc b/checks/fields.desc
index 37f851e..22c09f2 100644
--- a/checks/fields.desc
+++ b/checks/fields.desc
@@ -908,30 +908,11 @@ Info: The Dm-Upload-Allowed field in this package is set to something
  Debian GR is "yes" and other values (including capitalization variants)
  may not work as expected.
 
-Tag: doc-package-should-be-section-doc
+Tag: wrong-section-according-to-package-name
 Severity: normal
 Certainty: certain
-Info: This package has a name suggesting that it contains only
- documentation.  If so, it should be in section "doc".
-
-Tag: python-package-should-be-section-python
-Severity: normal
-Certainty: certain
-Info: This package has a name suggesting that it is a Python extension or
- part of the Python environment.  If so, it should be in section
- "python".
-
-Tag: perl-package-should-be-section-perl
-Severity: normal
-Certainty: certain
-Info: This package has a name suggesting that it is a Perl module package.
- If so, it should be in section "perl".
-
-Tag: dev-package-should-be-section-libdevel
-Severity: normal
-Certainty: certain
-Info: This package has a name suggesting that it is a library development
- package.  If so, it should be in section "libdevel".
+Info: This package has a name suggesting that it belongs to a section
+ other than the one it is currently categorized in.
 
 Tag: debug-package-should-be-priority-extra
 Severity: normal
diff --git a/debian/changelog b/debian/changelog
index 17d71e3..326798d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,14 @@
 lintian (2.2.9) UNRELEASED; urgency=low
 
+  * Summary of tag changes:
+    + Added:
+       - wrong-section-according-to-package-name
+    + Removed:
+       - dev-package-should-be-section-libdevel
+       - doc-package-should-be-section-doc
+       - perl-package-should-be-section-perl
+       - python-package-should-be-section-python
+  
   * checks/deb-format.desc:
     + [RA] In the tag description, the first required element should be
       debian-binary, not debian-control.  Thanks, Judit Foglszinger.
@@ -8,6 +17,9 @@ lintian (2.2.9) UNRELEASED; urgency=low
     + [FL] Update list of valid sections.
     + [RA] Fix dbg-package-missing-depends check when the dependency is
       followed by a comma.  (Closes: #520640)
+    + [FL] Add package name checks for the new sections. Use this opportunity
+      to move all these checks to one tag "wrong-section-according-to-package-name"
+      instead of one tag per section.
   * checks/lintian.desc:
     + [CW] Add karmic as an allowable distribution for Ubuntu (thanks, Soren
       Hansen).
diff --git a/t/tests/fields-wrong-section/debian/debian/control.in b/t/tests/fields-wrong-section/debian/debian/control.in
index 131c68d..79d6aba 100644
--- a/t/tests/fields-wrong-section/debian/debian/control.in
+++ b/t/tests/fields-wrong-section/debian/debian/control.in
@@ -5,6 +5,16 @@ Maintainer: {$author}
 Standards-Version: 3.8.1
 Build-Depends: debhelper (>= 7)
 
+Package: {$srcpkg}
+Architecture: any
+Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
+Description: {$description}
+ Only here as valid dependency for {$srcpkg}-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.
+
 Package: {$srcpkg}-doc
 Architecture: {$architecture}
 Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
@@ -15,6 +25,16 @@ Description: {$description} (doc)
  Lintian.  It is part of the Lintian test suite and may do very odd
  things.  It should not be installed like a regular package.
 
+Package: {$srcpkg}-dbg
+Architecture: any
+Depends: $\{shlibs:Depends\}, $\{misc:Depends\}, {$srcpkg} (= $\{binary:Version\})
+Description: {$description} (debug)
+ Test for debug section.
+ .
+ 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.
+
 Package: lib{$srcpkg}-dev
 Architecture: {$architecture}
 Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
@@ -44,3 +64,73 @@ Description: {$description} (Python)
  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.
+
+Package: lib{$srcpkg}-ocaml-dev
+Architecture: {$architecture}
+Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
+Description: {$description} (OCaml)
+ Test for OCaml section.
+ .
+ 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.
+
+Package: libghc6-{$srcpkg}
+Architecture: {$architecture}
+Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
+Description: {$description} (Haskell)
+ Test for Haskell section.
+ .
+ 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.
+
+Package: lib{$srcpkg}-cil
+Architecture: {$architecture}
+Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
+Description: {$description} (CLI/Mono)
+ Test for CLI/Mono section.
+ .
+ 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.
+
+Package: libphp-{$srcpkg}
+Architecture: {$architecture}
+Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
+Description: {$description} (PHP)
+ Test for PHP section.
+ .
+ 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.
+
+Package: lib{$srcpkg}-ruby1.8
+Architecture: {$architecture}
+Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
+Description: {$description} (Ruby)
+ Test for Ruby section.
+ .
+ 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.
+
+Package: lib{$srcpkg}-java
+Architecture: {$architecture}
+Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
+Description: {$description} (Java)
+ Test for Java section.
+ .
+ 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.
+
+Package: r-cran-{$srcpkg}
+Architecture: {$architecture}
+Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
+Description: {$description} (GNU R)
+ Test for GNU R section.
+ .
+ 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.
diff --git a/t/tests/fields-wrong-section/desc b/t/tests/fields-wrong-section/desc
index 9794d92..76d492f 100644
--- a/t/tests/fields-wrong-section/desc
+++ b/t/tests/fields-wrong-section/desc
@@ -3,7 +3,4 @@ Sequence: 6000
 Version: 1.0
 Description: Packages placed in the wrong sections
 Test-For:
- doc-package-should-be-section-doc
- dev-package-should-be-section-libdevel
- perl-package-should-be-section-perl
- python-package-should-be-section-python
+ wrong-section-according-to-package-name
diff --git a/t/tests/fields-wrong-section/tags b/t/tests/fields-wrong-section/tags
index ca8e33c..5d961be 100644
--- a/t/tests/fields-wrong-section/tags
+++ b/t/tests/fields-wrong-section/tags
@@ -1,4 +1,12 @@
-W: fields-wrong-section-doc: doc-package-should-be-section-doc fields-wrong-section-doc
-W: libfields-wrong-section-dev: dev-package-should-be-section-libdevel libfields-wrong-section-dev
-W: libfields-wrong-section-perl: perl-package-should-be-section-perl libfields-wrong-section-perl
-W: python-fields-wrong-section: python-package-should-be-section-python python-fields-wrong-section
+W: fields-wrong-section-dbg: wrong-section-according-to-package-name fields-wrong-section-dbg => debug
+W: fields-wrong-section-doc: wrong-section-according-to-package-name fields-wrong-section-doc => doc
+W: libfields-wrong-section-cil: wrong-section-according-to-package-name libfields-wrong-section-cil => cli-mono
+W: libfields-wrong-section-dev: wrong-section-according-to-package-name libfields-wrong-section-dev => libdevel
+W: libfields-wrong-section-java: wrong-section-according-to-package-name libfields-wrong-section-java => java
+W: libfields-wrong-section-ocaml-dev: wrong-section-according-to-package-name libfields-wrong-section-ocaml-dev => ocaml
+W: libfields-wrong-section-perl: wrong-section-according-to-package-name libfields-wrong-section-perl => perl
+W: libfields-wrong-section-ruby1.8: wrong-section-according-to-package-name libfields-wrong-section-ruby1.8 => ruby
+W: libghc6-fields-wrong-section: wrong-section-according-to-package-name libghc6-fields-wrong-section => haskell
+W: libphp-fields-wrong-section: wrong-section-according-to-package-name libphp-fields-wrong-section => php
+W: python-fields-wrong-section: wrong-section-according-to-package-name python-fields-wrong-section => python
+W: r-cran-fields-wrong-section: wrong-section-according-to-package-name r-cran-fields-wrong-section => gnu-r
diff --git a/testset/debug/debian/control b/testset/debug/debian/control
index 148de29..8c36a9f 100644
--- a/testset/debug/debian/control
+++ b/testset/debug/debian/control
@@ -19,6 +19,7 @@ Description: Test for external debugging information
 
 Package: hello-dbg
 Priority: extra
+Section: debug
 Architecture: alpha amd64 arm hppa hurd-i386 i386 ia64 kfreebsd-i386 m68k mips mipsel powerpc ppc64 s390 sparc
 Depends: hello (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}
 Description: Test for external debugging information (symbols)
@@ -42,7 +43,7 @@ Description: Test for external debugging information (library)
  things.  It should not be installed like a regular package.
 
 Package: libhello0-dbg
-Section: libdevel
+Section: debug
 Priority: extra
 Architecture: alpha amd64 arm hppa hurd-i386 i386 ia64 kfreebsd-i386 m68k mips mipsel powerpc ppc64 s390 sparc
 Depends: libhello (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}
@@ -55,7 +56,7 @@ Description: Test for external debugging information (library symbols)
  things.  It should not be installed like a regular package.
 
 Package: hi-dbg
-Section: libdevel
+Section: debug
 Priority: extra
 Architecture: any
 Depends: foo-pkg, not-libhello0
@@ -68,7 +69,7 @@ Description: Test for external debugging symbols
  things.  It should not be installed like a regular package.
 
 Package: hello-hello-dbg
-Section: devel
+Section: debug
 Priority: extra
 Architecture: any
 Depends: foo-pkg, not-libhello0, hello
diff --git a/testset/tags.libbaz b/testset/tags.libbaz
index 4f7c167..1e8db06 100644
--- a/testset/tags.libbaz
+++ b/testset/tags.libbaz
@@ -42,7 +42,7 @@ W: libbaz source: native-package-with-dash-version
 W: libbaz source: package-lacks-versioned-build-depends-on-debhelper 6
 W: libbaz source: source-nmu-has-incorrect-version-number 1-1
 W: libbaz source: substvar-source-version-is-deprecated libbaz2-dev
-W: libbaz1-dev: dev-package-should-be-section-libdevel libbaz1-dev
+W: libbaz1-dev: wrong-section-according-to-package-name libbaz1-dev => libdevel
 W: libbaz1: missing-depends-line
 W: libbaz1: new-package-should-close-itp-bug
 W: libbaz1: package-name-doesnt-match-sonames libbaz libbaz2-1.0 libbaz3-1
@@ -62,8 +62,9 @@ W: libbaz1: unused-shlib-entry-in-control-file udeb: libdoesntexist2 1.0
 W: libbaz1: unused-shlib-entry-in-symbols-control-file libbaz 2
 W: libbaz1: zero-byte-file-in-doc-directory usr/share/doc/README.Debian
 W: libbaz2-dbg: debug-package-should-be-priority-extra libbaz2-dbg
-W: libbaz2-dev: dev-package-should-be-section-libdevel libbaz2-dev
+W: libbaz2-dbg: wrong-section-according-to-package-name libbaz2-dbg => debug
 W: libbaz2-dev: new-package-should-close-itp-bug
+W: libbaz2-dev: wrong-section-according-to-package-name libbaz2-dev => libdevel
 W: libbaz2: debian-changelog-file-is-a-symlink
 W: libbaz2: package-name-doesnt-match-sonames libbaz2-1.0
 W: libbaz2: symlink-should-be-relative usr/share/doc/libbaz2/changelog.gz /usr/share/doc/lintian/changelog.gz

-- 
Debian package checker


Reply to: