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

dpkg-gencontrol: warn about unused substvars (closes: #532760)

The change to Dpkg/Fields.pm is required to avoid unwanted warnings
on the F:<fieldname> substitutions.
Joachim Breitner лет назад: 17
Родитель
Сommit
d60bb3e211
3 измененных файлов с 6 добавлено и 0 удалено
  1. 3 0
      debian/changelog
  2. 1 0
      scripts/Dpkg/Fields.pm
  3. 2 0
      scripts/dpkg-gencontrol.pl

+ 3 - 0
debian/changelog

@@ -32,6 +32,9 @@ dpkg (1.15.3) UNRELEASED; urgency=low
     that the toolchain allows to be shared but that are often static (and
     that the toolchain allows to be shared but that are often static (and
     hence are blacklisted for this reason). Closes: #533642
     hence are blacklisted for this reason). Closes: #533642
 
 
+  [ Joachim Breitner ]
+  * Warn about unused substvars in dpkg-gencontrol. Closes: #532760
+
   [ Updated dpkg translations ]
   [ Updated dpkg translations ]
   * Simplified Chinese (Deng Xiyue). Closes: #531387
   * Simplified Chinese (Deng Xiyue). Closes: #531387
   * Catalan (Jordi Mallach). Closes: #532109
   * Catalan (Jordi Mallach). Closes: #532109

+ 1 - 0
scripts/Dpkg/Fields.pm

@@ -213,6 +213,7 @@ sub output {
     if (defined($substvars)) {
     if (defined($substvars)) {
 	foreach my $f (keys %{$self->[0]}) {
 	foreach my $f (keys %{$self->[0]}) {
 	    $substvars->set("F:$f", $self->[0]->{$f});
 	    $substvars->set("F:$f", $self->[0]->{$f});
+	    $substvars->no_warn("F:$f");
 	}
 	}
     }
     }
 
 

+ 2 - 0
scripts/dpkg-gencontrol.pl

@@ -312,6 +312,7 @@ if (defined($substvars->get('Extra-Size'))) {
 if (defined($substvars->get('Installed-Size'))) {
 if (defined($substvars->get('Installed-Size'))) {
     $fields->{'Installed-Size'} = $substvars->get('Installed-Size');
     $fields->{'Installed-Size'} = $substvars->get('Installed-Size');
 }
 }
+$substvars->no_warn('Installed-Size');
 
 
 for my $f (keys %override) {
 for my $f (keys %override) {
     $fields->{$f} = $override{$f};
     $fields->{$f} = $override{$f};
@@ -370,4 +371,5 @@ if (!$stdout) {
         syserr(_g("cannot install output control file \`%s'"), $cf);
         syserr(_g("cannot install output control file \`%s'"), $cf);
 }
 }
 
 
+$substvars->warn_about_unused();