The following commit has been merged in the master branch:
commit 3df3fe4ce2ca36d679053a7b4f6415cfad25daed
Author: Raphaël Hertzog <[email protected]>
Date:   Sun Sep 20 11:13:10 2009 +0200

    Dpkg::Vendor::Ubuntu: move Launchpad-Bugs-Fixed creation in another hook
    
    The creation of the Launchpad-Bugs-Fixed field is now done
    in post-process-changelog-entry instead of before-changes-creation
    so that it's also output by dpkg-parsechangelog and not only
    in the .changes file. Closes: #536066

diff --git a/debian/changelog b/debian/changelog
index ebe5c2b..8a00b78 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -23,6 +23,8 @@ dpkg (1.15.5) UNRELEASED; urgency=low
       information that was previously available through Dpkg::Deps.
   * All dpkg-* perl programs that work with control information have been
     updated to use the new Dpkg::Control interface.
+  * Create Launchpad-Bugs-Fixed directly in the changelog parsing code thanks
+    to a new vendor hook post-process-changelog-entry. Closes: #536066
 
   [ Updated dpkg translations ]
   * German (Sven Joachim).
diff --git a/scripts/Dpkg/Vendor/Ubuntu.pm b/scripts/Dpkg/Vendor/Ubuntu.pm
index b4b4596..545b02e 100644
--- a/scripts/Dpkg/Vendor/Ubuntu.pm
+++ b/scripts/Dpkg/Vendor/Ubuntu.pm
@@ -64,17 +64,12 @@ sub run_hook {
     } elsif ($hook eq "before-changes-creation") {
         my $fields = shift @params;
 
-        # Add Launchpad-Bugs-Fixed field
-        my $bugs = find_launchpad_closes($fields->{"Changes"} || "");
-        if (scalar(@{$bugs})) {
-            $fields->{"Launchpad-Bugs-Fixed"} = join(" ", @{$bugs});
-        }
-
     } elsif ($hook eq "keyrings") {
         my @keyrings = $self->SUPER::run_hook($hook);
 
         push(@keyrings, '/usr/share/keyrings/ubuntu-archive-keyring.gpg');
         return @keyrings;
+
     } elsif ($hook eq "register-custom-fields") {
         my @field_ops = $self->SUPER::run_hook($hook);
         push @field_ops,
@@ -83,6 +78,15 @@ sub run_hook {
             [ "insert_after", CTRL_FILE_CHANGES, "Closes", 
"Launchpad-Bugs-Fixed" ],
             [ "insert_after", CTRL_CHANGELOG, "Closes", "Launchpad-Bugs-Fixed" 
];
         return @field_ops;
+
+    } elsif ($hook eq "post-process-changelog-entry") {
+        my $fields = shift @params;
+
+        # Add Launchpad-Bugs-Fixed field
+        my $bugs = find_launchpad_closes($fields->{"Changes"} || "");
+        if (scalar(@$bugs)) {
+            $fields->{"Launchpad-Bugs-Fixed"} = join(" ", @$bugs);
+        }
     }
 
 }

-- 
dpkg's main repository


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

Reply via email to