diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/rlx_prv_overlay.erl | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/rlx_prv_overlay.erl b/src/rlx_prv_overlay.erl index 87fa91f..75608b3 100644 --- a/src/rlx_prv_overlay.erl +++ b/src/rlx_prv_overlay.erl @@ -187,9 +187,11 @@ merge_overlay_vars(State, FileNames) -> %% to the current one being read OverlayRelativeRoot = filename:dirname(FileName), NewTerms = check_overlay_inclusion(State, OverlayRelativeRoot, Terms), + %% Remove already defined variables from Acc, + %% append NewTerms, preserving order lists:foldl(fun(NewTerm, A) -> - lists:keystore(element(1, NewTerm), 1, A, NewTerm) - end, Acc, NewTerms); + lists:keydelete(element(1, NewTerm), 1, A) + end, Acc, NewTerms) ++ NewTerms; {error, Reason} -> ec_cmd_log:warn(rlx_state:log(State), format_error({unable_to_read_varsfile, FileName, Reason})), |