From: Raphael Hertzog Date: Tue, 22 Jan 2008 17:49:24 +0000 (+0100) Subject: Disable variable substitution in dpkg-genchanges X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aa398d55bd6e6348c60192fa8f585793b24c867c;p=dpkg Disable variable substitution in dpkg-genchanges * scripts/dpkg-genchanges.pl: Do not substitute variables on the output. * man/dpkg-genchanges.pl: Document this change. --- diff --git a/ChangeLog b/ChangeLog index 1d7ee914..c7f8e284 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,10 @@ scripts/dpkg-source.pl: Remove the IO-layer that converts to UTF-8. It's not as smart as I expected. + * scripts/dpkg-genchanges.pl: Do not substitute variables on + the output. + * man/dpkg-genchanges.pl: Document this change. + 2008-01-22 Guillem Jover * configure.ac: Release 1.14.16.2. diff --git a/debian/changelog b/debian/changelog index 9d9dd446..d9e897c6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ dpkg (1.14.16.3) UNRELEASED; urgency=low * Remove the ":utf8" layer that utf8-encodes already valid utf8. Closes: #462098 + * Disable variable substitution in dpkg-genchanges. Closes: #462079, #462089 -- Raphael Hertzog Tue, 22 Jan 2008 18:15:42 +0100 diff --git a/man/dpkg-genchanges.1 b/man/dpkg-genchanges.1 index 2662cca0..890ca859 100644 --- a/man/dpkg-genchanges.1 +++ b/man/dpkg-genchanges.1 @@ -79,6 +79,9 @@ Read substitution variables in .IR substvarsfile ; the default is .BR debian/substvars . +No variable substitution is done on any of the fields that are output, +however the special variable \fIFormat\fR will override the field of the +same name. .TP .BI \-D field = value Override or add an output control file field. diff --git a/scripts/dpkg-genchanges.pl b/scripts/dpkg-genchanges.pl index 597bed42..a908fb5d 100755 --- a/scripts/dpkg-genchanges.pl +++ b/scripts/dpkg-genchanges.pl @@ -200,6 +200,7 @@ $bad_parser = 1 if ($@); my $control = Dpkg::Control->new($controlfile); my $fields = Dpkg::Fields::Object->new(); $substvars->set_version_substvars($changelog->{"Version"}); +$substvars->parse($varlistfile) if -e $varlistfile; if (not is_sourceonly) { open(FL,"<",$fileslistfile) || &syserr(_g("cannot read files list file")); @@ -441,7 +442,7 @@ if (!is_binaryonly) { print(STDERR "$progname: $origsrcmsg\n") || &syserr(_g("write original source message")) unless $quiet; -$fields->{'Format'} = '${Format}'; # Use value stored in substvars +$fields->{'Format'} = $substvars->get("Format"); if (!defined($fields->{'Date'})) { chomp(my $date822 = `date -R`); @@ -510,7 +511,6 @@ for my $f (keys %remove) { delete $fields->{$f}; } -$substvars->parse($varlistfile) if -e $varlistfile; tied(%{$fields})->set_field_importance(@changes_fields); -tied(%{$fields})->output(\*STDOUT, $substvars); +tied(%{$fields})->output(\*STDOUT); # Note: no substitution of variables