summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Sloughter <t@crashfast.com>2014-12-06 15:36:57 -0600
committerTristan Sloughter <t@crashfast.com>2014-12-06 20:08:36 -0600
commit63461b45b53bae01b650b90924bc65f4bd9f46d3 (patch)
tree69a545d0f1b6f62eb16aaac888507c9db7d01038
parenta39041924783f901cf24a53991d8fbdc59977dd6 (diff)
don't use lock file for non-defualt profile deps
-rw-r--r--src/rebar_prv_install_deps.erl13
-rw-r--r--src/rebar_state.erl4
2 files changed, 8 insertions, 9 deletions
diff --git a/src/rebar_prv_install_deps.erl b/src/rebar_prv_install_deps.erl
index 9a3703c..692beaf 100644
--- a/src/rebar_prv_install_deps.erl
+++ b/src/rebar_prv_install_deps.erl
@@ -65,15 +65,16 @@ init(State) ->
-spec do(rebar_state:t()) -> {ok, rebar_state:t()} | {error, string()}.
do(State) ->
- ?INFO("Verifying dependencies...", []),
Profile = rebar_state:current_profile(State),
+ ?INFO("Verifying ~p dependencies...", [Profile]),
ProjectApps = rebar_state:project_apps(State),
try
- {ok, SrcApps, State1} = case rebar_state:get(State, locks, []) of
- [] ->
- handle_deps(State, rebar_state:get(State, {deps, Profile}, []));
- Locks ->
- handle_deps(State, Locks)
+ {ok, SrcApps, State1} = case {Profile, rebar_state:get(State, locks, [])} of
+ {default, Locks} ->
+ handle_deps(State, Locks);
+ _ ->
+ %% If not the default profile, ignore locks file
+ handle_deps(State, rebar_state:get(State, {deps, Profile}, []))
end,
Source = ProjectApps ++ SrcApps,
diff --git a/src/rebar_state.erl b/src/rebar_state.erl
index 1f522ef..7cdfd9a 100644
--- a/src/rebar_state.erl
+++ b/src/rebar_state.erl
@@ -160,8 +160,6 @@ apply_profile(State=#state_t{default=Opts}, Profile) ->
State#state_t{opts=merge_opts(Profile, ProfileOpts, Opts1)}.
merge_opts(Profile, NewOpts, OldOpts) ->
- io:format("Keys ~p~n", [dict:fetch_keys(NewOpts)]),
- io:format("Keys ~p~n", [dict:fetch_keys(OldOpts)]),
Dict = dict:merge(fun(_Key, NewValue, OldValue) when is_list(NewValue) ->
case io_lib:printable_list(NewValue) of
true ->
@@ -177,7 +175,7 @@ merge_opts(Profile, NewOpts, OldOpts) ->
case dict:find(deps, NewOpts) of
error ->
dict:store({deps, Profile}, [], Dict);
- Deps ->
+ {ok, Deps} ->
dict:store({deps, Profile}, Deps, Dict)
end.