From e57e7f332fcf9ea26a7f7536b18a24181b680463 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kan=20Mattsson?= Date: Thu, 22 Apr 2010 09:30:12 +0200 Subject: Make some cleanups --- lib/reltool/doc/src/reltool.xml | 88 +++++++++++++++---------------- lib/reltool/src/reltool_target.erl | 25 ++------- lib/reltool/test/reltool_server_SUITE.erl | 8 +-- lib/reltool/test/reltool_test_lib.hrl | 1 + 4 files changed, 55 insertions(+), 67 deletions(-) diff --git a/lib/reltool/doc/src/reltool.xml b/lib/reltool/doc/src/reltool.xml index a46323b1f2..0c2b7d2a2b 100644 --- a/lib/reltool/doc/src/reltool.xml +++ b/lib/reltool/doc/src/reltool.xml @@ -136,16 +136,16 @@ incl_cond -

This parameter controls the application and escript - inclusion policy. It defaults to derived which means - that the applications that not have any explicit - incl_cond setting, will only be included if any other - (explicitly or implicitly included) application uses it. The - value include implies that all applications and - escripts that that not have any explicit incl_cond - setting will be included. exclude implies that all - applications and escripts) that that not have any explicit - incl_cond setting will be excluded.

+

This parameter controls the application and escript + inclusion policy. It defaults to derived which means + that the applications that not have any explicit + incl_cond setting, will only be included if any other + (explicitly or implicitly included) application uses it. The + value include implies that all applications and + escripts that that not have any explicit incl_cond + setting will be included. exclude implies that all + applications and escripts) that that not have any explicit + incl_cond setting will be excluded.

boot_rel @@ -167,33 +167,33 @@ relocatable -

This parameter controls whether the erl executable - in the target system automatically should determine where it - is installed or if it should use a hardcoded path to the - installation. In the latter case the target system must be - installed with reltool:install/2 before it can be - used. If the system is relocatable, the file tree containing - the target system can be moved to another location without - re-installation. The default is true.

+

This parameter controls whether the erl executable + in the target system automatically should determine where it + is installed or if it should use a hardcoded path to the + installation. In the latter case the target system must be + installed with reltool:install/2 before it can be + used. If the system is relocatable, the file tree containing + the target system can be moved to another location without + re-installation. The default is true.

profile -

The creation of the specification for a target system is - performed in two steps. In the first step a complete - specification is generated. It will likely contain much more - files than you are interested in your customized target - system. In the second step the specification will be filtered - according to your filters. There you have the ability to - specify filters per application as well as system wide - filters. You can also select a profile for your - system. Depending on the profile, different default - filters will be used. There are three different profiles to - choose from: development, embedded and - standalone. development is default. The - parameters that are affected by the profile are: - incl_sys_filters, excl_sys_filters, - incl_app_filters and excl_app_filters.

+

The creation of the specification for a target system is + performed in two steps. In the first step a complete + specification is generated. It will likely contain much more + files than you are interested in your customized target + system. In the second step the specification will be filtered + according to your filters. There you have the ability to + specify filters per application as well as system wide + filters. You can also select a profile for your + system. Depending on the profile, different default + filters will be used. There are three different profiles to + choose from: development, embedded and + standalone. development is default. The + parameters that are affected by the profile are: + incl_sys_filters, excl_sys_filters, + incl_app_filters and excl_app_filters.

app_file @@ -386,14 +386,14 @@ incl_cond -

This parameter controls whether the module is included or not. By - default the mod_incl parameter on application and system level - will be used to control whether the module is included or not. The - value of incl_cond overrides the module inclusion policy. - include implies that the module is included, while - exclude implies that the module not is included. - derived implies that the is included if any included uses the - module.

+

This parameter controls whether the module is included or not. By + default the mod_incl parameter on application and system level + will be used to control whether the module is included or not. The + value of incl_cond overrides the module inclusion policy. + include implies that the module is included, while + exclude implies that the module not is included. + derived implies that the is included if any included uses the + module.

debug_info @@ -479,7 +479,7 @@ re_regexp() = string() reason() = string() regexps() = [re_regexp()] | {add, [re_regexp()]} - | {del, [re_regexp()]} + | {del, [re_regexp()]} rel_file() = term() rel_name() = string() rel_vsn() = string() @@ -511,9 +511,9 @@ target_spec() = [target_spec()] create_target(Server, TargetDir) -> ok | {error, Reason} Create a target system - Server = server() + Server = server() TargetDir = target_dir() - Reason = reason() + Reason = reason()

Create a target system. Gives the same result as {ok,TargetSpec}=reltool:get_target_spec(Server) and diff --git a/lib/reltool/src/reltool_target.erl b/lib/reltool/src/reltool_target.erl index 6149279112..dd6f75b9fc 100644 --- a/lib/reltool/src/reltool_target.erl +++ b/lib/reltool/src/reltool_target.erl @@ -322,7 +322,6 @@ merge_apps(#rel{name = RelName, A#app.name =/= erts, A#app.name =/= ?MISSING_APP_NAME, not lists:keymember(A#app.name, #app.name, MergedApps2)], - io:format("Embedded: ~p\n", [Embedded]), MergedApps3 = do_merge_apps(RelName, Embedded, Apps, EmbAppType, MergedApps2), sort_apps(MergedApps3). @@ -776,8 +775,6 @@ do_gen_spec(#sys{root_dir = RootDir, {create_dir,BootVsn, RelFiles}]}, {create_dir, "bin", BinFiles} ] ++ SysFiles2, - %% io:format("InclRegexps2: ~p\n", [InclRegexps2]), - %% io:format("ExclRegexps2: ~p\n", [ExclRegexps2]), SysFiles4 = filter_spec(SysFiles3, InclRegexps2, ExclRegexps2), SysFiles5 = SysFiles4 ++ [{create_dir, "lib", LibFiles}], check_sys(["bin", "erts", "lib"], SysFiles5), @@ -921,7 +918,6 @@ check_sys(Mandatory, SysFiles) -> lists:foreach(fun(M) -> do_check_sys(M, SysFiles) end, Mandatory). do_check_sys(Prefix, Specs) -> - %%io:format("Prefix: ~p\n", [Prefix]), case lookup_spec(Prefix, Specs) of [] -> reltool_utils:throw_error("Mandatory system directory ~s " @@ -989,10 +985,10 @@ check_apps([], _) -> spec_app(#app{name = Name, mods = Mods, active_dir = SourceDir, - incl_app_filters = AppInclRegexps, - excl_app_filters = AppExclRegexps} = App, - #sys{incl_app_filters = SysInclRegexps, - excl_app_filters = SysExclRegexps, + incl_app_filters = AppInclRegexps, + excl_app_filters = AppExclRegexps} = App, + #sys{incl_app_filters = SysInclRegexps, + excl_app_filters = SysExclRegexps, debug_info = SysDebugInfo} = Sys) -> %% List files recursively {create_dir, _, AppFiles} = spec_dir(SourceDir), @@ -1342,18 +1338,7 @@ opt_join(Path, File) -> filename:join([Path, File]). match(String, InclRegexps, ExclRegexps) -> - %%case - match(String, InclRegexps) andalso not match(String, ExclRegexps). -%% of -%% true -> -%% true; -%% false -> -%% io:format("no match: ~p\n" -%% " incl: ~p\n" -%% " excl: ~p\n", -%% [String, InclRegexps, ExclRegexps]), -%% false -%% end. + match(String, InclRegexps) andalso not match(String, ExclRegexps). %% Match at least one regexp match(_String, []) -> diff --git a/lib/reltool/test/reltool_server_SUITE.erl b/lib/reltool/test/reltool_server_SUITE.erl index df53d0cc23..d9c6a1350c 100644 --- a/lib/reltool/test/reltool_server_SUITE.erl +++ b/lib/reltool/test/reltool_server_SUITE.erl @@ -130,8 +130,7 @@ create_release(_Config) -> {value, {_, _, StdlibVsn}} = lists:keysearch(stdlib, 1, Apps), Rel = {release, {RelName, RelVsn}, {erts, ErtsVsn}, - [{kernel, KernelVsn}, - {stdlib, StdlibVsn}]}, + [{kernel, KernelVsn}, {stdlib, StdlibVsn}]}, ?m({ok, Rel}, reltool:get_rel([{config, Config}], RelName)), ok. @@ -161,7 +160,7 @@ create_script(_Config) -> Rel = {release, {RelName, RelVsn}, {erts, ErtsVsn}, - [{stdlib, StdlibVsn}, {kernel, KernelVsn}]}, + [{kernel, KernelVsn}, {stdlib, StdlibVsn}]}, ?m({ok, Rel}, reltool:get_rel(Pid, RelName)), ?m(ok, file:write_file(filename:join([?WORK_DIR, RelName ++ ".rel"]), io_lib:format("~p.\n", [Rel]))), @@ -208,6 +207,7 @@ create_target(_Config) -> TargetDir = filename:join([?WORK_DIR, "target_development"]), ?m(ok, reltool_utils:recursive_delete(TargetDir)), ?m(ok, file:make_dir(TargetDir)), + ?log("SPEC: ~p\n", [reltool:get_target_spec([{config, Config}])]), ?m(ok, reltool:create_target([{config, Config}], TargetDir)), Erl = filename:join([TargetDir, "bin", "erl"]), @@ -294,6 +294,8 @@ create_standalone(_Config) -> create_old_target(TestInfo) when is_atom(TestInfo) -> reltool_test_lib:tc_info(TestInfo); create_old_target(_Config) -> + ?skip("Old style of target", []), + %% Configure the server RelName1 = "Just testing", RelName2 = "Just testing with SASL", diff --git a/lib/reltool/test/reltool_test_lib.hrl b/lib/reltool/test/reltool_test_lib.hrl index 93134144ea..60032030ad 100644 --- a/lib/reltool/test/reltool_test_lib.hrl +++ b/lib/reltool/test/reltool_test_lib.hrl @@ -18,6 +18,7 @@ -include_lib("wx/include/wx.hrl"). +-define(flat_format(Format,Args), lists:flatten(io_lib:format(Format,Args))). -define(log(Format,Args), reltool_test_lib:log(Format,Args,?FILE,?LINE)). -define(warning(Format,Args), ?log("\n " ++ Format,Args)). -define(error(Format,Args), reltool_test_lib:error(Format,Args,?FILE,?LINE)). -- cgit v1.2.3