aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2012-10-10 12:22:52 +0200
committerSiri Hansen <[email protected]>2012-10-10 12:22:52 +0200
commit30bef3483796b2b73f438427640b7231df3787b8 (patch)
tree245f53a6b343b4a702cadc670da311e77e13f625
parent0862c07826b3fd5496a9b3bab2bb0b54a8aa7655 (diff)
parent0bdd08b451c0afc859acdc06678a944e6195a279 (diff)
downloadotp-30bef3483796b2b73f438427640b7231df3787b8.tar.gz
otp-30bef3483796b2b73f438427640b7231df3787b8.tar.bz2
otp-30bef3483796b2b73f438427640b7231df3787b8.zip
Merge branch 'siri/sasl/appup-regexp-fix/OTP-10463'
* siri/sasl/appup-regexp-fix/OTP-10463: Fix release_handler:find_script so it can read regexp in appups
-rw-r--r--lib/sasl/src/release_handler.erl8
-rw-r--r--lib/sasl/src/systools_relup.erl5
-rw-r--r--lib/sasl/test/release_handler_SUITE.erl12
3 files changed, 18 insertions, 7 deletions
diff --git a/lib/sasl/src/release_handler.erl b/lib/sasl/src/release_handler.erl
index 5efd932c92..1ff3eb96eb 100644
--- a/lib/sasl/src/release_handler.erl
+++ b/lib/sasl/src/release_handler.erl
@@ -494,10 +494,10 @@ find_script(App, Dir, OldVsn, UpOrDown) ->
up -> UpFromScripts;
down -> DownToScripts
end,
- case lists:keysearch(OldVsn, 1, Scripts) of
- {value, {_OldVsn, Script}} ->
- {NewVsn, Script};
- false ->
+ case systools_relup:appup_search_for_version(OldVsn,Scripts) of
+ {ok,Script} ->
+ {NewVsn,Script};
+ error ->
throw({version_not_in_appup, OldVsn})
end;
{error, enoent} ->
diff --git a/lib/sasl/src/systools_relup.erl b/lib/sasl/src/systools_relup.erl
index 7fb623bb85..7048184426 100644
--- a/lib/sasl/src/systools_relup.erl
+++ b/lib/sasl/src/systools_relup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -114,7 +114,8 @@
-define(R15_SASL_VSN,"2.2").
-%% For test purposes only - used by kernel, stdlib and sasl tests
+%% Used by release_handler:find_script/4.
+%% Also used by kernel, stdlib and sasl tests
-export([appup_search_for_version/2]).
%%-----------------------------------------------------------------
diff --git a/lib/sasl/test/release_handler_SUITE.erl b/lib/sasl/test/release_handler_SUITE.erl
index 87a755031c..94cffc988d 100644
--- a/lib/sasl/test/release_handler_SUITE.erl
+++ b/lib/sasl/test/release_handler_SUITE.erl
@@ -63,7 +63,8 @@ cases() ->
instructions, eval_appup, eval_appup_with_restart,
supervisor_which_children_timeout,
release_handler_which_releases, install_release_syntax_check,
- upgrade_supervisor, upgrade_supervisor_fail, otp_9864].
+ upgrade_supervisor, upgrade_supervisor_fail, otp_9864,
+ otp_10463_upgrade_script_regexp].
groups() ->
[{release,[],
@@ -1660,6 +1661,15 @@ upgrade_gg(cleanup,Config) ->
ok = stop_nodes(NodeNames).
+%%%-----------------------------------------------------------------
+%%% OTP-10463, Bug - release_handler could not handle regexp in appup
+%%% files.
+otp_10463_upgrade_script_regexp(_Config) ->
+ %% Assuming that kernel always has a regexp in it's appup
+ KernelVsn = vsn(kernel,current),
+ {ok,KernelVsn,_} =
+ release_handler:upgrade_script(kernel,code:lib_dir(kernel)),
+ ok.
%%%=================================================================