From 8b9d7cefca62db1737cd38359e4153889232e83c Mon Sep 17 00:00:00 2001 From: DualWu Date: Sun, 7 Feb 2021 17:09:20 +0800 Subject: [PATCH 1/2] remove useless code --- src/rebar_relx.erl | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/rebar_relx.erl b/src/rebar_relx.erl index af4104f3d..332d0e226 100644 --- a/src/rebar_relx.erl +++ b/src/rebar_relx.erl @@ -26,18 +26,11 @@ do(Provider, State) -> ProfileString = rebar_dir:profile_dir_name(State), ExtraOverlays = [{profile_string, ProfileString}], - CurrentProfiles = rebar_state:current_profiles(State), - RelxMode = case lists:member(prod, CurrentProfiles) of - true -> - [{mode, prod}]; - false -> - [] - end, DefaultOutputDir = filename:join(rebar_dir:base_dir(State), ?DEFAULT_RELEASE_DIR), - RelxConfig1 = RelxMode ++ [output_dir(DefaultOutputDir, Opts), - {overlay_vars_values, ExtraOverlays}, - {overlay_vars, [{base_dir, rebar_dir:base_dir(State)}]} - | merge_overlays(RelxConfig)], + RelxConfig1 = [output_dir(DefaultOutputDir, Opts), + {overlay_vars_values, ExtraOverlays}, + {overlay_vars, [{base_dir, rebar_dir:base_dir(State)}]} + | merge_overlays(RelxConfig)], {ok, RelxState} = rlx_config:to_state(RelxConfig1), Providers = rebar_state:providers(State), From 092d92330009707862a4f6fb355a34b01e02ea4b Mon Sep 17 00:00:00 2001 From: DualWu Date: Sun, 7 Feb 2021 17:33:49 +0800 Subject: [PATCH 2/2] relx opt should not sort --- src/rebar_opts.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rebar_opts.erl b/src/rebar_opts.erl index e7d38975d..b2bf60f62 100644 --- a/src/rebar_opts.erl +++ b/src/rebar_opts.erl @@ -216,7 +216,7 @@ merge_opt(relx, NewValue, OldValue) -> {NewOverlays, NewOther} = lists:partition(Partition, NewValue), {OldOverlays, OldOther} = lists:partition(Partition, OldValue), rebar_utils:tup_umerge(NewOverlays, OldOverlays) - ++ rebar_utils:tup_umerge(OldOther, NewOther); + ++ OldOther ++ NewOther; merge_opt(Key, NewValue, OldValue) when Key == erl_opts; Key == eunit_compile_opts; Key == ct_compile_opts -> merge_erl_opts(lists:reverse(OldValue), NewValue);