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

lintian: r681 - in trunk: checks debian testset/relations/debian



Author: rra
Date: 2006-06-21 22:53:10 +0200 (Wed, 21 Jun 2006)
New Revision: 681

Modified:
   trunk/checks/fields
   trunk/debian/changelog
   trunk/testset/relations/debian/control
   trunk/testset/relations/debian/rules
Log:
  + [RA] Allow (but don't require due to perl-base) Build-Depends on
    perl for arch-independent packages if perl is invoked in
    debian/rules clean.

Modified: trunk/checks/fields
===================================================================
--- trunk/checks/fields	2006-06-21 20:31:12 UTC (rev 680)
+++ trunk/checks/fields	2006-06-21 20:53:10 UTC (rev 681)
@@ -80,12 +80,16 @@
 	[ debhelper => '^\t\s*dh_.+' ],
 	[ dpatch => '^\t\s*dpatch\s' ],
 	[ patch => '^\t\s*(?:perl debian/)?yada\s+unpatch' ],
-	[ perl => '^\t\s*perl\s' ],
 	[ $python_depend => '^\t\s*python\s' ],
 	[ quilt => '^\t\s*(\S+=\S+\s+)*quilt\s' ],
 	[ yada => '^\t\s*yada\s' ],
 );
 
+# Similar, but the resulting dependency is only allowed, not required.
+my @rule_clean_allowed = (
+	[ 'perl | perl-base (>= 5.6.0-16)' => '(^\t|\|\|)\s*(perl|\$\(PERL\))\s' ],
+);
+
 sub run {
 
 my $pkg = shift;
@@ -534,6 +538,11 @@
 					$needed_clean{$rule->[0]} = $rule->[2] || $needed_clean{$rule->[0]} || '';
 				}
 			}
+			for my $rule (@rule_clean_allowed) {
+				if ($_ =~ /$rule->[1]/) {
+					$allowed_clean{$rule->[0]} = 1;
+				}
+			}
 		}
 	}
 	close RULES;
@@ -636,12 +645,17 @@
 	# dependencies in Build-Depends, and then allow any dependency in
 	# Build-Depends that's implied by the dependencies we require or allow
 	# there.
+	#
+	# We also have to map | to , when building the list of allowed
+	# packages so that the implications will work properly.
+	#
+	# This is confusing.  There should be a better way to do this.
 	if (-e "fields/build-depends" && $arch_dep_packages == 0) {
 		open(FH, "fields/build-depends") or fail("cannot read fields/build-depends: $!");
 		my $build_depends = <FH>;
 		close FH;
 		my @packages = split /\s*,\s*/, $build_depends;
-		my @allowed = map { s/[\(\[][^\)\]]+[\)\]]//g; $_ } keys (%needed_clean), keys (%allowed_clean);
+		my @allowed = map { s/[\(\[][^\)\]]+[\)\]]//g; s/\|/,/g; $_ } keys (%needed_clean), keys (%allowed_clean);
 		my $dep = Dep::parse (join (',', @allowed));
 		foreach my $pkg (@packages) {
 			my $name = $pkg;

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2006-06-21 20:31:12 UTC (rev 680)
+++ trunk/debian/changelog	2006-06-21 20:53:10 UTC (rev 681)
@@ -16,11 +16,14 @@
     + [RA] Fix handling of versioned Build-Depends to avoid spurious
       build-depends-without-arch-dep warnings.  Reported by Marcus
       Better.
+    + [RA] Allow (but don't require due to perl-base) Build-Depends on
+      perl for arch-independent packages if perl is invoked in
+      debian/rules clean.
   * checks/po-debconf:
     + [RA] Don't consider templates.in to be a stray translated template
       file.  Thanks, Thomas Huriaux.  (Closes: #367534)
 
- -- Russ Allbery <rra@debian.org>  Wed, 21 Jun 2006 13:29:37 -0700
+ -- Russ Allbery <rra@debian.org>  Wed, 21 Jun 2006 13:53:06 -0700
 
 lintian (1.23.21) unstable; urgency=low
 

Modified: trunk/testset/relations/debian/control
===================================================================
--- trunk/testset/relations/debian/control	2006-06-21 20:31:12 UTC (rev 680)
+++ trunk/testset/relations/debian/control	2006-06-21 20:53:10 UTC (rev 681)
@@ -1,7 +1,7 @@
 Source: relations
 Section: misc
 Priority: optional
-Build-Depends: mail-transport-agent, libc6-dev, findutils, foo (>> 2) [!amd64 !i386], bar, arch-test1 [i386], arch-test2 [!i386], quilt (>= 0.40)
+Build-Depends: mail-transport-agent, libc6-dev, findutils, foo (>> 2) [!amd64 !i386], bar, arch-test1 [i386], arch-test2 [!i386], quilt (>= 0.40), perl
 Build-Depends-Indep: make, bash, debmake, build-essential
 Build-Conflicts: foo [amd64 i386], bar [alpha test], xlibs-dev, arch-test1 [powerpc], arch-test2 [!sparc]
 Build-Conflicts-Indep: debmake [!powerpc]

Modified: trunk/testset/relations/debian/rules
===================================================================
--- trunk/testset/relations/debian/rules	2006-06-21 20:31:12 UTC (rev 680)
+++ trunk/testset/relations/debian/rules	2006-06-21 20:53:10 UTC (rev 681)
@@ -35,6 +35,11 @@
 
 clean:
 	rm -rf debian/tmp debian/files
+
+# Test allowing quilt Build-Depends for manual quilt invocations.
 	TESTING=foo ANOTHER=bar quilt || true
 
+# Test requiring perl Build-Depends for manual perl invocations.
+	[ ! -f Build ] || $(PERL) Build distclean
+
 .PHONY: build binary-arch binary-indep binary clean



Reply to: