diff options
-rw-r--r-- | scripts/Dpkg/Changelog/Entry.pm | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/scripts/Dpkg/Changelog/Entry.pm b/scripts/Dpkg/Changelog/Entry.pm index 4cd78a032..c67d456c9 100644 --- a/scripts/Dpkg/Changelog/Entry.pm +++ b/scripts/Dpkg/Changelog/Entry.pm @@ -273,6 +273,30 @@ sub get_timestamp { return undef; } +=item my $str = $entry->get_dpkg_changes() + +Returns a string that is suitable for usage in a C<Changes> field +in the output format of C<dpkg-parsechangelog>. + +=cut + +sub get_dpkg_changes { + my ($self) = @_; + my $header = $self->get_part("header") || ""; + $header =~ s/\s+$//; + my $changes = "\n $header\n .\n"; + foreach my $line (@{$self->get_part("changes")}) { + $line =~ s/\s+$//; + if ($line eq "") { + $changes .= " .\n"; + } else { + $changes .= " $line\n"; + } + } + chomp $changes; + return $changes; +} + =back =head1 AUTHOR |