aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/rlx_prv_overlay.erl4
-rw-r--r--test/rlx_release_SUITE.erl3
-rw-r--r--test/rlx_test_utils.erl1
3 files changed, 7 insertions, 1 deletions
diff --git a/src/rlx_prv_overlay.erl b/src/rlx_prv_overlay.erl
index 412e5ba..becdb32 100644
--- a/src/rlx_prv_overlay.erl
+++ b/src/rlx_prv_overlay.erl
@@ -197,7 +197,9 @@ merge_overlay_vars(State, FileNames) ->
%% to the current one being read
OverlayRelativeRoot = filename:dirname(FileName),
NewTerms = check_overlay_inclusion(State, OverlayRelativeRoot, Terms),
- lists:ukeymerge(1, lists:ukeysort(1, NewTerms), Acc);
+ lists:foldl(fun(NewTerm, A) ->
+ lists:keystore(element(1, NewTerm), 1, A, NewTerm)
+ end, Acc, NewTerms);
{error, Reason} ->
ec_cmd_log:warn(rlx_state:log(State),
format_error({unable_to_read_varsfile, FileName, Reason})),
diff --git a/test/rlx_release_SUITE.erl b/test/rlx_release_SUITE.erl
index 710370a..780b1c8 100644
--- a/test/rlx_release_SUITE.erl
+++ b/test/rlx_release_SUITE.erl
@@ -550,6 +550,7 @@ overlay_release(Config) ->
VarsFile1 = filename:join([LibDir1, "vars1.config"]),
rlx_test_utils:write_config(VarsFile1, [{yahoo, "yahoo"},
{yahoo2, [{foo, "bar"}]},
+ {foo_yahoo, "foo_{{yahoo}}"},
{foo_dir, "foodir"}]),
VarsFile2 = filename:join([LibDir1, "vars2.config"]),
@@ -610,6 +611,8 @@ overlay_release(Config) ->
proplists:get_value(release_name, TemplateData)),
?assertEqual("yahoo/foo4",
proplists:get_value(yahoo4, TemplateData)),
+ ?assertEqual("foo_yahoo",
+ proplists:get_value(foo_yahoo, TemplateData)),
?assertEqual("yahoo",
proplists:get_value(google, TemplateData)).
diff --git a/test/rlx_test_utils.erl b/test/rlx_test_utils.erl
index 9db2835..1157e3f 100644
--- a/test/rlx_test_utils.erl
+++ b/test/rlx_test_utils.erl
@@ -77,4 +77,5 @@ test_template_contents() ->
"{yahoo4, \"{{yahoo4}}\"}.\n"
"{yahoo, \"{{yahoo}}\"}.\n"
"{foo_dir, \"{{foo_dir}}\"}.\n"
+ "{foo_yahoo, \"{{foo_yahoo}}\"}.\n"
"{google, \"{{google}}\"}.\n".