Author: rra
Date: 2007-06-05 04:41:48 +0200 (Tue, 05 Jun 2007)
New Revision: 896

Modified:
   trunk/checks/version-substvars
   trunk/checks/version-substvars.desc
   trunk/debian/changelog
   trunk/testset/debug/debian/control
   trunk/testset/tags.binary
   trunk/testset/tags.libbaz
Log:
* checks/version-substvars{.desc,}:
  + [RA] Add a check for deprecated ${Source-Version} substvars.  Patch
    from Guillem Jover.  (Closes: #427577)

Modified: trunk/checks/version-substvars
===================================================================
--- trunk/checks/version-substvars      2007-06-04 17:01:29 UTC (rev 895)
+++ trunk/checks/version-substvars      2007-06-05 02:41:48 UTC (rev 896)
@@ -41,6 +41,7 @@
 my $type = shift;
 
 my @control_data = read_dpkg_control("debfiles/control");
+my @dep_fields = qw(depends pre-depends recommends suggests conflicts 
replaces);
 
 shift @control_data; # skip source info entry
 
@@ -50,6 +51,14 @@
        $pkg1 = $_->{'package'};
        $pkg1_is_any = ($_->{'architecture'} ne 'all');
 
+       foreach my $field (@dep_fields) {
+               next unless $_->{$field};
+               if ($_->{$field} =~ m/\${Source-Version}/) {
+                       tag "substvar-source-version-is-deprecated", $pkg1;
+                       last;
+               }
+       }
+
        foreach (split /,/, ($_->{'depends'} || "")) {
                next unless 
m/(\S+)\s*\(\s*=\s*\${((?:Source-|source:|binary:)Version)}/x;
 
@@ -74,8 +83,6 @@
                        # (b3) all -> any (= ${either-of-them})
                        tag "not-binnmuable-all-depends-any", "$pkg1 -> $pkg2";
                }
-
-               # TODO (post-Etch?): warn/error about ${Source-Version} being 
deprecated
        }
 }
 

Modified: trunk/checks/version-substvars.desc
===================================================================
--- trunk/checks/version-substvars.desc 2007-06-04 17:01:29 UTC (rev 895)
+++ trunk/checks/version-substvars.desc 2007-06-05 02:41:48 UTC (rev 896)
@@ -41,3 +41,10 @@
  (= ${binary:Version}), (= ${source:Version}), or (= ${Source-Version}),
  but the second package is not built from this source package.  Usually
  this means there is a mistake in the package name in this dependency.
+
+Tag: substvar-source-version-is-deprecated
+Type: warning
+Info: The package uses the now deprecated ${Source-Version} substvar,
+ which has misleading semantics. Please switch to ${binary:Version} or
+ ${source:Version} as appropriate. Support for ${Source-Version} may be
+ removed from dpkg-dev in the future.

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog      2007-06-04 17:01:29 UTC (rev 895)
+++ trunk/debian/changelog      2007-06-05 02:41:48 UTC (rev 896)
@@ -41,11 +41,14 @@
       not written in shell.
     + [RA] Diagnose maintainer scripts looking at /var/lib/dpkg/status
       directly.  Thanks, Guillem Jover.  (Closes: #426628)
+  * checks/version-substvars{.desc,}:
+    + [RA] Add a check for deprecated ${Source-Version} substvars.  Patch
+      from Guillem Jover.  (Closes: #427577)
 
   * frontend/lintian-info:
     + [CW] Fix uninitialized value warning after reading a blank line.
 
- -- Russ Allbery <[EMAIL PROTECTED]>  Mon, 04 Jun 2007 10:01:17 -0700
+ -- Russ Allbery <[EMAIL PROTECTED]>  Mon, 04 Jun 2007 19:28:29 -0700
 
 lintian (1.23.30) unstable; urgency=low
 

Modified: trunk/testset/debug/debian/control
===================================================================
--- trunk/testset/debug/debian/control  2007-06-04 17:01:29 UTC (rev 895)
+++ trunk/testset/debug/debian/control  2007-06-05 02:41:48 UTC (rev 896)
@@ -15,7 +15,7 @@
 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 (= ${Source-Version}), ${shlibs:Depends}, ${misc:Depends}
+Depends: hello (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}
 Description: Test for external debugging information
  lintian regression test for external debugging file handling.
 
@@ -30,6 +30,6 @@
 Section: libdevel
 Priority: extra
 Architecture: alpha amd64 arm hppa hurd-i386 i386 ia64 kfreebsd-i386 m68k mips 
mipsel powerpc ppc64 s390 sparc
-Depends: libhello (= ${Source-Version}), ${shlibs:Depends}, ${misc:Depends}
+Depends: libhello (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}
 Description: Test for external debugging information
  lintian regression test for external debugging file handling.

Modified: trunk/testset/tags.binary
===================================================================
--- trunk/testset/tags.binary   2007-06-04 17:01:29 UTC (rev 895)
+++ trunk/testset/tags.binary   2007-06-05 02:41:48 UTC (rev 896)
@@ -40,6 +40,8 @@
 W: binary source: native-package-with-dash-version
 W: binary source: not-binnmuable-all-depends-any binary-data -> binary
 W: binary source: not-binnmuable-any-depends-all binary -> binary-data
+W: binary source: substvar-source-version-is-deprecated binary
+W: binary source: substvar-source-version-is-deprecated binary-data
 W: binary: binary-without-manpage usr/bin/hello
 W: binary: binary-without-manpage usr/bin/hello-static
 W: binary: binary-without-manpage usr/bin/hello.static

Modified: trunk/testset/tags.libbaz
===================================================================
--- trunk/testset/tags.libbaz   2007-06-04 17:01:29 UTC (rev 895)
+++ trunk/testset/tags.libbaz   2007-06-05 02:41:48 UTC (rev 896)
@@ -26,6 +26,7 @@
 W: libbaz source: changelog-should-mention-nmu
 W: libbaz source: package-uses-deprecated-debhelper-compat-version 1
 W: libbaz source: source-nmu-has-incorrect-version-number 1
+W: libbaz source: substvar-source-version-is-deprecated libbaz2-dev
 W: libbaz1: missing-depends-line
 W: libbaz1: package-name-doesnt-match-sonames libbaz3-1 libbaz2-1.0
 W: libbaz1: postinst-should-not-set-usr-doc-link


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to