X-Git-Url: https://git.deb.at/w?a=blobdiff_plain;f=lib%2FParse%2FDebianChangelog%2FUtil.pm;h=f5c9accd148825f1c4df1b2eaa8ec1204b1d39fe;hb=HEAD;hp=4516560a225cc2f70cbbd0bfafa23079b41aa293;hpb=08f111d6668d5278a64d304fbc3bae6be86e6a94;p=deb%2Fpackages.git diff --git a/lib/Parse/DebianChangelog/Util.pm b/lib/Parse/DebianChangelog/Util.pm index 4516560..f5c9acc 100644 --- a/lib/Parse/DebianChangelog/Util.pm +++ b/lib/Parse/DebianChangelog/Util.pm @@ -67,7 +67,7 @@ sub find_closes { my $changes = shift; my @closes = (); - while ($changes && ($changes =~ /closes:\s*(?:bug)?\#?\s?\d+(?:,\s*(?:bug)?\#?\s?\d+)*/ig)) { + while ($changes && ($changes =~ /closes:\s*(?:bug)?\#?\s?\d+(?:\s*,\s*(?:bug)?\#?\s?\d+)*/ig)) { push(@closes, $& =~ /\#?\s?(\d+)/g); } @@ -96,9 +96,13 @@ sub data2rfc822 { for my $f (sort { $fieldimps->{$b} <=> $fieldimps->{$a} } keys %$data) { my $v= $data->{$f} or next; $v =~ m/\S/o || next; # delete whitespace-only fields - $v =~ m/\n\S/o && warn("field $f has newline then non whitespace >$v<"); - $v =~ m/\n[ \t]*\n/o && warn("field $f has blank lines >$v<"); - $v =~ m/\n$/o && warn("field $f has trailing newline >$v<"); + $v =~ m/\n\S/o + && warn(__g("field %s has newline then non whitespace >%s<", + $f, $v )); + $v =~ m/\n[ \t]*\n/o && warn(__g("field %s has blank lines >%s<", + $f, $v )); + $v =~ m/\n$/o && warn(__g("field %s has trailing newline >%s<", + $f, $v )); $v =~ s/\$\{\}/\$/go; $rfc822_str .= "$f: $v\n"; } @@ -142,7 +146,7 @@ in the output format of C. =cut sub get_dpkg_changes { - my $changes = "\n ".$_[0]->Header."\n .\n".$_[0]->Changes; + my $changes = "\n ".($_[0]->Header||'')."\n .\n".($_[0]->Changes||''); chomp $changes; $changes =~ s/^ $/ ./mgo; return $changes;