From d53be747c945d5e86997e1944446795b271dacb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Fri, 11 Mar 2011 17:34:22 +0100 Subject: Update copyright years --- lib/sasl/doc/src/alarm_handler.xml | 2 +- lib/sasl/doc/src/appup.xml | 2 +- lib/sasl/doc/src/part_notes_history.xml | 2 +- lib/sasl/doc/src/rel.xml | 2 +- lib/sasl/doc/src/relup.xml | 2 +- lib/sasl/doc/src/script.xml | 2 +- lib/sasl/doc/src/systools.xml | 2 +- lib/sasl/src/systools_relup.erl | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) (limited to 'lib/sasl') diff --git a/lib/sasl/doc/src/alarm_handler.xml b/lib/sasl/doc/src/alarm_handler.xml index e4501ce5f0..87be6d2a9e 100644 --- a/lib/sasl/doc/src/alarm_handler.xml +++ b/lib/sasl/doc/src/alarm_handler.xml @@ -5,7 +5,7 @@
1996 - 2007 + 2011 Ericsson AB, All Rights Reserved diff --git a/lib/sasl/doc/src/appup.xml b/lib/sasl/doc/src/appup.xml index 48d7b69885..89bcf23b5e 100644 --- a/lib/sasl/doc/src/appup.xml +++ b/lib/sasl/doc/src/appup.xml @@ -4,7 +4,7 @@
- 19972009 + 19972011 Ericsson AB. All Rights Reserved. diff --git a/lib/sasl/doc/src/part_notes_history.xml b/lib/sasl/doc/src/part_notes_history.xml index 2726d73684..d8d48bfd46 100644 --- a/lib/sasl/doc/src/part_notes_history.xml +++ b/lib/sasl/doc/src/part_notes_history.xml @@ -5,7 +5,7 @@
2006 - 2007 + 2011 Ericsson AB, All Rights Reserved diff --git a/lib/sasl/doc/src/rel.xml b/lib/sasl/doc/src/rel.xml index 108f5e7f3e..470adf3c03 100644 --- a/lib/sasl/doc/src/rel.xml +++ b/lib/sasl/doc/src/rel.xml @@ -5,7 +5,7 @@
1997 - 2007 + 2011 Ericsson AB, All Rights Reserved diff --git a/lib/sasl/doc/src/relup.xml b/lib/sasl/doc/src/relup.xml index f7d9fcdd42..7aba7e58ba 100644 --- a/lib/sasl/doc/src/relup.xml +++ b/lib/sasl/doc/src/relup.xml @@ -5,7 +5,7 @@
1997 - 2007 + 2011 Ericsson AB, All Rights Reserved diff --git a/lib/sasl/doc/src/script.xml b/lib/sasl/doc/src/script.xml index 6bac07d106..17cc64f08e 100644 --- a/lib/sasl/doc/src/script.xml +++ b/lib/sasl/doc/src/script.xml @@ -5,7 +5,7 @@
1997 - 2007 + 2011 Ericsson AB, All Rights Reserved diff --git a/lib/sasl/doc/src/systools.xml b/lib/sasl/doc/src/systools.xml index 296553bb12..e28cd25f27 100644 --- a/lib/sasl/doc/src/systools.xml +++ b/lib/sasl/doc/src/systools.xml @@ -5,7 +5,7 @@
1996 - 2007 + 2011 Ericsson AB, All Rights Reserved diff --git a/lib/sasl/src/systools_relup.erl b/lib/sasl/src/systools_relup.erl index 71bd3ca491..6b0f77703e 100644 --- a/lib/sasl/src/systools_relup.erl +++ b/lib/sasl/src/systools_relup.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2009. All Rights Reserved. +%% Copyright Ericsson AB 1996-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in -- cgit v1.2.3 From 91b2e57ea0e3ab794d4b57a12ef10205383525a5 Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Mon, 14 Mar 2011 18:18:42 +0100 Subject: Prepare release --- lib/sasl/doc/src/notes.xml | 33 +++++++++++++++++++++++++++++++++ lib/sasl/vsn.mk | 2 +- 2 files changed, 34 insertions(+), 1 deletion(-) (limited to 'lib/sasl') diff --git a/lib/sasl/doc/src/notes.xml b/lib/sasl/doc/src/notes.xml index e528af2522..7941e371a0 100644 --- a/lib/sasl/doc/src/notes.xml +++ b/lib/sasl/doc/src/notes.xml @@ -30,6 +30,39 @@

This document describes the changes made to the SASL application.

+
SASL 2.1.9.3 + +
Improvements and New Features + + +

+ Honor start type in .rel files when building relup files

+

+ Previously, relup file always included an + application:start(Application, permanent) apply + instruction for every application that appear in the + UpTo/DowFrom release file, whatever their start type in + the release file.

+

+ The new implementation fixes this bug by honoring the + start type according to the rel(5) format. If the start + type is none, no apply line is included in the relup. If + the start type is load, the relup includes instruction to + only load the application. Otherwise, the relup includes + an instruction to start the application to the according + type.

+

+ The fix is implemented by adding a new parameter to the + add_application high level appup instruction. This new + parameter is documented in appup(5).

+

+ Own Id: OTP-9097

+
+
+
+ +
+
SASL 2.1.9.2
Fixed Bugs and Malfunctions diff --git a/lib/sasl/vsn.mk b/lib/sasl/vsn.mk index d01a9bc4f1..8112d145dd 100644 --- a/lib/sasl/vsn.mk +++ b/lib/sasl/vsn.mk @@ -1 +1 @@ -SASL_VSN = 2.1.9.2 +SASL_VSN = 2.1.9.3 -- cgit v1.2.3 From c425230a40c85c343538d88fccf278bc4ec569c5 Mon Sep 17 00:00:00 2001 From: Steven Gravell Date: Sun, 19 Sep 2010 18:48:24 +0100 Subject: Remove traces of release_handler reading from filesystem when it has Masters list There are a couple of places in release_handler and release_handler_1 that assumed it has a disk to read from, which in the case of an erl_prim_loader Loader other than efile is not necessarily true Add check_paths/2 to do the equivalent of check_path/1 for when there is a Masters list Change get_vsn to no longer get sent File paths but instead use the Bin since beam_lib:version being sent a file path causes it to read the local file system Add get_current_vsn/1 as an equivalent to beam_lib:version(code:which(Mod)), but using erl_prim_loader:get_file instead of reading from local file system --- lib/sasl/src/release_handler.erl | 42 +++++++++++++++++++++++++----------- lib/sasl/src/release_handler_1.erl | 44 +++++++++++++++++++++++++++----------- 2 files changed, 60 insertions(+), 26 deletions(-) (limited to 'lib/sasl') diff --git a/lib/sasl/src/release_handler.erl b/lib/sasl/src/release_handler.erl index 4c43277848..b60aa847df 100644 --- a/lib/sasl/src/release_handler.erl +++ b/lib/sasl/src/release_handler.erl @@ -791,7 +791,7 @@ check_rel(Root, RelFile, Masters) -> check_rel(Root, RelFile, LibDirs, Masters) -> case consult(RelFile, Masters) of {ok, [RelData]} -> - check_rel_data(RelData, Root, LibDirs); + check_rel_data(RelData, Root, LibDirs, Masters); {ok, _} -> throw({error, {bad_rel_file, RelFile}}); {error, Reason} when is_tuple(Reason) -> @@ -800,7 +800,8 @@ check_rel(Root, RelFile, LibDirs, Masters) -> throw({error, {FileError, RelFile}}) end. -check_rel_data({release, {Name, Vsn}, {erts, EVsn}, Libs}, Root, LibDirs) -> +check_rel_data({release, {Name, Vsn}, {erts, EVsn}, Libs}, Root, LibDirs, + Masters) -> Libs2 = lists:map(fun(LibSpec) -> Lib = element(1, LibSpec), @@ -810,7 +811,7 @@ check_rel_data({release, {Name, Vsn}, {erts, EVsn}, Libs}, Root, LibDirs) -> case lists:keysearch(Lib, 1, LibDirs) of {value, {_Lib, _Vsn, Dir}} -> Path = filename:join(Dir,LibName), - check_path(Path), + check_path(Path, Masters), Path; _ -> filename:join([Root, "lib", LibName]) @@ -820,19 +821,34 @@ check_rel_data({release, {Name, Vsn}, {erts, EVsn}, Libs}, Root, LibDirs) -> Libs), #release{name = Name, vsn = Vsn, erts_vsn = EVsn, libs = Libs2, status = unpacking}; -check_rel_data(RelData, _Root, _LibDirs) -> +check_rel_data(RelData, _Root, _LibDirs, _Masters) -> throw({error, {bad_rel_data, RelData}}). check_path(Path) -> - case file:read_file_info(Path) of - {ok, Info} when Info#file_info.type==directory -> - ok; - {ok, _Info} -> - throw({error, {not_a_directory, Path}}); - {error, _Reason} -> - throw({error, {no_such_directory, Path}}) - end. - + check_path_response(Path, file:read_file_info(Path)). +check_path(Path, false) -> check_path(Path); +check_path(Path, Masters) -> check_path_master(Masters, Path). + +%%----------------------------------------------------------------- +%% check_path at any master node. +%% If the path does not exist or is not a directory +%% at one node it should not exist at any other node either. +%%----------------------------------------------------------------- +check_path_master([Master|Ms], Path) -> + case rpc:call(Master, file, read_file_info, [Path]) of + {badrpc, _} -> consult_master(Ms, Path); + Res -> check_path_response(Path, Res) + end; +check_path_master([], _Path) -> + {error, no_master}. + +check_path_response(_Path, {ok, Info}) when Info#file_info.type==directory -> + ok; +check_path_response(Path, {ok, _Info}) -> + throw({error, {not_a_directory, Path}}); +check_path_response(Path, {error, _Reason}) -> + throw({error, {no_such_directory, Path}}). + do_check_install_release(RelDir, Vsn, Releases, Masters) -> case lists:keysearch(Vsn, #release.vsn, Releases) of {value, #release{status = current}} -> diff --git a/lib/sasl/src/release_handler_1.erl b/lib/sasl/src/release_handler_1.erl index 9c0edf4e99..8d050fb7b0 100644 --- a/lib/sasl/src/release_handler_1.erl +++ b/lib/sasl/src/release_handler_1.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2010. All Rights Reserved. +%% Copyright Ericsson AB 1996-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -20,7 +20,7 @@ %% External exports -export([eval_script/3, eval_script/4, check_script/2]). --export([get_vsn/1]). %% exported because used in a test case +-export([get_current_vsn/1]). %% exported because used in a test case -record(eval_state, {bins = [], stopped = [], suspended = [], apps = [], libdirs, unpurged = [], vsns = [], newlibs = [], @@ -223,7 +223,7 @@ eval({load_object_code, {Lib, LibVsn, Modules}}, EvalState) -> FName = filename:join(Ebin, File), case erl_prim_loader:get_file(FName) of {ok, Bin, FName2} -> - NVsns = add_new_vsn(Mod, FName2, Vsns), + NVsns = add_new_vsn(Mod, Bin, Vsns), {[{Mod, Bin, FName2} | Bins],NVsns}; error -> throw({error, {no_such_file,FName}}) @@ -609,17 +609,17 @@ sync_nodes(Id, Nodes) -> add_old_vsn(Mod, Vsns) -> case lists:keysearch(Mod, 1, Vsns) of {value, {Mod, undefined, NewVsn}} -> - OldVsn = get_vsn(code:which(Mod)), + OldVsn = get_current_vsn(Mod), lists:keyreplace(Mod, 1, Vsns, {Mod, OldVsn, NewVsn}); {value, {Mod, _OldVsn, _NewVsn}} -> Vsns; false -> - OldVsn = get_vsn(code:which(Mod)), + OldVsn = get_current_vsn(Mod), [{Mod, OldVsn, undefined} | Vsns] end. -add_new_vsn(Mod, File, Vsns) -> - NewVsn = get_vsn(File), +add_new_vsn(Mod, Bin, Vsns) -> + NewVsn = get_vsn(Bin), case lists:keysearch(Mod, 1, Vsns) of {value, {Mod, OldVsn, undefined}} -> lists:keyreplace(Mod, 1, Vsns, {Mod, OldVsn, NewVsn}); @@ -627,17 +627,35 @@ add_new_vsn(Mod, File, Vsns) -> [{Mod, undefined, NewVsn} | Vsns] end. - +%%----------------------------------------------------------------- +%% Func: get_current_vsn/1 +%% Args: Mod = atom() +%% Purpose: This function returns the equivalent of +%% beam_lib:version(code:which(Mod)), but it will also handle the +%% case when using erl_prim_loader loader different from 'efile'. +%% The reason for not using the Binary from the 'bins' or the +%% version directly from the 'vsns' state field is that these are +%% updated already by load_object_code, and this function is called +%% from load and remove. +%% Returns: Vsn = term() +%%----------------------------------------------------------------- +get_current_vsn(Mod) -> + File = code:which(Mod), + case erl_prim_loader:get_file(File) of + {ok, Bin, _File2} -> + get_vsn(Bin); + error -> + throw({error, {no_such_file, File}}) + end. %%----------------------------------------------------------------- %% Func: get_vsn/1 -%% Args: File = string() +%% Args: Bin = binary() %% Purpose: Finds the version attribute of a module. -%% Returns: Vsn -%% Vsn = term() +%% Returns: Vsn = term() %%----------------------------------------------------------------- -get_vsn(File) -> - {ok, {_Mod, Vsn}} = beam_lib:version(File), +get_vsn(Bin) -> + {ok, {_Mod, Vsn}} = beam_lib:version(Bin), case misc_supp:is_string(Vsn) of true -> Vsn; -- cgit v1.2.3