summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDave Smith <dizzyd@dizzyd.com>2013-06-16 06:14:48 -0700
committerDave Smith <dizzyd@dizzyd.com>2013-06-16 06:14:48 -0700
commit2f4de5359c13b556d37130c02c944c5ed63add76 (patch)
treee462be20a96c97136ec899c728feae56f6edd6e6 /src
parent76405da6d7726d6600270ad42e43ab626eb30ef9 (diff)
parent22641c07ecc18f1fb58abcc94b3643e8bf9ae6fb (diff)
Merge pull request #37 from nox/force-registered
Ensure we always have a `registered` value in `.app` files
Diffstat (limited to 'src')
-rw-r--r--src/rebar_otp_app.erl15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/rebar_otp_app.erl b/src/rebar_otp_app.erl
index 6c52336..b3566c8 100644
--- a/src/rebar_otp_app.erl
+++ b/src/rebar_otp_app.erl
@@ -119,8 +119,12 @@ preprocess(Config, AppSrcFile) ->
{Config2, Vsn} = rebar_app_utils:app_vsn(Config1, AppSrcFile),
A2 = lists:keystore(vsn, 1, A1, {vsn, Vsn}),
+ %% systools:make_relup/4 fails with {missing_param, registered}
+ %% without a 'registered' value.
+ A3 = ensure_registered(A2),
+
%% Build the final spec as a string
- Spec = io_lib:format("~p.\n", [{application, AppName, A2}]),
+ Spec = io_lib:format("~p.\n", [{application, AppName, A3}]),
%% Setup file .app filename and write new contents
AppFile = rebar_app_utils:app_src_to_app(AppSrcFile),
@@ -205,3 +209,12 @@ validate_modules(AppName, Mods) ->
ebin_modules() ->
lists:sort([rebar_utils:beam_to_mod("ebin", N) ||
N <- rebar_utils:beams("ebin")]).
+
+ensure_registered(AppData) ->
+ case lists:keyfind(registered, 1, AppData) of
+ false ->
+ [{registered, []} | AppData];
+ {registered, _} ->
+ %% We could further check whether the value is a list of atoms.
+ AppData
+ end.