Commit e033c668 authored by Felix Lechner's avatar Felix Lechner Committed by Chris Lamb

In commands/lintian.pm, use new changelog parser.

In response to Bug#933134, the changelog parser became part of
Lintian. This commit uses it in commands/lintian.pm.

Gbp-Dch: ignore
parent bfa9348b
......@@ -36,6 +36,7 @@ use Getopt::Long();
use IO::Async::Function;
use IO::Async::Loop;
use List::MoreUtils qw(any none);
use Path::Tiny;
use POSIX qw(:sys_wait_h);
use Time::HiRes qw(gettimeofday tv_interval);
......@@ -47,6 +48,7 @@ use Lintian::DepMap::Properties;
use Lintian::Data;
use Lintian::Lab;
use Lintian::Output qw(:messages);
use Lintian::Info::Changelog;
use Lintian::Internal::FrontendUtil qw(
default_parallel load_collections
sanitize_environment open_file_or_fd);
......@@ -1212,11 +1214,11 @@ sub parse_config_file {
}
sub _find_changes {
require Parse::DebianChangelog;
my $dch = Parse::DebianChangelog->init(
{ infile => 'debian/changelog', quiet => 1 });
my $data = $dch->data;
my $last = $data ? $data->[0] : undef;
my $contents = path('debian/changelog')->slurp;
my $changelog = Lintian::Info::Changelog->new;
$changelog->parse($contents);
my @entries = @{$changelog->entries};
my $last = @entries ? $entries[0] : undef;
my ($source, $version);
my $changes;
my @archs;
......@@ -1226,7 +1228,7 @@ sub _find_changes {
if exists($ENV{'DEBRELEASE_DEBS_DIR'});
if (not $last) {
my @errors = $dch->get_parse_errors;
my @errors = @{$changelog->errors};
if (@errors) {
print STDERR "Cannot parse debian/changelog due to errors:\n";
for my $error (@errors) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment