diff options
author | Tristan Sloughter <t@crashfast.com> | 2016-05-21 08:02:28 -0500 |
---|---|---|
committer | Tristan Sloughter <t@crashfast.com> | 2016-05-22 11:11:08 -0500 |
commit | f701895165a1395e1ed1e88e16dcfbf40a4654ea (patch) | |
tree | 9f4f42516f317d0c1d4e07dba2bea58ab0f6001f | |
parent | 41addaa53bf9a52972a9a0d071cb6db6b5e94780 (diff) |
filter available package versions individually by buildtools
-rw-r--r-- | src/rebar_prv_update.erl | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/rebar_prv_update.erl b/src/rebar_prv_update.erl index 5e1e253..54b135e 100644 --- a/src/rebar_prv_update.erl +++ b/src/rebar_prv_update.erl @@ -114,14 +114,14 @@ hex_to_index(State) -> ets:foldl(fun({Pkg, [[]]}, _) when is_binary(Pkg) -> true; - ({Pkg, [Vsns=[Vsn | _Rest]]}, _) when is_binary(Pkg) -> + ({Pkg, [Vsns=[_Vsn | _Rest]]}, _) when is_binary(Pkg) -> %% Verify the package is of the right build tool by checking if the first %% version exists in the table from the foldl above - case ets:member(?PACKAGE_TABLE, {Pkg, Vsn}) of - true -> - ets:insert(?PACKAGE_TABLE, {Pkg, Vsns}); - false -> - true + case [V || V <- Vsns, ets:member(?PACKAGE_TABLE, {Pkg, V})] of + [] -> + true; + Vsns1 -> + ets:insert(?PACKAGE_TABLE, {Pkg, Vsns1}) end; (_, _) -> true |