소스 검색

Add the source version inside parenthesis to the Source field in the
generated .changes and binary packages if the binary package version
differs (like in binNMUs). Closes: #62529

Guillem Jover 20 년 전
부모
커밋
9ee221065b
6개의 변경된 파일32개의 추가작업 그리고 10개의 파일을 삭제
  1. 13 0
      ChangeLog
  2. 3 0
      debian/changelog
  3. 8 0
      scripts/controllib.pl
  4. 4 6
      scripts/dpkg-genchanges.pl
  5. 3 4
      scripts/dpkg-gencontrol.pl
  6. 1 0
      scripts/dpkg-source.pl

+ 13 - 0
ChangeLog

@@ -1,3 +1,16 @@
+2006-06-16  Guillem Jover  <guillem@debian.org>
+
+	* scripts/controllib.pl (parsechangelog): Move substvar initialization
+	to ...
+	(init_substvars): ... here. New function. Move the dpkg substvars
+	initialization to this function.
+	* scripts/dpkg-source.pl: Call init_substvars after parsechangelog.
+	* scripts/dpkg-genchanges.pl: Replace setting dpkg substvars with
+	init_substvars. If the version field or the one forced from command
+	line differs from the substvar, add the later to the output Source
+	field inside parenthesis.
+	* scripts/dpkg-gencontrol.pl: Likewise.
+
 2006-06-16  Andrew Ferrier  <andrew@new-destiny.co.uk>
 	    Guillem Jover  <guillem@debian.org>
 

+ 3 - 0
debian/changelog

@@ -9,6 +9,9 @@ dpkg (1.13.22~) UNRELEASED; urgency=low
     Closes: #325895
   * Clarify the legend in update-alternatives '--help' (Andrew Ferrier).
     Closes: #305318
+  * Add the source version inside parenthesis to the Source field in the
+    generated .changes and binary packages if the binary package version
+    differs (like in binNMUs). Closes: #62529
 
   [ Updated dpkg Translations ]
   * Romanian (Eddy Petrişor).

+ 8 - 0
scripts/controllib.pl

@@ -304,7 +304,10 @@ sub parsechangelog {
     }
     &parsecdata('L',0,_g("parsed version of changelog"));
     close(CDATA); $? && &subprocerr(_g("parse changelog"));
+}
 
+sub init_substvars
+{
     # XXX: Source-Version is now deprecated, remove in the future.
     $substvar{'Source-Version'}= $fi{"L Version"};
     $substvar{'binary:Version'} = $fi{"L Version"};
@@ -312,6 +315,11 @@ sub parsechangelog {
     $substvar{'source:Version'} =~ s/\+b[0-9]+$//;
     $substvar{'source:Upstream-Version'} = $fi{"L Version"};
     $substvar{'source:Upstream-Version'} =~ s/-[^-]*$//;
+
+    # We expect the calling program to set $version.
+    $substvar{"dpkg:Version"} = $version;
+    $substvar{"dpkg:Upstream-Version"} = $version;
+    $substvar{"dpkg:Upstream-Version"} =~ s/-[^-]+$//;
 }
 
 sub checkpackagename {

+ 4 - 6
scripts/dpkg-genchanges.pl

@@ -272,12 +272,7 @@ for $p (keys %p2f) {
                                  $p, $pri, $f2pri{$f}));
 }
 
-# Extract version and origversion so we can add them to our fixed list
-# of substvars
-
-$substvar{"dpkg:Version"} = $version;
-$substvar{"dpkg:Upstream-Version"} = $version;
-$substvar{"dpkg:Upstream-Version"} =~ s/-[^-]+$//;
+&init_substvars;
 
 if (!$binaryonly) {
     $sec= $sourcedefault{'Section'};
@@ -353,6 +348,9 @@ for $f (@sourcefiles,@fileslistfiles) {
 }    
 
 $f{'Source'}= $sourcepackage;
+if ($f{'Version'} ne $substvar{'source:Version'}) {
+    $f{'Source'} .= " ($substvar{'source:Version'})";
+}
 
 $f{'Maintainer'}= $forcemaint if length($forcemaint);
 $f{'Changed-By'}= $forcechangedby if length($forcechangedby);

+ 3 - 4
scripts/dpkg-gencontrol.pl

@@ -187,9 +187,7 @@ for $_ (keys %fi) {
 
 $f{'Version'}= $forceversion if length($forceversion);
 
-$substvar{"dpkg:Version"} = $version;
-$substvar{"dpkg:Upstream-Version"} = $version;
-$substvar{"dpkg:Upstream-Version"} =~ s/-[^-]+$//;
+&init_substvars;
 
 for $_ (keys %fi) {
     $v= $fi{$_};
@@ -226,7 +224,8 @@ for $f (qw(Maintainer Description Architecture)) {
 }
 $oppackage= $f{'Package'};
 
-$verdiff= $f{'Version'} ne $sourceversion;
+$verdiff = $f{'Version'} ne $substvar{'source:Version'} or
+           $f{'Version'} ne $sourceversion;
 if ($oppackage ne $sourcepackage || $verdiff) {
     $f{'Source'}= $sourcepackage;
     $f{'Source'}.= " ($substvar{'source:Version'})" if $verdiff;

+ 1 - 0
scripts/dpkg-source.pl

@@ -194,6 +194,7 @@ if ($opmode eq 'build') {
     &parsechangelog;
     &parsecontrolfile;
     $f{"Format"}=$def_dscformat;
+    &init_substvars;
 
     $archspecific=0;
     for $_ (keys %fi) {