Skip to content

Commit

Permalink
Take conflicts into account when resolving direct dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
mlschroe committed Sep 19, 2024
1 parent 96c2c49 commit 34d14f5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions Build/Expand.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 6 additions & 1 deletion t/conflicts.t
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/perl -w

use strict;
use Test::More tests => 15;
use Test::More tests => 16;

require 't/testlib.pm';

Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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');

0 comments on commit 34d14f5

Please sign in to comment.