Просмотр исходного кода

Add new substvars source:Version, source:Upstream-Version and
binary:Version so packages will be able to avoid breaking on binNMUs.
Based on a patch by Ken Bloom and Jeroen van Wolffelaar. Closes: #358530

Guillem Jover лет назад: 20
Родитель
Сommit
7b356663f1
5 измененных файлов с 36 добавлено и 1 удалено
  1. 7 0
      ChangeLog
  2. 3 0
      debian/changelog
  3. 13 1
      man/C/dpkg-source.1
  4. 5 0
      man/ChangeLog
  5. 8 0
      scripts/controllib.pl

+ 7 - 0
ChangeLog

@@ -1,3 +1,10 @@
+2006-05-02  Ken Bloom  <kbloom@gmail.com>,
+            Jeroen van Wolffelaar  <jeroen@wolffelaar.nl>,
+            Guillem Jover  <guillem@debian.org>
+
+	* scripts/controllib.pl (parsechangelog): Add new source:Version,
+	source:Upstream-Version and binary:Version substvars.
+
 2006-04-29  Justin Pryzby <justinpryzby@users.sourceforge.net>
 
 	* src/filesdb.c: Fix a typo (unexecpted -> unexpected).

+ 3 - 0
debian/changelog

@@ -32,6 +32,9 @@ dpkg (1.13.19~) UNRELEASED; urgency=low
   * Fix strings so that they can be more easily translated. Closes: #134358
   * Strip the trailing '/dir' from '--dir-file' option parameter to make it
     GNU install-info compatible (Clint Adams). Closes: #61640, #67237
+  * Add new substvars source:Version, source:Upstream-Version and
+    binary:Version so packages will be able to avoid breaking on binNMUs.
+    Based on a patch by Ken Bloom and Jeroen van Wolffelaar. Closes: #358530
 
  -- Christian Perrier <bubulle@debian.org>  Sat, 29 Apr 2006 14:28:55 +0200
 

+ 13 - 1
man/C/dpkg-source.1

@@ -713,8 +713,20 @@ Additionally, the following standard variables are available:
 The current build architecture (from
 .BR "dpkg \-\-print\-architecture" ).
 .TP
+.B source:Version
+The source package version.
+.TP
+.B source:Upstream\-Version
+The upstream source package version.
+.TP
+.B binary:Version
+The binary package version (which may differ from source:Version in a binNMU
+for example).
+.TP
 .B Source\-Version
-The source package version (from the changelog file).
+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.
 .TP
 .B Installed\-Size
 The total size of the package's installed files. This value is copied

+ 5 - 0
man/ChangeLog

@@ -1,3 +1,8 @@
+2006-05-02  Guillem Jover  <guillem@debian.org>
+
+	* C/dpkg-source.1: Document new source:Version,
+	source:Upstream-Version and binary:Version substvars.
+
 2006-04-19  Nicolas Francois  <nicolas.francois@centraliens.net>
 
 	* C/install-info.8: Add a missing quote arround the date.

+ 8 - 0
scripts/controllib.pl

@@ -294,7 +294,15 @@ sub parsechangelog {
     }
     &parsecdata('L',0,"parsed version of changelog");
     close(CDATA); $? && &subprocerr("parse changelog");
+
+    # XXX: Source-Version is now deprecated, remove in the future.
     $substvar{'Source-Version'}= $fi{"L Version"};
+    $substvar{'binary:Version'} = $fi{"L Version"};
+    $substvar{'source:Version'} = $fi{"L Version"};
+    $substvar{'source:Version'} =~ s/\+b[0-9]+$//;
+    $substvar{'source:Upstream-Version'} = $fi{"L Version"};
+    $substvar{'source:Upstream-Version'} =~ s/-[^-]*$//;
+    $substvar{'source:Upstream-Version'} =~ s/^[0-9]+://;
 }
 
 sub checkpackagename {