Explorar el Código

Merge pull request #114 from tsloughter/lock_dups

check locks before locking a dep to not have duplicates
pull/117/head
Fred Hebert hace 10 años
padre
commit
3bb1f3720e
Se han modificado 1 ficheros con 9 adiciones y 2 borrados
  1. +9
    -2
      src/rebar_prv_install_deps.erl

+ 9
- 2
src/rebar_prv_install_deps.erl Ver fichero

@ -205,8 +205,15 @@ maybe_lock(Profile, AppInfo, Seen, State, Level) ->
default ->
case sets:is_element(Name, Seen) of
false ->
{sets:add_element(Name, Seen),
rebar_state:lock(State, rebar_app_info:dep_level(AppInfo, Level))};
AppName = rebar_app_info:name(AppInfo),
Locks = rebar_state:lock(State),
case lists:any(fun(App) -> rebar_app_info:name(App) =:= AppName end, Locks) of
true ->
{sets:add_element(Name, Seen), State};
false ->
{sets:add_element(Name, Seen),
rebar_state:lock(State, rebar_app_info:dep_level(AppInfo, Level))}
end;
true ->
{Seen, State}
end;

Cargando…
Cancelar
Guardar