[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#786400: PTS: depneedsmaint.pl and dephasrc.pl crash: don't support build profiles



Hi,

in case you want to use dpkg to parse dependency fields (instead of just adding
another two lines to the simplify_packages_list function which remove the <>
blocks) it might help whoever ends up implementing this that dpkg does not
offer a parser for the whole Build-Depends line. So instead, one would do the
splitting by comma and pipe manually like this:

my @dep_list = ();
foreach my $dep_and (split(/\s*,\s*/m, $dep_line)) {
	foreach my $dep_or (split(/\s*\|\s*/m, $dep_and)) {
		my $dep_simple = Dpkg::Deps::Simple->new($dep_or);
		my $depname = $dep_simple->{package};
		next if not defined($depname);
		push @dep_list, $depname;
	}
}

If I understand correctly what simplify_packages_list does, then the above
should be a replacement for it using libdpkg-perl parsing.

Maybe that helps!

cheers, josch

Attachment: signature.asc
Description: signature


Reply to: