+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>
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).
}
&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"};
$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 {
$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'};
}
$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);
$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{$_};
}
$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;
&parsechangelog;
&parsecontrolfile;
$f{"Format"}=$def_dscformat;
+ &init_substvars;
$archspecific=0;
for $_ (keys %fi) {