summaryrefslogtreecommitdiff
path: root/src/rebar_digraph.erl
diff options
context:
space:
mode:
authorFred Hebert <mononcqc@ferd.ca>2015-08-18 11:52:39 -0400
committerFred Hebert <mononcqc@ferd.ca>2015-08-18 11:52:39 -0400
commite9cfbfb36b53d2fc6c7ca34bb49fe75fa112f770 (patch)
treef9c2f17bcfff90cf76ddef3540d6df48ab9bb14e /src/rebar_digraph.erl
parent89ccf5799557691889f01ed85b38ac63be227f4a (diff)
parent070f828e10a27288fc16d77dc28866eba403436f (diff)
Merge pull request #724 from tsloughter/upgrade_with_locks
properly update locks for deps and ignore skip messages for locks
Diffstat (limited to 'src/rebar_digraph.erl')
-rw-r--r--src/rebar_digraph.erl12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/rebar_digraph.erl b/src/rebar_digraph.erl
index 4ece286..ff0a1d2 100644
--- a/src/rebar_digraph.erl
+++ b/src/rebar_digraph.erl
@@ -77,7 +77,7 @@ cull_deps(Graph, Vertices) ->
cull_deps(Graph, Vertices, Seen) ->
Vertices1 = lists:keysort(2, Vertices),
- {Solution, Levels, Discarded} = {dict:new(), dict:new(), []},
+ {Solution, Levels, Discarded} = {dict:new(), dict:new(), sets:new()},
cull_deps(Graph, Vertices1, Levels, Solution, Seen, Discarded).
format_error(no_solution) ->
@@ -91,7 +91,7 @@ cull_deps(_Graph, [], Levels, Solution, _, Discarded) ->
{_, Vertices} = lists:unzip(dict:to_list(Solution)),
LvlVertices = [{Profile, {Parent, App, Vsn, dict:fetch(App, Levels)}}
|| {Profile, {Parent,App,Vsn}} <- Vertices],
- {ok, LvlVertices, Discarded};
+ {ok, LvlVertices, sets:to_list(Discarded)};
cull_deps(Graph, [{Profile, Level, Vs} | Vertices], Levels, Solution, Seen, Discarded) ->
{NV, NS, LS, DS} =
lists:foldl(fun({Parent, Name, Vsn}, {Acc, SolutionAcc, LevelsAcc, DiscardedAcc}) ->
@@ -134,7 +134,7 @@ handle_neighbors(Profile, Level, Parent, OutNeighbors, Vertices
{ok, _} -> % conflict resolution!
%% Warn on different version
{NewVertices,
- [Value|Discarded1]};
+ sets:add_element(Value, Discarded1)};
error ->
%% We check Seen separately because we don't care
%% to warn if the exact same version of a package
@@ -143,7 +143,7 @@ handle_neighbors(Profile, Level, Parent, OutNeighbors, Vertices
case sets:is_element(Name, Seen) of
true ->
{NewVertices,
- [Value|Discarded1]};
+ sets:add_element(Value, Discarded1)};
false ->
{[{Parent, Name, Vsn} | NewVertices],
Discarded1}
@@ -167,7 +167,7 @@ maybe_add_to_solution(Profile, Level, Key, {Name, Vsn}=Value, Parent
%% Warn on different version
{Solution,
Levels,
- [Value|Discarded]};
+ sets:add_element(Value, Discarded)};
error ->
%% We check Seen separately because we don't care to warn if the exact
%% same version of a package was already part of the solution but we do
@@ -176,7 +176,7 @@ maybe_add_to_solution(Profile, Level, Key, {Name, Vsn}=Value, Parent
true ->
{Solution,
Levels,
- [Value|Discarded]};
+ sets:add_element(Value, Discarded)};
false ->
{dict:store(Key, {Profile, {Parent, Name, Vsn}}, Solution),
dict:store(Key, Level, Levels),