summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--mix.exs1
-rw-r--r--rebar.config1
-rw-r--r--src/ejabberd_update.erl35
3 files changed, 37 insertions, 0 deletions
diff --git a/mix.exs b/mix.exs
index 6d50b2ce..4200325c 100644
--- a/mix.exs
+++ b/mix.exs
@@ -71,6 +71,7 @@ defmodule Ejabberd.Mixfile do
if_version_below('23', [{:d, :USE_OLD_CRYPTO_HMAC}]) ++
if_version_below('23', [{:d, :USE_OLD_PG2}]) ++
if_version_below('24', [{:d, :COMPILER_REPORTS_ONLY_LINES}]) ++
+ if_version_below('24', [{:d, :SYSTOOLS_APP_DEF_WITHOUT_OPTIONAL}]) ++
if_function_exported(:erl_error, :format_exception, 6, [{:d, :HAVE_ERL_ERROR}])
defines = for {:d, value} <- result, do: {:d, value}
result ++ [{:d, :ALL_DEFS, defines}]
diff --git a/rebar.config b/rebar.config
index 05466033..81f3dc84 100644
--- a/rebar.config
+++ b/rebar.config
@@ -100,6 +100,7 @@
{if_version_below, "23", {d, 'USE_OLD_CRYPTO_HMAC'}},
{if_version_below, "23", {d, 'USE_OLD_PG2'}},
{if_version_below, "24", {d, 'COMPILER_REPORTS_ONLY_LINES'}},
+ {if_version_below, "24", {d, 'SYSTOOLS_APP_DEF_WITHOUT_OPTIONAL'}},
{if_var_match, db_type, mssql, {d, 'mssql'}},
{if_var_false, debug, no_debug_info},
{if_var_true, debug, debug_info},
diff --git a/src/ejabberd_update.erl b/src/ejabberd_update.erl
index 7785b608..8cb8c051 100644
--- a/src/ejabberd_update.erl
+++ b/src/ejabberd_update.erl
@@ -148,6 +148,7 @@ build_script(Dir, UpdatedBeams) ->
{Script, LowLevelScript, Check1}.
%% Copied from Erlang/OTP file: lib/sasl/src/systools.hrl
+-ifdef(SYSTOOLS_APP_DEF_WITHOUT_OPTIONAL).
-record(application,
{name, %% Name of the application, atom().
type = permanent, %% Application start type, atom().
@@ -177,6 +178,40 @@ build_script(Dir, UpdatedBeams) ->
dir = "" %% The directory where the .app file was
%% found (internal use).
}).
+-else.
+-record(application,
+ {name, %% Name of the application, atom().
+ type = permanent, %% Application start type, atom().
+ vsn = "", %% Version of the application, string().
+ id = "", %% Id of the application, string().
+ description = "", %% Description of application, string().
+ modules = [], %% [Module | {Module,Vsn}] of modules
+ %% incorporated in the application,
+ %% Module = atom(), Vsn = string().
+ uses = [], %% [Application] list of applications required
+ %% by the application, Application = atom().
+ optional = [], %% [Application] list of applications in uses
+ %% that are optional, Application = atom().
+ includes = [], %% [Application] list of applications included
+ %% by the application, Application = atom().
+ regs = [], %% [RegNames] a list of registered process
+ %% names used by the application, RegNames =
+ %% atom().
+ env = [], %% [{Key,Value}] environment variable of
+ %% application, Key = Value = term().
+ maxT = infinity, %% Max time an application may exist,
+ %% integer() | infinity.
+ maxP = infinity, %% Max number of processes in an application,
+ %% integer() | infinity.
+ mod = [], %% [] | {Mod, StartArgs}, Mod= atom(),
+ %% StartArgs = list().
+ start_phases, %% [{Phase, PhaseArgs}] | undefined,
+ %% Phase = atom(),
+ %% PhaseArgs = list().
+ dir = "" %% The directory where the .app file was
+ %% found (internal use).
+ }).
+-endif.
make_script(UpdatedBeams) ->