diff --git a/Build/Expand.pm b/Build/Expand.pm index 93332038..97c18ebc 100644 --- a/Build/Expand.pm +++ b/Build/Expand.pm @@ -465,6 +465,7 @@ sub expand { next; } my @q = @{$whatprovides->{$r} || Build::addproviders($config, $r)}; + @q = grep {!$aconflicts{$_}} @q if @q > 1; my $pn = $r; $pn =~ s/ .*//; @q = grep {$_ eq $pn} @q; diff --git a/t/conflicts.t b/t/conflicts.t index 2dbb99f4..3dd8dfd7 100644 --- a/t/conflicts.t +++ b/t/conflicts.t @@ -1,7 +1,7 @@ #!/usr/bin/perl -w use strict; -use Test::More tests => 15; +use Test::More tests => 16; require 't/testlib.pm'; @@ -31,6 +31,8 @@ C: m P: x = 1-1 P: y = 1-1 R: x +P: z = 1-1 z1 +P: z2 = 1-1 z EOR my $config = setuptest($repo, "Conflict: i:j\nConflict: x"); @@ -85,3 +87,6 @@ is_deeply(\@r, [undef, 'x is in conflict'], 'install x'); @r = expand($config, 'y'); is_deeply(\@r, [undef, '(provider x is in conflict)', 'conflict for providers of x needed by y'], 'install y'); + +@r = expand($config, 'z', '!z1'); +is_deeply(\@r, [1, 'z2'], 'install z !z1');