diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/rlx_prv_assembler.erl | 44 |
1 files changed, 29 insertions, 15 deletions
diff --git a/src/rlx_prv_assembler.erl b/src/rlx_prv_assembler.erl index 5fa1817..79768d3 100644 --- a/src/rlx_prv_assembler.erl +++ b/src/rlx_prv_assembler.erl @@ -320,26 +320,29 @@ write_bin_file(State, Release, OutputDir, RelDir) -> BareRel = filename:join(BinDir, RelName), ErlOpts = rlx_state:get(State, erl_opts, ""), {OsFamily, _OsName} = os:type(), + + Prefix = code:root_dir(), + DstFile = filename:join([BinDir, "start_clean.boot"]), + %% Explicitly remove before cp, since it is 0444 mode + ec_file:remove(DstFile), + ok = ec_file:copy(filename:join([Prefix, "bin", "start_clean.boot"]), + DstFile), + StartFile = case rlx_state:get(State, extended_start_script, false) of false -> + case rlx_state:get(State, include_nodetool, false) of + true -> + include_nodetool(BinDir); + false -> + ok + end, bin_file_contents(OsFamily, RelName, RelVsn, rlx_release:erts(Release), ErlOpts); true -> case rlx_state:get(State, extended_start_script, false) of true -> - Prefix = code:root_dir(), - DstFile = filename:join([BinDir, "start_clean.boot"]), - %% Explicitly remove before cp, since it is 0444 mode - ec_file:remove(DstFile), - ok = ec_file:copy(filename:join([Prefix, "bin", "start_clean.boot"]), - DstFile), - NodeToolFile = nodetool_contents(), - InstallUpgradeFile = install_upgrade_escript_contents(), - NodeTool = filename:join([BinDir, "nodetool"]), - InstallUpgrade = filename:join([BinDir, "install_upgrade.escript"]), - ok = file:write_file(NodeTool, NodeToolFile), - ok = file:write_file(InstallUpgrade, InstallUpgradeFile); + include_nodetool(BinDir); false -> ok end, @@ -370,6 +373,14 @@ write_bin_file(State, Release, OutputDir, RelDir) -> copy_or_generate_sys_config_file(State, RelDir), include_erts(State, Release, OutputDir, RelDir). +include_nodetool(BinDir) -> + NodeToolFile = nodetool_contents(), + InstallUpgradeFile = install_upgrade_escript_contents(), + NodeTool = filename:join([BinDir, "nodetool"]), + InstallUpgrade = filename:join([BinDir, "install_upgrade.escript"]), + ok = file:write_file(NodeTool, NodeToolFile), + ok = file:write_file(InstallUpgrade, InstallUpgradeFile). + %% @doc generate a start_erl.data file -spec generate_start_erl_data_file(rlx_release:t(), file:name()) -> ok | relx:error(). @@ -467,11 +478,14 @@ include_erts(State, Release, OutputDir, RelDir) -> ok = ec_file:remove(ErlIni), ok = file:write_file(ErlIni, erl_ini(OutputDir, ErtsVersion)) end, + + ok = ec_file:remove(filename:join([OutputDir, "bin", "start_clean.boot"])), + ok = ec_file:copy(filename:join([Prefix, "bin", "start_clean.boot"]), + filename:join([OutputDir, "bin", "start_clean.boot"])), + case rlx_state:get(State, extended_start_script, false) of true -> - ok = ec_file:remove(filename:join([OutputDir, "bin", "start_clean.boot"])), - ok = ec_file:copy(filename:join([Prefix, "bin", "start_clean.boot"]), - filename:join([OutputDir, "bin", "start_clean.boot"])), + NodeToolFile = nodetool_contents(), InstallUpgradeFile = install_upgrade_escript_contents(), NodeTool = filename:join([LocalErts, "bin", "nodetool"]), |