WIP: AE_DISABLE_CUCKOO env var support
revert rebar.lock to original
This commit is contained in:
parent
0338cfc249
commit
495fcb30d6
20
rebar.config.script
Normal file
20
rebar.config.script
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
%% -*- mode:erlang; erlang-indent-level:4; indent-tabs-mode:nil -*-
|
||||||
|
io:fwrite("Running ~p~n", [SCRIPT]).
|
||||||
|
case os:getenv("AE_DISABLE_CUCKOO") =/= false of
|
||||||
|
true ->
|
||||||
|
RemoveApps = [aecuckoo, aecuckooprebuilt],
|
||||||
|
RemovePlugins = [rebar_aecuckooprebuilt_dep],
|
||||||
|
{_, Deps} = lists:keyfind(deps, 1, CONFIG),
|
||||||
|
NewDeps = [D || D <- Deps,
|
||||||
|
not lists:member(element(1,D), RemoveApps)],
|
||||||
|
Plugins = proplists:get_value(plugins, CONFIG, []),
|
||||||
|
CONFIG1 = lists:keyreplace(deps, 1, CONFIG, {deps, NewDeps}),
|
||||||
|
Plugins1 = [P || P <- Plugins,
|
||||||
|
not lists:member(element(1,P), RemovePlugins)],
|
||||||
|
CONFIG2 = lists:keystore(plugins, 1, CONFIG1, {plugins, Plugins1}),
|
||||||
|
io:fwrite("CONFIG2 = ~p~n", [CONFIG2]),
|
||||||
|
CONFIG2;
|
||||||
|
false ->
|
||||||
|
io:fwrite("Using cuckoo~n", []),
|
||||||
|
CONFIG
|
||||||
|
end.
|
18
src/aeminer.app.src.script
Normal file
18
src/aeminer.app.src.script
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
%% -*- mode:erlang; erlang-indent-level:4; indent-tabs-mode:nil -*-
|
||||||
|
|
||||||
|
RemoveApps = [aecuckoo, aecuckooprebuilt].
|
||||||
|
Base = filename:basename(SCRIPT, ".script").
|
||||||
|
Dir = filename:dirname(SCRIPT).
|
||||||
|
{ok, [{application,_,Opts} = App]} = file:consult(filename:join(Dir, Base)).
|
||||||
|
case os:getenv("AE_DISABLE_CUCKOO") =/= false of
|
||||||
|
true ->
|
||||||
|
{_, Apps} = lists:keyfind(applications, 1, Opts),
|
||||||
|
Env = proplists:get_value(env, Opts, []),
|
||||||
|
Env1 = lists:keystore(use_cuckoo, 1, Env, {use_cuckoo, false}),
|
||||||
|
Apps1 = Apps -- RemoveApps,
|
||||||
|
Opts1 = lists:keyreplace(applications, 1, Opts, {applications, Apps1}),
|
||||||
|
Opts2 = lists:keystore(env, 1, Opts1, {env, Env1}),
|
||||||
|
setelement(3, App, Opts2);
|
||||||
|
false ->
|
||||||
|
App
|
||||||
|
end.
|
Loading…
x
Reference in New Issue
Block a user