aboutsummaryrefslogtreecommitdiffstats
path: root/src/rlx_prv_assembler.erl
diff options
context:
space:
mode:
authorJordan Wilberding <[email protected]>2014-04-07 18:24:00 +0200
committerJordan Wilberding <[email protected]>2014-04-07 18:24:00 +0200
commitd7a1d0a1ad735dde857a9d4785301aea83cf38db (patch)
tree5b17d551c90d7a98e4e33c2d633da76ef4353a21 /src/rlx_prv_assembler.erl
parent5561818c5620066899a6bf74ae59a873d94d8aef (diff)
parent15d535756f5ed3fef1a433da926d11cb36b10d21 (diff)
downloadrelx-d7a1d0a1ad735dde857a9d4785301aea83cf38db.tar.gz
relx-d7a1d0a1ad735dde857a9d4785301aea83cf38db.tar.bz2
relx-d7a1d0a1ad735dde857a9d4785301aea83cf38db.zip
Merge pull request #160 from zerotao/explicit_erts
Add support for explicit erts path
Diffstat (limited to 'src/rlx_prv_assembler.erl')
-rw-r--r--src/rlx_prv_assembler.erl38
1 files changed, 25 insertions, 13 deletions
diff --git a/src/rlx_prv_assembler.erl b/src/rlx_prv_assembler.erl
index 3772611..d7bf3f1 100644
--- a/src/rlx_prv_assembler.erl
+++ b/src/rlx_prv_assembler.erl
@@ -410,9 +410,21 @@ copy_or_symlink_config_file(State, ConfigPath, RelConfPath) ->
-spec include_erts(rlx_state:t(), rlx_release:t(), file:name(), file:name()) ->
{ok, rlx_state:t()} | relx:error().
include_erts(State, Release, OutputDir, RelDir) ->
- case rlx_state:get(State, include_erts, true) of
- true ->
- Prefix = code:root_dir(),
+ Prefix = case rlx_state:get(State, include_erts, true) of
+ false ->
+ false;
+ true ->
+ code:root_dir();
+ P ->
+ filename:absname(P)
+ end,
+
+ case Prefix of
+ false ->
+ make_boot_script(State, Release, OutputDir, RelDir);
+ _ ->
+ ec_cmd_log:info(rlx_state:log(State),
+ "Including Erts from ~s~n", [Prefix]),
ErtsVersion = rlx_release:erts(Release),
ErtsDir = filename:join([Prefix, "erts-" ++ ErtsVersion]),
LocalErts = filename:join([OutputDir, "erts-" ++ ErtsVersion]),
@@ -450,12 +462,9 @@ include_erts(State, Release, OutputDir, RelDir) ->
ok
end,
make_boot_script(State, Release, OutputDir, RelDir)
- end;
- _ ->
- make_boot_script(State, Release, OutputDir, RelDir)
+ end
end.
-
-spec make_boot_script(rlx_state:t(), rlx_release:t(), file:name(), file:name()) ->
{ok, rlx_state:t()} | relx:error().
make_boot_script(State, Release, OutputDir, RelDir) ->
@@ -518,16 +527,19 @@ make_relup(State, Release) ->
make_tar(State, Release, OutputDir) ->
Name = atom_to_list(rlx_release:name(Release)),
Vsn = rlx_release:vsn(Release),
- Prefix = code:root_dir(),
ErtsVersion = rlx_release:erts(Release),
- ErtsDir = filename:join([Prefix]),
Opts = [{path, [filename:join([OutputDir, "lib", "*", "ebin"])]},
{outdir, OutputDir} |
case rlx_state:get(State, include_erts, true) of
true ->
+ Prefix = code:root_dir(),
+ ErtsDir = filename:join([Prefix]),
[{erts, ErtsDir}];
false ->
- []
+ [];
+ Prefix ->
+ ErtsDir = filename:join([Prefix]),
+ [{erts, ErtsDir}]
end],
case systools:make_tar(filename:join([OutputDir, "releases", Vsn, Name]),
Opts) of
@@ -562,10 +574,10 @@ update_tar(State, TempDir, OutputDir, Name, Vsn, ErtsVersion) ->
filename:join([OutputDir, "releases", Vsn, "vm.args"])},
{"bin", filename:join([OutputDir, "bin"])} |
case rlx_state:get(State, include_erts, true) of
- true ->
- [{"erts-"++ErtsVersion, filename:join(OutputDir, "erts-"++ErtsVersion)}];
false ->
- []
+ [];
+ _ ->
+ [{"erts-"++ErtsVersion, filename:join(OutputDir, "erts-"++ErtsVersion)}]
end], [compressed]),
ec_cmd_log:info(rlx_state:log(State),
"tarball ~s successfully created!~n", [TarFile]),