Kaynağa Gözat

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
Raphaël Hertzog 17 yıl önce
ebeveyn
işleme
3df3fe4ce2
2 değiştirilmiş dosya ile 12 ekleme ve 6 silme
  1. 2 0
      debian/changelog
  2. 10 6
      scripts/Dpkg/Vendor/Ubuntu.pm

+ 2 - 0
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).

+ 10 - 6
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);
+        }
     }
 
 }