diff options
author | Fred Hebert <mononcqc@ferd.ca> | 2015-02-12 10:59:07 -0500 |
---|---|---|
committer | Fred Hebert <mononcqc@ferd.ca> | 2015-02-12 10:59:07 -0500 |
commit | 3001618a4aadd9e3c8bae8019a298847780b9107 (patch) | |
tree | f7f43fdb9a6af969aa01e445b60428c40cf93ffc /src/rebar_state.erl | |
parent | 2fd6f43c020555435c758ffe84ffe56a632387d8 (diff) | |
parent | 2e34e91dfb54218597f72faac3a39aedd57bcf97 (diff) |
Merge pull request #126 from ferd/upgrade-redo
Upgrade procedure, from scratch (WIP)
Diffstat (limited to 'src/rebar_state.erl')
-rw-r--r-- | src/rebar_state.erl | 8 |
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]}. |