diff options
Diffstat (limited to 'lib/sasl/test/rh_test_lib.erl')
-rw-r--r-- | lib/sasl/test/rh_test_lib.erl | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/lib/sasl/test/rh_test_lib.erl b/lib/sasl/test/rh_test_lib.erl index 6425fce7a7..dba45bece6 100644 --- a/lib/sasl/test/rh_test_lib.erl +++ b/lib/sasl/test/rh_test_lib.erl @@ -12,13 +12,15 @@ -export([clean_dir/1, clean_dir/2]). +-export([old_app_vsn/1]). + -include_lib("kernel/include/file.hrl"). cmd(Cmd,Args,Env) -> case open_port({spawn_executable, Cmd}, [{args,Args},{env,Env}]) of Port when is_port(Port) -> unlink(Port), - catch erlang:port_close(Port), % migth already be closed, so catching + catch erlang:port_close(Port), % might already be closed, so catching ok; Error -> Error @@ -160,3 +162,23 @@ rm_rf([File|Files],Save) -> end; rm_rf([],_) -> ok. + +old_app_vsn(App) -> + %% Get oldest application version (erts, kernel, sasl, + %% stdlib) we support upgrade from, i.e., the first + %% application version in the release two releases + %% prior to current release... + State = case get('__otp_vsns_state__') of + undefined -> + S = otp_vsns:read_state(), + put('__otp_vsns_state__', S), + S; + S -> + S + end, + Rel = integer_to_list(list_to_integer(erlang:system_info(otp_release))-2), + AppVsn = otp_vsns:app_vsn(State, "OTP-"++Rel++".0", atom_to_list(App)), + [_, Vsn] = string:lexemes(AppVsn, "-"), + Vsn. + + |