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

Disable variable substitution in dpkg-genchanges

* scripts/dpkg-genchanges.pl: Do not substitute variables on
the output.
* man/dpkg-genchanges.pl: Document this change.
Raphael Hertzog лет назад: 18
Родитель
Сommit
aa398d55bd
4 измененных файлов с 11 добавлено и 3 удалено
  1. 4 0
      ChangeLog
  2. 1 0
      debian/changelog
  3. 3 0
      man/dpkg-genchanges.1
  4. 3 3
      scripts/dpkg-genchanges.pl

+ 4 - 0
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  <guillem@debian.org>
 
 	* configure.ac: Release 1.14.16.2.

+ 1 - 0
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 <hertzog@debian.org>  Tue, 22 Jan 2008 18:15:42 +0100
 

+ 3 - 0
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.

+ 3 - 3
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