diff options
Diffstat (limited to 'lib/sasl')
-rw-r--r-- | lib/sasl/doc/src/error_logging.xml | 5 | ||||
-rw-r--r-- | lib/sasl/doc/src/sasl_app.xml | 13 | ||||
-rw-r--r-- | lib/sasl/doc/src/systools.xml | 6 | ||||
-rw-r--r-- | lib/sasl/src/systools_make.erl | 18 | ||||
-rw-r--r-- | lib/sasl/test/release_handler_SUITE.erl | 33 | ||||
-rw-r--r-- | lib/sasl/test/systools_SUITE.erl | 32 |
6 files changed, 88 insertions, 19 deletions
diff --git a/lib/sasl/doc/src/error_logging.xml b/lib/sasl/doc/src/error_logging.xml index 5707bc4d69..f624fed1c7 100644 --- a/lib/sasl/doc/src/error_logging.xml +++ b/lib/sasl/doc/src/error_logging.xml @@ -173,8 +173,9 @@ <section> <title>Report Browser</title> <p>The report browser is used to browse and format error reports - written by the error logger handler <c>error_logger_mf_h</c>.</p> - <p>The <c>error_logger_mf_h</c> handler writes all reports to a + written by the error logger handler <c>log_mf_h</c> defined in + <c>stdlib</c>.</p> + <p>The <c>log_mf_h</c> handler writes all reports to a report logging directory. This directory is specified when configuring the SASL application.</p> <p>If the report browser is diff --git a/lib/sasl/doc/src/sasl_app.xml b/lib/sasl/doc/src/sasl_app.xml index 446baccb08..af9e73027f 100644 --- a/lib/sasl/doc/src/sasl_app.xml +++ b/lib/sasl/doc/src/sasl_app.xml @@ -51,7 +51,7 @@ <section> <title>Error Logger Event Handlers</title> - <p>The following error logger event handlers are defined in + <p>The following error logger event handlers are used by the SASL application.</p> <taglist> <tag><c>sasl_report_tty_h</c></tag> @@ -62,11 +62,10 @@ <item> <p>Formats and writes <em>supervisor reports</em>, <em>crash report</em> and <em>progress report</em> to a single file.</p> </item> - <tag><c>error_logger_mf_h</c></tag> + <tag><c>log_mf_h</c></tag> <item> <p>This error logger writes <em>all</em> events sent to - the error logger to disk. It installs the <c>log_mf_h</c> - event handler in the <c>error_logger</c> process.</p> + the error logger to disk.</p> <p>To activate this event handler, the following three sasl configuration parameters must be set: <c>error_logger_mf_dir</c>, <c>error_logger_mf_maxbytes</c> @@ -109,18 +108,18 @@ <item> <p>Specifies in which directory the files are stored. If this parameter is undefined or <c>false</c>, - the <c>error_logger_mf_h</c> is not installed.</p> + the <c>log_mf_h</c> handler is not installed.</p> </item> <tag><c><![CDATA[error_logger_mf_maxbytes = integer() <optional>]]></c></tag> <item> <p>Specifies how large each individual file can be. If this - parameter is undefined, the <c>error_logger_mf_h</c> is not + parameter is undefined, the <c>log_mf_h</c> handler is not installed.</p> </item> <tag><c><![CDATA[error_logger_mf_maxfiles = 0<integer()<256 <optional>]]></c></tag> <item> <p>Specifies how many files are used. If this parameter is - undefined, the <c>error_logger_mf_h</c> is not installed.</p> + undefined, the <c>log_mf_h</c> handler is not installed.</p> </item> <tag><c><![CDATA[overload_max_intensity = float() > 0 <optional>]]></c></tag> <item> diff --git a/lib/sasl/doc/src/systools.xml b/lib/sasl/doc/src/systools.xml index 84fed0a25f..284047163e 100644 --- a/lib/sasl/doc/src/systools.xml +++ b/lib/sasl/doc/src/systools.xml @@ -5,7 +5,7 @@ <header> <copyright> <year>1996</year> - <year>2011</year> + <year>2013</year> <holder>Ericsson AB, All Rights Reserved</holder> </copyright> <legalnotice> @@ -139,7 +139,7 @@ <type> <v>Name = string()</v> <v>Opt = src_tests | {path,[Dir]} | local | {variables,[Var]} | exref | - {exref,[App]}] | silent | {outdir,Dir} | no_warn_sasl | + {exref,[App]}] | silent | {outdir,Dir} | no_dot_erlang | no_warn_sasl | warnings_as_errors</v> <v> Dir = string()</v> <v> Var = {VarName,Prefix}</v> @@ -252,6 +252,8 @@ <c>Module:format_error(Error)</c>.</p> <p>If the option <c>warnings_as_errors</c> is provided, warnings are treated as errors.</p> + <p>If the option <c>no_dot_erlang</c> is provided, the instruction to + load the <c>.erlang</c> file during boot is <em>NOT</em> included.</p> </desc> </func> <func> diff --git a/lib/sasl/src/systools_make.erl b/lib/sasl/src/systools_make.erl index b2e95fdbee..bab88552f9 100644 --- a/lib/sasl/src/systools_make.erl +++ b/lib/sasl/src/systools_make.erl @@ -1135,10 +1135,10 @@ generate_script(Output, Release, Appls, Flags) -> load_appl_mods(Appls, Mandatory ++ Preloaded, PathFlag, Variables) ++ [{path, create_path(Appls, PathFlag, Variables)}] ++ - create_kernel_procs(Appls) ++ - create_load_appls(Appls) ++ - create_start_appls(Appls) ++ - script_end() + create_kernel_procs(Appls) ++ + create_load_appls(Appls) ++ + create_start_appls(Appls) ++ + script_end(lists:member(no_dot_erlang, Flags)) }, ScriptFile = Output ++ ".script", @@ -1229,9 +1229,12 @@ create_load_appls([]) -> %%______________________________________________________________________ %% The final part of the script. -script_end() -> +script_end(false) -> %% Do not skip loading of $HOME/.erlang [{apply, {c, erlangrc, []}}, - {progress, started}]. + {progress, started}]; +script_end(true) -> %% Ignore loading of $HOME/.erlang + [{progress, started}]. + %%----------------------------------------------------------------- %% Function: sort_appls(Appls) -> {ok, Appls'} | throw({error, Error}) @@ -2055,6 +2058,9 @@ cas([no_warn_sasl | Args], X) -> %%% no_module_tests (kept for backwards compatibility, but ignored) ---- cas([no_module_tests | Args], X) -> cas(Args, X); +cas([no_dot_erlang | Args], X) -> + cas(Args, X); + %%% ERROR -------------------------------------------------------------- cas([Y | Args], X) -> cas(Args, X++[Y]). diff --git a/lib/sasl/test/release_handler_SUITE.erl b/lib/sasl/test/release_handler_SUITE.erl index a56924d5ca..d7369b0ecf 100644 --- a/lib/sasl/test/release_handler_SUITE.erl +++ b/lib/sasl/test/release_handler_SUITE.erl @@ -64,7 +64,7 @@ cases() -> supervisor_which_children_timeout, release_handler_which_releases, install_release_syntax_check, upgrade_supervisor, upgrade_supervisor_fail, otp_9864, - otp_10463_upgrade_script_regexp]. + otp_10463_upgrade_script_regexp, no_dot_erlang]. groups() -> [{release,[], @@ -1709,6 +1709,37 @@ otp_10463_upgrade_script_regexp(_Config) -> release_handler:upgrade_script(kernel,code:lib_dir(kernel)), ok. +no_dot_erlang(Conf) -> + PrivDir = priv_dir(Conf), + {ok, OrigWd} = file:get_cwd(), + try + ok = file:set_cwd(PrivDir), + + Erl = filename:join([code:root_dir(),"bin","erl"]), + Args = " -noinput -run io put_chars \"TESTOK\" -run erlang halt", + ok = file:write_file(".erlang", <<"io:put_chars(\"DOT_ERLANG_READ\\n\").\n">>), + + case os:cmd(Erl ++ Args) of + "DOT_ERLANG_READ" ++ _ -> ok; + Other1 -> + io:format("Failed: ~s~n",[Erl ++ Args]), + io:format("Expected: ~s ++ _~n",["DOT_ERLANG_READ "]), + io:format("Got: ~s~n",[Other1]), + exit(failed_to_start, test_error) + end, + NO_DOT_ERL = " -boot no_dot_erlang", + case os:cmd(Erl ++ NO_DOT_ERL ++ Args) of + "TESTOK" ++ _ -> ok; + Other2 -> + io:format("Failed: ~s~n",[Erl ++ Args]), + io:format("Expected: ~s~n",["TESTOK"]), + io:format("Got: ~s~n",[Other2]), + exit(failed_to_start, no_dot_erlang) + end + after + _ = file:delete(".erlang"), + ok = file:set_cwd(OrigWd) + end. %%%================================================================= %%% Misceleaneous functions diff --git a/lib/sasl/test/systools_SUITE.erl b/lib/sasl/test/systools_SUITE.erl index 3921b2d3bb..9efc8f8392 100644 --- a/lib/sasl/test/systools_SUITE.erl +++ b/lib/sasl/test/systools_SUITE.erl @@ -43,6 +43,7 @@ -export([script_options/1, normal_script/1, unicode_script/1, unicode_script/2, no_mod_vsn_script/1, wildcard_script/1, variable_script/1, no_sasl_script/1, + no_dot_erlang_script/1, abnormal_script/1, src_tests_script/1, crazy_script/1, included_script/1, included_override_script/1, included_fail_script/1, included_bug_script/1, exref_script/1, @@ -79,7 +80,8 @@ groups() -> [{script, [], [script_options, normal_script, unicode_script, no_mod_vsn_script, wildcard_script, variable_script, abnormal_script, - no_sasl_script, src_tests_script, crazy_script, + no_sasl_script, no_dot_erlang_script, + src_tests_script, crazy_script, included_script, included_override_script, included_fail_script, included_bug_script, exref_script, otp_3065_circular_dependenies, included_and_used_sort_script]}, @@ -457,6 +459,34 @@ no_sasl_script(Config) when is_list(Config) -> ok = file:set_cwd(OldDir), ok. +%% make_script: Create script with no_dot_erlang. Check script contents. +no_dot_erlang_script(Config) when is_list(Config) -> + {ok, OldDir} = file:get_cwd(), + + {LatestDir, LatestName} = create_script(latest1_no_sasl,Config), + + DataDir = filename:absname(?copydir), + LibDir = [fname([DataDir, d_normal, lib])], + P = [fname([LibDir, '*', ebin]), + fname([DataDir, lib, kernel, ebin]), + fname([DataDir, lib, stdlib, ebin]), + fname([DataDir, lib, sasl, ebin])], + + ok = file:set_cwd(LatestDir), + + {ok, _ , []} = + systools:make_script(LatestName,[{path, P},silent, no_warn_sasl]), + {ok, [{_, _, LoadDotErlang}]} = read_script_file(LatestName), + [erlangrc] = [E || {apply, {c, E, []}} <- LoadDotErlang], + + {ok, _ , []} = + systools:make_script(LatestName,[{path, P},silent, no_warn_sasl, no_dot_erlang]), + {ok, [{_, _, DoNotLoadDotErlang}]} = read_script_file(LatestName), + [] = [E || {apply, {c, E, []}} <- DoNotLoadDotErlang], + + ok = file:set_cwd(OldDir), + ok. + %% make_script: Do not check date of object file or that source code %% can be found. |