summaryrefslogtreecommitdiff
path: root/src/rebar_state.erl
diff options
context:
space:
mode:
authorFred Hebert <mononcqc@ferd.ca>2015-01-20 01:39:43 +0000
committerFred Hebert <mononcqc@ferd.ca>2015-02-11 21:57:58 +0000
commitb94afdfa2d44b0cb1489234c7746cd72f85a167d (patch)
treec76a7c7bd3bd25ee369f843de83b1200aaeeb90c /src/rebar_state.erl
parent2fd6f43c020555435c758ffe84ffe56a632387d8 (diff)
WIP
Test that all the correct locks are set for an upgrade run. Now to actually re-run the install deps and prove it works
Diffstat (limited to 'src/rebar_state.erl')
-rw-r--r--src/rebar_state.erl8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/rebar_state.erl b/src/rebar_state.erl
index 29b7c3f..70aba51 100644
--- a/src/rebar_state.erl
+++ b/src/rebar_state.erl
@@ -89,8 +89,10 @@ new(ParentState, Config, Dir) ->
Opts = ParentState#state_t.opts,
LocalOpts = case rebar_config:consult_file(filename:join(Dir, ?LOCK_FILE)) of
[D] ->
- LockedDeps = [X || X <- D, element(3, X) =:= 0],
- dict:from_list([{{locks, default}, LockedDeps}, {{deps, default}, D} | Config]);
+ %% We want the top level deps only from the lock file.
+ %% This ensures deterministic overrides for configs.
+ Deps = [X || X <- D, element(3, X) =:= 0],
+ dict:from_list([{{locks, default}, D}, {{deps, default}, Deps} | Config]);
_ ->
D = proplists:get_value(deps, Config, []),
dict:from_list([{{deps, default}, D} | Config])
@@ -133,6 +135,8 @@ current_profiles(#state_t{current_profiles=Profiles}) ->
lock(#state_t{lock=Lock}) ->
Lock.
+lock(State=#state_t{}, Apps) when is_list(Apps) ->
+ State#state_t{lock=Apps};
lock(State=#state_t{lock=Lock}, App) ->
State#state_t{lock=[App | Lock]}.