summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rebar.config1
-rw-r--r--src/rebar_prv_install_deps.erl11
2 files changed, 10 insertions, 2 deletions
diff --git a/rebar.config b/rebar.config
index 2903832..5909531 100644
--- a/rebar.config
+++ b/rebar.config
@@ -9,6 +9,7 @@
[getopt, merl, erlydtl, erlware_commons, relx, providers, rebar]}.
{escript_top_level_app, rebar}.
{escript_name, rebar3}.
+{escript_emu_args, "%%! +sbtu +A0 -noinput -mode minimal\n"}.
{erl_opts,
[{platform_define, "R14", no_callback_support},
diff --git a/src/rebar_prv_install_deps.erl b/src/rebar_prv_install_deps.erl
index 5cf7af7..fc876bd 100644
--- a/src/rebar_prv_install_deps.erl
+++ b/src/rebar_prv_install_deps.erl
@@ -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;