summaryrefslogtreecommitdiff
path: root/src/rebar_prv_update.erl
diff options
context:
space:
mode:
authorTristan Sloughter <t@crashfast.com>2015-05-08 18:58:31 -0500
committerTristan Sloughter <t@crashfast.com>2015-05-08 21:17:50 -0500
commitc5aee4b375818a3e1cd6cc94af89bf2b7dc456f3 (patch)
treec03f35ee145bc30a4c55d2c8372881487d220b67 /src/rebar_prv_update.erl
parentd53d3b56be9bb975f6d759d8e5df6af389db9d92 (diff)
ignore pkgs that can't build with rebar or make
Diffstat (limited to 'src/rebar_prv_update.erl')
-rw-r--r--src/rebar_prv_update.erl15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/rebar_prv_update.erl b/src/rebar_prv_update.erl
index 973b275..942b386 100644
--- a/src/rebar_prv_update.erl
+++ b/src/rebar_prv_update.erl
@@ -72,6 +72,10 @@ write_registry(Dict, {digraph, Edges, Vertices, Neighbors, _}, State) ->
ets:tab2file(Neighbors, filename:join(RegistryDir, "neighbors")),
file:write_file(filename:join(RegistryDir, "dict"), term_to_binary(Dict)).
+is_supported(<<"make">>) -> true;
+is_supported(<<"rebar">>) -> true;
+is_supported(_) -> false.
+
hex_to_graph(Filename) ->
{ok, T} = ets:file2tab(Filename),
Graph = digraph:new(),
@@ -83,9 +87,14 @@ hex_to_graph(Filename) ->
ok
end, ok, T),
- Dict1 = ets:foldl(fun({{Pkg, PkgVsn}, [Deps | _]}, Dict) ->
- DepsList = update_graph(Pkg, PkgVsn, Deps, T, Graph),
- dict:store({Pkg, PkgVsn}, DepsList, Dict);
+ Dict1 = ets:foldl(fun({{Pkg, PkgVsn}, [Deps, _, BuildTools | _]}, Dict) when is_list(BuildTools) ->
+ case lists:any(fun is_supported/1, BuildTools) of
+ true ->
+ DepsList = update_graph(Pkg, PkgVsn, Deps, T, Graph),
+ dict:store({Pkg, PkgVsn}, DepsList, Dict);
+ false ->
+ Dict
+ end;
(_, Dict) ->
Dict
end, dict:new(), T),