aboutsummaryrefslogtreecommitdiffstats
path: root/lib/sasl/src
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2011-12-21 14:53:48 +0100
committerSiri Hansen <[email protected]>2011-12-21 14:53:48 +0100
commit5acece57ced229dc76ebf3eb7cf7dfec1a24cc19 (patch)
tree8043de4e66b641c593f78219902a0a9a7fc2e6c8 /lib/sasl/src
parentecb1632afcce1eb5c7e7887af48f2c14fba5b398 (diff)
parent009bef0359d6426e89878d782346feb31d922ee3 (diff)
downloadotp-5acece57ced229dc76ebf3eb7cf7dfec1a24cc19.tar.gz
otp-5acece57ced229dc76ebf3eb7cf7dfec1a24cc19.tar.bz2
otp-5acece57ced229dc76ebf3eb7cf7dfec1a24cc19.zip
Merge branch 'siri/sasl/require-kernel-start/OTP-9652' into maint
* siri/sasl/require-kernel-start/OTP-9652: Reject systools:make_script if kernel and stdlib are not permanent in .rel
Diffstat (limited to 'lib/sasl/src')
-rw-r--r--lib/sasl/src/systools_make.erl54
1 files changed, 31 insertions, 23 deletions
diff --git a/lib/sasl/src/systools_make.erl b/lib/sasl/src/systools_make.erl
index 8fd90c50f9..7be83d4137 100644
--- a/lib/sasl/src/systools_make.erl
+++ b/lib/sasl/src/systools_make.erl
@@ -463,30 +463,35 @@ check_appl(Appl) ->
end,
Appl) of
[] ->
- {ok,Ws} = mandatory_applications(Appl),
- {split_app_incl(Appl),Ws};
+ {ApplsNoIncls,Incls} = split_app_incl(Appl),
+ {ok,Ws} = mandatory_applications(ApplsNoIncls,undefined,
+ undefined,undefined),
+ {{ApplsNoIncls,Incls},Ws};
Illegal ->
throw({error, {illegal_applications,Illegal}})
end.
-mandatory_applications(Appl) ->
- AppNames = map(fun(AppT) -> element(1, AppT) end,
- Appl),
- Mand = mandatory_applications(),
- case filter(fun(X) -> member(X, AppNames) end, Mand) of
- Mand ->
- case member(sasl,AppNames) of
- true ->
- {ok,[]};
- _ ->
- {ok, [{warning,missing_sasl}]}
- end;
- _ ->
- throw({error, {missing_mandatory_app, Mand}})
- end.
-
-mandatory_applications() ->
- [kernel, stdlib].
+mandatory_applications([{kernel,_,Type}|Apps],undefined,Stdlib,Sasl) ->
+ mandatory_applications(Apps,Type,Stdlib,Sasl);
+mandatory_applications([{stdlib,_,Type}|Apps],Kernel,undefined,Sasl) ->
+ mandatory_applications(Apps,Kernel,Type,Sasl);
+mandatory_applications([{sasl,_,Type}|Apps],Kernel,Stdlib,undefined) ->
+ mandatory_applications(Apps,Kernel,Stdlib,Type);
+mandatory_applications([_|Apps],Kernel,Stdlib,Sasl) ->
+ mandatory_applications(Apps,Kernel,Stdlib,Sasl);
+mandatory_applications([],Type,_,_) when Type=/=permanent ->
+ error_mandatory_application(kernel,Type);
+mandatory_applications([],_,Type,_) when Type=/=permanent ->
+ error_mandatory_application(sasl,Type);
+mandatory_applications([],_,_,undefined) ->
+ {ok, [{warning,missing_sasl}]};
+mandatory_applications([],_,_,_) ->
+ {ok,[]}.
+
+error_mandatory_application(App,undefined) ->
+ throw({error, {missing_mandatory_app, App}});
+error_mandatory_application(App,Type) ->
+ throw({error, {mandatory_app, App, Type}}).
split_app_incl(Appl) -> split_app_incl(Appl, [], []).
@@ -2187,9 +2192,12 @@ format_error({missing_parameter,Par}) ->
format_error({illegal_applications,Names}) ->
io_lib:format("Illegal applications in the release file: ~p~n",
[Names]);
-format_error({missing_mandatory_app,Names}) ->
- io_lib:format("Mandatory applications (~p) must be specified in the release file~n",
- [Names]);
+format_error({missing_mandatory_app,Name}) ->
+ io_lib:format("Mandatory application ~p must be specified in the release file~n",
+ [Name]);
+format_error({mandatory_app,Name,Type}) ->
+ io_lib:format("Mandatory application ~p must be of type 'permanent' in the release file. Is '~p'.~n",
+ [Name,Type]);
format_error({duplicate_register,Dups}) ->
io_lib:format("Duplicated register names: ~n~s",
[map(fun({{Reg,App1,_,_},{Reg,App2,_,_}}) ->