diff options
author | Siri Hansen <[email protected]> | 2012-03-22 16:39:20 +0100 |
---|---|---|
committer | Siri Hansen <[email protected]> | 2012-03-22 16:39:20 +0100 |
commit | 38f068341ebf04e5d6bf5eff7fb01e44bce228b6 (patch) | |
tree | a8fd5fff96972a307887ad482142d5ef1e17f0e2 /lib/reltool/test | |
parent | 602d96340b97315c156b597a5ccbfcc135a9a682 (diff) | |
download | otp-38f068341ebf04e5d6bf5eff7fb01e44bce228b6.tar.gz otp-38f068341ebf04e5d6bf5eff7fb01e44bce228b6.tar.bz2 otp-38f068341ebf04e5d6bf5eff7fb01e44bce228b6.zip |
[reltool] Allow lib_dir on app level to use relative path
This commit adds a normalization of the directory given with the
lib_dir parameter on application level. This will covert the path to
absolute, remove trailing slash and any occurrencies of "xxx/..".
Diffstat (limited to 'lib/reltool/test')
-rw-r--r-- | lib/reltool/test/reltool_server_SUITE.erl | 27 | ||||
-rw-r--r-- | lib/reltool/test/reltool_server_SUITE_data/use_selected_vsn/b-1.0/rel/.gitignore | 0 |
2 files changed, 25 insertions, 2 deletions
diff --git a/lib/reltool/test/reltool_server_SUITE.erl b/lib/reltool/test/reltool_server_SUITE.erl index 998687136f..8a98dc36cf 100644 --- a/lib/reltool/test/reltool_server_SUITE.erl +++ b/lib/reltool/test/reltool_server_SUITE.erl @@ -89,7 +89,8 @@ all() -> gen_rel_files, save_config, dependencies, - use_selected_vsn]. + use_selected_vsn, + use_selected_vsn_relative_path]. groups() -> []. @@ -2084,7 +2085,6 @@ use_selected_vsn(Config) -> {app,b,[{incl_cond,include},{lib_dir,B2Dir}]}]}, {ok, Pid3} = ?msym({ok, _}, reltool:start_server([{config, Sys3}])), % test_server:break("Pid3 = list_to_pid(\""++pid_to_list(Pid3)++"\")."), - ?msym({ok,#app{vsn="2.0",active_dir=B2Dir}},reltool_server:get_app(Pid3,b)), {ok,B31} = ?msym({ok,#app{vsn="2.0",active_dir=B2Dir}}, reltool_server:get_app(Pid3,b)), %% Change from a pre-selected dir to use latest @@ -2123,6 +2123,29 @@ use_selected_vsn(Config) -> ok. +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +use_selected_vsn_relative_path(Config) -> + LibDir = filename:join([datadir(Config),"use_selected_vsn","b-1.0"]), + RelDir = filename:join(LibDir,"rel"), + + {ok,Cwd} = file:get_cwd(), + ok = file:set_cwd(RelDir), + + Sys = {sys,[{incl_cond, exclude}, + {app,kernel,[{incl_cond,include}]}, + {app,sasl,[{incl_cond,include}]}, + {app,stdlib,[{incl_cond,include}]}, + {app,b,[{incl_cond,include},{lib_dir,".."}]}]}, + {ok, Pid} = ?msym({ok, _}, reltool:start_server([{config, Sys}])), + + ?msym({ok,#app{vsn="1.0",active_dir=LibDir}},reltool_server:get_app(Pid,b)), + + ?m(ok, reltool:stop(Pid)), + + ok = file:set_cwd(Cwd), + ok. + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Library functions diff --git a/lib/reltool/test/reltool_server_SUITE_data/use_selected_vsn/b-1.0/rel/.gitignore b/lib/reltool/test/reltool_server_SUITE_data/use_selected_vsn/b-1.0/rel/.gitignore new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/lib/reltool/test/reltool_server_SUITE_data/use_selected_vsn/b-1.0/rel/.gitignore |