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

lintian: r747 - in trunk: checks debian lib testset testset/scripts testset/scripts/debian



Author: rra
Date: 2006-09-17 04:05:36 +0200 (Sun, 17 Sep 2006)
New Revision: 747

Added:
   trunk/testset/scripts/wishfoo
Modified:
   trunk/checks/scripts
   trunk/checks/scripts.desc
   trunk/debian/changelog
   trunk/lib/Dep.pm
   trunk/testset/scripts/debian/control
   trunk/testset/scripts/debian/rules
   trunk/testset/tags.scripts
Log:
  + [RA] Add a separate tag for tclsh dependencies to explain about the
    virtual package and improve the description of the wish virtual
    package in its tag.  Fix inverted logic that got the wish dependency
    backwards.  Restore the previous behavior of treating alternatives
    as conjunction for script dependencies to work around a deficiency
    in the dependency engine, manifesting as false positives for wish
    and tclsh scripts.  Reported by Hamish Moffatt.  (Closes: #387845)

Modified: trunk/checks/scripts
===================================================================
--- trunk/checks/scripts	2006-09-13 19:15:33 UTC (rev 746)
+++ trunk/checks/scripts	2006-09-17 02:05:36 UTC (rev 747)
@@ -153,9 +153,6 @@
 				'slsh' => 'slsh',
 				'speedy' => 'speedy-cgi-perl',
 				'tcl' => 'tclx8.3',
-				'tclsh' => 'tclsh',
-				'tclsh8.3' => 'tcl8.3',
-				'tclsh8.4' => 'tcl8.4',
 				'tcsh' => 'tcsh',
 				'tixwish' => 'tix',
 				'trs' => 'konwert',
@@ -208,10 +205,13 @@
 }
 close(FILEINFO);
 
-# If alternatives are used, they are each listed as a separate dependency.
-# This is the best thing to do with the tk/tcl interpreters, which
-# are often listed with dependencies like tk41|tk42|wish.
-# They are also the only interpreters likely to be listed with alternatives.
+# We transform alternatives separated by | into stronger dependencies
+# separated by ,.  This is done to avoid false positives with dependencies
+# like "tcl8.4 | tclsh" (sufficient for a tclsh script) and is required solely
+# because of deficiencies in our dependency evaluation engine.
+#
+# This may lead to false negatives when alternatives may allow necessary
+# packages to not be installed.  Hopefully those will be rare.
 my $all_deps = '';
 foreach my $depfield ('suggests', 'recommends', 'depends', 'pre-depends',
 		   'provides') {
@@ -220,6 +220,7 @@
 	$_ = join('', <IN>);
 	close(IN);
         chomp;
+        s/\|/,/g;
         $deps{$depfield} = $_;
         $all_deps .= ', ' if $all_deps;
         $all_deps .= $_;
@@ -311,14 +312,23 @@
 	    } elsif ($base eq 'perl' && $suid{$filename}) {
 		tag_error("suid-perl-script-but-no-perl-suid-dep", $filename)
                     unless Dep::implies($deps{all}, Dep::parse('perl-suid'));
+	    } elsif ($base =~ m/^tclsh(\d+\.\d+)?$/) {
+		my $ver = $1 ? $1 : "";
+		if ($ver) {
+		    tag_error("tclsh-script-but-no-tclsh-dep", "$filename $base")
+			unless Dep::implies($deps{all}, Dep::parse("tcl$ver"));
+		} else {
+		    tag_error("tclsh-script-but-no-tclsh-dep", "$filename $base")
+			unless Dep::implies($deps{all}, Dep::parse("tcl8.3 | tcl8.4 | tclsh"));
+		}
 	    } elsif ($base =~ m/^wish(\d+\.\d+)?$/) {
 		my $ver = $1 ? $1 : "";
 		if ($ver) {
-		    tag_error("wish-script-but-no-wish-dep", $filename)
-			unless Dep::implies($deps{all}, Dep::parse('tcl8.3 | tcl8.4 | wish'));
+		    tag_error("wish-script-but-no-wish-dep", "$filename $base")
+			unless Dep::implies($deps{all}, Dep::parse("tk$ver"));
 		} else {
-		    tag_error("wish-script-but-no-wish-dep", $filename)
-			unless Dep::implies($deps{all}, Dep::parse("tcl$ver"));
+		    tag_error("wish-script-but-no-wish-dep", "$filename $base")
+			unless Dep::implies($deps{all}, Dep::parse("tk8.3 | tk8.4 | wish"));
 		}
 	    }
 	}

Modified: trunk/checks/scripts.desc
===================================================================
--- trunk/checks/scripts.desc	2006-09-13 19:15:33 UTC (rev 746)
+++ trunk/checks/scripts.desc	2006-09-17 02:05:36 UTC (rev 747)
@@ -181,11 +181,21 @@
 
 Tag: wish-script-but-no-wish-dep
 Type: error
-Info: Packages that use wish scripts must depend on the virtual package wish.
+Info: Packages that use wish scripts must depend on the virtual package wish
+ or, if they require a specific version of wish or tk, that version of tk.
  .
  In some cases a weaker relationship, such as Suggests or Recommends, will
  be more appropriate.
 
+Tag: tclsh-script-but-no-tclsh-dep
+Type: error
+Info: Packages that use wish scripts must depend on the virtual package
+ tclsh or, if they require a specific version of wish or tk, that version
+ of tcl.
+ .
+ In some cases a weaker relationship, such as Suggests or Recommends, will
+ be more appropriate.
+
 Tag: calls-suidperl-directly
 Type: error
 Info: Since perl version 5.8.3-3, /usr/bin/suidperl shouldn't be called directly

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2006-09-13 19:15:33 UTC (rev 746)
+++ trunk/debian/changelog	2006-09-17 02:05:36 UTC (rev 747)
@@ -12,8 +12,15 @@
   * checks/scripts:
     + [RA] Add /usr/bin/gosh from the gauche package to the list of valid
       interpreters.  Thanks, Tatsuya Kinoshita.  (Closes: #386798)
+    + [RA] Add a separate tag for tclsh dependencies to explain about the
+      virtual package and improve the description of the wish virtual
+      package in its tag.  Fix inverted logic that got the wish dependency
+      backwards.  Restore the previous behavior of treating alternatives
+      as conjunction for script dependencies to work around a deficiency
+      in the dependency engine, manifesting as false positives for wish
+      and tclsh scripts.  Reported by Hamish Moffatt.  (Closes: #387845)
 
- -- Russ Allbery <rra@debian.org>  Wed, 13 Sep 2006 09:36:44 -0700
+ -- Russ Allbery <rra@debian.org>  Sat, 16 Sep 2006 18:56:42 -0700
 
 lintian (1.23.24) unstable; urgency=low
 

Modified: trunk/lib/Dep.pm
===================================================================
--- trunk/lib/Dep.pm	2006-09-13 19:15:33 UTC (rev 746)
+++ trunk/lib/Dep.pm	2006-09-17 02:05:36 UTC (rev 747)
@@ -114,7 +114,10 @@
 	}
 	return 1;
     } elsif ($q->[0] eq 'OR') {
-	# Any of q's clauses may be deduced from p.
+	# Any of q's clauses may be deduced from p.  This isn't entirely
+	# sufficient and will not correctly deduce that "a|b" implies "a|b|c".
+	# I don't see how to get that right using this code structure, or any
+	# simple change that would get it right.
 	$i = 1;
 	while ($i < @$q) {
 	    return 1 if Dep::implies($p, $q->[$i++]);

Modified: trunk/testset/scripts/debian/control
===================================================================
--- trunk/testset/scripts/debian/control	2006-09-13 19:15:33 UTC (rev 746)
+++ trunk/testset/scripts/debian/control	2006-09-17 02:05:36 UTC (rev 747)
@@ -9,5 +9,6 @@
 Package: scripts
 Architecture: all
 Depends: test, ruby1.8, build-essential
+Recommends: tk8.4 | wish
 Description: test lintian's script file checks
  Regression test lintian's script file checks.

Modified: trunk/testset/scripts/debian/rules
===================================================================
--- trunk/testset/scripts/debian/rules	2006-09-13 19:15:33 UTC (rev 746)
+++ trunk/testset/scripts/debian/rules	2006-09-17 02:05:36 UTC (rev 747)
@@ -26,6 +26,7 @@
 	install -m 4751 perlfoo $(tmp)/usr/bin/suidperlfoo2
 	install -m 4555 suidperlfoo $(tmp)/usr/bin/
 	install -m 755 tkfoo $(tmp)/usr/bin/
+	install -m 755 wishfoo $(tmp)/usr/bin/
 	install -m 644 xsession-test $(tmp)/etc/X11/Xsession.d/
 
 # Permissions here aren't part of what's being tested, but let us exercise

Added: trunk/testset/scripts/wishfoo
===================================================================
--- trunk/testset/scripts/wishfoo	2006-09-13 19:15:33 UTC (rev 746)
+++ trunk/testset/scripts/wishfoo	2006-09-17 02:05:36 UTC (rev 747)
@@ -0,0 +1,4 @@
+#!/usr/bin/wish
+#
+# This is not actually a wish script, here to force a test of wish
+# dependencies.

Modified: trunk/testset/tags.scripts
===================================================================
--- trunk/testset/tags.scripts	2006-09-13 19:15:33 UTC (rev 746)
+++ trunk/testset/tags.scripts	2006-09-17 02:05:36 UTC (rev 747)
@@ -35,6 +35,7 @@
 W: scripts: binary-without-manpage suidperlfoo2
 W: scripts: binary-without-manpage test.sh
 W: scripts: binary-without-manpage tkfoo
+W: scripts: binary-without-manpage wishfoo
 W: scripts: executable-is-not-world-readable usr/bin/perl-bizarre-2 0750 != 0755
 W: scripts: executable-is-not-world-readable usr/bin/suidperlfoo2 4751
 W: scripts: executable-not-elf-or-script ./usr/bin/perl-bizarre-3



Reply to: