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

[SCM] Debian package checker branch, master, updated. 2.1.4-2-g133270b



The following commit has been merged in the master branch:
commit 133270be3bc08cecd6cd1856f3d64af90f010421
Author: Russ Allbery <rra@debian.org>
Date:   Fri Jan 9 22:27:22 2009 -0800

    Tag duplicate long or short descriptions
    
    * checks/control-file{,.desc}:
      + [RA] Tag (severity: wishlist) duplicate short or long descriptions
        in packages built from the same source.  (Closes: #30020)

diff --git a/checks/control-file b/checks/control-file
index 7db82f7..1a8e8d1 100644
--- a/checks/control-file
+++ b/checks/control-file
@@ -113,6 +113,9 @@ for my $control (@binary_controls) {
 # expected archive category from the first binary package by leaving $category
 # undefined until parsing the first binary section.  Missing sections will be
 # caught by other checks.
+#
+# Also accumulate short and long descriptions for each package so that we can
+# check for duplication.
 my $category;
 if ($header->{'section'}) {
 	if ($header->{'section'} =~ m%^([^/]+)/%) {
@@ -123,7 +126,10 @@ if ($header->{'section'}) {
 } else {
 	tag "no-section-field-for-source", "";
 }
+my @descriptions;
 for my $binary_control (@binary_controls) {
+	push(@descriptions, [ $binary_control->{'package'}, split("\n", $binary_control->{'description'}, 2) ])
+	    if $binary_control->{'description'};
 	next unless $binary_control->{'section'};
 	if (!defined ($category)) {
 		if ($binary_control->{'section'} =~ m%^([^/]+)/%) {
@@ -139,6 +145,31 @@ for my $binary_control (@binary_controls) {
 		if (!$category && $binary_control->{'section'} =~ m%^([^/]+)/% && $1 ne 'contrib');
 }
 
+# Check for duplicate descriptions.
+my (%seen_short, %seen_long);
+for my $i (0 .. $#descriptions) {
+	my (@short, @long);
+	for my $j (($i + 1) .. $#descriptions) {
+		if ($descriptions[$i][1] eq $descriptions[$j][1]) {
+			my $package = $descriptions[$j][0];
+			push(@short, $package) unless $seen_short{$package};
+		}
+		next unless ($descriptions[$i][2] and $descriptions[$j][2]);
+		if ($descriptions[$i][2] eq $descriptions[$j][2]) {
+			my $package = $descriptions[$j][0];
+			push(@long, $package) unless $seen_long{$package};
+		}
+	}
+	if (@short) {
+		tag 'duplicate-short-description', $descriptions[$i][0], @short;
+		for (@short) { $seen_short{$_} = 1 }
+	}
+	if (@long) {
+		tag 'duplicate-long-description', $descriptions[$i][0], @long;
+		for (@long) { $seen_long{$_} = 1 }
+	}
+}
+
 }
 
 1;
diff --git a/checks/control-file.desc b/checks/control-file.desc
index c2011be..0aba219 100644
--- a/checks/control-file.desc
+++ b/checks/control-file.desc
@@ -103,3 +103,21 @@ Info: The given package declares a dependency on itself in its
  silently fix this problem by removing the dependency, but it may indicate
  a more subtle bug (misspelling or cutting and pasting the wrong package
  name).
+
+Tag: duplicate-short-description
+Severity: wishlist
+Certainty: possible
+Info: The listed binary packages all share the same short description (the
+ first line of the Description control field).  The package names may
+ provide enough additional information to distinguish between the
+ packages, but it's common to also add a word or two to the short
+ description to clarify the difference.
+
+Tag: duplicate-long-description
+Severity: wishlist
+Certainty: certain
+Info: The listed binary packages all share the same extended description.
+ Some additional information in the extended description explaining what
+ is in each package and how it differs from the other packages is useful,
+ particularly for users who arne't familiar with Debian's package naming
+ conventions.
diff --git a/debian/changelog b/debian/changelog
index 6d70668..c364396 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,13 @@
 lintian (2.1.5) UNRELEASED; urgency=low
 
+  * Summary of tag changes:
+    + Added
+      - duplicate-long-description
+      - duplicate-short-description
+
+  * checks/control-file{,.desc}:
+    + [RA] Tag (severity: wishlist) duplicate short or long descriptions
+      in packages built from the same source.  (Closes: #30020)
   * checks/rules:
     + [RA] Consider a define command to be the end of a list of target
       commands, avoiding binary-arch-rules-but-pkg-is-arch-indep false
diff --git a/t/tests/6000_control-file-general.desc b/t/tests/6000_control-file-general.desc
index 520c2d4..668a26b 100644
--- a/t/tests/6000_control-file-general.desc
+++ b/t/tests/6000_control-file-general.desc
@@ -4,6 +4,9 @@ Description: Various problems with debian/control
 Test-For:
  binary-control-field-duplicates-source
  build-info-in-binary-control-file-section
+ duplicate-long-description
+ duplicate-short-description
  no-section-field-for-source
  package-depends-on-itself
  stronger-dependency-implies-weaker
+References: Debian Bug#30020
diff --git a/t/tests/control-file-general/debian/debian/control.in b/t/tests/control-file-general/debian/debian/control.in
index 567bd11..c8f4c24 100644
--- a/t/tests/control-file-general/debian/debian/control.in
+++ b/t/tests/control-file-general/debian/debian/control.in
@@ -17,3 +17,21 @@ 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.
+
+Package: {$srcpkg}-1
+Section: {$section}
+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.
+
+Package: {$srcpkg}-2
+Section: {$section}
+Architecture: {$architecture}
+Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
+Description: {$description} (two)
+ 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/control-file-general/tags b/t/tests/control-file-general/tags
index f9d5db2..fc2c4e0 100644
--- a/t/tests/control-file-general/tags
+++ b/t/tests/control-file-general/tags
@@ -1,5 +1,7 @@
 E: control-file-general source: build-info-in-binary-control-file-section Package control-file-general
 I: control-file-general source: binary-control-field-duplicates-source maintainer in package control-file-general
+I: control-file-general source: duplicate-long-description control-file-general control-file-general-1 control-file-general-2
+I: control-file-general source: duplicate-short-description control-file-general control-file-general-1
 W: control-file-general source: no-section-field-for-source
 W: control-file-general source: package-depends-on-itself control-file-general depends
 W: control-file-general source: stronger-dependency-implies-weaker control-file-general depends -> recommends foo
diff --git a/t/tests/fields-wrong-section/debian/debian/control.in b/t/tests/fields-wrong-section/debian/debian/control.in
index 9ecaf8b..1534de3 100644
--- a/t/tests/fields-wrong-section/debian/debian/control.in
+++ b/t/tests/fields-wrong-section/debian/debian/control.in
@@ -8,7 +8,9 @@ Build-Depends: debhelper (>= 7)
 Package: {$srcpkg}-doc
 Architecture: {$architecture}
 Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
-Description: {$description}
+Description: {$description} (doc)
+ Test for doc 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.
@@ -16,7 +18,9 @@ Description: {$description}
 Package: lib{$srcpkg}-dev
 Architecture: {$architecture}
 Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
-Description: {$description}
+Description: {$description} (dev)
+ Test for libdevel 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.
@@ -24,7 +28,9 @@ Description: {$description}
 Package: lib{$srcpkg}-perl
 Architecture: {$architecture}
 Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
-Description: {$description}
+Description: {$description} (perl)
+ Test for perl 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.
@@ -32,7 +38,9 @@ Description: {$description}
 Package: python-{$srcpkg}
 Architecture: {$architecture}
 Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
-Description: {$description}
+Description: {$description} (Python)
+ Test for Python 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/files-games-section/debian/debian/control.in b/t/tests/files-games-section/debian/debian/control.in
index 39b68aa..1d0cddd 100644
--- a/t/tests/files-games-section/debian/debian/control.in
+++ b/t/tests/files-games-section/debian/debian/control.in
@@ -8,7 +8,9 @@ Build-Depends: debhelper (>= 7)
 Package: {$srcpkg}-both
 Architecture: {$architecture}
 Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
-Description: {$description}
+Description: {$description} (both)
+ Package has both regular binaries and games.
+ .
  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.
@@ -16,7 +18,9 @@ Description: {$description}
 Package: {$srcpkg}-good
 Architecture: {$architecture}
 Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
-Description: {$description}
+Description: {$description} (good)
+ Games package in games 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.
@@ -24,7 +28,9 @@ Description: {$description}
 Package: {$srcpkg}-no-games
 Architecture: {$architecture}
 Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
-Description: {$description}
+Description: {$description} (no games)
+ Games package without any games.
+ .
  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.
@@ -33,7 +39,9 @@ Package: {$srcpkg}-wrong
 Section: devel
 Architecture: {$architecture}
 Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
-Description: {$description}
+Description: {$description} (wrong)
+ Games package in wrong 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/scripts-control-interpreters/debian/debian/control.in b/t/tests/scripts-control-interpreters/debian/debian/control.in
index cb5466a..b2d36ff 100644
--- a/t/tests/scripts-control-interpreters/debian/debian/control.in
+++ b/t/tests/scripts-control-interpreters/debian/debian/control.in
@@ -9,6 +9,8 @@ Package: {$srcpkg}-paths
 Architecture: {$architecture}
 Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
 Description: {$description} (paths)
+ Interpreters with bad paths.
+ .
  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.
@@ -17,6 +19,8 @@ Package: {$srcpkg}-forbidden
 Architecture: {$architecture}
 Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
 Description: {$description} (forbidden)
+ Forbidden control interpreters.
+ .
  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.
@@ -24,7 +28,9 @@ Description: {$description} (forbidden)
 Package: {$srcpkg}-unknown
 Architecture: {$architecture}
 Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
-Description: {$description} (forbidden)
+Description: {$description} (unknown)
+ Unknown control interpreters.
+ .
  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.
@@ -33,6 +39,8 @@ Package: {$srcpkg}-python
 Architecture: {$architecture}
 Depends: python, $\{shlibs:Depends\}, $\{misc:Depends\}
 Description: {$description} (python)
+ Python control interpreters with depends.
+ .
  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.
@@ -41,7 +49,9 @@ Package: {$srcpkg}-prepython
 Architecture: {$architecture}
 Pre-Depends: python
 Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
-Description: {$description} (python)
+Description: {$description} (python preinst)
+ Python control interpreters with pre-depends.
+ .
  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/testset/debconf/debian/control b/testset/debconf/debian/control
index fcf8181..bd365b1 100644
--- a/testset/debconf/debian/control
+++ b/testset/debconf/debian/control
@@ -13,7 +13,7 @@ Description: Test package for the debconf checks of lintian
 Package: debconf-test-noscripts
 Architecture: any
 Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: Test package for the debconf checks of lintian
+Description: Test package for the debconf checks of lintian (noscripts)
  Package missing postinst/postrm/config.
  .
  This is a test package designed to exercise some feature or tag of
@@ -23,7 +23,7 @@ Description: Test package for the debconf checks of lintian
 Package: debconf-test-preinst
 Architecture: any
 Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: Test package for the debconf checks of lintian
+Description: Test package for the debconf checks of lintian (preinst)
  Package uses debconf only in preinst.
  .
  This is a test package designed to exercise some feature or tag of
@@ -33,7 +33,7 @@ Description: Test package for the debconf checks of lintian
 Package: debconf-test-postinst
 Architecture: any
 Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: Test package for the debconf checks of lintian
+Description: Test package for the debconf checks of lintian (postinst)
  Package uses debconf only in postinst.
  .
  This is a test package designed to exercise some feature or tag of
diff --git a/testset/debug/debian/control b/testset/debug/debian/control
index d92fbcd..f623334 100644
--- a/testset/debug/debian/control
+++ b/testset/debug/debian/control
@@ -10,7 +10,8 @@ Package: hello
 Architecture: alpha amd64 arm hppa hurd-i386 i386 ia64 kfreebsd-i386 m68k mips mipsel powerpc ppc64 s390 sparc
 Depends: ${shlibs:Depends}, ${misc:Depends}
 Description: Test for external debugging information
- lintian regression test for external debugging file handling.
+ Lintian regression test for external debugging file handling.  This test
+ contains the binary.
  .
  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
@@ -20,8 +21,9 @@ Package: hello-dbg
 Priority: extra
 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
- lintian regression test for external debugging file handling.
+Description: Test for external debugging information (symbols)
+ Lintian regression test for external debugging file handling.  This test
+ contains the binary symbols.
  .
  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
@@ -31,8 +33,9 @@ Package: libhello0
 Section: libs
 Architecture: alpha amd64 arm hppa hurd-i386 i386 ia64 kfreebsd-i386 m68k mips mipsel powerpc ppc64 s390 sparc
 Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: Test for external debugging information
- lintian regression test for external debugging file handling.
+Description: Test for external debugging information (library)
+ Lintian regression test for external debugging file handling.  This test
+ contains a library.
  .
  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
@@ -43,8 +46,9 @@ Section: libdevel
 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}
-Description: Test for external debugging information
- lintian regression test for external debugging file handling.
+Description: Test for external debugging information (library symbols)
+ Lintian regression test for external debugging file handling.  This test
+ contains the library symbols.
  .
  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/testset/description/debian/control b/testset/description/debian/control
index 1b89754..914f59a 100644
--- a/testset/description/debian/control
+++ b/testset/description/debian/control
@@ -50,4 +50,5 @@ Description:    the synopsis starts with spaces
 Package: description-qux
 Architecture: all
 Description: This description ends, etc.
- This is a real Lintian bug which has been discovered with this testset.
+ This is another real Lintian bug which has been discovered with this
+ testset.
diff --git a/testset/libbaz/debian/control b/testset/libbaz/debian/control
index 952f3a2..e996b8a 100644
--- a/testset/libbaz/debian/control
+++ b/testset/libbaz/debian/control
@@ -19,7 +19,7 @@ Package: libbaz1-dev
 Architecture: any
 Depends: libbaz1 (= ${source:Version}), perlapi-5.8.8
 Description: development package
- Regression test for lintian's handling of libraries.
+ Regression test for lintian's handling of libraries (dev).
  .
  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
@@ -28,8 +28,8 @@ Description: development package
 Package: libbaz2
 Architecture: any
 Depends: ${shlibs:Depends}, libssl0.9.8
-Description: test handling of library packages
- Regression test for lintian's handling of libraries.
+Description: test handling of library packages (good)
+ Regression test for lintian's handling of libraries (good).
  .
  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
@@ -38,8 +38,8 @@ Description: test handling of library packages
 Package: libbaz2-dev
 Architecture: any
 Depends: ${shlibs:Depends}, libbaz2 (= ${Source-Version})
-Description: development package
- Regression test for lintian's handling of libraries.
+Description: development package (good)
+ Regression test for lintian's handling of libraries (dev good).
  .
  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
@@ -50,7 +50,7 @@ Architecture: any
 Depends: libbaz2 (= ${binary:Version})
 Priority: optional
 Description: debugging package
- Regression test for lintian's handling of libraries.
+ Regression test for lintian's handling of libraries (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
@@ -60,7 +60,7 @@ Package: ia32-libbaz2
 Architecture: all
 Depends: ${shlibs:Depends}
 Description: multiarch package
- Regression test for lintian's handling of libraries.
+ Regression test for lintian's handling of libraries (multiarch).
  .
  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/testset/non-us/debian/control b/testset/non-us/debian/control
index a29734d..54dc300 100644
--- a/testset/non-us/debian/control
+++ b/testset/non-us/debian/control
@@ -9,6 +9,8 @@ Package: patented-app
 Architecture: all
 Section: non-us
 Description: test for non-us checks
+ non-US test.
+ .
  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.
@@ -17,6 +19,8 @@ Package: crypto-app
 Architecture: all
 Section: non-US
 Description: proper non-US app
+ A proper non-US app.
+ .
  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.
@@ -25,6 +29,8 @@ Package: broken-crypto
 Architecture: all
 Section: non-US/admin
 Description: broken non-US app
+ A broken non-US app.
+ .
  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.
@@ -33,6 +39,8 @@ Package: nonfree-crypto-app
 Architecture: all
 Section: non-US/non-free
 Description: proper non-US/non-free app
+ A proper non-US/non-free app.
+ .
  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/testset/tags.foo++ b/testset/tags.foo++
index 3a1ff76..2894afb 100644
--- a/testset/tags.foo++
+++ b/testset/tags.foo++
@@ -13,6 +13,7 @@ E: foo++: debian-changelog-file-contains-debmake-default-email-address he@unknow
 E: foo++: debian-changelog-file-uses-obsolete-national-encoding at line 11
 E: foo++: no-copyright-file
 E: foo++: wrong-debian-qa-address-set-as-maintainer Lintian Maintainer <debian-qa@lists.debian.org>
+I: foo++ source: duplicate-short-description foo++ foo++-helper
 I: foo++: no-md5sums-control-file
 W: foo++ source: ancient-standards-version 3.1.1 (current is 3.8.0)
 W: foo++ source: debian-watch-file-in-native-package

-- 
Debian package checker


Reply to: