aboutsummaryrefslogtreecommitdiffstats
path: root/lib/reltool/src/reltool_sys_win.erl
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2011-05-11 15:57:51 +0200
committerSiri Hansen <[email protected]>2011-05-17 11:04:38 +0200
commit06f99b287fbb79e89831bedf1b2e64e7185f66c8 (patch)
tree0fda082fa28322df482ecff103324462a2aaf396 /lib/reltool/src/reltool_sys_win.erl
parent430056cfd0d8202337c87cb110818b8491caa41a (diff)
downloadotp-06f99b287fbb79e89831bedf1b2e64e7185f66c8.tar.gz
otp-06f99b287fbb79e89831bedf1b2e64e7185f66c8.tar.bz2
otp-06f99b287fbb79e89831bedf1b2e64e7185f66c8.zip
Allow same module name in multiple applications if explicitely excluded
Earlier, reltool expected all module names detected under the lib directories to have unique names. If this was not the case, the result was undefined - i.e. the beam file of the duplicated module might be included in multiple applications in the target area, or it might even be excluded from all applications. This commit adds awareness in reltool that a module might occur in multiple applications, and it is allowed as long as the module or it's application is explicitely excluded in all but one of the containing applications.
Diffstat (limited to 'lib/reltool/src/reltool_sys_win.erl')
-rw-r--r--lib/reltool/src/reltool_sys_win.erl26
1 files changed, 16 insertions, 10 deletions
diff --git a/lib/reltool/src/reltool_sys_win.erl b/lib/reltool/src/reltool_sys_win.erl
index dbb8e32aa2..76c064f1e7 100644
--- a/lib/reltool/src/reltool_sys_win.erl
+++ b/lib/reltool/src/reltool_sys_win.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-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
@@ -1092,17 +1092,23 @@ move_app(S, {_ItemNo, AppBase}, Action) ->
OldApp#app{incl_cond = AppCond}.
do_set_app(#state{server_pid = ServerPid, app_wins = AppWins} = S, NewApp) ->
- {ok, AnalysedApp, Warnings} = reltool_server:set_app(ServerPid, NewApp),
+ Result = reltool_server:set_app(ServerPid, NewApp),
[ok = reltool_app_win:refresh(AW#app_win.pid) || AW <- AppWins],
S2 = redraw_apps(S),
- case Warnings of
- [] ->
- ignore;
- _ ->
- Msg = lists:flatten([[W, $\n] || W <- Warnings]),
- display_message(Msg, ?wxICON_WARNING)
- end,
- {ok, AnalysedApp, S2}.
+ ReturnApp =
+ case Result of
+ {ok, AnalysedApp, []} ->
+ AnalysedApp;
+ {ok, AnalysedApp, Warnings} ->
+ Msg = lists:flatten([[W, $\n] || W <- Warnings]),
+ display_message(Msg, ?wxICON_WARNING),
+ AnalysedApp;
+ {error, Reason} ->
+ display_message(Reason, ?wxICON_ERROR),
+ {ok,OldApp} = reltool_server:get_app(ServerPid, NewApp#app.name),
+ OldApp
+ end,
+ {ok, ReturnApp, S2}.
redraw_apps(#state{server_pid = ServerPid,
source = SourceCtrl,