Recognise and ignore Enhances: lines

Patch from Ian Campbell.

It seems that "apt-cache depends" recently (as of 0.7.22) started
including Enhances lines in its output. Leading to:

 Generating dependency tree with apt-cache depends...
        UNEXPECTED: Line `  Enhances: kvm
        ' while parsing end of deptree from 'kvm-source'
        [etc....]

Ignore these lines.
This commit is contained in:
Frans Pop 2009-08-09 14:50:38 +00:00
parent fe2334131d
commit c967349160
2 changed files with 4 additions and 2 deletions

1
debian/changelog vendored
View File

@ -22,6 +22,7 @@ debian-cd (3.1.3) UNRELEASED; urgency=low
* Add support for "variants". A variant allows to include/exclude additional
packages or D-I components relative to a regular image.
* Add variant to create i386/amd64 images that support installing Xen guests.
* Recognise and ignore Enhances: lines.
-- Frans Pop <fjp@debian.org> Tue, 04 Aug 2009 22:32:08 +0200

View File

@ -308,7 +308,7 @@ sub read_depends {
my $i = shift; # Ref
my $lines = shift; # Ref
my $pkg = shift; # string
my $types = "(?:Pre)?Depends|Suggests|Recommends|Replaces|Conflicts|Breaks";
my $types = "(?:Pre)?Depends|Suggests|Recommends|Replaces|Conflicts|Breaks|Enhances";
my (@dep, @rec, @sug);
my ($type, $or, $elt);
@ -317,7 +317,8 @@ sub read_depends {
# Get rid of replaces and conflicts ...
if (($type eq "Replaces") or
($type eq "Conflicts") or
($type eq "Breaks")) {
($type eq "Breaks") or
($type eq "Enhances")) {
$$i++;
while ($lines->[$$i] =~ m/^\s{4}/) {
$$i++;