Browse Source

Dpkg::Substvars: Move upstream version computation into a temporary variable

Guillem Jover 12 years ago
parent
commit
1da1f62fb9
1 changed files with 4 additions and 2 deletions
  1. 4 2
      scripts/Dpkg/Substvars.pm

+ 4 - 2
scripts/Dpkg/Substvars.pm

@@ -202,10 +202,12 @@ sub set_version_substvars {
     # field on the changelog, always fix up the source version.
     # field on the changelog, always fix up the source version.
     $sourceversion =~ s/\+b[0-9]+$//;
     $sourceversion =~ s/\+b[0-9]+$//;
 
 
+    my $upstreamversion = $sourceversion;
+    $upstreamversion =~ s/-[^-]*$//;
+
     $self->{vars}{'binary:Version'} = $binaryversion;
     $self->{vars}{'binary:Version'} = $binaryversion;
     $self->{vars}{'source:Version'} = $sourceversion;
     $self->{vars}{'source:Version'} = $sourceversion;
-    $self->{vars}{'source:Upstream-Version'} = $sourceversion;
-    $self->{vars}{'source:Upstream-Version'} =~ s/-[^-]*$//;
+    $self->{vars}{'source:Upstream-Version'} = $upstreamversion;
 
 
     # XXX: Source-Version is now deprecated, remove in the future.
     # XXX: Source-Version is now deprecated, remove in the future.
     $self->{vars}{'Source-Version'} = $binaryversion;
     $self->{vars}{'Source-Version'} = $binaryversion;