Skip to content

Commit

Permalink
filter available package versions individually by buildtools
Browse files Browse the repository at this point in the history
  • Loading branch information
tsloughter committed May 22, 2016
1 parent 41addaa commit f701895
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/rebar_prv_update.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f701895

Please sign in to comment.