From 5884d153fb6d94cb5af2fbcc809b83e5d47297cb Mon Sep 17 00:00:00 2001 From: Raphael Hertzog Date: Sat, 19 Jan 2008 19:00:00 +0100 Subject: [PATCH] dpkg-buildpackage: use parse_changelog() instead of calling dpkg-parsechangelog --- ChangeLog | 6 ++++++ scripts/dpkg-buildpackage.pl | 19 +++++-------------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 40d9a106..d70be27e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-01-19 Raphael Hertzog + + * scripts/dpkg-buildpackage.pl: Use + Dpkg::Changelog::parse_changelog() instead of calling + dpkg-parsechangelog. + 2008-01-18 Raphael Hertzog * scripts/Dpkg/Shlibs/SymbolFile.pm, diff --git a/scripts/dpkg-buildpackage.pl b/scripts/dpkg-buildpackage.pl index 9ff387cf..a841e3df 100755 --- a/scripts/dpkg-buildpackage.pl +++ b/scripts/dpkg-buildpackage.pl @@ -13,6 +13,7 @@ use Dpkg::ErrorHandling qw(warning error failure syserr subprocerr usageerr use Dpkg::BuildOptions; use Dpkg::Compression; use Dpkg::Version qw(check_version); +use Dpkg::Changelog qw(parse_changelog); textdomain("dpkg-dev"); @@ -256,17 +257,7 @@ if ($parallel) { my $cwd = cwd(); my $dir = basename($cwd); -my %changes; -open CHANGELOG, '-|', 'dpkg-parsechangelog' or subprocerr('dpkg-parsechangelog'); -# until we have a better parsecdata function this -# should suffice -while ($_ = ) { - chomp; - /^(\S+):\s*(.*)$/ && do { - $changes{lc $1} = $2; - }; -} -close CHANGELOG or subprocerr('dpkg-parsechangelog'); +my $changelog = parse_changelog(); sub mustsetvar { my ($var, $text) = @_; @@ -278,8 +269,8 @@ sub mustsetvar { return $var; } -my $pkg = mustsetvar($changes{source}, _g('source package')); -my $version = mustsetvar($changes{version}, _g('source version')); +my $pkg = mustsetvar($changelog->{source}, _g('source package')); +my $version = mustsetvar($changelog->{version}, _g('source version')); check_version($version); my $maintainer; @@ -288,7 +279,7 @@ if ($changedby) { } elsif ($maint) { $maintainer = $maint; } else { - $maintainer = mustsetvar($changes{maintainer}, _g('source changed by')); + $maintainer = mustsetvar($changelog->{maintainer}, _g('source changed by')); } open my $arch_env, '-|', 'dpkg-architecture', "-a$targetarch", -- 2.39.5