Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Ensure we always have a `registered` value in `.app` files #37

Merged
merged 1 commit into from

3 participants

@nox
nox commented

systools:make_relup/4 fails with {missing_param, registered} without a registered value.

@nox nox Ensure we always have a `registered` value in `.app` files
`systools:make_relup/4` fails with `{missing_param, registered}`
without a `registered` value.
22641c0
@tuncer

@dizzyd, ping?

@dizzyd dizzyd merged commit 2f4de53 into rebar:master

1 check passed

Details default The Travis build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 7, 2012
  1. @nox

    Ensure we always have a `registered` value in `.app` files

    nox authored
    `systools:make_relup/4` fails with `{missing_param, registered}`
    without a `registered` value.
This page is out of date. Refresh to see the latest.
Showing with 14 additions and 1 deletion.
  1. +14 −1 src/rebar_otp_app.erl
View
15 src/rebar_otp_app.erl
@@ -101,8 +101,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),
@@ -187,3 +191,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.
Something went wrong with that request. Please try again.