summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorILYA Khlopotov <iilyak@apache.org>2020-04-14 03:06:25 -0700
committerILYA Khlopotov <iilyak@apache.org>2020-04-14 03:36:20 -0700
commit4e2f18c03e478855e927d9d0ae7bd757427c2edd (patch)
tree5e27e842f73d1d1ca11a282771086d11930b4ede
parent757515231ff3d2e0228a078a1771837eff0b66d0 (diff)
downloadcouchdb-4e2f18c03e478855e927d9d0ae7bd757427c2edd.tar.gz
Merge keys from rebar.config
This change allows creation of local `src/couch/rebar.config` and `rebar.config` files to set additional configuration options. This is useful for: - disabling deprecation warnings `{nowarn_deprecated_function, MFAs}` - control debugging in eunit tests - `DEBUG` - `{eunit_compile_opts, [{d, DEBUG, true}]}` - `NODEBUG` - `{eunit_compile_opts, [{d, NODEBUG, true}]}`
-rw-r--r--.gitignore1
-rw-r--r--rebar.config.script9
-rw-r--r--src/couch/.gitignore2
-rw-r--r--src/couch/rebar.config.script7
4 files changed, 16 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index 955403a98..cd4608809 100644
--- a/.gitignore
+++ b/.gitignore
@@ -28,6 +28,7 @@ ebin/
erl_crash.dump
erln8.config
install.mk
+rebar.config
rel/*.config
rel/couchdb
rel/dev*
diff --git a/rebar.config.script b/rebar.config.script
index 6f9f65c73..b3ea2c933 100644
--- a/rebar.config.script
+++ b/rebar.config.script
@@ -223,6 +223,11 @@ AddConfig = [
{post_hooks, [{compile, "escript support/build_js.escript"}]}
],
-C = lists:foldl(fun({K, V}, CfgAcc) ->
- lists:keystore(K, 1, CfgAcc, {K, V})
+lists:foldl(fun({K, V}, CfgAcc) ->
+ case lists:keyfind(K, 1, CfgAcc) of
+ {K, Existent} when is_list(Existent) andalso is_list(V) ->
+ lists:keystore(K, 1, CfgAcc, {K, Existent ++ V});
+ false ->
+ lists:keystore(K, 1, CfgAcc, {K, V})
+ end
end, CONFIG, AddConfig).
diff --git a/src/couch/.gitignore b/src/couch/.gitignore
index e1fa65333..861974adb 100644
--- a/src/couch/.gitignore
+++ b/src/couch/.gitignore
@@ -19,3 +19,5 @@ test/engines/log/
.rebar/
.eunit
+
+rebar.config
diff --git a/src/couch/rebar.config.script b/src/couch/rebar.config.script
index 91e24d99e..80e6bd12e 100644
--- a/src/couch/rebar.config.script
+++ b/src/couch/rebar.config.script
@@ -229,5 +229,10 @@ AddConfig = [
].
lists:foldl(fun({K, V}, CfgAcc) ->
- lists:keystore(K, 1, CfgAcc, {K, V})
+ case lists:keyfind(K, 1, CfgAcc) of
+ {K, Existent} when is_list(Existent) andalso is_list(V) ->
+ lists:keystore(K, 1, CfgAcc, {K, Existent ++ V});
+ false ->
+ lists:keystore(K, 1, CfgAcc, {K, V})
+ end
end, CONFIG, AddConfig).