Browse Source

Dpkg::Substvars: Obsolete Source-Version substvar

Emit an error when the source package uses this substvar.
Guillem Jover 10 years ago
parent
commit
15062f9839
5 changed files with 27 additions and 17 deletions
  1. 2 0
      debian/changelog
  2. 10 8
      doc/README.feature-removal-schedule
  3. 3 2
      man/deb-substvars.man
  4. 11 7
      scripts/Dpkg/Substvars.pm
  5. 1 0
      t/pod-spell.t

+ 2 - 0
debian/changelog

@@ -6,6 +6,8 @@ dpkg (1.18.11) UNRELEASED; urgency=medium
     to be valid. Thanks to David Kalnischkies <david@kalnischkies.de>.
     to be valid. Thanks to David Kalnischkies <david@kalnischkies.de>.
   * Add support to dpkg-scanpackages for scanning a single binary file.
   * Add support to dpkg-scanpackages for scanning a single binary file.
     Thanks to Javier Serrano Polo <javier@jasp.net>. Closes: #833964
     Thanks to Javier Serrano Polo <javier@jasp.net>. Closes: #833964
+  * Perl modules:
+    - Obsolete Source-Version substvar in Dpkg::Substvars by emitting errors.
   * Packaging:
   * Packaging:
     - Add liblocale-gettext-perl to libdpkg-perl Recommends.
     - Add liblocale-gettext-perl to libdpkg-perl Recommends.
     - Wrap and document dependency relationships.
     - Wrap and document dependency relationships.

+ 10 - 8
doc/README.feature-removal-schedule

@@ -10,14 +10,6 @@ Why:
  backwards compatibility but will be removed once all packages have the
  backwards compatibility but will be removed once all packages have the
  debian/source/format file. This is unlikely to happen before 1.17.x.
  debian/source/format file. This is unlikely to happen before 1.17.x.
 
 
-What: Source-Version (substvar)
-Status: obsolete
-When: 1.16.x
-Warning: lintian (substvar-source-version-is-deprecated)
-Why:
- The semantics of Source-Version are misleading when applied to binNMUs.
- Should switch to use binary:Version or source:Version substvars.
-
 What: --print-installation-architecture (dpkg option)
 What: --print-installation-architecture (dpkg option)
 Status: obsolete
 Status: obsolete
 When: 1.15.x
 When: 1.15.x
@@ -170,3 +162,13 @@ Why:
  .
  .
  In addition there's no known users in Debian, so it was deemed safe to remove
  In addition there's no known users in Debian, so it was deemed safe to remove
  the support without a transition.
  the support without a transition.
+
+What: Source-Version (substvar)
+Status: removed
+When: 1.18.11
+Warning: program, lintian (substvar-source-version-is-deprecated)
+Why:
+ The semantics of Source-Version were misleading when applied to binNMUs.
+ Should switch to use binary:Version or source:Version substvars.
+ .
+ The code got changed to emit errors.

+ 3 - 2
man/deb-substvars.man

@@ -108,8 +108,9 @@ for example; since dpkg 1.13.19).
 .TP
 .TP
 .B Source\-Version
 .B Source\-Version
 The source package version (from the changelog file). This variable is now
 The source package version (from the changelog file). This variable is now
-\fBdeprecated\fP as its meaning is different from its function, please use
-the \fBsource:Version\fP or \fBbinary:Version\fP as appropriate.
+\fBobsolete\fP and emits an error when used as its meaning is different from
+its function, please use the \fBsource:Version\fP or \fBbinary:Version\fP as
+appropriate.
 .TP
 .TP
 .B Installed\-Size
 .B Installed\-Size
 The approximate total size of the package's installed files. This value is
 The approximate total size of the package's installed files. This value is

+ 11 - 7
scripts/Dpkg/Substvars.pm

@@ -19,7 +19,7 @@ package Dpkg::Substvars;
 use strict;
 use strict;
 use warnings;
 use warnings;
 
 
-our $VERSION = '1.04';
+our $VERSION = '1.05';
 
 
 use POSIX qw(:errno_h);
 use POSIX qw(:errno_h);
 
 
@@ -49,7 +49,7 @@ strings.
 use constant {
 use constant {
     SUBSTVAR_ATTR_USED => 1,
     SUBSTVAR_ATTR_USED => 1,
     SUBSTVAR_ATTR_AUTO => 2,
     SUBSTVAR_ATTR_AUTO => 2,
-    SUBSTVAR_ATTR_OLD => 4,
+    SUBSTVAR_ATTR_AGED => 4,
 };
 };
 
 
 =head1 METHODS
 =head1 METHODS
@@ -244,8 +244,8 @@ sub set_version_substvars {
     $self->set('source:Version', $sourceversion, $attr);
     $self->set('source:Version', $sourceversion, $attr);
     $self->set('source:Upstream-Version', $upstreamversion, $attr);
     $self->set('source:Upstream-Version', $upstreamversion, $attr);
 
 
-    # XXX: Source-Version is now deprecated, remove in the future.
-    $self->set('Source-Version', $binaryversion, $attr | SUBSTVAR_ATTR_OLD);
+    # XXX: Source-Version is now obsolete, remove in 1.19.x.
+    $self->set('Source-Version', $binaryversion, $attr | SUBSTVAR_ATTR_AGED);
 }
 }
 
 
 =item $s->set_arch_substvars()
 =item $s->set_arch_substvars()
@@ -296,9 +296,9 @@ sub substvars {
             $self->mark_as_used($vn);
             $self->mark_as_used($vn);
             $count++;
             $count++;
 
 
-            if (not $opts{no_warn} and $self->{attr}{$vn} & SUBSTVAR_ATTR_OLD) {
-                warning($opts{msg_prefix} .
-                        g_('deprecated substitution variable ${%s}'), $vn);
+            if ($self->{attr}{$vn} & SUBSTVAR_ATTR_AGED) {
+                error($opts{msg_prefix} .
+                      g_('obsolete substitution variable ${%s}'), $vn);
             }
             }
         } else {
         } else {
             warning($opts{msg_prefix} . g_('unknown substitution variable ${%s}'),
             warning($opts{msg_prefix} . g_('unknown substitution variable ${%s}'),
@@ -395,6 +395,10 @@ sub output {
 
 
 =head1 CHANGES
 =head1 CHANGES
 
 
+=head2 Version 1.05 (dpkg 1.18.11)
+
+Obsolete substvar: Emit an error on Source-Version substvar usage.
+
 =head2 Version 1.04 (dpkg 1.18.0)
 =head2 Version 1.04 (dpkg 1.18.0)
 
 
 New method: $s->filter().
 New method: $s->filter().

+ 1 - 0
t/pod-spell.t

@@ -81,6 +81,7 @@ qa
 reportfile
 reportfile
 rfc822
 rfc822
 sig
 sig
+substvar
 substvars
 substvars
 unparsed
 unparsed
 update-buildflags
 update-buildflags