use Dpkg::BuildOptions;
use Dpkg::Version qw(check_version);
-push (@INC, $dpkglibdir);
-require 'controllib.pl';
-
textdomain("dpkg-dev");
sub showversion {
use Dpkg::Deps;
use Dpkg::Control;
-push(@INC,$dpkglibdir);
-require 'controllib.pl';
-
textdomain("dpkg-dev");
sub usage {
use Dpkg::Cdata;
use Dpkg::Substvars;
use Dpkg::Vars;
-
-push(@INC,$dpkglibdir);
-require 'controllib.pl';
-
-our (%fi);
+use Dpkg::Changelog qw(parse_changelog);
textdomain("dpkg-dev");
}
}
-parsechangelog($changelogfile, $changelogformat, $since);
+my $changelog = parse_changelog($changelogfile, $changelogformat, $since);
my $control = Dpkg::Control->new($controlfile);
my $fields = Dpkg::Fields::Object->new();
-$substvars->set_version_substvars($fi{"L Version"});
+$substvars->set_version_substvars($changelog->{"Version"});
if (not is_sourceonly) {
open(FL,"<",$fileslistfile) || &syserr(_g("cannot read files list file"));
}
}
-for $_ (keys %fi) {
- my $v = $fi{$_};
-
- if (s/^L //) {
- if (m/^Source$/i) {
- set_source_package($v);
- } elsif (m/^Maintainer$/i) {
- $fields->{"Changed-By"} = $v;
- } elsif (m/^(Version|Changes|Urgency|Distribution|Date|Closes)$/i) {
- $fields->{$_} = $v;
- } elsif (s/^X[BS]*C[BS]*-//i) {
- $fields->{$_} = $v;
- } elsif (!m/^X[BS]+-/i) {
- &unknown(_g("parsed version of changelog"));
- }
+# Scan fields of dpkg-parsechangelog
+foreach $_ (keys %{$changelog}) {
+ my $v = $changelog->{$_};
+ if (m/^Source$/i) {
+ set_source_package($v);
+ } elsif (m/^Maintainer$/i) {
+ $fields->{"Changed-By"} = $v;
+ } elsif (m/^(Version|Changes|Urgency|Distribution|Date|Closes)$/i) {
+ $fields->{$_} = $v;
+ } elsif (s/^X[BS]*C[BS]*-//i) {
+ $fields->{$_} = $v;
+ } elsif (!m/^X[BS]+-/i) {
+ &unknown(_g("parsed version of changelog"));
}
}
use Dpkg::Control;
use Dpkg::Substvars;
use Dpkg::Vars;
-
-push(@INC,$dpkglibdir);
-require 'controllib.pl';
-
-our %fi;
+use Dpkg::Changelog qw(parse_changelog);
textdomain("dpkg-dev");
}
}
-parsechangelog($changelogfile, $changelogformat);
-$substvars->set_version_substvars($fi{"L Version"});
+my $changelog = parse_changelog($changelogfile, $changelogformat);
+$substvars->set_version_substvars($changelog->{"Version"});
$substvars->parse($varlistfile) if -e $varlistfile;
my $control = Dpkg::Control->new($controlfile);
my $fields = Dpkg::Fields::Object->new();
}
}
-for $_ (keys %fi) {
- my $v = $fi{$_};
-
- if (s/^L //) {
- if (m/^Source$/) {
- set_source_package($v);
- } elsif (m/^Version$/) {
- $sourceversion = $v;
- $fields->{$_} = $v unless defined($forceversion);
- } elsif (m/^(Maintainer|Changes|Urgency|Distribution|Date|Closes)$/) {
- } elsif (s/^X[CS]*B[CS]*-//i) {
- $fields->{$_} = $v;
- } elsif (!m/^X[CS]+-/i) {
- $_ = "L $_"; &unknown(_g("parsed version of changelog"));
- }
+# Scan fields of dpkg-parsechangelog
+foreach $_ (keys %{$changelog}) {
+ my $v = $changelog->{$_};
+
+ if (m/^Source$/) {
+ set_source_package($v);
+ } elsif (m/^Version$/) {
+ $sourceversion = $v;
+ $fields->{$_} = $v unless defined($forceversion);
+ } elsif (m/^(Maintainer|Changes|Urgency|Distribution|Date|Closes)$/) {
+ } elsif (s/^X[CS]*B[CS]*-//i) {
+ $fields->{$_} = $v;
+ } elsif (!m/^X[CS]+-/i) {
+ &unknown(_g("parsed version of changelog"));
}
}
use Dpkg::Gettext;
use Dpkg::ErrorHandling qw(warning error syserr usageerr);
use Dpkg::Control;
+use Dpkg::Changelog qw(parse_changelog);
textdomain("dpkg-dev");
-push(@INC, $dpkglibdir);
-require 'controllib.pl';
-
-our %fi;
-our %p2i;
-
my $changelogfile = 'debian/changelog';
my $packagebuilddir = 'debian/tmp';
}
if (not defined($sourceversion)) {
- parsechangelog($changelogfile);
- $sourceversion = $fi{"L Version"};
+ my $changelog = parse_changelog($changelogfile);
+ $sourceversion = $changelog->{"Version"};
}
if (not defined($oppackage)) {
my $control = Dpkg::Control->new();
use Dpkg::Substvars;
use Dpkg::Version qw(check_version);
use Dpkg::Vars;
+use Dpkg::Changelog qw(parse_changelog);
my @filesinarchive;
my %dirincluded;
use File::Temp qw (tempfile);
use Cwd;
-push (@INC, $dpkglibdir);
-require 'controllib.pl';
-
-our (%fi);
-our @src_dep_fields;
-
textdomain("dpkg-dev");
my @dsc_fields = (qw(Format Source Binary Architecture Version Origin
$changelogfile= "$dir/debian/changelog" unless defined($changelogfile);
$controlfile= "$dir/debian/control" unless defined($controlfile);
- parsechangelog($changelogfile, $changelogformat);
+ my $changelog = parse_changelog($changelogfile, $changelogformat);
my $control = Dpkg::Control->new($controlfile);
my $fields = Dpkg::Fields::Object->new();
}
}
- for $_ (keys %fi) {
- my $v = $fi{$_};
+ # Scan fields of dpkg-parsechangelog
+ foreach $_ (keys %{$changelog}) {
+ my $v = $changelog->{$_};
- if (s/^L //) {
- if (m/^Source$/) {
- set_source_package($v);
- } elsif (m/^Version$/) {
- check_version($v);
- $fields->{$_} = $v;
- } elsif (s/^X[BS]*C[BS]*-//i) {
- $fields->{$_} = $v;
- } elsif (m/^(Maintainer|Changes|Urgency|Distribution|Date|Closes)$/i ||
- m/^X[BS]+-/i) {
- } else {
- &unknown(_g("parsed version of changelog"));
- }
+ if (m/^Source$/) {
+ set_source_package($v);
+ } elsif (m/^Version$/) {
+ check_version($v);
+ $fields->{$_} = $v;
+ } elsif (s/^X[BS]*C[BS]*-//i) {
+ $fields->{$_} = $v;
+ } elsif (m/^(Maintainer|Changes|Urgency|Distribution|Date|Closes)$/i ||
+ m/^X[BS]+-/i) {
+ } else {
+ &unknown(_g("parsed version of changelog"));
}
}