r48140 - /scripts/examples/gen-itp
ryan at users.alioth.debian.org
ryan at users.alioth.debian.org
Thu Dec 3 04:12:47 UTC 2009
Author: ryan
Date: Thu Dec 3 04:11:31 2009
New Revision: 48140
URL: http://svn.debian.org/wsvn/?sc=1&rev=48140
Log:
fixed for new dpkg-dev API
Modified:
scripts/examples/gen-itp
Modified: scripts/examples/gen-itp
URL: http://svn.debian.org/wsvn/scripts/examples/gen-itp?rev=48140&op=diff
==============================================================================
--- scripts/examples/gen-itp (original)
+++ scripts/examples/gen-itp Thu Dec 3 04:11:31 2009
@@ -19,14 +19,14 @@
# machine parseable in a nicer way. (replacing the information
# gathered from there with FIXMEs instead of erroring out)
+use Dpkg::Control::Info;
use Dpkg::Control;
-use Dpkg::Cdata;
sub p {
my $line = shift;
print $line . "\n";
}
-my $control = Dpkg::Control->new();
+my $control = Dpkg::Control::Info->new();
my $source = $control->get_source;
my @pkgs = $control->get_packages;
my $pkg = $pkgs[0];
@@ -38,7 +38,10 @@
my @descriptions = split("\n", $pkg->{Description});
my $short_description = $descriptions[0];
open($copyright_file, "<", "debian/copyright");
-while($_ = parsecdata($copyright_file, "debian/copyright")) {
+eval {
+while(1) {
+ my $_ = Dpkg::Control->new();
+ last if not $_->parse_fh($copyright_file, "debian/copyright");
if($_->{'Format-Specification'}) {
$upstream = $_;
} elsif ($_->{Files}) {
@@ -52,10 +55,12 @@
die("unknown block");
}
}
+};
close $copyright_file;
my $changelog_file;
open $changelog_file, "-|", "dpkg-parsechangelog";
-my $changelog = parsecdata($changelog_file, "debian/changelog");
+my $changelog = Dpkg::Control->new();
+$changelog->parse_fh($changelog_file, "debian/changelog");
close $changelog_file;
my $lang;
@@ -123,7 +128,7 @@
}
p "* URL : " . $homepage;
-p "* License : " . $main_files->{'License'};
+p "* License : " . ($main_files->{'License'} || "FIXME");
p " Programming Lang: " . $lang;
my ($short, $long) = split(/\n/, $pkg->{Description}, 2);
More information about the Pkg-perl-cvs-commits
mailing list