summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scripts/Dpkg/Changelog.pm2
-rw-r--r--scripts/Dpkg/Changelog/Debian.pm21
2 files changed, 17 insertions, 6 deletions
diff --git a/scripts/Dpkg/Changelog.pm b/scripts/Dpkg/Changelog.pm
index e4fd8cdf1..5aca5b449 100644
--- a/scripts/Dpkg/Changelog.pm
+++ b/scripts/Dpkg/Changelog.pm
@@ -500,6 +500,8 @@ BEGIN {
@CHANGELOG_FIELDS = qw(Source Version Distribution
Urgency Maintainer Date Closes Changes
Timestamp Header Items Trailer
+ BlankAfterHeader BlankAfterChanges
+ BlankAfterTrailer
Urgency_comment Urgency_lc);
$CHANGELOG_FIELDS = Dpkg::Control->new(type => CTRL_CHANGELOG);
%$CHANGELOG_FIELDS = map { $_ => 1 } @CHANGELOG_FIELDS;
diff --git a/scripts/Dpkg/Changelog/Debian.pm b/scripts/Dpkg/Changelog/Debian.pm
index 454697e79..3b7df304b 100644
--- a/scripts/Dpkg/Changelog/Debian.pm
+++ b/scripts/Dpkg/Changelog/Debian.pm
@@ -156,6 +156,9 @@ sub parse {
$entry->{'Header'} = "$_";
($entry->{'Distribution'} = "$3") =~ s/^\s+//;
$entry->{'Changes'} = [];
+ $entry->{'BlankAfterHeader'} = [];
+ $entry->{'BlankAfterChanges'} = [];
+ $entry->{'BlankAfterTrailer'} = [];
$entry->{'Urgency_comment'} = '';
$entry->{'Urgency'} = $entry->{'Urgency_lc'} = 'unknown';
}
@@ -226,6 +229,8 @@ sub parse {
_g( "badly formatted trailer line" ),
"$_");
}
+ push @{$entry->{BlankAfterChanges}}, @blanklines;
+ @blanklines = ();
$entry->{'Trailer'} = $_;
$entry->{'Maintainer'} = "$1 <$2>" unless $entry->{'Maintainer'};
unless($entry->{'Date'} && defined $entry->{'Timestamp'}) {
@@ -281,12 +286,16 @@ sub parse {
@blanklines = ();
$expect = 'more change data or trailer';
} elsif (!m/\S/) {
- next if $expect eq 'start of change data'
- || $expect eq 'next heading or eof';
- $expect eq 'more change data or trailer'
- || $self->_do_parse_error($file, $NR,
- sprintf(_g("found blank line where expected %s"),
- $expect));
+ if ($expect eq 'start of change data') {
+ push @{$entry->{BlankAfterHeader}}, $_;
+ next;
+ } elsif ($expect eq 'next heading or eof') {
+ push @{$entry->{BlankAfterTrailer}}, $_;
+ next;
+ } elsif ($expect ne 'more change data or trailer') {
+ $self->_do_parse_error($file, $NR,
+ sprintf(_g("found blank line where expected %s"), $expect));
+ }
push @blanklines, $_;
} else {
$self->_do_parse_error($file, $NR, _g( "unrecognised line" ),