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

[SCM] Debian package checker branch, master, updated. 2.4.1-26-g8d34c62



The following commit has been merged in the master branch:
commit 8d34c625b4cd1f69118f0a63698c9b0109ca1a20
Author: Russ Allbery <rra@debian.org>
Date:   Sun Jun 27 13:30:50 2010 -0700

    Allow architecture wildcards in control fields
    
    + [RA] Allow architecture wildcards in build relations and in the
      Architecture field of binary and source packages.
    + [RA] Rename arch-any-in-binary-pkg to arch-wildcard-in-binary-package
      and diagnose any architecture wildcard, not just "any".

diff --git a/checks/fields b/checks/fields
index f8fe975..1448205 100644
--- a/checks/fields
+++ b/checks/fields
@@ -41,6 +41,21 @@ our $KNOWN_ESSENTIAL = Lintian::Data->new('fields/essential');
 our $KNOWN_METAPACKAGES = Lintian::Data->new('fields/metapackages');
 our $NO_BUILD_DEPENDS = Lintian::Data->new('fields/no-build-depends');
 
+# Generate the list of valid architecture wildcards.  We can ignore all
+# architectures not containing a - for our purposes and transform any
+# architecture like foo-bar into any-bar and foo-any.  Putting this in a hash
+# will then clean up all the duplicates.
+our %ARCH_WILDCARDS = map {
+	if (/-/) {
+		my ($first, $second) = split ('-', $_, 2);
+		("$first-any" => 1, "any-$second" => 1);
+	} else {
+		();
+	}
+} $KNOWN_ARCHS->all;
+$ARCH_WILDCARDS{'linux-any'} = 1;
+$ARCH_WILDCARDS{any} = 1;
+
 our %known_archive_parts = map { $_ => 1 }
     ('non-free', 'contrib');
 
@@ -276,12 +291,14 @@ if (not defined $info->field('architecture')) {
 	}
 
 	for my $arch (@archs) {
-		tag "unknown-architecture", "$arch" unless $KNOWN_ARCHS->known($arch);
+		tag "unknown-architecture", "$arch"
+		    unless $KNOWN_ARCHS->known($arch) || $ARCH_WILDCARDS{$arch};
+		tag "arch-wildcard-in-binary-package", "$arch"
+		    if ($type eq 'binary' && $ARCH_WILDCARDS{$arch});
 	}
 
 	if ($type eq "binary") {
 		tag "too-many-architectures", "" if (@archs > 1);
-		tag "arch-any-in-binary-pkg", "" if (grep { $_ eq "any" } @archs);
                 tag "aspell-package-not-arch-all", ""
                     if ($pkg =~ /^aspell-[a-z]{2}(-.*)?$/ && (@archs > 1 || $archs[0] ne 'all'));
 	}
@@ -701,7 +718,7 @@ if ($type eq "source") {
 
 					my $negated = 0;
 					for my $arch (@{$d_arch->[0]}) {
-						if ($arch eq 'all' or $arch eq 'any' or !$KNOWN_ARCHS->known($arch)) {
+						if ($arch eq 'all' or (!$KNOWN_ARCHS->known($arch) and !$ARCH_WILDCARDS{$arch})) {
 							tag "invalid-arch-string-in-source-relation", "$arch [$field: $part_d_orig]"
 						}
 					}
diff --git a/checks/fields.desc b/checks/fields.desc
index e87b885..2337d71 100644
--- a/checks/fields.desc
+++ b/checks/fields.desc
@@ -107,11 +107,12 @@ Info: A binary package should list exactly one architecture (the one it is
  compiled for), or the special value "all" if it is architecture-independent.
 Ref: policy 5.6.8
 
-Tag: arch-any-in-binary-pkg
+Tag: arch-wildcard-in-binary-package
 Severity: serious
 Certainty: certain
-Info: The special architecture value "any" does not make sense in a binary
- package.
+Info: Architecture wildcards, including the special architecture value
+ "any", do not make sense in a binary package.  A binary package must
+ either be architecture-independent or built for a specific architecture.
 Ref: policy 5.6.8
 
 Tag: aspell-package-not-arch-all
diff --git a/debian/changelog b/debian/changelog
index 94b1625..3d271bd 100755
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,11 +2,13 @@ lintian (2.4.2) UNRELEASED; urgency=low
 
   * Summary of tag changes:
     + Added:
+      - arch-wildcard-in-binary-package
       - bad-provided-package-name
       - copyright-refers-to-deprecated-bsd-license-file
       - init.d-script-depends-on-unknown-virtual-facility
       - xc-package-type-in-debian-control (pedantic)
     + Removed:
+      - arch-any-in-binary-pkg (now in arch-wildcard-in-binary-package)
       - package-type-in-debian-control
 
   * checks/changes-file.desc:
@@ -28,6 +30,10 @@ lintian (2.4.2) UNRELEASED; urgency=low
       packages.
     + [RG] Exclude dash from the depends-on-essential-package checks, as
       per discusion in debian-devel.  (Closes: #587209)
+    + [RA] Allow architecture wildcards in build relations and in the
+      Architecture field of binary and source packages.
+    + [RA] Rename arch-any-in-binary-pkg to arch-wildcard-in-binary-package
+      and diagnose any architecture wildcard, not just "any".
   * checks/huge-usr-share{,.desc}:
     + [RA] Count file size from the tar listing rather than using du.  The
       results of du vary based on file system and other factors and make
diff --git a/t/debs/fields-malformed-source/Makefile b/t/debs/fields-wildcard-binary/Makefile
similarity index 81%
copy from t/debs/fields-malformed-source/Makefile
copy to t/debs/fields-wildcard-binary/Makefile
index dd9605a..d232ffd 100644
--- a/t/debs/fields-malformed-source/Makefile
+++ b/t/debs/fields-wildcard-binary/Makefile
@@ -1,4 +1,4 @@
-name = fields-malformed-source
+name = fields-wildcard-binary
 
 all:
 	echo '2.0' > debian-binary
@@ -14,5 +14,5 @@ all:
 	    debian-binary control.tar.gz data.tar.gz
 
 clean:
-	rm -f *.tar.gz *.tar.lzma *.deb md5sums debian-binary
+	rm -f *.tar.gz *.deb md5sums debian-binary
 	rm -rf usr
diff --git a/t/debs/fields-obsolete-relation/changelog b/t/debs/fields-wildcard-binary/changelog
similarity index 69%
copy from t/debs/fields-obsolete-relation/changelog
copy to t/debs/fields-wildcard-binary/changelog
index b30cd3b..5bd2d73 100644
--- a/t/debs/fields-obsolete-relation/changelog
+++ b/t/debs/fields-wildcard-binary/changelog
@@ -1,4 +1,4 @@
-fields-obsolete-relation (1.0) unstable; urgency=low
+fields-wildcard-binary (1.0) unstable; urgency=low
 
   * A Lintian test case.
 
diff --git a/t/debs/deb-format-record-size/control b/t/debs/fields-wildcard-binary/control
similarity index 74%
copy from t/debs/deb-format-record-size/control
copy to t/debs/fields-wildcard-binary/control
index 7163fe9..196b3ae 100644
--- a/t/debs/deb-format-record-size/control
+++ b/t/debs/fields-wildcard-binary/control
@@ -1,10 +1,10 @@
-Package: deb-format-record-size
+Package: fields-wildcard-binary
 Version: 1.0
-Architecture: all
+Architecture: any-i386
 Maintainer: Debian Lintian Maintainers <lintian-maint@debian.org>
 Section: devel
 Priority: extra
-Description: Test package with a non-standard tar record size
+Description: Test for architecture wildcard in binary package
  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.  It may
diff --git a/t/debs/deb-format-ancient-file/copyright b/t/debs/fields-wildcard-binary/copyright
similarity index 94%
copy from t/debs/deb-format-ancient-file/copyright
copy to t/debs/fields-wildcard-binary/copyright
index 98298fd..96dde6f 100644
--- a/t/debs/deb-format-ancient-file/copyright
+++ b/t/debs/fields-wildcard-binary/copyright
@@ -2,7 +2,7 @@ This is part of the testsuite of lintian. See the file debian/copyright
 in the lintian source directory for more details.
 
 So far as it is copyrightable at all, this test case is
-   Copyright © 2009 Russ Allbery <rra@debian.org>
+   Copyright © 2009, 2010 Russ Allbery <rra@debian.org>
 
 This program is free software; you may redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
diff --git a/t/debs/fields-wildcard-binary/tags b/t/debs/fields-wildcard-binary/tags
new file mode 100644
index 0000000..5d0216c
--- /dev/null
+++ b/t/debs/fields-wildcard-binary/tags
@@ -0,0 +1 @@
+E: fields-wildcard-binary: arch-wildcard-in-binary-package any-i386
diff --git a/t/tests/basic-3.0-native/debian/README b/t/tests/fields-architecture/debian/README
similarity index 100%
copy from t/tests/basic-3.0-native/debian/README
copy to t/tests/fields-architecture/debian/README
diff --git a/t/tests/fields-architecture/desc b/t/tests/fields-architecture/desc
new file mode 100644
index 0000000..120398d
--- /dev/null
+++ b/t/tests/fields-architecture/desc
@@ -0,0 +1,6 @@
+Testname: fields-architecture
+Sequence: 6000
+Version: 1.0
+Description: Tests for the Architecture field
+Architecture: linux-any any-i386
+Test-Against: unknown-architecture
diff --git a/t/debs/deb-format-record-size/tags b/t/tests/fields-architecture/tags
similarity index 100%
copy from t/debs/deb-format-record-size/tags
copy to t/tests/fields-architecture/tags
diff --git a/t/tests/fields-depends-general/debian/debian/control.in b/t/tests/fields-depends-general/debian/debian/control.in
index c057dc6..65e41ae 100644
--- a/t/tests/fields-depends-general/debian/debian/control.in
+++ b/t/tests/fields-depends-general/debian/debian/control.in
@@ -5,7 +5,7 @@ Maintainer: {$author}
 Standards-Version: {$standards_version}
 Build-Depends: debhelper (>= 7.0.50~), xorg-dev, java-propose-classpath,
  python3.1-dev, foo [all], bar [i386 any], baz [source i3!86],
- baz [i386 !amd64]
+ baz [i386 !amd64], other-pkg [kfreebsd-any], yet-another [any-powerpc]
 
 Package: {$srcpkg}
 Architecture: {$architecture}
diff --git a/t/tests/fields-depends-general/tags b/t/tests/fields-depends-general/tags
index 1da2cc1..c56235a 100644
--- a/t/tests/fields-depends-general/tags
+++ b/t/tests/fields-depends-general/tags
@@ -2,7 +2,6 @@ E: fields-depends-general source: build-depends-on-metapackage build-depends: xo
 E: fields-depends-general source: build-depends-on-non-build-package build-depends: java-propose-classpath
 E: fields-depends-general source: conflicting-negation-in-source-relation build-depends: baz [i386 !amd64]
 E: fields-depends-general source: invalid-arch-string-in-source-relation all [build-depends: foo [all]]
-E: fields-depends-general source: invalid-arch-string-in-source-relation any [build-depends: bar [i386 any]]
 E: fields-depends-general source: invalid-arch-string-in-source-relation i3!86 [build-depends: baz [source i3!86]]
 E: fields-depends-general source: invalid-arch-string-in-source-relation source [build-depends: baz [source i3!86]]
 E: fields-depends-general: depends-on-metapackage depends: xorg

-- 
Debian package checker


Reply to: