The following commit has been merged in the master branch:
commit d60bb3e211d9496653d5061c112ce3092998fe11
Author: Joachim Breitner <[email protected]>
Date:   Sat Jun 13 23:33:08 2009 +0200

    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.

diff --git a/debian/changelog b/debian/changelog
index eb19faa..a8438d1 100644
--- a/debian/changelog
+++ b/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
     hence are blacklisted for this reason). Closes: #533642
 
+  [ Joachim Breitner ]
+  * Warn about unused substvars in dpkg-gencontrol. Closes: #532760
+
   [ Updated dpkg translations ]
   * Simplified Chinese (Deng Xiyue). Closes: #531387
   * Catalan (Jordi Mallach). Closes: #532109
diff --git a/scripts/Dpkg/Fields.pm b/scripts/Dpkg/Fields.pm
index fea5dc4..fe32896 100644
--- a/scripts/Dpkg/Fields.pm
+++ b/scripts/Dpkg/Fields.pm
@@ -213,6 +213,7 @@ sub output {
     if (defined($substvars)) {
        foreach my $f (keys %{$self->[0]}) {
            $substvars->set("F:$f", $self->[0]->{$f});
+           $substvars->no_warn("F:$f");
        }
     }
 
diff --git a/scripts/dpkg-gencontrol.pl b/scripts/dpkg-gencontrol.pl
index da4c2d4..19ca39c 100755
--- a/scripts/dpkg-gencontrol.pl
+++ b/scripts/dpkg-gencontrol.pl
@@ -312,6 +312,7 @@ if (defined($substvars->get('Extra-Size'))) {
 if (defined($substvars->get('Installed-Size'))) {
     $fields->{'Installed-Size'} = $substvars->get('Installed-Size');
 }
+$substvars->no_warn('Installed-Size');
 
 for my $f (keys %override) {
     $fields->{$f} = $override{$f};
@@ -370,4 +371,5 @@ if (!$stdout) {
         syserr(_g("cannot install output control file \`%s'"), $cf);
 }
 
+$substvars->warn_about_unused();
 

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to