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

lintian: r142 - in trunk: checks debian testset



Author: he
Date: 2004-04-10 22:25:30 +0200 (Sat, 10 Apr 2004)
New Revision: 142

Modified:
   trunk/checks/copyright-file
   trunk/checks/copyright-file.desc
   trunk/debian/changelog
   trunk/testset/info_tags.foo++
   trunk/testset/info_tags.relations
   trunk/testset/tags.foo++
   trunk/testset/tags.relations
Log:
* checks/copyright-file:
  + [HE] Change usr-doc-symlink-to-foreign-package check to throw an
  error when a package doesn't depend on the *same* version of the
  package its /usr/share/doc/$foo dir is symlinked to. This is supposed
  to ensure that both come from the same source and the same source
  version. (Closes: #201470)



Modified: trunk/checks/copyright-file
===================================================================
--- trunk/checks/copyright-file	2004-04-10 10:35:40 UTC (rev 141)
+++ trunk/checks/copyright-file	2004-04-10 20:25:30 UTC (rev 142)
@@ -80,15 +80,22 @@
 
     	# this case is allowed, if this package depends on link
     	# and both packages come from the same source package
+
+
+	if (not open (VERSION, "fields/version")) {
+	    fail("Can't open fields/version: $!");
+	} else {
+	    chomp(my $our_version = <VERSION>); 
 	
-    	# depend on $link pkg?
-    	if ((not depends_on($link)) &&
-	    not (exists($known_essential{$link}) &&
-		 defined($known_essential{$link}))) {
-	    # no, it does not.
+    	    # depend on $link pkg?
+    	    if ((not depends_on($link, $our_version)) &&
+	         not (exists($known_essential{$link}) &&
+	         defined($known_essential{$link}))) {
+		# no, it does not.
 
-	    print "E: $pkg $type: usr-doc-symlink-without-dependency $link\n";
-	    last;
+		print "E: $pkg $type: usr-doc-symlink-without-dependency $link\n";
+		last;
+	    }
     	}
 	
     	# We can only check if both packages come from the same source
@@ -192,7 +199,7 @@
 
 # returns true, if $foo depends on $bar
 sub depends_on {
-    my ($bar) = @_;
+    my ($package, $version) = @_;
 
     my ($deps, $predeps) = ("", "");
 
@@ -210,11 +217,14 @@
 	close(I);
     }
 
-    for (split(/\s*(?:,|\|)\s*/,"$deps,$predeps")) {
-	# whitespace or an opening parenthesis indicates the end of the
-	# package name.
-	s/(\s|\().*//;
-	return 1 if $_ eq $bar;
+    for (split(/\s*,\s*/,"$deps,$predeps")) {
+    	# Now split the dep
+	# We don't allow alternatives, as we need a strong depends: The dependency
+	# has to be there whatever happens.
+	if (/^\s* ( [^\s\[\(]+ ) \s* (?:\( \s* (<=|<|=|>=|>>|>) \s* ([^(]+) \))?\s*$/x) {
+	    my ($d_pkg, $d_relation, $d_version) = ($1, ($2 || ""), ($3 || ""));
+	    return 1 if (($package eq $d_pkg) and ($d_relation eq "=") and ($d_version eq $version));
+	}
     }
 
     return 0;

Modified: trunk/checks/copyright-file.desc
===================================================================
--- trunk/checks/copyright-file.desc	2004-04-10 10:35:40 UTC (rev 141)
+++ trunk/checks/copyright-file.desc	2004-04-10 20:25:30 UTC (rev 142)
@@ -50,7 +50,8 @@
 Tag: usr-doc-symlink-without-dependency
 Type: error
 Info: If the package installs a symbolic link /usr/share/doc/<i>pkg1</i> -&gt;
- <i>pkg2</i>, then <i>pkg1</i> has to depend on <i>pkg2</i>.
+ <i>pkg2</i>, then <i>pkg1</i> has to depend on <i>pkg2</i> with the same
+ version as <i>pkg1</i>.
  .
  Note, that adding the "Depends:" entry just to fix this bug is not a good
  solution. It's suggested that you include a real /usr/share/doc/<i>pkg1</i>

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2004-04-10 10:35:40 UTC (rev 141)
+++ trunk/debian/changelog	2004-04-10 20:25:30 UTC (rev 142)
@@ -21,6 +21,12 @@
   * checks/common_data:
     + [HE] Change known_obsolete_fields to allow checks/fields to
     report the Bugs field als obsolete.
+  * checks/copyright-file:
+    + [HE] Change usr-doc-symlink-to-foreign-package check to throw an 
+    error when a package doesn't depend on the *same* version of the
+    package its /usr/share/doc/$foo dir is symlinked to. This is supposed
+    to ensure that both come from the same source and the same source
+    version. (Closes: #201470)
   * checks/debconf{,.desc}:
     + [JvW] Add an error for a bogus default for a boolean template
       (Closes: #236846)

Modified: trunk/testset/info_tags.foo++
===================================================================
--- trunk/testset/info_tags.foo++	2004-04-10 10:35:40 UTC (rev 141)
+++ trunk/testset/info_tags.foo++	2004-04-10 20:25:30 UTC (rev 142)
@@ -66,6 +66,19 @@
 N:   Refer to Policy Manual, section 5.6.2 for details.
 N:
 E: foo++ source: uploader-address-malformed I am afraid of spam and think this helps <no_spam_please AT debian.org>
+E: foo++-helper: usr-doc-symlink-without-dependency foo++
+N:
+N:   If the package installs a symbolic link /usr/share/doc/<pkg1> ->
+N:   <pkg2>, then <pkg1> has to depend on <pkg2> with the same version as
+N:   <pkg1>.
+N:   
+N:   Note, that adding the "Depends:" entry just to fix this bug is not a
+N:   good solution. It's suggested that you include a real
+N:   /usr/share/doc/<pkg1> directory within <pkg1> and copy the copyright
+N:   file into that directory.
+N:   
+N:   Refer to Policy Manual, section 12.5 for details.
+N:
 E: foo++-helper: wrong-debian-qa-address-set-as-maintainer Lintian Maintainer <debian-qa@lists.debian.org>
 E: foo++: no-copyright-file
 N:

Modified: trunk/testset/info_tags.relations
===================================================================
--- trunk/testset/info_tags.relations	2004-04-10 10:35:40 UTC (rev 141)
+++ trunk/testset/info_tags.relations	2004-04-10 20:25:30 UTC (rev 142)
@@ -31,11 +31,17 @@
 N:   You use the Origin field though the field value is the default
 N:   (Debian). In this case the field is redundant and should be removed.
 N:
-E: relations-multiple-libs: no-copyright-file
+E: relations-multiple-libs: usr-doc-symlink-without-dependency relations
 N:
-N:   Each binary package has to include a plain file
-N:   /usr/share/doc/<pkg>/copyright
+N:   If the package installs a symbolic link /usr/share/doc/<pkg1> ->
+N:   <pkg2>, then <pkg1> has to depend on <pkg2> with the same version as
+N:   <pkg1>.
 N:   
+N:   Note, that adding the "Depends:" entry just to fix this bug is not a
+N:   good solution. It's suggested that you include a real
+N:   /usr/share/doc/<pkg1> directory within <pkg1> and copy the copyright
+N:   file into that directory.
+N:   
 N:   Refer to Policy Manual, section 12.5 for details.
 N:
 W: relations-multiple-libs: description-synopsis-might-not-be-phrased-properly
@@ -98,6 +104,12 @@
 N:
 N: relations-multiple-libs binary: unknown-field-in-changes origin
 E: relations: no-copyright-file
+N:
+N:   Each binary package has to include a plain file
+N:   /usr/share/doc/<pkg>/copyright
+N:   
+N:   Refer to Policy Manual, section 12.5 for details.
+N:
 W: relations: package-relation-with-self depends: relations
 N:
 N:   The package declares a relationship with itself. This is not very

Modified: trunk/testset/tags.foo++
===================================================================
--- trunk/testset/tags.foo++	2004-04-10 10:35:40 UTC (rev 141)
+++ trunk/testset/tags.foo++	2004-04-10 20:25:30 UTC (rev 142)
@@ -9,6 +9,7 @@
 W: foo++ source: uploader-not-full-name Josip
 E: foo++ source: uploader-address-missing Josip
 E: foo++ source: uploader-address-malformed I am afraid of spam and think this helps <no_spam_please AT debian.org>
+E: foo++-helper: usr-doc-symlink-without-dependency foo++
 E: foo++-helper: wrong-debian-qa-address-set-as-maintainer Lintian Maintainer <debian-qa@lists.debian.org>
 E: foo++: no-copyright-file
 E: foo++: wrong-debian-qa-address-set-as-maintainer Lintian Maintainer <debian-qa@lists.debian.org>

Modified: trunk/testset/tags.relations
===================================================================
--- trunk/testset/tags.relations	2004-04-10 10:35:40 UTC (rev 141)
+++ trunk/testset/tags.relations	2004-04-10 20:25:30 UTC (rev 142)
@@ -2,7 +2,7 @@
 E: relations source: build-depends-without-arch-dep
 E: relations source: bad-relation build-depends: foo (>> 2) bar baz bat
 W: relations source: redundant-origin-field
-E: relations-multiple-libs: no-copyright-file
+E: relations-multiple-libs: usr-doc-symlink-without-dependency relations
 W: relations-multiple-libs: description-synopsis-might-not-be-phrased-properly
 E: relations-multiple-libs: description-synopsis-is-duplicated
 E: relations-multiple-libs: package-depends-on-multiple-libstdc-versions libstdc++2.10 libstdc++2.10-glibc2.2 libstdc++3.0



Reply to: