aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJordan Wilberding <[email protected]>2015-06-02 11:17:28 -0700
committerJordan Wilberding <[email protected]>2015-06-02 11:17:28 -0700
commitd7d18d2f88ea9a6597f6d45bc110e2f247b4ef57 (patch)
tree999bd571ed469353717c06d34fa5678ce63c2557
parent74fec3455ba6dbb7d9e369137c1b15ab10804993 (diff)
parentba268a442a6f6cd975db8ab05bcc7760f8a261e7 (diff)
downloadrelx-d7d18d2f88ea9a6597f6d45bc110e2f247b4ef57.tar.gz
relx-d7d18d2f88ea9a6597f6d45bc110e2f247b4ef57.tar.bz2
relx-d7d18d2f88ea9a6597f6d45bc110e2f247b4ef57.zip
Merge pull request #346 from tsloughter/include_start_clean
add include_nodetool option and always Include start clean
-rw-r--r--src/rlx_prv_assembler.erl44
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"]),