diff options
author | Jordan Wilberding <[email protected]> | 2014-10-11 11:52:43 -0500 |
---|---|---|
committer | Jordan Wilberding <[email protected]> | 2014-10-11 11:52:43 -0500 |
commit | a9c3c235ac81d1a17cf2feb8fbfbd70d6a57edff (patch) | |
tree | a17913740b0ad66ceb0139ded8df30514380ece6 /src/rlx_topo.erl | |
parent | d4d197ca142913b81fc192357dff18d1ed266921 (diff) | |
parent | fca419632793346d0f3732ed927f6862ed6bf85a (diff) | |
download | relx-a9c3c235ac81d1a17cf2feb8fbfbd70d6a57edff.tar.gz relx-a9c3c235ac81d1a17cf2feb8fbfbd70d6a57edff.tar.bz2 relx-a9c3c235ac81d1a17cf2feb8fbfbd70d6a57edff.zip |
Merge pull request #227 from tsloughter/master
Rebar3 support and code sharing
Diffstat (limited to 'src/rlx_topo.erl')
-rw-r--r-- | src/rlx_topo.erl | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/rlx_topo.erl b/src/rlx_topo.erl index b5585df..d24f227 100644 --- a/src/rlx_topo.erl +++ b/src/rlx_topo.erl @@ -32,7 +32,8 @@ %%%------------------------------------------------------------------- -module(rlx_topo). --export([sort_apps/1, +-export([sort/1, + sort_apps/1, format_error/1]). -include("relx.hrl"). @@ -64,6 +65,12 @@ sort_apps(Apps) -> E -> E end. + +%% @doc Do a topological sort on the list of pairs. +-spec sort([pair()]) -> {ok, [atom()]} | relx:error(). +sort(Pairs) -> + iterate(Pairs, [], all(Pairs)). + %% @doc nicely format the error from the sort. -spec format_error(Reason::term()) -> iolist(). format_error({cycle, Pairs}) -> @@ -82,11 +89,6 @@ format_error({cycle, Pairs}) -> %%==================================================================== %% Internal Functions %%==================================================================== -%% @doc Do a topological sort on the list of pairs. --spec sort([pair()]) -> {ok, [atom()]} | relx:error(). -sort(Pairs) -> - iterate(Pairs, [], all(Pairs)). - -spec names_to_apps([atom()], [rlx_app_info:t()]) -> [rlx_app_info:t()]. names_to_apps(Names, Apps) -> [find_app_by_name(Name, Apps) || Name <- Names]. |