From 88a0baff55e928679551ff6c68bdc8884d6fbf62 Mon Sep 17 00:00:00 2001 From: Raphaƫl Hertzog Date: Sun, 20 Sep 2009 10:59:05 +0200 Subject: Dpkg::Changelog: add new vendor hook post-process-changelog-entry This hook is mainly meant to extract more structured information from the raw changes information. --- scripts/Dpkg/Changelog.pm | 4 ++++ scripts/Dpkg/Vendor/Default.pm | 9 +++++++++ 2 files changed, 13 insertions(+) (limited to 'scripts') diff --git a/scripts/Dpkg/Changelog.pm b/scripts/Dpkg/Changelog.pm index 46b961c17..202b8fbc1 100644 --- a/scripts/Dpkg/Changelog.pm +++ b/scripts/Dpkg/Changelog.pm @@ -43,6 +43,7 @@ use Dpkg::Gettext; use Dpkg::ErrorHandling qw(:DEFAULT report); use Dpkg::Control; use Dpkg::Version qw(compare_versions); +use Dpkg::Vendor qw(run_vendor_hook); use base qw(Exporter); @@ -553,6 +554,7 @@ sub dpkg { $f->{Closes} = join " ", sort { $a <=> $b } @{$f->{Closes}}; $f->{Urgency} .= $urg_comment; + run_vendor_hook("post-process-changelog-entry", $f); return %$f if wantarray; return $f; @@ -611,6 +613,8 @@ sub rfc822 { $f->{$field} = $entry->{$field}; } + run_vendor_hook("post-process-changelog-entry", $f); + push @out_data, $f; } diff --git a/scripts/Dpkg/Vendor/Default.pm b/scripts/Dpkg/Vendor/Default.pm index d940839bd..881d8af21 100644 --- a/scripts/Dpkg/Vendor/Default.pm +++ b/scripts/Dpkg/Vendor/Default.pm @@ -96,6 +96,12 @@ function. Known operations are "register", "insert_after" and "insert_before". +=item post-process-changelog-entry ($fields) + +The hook is called in Dpkg::Changelog to post-process a +Dpkg::Changelog::Entry after it has been created and filled with the +appropriate values. + =back =cut @@ -111,7 +117,10 @@ sub run_hook { return (); } elsif ($hook eq "register-custom-fields") { return (); + } elsif ($hook eq "post-process-changelog-entry") { + my $fields = shift @params; } + } =back -- cgit v1.2.3