From e255529da5c2366f1a9c4eb823d3c3d02c237eae Mon Sep 17 00:00:00 2001 From: Viacheslav Kovalev Date: Wed, 22 Apr 2015 18:56:09 +0300 Subject: Get rid of rebar_utils:tup_umerge/2 patching --- src/rebar_state.erl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/rebar_state.erl') diff --git a/src/rebar_state.erl b/src/rebar_state.erl index f73370b..c2e479d 100644 --- a/src/rebar_state.erl +++ b/src/rebar_state.erl @@ -207,7 +207,8 @@ apply_profiles(State, Profile) when not is_list(Profile) -> apply_profiles(State, [Profile]); apply_profiles(State, [default]) -> State; -apply_profiles(State=#state_t{opts=Opts, current_profiles=CurrentProfiles}, Profiles) -> +apply_profiles(State=#state_t{default = Defaults, current_profiles=CurrentProfiles}, Profiles) -> + AppliedProfiles = deduplicate(CurrentProfiles ++ Profiles), ConfigProfiles = rebar_state:get(State, profiles, []), NewOpts = lists:foldl(fun(default, OptsAcc) -> @@ -215,8 +216,8 @@ apply_profiles(State=#state_t{opts=Opts, current_profiles=CurrentProfiles}, Prof (Profile, OptsAcc) -> ProfileOpts = dict:from_list(proplists:get_value(Profile, ConfigProfiles, [])), merge_opts(Profile, ProfileOpts, OptsAcc) - end, Opts, Profiles), - State#state_t{current_profiles = deduplicate(CurrentProfiles ++ Profiles), opts=NewOpts}. + end, Defaults, AppliedProfiles), + State#state_t{current_profiles = AppliedProfiles, opts=NewOpts}. deduplicate(Profiles) -> do_deduplicate(lists:reverse(Profiles), []). -- cgit v1.1