diff options
author | Loïc Hoguin <[email protected]> | 2017-05-12 13:55:13 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2017-05-12 13:55:13 +0200 |
commit | 269349df3596bef2a5c038f15cc9b7b036e6797d (patch) | |
tree | cae91dd6d78b1284023e53e0ac90d0746d22b93e /priv | |
parent | 2da0b73b85a3c6e421f06001b317b9372f937a15 (diff) | |
download | relx-269349df3596bef2a5c038f15cc9b7b036e6797d.tar.gz relx-269349df3596bef2a5c038f15cc9b7b036e6797d.tar.bz2 relx-269349df3596bef2a5c038f15cc9b7b036e6797d.zip |
Don't require compiler in the release for relups
Diffstat (limited to 'priv')
-rw-r--r-- | priv/templates/install_upgrade_escript | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/priv/templates/install_upgrade_escript b/priv/templates/install_upgrade_escript index c2aa06c..47521c6 100644 --- a/priv/templates/install_upgrade_escript +++ b/priv/templates/install_upgrade_escript @@ -2,15 +2,6 @@ %%! -noshell -noinput %% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*- %% ex: ft=erlang ts=4 sw=4 et -%% the following is so we have access to ?MODULE --mode(compile). - --export([install/2, - unpack/2, - upgrade/2, - downgrade/2, - uninstall/2, - versions/2]). -define(TIMEOUT, 300000). -define(INFO(Fmt,Args), io:format(Fmt,Args)). @@ -19,11 +10,18 @@ main([Command0, DistInfoStr | CommandArgs]) -> %% convert the distribution info arguments string to an erlang term {ok, Tokens, _} = erl_scan:string(DistInfoStr ++ "."), {ok, DistInfo} = erl_parse:parse_term(Tokens), - Command = list_to_atom(Command0), %% convert arguments into a proplist Opts = parse_arguments(CommandArgs), %% invoke the command passed as argument - erlang:apply(?MODULE, Command, [DistInfo, Opts]); + F = case Command0 of + "install" -> fun(A, B) -> install(A, B) end; + "unpack" -> fun(A, B) -> unpack(A, B) end; + "upgrade" -> fun(A, B) -> upgrade(A, B) end; + "downgrade" -> fun(A, B) -> downgrade(A, B) end; + "uninstall" -> fun(A, B) -> uninstall(A, B) end; + "versions" -> fun(A, B) -> versions(A, B) end + end, + F(DistInfo, Opts); main(Args) -> ?INFO("unknown args: ~p\n", [Args]), erlang:halt(1). |