From d75ba02671236634906989f70eadc785658b4959 Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Fri, 10 Apr 2015 22:31:01 -0500 Subject: support single atoms for pkg deps, fetch highest version available --- src/rebar_digraph.erl | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/rebar_digraph.erl') diff --git a/src/rebar_digraph.erl b/src/rebar_digraph.erl index 129ea35..35fd7e7 100644 --- a/src/rebar_digraph.erl +++ b/src/rebar_digraph.erl @@ -72,10 +72,12 @@ cull_deps(Graph, Vertices) -> cull_deps(Graph, Vertices, 1, - lists:foldl(fun({Key, _}, Levels) -> dict:store(Key, 0, Levels) end, - dict:new(), Vertices), - lists:foldl(fun({Key, _}=N, Solution) -> dict:store(Key, N, Solution) end, - dict:new(), Vertices), + lists:foldl(fun({Key, _}, Levels) -> + dict:store(Key, 0, Levels) + end, dict:new(), Vertices), + lists:foldl(fun({Key, _}=N, Solution) -> + dict:store(Key, N, Solution) + end, dict:new(), Vertices), []). cull_deps(_Graph, [], _Level, Levels, Solution, Discarded) -> @@ -99,7 +101,7 @@ cull_deps(Graph, Vertices, Level, Levels, Solution, Discarded) -> DiscardedAcc1} end end, {NewVertices, SolutionAcc, LevelsAcc, DiscardedAcc}, OutNeighbors) - end, {[], Solution, Levels, Discarded}, lists:keysort(1, Vertices)), + end, {[], Solution, Levels, Discarded}, lists:sort(Vertices)), cull_deps(Graph, NV, Level+1, LS, NS, DS). subgraph(Graph, Vertices) -> -- cgit v1.1 From d317869a3e3234510d3b2edc756caeff4cc1d515 Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Sat, 11 Apr 2015 17:14:11 -0500 Subject: clean ups from Fred's comments --- src/rebar_digraph.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/rebar_digraph.erl') diff --git a/src/rebar_digraph.erl b/src/rebar_digraph.erl index 35fd7e7..7c1fe90 100644 --- a/src/rebar_digraph.erl +++ b/src/rebar_digraph.erl @@ -101,7 +101,7 @@ cull_deps(Graph, Vertices, Level, Levels, Solution, Discarded) -> DiscardedAcc1} end end, {NewVertices, SolutionAcc, LevelsAcc, DiscardedAcc}, OutNeighbors) - end, {[], Solution, Levels, Discarded}, lists:sort(Vertices)), + end, {[], Solution, Levels, Discarded}, lists:keysort(1, Vertices)), cull_deps(Graph, NV, Level+1, LS, NS, DS). subgraph(Graph, Vertices) -> -- cgit v1.1