diff options
author | Tristan Sloughter <tristan.sloughter@gmail.com> | 2015-08-15 21:31:01 -0500 |
---|---|---|
committer | Tristan Sloughter <tristan.sloughter@gmail.com> | 2015-08-15 21:31:01 -0500 |
commit | e49e59d09a73d4a27e1bd18ee59dd1b9ac6522bb (patch) | |
tree | 480ca2b447e0ebe3006b434880f87b68eb3658ab /src/rebar_prv_lock.erl | |
parent | 75364c2cd6282d1d039330ea7e46cac93cba1846 (diff) | |
parent | d4bca1d6c5b7ce4dd128c4f20fbfe7a1cf52cc69 (diff) |
Merge pull request #706 from tsloughter/pkg_deps_order
install package deps in same level/profile order as src deps
Diffstat (limited to 'src/rebar_prv_lock.erl')
-rw-r--r-- | src/rebar_prv_lock.erl | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/src/rebar_prv_lock.erl b/src/rebar_prv_lock.erl index 1844934..8578979 100644 --- a/src/rebar_prv_lock.erl +++ b/src/rebar_prv_lock.erl @@ -29,18 +29,24 @@ init(State) -> -spec do(rebar_state:t()) -> {ok, rebar_state:t()} | {error, string()}. do(State) -> - OldLocks = rebar_state:get(State, {locks, default}, []), - Locks = build_locks(State), - Dir = rebar_state:dir(State), - file:write_file(filename:join(Dir, ?LOCK_FILE), - io_lib:format("~p.~n", [Locks])), - State1 = rebar_state:set(State, {locks, default}, Locks), + %% Only lock default profile run + case rebar_state:current_profiles(State) of + [default] -> + OldLocks = rebar_state:get(State, {locks, default}, []), + Locks = lists:keysort(1, build_locks(State)), + Dir = rebar_state:dir(State), + file:write_file(filename:join(Dir, ?LOCK_FILE), + io_lib:format("~p.~n", [Locks])), + State1 = rebar_state:set(State, {locks, default}, Locks), - OldLockNames = [element(1,L) || L <- OldLocks], - NewLockNames = [element(1,L) || L <- Locks], - rebar_utils:info_useless(OldLockNames, NewLockNames), + OldLockNames = [element(1,L) || L <- OldLocks], + NewLockNames = [element(1,L) || L <- Locks], + rebar_utils:info_useless(OldLockNames, NewLockNames), - {ok, State1}. + {ok, State1}; + _ -> + {ok, State} + end. -spec format_error(any()) -> iolist(). format_error(Reason) -> |