diff options
author | Luis Rascão <[email protected]> | 2017-05-12 13:36:20 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2017-05-12 13:36:20 +0100 |
commit | e0d3346810e224b5210996af35421ab81221ca0d (patch) | |
tree | cae91dd6d78b1284023e53e0ac90d0746d22b93e /priv/templates/install_upgrade_escript | |
parent | 2da0b73b85a3c6e421f06001b317b9372f937a15 (diff) | |
parent | 269349df3596bef2a5c038f15cc9b7b036e6797d (diff) | |
download | relx-e0d3346810e224b5210996af35421ab81221ca0d.tar.gz relx-e0d3346810e224b5210996af35421ab81221ca0d.tar.bz2 relx-e0d3346810e224b5210996af35421ab81221ca0d.zip |
Merge pull request #589 from essen/relups-dont-need-compiler
Don't require compiler in the release for relups
Diffstat (limited to 'priv/templates/install_upgrade_escript')
-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). |