Skip to content

Commit

Permalink
Make the dependency calculation a bit more sane, excluding circular d…
Browse files Browse the repository at this point in the history
…eps.
  • Loading branch information
seancribbs committed Aug 20, 2012
1 parent d5f707f commit 300965c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/pb_service_test.erl
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,12 @@ dep_apps(App) ->
{ok, Apps} = application:get_key(App, applications),
Apps.

all_deps(App) ->
[[ all_deps(Dep) || Dep <- dep_apps(App) ],App].
all_deps(App, Deps) ->
[[ all_deps(Dep, [App|Deps]) || Dep <- dep_apps(App),
not lists:member(Dep, Deps)], App].

resolve_deps(App) ->
DepList = lists:flatten(all_deps(App)),
DepList = all_deps(App, []),
{AppOrder, _} = lists:foldl(fun(A,{List,Set}) ->
case sets:is_element(A, Set) of
true ->
Expand Down

0 comments on commit 300965c

Please sign in to comment.