summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFred Hebert <mononcqc@ferd.ca>2017-08-16 16:36:00 -0400
committerGitHub <noreply@github.com>2017-08-16 16:36:00 -0400
commit3d15c00917db14148d12658c731e71e921cbb4bb (patch)
treeeb467fa9598168664f6f8a6550e8940c752a4c48 /src
parent957caae90f2df65bbb847234abb170f753fcbc02 (diff)
parentbc2f06220003499ac998f519c9eb595a0e957e15 (diff)
Merge pull request #1610 from ferd/fix-relx-overlaying
Fix ordering of overlays and overlay vars in Relx
Diffstat (limited to 'src')
-rw-r--r--src/rebar_opts.erl6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/rebar_opts.erl b/src/rebar_opts.erl
index 8863b4c..b7156b2 100644
--- a/src/rebar_opts.erl
+++ b/src/rebar_opts.erl
@@ -132,7 +132,11 @@ merge_opt(mib_first_files, Value, Value) ->
merge_opt(mib_first_files, NewValue, OldValue) ->
OldValue ++ NewValue;
merge_opt(relx, NewValue, OldValue) ->
- rebar_utils:tup_umerge(OldValue, NewValue);
+ Partition = fun(C) -> is_tuple(C) andalso element(1, C) =:= overlay end,
+ {NewOverlays, NewOther} = lists:partition(Partition, NewValue),
+ {OldOverlays, OldOther} = lists:partition(Partition, OldValue),
+ rebar_utils:tup_umerge(NewOverlays, OldOverlays)
+ ++ rebar_utils:tup_umerge(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);