diff options
Diffstat (limited to 'lib/sasl')
-rw-r--r-- | lib/sasl/doc/src/make.dep | 22 | ||||
-rw-r--r-- | lib/sasl/doc/src/release_handler.xml | 12 | ||||
-rw-r--r-- | lib/sasl/src/release_handler.erl | 25 | ||||
-rw-r--r-- | lib/sasl/src/systools_relup.erl | 2 | ||||
-rw-r--r-- | lib/sasl/test/release_handler_SUITE.erl | 28 | ||||
-rw-r--r--[-rwxr-xr-x] | lib/sasl/test/release_handler_SUITE_data/heart_restart.bat | 0 |
6 files changed, 62 insertions, 27 deletions
diff --git a/lib/sasl/doc/src/make.dep b/lib/sasl/doc/src/make.dep deleted file mode 100644 index 4843b7934a..0000000000 --- a/lib/sasl/doc/src/make.dep +++ /dev/null @@ -1,22 +0,0 @@ -# ---------------------------------------------------- -# >>>> Do not edit this file <<<< -# This file was automaticly generated by -# /home/otp/bin/docdepend -# ---------------------------------------------------- - - -# ---------------------------------------------------- -# TeX files that the DVI file depend on -# ---------------------------------------------------- - -book.dvi: alarm_handler.tex appup.tex book.tex error_logging.tex \ - overload.tex part.tex rb.tex ref_man.tex rel.tex \ - release_handler.tex relup.tex sasl_app.tex \ - sasl_intro.tex script.tex systools.tex - -# ---------------------------------------------------- -# Source inlined when transforming from source to LaTeX -# ---------------------------------------------------- - -book.tex: ref_man.xml - diff --git a/lib/sasl/doc/src/release_handler.xml b/lib/sasl/doc/src/release_handler.xml index bd24b2d963..7f32100d4b 100644 --- a/lib/sasl/doc/src/release_handler.xml +++ b/lib/sasl/doc/src/release_handler.xml @@ -453,6 +453,18 @@ release_handler:set_unpacked(RelFile, [{myapp,"1.0","/home/user"},...]). <p>Returns all releases known to the release handler.</p> </desc> </func> + <func> + <name>which_releases(Status) -> [{Name, Vsn, Apps, Status}]</name> + <fsummary>Return all known releases of a specific status</fsummary> + <type> + <v>Name = Vsn = string()</v> + <v>Apps = ["App-Vsn"]</v> + <v>Status = unpacked | current | permanent | old</v> + </type> + <desc> + <p>Returns all releases known to the release handler of a specific status.</p> + </desc> + </func> </funcs> <section> diff --git a/lib/sasl/src/release_handler.erl b/lib/sasl/src/release_handler.erl index 94a704e61f..4e8cb4628c 100644 --- a/lib/sasl/src/release_handler.erl +++ b/lib/sasl/src/release_handler.erl @@ -26,9 +26,9 @@ create_RELEASES/1, create_RELEASES/2, create_RELEASES/4, unpack_release/1, check_install_release/1, check_install_release/2, - install_release/1, install_release/2, - new_emulator_upgrade/2, remove_release/1, - which_releases/0, make_permanent/1, reboot_old_release/1, + install_release/1, install_release/2, new_emulator_upgrade/2, + remove_release/1, which_releases/0, which_releases/1, + make_permanent/1, reboot_old_release/1, set_unpacked/2, set_removed/1, install_file/2]). -export([upgrade_app/2, downgrade_app/2, downgrade_app/3, upgrade_script/2, downgrade_script/3, @@ -334,6 +334,14 @@ which_releases() -> call(which_releases). %%----------------------------------------------------------------- +%% Returns: [{Name, Vsn, [LibName], Status}] +%% Status = unpacked | current | permanent | old +%%----------------------------------------------------------------- +which_releases(Status) -> + Releases = which_releases(), + get_releases_with_status(Releases, Status, []). + +%%----------------------------------------------------------------- %% check_script(Script, LibDirs) -> ok | {error, Reason} %%----------------------------------------------------------------- check_script(Script, LibDirs) -> @@ -2259,3 +2267,14 @@ get_new_libs([{App,Vsn,_LibDir}|CurrentLibs], NewLibs) -> end; get_new_libs([],_) -> []. + +%%----------------------------------------------------------------- +%% Return a list of releases witch a specific status +%%----------------------------------------------------------------- +get_releases_with_status([], _, Acc) -> + Acc; +get_releases_with_status([ {_, _, _, ReleaseStatus } = Head | Tail], + Status, Acc) when ReleaseStatus == Status -> + get_releases_with_status(Tail, Status, [Head | Acc]); +get_releases_with_status([_ | Tail], Status, Acc) -> + get_releases_with_status(Tail, Status, Acc). diff --git a/lib/sasl/src/systools_relup.erl b/lib/sasl/src/systools_relup.erl index 8376e278af..7fb623bb85 100644 --- a/lib/sasl/src/systools_relup.erl +++ b/lib/sasl/src/systools_relup.erl @@ -387,7 +387,7 @@ check_for_restart_emulator_opt(RUs, Ws, Opts) -> %% instruction, executed after all code loading, code_change etc. fix_r15_sasl_upgrade([restart_new_emulator | RestRUs]=RUs, Ws, BaseApps) -> case lists:keyfind(sasl,1,BaseApps) of - {sasl,Vsn} when Vsn < ?R15_SASL_VSN -> + {sasl,Vsn} when Vsn < ?R15_SASL_VSN -> {lists:delete(restart_emulator,RestRUs) ++ [restart_new_emulator], [pre_R15_emulator_upgrade|Ws]}; _ -> diff --git a/lib/sasl/test/release_handler_SUITE.erl b/lib/sasl/test/release_handler_SUITE.erl index 180592894e..11f8bbe4fe 100644 --- a/lib/sasl/test/release_handler_SUITE.erl +++ b/lib/sasl/test/release_handler_SUITE.erl @@ -61,7 +61,7 @@ cases() -> otp_9395_check_old_code, otp_9395_check_and_purge, otp_9395_update_many_mods, otp_9395_rm_many_mods, instructions, eval_appup, supervisor_which_children_timeout, - install_release_syntax_check]. + release_handler_which_releases, install_release_syntax_check]. groups() -> [{release,[], @@ -639,6 +639,32 @@ install_release_syntax_check(Conf) when is_list(Conf) -> %%----------------------------------------------------------------- +%% release_handler:which_releases/0 and 1 test +%%----------------------------------------------------------------- +release_handler_which_releases(Conf) -> + PrivDir = priv_dir(Conf), + Dir = filename:join(PrivDir,"release_handler_which_releases"), + DataDir = ?config(data_dir,Conf), + LibDir = filename:join([DataDir,release_handler_timeouts]), + + Rel1 = create_and_install_fake_first_release(Dir,[{dummy,"0.1",LibDir}]), + + {ok, Node} = t_start_node(release_handler_which_releases, Rel1, []), + Releases0 = rpc:call(Node, release_handler, which_releases, []), + Releases1 = rpc:call(Node, release_handler, which_releases, [permanent]), + Releases2 = rpc:call(Node, release_handler, which_releases, [old]), + + 1 = length(Releases0), + 1 = length(Releases1), + 0 = length(Releases2), + + ?t:format("release_handler:which_releases/0: ~p~n", [Releases0]), + ?t:format("release_handler:which_releases/1: ~p~n", [Releases1]), + ?t:format("release_handler:which_releases/1: ~p~n", [Releases2]), + + ok. + +%%----------------------------------------------------------------- %% Ticket: OTP-2740 %% Slogan: vsn not numeric doesn't work so good in release_handling %%----------------------------------------------------------------- diff --git a/lib/sasl/test/release_handler_SUITE_data/heart_restart.bat b/lib/sasl/test/release_handler_SUITE_data/heart_restart.bat index ede1ad4ff3..ede1ad4ff3 100755..100644 --- a/lib/sasl/test/release_handler_SUITE_data/heart_restart.bat +++ b/lib/sasl/test/release_handler_SUITE_data/heart_restart.bat |