This is an automated email from the ASF dual-hosted git repository.

jaydoane pushed a commit to branch cleanup-have-dreyfus
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 797420010bf4cd6b30afc57c2c4b4e3dcd942fb7
Author: Jay Doane <[email protected]>
AuthorDate: Mon Oct 27 21:03:49 2025 -0700

    Do not check for dreyfus
    
    The dreyfus application has been integrated into the CouchDB code base,
    so there's no longer a need to check for its presence.
---
 src/ken/rebar.config.script               | 10 ++--------
 src/ken/src/ken.app.src.script            | 11 +++--------
 src/mango/rebar.config.script             | 16 +++++-----------
 src/mem3/test/eunit/mem3_reshard_test.erl | 16 +++-------------
 4 files changed, 13 insertions(+), 40 deletions(-)

diff --git a/src/ken/rebar.config.script b/src/ken/rebar.config.script
index ceef74a9c..61af64c6d 100644
--- a/src/ken/rebar.config.script
+++ b/src/ken/rebar.config.script
@@ -12,15 +12,9 @@
 % License for the specific language governing permissions and limitations under
 % the License.
 
-HaveDreyfus = element(1, file:list_dir("../dreyfus")) == ok.
-
-CurrOpts = case lists:keyfind(erl_opts, 1, CONFIG) of
+ErlOpts = [{i, "../"}] ++ case lists:keyfind(erl_opts, 1, CONFIG) of
     {erl_opts, Opts} -> Opts;
     false -> []
 end,
 
-NewOpts =
-    if HaveDreyfus -> [{d, 'HAVE_DREYFUS'}]; true -> [] end ++
-    [{i, "../"}] ++ CurrOpts.
-
-lists:keystore(erl_opts, 1, CONFIG, {erl_opts, NewOpts}).
+lists:keystore(erl_opts, 1, CONFIG, {erl_opts, ErlOpts}).
diff --git a/src/ken/src/ken.app.src.script b/src/ken/src/ken.app.src.script
index 5ee3f4b25..f88d05944 100644
--- a/src/ken/src/ken.app.src.script
+++ b/src/ken/src/ken.app.src.script
@@ -10,21 +10,16 @@
 % License for the specific language governing permissions and limitations under
 % the License.
 
-HaveDreyfus = code:lib_dir(dreyfus) /= {error, bad_name}.
-
-BaseApplications = [
+Applications = [
     kernel,
     stdlib,
     couch_log,
     couch_event,
     couch,
-    config
+    config,
+    dreyfus
 ].
 
-Applications =
-    if HaveDreyfus -> [dreyfus]; true -> [] end ++
-    BaseApplications.
-
 {application, ken, [
     {description, "Ken builds views and search indexes automatically"},
     {vsn, git},
diff --git a/src/mango/rebar.config.script b/src/mango/rebar.config.script
index c3083b3ee..497fd4305 100644
--- a/src/mango/rebar.config.script
+++ b/src/mango/rebar.config.script
@@ -13,16 +13,10 @@
 % the License.
 
 
-HaveDreyfus = code:lib_dir(dreyfus) /= {error, bad_name}.
+ErlOpts = case lists:keyfind(erl_opts, 1, CONFIG) of
+    {erl_opts, Opts} -> Opts;
+    false -> []
+end,
 
-if not HaveDreyfus -> CONFIG; true ->
-    CurrOpts = case lists:keyfind(erl_opts, 1, CONFIG) of
-        {erl_opts, Opts} -> Opts;
-        false -> []
-    end,
-    NewOpts = [
-        {d, 'HAVE_DREYFUS'}
-    ] ++ CurrOpts,
-    lists:keystore(erl_opts, 1, CONFIG, {erl_opts, NewOpts})
-end.
+lists:keystore(erl_opts, 1, CONFIG, {erl_opts, ErlOpts}).
 
diff --git a/src/mem3/test/eunit/mem3_reshard_test.erl 
b/src/mem3/test/eunit/mem3_reshard_test.erl
index 42aeba6b3..ec369bfe8 100644
--- a/src/mem3/test/eunit/mem3_reshard_test.erl
+++ b/src/mem3/test/eunit/mem3_reshard_test.erl
@@ -22,11 +22,7 @@
 -define(TIMEOUT, 60).
 
 setup() ->
-    HaveDreyfus = code:lib_dir(dreyfus) /= {error, bad_name},
-    case HaveDreyfus of
-        false -> ok;
-        true -> mock_dreyfus_indices()
-    end,
+    mock_dreyfus_indices(),
     {Db1, Db2} = {?tempdb(), ?tempdb()},
     create_db(Db1, [{q, 1}, {n, 1}]),
     PartProps = [{partitioned, true}, {hash, [couch_partition, hash, []]}],
@@ -303,14 +299,8 @@ indices_are_built(#{db1 := Db}) ->
             MRViewGroupInfo = get_group_info(Db, <<"_design/mrview00000">>),
             ?assertMatch(#{<<"update_seq">> := 28}, MRViewGroupInfo),
 
-            HaveDreyfus = code:lib_dir(dreyfus) /= {error, bad_name},
-            case HaveDreyfus of
-                false ->
-                    ok;
-                true ->
-                    % 4 because there are 2 indices and 2 target shards
-                    ?assertEqual(4, meck:num_calls(dreyfus_index, await, 2))
-            end
+            % 4 because there are 2 indices and 2 target shards
+            ?assertEqual(4, meck:num_calls(dreyfus_index, await, 2))
         end)}.
 
 % This test that indices are built despite intermittent errors.

Reply via email to