瀏覽代碼

dpkg-gencontrol: Do substvar instantiation just once

Do it before perparing for the final output, instead of doing it per
some specific fields and then a global one immediately before output.
Guillem Jover 9 年之前
父節點
當前提交
e977c30856
共有 2 個文件被更改,包括 5 次插入4 次删除
  1. 1 0
      debian/changelog
  2. 4 4
      scripts/dpkg-gencontrol.pl

+ 1 - 0
debian/changelog

@@ -57,6 +57,7 @@ dpkg (1.18.11) UNRELEASED; urgency=medium
   * Give more information on --set-selections warnings. Closes: #842230
   * Add new DEB_*_ARCH_ABI and DEB_*_ARCH_LIBC variables to dpkg-architecture
     and architecture.mk Makefile fragment.
+  * Do substvar instantiation just once in dpkg-gencontrol.
   * Architecture support:
     - Add support for AIX operating system.
     - Add a version pseudo-field to the arch tables.

+ 4 - 4
scripts/dpkg-gencontrol.pl

@@ -367,13 +367,14 @@ for my $f (keys %remove) {
     delete $fields->{$f};
 }
 
+$fields->apply_substvars($substvars);
+
 my $sversion = $fields->{'Version'};
 $sversion =~ s/^\d+://;
 $forcefilename //= sprintf('%s_%s_%s.%s', $fields->{'Package'}, $sversion,
                            $fields->{'Architecture'}, $pkg_type);
-$forcefilename = $substvars->substvars($forcefilename);
-my $section = $substvars->substvars($fields->{'Section'} || '-');
-my $priority = $substvars->substvars($fields->{'Priority'} || '-');
+my $section = $fields->{'Section'} || '-';
+my $priority = $fields->{'Priority'} || '-';
 
 # Obtain a lock on debian/control to avoid simultaneous updates
 # of debian/files when parallel building is in use
@@ -417,7 +418,6 @@ if (!$stdout) {
     $fh_output = \*STDOUT;
 }
 
-$fields->apply_substvars($substvars);
 $fields->output($fh_output);
 
 if (!$stdout) {