aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/appmon/doc/src/appmon_chapter.xml10
-rw-r--r--lib/asn1/test/Makefile18
-rw-r--r--lib/asn1/test/asn1_SUITE.erl.src2
-rw-r--r--lib/asn1/test/asn1_app_test.erl38
-rw-r--r--lib/asn1/test/asn1_appup_test.erl56
-rw-r--r--lib/asn1/test/asn1_test_lib.erl2
-rw-r--r--lib/asn1/test/asn1_wrapper.erl20
-rw-r--r--lib/asn1/test/ber_decode_error.erl12
-rw-r--r--lib/asn1/test/choice_extension.erl12
-rw-r--r--lib/asn1/test/h323test.erl12
-rw-r--r--lib/asn1/test/testChoExtension.erl12
-rw-r--r--lib/asn1/test/testChoExternal.erl12
-rw-r--r--lib/asn1/test/testChoOptional.erl12
-rw-r--r--lib/asn1/test/testChoOptionalImplicitTag.erl12
-rw-r--r--lib/asn1/test/testChoPrim.erl12
-rw-r--r--lib/asn1/test/testChoRecursive.erl12
-rw-r--r--lib/asn1/test/testChoTypeRefCho.erl12
-rw-r--r--lib/asn1/test/testChoTypeRefPrim.erl12
-rw-r--r--lib/asn1/test/testChoTypeRefSeq.erl12
-rw-r--r--lib/asn1/test/testChoTypeRefSet.erl12
-rw-r--r--lib/asn1/test/testChoiceIndefinite.erl12
-rw-r--r--lib/asn1/test/testCompactBitString.erl12
-rw-r--r--lib/asn1/test/testConstraints.erl12
-rw-r--r--lib/asn1/test/testContextSwitchingTypes.erl16
-rw-r--r--lib/asn1/test/testDER.erl12
-rw-r--r--lib/asn1/test/testDeepTConstr.erl12
-rw-r--r--lib/asn1/test/testDef.erl12
-rw-r--r--lib/asn1/test/testDoubleEllipses.erl12
-rw-r--r--lib/asn1/test/testEnumExt.erl12
-rw-r--r--lib/asn1/test/testExternal.erl12
-rw-r--r--lib/asn1/test/testINSTANCE_OF.erl24
-rw-r--r--lib/asn1/test/testInfObj.erl12
-rw-r--r--lib/asn1/test/testInfObjectClass.erl12
-rw-r--r--lib/asn1/test/testMegaco.erl14
-rw-r--r--lib/asn1/test/testMergeCompile.erl12
-rw-r--r--lib/asn1/test/testMvrasn6.erl12
-rw-r--r--lib/asn1/test/testNBAPsystem.erl14
-rw-r--r--lib/asn1/test/testOpenTypeImplicitTag.erl12
-rw-r--r--lib/asn1/test/testOpt.erl12
-rw-r--r--lib/asn1/test/testParamBasic.erl12
-rw-r--r--lib/asn1/test/testParameterizedInfObj.erl2
-rw-r--r--lib/asn1/test/testPrim.erl12
-rw-r--r--lib/asn1/test/testPrimExternal.erl12
-rw-r--r--lib/asn1/test/testPrimStrings.erl14
-rw-r--r--lib/asn1/test/testRANAP.erl2
-rw-r--r--lib/asn1/test/testROSE.erl12
-rw-r--r--lib/asn1/test/testSSLspecs.erl12
-rw-r--r--lib/asn1/test/testSelectionTypes.erl12
-rw-r--r--lib/asn1/test/testSeq2738.erl12
-rw-r--r--lib/asn1/test/testSeqDefault.erl12
-rw-r--r--lib/asn1/test/testSeqExtension.erl12
-rw-r--r--lib/asn1/test/testSeqExternal.erl12
-rw-r--r--lib/asn1/test/testSeqIndefinite.erl12
-rw-r--r--lib/asn1/test/testSeqOf.erl12
-rw-r--r--lib/asn1/test/testSeqOfCho.erl12
-rw-r--r--lib/asn1/test/testSeqOfExternal.erl12
-rw-r--r--lib/asn1/test/testSeqOfIndefinite.erl12
-rw-r--r--lib/asn1/test/testSeqOfTag.erl12
-rw-r--r--lib/asn1/test/testSeqOptional.erl12
-rw-r--r--lib/asn1/test/testSeqPrim.erl12
-rw-r--r--lib/asn1/test/testSeqSetDefaultVal.erl12
-rw-r--r--lib/asn1/test/testSeqTag.erl12
-rw-r--r--lib/asn1/test/testSeqTypeRefCho.erl12
-rw-r--r--lib/asn1/test/testSeqTypeRefPrim.erl12
-rw-r--r--lib/asn1/test/testSeqTypeRefSeq.erl12
-rw-r--r--lib/asn1/test/testSeqTypeRefSet.erl12
-rw-r--r--lib/asn1/test/testSetDefault.erl12
-rw-r--r--lib/asn1/test/testSetExtension.erl12
-rw-r--r--lib/asn1/test/testSetExternal.erl12
-rw-r--r--lib/asn1/test/testSetIndefinite.erl12
-rw-r--r--lib/asn1/test/testSetOf.erl12
-rw-r--r--lib/asn1/test/testSetOfCho.erl12
-rw-r--r--lib/asn1/test/testSetOfExternal.erl12
-rw-r--r--lib/asn1/test/testSetOfTag.erl12
-rw-r--r--lib/asn1/test/testSetOptional.erl12
-rw-r--r--lib/asn1/test/testSetPrim.erl12
-rw-r--r--lib/asn1/test/testSetTag.erl12
-rw-r--r--lib/asn1/test/testSetTypeRefCho.erl12
-rw-r--r--lib/asn1/test/testSetTypeRefPrim.erl12
-rw-r--r--lib/asn1/test/testSetTypeRefSeq.erl12
-rw-r--r--lib/asn1/test/testSetTypeRefSet.erl12
-rw-r--r--lib/asn1/test/testTCAP.erl12
-rw-r--r--lib/asn1/test/testTcapsystem.erl12
-rw-r--r--lib/asn1/test/testTimer.erl16
-rw-r--r--lib/asn1/test/testTypeValueNotation.erl12
-rw-r--r--lib/asn1/test/testX420.erl14
-rw-r--r--lib/asn1/test/test_bad_values.erl12
-rw-r--r--lib/asn1/test/test_compile_options.erl12
-rw-r--r--lib/asn1/test/test_driver_load.erl12
-rw-r--r--lib/asn1/test/test_inline.erl12
-rw-r--r--lib/asn1/test/test_modified_x420.erl12
-rw-r--r--lib/asn1/test/test_partial_incomplete_decode.erl12
-rw-r--r--lib/asn1/test/test_selective_decode.erl12
-rw-r--r--lib/asn1/test/test_special_decode_performance.erl12
-rw-r--r--lib/asn1/test/test_undecoded_rest.erl18
-rw-r--r--lib/asn1/test/test_x691.erl12
-rw-r--r--lib/compiler/src/v3_life.erl46
-rw-r--r--lib/cosTransactions/doc/src/ch_example.xml10
-rw-r--r--lib/erl_interface/doc/src/ei.xml8
-rw-r--r--lib/erl_interface/doc/src/erl_call.xml8
-rw-r--r--lib/hipe/cerl/erl_bif_types.erl2
-rw-r--r--lib/ic/doc/src/ch_c_mapping.xml8
-rw-r--r--lib/inets/doc/src/http_server.xml2
-rw-r--r--lib/inets/doc/src/httpc.xml3
-rw-r--r--lib/inets/doc/src/httpd_util.xml4
-rw-r--r--lib/inets/doc/src/mod_security.xml17
-rw-r--r--lib/inets/doc/src/notes.xml64
-rw-r--r--lib/inets/src/http_client/httpc_handler.erl35
-rw-r--r--lib/inets/src/http_server/httpd_conf.erl2
-rw-r--r--lib/inets/src/http_server/mod_esi.erl26
-rw-r--r--lib/inets/src/inets_app/inets.appup.src12
-rw-r--r--lib/inets/vsn.mk6
-rw-r--r--lib/kernel/doc/src/application.xml8
-rw-r--r--lib/kernel/doc/src/erl_ddll.xml12
-rw-r--r--lib/kernel/doc/src/file.xml19
-rw-r--r--lib/kernel/src/global.erl131
-rw-r--r--lib/kernel/test/global_SUITE.erl41
-rw-r--r--lib/megaco/doc/src/megaco_mib.xml12
-rw-r--r--lib/megaco/doc/src/megaco_run.xml8
-rw-r--r--lib/megaco/doc/src/megaco_user.xml8
-rw-r--r--lib/megaco/doc/src/notes_history.xml10
-rw-r--r--lib/megaco/test/megaco_app_test.erl14
-rw-r--r--lib/reltool/src/Makefile12
-rw-r--r--lib/reltool/src/reltool.erl154
-rw-r--r--lib/reltool/src/reltool.hrl335
-rw-r--r--lib/reltool/src/reltool_app_win.erl248
-rw-r--r--lib/reltool/src/reltool_fgraph.erl34
-rw-r--r--lib/reltool/src/reltool_fgraph_win.erl277
-rw-r--r--lib/reltool/src/reltool_mod_win.erl239
-rw-r--r--lib/reltool/src/reltool_server.erl809
-rw-r--r--lib/reltool/src/reltool_sys_win.erl389
-rw-r--r--lib/reltool/src/reltool_target.erl423
-rw-r--r--lib/reltool/src/reltool_utils.erl61
-rw-r--r--lib/runtime_tools/doc/src/erts_alloc_config.xml8
-rw-r--r--lib/runtime_tools/src/dbg.erl71
-rw-r--r--lib/snmp/doc/src/notes_history.xml14
-rw-r--r--lib/snmp/doc/src/snmp_app.xml4
-rw-r--r--lib/snmp/doc/src/snmp_config.xml2
-rw-r--r--lib/snmp/doc/src/snmpa_network_interface_filter.xml8
-rw-r--r--lib/snmp/doc/src/snmpm.xml10
-rw-r--r--lib/ssh/doc/src/notes.xml24
-rw-r--r--lib/ssh/doc/src/ssh.xml17
-rw-r--r--lib/ssh/src/ssh.appup.src16
-rw-r--r--lib/ssh/src/ssh.erl16
-rw-r--r--lib/ssh/src/ssh_connection.erl12
-rw-r--r--lib/ssh/src/ssh_connection_manager.erl22
-rw-r--r--lib/ssh/vsn.mk8
-rw-r--r--lib/ssl/doc/src/notes.xml15
-rw-r--r--lib/ssl/src/ssl.appup.src5
-rw-r--r--lib/ssl/src/ssl_certificate_db.erl2
-rw-r--r--lib/ssl/vsn.mk5
-rw-r--r--lib/stdlib/doc/src/io_protocol.xml4
-rw-r--r--lib/stdlib/doc/src/ms_transform.xml8
-rw-r--r--lib/stdlib/doc/src/unicode_usage.xml4
-rw-r--r--lib/stdlib/doc/src/zip.xml90
-rw-r--r--lib/stdlib/src/erl_expand_records.erl14
-rw-r--r--lib/stdlib/src/erl_lint.erl41
-rw-r--r--lib/stdlib/src/erl_parse.yrl37
-rw-r--r--lib/stdlib/src/escript.erl441
-rw-r--r--lib/stdlib/src/zip.erl80
-rw-r--r--lib/stdlib/test/erl_pp_SUITE.erl39
-rw-r--r--lib/stdlib/test/escript_SUITE.erl396
-rw-r--r--lib/stdlib/test/zip_SUITE.erl78
-rw-r--r--lib/test_server/doc/src/test_server_ctrl.xml2
-rw-r--r--lib/tools/emacs/test.erl.indented10
-rw-r--r--lib/tools/emacs/test.erl.orig10
-rw-r--r--lib/wx/c_src/wxe_driver.c13
-rw-r--r--lib/wx/c_src/wxe_driver.h11
-rw-r--r--lib/wx/c_src/wxe_impl.cpp16
-rw-r--r--lib/wx/c_src/wxe_impl.h15
-rw-r--r--lib/xmerl/doc/src/notes.xml2
171 files changed, 3896 insertions, 2399 deletions
diff --git a/lib/appmon/doc/src/appmon_chapter.xml b/lib/appmon/doc/src/appmon_chapter.xml
index 9673a13078..0dab23b549 100644
--- a/lib/appmon/doc/src/appmon_chapter.xml
+++ b/lib/appmon/doc/src/appmon_chapter.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2009</year>
+ <year>2000</year><year>2010</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -13,12 +13,12 @@
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at http://www.erlang.org/.
-
+
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitations
under the License.
-
+
</legalnotice>
<title>Appmon</title>
@@ -226,8 +226,8 @@
<p>In the left frame it is possible to:</p>
<list type="bulleted">
<item>Select which node to supervise.</item>
- <item>Select an application to view it's process tree.</item>
- <item>Select an application to view it's specification.</item>
+ <item>Select an application to view its process tree.</item>
+ <item>Select an application to view its specification.</item>
</list>
<p>The right frame shows the selected information, either the application
specification or the process tree and process information.</p>
diff --git a/lib/asn1/test/Makefile b/lib/asn1/test/Makefile
index 879e51c632..5014eb902b 100644
--- a/lib/asn1/test/Makefile
+++ b/lib/asn1/test/Makefile
@@ -133,9 +133,7 @@ ERL_FILES= $(MODULES:%=%.erl)
HRL_FILES= External.hrl
-TARGET_FILES= $(MODULES:%=$(EBIN)/%.$(EMULATOR))
-
-INSTALL_PROGS= $(TARGET_FILES)
+EMAKEFILE=Emakefile
# ----------------------------------------------------
# Release directory specification
@@ -145,19 +143,20 @@ RELSYSDIR = $(RELEASE_PATH)/asn1_test
# ----------------------------------------------------
# FLAGS
# ----------------------------------------------------
-ERL_COMPILE_FLAGS += -I$(ERL_TOP)/lib/test_server/include \
- -I$(ERL_TOP)/lib/kernel/include
-
+ERL_COMPILE_FLAGS += +warnings_as_errors
EBIN = .
# ----------------------------------------------------
# Targets
# ----------------------------------------------------
-tests debug opt: $(TARGET_FILES) $(SUITE) $(SUITE_BIN) $(SUITE_BIN_V2)
+$(EMAKEFILE): $(ERL_FILES) $(HRL_FILES)
+ $(ERL_TOP)/make/make_emakefile $(ERL_COMPILE_FLAGS) -o$(EBIN) $(MODULES) $(ERL_FILES) >$(EMAKEFILE)
+
+tests debug opt: $(SUITE) $(SUITE_BIN) $(SUITE_BIN_V2) $(EMAKEFILE)
clean:
- rm -f $(TARGET_FILES) $(SUITE) $(SUITE_BIN) $(SUITE_BIN_V2)
+ rm -f $(SUITE) $(SUITE_BIN) $(SUITE_BIN_V2)
rm -f core
docs:
@@ -190,8 +189,7 @@ release_spec: opt
release_tests_spec: opt
$(INSTALL_DIR) $(RELSYSDIR)
- $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(RELSYSDIR)
- $(INSTALL_DATA) asn1.spec $(INSTALL_PROGS) $(RELSYSDIR)
+ $(INSTALL_DATA) asn1.spec $(EMAKEFILE) $(ERL_FILES) $(HRL_FILES) $(RELSYSDIR)
chmod -f -R u+w $(RELSYSDIR)
@tar cf - *_SUITE_data | (cd $(RELSYSDIR); tar xf -)
$(INSTALL_DIR) $(RELSYSDIR)/asn1_bin_SUITE_data
diff --git a/lib/asn1/test/asn1_SUITE.erl.src b/lib/asn1/test/asn1_SUITE.erl.src
index 53a5cc5284..9d3f03fc4c 100644
--- a/lib/asn1/test/asn1_SUITE.erl.src
+++ b/lib/asn1/test/asn1_SUITE.erl.src
@@ -48,7 +48,7 @@
-compile(export_all).
%%-export([Function/Arity, ...]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
%% records used by test-case default
-record('Def1',{
diff --git a/lib/asn1/test/asn1_app_test.erl b/lib/asn1/test/asn1_app_test.erl
index 8ee42d3ec3..23a7e691e7 100644
--- a/lib/asn1/test/asn1_app_test.erl
+++ b/lib/asn1/test/asn1_app_test.erl
@@ -1,43 +1,29 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2005-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
%%----------------------------------------------------------------------
-%% Purpose: Verify the application specifics of the Megaco application
+%% Purpose: Verify the application specifics of the asn1 application
%%----------------------------------------------------------------------
-module(asn1_app_test).
-compile(export_all).
-%-include("megaco_test_lib.hrl").
-
-
-% t() -> megaco_test_lib:t(?MODULE).
-% t(Case) -> megaco_test_lib:t({?MODULE, Case}).
-
-
-% %% Test server callbacks
-% init_per_testcase(Case, Config) ->
-% megaco_test_lib:init_per_testcase(Case, Config).
-
-% fin_per_testcase(Case, Config) ->
-% megaco_test_lib:fin_per_testcase(Case, Config).
-
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
all(suite) ->
@@ -54,7 +40,7 @@ all(suite) ->
app_init(suite) -> [];
app_init(doc) -> [];
-app_init(Config) when list(Config) ->
+app_init(Config) when is_list(Config) ->
case is_app(asn1) of
{ok, AppFile} ->
io:format("AppFile: ~n~p~n", [AppFile]),
@@ -76,7 +62,7 @@ is_app(App) ->
app_fin(suite) -> [];
app_fin(doc) -> [];
-app_fin(Config) when list(Config) ->
+app_fin(Config) when is_list(Config) ->
Config.
@@ -86,7 +72,7 @@ fields(suite) ->
[];
fields(doc) ->
[];
-fields(Config) when list(Config) ->
+fields(Config) when is_list(Config) ->
AppFile = key1search(app_file, Config),
Fields = [vsn, description, modules, registered, applications],
case check_fields(Fields, AppFile, []) of
@@ -117,7 +103,7 @@ modules(suite) ->
[];
modules(doc) ->
[];
-modules(Config) when list(Config) ->
+modules(Config) when is_list(Config) ->
AppFile = key1search(app_file, Config),
Mods = key1search(modules, AppFile),
EbinList = get_ebin_mods(asn1),
@@ -188,7 +174,7 @@ exportall(suite) ->
[];
exportall(doc) ->
[];
-exportall(Config) when list(Config) ->
+exportall(Config) when is_list(Config) ->
AppFile = key1search(app_file, Config),
Mods = key1search(modules, AppFile),
check_export_all(Mods).
@@ -221,7 +207,7 @@ app_depend(suite) ->
[];
app_depend(doc) ->
[];
-app_depend(Config) when list(Config) ->
+app_depend(Config) when is_list(Config) ->
AppFile = key1search(app_file, Config),
Apps = key1search(applications, AppFile),
check_apps(Apps).
diff --git a/lib/asn1/test/asn1_appup_test.erl b/lib/asn1/test/asn1_appup_test.erl
index 644c0f7d03..81701328a6 100644
--- a/lib/asn1/test/asn1_appup_test.erl
+++ b/lib/asn1/test/asn1_appup_test.erl
@@ -1,43 +1,29 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2005-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
%%----------------------------------------------------------------------
-%% Purpose: Verify the application specifics of the Megaco application
+%% Purpose: Verify the application specifics of the asn1 application
%%----------------------------------------------------------------------
-module(asn1_appup_test).
-compile(export_all).
-%-include("megaco_test_lib.hrl").
-
-
-%t() -> megaco_test_lib:t(?MODULE).
-%t(Case) -> megaco_test_lib:t({?MODULE, Case}).
-
-
-%% Test server callbacks
-% init_per_testcase(Case, Config) ->
-% megaco_test_lib:init_per_testcase(Case, Config).
-
-% fin_per_testcase(Case, Config) ->
-% megaco_test_lib:fin_per_testcase(Case, Config).
-
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
all(suite) ->
@@ -51,7 +37,7 @@ all(suite) ->
appup_init(suite) -> [];
appup_init(doc) -> [];
-appup_init(Config) when list(Config) ->
+appup_init(Config) when is_list(Config) ->
AppFile = file_name(asn1, ".app"),
AppupFile = file_name(asn1, ".appup"),
[{app_file, AppFile}, {appup_file, AppupFile}|Config].
@@ -64,7 +50,7 @@ file_name(App, Ext) ->
appup_fin(suite) -> [];
appup_fin(doc) -> [];
-appup_fin(Config) when list(Config) ->
+appup_fin(Config) when is_list(Config) ->
Config.
@@ -74,7 +60,7 @@ appup(suite) ->
[];
appup(doc) ->
"perform a simple check of the appup file";
-appup(Config) when list(Config) ->
+appup(Config) when is_list(Config) ->
AppupFile = key1search(appup_file, Config),
AppFile = key1search(app_file, Config),
Modules = modules(AppFile),
@@ -161,14 +147,14 @@ check_instructions(UpDown, [Instr|Instrs], AllInstr, Good, Bad, Modules) ->
%% A new module is added
check_instruction(up, {add_module, Module}, _, Modules)
- when atom(Module) ->
+ when is_atom(Module) ->
d("check_instruction -> entry when up-add_module instruction with"
"~n Module: ~p", [Module]),
check_module(Module, Modules);
%% An old module is re-added
check_instruction(down, {add_module, Module}, _, Modules)
- when atom(Module) ->
+ when is_atom(Module) ->
d("check_instruction -> entry when down-add_module instruction with"
"~n Module: ~p", [Module]),
case (catch check_module(Module, Modules)) of
@@ -182,7 +168,7 @@ check_instruction(down, {add_module, Module}, _, Modules)
%% - the module has been removed from the app-file.
%% - check that no module depends on this (removed) module
check_instruction(up, {remove, {Module, Pre, Post}}, _, Modules)
- when atom(Module), atom(Pre), atom(Post) ->
+ when is_atom(Module), is_atom(Pre), is_atom(Post) ->
d("check_instruction -> entry when up-remove instruction with"
"~n Module: ~p"
"~n Pre: ~p"
@@ -198,7 +184,7 @@ check_instruction(up, {remove, {Module, Pre, Post}}, _, Modules)
%% Removing a module on downgrade: the module exist
%% in the app-file.
check_instruction(down, {remove, {Module, Pre, Post}}, AllInstr, Modules)
- when atom(Module), atom(Pre), atom(Post) ->
+ when is_atom(Module), is_atom(Pre), is_atom(Post) ->
d("check_instruction -> entry when down-remove instruction with"
"~n Module: ~p"
"~n Pre: ~p"
@@ -214,7 +200,7 @@ check_instruction(down, {remove, {Module, Pre, Post}}, AllInstr, Modules)
check_instruction(_, {load_module, Module, Pre, Post, Depend},
AllInstr, Modules)
- when atom(Module), atom(Pre), atom(Post), list(Depend) ->
+ when is_atom(Module), is_atom(Pre), is_atom(Post), is_list(Depend) ->
d("check_instruction -> entry when load_module instruction with"
"~n Module: ~p"
"~n Pre: ~p"
@@ -228,7 +214,7 @@ check_instruction(_, {load_module, Module, Pre, Post, Depend},
check_instruction(_, {update, Module, Change, Pre, Post, Depend},
AllInstr, Modules)
- when atom(Module), atom(Pre), atom(Post), list(Depend) ->
+ when is_atom(Module), is_atom(Pre), is_atom(Post), is_list(Depend) ->
d("check_instruction -> entry when update instruction with"
"~n Module: ~p"
"~n Change: ~p"
@@ -244,7 +230,7 @@ check_instruction(_, {update, Module, Change, Pre, Post, Depend},
check_instruction(_, {apply, {Module, Function, Args}},
_AllInstr, Modules)
- when atom(Module), atom(Function), list(Args) ->
+ when is_atom(Module), is_atom(Function), is_list(Args) ->
d("check_instruction -> entry when apply instruction with"
"~n Module: ~p"
"~n Function: ~p"
@@ -289,13 +275,13 @@ instruction_module(Instr) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-check_version(V) when list(V) ->
+check_version(V) when is_list(V) ->
ok;
check_version(V) ->
error({bad_version, V}).
-check_module(M, Modules) when atom(M) ->
+check_module(M, Modules) when is_atom(M) ->
case lists:member(M,Modules) of
true ->
ok;
@@ -307,7 +293,7 @@ check_module(M, _) ->
check_apply(Module,Function,Args) ->
case (catch Module:module_info()) of
- Info when list(Info) ->
+ Info when is_list(Info) ->
check_exported(Function,Args,Info);
{'EXIT',{undef,_}} ->
error({not_existing_module,Module})
@@ -326,11 +312,11 @@ check_exported(Function,Args,Info) ->
error({bad_export,Info})
end.
-check_module_depend(M, [], _) when atom(M) ->
+check_module_depend(M, [], _) when is_atom(M) ->
d("check_module_depend -> entry with"
"~n M: ~p", [M]),
ok;
-check_module_depend(M, Deps, Modules) when atom(M), list(Deps) ->
+check_module_depend(M, Deps, Modules) when is_atom(M), is_list(Deps) ->
d("check_module_depend -> entry with"
"~n M: ~p"
"~n Deps: ~p"
diff --git a/lib/asn1/test/asn1_test_lib.erl b/lib/asn1/test/asn1_test_lib.erl
index 2884c79216..26cbdeb940 100644
--- a/lib/asn1/test/asn1_test_lib.erl
+++ b/lib/asn1/test/asn1_test_lib.erl
@@ -22,7 +22,7 @@
-export([ticket_7407_compile/2,ticket_7407_code/1, ticket_7678/2,
ticket_7708/2, ticket_7763/1, ticket_7876/3]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
ticket_7407_compile(Config,Option) ->
diff --git a/lib/asn1/test/asn1_wrapper.erl b/lib/asn1/test/asn1_wrapper.erl
index 553f0b062c..d515b99ac2 100644
--- a/lib/asn1/test/asn1_wrapper.erl
+++ b/lib/asn1/test/asn1_wrapper.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2001-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -26,7 +26,7 @@
encode(Module,Type,Value) ->
case asn1rt:encode(Module,Type,Value) of
- {ok,X} when binary(X) ->
+ {ok,X} when is_binary(X) ->
{ok, binary_to_list(X)};
{ok,X} ->
{ok, binary_to_list(list_to_binary(X))};
@@ -38,21 +38,21 @@ decode(Module,Type,Bytes) ->
case Module:encoding_rule() of
ber ->
asn1rt:decode(Module,Type,Bytes);
- ber_bin when binary(Bytes) ->
+ ber_bin when is_binary(Bytes) ->
asn1rt:decode(Module,Type,Bytes);
ber_bin ->
asn1rt:decode(Module,Type,list_to_binary(Bytes));
- ber_bin_v2 when binary(Bytes) ->
+ ber_bin_v2 when is_binary(Bytes) ->
asn1rt:decode(Module,Type,Bytes);
ber_bin_v2 ->
asn1rt:decode(Module,Type,list_to_binary(Bytes));
per ->
asn1rt:decode(Module,Type,Bytes);
- per_bin when binary(Bytes) ->
+ per_bin when is_binary(Bytes) ->
asn1rt:decode(Module,Type,Bytes);
per_bin ->
asn1rt:decode(Module,Type,list_to_binary(Bytes));
- uper_bin when binary(Bytes) ->
+ uper_bin when is_binary(Bytes) ->
asn1rt:decode(Module,Type,Bytes);
uper_bin ->
asn1rt:decode(Module,Type,list_to_binary(Bytes))
diff --git a/lib/asn1/test/ber_decode_error.erl b/lib/asn1/test/ber_decode_error.erl
index aa3b0122fd..96d6545636 100644
--- a/lib/asn1/test/ber_decode_error.erl
+++ b/lib/asn1/test/ber_decode_error.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1999-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -21,7 +21,7 @@
-export([run/1, compile/3]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
compile(Config,Rules,Options) ->
diff --git a/lib/asn1/test/choice_extension.erl b/lib/asn1/test/choice_extension.erl
index 843704ee9e..85e0936ebf 100644
--- a/lib/asn1/test/choice_extension.erl
+++ b/lib/asn1/test/choice_extension.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1999-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -21,7 +21,7 @@
-export([run/0, compile/3]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
compile(Config,Rules,Options) ->
diff --git a/lib/asn1/test/h323test.erl b/lib/asn1/test/h323test.erl
index 60d2c39be0..5545dd45b9 100644
--- a/lib/asn1/test/h323test.erl
+++ b/lib/asn1/test/h323test.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1999-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -21,7 +21,7 @@
-compile(export_all).
-export([compile/3,run/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
compile(Config,Rules,Options) ->
?line DataDir = ?config(data_dir,Config),
diff --git a/lib/asn1/test/testChoExtension.erl b/lib/asn1/test/testChoExtension.erl
index 125dfaa3bd..5e149ed247 100644
--- a/lib/asn1/test/testChoExtension.erl
+++ b/lib/asn1/test/testChoExtension.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1997-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -22,7 +22,7 @@
-export([compile/3]).
-export([extension/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
compile(Config,Rules,Options) ->
diff --git a/lib/asn1/test/testChoExternal.erl b/lib/asn1/test/testChoExternal.erl
index 5f804d9d7f..b6586b616b 100644
--- a/lib/asn1/test/testChoExternal.erl
+++ b/lib/asn1/test/testChoExternal.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1997-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -23,7 +23,7 @@
-export([compile/3]).
-export([external/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
-include("External.hrl").
diff --git a/lib/asn1/test/testChoOptional.erl b/lib/asn1/test/testChoOptional.erl
index 2d969391d0..61a1955d28 100644
--- a/lib/asn1/test/testChoOptional.erl
+++ b/lib/asn1/test/testChoOptional.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1997-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -24,7 +24,7 @@
-export([optional/1]).
%-include("ChoOptional.hrl").
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
-include("External.hrl").
diff --git a/lib/asn1/test/testChoOptionalImplicitTag.erl b/lib/asn1/test/testChoOptionalImplicitTag.erl
index 30addf2e20..e28353cb5a 100644
--- a/lib/asn1/test/testChoOptionalImplicitTag.erl
+++ b/lib/asn1/test/testChoOptionalImplicitTag.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1999-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -24,7 +24,7 @@
-export([optional/1]).
%-include("ChoOptional.hrl").
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
-include("External.hrl").
diff --git a/lib/asn1/test/testChoPrim.erl b/lib/asn1/test/testChoPrim.erl
index 7fa6164b5a..f037db1c5d 100644
--- a/lib/asn1/test/testChoPrim.erl
+++ b/lib/asn1/test/testChoPrim.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1997-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -23,7 +23,7 @@
-export([bool/1]).
-export([int/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
compile(Config,Rules,Options) ->
diff --git a/lib/asn1/test/testChoRecursive.erl b/lib/asn1/test/testChoRecursive.erl
index f8c5e60f55..36e23e2e03 100644
--- a/lib/asn1/test/testChoRecursive.erl
+++ b/lib/asn1/test/testChoRecursive.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1997-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -23,7 +23,7 @@
-export([compile/3]).
-export([recursive/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
-record('ChoRec_something',{a, b, c}).
-record('ChoRec2_something',{a, b, c}).
diff --git a/lib/asn1/test/testChoTypeRefCho.erl b/lib/asn1/test/testChoTypeRefCho.erl
index 341a77c21b..f381d9078d 100644
--- a/lib/asn1/test/testChoTypeRefCho.erl
+++ b/lib/asn1/test/testChoTypeRefCho.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1997-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -22,7 +22,7 @@
-export([compile/3]).
-export([choice/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
diff --git a/lib/asn1/test/testChoTypeRefPrim.erl b/lib/asn1/test/testChoTypeRefPrim.erl
index 1ef221819c..8fb9ed9f02 100644
--- a/lib/asn1/test/testChoTypeRefPrim.erl
+++ b/lib/asn1/test/testChoTypeRefPrim.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1997-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -22,7 +22,7 @@
-export([compile/3]).
-export([prim/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
diff --git a/lib/asn1/test/testChoTypeRefSeq.erl b/lib/asn1/test/testChoTypeRefSeq.erl
index 2e9aa7c411..45d6209e79 100644
--- a/lib/asn1/test/testChoTypeRefSeq.erl
+++ b/lib/asn1/test/testChoTypeRefSeq.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1997-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -22,7 +22,7 @@
-export([compile/3]).
-export([seq/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
-record('ChoSeq',{seqInt, seqOs}).
-record('ChoSeqImp',{seqInt, seqOs}).
diff --git a/lib/asn1/test/testChoTypeRefSet.erl b/lib/asn1/test/testChoTypeRefSet.erl
index e4db73c1e3..9869549d7a 100644
--- a/lib/asn1/test/testChoTypeRefSet.erl
+++ b/lib/asn1/test/testChoTypeRefSet.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1997-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -22,7 +22,7 @@
-export([compile/3]).
-export([set/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
-record('ChoSet',{setInt, setOs}).
-record('ChoSetImp',{setInt, setOs}).
diff --git a/lib/asn1/test/testChoiceIndefinite.erl b/lib/asn1/test/testChoiceIndefinite.erl
index 5eff4ce5d4..e5f3ee51c8 100644
--- a/lib/asn1/test/testChoiceIndefinite.erl
+++ b/lib/asn1/test/testChoiceIndefinite.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2002-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2002-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -22,7 +22,7 @@
-export([compile/3]).
-export([main/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
compile(Config,Rules,Options) ->
diff --git a/lib/asn1/test/testCompactBitString.erl b/lib/asn1/test/testCompactBitString.erl
index 12aae260ea..cd5586602b 100644
--- a/lib/asn1/test/testCompactBitString.erl
+++ b/lib/asn1/test/testCompactBitString.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2001-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -23,7 +23,7 @@
-export([compact_bit_string/1, bit_string_unnamed/1,otp_4869/1,
ticket_7734/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
compile(Config,Rules,Option) ->
diff --git a/lib/asn1/test/testConstraints.erl b/lib/asn1/test/testConstraints.erl
index f70089fe82..dcbc04f8d8 100644
--- a/lib/asn1/test/testConstraints.erl
+++ b/lib/asn1/test/testConstraints.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2001-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -23,7 +23,7 @@
-export([int_constraints/1,refed_NNL_name/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
diff --git a/lib/asn1/test/testContextSwitchingTypes.erl b/lib/asn1/test/testContextSwitchingTypes.erl
index ef14397d1e..260a016c6c 100644
--- a/lib/asn1/test/testContextSwitchingTypes.erl
+++ b/lib/asn1/test/testContextSwitchingTypes.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2001-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -22,7 +22,7 @@
-export([compile/3]).
-export([test/0]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
compile(Config,Rules,Options) ->
@@ -71,13 +71,13 @@ check_EXTERNAL_Idef({Alt,_}) when Alt=='context-negotiation';
ok;
check_EXTERNAL_Idef(I) ->
{error,"failed on identification alternative",I}.
-check_EXTERNAL_DVD(DVD) when list(DVD) ->
+check_EXTERNAL_DVD(DVD) when is_list(DVD) ->
ok;
check_EXTERNAL_DVD(asn1_NOVALUE) ->
ok;
check_EXTERNAL_DVD(DVD) ->
{error,"failed on data-value-descriptor alternative",DVD}.
-check_EXTERNAL_DV(DV) when list(DV) ->
+check_EXTERNAL_DV(DV) when is_list(DV) ->
ok;
check_EXTERNAL_DV(DV) ->
{error,"failed on data-value alternative",DV}.
diff --git a/lib/asn1/test/testDER.erl b/lib/asn1/test/testDER.erl
index 970e8dadd4..630f7ecc14 100644
--- a/lib/asn1/test/testDER.erl
+++ b/lib/asn1/test/testDER.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2003-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2003-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -22,7 +22,7 @@
-export([compile/3]).
-export([test/0]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
compile(Config,Rule,Options) ->
diff --git a/lib/asn1/test/testDeepTConstr.erl b/lib/asn1/test/testDeepTConstr.erl
index a185a127e5..53d2b3040e 100644
--- a/lib/asn1/test/testDeepTConstr.erl
+++ b/lib/asn1/test/testDeepTConstr.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2001-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -23,7 +23,7 @@
-export([compile/3,main/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
compile(Config,Rules,Options) ->
diff --git a/lib/asn1/test/testDef.erl b/lib/asn1/test/testDef.erl
index aa41f7b678..7942a358be 100644
--- a/lib/asn1/test/testDef.erl
+++ b/lib/asn1/test/testDef.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1997-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -22,7 +22,7 @@
-export([compile/3]).
-export([main/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
-record('Def1',{bool0,
bool1 = asn1_DEFAULT,
diff --git a/lib/asn1/test/testDoubleEllipses.erl b/lib/asn1/test/testDoubleEllipses.erl
index 444b06995f..20be4ea215 100644
--- a/lib/asn1/test/testDoubleEllipses.erl
+++ b/lib/asn1/test/testDoubleEllipses.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2007-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2007-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -22,7 +22,7 @@
-export([compile/3]).
-export([main/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
-record('Seq',{a, c}).
-record('SeqV2',{a, b ,c}).
diff --git a/lib/asn1/test/testEnumExt.erl b/lib/asn1/test/testEnumExt.erl
index 7e25aa9b4e..4ea0f3b8a1 100644
--- a/lib/asn1/test/testEnumExt.erl
+++ b/lib/asn1/test/testEnumExt.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1998-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -22,7 +22,7 @@
-export([compile/3]).
-export([main/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
compile(Config,Rules,Options) ->
diff --git a/lib/asn1/test/testExternal.erl b/lib/asn1/test/testExternal.erl
index 3c3dc2ea29..6e1fa0ee7d 100644
--- a/lib/asn1/test/testExternal.erl
+++ b/lib/asn1/test/testExternal.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1997-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -21,7 +21,7 @@
-export([compile/3]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
compile(Config,Rules,Options) ->
diff --git a/lib/asn1/test/testINSTANCE_OF.erl b/lib/asn1/test/testINSTANCE_OF.erl
index 2a3a5c333b..6ae656da44 100644
--- a/lib/asn1/test/testINSTANCE_OF.erl
+++ b/lib/asn1/test/testINSTANCE_OF.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2003-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2003-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -21,7 +21,7 @@
-export([compile/3,main/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
compile(Config,Rules,Opt) ->
@@ -73,17 +73,17 @@ test_encdec(_Erule,{lastName,{'GeneralName_lastName',{2,3,4},
test_encdec(Erule,Res) ->
{error,{Erule,Res}}.
-wrap(ber,Int) when list(Int) ->
+wrap(ber,Int) when is_list(Int) ->
binary_to_list(list_to_binary(Int));
-wrap(per,Int) when list(Int) ->
+wrap(per,Int) when is_list(Int) ->
binary_to_list(list_to_binary(Int));
-wrap(ber_bin,Int) when list(Int) ->
+wrap(ber_bin,Int) when is_list(Int) ->
list_to_binary(Int);
-wrap(ber_bin_v2,Int) when list(Int) ->
+wrap(ber_bin_v2,Int) when is_list(Int) ->
list_to_binary(Int);
-wrap(per_bin,Int) when list(Int) ->
+wrap(per_bin,Int) when is_list(Int) ->
list_to_binary(Int);
-wrap(uper_bin,Int) when list(Int) ->
+wrap(uper_bin,Int) when is_list(Int) ->
list_to_binary(Int);
wrap(_,Int) ->
Int.
diff --git a/lib/asn1/test/testInfObj.erl b/lib/asn1/test/testInfObj.erl
index 317cd75e4b..9d73be9f23 100644
--- a/lib/asn1/test/testInfObj.erl
+++ b/lib/asn1/test/testInfObj.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2001-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -22,7 +22,7 @@
-export([compile/3,main/1,compile_RANAPfiles/3]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
-record('InitiatingMessage',{procedureCode,criticality,value}).
-record('InitiatingMessage2',{procedureCode,criticality,value}).
diff --git a/lib/asn1/test/testInfObjectClass.erl b/lib/asn1/test/testInfObjectClass.erl
index 63b332ad0a..07ebb7dbd0 100644
--- a/lib/asn1/test/testInfObjectClass.erl
+++ b/lib/asn1/test/testInfObjectClass.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2001-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -23,7 +23,7 @@
-export([compile/3,main/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
diff --git a/lib/asn1/test/testMegaco.erl b/lib/asn1/test/testMegaco.erl
index 8c0565eec7..ca2b1062d1 100644
--- a/lib/asn1/test/testMegaco.erl
+++ b/lib/asn1/test/testMegaco.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2001-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -22,7 +22,7 @@
-export([compile/3,main/2,msg11/0]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
-define(MID, {ip4Address, #'IP4Address'{address = [124, 124, 124, 222],
portNumber = 55555}}).
-define(A4444, ["11111111"]).
@@ -163,7 +163,7 @@ read_msg(File) ->
end.
-request(Mid, TransId, ContextId, CmdReq) when list(CmdReq) ->
+request(Mid, TransId, ContextId, CmdReq) when is_list(CmdReq) ->
Actions = [#'ActionRequest'{contextId = ContextId,
commandRequests = CmdReq}],
Req = {transactions,
diff --git a/lib/asn1/test/testMergeCompile.erl b/lib/asn1/test/testMergeCompile.erl
index e70ca16b77..733cbc0eef 100644
--- a/lib/asn1/test/testMergeCompile.erl
+++ b/lib/asn1/test/testMergeCompile.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2001-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -22,7 +22,7 @@
-export([compile/3,main/1,mvrasn/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
-record('InitiatingMessage',{procedureCode,criticality,value}).
-record('Iu-ReleaseCommand',{protocolIEs,protocolExtensions}).
diff --git a/lib/asn1/test/testMvrasn6.erl b/lib/asn1/test/testMvrasn6.erl
index 65668f3ed4..eaa667e6d7 100644
--- a/lib/asn1/test/testMvrasn6.erl
+++ b/lib/asn1/test/testMvrasn6.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2001-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -22,7 +22,7 @@
-export([compile/2]).
-export([main/0]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
compile(Config,Rules) ->
diff --git a/lib/asn1/test/testNBAPsystem.erl b/lib/asn1/test/testNBAPsystem.erl
index 402f16ab5d..1269f94060 100644
--- a/lib/asn1/test/testNBAPsystem.erl
+++ b/lib/asn1/test/testNBAPsystem.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2005-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -21,7 +21,7 @@
-export([compile/3,test/2,cell_setup_req_msg/0]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
-record('InitiatingMessage',{
procedureID, criticality, messageDiscriminator, transactionID, value}).
@@ -299,7 +299,7 @@ protocolIEs_051107() ->
compare(V,V) ->
ok;
-compare(V,L) when list(L) ->
+compare(V,L) when is_list(L) ->
compare(V,list_to_binary(L));
compare(_,_) ->
false.
diff --git a/lib/asn1/test/testOpenTypeImplicitTag.erl b/lib/asn1/test/testOpenTypeImplicitTag.erl
index 4300509e07..8662744ed3 100644
--- a/lib/asn1/test/testOpenTypeImplicitTag.erl
+++ b/lib/asn1/test/testOpenTypeImplicitTag.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2002-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2002-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -22,7 +22,7 @@
-export([compile/3]).
-export([main/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
compile(Config,Rules,Options) ->
diff --git a/lib/asn1/test/testOpt.erl b/lib/asn1/test/testOpt.erl
index 2967595fd2..a1ad8099b5 100644
--- a/lib/asn1/test/testOpt.erl
+++ b/lib/asn1/test/testOpt.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1997-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -22,7 +22,7 @@
-export([compile/2]).
-export([main/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
-record('Opt1',{bool0,
bool1 = asn1_NOVALUE,
diff --git a/lib/asn1/test/testParamBasic.erl b/lib/asn1/test/testParamBasic.erl
index 172a2881cd..4ba0029b54 100644
--- a/lib/asn1/test/testParamBasic.erl
+++ b/lib/asn1/test/testParamBasic.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2001-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -23,7 +23,7 @@
-export([compile_der/2]).
-export([main/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
-record('T11',{number, string=asn1_DEFAULT}).
-record('T12',{number, string=asn1_DEFAULT}).
diff --git a/lib/asn1/test/testParameterizedInfObj.erl b/lib/asn1/test/testParameterizedInfObj.erl
index 91d160f335..b95d627d58 100644
--- a/lib/asn1/test/testParameterizedInfObj.erl
+++ b/lib/asn1/test/testParameterizedInfObj.erl
@@ -22,7 +22,7 @@
-export([compile/3,main/1,ranap/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
-record('AllocationOrRetentionPriority',{priorityLevel,iE_Extensions}).
-record('ProtocolExtensionField',{id,criticality,extensionValue}).
diff --git a/lib/asn1/test/testPrim.erl b/lib/asn1/test/testPrim.erl
index 4ccdd82c13..97f99e7b1c 100644
--- a/lib/asn1/test/testPrim.erl
+++ b/lib/asn1/test/testPrim.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1997-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -28,7 +28,7 @@
-export([null/1]).
-export([real/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
diff --git a/lib/asn1/test/testPrimExternal.erl b/lib/asn1/test/testPrimExternal.erl
index 2a6384009a..23633177eb 100644
--- a/lib/asn1/test/testPrimExternal.erl
+++ b/lib/asn1/test/testPrimExternal.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1997-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -22,7 +22,7 @@
-export([compile/3]).
-export([external/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
compile(Config,Rules,Options) ->
diff --git a/lib/asn1/test/testPrimStrings.erl b/lib/asn1/test/testPrimStrings.erl
index 707ee375c1..33652d6554 100644
--- a/lib/asn1/test/testPrimStrings.erl
+++ b/lib/asn1/test/testPrimStrings.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1997-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -31,7 +31,7 @@
-export([times/1]).
-export([utf8_string/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
compile(Config,Rules,Option) ->
@@ -930,7 +930,7 @@ utf8_string(_Rules) ->
?line {ok,Bin13} = asn1_wrapper:decode('PrimStrings','UTF',Bytes13),
?line {ok,LongVal} = wrapper_utf8_binary_to_list(Bin13).
-wrapper_utf8_binary_to_list(L) when list(L) ->
+wrapper_utf8_binary_to_list(L) when is_list(L) ->
asn1rt:utf8_binary_to_list(list_to_binary(L));
wrapper_utf8_binary_to_list(B) ->
asn1rt:utf8_binary_to_list(B).
diff --git a/lib/asn1/test/testRANAP.erl b/lib/asn1/test/testRANAP.erl
index 7c35674d3a..52a58d850b 100644
--- a/lib/asn1/test/testRANAP.erl
+++ b/lib/asn1/test/testRANAP.erl
@@ -22,7 +22,7 @@
-export([compile/3,testobj/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
compile(Config,Erule,Options) ->
diff --git a/lib/asn1/test/testROSE.erl b/lib/asn1/test/testROSE.erl
index 65851e21fc..a692ec7682 100644
--- a/lib/asn1/test/testROSE.erl
+++ b/lib/asn1/test/testROSE.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2002-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2002-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -21,7 +21,7 @@
-export([compile/3]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
diff --git a/lib/asn1/test/testSSLspecs.erl b/lib/asn1/test/testSSLspecs.erl
index 87e5e5fd02..10623af51e 100644
--- a/lib/asn1/test/testSSLspecs.erl
+++ b/lib/asn1/test/testSSLspecs.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2004-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -22,7 +22,7 @@
-export([compile/3,run/1,compile_inline/2,run_inline/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
compile(Config,Rules,Options) ->
diff --git a/lib/asn1/test/testSelectionTypes.erl b/lib/asn1/test/testSelectionTypes.erl
index a3876c259e..893c31622f 100644
--- a/lib/asn1/test/testSelectionTypes.erl
+++ b/lib/asn1/test/testSelectionTypes.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2004-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -22,7 +22,7 @@
-export([compile/3]).
-export([test/0]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
compile(Config,Rule,Options) ->
diff --git a/lib/asn1/test/testSeq2738.erl b/lib/asn1/test/testSeq2738.erl
index 0f3c4b7bf7..9cf9c8fcb4 100644
--- a/lib/asn1/test/testSeq2738.erl
+++ b/lib/asn1/test/testSeq2738.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1999-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -22,7 +22,7 @@
-export([compile/3]).
-export([main/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
%-record('SeqOpt',{int, opt = asn1_NOVALUE}).
-record('SeqOptFake',{int, opt = asn1_NOVALUE}).
diff --git a/lib/asn1/test/testSeqDefault.erl b/lib/asn1/test/testSeqDefault.erl
index a626bfd645..edf07cf1c1 100644
--- a/lib/asn1/test/testSeqDefault.erl
+++ b/lib/asn1/test/testSeqDefault.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1997-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -23,7 +23,7 @@
-export([compile/3]).
-export([main/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
-record('SeqDef1',{bool1 = asn1_DEFAULT, int1, seq1 = asn1_DEFAULT}).
-record('SeqDef1Imp',{bool1 = asn1_DEFAULT, int1, seq1 = asn1_DEFAULT}).
diff --git a/lib/asn1/test/testSeqExtension.erl b/lib/asn1/test/testSeqExtension.erl
index 4ddaddb8f1..538e2c250b 100644
--- a/lib/asn1/test/testSeqExtension.erl
+++ b/lib/asn1/test/testSeqExtension.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1997-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -23,7 +23,7 @@
-export([compile/3]).
-export([main/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
-record('SeqExt1',{}).
-record('SeqExt2',{bool, int}).
diff --git a/lib/asn1/test/testSeqExternal.erl b/lib/asn1/test/testSeqExternal.erl
index f148d32b21..b89b98d3fa 100644
--- a/lib/asn1/test/testSeqExternal.erl
+++ b/lib/asn1/test/testSeqExternal.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1997-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -23,7 +23,7 @@
-export([compile/3]).
-export([main/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
-record('SeqXSet1',{set, bool, int}).
diff --git a/lib/asn1/test/testSeqIndefinite.erl b/lib/asn1/test/testSeqIndefinite.erl
index b1b622bdfa..9285d7b368 100644
--- a/lib/asn1/test/testSeqIndefinite.erl
+++ b/lib/asn1/test/testSeqIndefinite.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1999-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -22,7 +22,7 @@
-export([compile/3]).
-export([main/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
compile(Config,Rules,Options) ->
diff --git a/lib/asn1/test/testSeqOf.erl b/lib/asn1/test/testSeqOf.erl
index 71556ed746..961e2d89d9 100644
--- a/lib/asn1/test/testSeqOf.erl
+++ b/lib/asn1/test/testSeqOf.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1997-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -22,7 +22,7 @@
-export([compile/3]).
-export([main/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
-record('Seq1',{bool1, int1, seq1 = asn1_DEFAULT}).
-record('Seq2',{seq2 = asn1_DEFAULT, bool2, int2}).
diff --git a/lib/asn1/test/testSeqOfCho.erl b/lib/asn1/test/testSeqOfCho.erl
index eefb258346..05bd45580f 100644
--- a/lib/asn1/test/testSeqOfCho.erl
+++ b/lib/asn1/test/testSeqOfCho.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1997-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -22,7 +22,7 @@
-export([compile/3]).
-export([main/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
-record('SeqChoDef',{bool1, int1, seq1 = asn1_DEFAULT}).
-record('SeqChoOpt',{bool1, int1, seq1 = asn1_NOVALUE}).
diff --git a/lib/asn1/test/testSeqOfExternal.erl b/lib/asn1/test/testSeqOfExternal.erl
index dde36e6949..4c4c9e2b0f 100644
--- a/lib/asn1/test/testSeqOfExternal.erl
+++ b/lib/asn1/test/testSeqOfExternal.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1997-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -23,7 +23,7 @@
-export([compile/3]).
-export([main/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
-include("External.hrl").
-record('NT',{os, bool}).
diff --git a/lib/asn1/test/testSeqOfIndefinite.erl b/lib/asn1/test/testSeqOfIndefinite.erl
index 8e8967572a..0221581cf1 100644
--- a/lib/asn1/test/testSeqOfIndefinite.erl
+++ b/lib/asn1/test/testSeqOfIndefinite.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1999-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -22,7 +22,7 @@
-export([compile/3]).
-export([main/0]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
%-record('Seq1',{bool1, int1, seq1 = asn1_DEFAULT}).
%-record('Seq2',{seq2 = asn1_DEFAULT, bool2, int2}).
diff --git a/lib/asn1/test/testSeqOfTag.erl b/lib/asn1/test/testSeqOfTag.erl
index 0a4e1397a6..4f56ab717b 100644
--- a/lib/asn1/test/testSeqOfTag.erl
+++ b/lib/asn1/test/testSeqOfTag.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1997-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -23,7 +23,7 @@
-export([compile/3]).
-export([main/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
-include("External.hrl").
diff --git a/lib/asn1/test/testSeqOptional.erl b/lib/asn1/test/testSeqOptional.erl
index 7177011427..0125c9fb3e 100644
--- a/lib/asn1/test/testSeqOptional.erl
+++ b/lib/asn1/test/testSeqOptional.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1997-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -23,7 +23,7 @@
-export([compile/3]).
-export([main/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
-record('SeqOpt1',{bool1 = asn1_NOVALUE, int1, seq1 = asn1_NOVALUE}).
-record('SeqOpt1Imp',{bool1 = asn1_NOVALUE, int1, seq1 = asn1_NOVALUE}).
diff --git a/lib/asn1/test/testSeqPrim.erl b/lib/asn1/test/testSeqPrim.erl
index 7ad1de58a1..ec48d1b779 100644
--- a/lib/asn1/test/testSeqPrim.erl
+++ b/lib/asn1/test/testSeqPrim.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1997-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -22,7 +22,7 @@
-export([compile/3]).
-export([main/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
-record('Seq',{bool, boolCon, boolPri, boolApp, boolExpCon, boolExpPri, boolExpApp}).
-record('Empty',{}).
diff --git a/lib/asn1/test/testSeqSetDefaultVal.erl b/lib/asn1/test/testSeqSetDefaultVal.erl
index 1c238fd1b7..5a1a443ebc 100644
--- a/lib/asn1/test/testSeqSetDefaultVal.erl
+++ b/lib/asn1/test/testSeqSetDefaultVal.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2001-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -23,7 +23,7 @@
-export([compile/2]).
-export([main/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
-record('SeqInts',{a = asn1_DEFAULT,
b = asn1_DEFAULT,
diff --git a/lib/asn1/test/testSeqTag.erl b/lib/asn1/test/testSeqTag.erl
index ff6d1bbe91..60d3629840 100644
--- a/lib/asn1/test/testSeqTag.erl
+++ b/lib/asn1/test/testSeqTag.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1997-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -22,7 +22,7 @@
-export([compile/3]).
-export([main/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
-include("External.hrl").
-record('SeqTag',{nt, imp, exp}).
diff --git a/lib/asn1/test/testSeqTypeRefCho.erl b/lib/asn1/test/testSeqTypeRefCho.erl
index 03933d68ae..9262fd1bfd 100644
--- a/lib/asn1/test/testSeqTypeRefCho.erl
+++ b/lib/asn1/test/testSeqTypeRefCho.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1997-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -22,7 +22,7 @@
-export([compile/3]).
-export([main/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
-include("External.hrl").
-record('SeqTRcho',{seqCho, seqChoE, 'seqCho-E', 'seqChoE-E'}).
diff --git a/lib/asn1/test/testSeqTypeRefPrim.erl b/lib/asn1/test/testSeqTypeRefPrim.erl
index 264fc24f85..7d4c2acc0e 100644
--- a/lib/asn1/test/testSeqTypeRefPrim.erl
+++ b/lib/asn1/test/testSeqTypeRefPrim.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1997-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -22,7 +22,7 @@
-export([compile/3]).
-export([main/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
-record('SeqTR',{octStr, octStrI, octStrE, 'octStr-I', 'octStrI-I', 'octStrE-I', 'octStr-E', 'octStrI-E', 'octStrE-E'}).
diff --git a/lib/asn1/test/testSeqTypeRefSeq.erl b/lib/asn1/test/testSeqTypeRefSeq.erl
index b01c14ee32..51b0f13c57 100644
--- a/lib/asn1/test/testSeqTypeRefSeq.erl
+++ b/lib/asn1/test/testSeqTypeRefSeq.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1997-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -22,7 +22,7 @@
-export([compile/3]).
-export([main/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
-record('Seq1',{bool1, int1, seq1}).
-record('Seq2',{seq2, bool2, int2}).
diff --git a/lib/asn1/test/testSeqTypeRefSet.erl b/lib/asn1/test/testSeqTypeRefSet.erl
index 92d2cadf28..a704ce3403 100644
--- a/lib/asn1/test/testSeqTypeRefSet.erl
+++ b/lib/asn1/test/testSeqTypeRefSet.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1997-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -22,7 +22,7 @@
-export([compile/3]).
-export([main/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
-record('SeqTRset',{seqSet, seqSetI, seqSetE, 'seqSet-I', 'seqSetI-I', 'seqSetE-I', 'seqSet-E', 'seqSetI-E', 'seqSetE-E'}).
-record('SeqSet',{setInt, setOs}).
diff --git a/lib/asn1/test/testSetDefault.erl b/lib/asn1/test/testSetDefault.erl
index e4b6a0ab82..e36894327c 100644
--- a/lib/asn1/test/testSetDefault.erl
+++ b/lib/asn1/test/testSetDefault.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1997-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -22,7 +22,7 @@
-export([compile/3]).
-export([main/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
-record('SetDef1',{bool1 = asn1_DEFAULT, int1, set1 = asn1_DEFAULT}).
-record('SetDef2',{set2 = asn1_DEFAULT, bool2, int2}).
diff --git a/lib/asn1/test/testSetExtension.erl b/lib/asn1/test/testSetExtension.erl
index 85a84e020a..c7fb3b42c4 100644
--- a/lib/asn1/test/testSetExtension.erl
+++ b/lib/asn1/test/testSetExtension.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1997-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -24,7 +24,7 @@
-export([compile/3]).
-export([main/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
-record('SetExt1',{}).
-record('SetExt2',{bool, int}).
diff --git a/lib/asn1/test/testSetExternal.erl b/lib/asn1/test/testSetExternal.erl
index 83974a5499..41f32dcd90 100644
--- a/lib/asn1/test/testSetExternal.erl
+++ b/lib/asn1/test/testSetExternal.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1997-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -23,7 +23,7 @@
-export([compile/3]).
-export([main/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
-record('SetXSeq1',{seq, bool, int}).
diff --git a/lib/asn1/test/testSetIndefinite.erl b/lib/asn1/test/testSetIndefinite.erl
index 0e6a86bac4..bf8b242860 100644
--- a/lib/asn1/test/testSetIndefinite.erl
+++ b/lib/asn1/test/testSetIndefinite.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1999-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -22,7 +22,7 @@
-export([compile/3]).
-export([main/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
compile(Config,Rules,Options) ->
diff --git a/lib/asn1/test/testSetOf.erl b/lib/asn1/test/testSetOf.erl
index fe68a0705a..0769b9a344 100644
--- a/lib/asn1/test/testSetOf.erl
+++ b/lib/asn1/test/testSetOf.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1997-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -22,7 +22,7 @@
-export([compile/3]).
-export([main/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
-record('Set1',{bool1, int1, set1 = asn1_DEFAULT}).
-record('Set2',{set2 = asn1_DEFAULT, bool2, int2}).
diff --git a/lib/asn1/test/testSetOfCho.erl b/lib/asn1/test/testSetOfCho.erl
index f3164273f6..474742fbdb 100644
--- a/lib/asn1/test/testSetOfCho.erl
+++ b/lib/asn1/test/testSetOfCho.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1997-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -22,7 +22,7 @@
-export([compile/3]).
-export([main/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
-record('SetChoDef',{bool1, int1, set1 = asn1_DEFAULT}).
-record('SetChoOpt',{bool1, int1, set1 = asn1_NOVALUE}).
diff --git a/lib/asn1/test/testSetOfExternal.erl b/lib/asn1/test/testSetOfExternal.erl
index 1c59ad0a74..9e2b01c698 100644
--- a/lib/asn1/test/testSetOfExternal.erl
+++ b/lib/asn1/test/testSetOfExternal.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1997-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -23,7 +23,7 @@
-export([compile/3]).
-export([main/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
-include("External.hrl").
-record('NT',{os, bool}).
diff --git a/lib/asn1/test/testSetOfTag.erl b/lib/asn1/test/testSetOfTag.erl
index ff59a329e3..c101306d7a 100644
--- a/lib/asn1/test/testSetOfTag.erl
+++ b/lib/asn1/test/testSetOfTag.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1997-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -23,7 +23,7 @@
-export([compile/3]).
-export([main/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
-include("External.hrl").
diff --git a/lib/asn1/test/testSetOptional.erl b/lib/asn1/test/testSetOptional.erl
index 3df1ed58bb..035fa70424 100644
--- a/lib/asn1/test/testSetOptional.erl
+++ b/lib/asn1/test/testSetOptional.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1997-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -23,7 +23,7 @@
-export([compile/3]).
-export([main/1]).
-export([ticket_7533/1,decoder/4]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
-record('SetOpt1',{bool1 = asn1_NOVALUE, int1, set1 = asn1_NOVALUE}).
-record('SetOpt1Imp',{bool1 = asn1_NOVALUE, int1, set1 = asn1_NOVALUE}).
diff --git a/lib/asn1/test/testSetPrim.erl b/lib/asn1/test/testSetPrim.erl
index cb64011dcc..e093c918e3 100644
--- a/lib/asn1/test/testSetPrim.erl
+++ b/lib/asn1/test/testSetPrim.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1997-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -22,7 +22,7 @@
-export([compile/3]).
-export([main/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
-record('Set',{bool, boolCon, boolPri, boolApp, boolExpCon, boolExpPri, boolExpApp}).
-record('Empty',{}).
diff --git a/lib/asn1/test/testSetTag.erl b/lib/asn1/test/testSetTag.erl
index fcf15dc0f0..8df3e36815 100644
--- a/lib/asn1/test/testSetTag.erl
+++ b/lib/asn1/test/testSetTag.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1997-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -22,7 +22,7 @@
-export([compile/3]).
-export([main/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
-include("External.hrl").
-record('SetTag',{nt, imp, exp}).
diff --git a/lib/asn1/test/testSetTypeRefCho.erl b/lib/asn1/test/testSetTypeRefCho.erl
index c2dbf076bd..1f68a8fbc4 100644
--- a/lib/asn1/test/testSetTypeRefCho.erl
+++ b/lib/asn1/test/testSetTypeRefCho.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1997-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -22,7 +22,7 @@
-export([compile/3]).
-export([main/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
-include("External.hrl").
-record('SetTRcho',{setCho, setChoE, 'setCho-E', 'setChoE-E'}).
diff --git a/lib/asn1/test/testSetTypeRefPrim.erl b/lib/asn1/test/testSetTypeRefPrim.erl
index 1f95947168..e6cec260e5 100644
--- a/lib/asn1/test/testSetTypeRefPrim.erl
+++ b/lib/asn1/test/testSetTypeRefPrim.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1997-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -22,7 +22,7 @@
-export([compile/3]).
-export([main/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
-record('SetTR',{octStr, octStrI, octStrE, 'octStr-I', 'octStrI-I', 'octStrE-I', 'octStr-E', 'octStrI-E', 'octStrE-E'}).
diff --git a/lib/asn1/test/testSetTypeRefSeq.erl b/lib/asn1/test/testSetTypeRefSeq.erl
index 2f6dfec9c6..0c1c9400bf 100644
--- a/lib/asn1/test/testSetTypeRefSeq.erl
+++ b/lib/asn1/test/testSetTypeRefSeq.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1997-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -22,7 +22,7 @@
-export([compile/3]).
-export([main/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
-record('SetTRseq',{setSeq, setSeqI, setSeqE, 'setSeq-I', 'setSeqI-I', 'setSeqE-I', 'setSeq-E', 'setSeqI-E', 'setSeqE-E'}).
-record('SetSeq',{seqInt, seqOs}).
diff --git a/lib/asn1/test/testSetTypeRefSet.erl b/lib/asn1/test/testSetTypeRefSet.erl
index 132e5fb3f5..6544e77458 100644
--- a/lib/asn1/test/testSetTypeRefSet.erl
+++ b/lib/asn1/test/testSetTypeRefSet.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1997-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -22,7 +22,7 @@
-export([compile/3]).
-export([main/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
-record('Set1',{bool1, int1, set1}).
-record('Set2',{set2, bool2, int2}).
diff --git a/lib/asn1/test/testTCAP.erl b/lib/asn1/test/testTCAP.erl
index 3e2c2de371..5e29938a16 100644
--- a/lib/asn1/test/testTCAP.erl
+++ b/lib/asn1/test/testTCAP.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2003-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2003-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -21,7 +21,7 @@
-export([compile/3,test/2,compile_asn1config/3,test_asn1config/0]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
diff --git a/lib/asn1/test/testTcapsystem.erl b/lib/asn1/test/testTcapsystem.erl
index c48b1b835d..2f13c11cd4 100644
--- a/lib/asn1/test/testTcapsystem.erl
+++ b/lib/asn1/test/testTcapsystem.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2004-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -21,7 +21,7 @@
-export([compile/3]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
diff --git a/lib/asn1/test/testTimer.erl b/lib/asn1/test/testTimer.erl
index 0fade7ebca..74002e16e9 100644
--- a/lib/asn1/test/testTimer.erl
+++ b/lib/asn1/test/testTimer.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2001-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -22,7 +22,7 @@
-compile(export_all).
%%-export([Function/Arity, ...]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
-define(times, 5000).
@@ -146,7 +146,7 @@ go(Config,Enc) ->
Bytes = case Enc of
ber_bin ->
list_to_binary(B);
- per_bin when list(B) ->
+ per_bin when is_list(B) ->
list_to_binary(B);
per_bin ->
B;
@@ -179,7 +179,7 @@ encode(0, _Module,_Type,_Value) ->
encode(N, Module,Type,Value) ->
?line {ok,B} = asn1rt:encode(Module,Type,Value),
_B2 = if
- list(B) -> list_to_binary(B);
+ is_list(B) -> list_to_binary(B);
true -> B
end,
encode(N-1, Module,Type,Value).
diff --git a/lib/asn1/test/testTypeValueNotation.erl b/lib/asn1/test/testTypeValueNotation.erl
index 0fc3dc3197..f0699370e0 100644
--- a/lib/asn1/test/testTypeValueNotation.erl
+++ b/lib/asn1/test/testTypeValueNotation.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2002-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2002-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -22,7 +22,7 @@
-export([compile/3]).
-export([main/2]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
-record('Seq',{octstr, int, bool, enum, bitstr, null, oid, vstr}).
diff --git a/lib/asn1/test/testX420.erl b/lib/asn1/test/testX420.erl
index 0fa3e6fb13..1d18e76c48 100644
--- a/lib/asn1/test/testX420.erl
+++ b/lib/asn1/test/testX420.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2008-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -23,7 +23,7 @@
-export([compile/3, ticket7759/2]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
compile(Erule,Options,Config) ->
@@ -50,7 +50,7 @@ compile_loop(Erule,[Spec|Specs],Options,Config)
Error ->
Error
end;
-compile_loop(Erule,_Specs,_Options,_Config) ->
+compile_loop(_Erule,_Specs,_Options,_Config) ->
ok.%%{skip,io_lib:format("Not tested for ~p",[Erule])}.
diff --git a/lib/asn1/test/test_bad_values.erl b/lib/asn1/test/test_bad_values.erl
index 0190b6ee9a..d379a509ab 100644
--- a/lib/asn1/test/test_bad_values.erl
+++ b/lib/asn1/test/test_bad_values.erl
@@ -1,26 +1,26 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2005-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
-module(test_bad_values).
-export([tests/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
tests(Config) ->
?line DataDir = ?config(data_dir,Config),
diff --git a/lib/asn1/test/test_compile_options.erl b/lib/asn1/test/test_compile_options.erl
index a6e0caa0f1..d51b2a6c4a 100644
--- a/lib/asn1/test/test_compile_options.erl
+++ b/lib/asn1/test/test_compile_options.erl
@@ -1,26 +1,26 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2005-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
-module(test_compile_options).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
-export([wrong_path/1,comp/2,path/1,ticket_6143/1,noobj/1,
diff --git a/lib/asn1/test/test_driver_load.erl b/lib/asn1/test/test_driver_load.erl
index 37a7e36a45..965f2473e9 100644
--- a/lib/asn1/test/test_driver_load.erl
+++ b/lib/asn1/test/test_driver_load.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2003-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2003-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -21,7 +21,7 @@
-export([compile/2,test/2,encode/0]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
test(per_bin,0) ->
diff --git a/lib/asn1/test/test_inline.erl b/lib/asn1/test/test_inline.erl
index aac003baf6..dfa3c134ae 100644
--- a/lib/asn1/test/test_inline.erl
+++ b/lib/asn1/test/test_inline.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2004-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -23,7 +23,7 @@
-export([mvrasn_inlined_encdec/2,mvrasn_encdec/2,
mi_encdec/2,m_encdec/2]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
-define(times, 5000).
-define(times2, 50000).
diff --git a/lib/asn1/test/test_modified_x420.erl b/lib/asn1/test/test_modified_x420.erl
index 93fcd73eaf..4e96db070b 100644
--- a/lib/asn1/test/test_modified_x420.erl
+++ b/lib/asn1/test/test_modified_x420.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2008-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -22,7 +22,7 @@
%-compile(export_all).
-export([compile/1, test_io/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
compile(Config) ->
?line DataDir = ?config(data_dir,Config),
diff --git a/lib/asn1/test/test_partial_incomplete_decode.erl b/lib/asn1/test/test_partial_incomplete_decode.erl
index 9fd078e952..a2e0a96bd8 100644
--- a/lib/asn1/test/test_partial_incomplete_decode.erl
+++ b/lib/asn1/test/test_partial_incomplete_decode.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2003-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2003-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -21,7 +21,7 @@
-export([compile/3,test/2]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
diff --git a/lib/asn1/test/test_selective_decode.erl b/lib/asn1/test/test_selective_decode.erl
index 94d3d5f34a..e1e101b622 100644
--- a/lib/asn1/test/test_selective_decode.erl
+++ b/lib/asn1/test/test_selective_decode.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2003-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2003-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -21,7 +21,7 @@
-export([test/2]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
test(ber_bin_v2,_Config) ->
diff --git a/lib/asn1/test/test_special_decode_performance.erl b/lib/asn1/test/test_special_decode_performance.erl
index c451d65172..60a95a3675 100644
--- a/lib/asn1/test/test_special_decode_performance.erl
+++ b/lib/asn1/test/test_special_decode_performance.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2003-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2003-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -21,7 +21,7 @@
-export([compile/2,go/1,loop2/4,loop1/5]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
compile(Config,Rule) when Rule==ber_bin_v2 ->
diff --git a/lib/asn1/test/test_undecoded_rest.erl b/lib/asn1/test/test_undecoded_rest.erl
index c7762d28f7..647fe2bb1c 100644
--- a/lib/asn1/test/test_undecoded_rest.erl
+++ b/lib/asn1/test/test_undecoded_rest.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2004-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -21,7 +21,7 @@
-export([compile/3,test/1]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
%% testing OTP-5104
@@ -39,10 +39,10 @@ test(Opt) ->
?line {ok,Msg} = asn1ct:value('P-Record','PersonnelRecord'),
?line {ok,Bytes} = asn1_wrapper:encode('P-Record','PersonnelRecord',Msg),
Bytes2 =
- fun(B) when list(B) ->
+ fun(B) when is_list(B) ->
B ++ [55,55,55];
- (B) when binary(B) ->
- concat_binary([B,<<55,55,55>>])
+ (B) when is_binary(B) ->
+ iolist_to_binary([B,<<55,55,55>>])
end (Bytes),
case Opt of
diff --git a/lib/asn1/test/test_x691.erl b/lib/asn1/test/test_x691.erl
index 5bf3a4a077..bc8a3495d8 100644
--- a/lib/asn1/test/test_x691.erl
+++ b/lib/asn1/test/test_x691.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2008-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -22,7 +22,7 @@
-export([compile/3]).
-export([cases/2]).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
compile(Config,Rules,Option) ->
diff --git a/lib/compiler/src/v3_life.erl b/lib/compiler/src/v3_life.erl
index 0adeaca8fa..8e6b153d57 100644
--- a/lib/compiler/src/v3_life.erl
+++ b/lib/compiler/src/v3_life.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1999-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%% Purpose : Convert annotated kernel expressions to annotated beam format.
@@ -66,21 +66,27 @@ functions([], Acc) -> reverse(Acc).
%% function(Kfunc) -> Func.
function(#k_fdef{func=F,arity=Ar,vars=Vs,body=Kb}) ->
- %ok = io:fwrite("life ~w: ~p~n~p~n", [?LINE,{F,Ar},Kb]),
- As = var_list(Vs),
- Vdb0 = foldl(fun ({var,N}, Vdb) -> new_var(N, 0, Vdb) end, [], As),
- %% Force a top-level match!
- B0 = case Kb of
- #k_match{} -> Kb;
- _ ->
- Ka = get_kanno(Kb),
- #k_match{anno=#k{us=Ka#k.us,ns=[],a=Ka#k.a},
- vars=Vs,body=Kb,ret=[]}
- end,
- put(guard_refc, 0),
- {B1,_,Vdb1} = body(B0, 1, Vdb0),
- erase(guard_refc),
- {function,F,Ar,As,B1,Vdb1}.
+ try
+ As = var_list(Vs),
+ Vdb0 = foldl(fun ({var,N}, Vdb) -> new_var(N, 0, Vdb) end, [], As),
+ %% Force a top-level match!
+ B0 = case Kb of
+ #k_match{} -> Kb;
+ _ ->
+ Ka = get_kanno(Kb),
+ #k_match{anno=#k{us=Ka#k.us,ns=[],a=Ka#k.a},
+ vars=Vs,body=Kb,ret=[]}
+ end,
+ put(guard_refc, 0),
+ {B1,_,Vdb1} = body(B0, 1, Vdb0),
+ erase(guard_refc),
+ {function,F,Ar,As,B1,Vdb1}
+ catch
+ Class:Error ->
+ Stack = erlang:get_stacktrace(),
+ io:fwrite("Function: ~w/~w\n", [F,Ar]),
+ erlang:raise(Class, Error, Stack)
+ end.
%% body(Kbody, I, Vdb) -> {[Expr],MaxI,Vdb}.
%% Handle a body, need special cases for transforming match_fails.
diff --git a/lib/cosTransactions/doc/src/ch_example.xml b/lib/cosTransactions/doc/src/ch_example.xml
index 65350166f0..026bfc467e 100644
--- a/lib/cosTransactions/doc/src/ch_example.xml
+++ b/lib/cosTransactions/doc/src/ch_example.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1999</year><year>2009</year>
+ <year>1999</year><year>2010</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -13,12 +13,12 @@
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at http://www.erlang.org/.
-
+
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitations
under the License.
-
+
</legalnotice>
<title>cosTransactions Examples</title>
@@ -83,7 +83,9 @@ module ownResourceImpl {
<item><c>commit_one_phase/1</c> - if possible, the Resource should commit all changes made as part of the transaction.
This operation can only be used if the Resource is the only child of its parent. </item>
<item><c>forget/1</c> - this operation informs the Resource that it is safe to forget any
- <term id="Heuristic decisions"><termdef>Heuristic decisions is a unilateral decision by a participant to commit or rollback without receiving the true outcome of the transaction from its parents coordinator.</termdef></term>and the knowledge of the transaction.</item>
+ <term id="Heuristic decisions"><termdef>Heuristic decisions is a unilateral decision by a participant to commit
+ or rollback without receiving the true outcome of the transaction from its parent's coordinator.</termdef></term>
+ and the knowledge of the transaction.</item>
<item><c>ownFunctions</c> - all application specific operations.</item>
</list>
<p>If the participant wants to be notified when a subtransaction commits, we must also implement the following operations
diff --git a/lib/erl_interface/doc/src/ei.xml b/lib/erl_interface/doc/src/ei.xml
index 2f65a8c375..9083ae02b0 100644
--- a/lib/erl_interface/doc/src/ei.xml
+++ b/lib/erl_interface/doc/src/ei.xml
@@ -4,7 +4,7 @@
<cref>
<header>
<copyright>
- <year>2001</year><year>2009</year>
+ <year>2001</year><year>2010</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -13,12 +13,12 @@
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at http://www.erlang.org/.
-
+
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitations
under the License.
-
+
</legalnotice>
<title>ei</title>
@@ -333,7 +333,7 @@ ei_encode_tuple_header(buf, &amp;i, 0);
<desc>
<p>This function encodes a list header, with a specified
arity. The next <c><![CDATA[arity+1]]></c> terms are the elements
- (actually it's <c><![CDATA[arity]]></c> cons cells) and the tail of the
+ (actually its <c><![CDATA[arity]]></c> cons cells) and the tail of the
list. Lists and tuples are encoded recursively, so that a
list may contain another list or tuple.</p>
<p>E.g. to encode the list <c><![CDATA[[c, d, [e | f]]]]></c>:</p>
diff --git a/lib/erl_interface/doc/src/erl_call.xml b/lib/erl_interface/doc/src/erl_call.xml
index 2d88e7616a..c597e11481 100644
--- a/lib/erl_interface/doc/src/erl_call.xml
+++ b/lib/erl_interface/doc/src/erl_call.xml
@@ -4,7 +4,7 @@
<comref>
<header>
<copyright>
- <year>1996</year><year>2009</year>
+ <year>1996</year><year>2010</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -13,12 +13,12 @@
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at http://www.erlang.org/.
-
+
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitations
under the License.
-
+
</legalnotice>
<title>erl_call</title>
@@ -61,7 +61,7 @@
<item>
<p>(<em>optional</em>): Applies the specified function
and returns the result. <c><![CDATA[Mod]]></c> must be specified, however
- <em>[]</em> is assumed for unspecified <c><![CDATA[Fun]]></c> and <c><![CDATA[Args]]></c>. <c><![CDATA[Args]]></c> should
+ <c>start</c> and <c>[]</c> are assumed for unspecified <c><![CDATA[Fun]]></c> and <c><![CDATA[Args]]></c>, respectively. <c><![CDATA[Args]]></c> should
be in the same format as for <c><![CDATA[erlang:apply/3]]></c>. Note
that this flag takes exactly one argument, so quoting
may be necessary in order to group <c><![CDATA[Mod]]></c>, <c><![CDATA[Fun]]></c>
diff --git a/lib/hipe/cerl/erl_bif_types.erl b/lib/hipe/cerl/erl_bif_types.erl
index 38342870e5..81ca837e45 100644
--- a/lib/hipe/cerl/erl_bif_types.erl
+++ b/lib/hipe/cerl/erl_bif_types.erl
@@ -4534,7 +4534,7 @@ t_decode_packet_option() ->
t_tuple([t_atom('line_length'), t_non_neg_integer()])]).
t_decode_packet_type() ->
- t_sup(t_inet_setoption_packettype(), t_atom('httph')).
+ t_sup([t_inet_setoption_packettype(), t_atom('httph'), t_atom('httph_bin')]).
t_dist_exit() ->
t_sup([t_atom('kill'), t_atom('noconnection'), t_atom('normal')]).
diff --git a/lib/ic/doc/src/ch_c_mapping.xml b/lib/ic/doc/src/ch_c_mapping.xml
index f5a921bfd2..23a9361c2c 100644
--- a/lib/ic/doc/src/ch_c_mapping.xml
+++ b/lib/ic/doc/src/ch_c_mapping.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1998</year><year>2009</year>
+ <year>1998</year><year>2010</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -13,12 +13,12 @@
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at http://www.erlang.org/.
-
+
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitations
under the License.
-
+
</legalnotice>
<title>IDL to C mapping</title>
@@ -804,7 +804,7 @@ CORBA_Environment* oe_env)
octets</p>
</item>
</list>
- <p>The erlang binary IDL type is defined in <c>erlang.idl</c>, while it's
+ <p>The erlang binary IDL type is defined in <c>erlang.idl</c>, while its
C definition is located in the <c>ic.h</c> header file, both in the
<c><![CDATA[IC-< vsn >/include]]></c> directory.
The user will have to include the file <c>erlang.idl</c> in order to use the
diff --git a/lib/inets/doc/src/http_server.xml b/lib/inets/doc/src/http_server.xml
index 547617e2e3..01e0b47d37 100644
--- a/lib/inets/doc/src/http_server.xml
+++ b/lib/inets/doc/src/http_server.xml
@@ -357,7 +357,7 @@ UserName:Password
<p>The mod_cgi module makes it possible to execute CGI scripts
in the server. A file that matches the definition of a
ScriptAlias config directive is treated as a CGI script. A CGI
- script is executed by the server and it's output is returned to
+ script is executed by the server and its output is returned to
the client. </p>
<p>The CGI Script response comprises a message-header and a
message-body, separated by a blank line. The message-header
diff --git a/lib/inets/doc/src/httpc.xml b/lib/inets/doc/src/httpc.xml
index ca93190f61..7430a62b1b 100644
--- a/lib/inets/doc/src/httpc.xml
+++ b/lib/inets/doc/src/httpc.xml
@@ -191,7 +191,8 @@ ssl_options() = {verify, code()} |
<v>Result = {status_line(), headers(), body()} |
{status_code(), body()} | request_id() </v>
<v>Profile = profile() </v>
- <v>Reason = term() </v>
+ <v>Reason = {connect_failed, term()} |
+ {send_failed, term()} | term() </v>
</type>
<desc>
diff --git a/lib/inets/doc/src/httpd_util.xml b/lib/inets/doc/src/httpd_util.xml
index 642e5213b0..6ac2b13c72 100644
--- a/lib/inets/doc/src/httpd_util.xml
+++ b/lib/inets/doc/src/httpd_util.xml
@@ -63,7 +63,7 @@
<v>Etag = string()</v>
</type>
<desc>
- <p><c>create_etag/1</c> calculates the Etag for a file, from it's
+ <p><c>create_etag/1</c> calculates the Etag for a file, from its
size and time for last modification. fileinfo is a record defined
in <c>kernel/include/file.hrl</c></p>
@@ -78,7 +78,7 @@
<v>HexValue = DecValue = string()</v>
</type>
<desc>
- <p>Converts the hexadecimal value <c>HexValue</c> into it's
+ <p>Converts the hexadecimal value <c>HexValue</c> into its
decimal equivalent (<c>DecValue</c>).</p>
<marker id="day"></marker>
diff --git a/lib/inets/doc/src/mod_security.xml b/lib/inets/doc/src/mod_security.xml
index 5f9f88071e..2a871d29d8 100644
--- a/lib/inets/doc/src/mod_security.xml
+++ b/lib/inets/doc/src/mod_security.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1998</year><year>2009</year>
+ <year>1998</year><year>2010</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -13,12 +13,12 @@
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at http://www.erlang.org/.
-
+
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitations
under the License.
-
+
</legalnotice>
<title>mod_security</title>
@@ -117,11 +117,14 @@
<section>
<marker id="callback_module"></marker>
<title>The SecurityCallbackModule</title>
- <p>The SecurityCallbackModule is a user written module that can receive events from
- the mod_security Erlang Webserver API module. This module only exports one function,
- <seealso marker="#callback_module_event">event/4</seealso>, which is described below.
+ <p>The SecurityCallbackModule is a user written module that can receive
+ events from the mod_security Erlang Webserver API module.
+ This module only exports the function(s),
+ <seealso marker="#callback_module_event">event/4,5</seealso>,
+ which are described below.
</p>
</section>
+
<funcs>
<func>
<name>event(What, Port, Dir, Data) -> ignored</name>
@@ -131,7 +134,7 @@
<v>What = atom()</v>
<v>Port = integer()</v>
<v>Address = {A,B,C,D} | string() &lt;v>Dir = string()</v>
- <v>What = [Info]</v>
+ <v>Data = [Info]</v>
<v>Info = {Name, Value}</v>
</type>
<desc>
diff --git a/lib/inets/doc/src/notes.xml b/lib/inets/doc/src/notes.xml
index 0c524f00d1..762c2c84c5 100644
--- a/lib/inets/doc/src/notes.xml
+++ b/lib/inets/doc/src/notes.xml
@@ -32,6 +32,70 @@
<file>notes.xml</file>
</header>
+ <section><title>Inets 5.3.1</title>
+
+ <section><title>Improvements and New Features</title>
+ <p>-</p>
+
+<!--
+ <list>
+ <item>
+ <p>[httpc] - Allow users to pass socket options to the transport
+ module when making requests. </p>
+ <p>See the <c>socket_opts</c> option in the
+ <seealso marker="httpc#request2">request/4</seealso> or
+ <seealso marker="httpc#set_options">set_options/1,2</seealso>
+ for more info, </p>
+ <p>Own Id: OTP-8352</p>
+ </item>
+
+ </list>
+-->
+ </section>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+
+<!--
+ <p>-</p>
+-->
+
+ <list>
+ <item>
+ <p>[httpc] - Badly formated error reason for errors occuring
+ during initial connect to a server.
+ Also, the possible error reasons was
+ not properly documented.</p>
+ <p>Own Id: OTP-8508</p>
+ <p>Aux Id: seq11407</p>
+ </item>
+
+ <item>
+ <p>[httpd] - Issues with ESI erl_script_timeout. </p>
+ <p>
+ <list type="bulleted">
+ <item>
+ <p>The <c>erl_script_timeout</c> config option is ducumented
+ as a number of seconds. But when parsing the config, in the
+ new format (not a config file), it was handled as if in
+ number of milliseconds. </p>
+ </item>
+ <item>
+ <p>When the erl-script-timeout time was exceeded, the server
+ incorrectly marked the answer as sent, thereby leaving
+ client hanging (with an incomplete answer).
+ This has been changed, so that now the socket will be
+ closed. </p>
+ </item>
+ </list>
+ </p>
+ <p>Own Id: OTP-8509</p>
+ </item>
+ </list>
+ </section>
+
+ </section> <!-- 5.3.1 -->
+
+
<section><title>Inets 5.3</title>
<section><title>Improvements and New Features</title>
diff --git a/lib/inets/src/http_client/httpc_handler.erl b/lib/inets/src/http_client/httpc_handler.erl
index 31585537d4..695ff9cf82 100644
--- a/lib/inets/src/http_client/httpc_handler.erl
+++ b/lib/inets/src/http_client/httpc_handler.erl
@@ -280,7 +280,7 @@ handle_call({connect_and_send, #request{address = Address0,
{ok, NewState} ->
{reply, ok, NewState};
{stop, Error, NewState} ->
- {stop, Error, Error, NewState}
+ {stop, normal, Error, NewState}
end
end;
@@ -675,6 +675,24 @@ handle_info({'EXIT', _, _}, State) ->
%%--------------------------------------------------------------------
%% Init error there is no socket to be closed.
+terminate(normal,
+ #state{request = Request,
+ session = {send_failed, AReason} = Reason} = State) ->
+ ?hcrd("terminate", [{send_reason, AReason}, {request, Request}]),
+ maybe_send_answer(Request,
+ httpc_response:error(Request, Reason),
+ State),
+ ok;
+
+terminate(normal,
+ #state{request = Request,
+ session = {connect_failed, AReason} = Reason} = State) ->
+ ?hcrd("terminate", [{connect_reason, AReason}, {request, Request}]),
+ maybe_send_answer(Request,
+ httpc_response:error(Request, Reason),
+ State),
+ ok;
+
terminate(normal, #state{session = undefined}) ->
ok;
@@ -886,18 +904,17 @@ connect_and_send_first_request(Address,
NewState = activate_request_timeout(TmpState),
{ok, NewState};
- {error, Reason} ->
+ {error, Reason} = Error ->
?hcrv("failed sending request", [{reason, Reason}]),
- Error = {error, {send_failed,
- httpc_response:error(Request, Reason)}},
- {stop, Error, State#state{request = Request}}
+ {stop, Error,
+ State#state{session = {send_failed, Reason},
+ request = Request}}
end;
- {error, Reason} ->
+ {error, Reason} = Error ->
?hcri("connect failed", [{reason, Reason}]),
- Error = {error, {connect_failed,
- httpc_response:error(Request, Reason)}},
- {stop, Error, State#state{request = Request}}
+ {stop, Error, State#state{session = {connect_failed, Reason},
+ request = Request}}
end.
diff --git a/lib/inets/src/http_server/httpd_conf.erl b/lib/inets/src/http_server/httpd_conf.erl
index 3e498d1db7..5ca2e47eb5 100644
--- a/lib/inets/src/http_server/httpd_conf.erl
+++ b/lib/inets/src/http_server/httpd_conf.erl
@@ -354,7 +354,7 @@ load("DocumentRoot " ++ DocumentRoot,[]) ->
{ok, Directory} ->
{ok, [], {document_root,string:strip(Directory,right,$/)}};
{error, _} ->
- {error, ?NICE(clean(DocumentRoot)++"is an invalid DocumentRoot")}
+ {error, ?NICE(clean(DocumentRoot)++" is an invalid DocumentRoot")}
end;
load("DefaultType " ++ DefaultType, []) ->
{ok, [], {default_type,clean(DefaultType)}};
diff --git a/lib/inets/src/http_server/mod_esi.erl b/lib/inets/src/http_server/mod_esi.erl
index 484d4b3fb4..cb33544540 100644
--- a/lib/inets/src/http_server/mod_esi.erl
+++ b/lib/inets/src/http_server/mod_esi.erl
@@ -33,6 +33,7 @@
-define(VMODULE,"ESI").
-define(DEFAULT_ERL_TIMEOUT,15000).
+
%%%=========================================================================
%%% API
%%%=========================================================================
@@ -52,6 +53,7 @@ deliver(SessionID, Data) when is_pid(SessionID) ->
deliver(_SessionID, _Data) ->
{error, bad_sessionID}.
+
%%%=========================================================================
%%% CALLBACK API
%%%=========================================================================
@@ -74,6 +76,8 @@ do(ModData) ->
{proceed, ModData#mod.data}
end
end.
+
+
%%--------------------------------------------------------------------------
%% load(Line, Context) -> eof | ok | {ok, NewContext} |
%% {ok, NewContext, Directive} |
@@ -127,6 +131,7 @@ load("ErlScriptNoCache " ++ CacheArg, [])->
" is an invalid ErlScriptNoCache directive")}
end.
+
%%--------------------------------------------------------------------------
%% store(Directive, DirectiveList) -> {ok, NewDirective} |
%% {ok, [NewDirective]} |
@@ -163,16 +168,18 @@ store({eval_script_alias, {Name, Modules}} = Conf, _)
store({erl_script_alias, Value}, _) ->
{error, {wrong_type, {erl_script_alias, Value}}};
-store({erl_script_timeout, Value} = Conf, _)
- when is_integer(Value), Value >= 0 ->
- {ok, Conf};
+store({erl_script_timeout, TimeoutSec}, _)
+ when is_integer(TimeoutSec) andalso (TimeoutSec >= 0) ->
+ {ok, {erl_script_timeout, TimeoutSec * 1000}};
store({erl_script_timeout, Value}, _) ->
{error, {wrong_type, {erl_script_timeout, Value}}};
-store({erl_script_nocache, Value} = Conf, _) when Value == true;
- Value == false ->
+store({erl_script_nocache, Value} = Conf, _)
+ when (Value =:= true) orelse (Value =:= false) ->
{ok, Conf};
store({erl_script_nocache, Value}, _) ->
{error, {wrong_type, {erl_script_nocache, Value}}}.
+
+
%%%========================================================================
%%% Internal functions
%%%========================================================================
@@ -227,7 +234,7 @@ alias_match_str(Alias, eval_script_alias) ->
%%------------------------ Erl mechanism --------------------------------
erl(#mod{method = Method} = ModData, ESIBody, Modules)
- when Method == "GET"; Method == "HEAD"->
+ when (Method =:= "GET") orelse (Method =:= "HEAD") ->
case httpd_util:split(ESIBody,":|%3A|/",2) of
{ok, [ModuleName, FuncAndInput]} ->
case httpd_util:split(FuncAndInput,"[\?/]",2) of
@@ -347,7 +354,7 @@ erl_scheme_webpage_chunk(Mod, Func, Env, Input, ModData) ->
Pid = spawn_link(
fun() ->
case catch Mod:Func(Self, Env, Input) of
- {'EXIT',{undef,_}} ->
+ {'EXIT', {undef,_}} ->
%% Will force fallback on the old API
exit(erl_scheme_webpage_chunk_undefined);
_ ->
@@ -430,11 +437,12 @@ handle_body(Pid, ModData, Body, Timeout, Size, IsDisableChunkedSend) ->
{proceed, [{response, {already_sent, 200, Size}} |
ModData#mod.data]};
{'EXIT', Pid, Reason} when is_pid(Pid) ->
+ httpd_response:send_final_chunk(ModData, IsDisableChunkedSend),
exit({mod_esi_linked_process_died, Pid, Reason})
after Timeout ->
process_flag(trap_exit,false),
- {proceed,[{response, {already_sent, 200, Size}} |
- ModData#mod.data]}
+ httpd_response:send_final_chunk(ModData, IsDisableChunkedSend),
+ exit({mod_esi_linked_process_timeout, Pid})
end.
erl_script_timeout(Db) ->
diff --git a/lib/inets/src/inets_app/inets.appup.src b/lib/inets/src/inets_app/inets.appup.src
index 2efa7ccb60..ba1dc8ccdb 100644
--- a/lib/inets/src/inets_app/inets.appup.src
+++ b/lib/inets/src/inets_app/inets.appup.src
@@ -18,6 +18,12 @@
{"%VSN%",
[
+ {"5.3",
+ [
+ {update, httpc_handler, soft, soft_purge, soft_purge, [mod_esi]},
+ {load_module, mod_esi, soft_purge, soft_purge, []}
+ ]
+ },
{"5.2",
[
{restart_application, inets}
@@ -35,6 +41,12 @@
}
],
[
+ {"5.3",
+ [
+ {update, httpc_handler, soft, soft_purge, soft_purge, [mod_esi]},
+ {load_module, mod_esi, soft_purge, soft_purge, []}
+ ]
+ },
{"5.2",
[
{restart_application, inets}
diff --git a/lib/inets/vsn.mk b/lib/inets/vsn.mk
index 23de8906e7..401bf4d37d 100644
--- a/lib/inets/vsn.mk
+++ b/lib/inets/vsn.mk
@@ -18,11 +18,13 @@
# %CopyrightEnd%
APPLICATION = inets
-INETS_VSN = 5.3
+INETS_VSN = 5.3.1
PRE_VSN =
APP_VSN = "$(APPLICATION)-$(INETS_VSN)$(PRE_VSN)"
-TICKETS = \
+TICKETS = OTP-8508 OTP-8509
+
+TICKETS_5_3 = \
OTP-8016 \
OTP-8056 \
OTP-8103 \
diff --git a/lib/kernel/doc/src/application.xml b/lib/kernel/doc/src/application.xml
index 08ef0b1e52..47d578a339 100644
--- a/lib/kernel/doc/src/application.xml
+++ b/lib/kernel/doc/src/application.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2009</year>
+ <year>1996</year><year>2010</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -13,12 +13,12 @@
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at http://www.erlang.org/.
-
+
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitations
under the License.
-
+
</legalnotice>
<title>application</title>
@@ -503,7 +503,7 @@ Nodes = [cp1@cave, {cp2@cave, cp3@cave}]</code>
the tree.</p>
<p><c>StartType</c> defines the type of start:</p>
<list type="bulleted">
- <item><c>normal</c> if its a normal startup.</item>
+ <item><c>normal</c> if it's a normal startup.</item>
<item><c>normal</c> also if the application is distributed and
started at the current node due to a failover from another
node, and the application specification key <c>start_phases == undefined</c>.</item>
diff --git a/lib/kernel/doc/src/erl_ddll.xml b/lib/kernel/doc/src/erl_ddll.xml
index 75dca8a85d..4e65bf46f8 100644
--- a/lib/kernel/doc/src/erl_ddll.xml
+++ b/lib/kernel/doc/src/erl_ddll.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1997</year><year>2009</year>
+ <year>1997</year><year>2010</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -13,12 +13,12 @@
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at http://www.erlang.org/.
-
+
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitations
under the License.
-
+
</legalnotice>
<title>erl_ddll</title>
@@ -730,7 +730,7 @@
extension suffix, i.e. <c>.so</c>). The name by which
the driver identifies itself must also be consistent
with this <c>Name</c> parameter, much as a beam-file's
- module name much correspond to it's filename.</p>
+ module name much correspond to its filename.</p>
</item>
<tag><em>OptionList</em></tag>
<item>
@@ -742,8 +742,8 @@
<tag><em>{driver_options, DriverOptionsList}</em></tag>
<item>
<p>This option is to provide options that will change
- it's general behavior and will "stick" to the driver
- throughout it's lifespan.</p>
+ its general behavior and will "stick" to the driver
+ throughout its lifespan.</p>
<p>The driver options for a given driver name need
always to be consistent, <em>even when the driver is reloaded</em>, meaning that they are as much a part
of the driver as the actual name.</p>
diff --git a/lib/kernel/doc/src/file.xml b/lib/kernel/doc/src/file.xml
index f9f5443f68..50f9722a1c 100644
--- a/lib/kernel/doc/src/file.xml
+++ b/lib/kernel/doc/src/file.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2009</year>
+ <year>1996</year><year>2010</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -13,12 +13,12 @@
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at http://www.erlang.org/.
-
+
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitations
under the License.
-
+
</legalnotice>
<title>file</title>
@@ -75,6 +75,19 @@ time() = {{Year, Month, Day}, {Hour, Minute, Second}}
</desc>
</func>
<func>
+ <name>change_mode(Filename, Mode) -> ok | {error, Reason}</name>
+ <fsummary>Change permissions of a file</fsummary>
+ <type>
+ <v>Filename = name()</v>
+ <v>Mode = int()</v>
+ <v>Reason = ext_posix()</v>
+ </type>
+ <desc>
+ <p>Changes permissions of a file. See
+ <seealso marker="#write_file_info/2">write_file_info/2</seealso>.</p>
+ </desc>
+ </func>
+ <func>
<name>change_owner(Filename, Uid) -> ok | {error, Reason}</name>
<fsummary>Change owner of a file</fsummary>
<type>
diff --git a/lib/kernel/src/global.erl b/lib/kernel/src/global.erl
index cc0402da73..081e7e2f93 100644
--- a/lib/kernel/src/global.erl
+++ b/lib/kernel/src/global.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1996-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
-module(global).
@@ -112,7 +112,7 @@
resolvers = [],
syncers = [] :: [pid()],
node_name = node() :: node(),
- the_locker, the_deleter, the_registrar, trace,
+ the_locker, the_registrar, trace,
global_lock_down = false
}).
@@ -153,6 +153,8 @@
%%% It can be removed later as can the deleter process.
%%% An extra process calling erlang:monitor() is sometimes created.
%%% The new_nodes messages has been augmented with the global lock id.
+%%%
+%%% R14A (OTP-8527): The deleter process has been removed.
start() ->
gen_server:start({local, global_name_server}, ?MODULE, [], []).
@@ -418,7 +420,6 @@ init([]) ->
S = #state{the_locker = start_the_locker(DoTrace),
trace = T0,
- the_deleter = start_the_deleter(self()),
the_registrar = start_the_registrar()},
S1 = trace_message(S, {init, node()}, []),
@@ -763,13 +764,16 @@ handle_cast({in_sync, Node, _IsKnown}, S) ->
%% Called when Pid on other node crashed
handle_cast({async_del_name, _Name, _Pid}, S) ->
- %% Sent from the_deleter at some node in the partition but node().
+ %% Sent from the_deleter at some node in the partition but node() (-R13B)
%% The DOWN message deletes the name.
+ %% R14A nodes and later do not send async_del_name messages.
{noreply, S};
handle_cast({async_del_lock, _ResourceId, _Pid}, S) ->
- %% Sent from global_name_server at some node in the partition but node().
+ %% Sent from global_name_server at some node in the partition but
+ %% node(). (-R13B)
%% The DOWN message deletes the lock.
+ %% R14A nodes and later do not send async_del_lock messages.
{noreply, S};
handle_cast(Request, S) ->
@@ -778,8 +782,6 @@ handle_cast(Request, S) ->
"handle_cast(~p, _)\n", [Request]),
{noreply, S}.
-handle_info({'EXIT', Deleter, _Reason}=Exit, #state{the_deleter=Deleter}=S) ->
- {stop, {deleter_died,Exit}, S#state{the_deleter=undefined}};
handle_info({'EXIT', Locker, _Reason}=Exit, #state{the_locker=Locker}=S) ->
{stop, {locker_died,Exit}, S#state{the_locker=undefined}};
handle_info({'EXIT', Registrar, _}=Exit, #state{the_registrar=Registrar}=S) ->
@@ -1348,30 +1350,13 @@ lock_still_set(PidOrNode, ExtraInfo, S) ->
[{?GLOBAL_RID, _LockReqId, PidRefs}] when is_pid(PidOrNode) ->
%% Name registration.
lists:keymember(PidOrNode, 1, PidRefs);
- [{?GLOBAL_RID, LockReqId, PidRefs}] when is_atom(PidOrNode) ->
- case extra_info(lock, ExtraInfo) of
- {?GLOBAL_RID, LockId} -> % R11B-4 or later
- LockReqId =:= LockId;
- undefined ->
- lock_still_set_old(PidOrNode, LockReqId, PidRefs)
- end;
+ [{?GLOBAL_RID, LockReqId, _PidRefs}] when is_atom(PidOrNode) ->
+ {?GLOBAL_RID, LockId} = extra_info(lock, ExtraInfo),
+ LockReqId =:= LockId;
[] ->
- %% If the global lock was not removed by a DOWN message
- %% then we have a node that do not monitor locking pids
- %% (pre R11B-3), or an R11B-3 node (which does not ensure
- %% that {new_nodes, ...} arrives before {del_lock, ...}).
not S#state.global_lock_down
end.
-%%% The following is probably overkill. It is possible that this node
-%%% has been locked again, but it is a rare occasion.
-lock_still_set_old(_Node, ReqId, _PidRefs) when is_pid(ReqId) ->
- %% Cannot do better than return true.
- true;
-lock_still_set_old(Node, ReqId, PidRefs) when is_list(ReqId) ->
- %% Connection, version > 4, but before R11B-4.
- [P || {P, _RPid, _Ref} <- PidRefs, node(P) =:= Node] =/= [].
-
extra_info(Tag, ExtraInfo) ->
%% ExtraInfo used to be a list of nodes (vsn 2).
case catch lists:keyfind(Tag, 1, ExtraInfo) of
@@ -1382,36 +1367,18 @@ extra_info(Tag, ExtraInfo) ->
end.
del_name(Ref, S) ->
- NameL = [{Name, Pid} ||
+ NameL = [Name ||
{_, Name} <- ets:lookup(global_pid_names, Ref),
- {_, Pid, _Method, _RPid, Ref1} <-
+ {_, _Pid, _Method, _RPid, Ref1} <-
ets:lookup(global_names, Name),
Ref1 =:= Ref],
- ?trace({async_del_name, self(), NameL, Ref}),
case NameL of
- [{Name, Pid}] ->
- _ = del_names(Name, Pid, S),
+ [Name] ->
delete_global_name2(Name, S);
[] ->
S
end.
-%% Send {async_del_name, ...} to old nodes (pre R11B-3).
-del_names(Name, Pid, S) ->
- Send = case ets:lookup(global_names_ext, Name) of
- [{Name, Pid, RegNode}] ->
- RegNode =:= node();
- [] ->
- node(Pid) =:= node()
- end,
- if
- Send ->
- ?trace({del_names, {pid,Pid}, {name,Name}}),
- S#state.the_deleter ! {delete_name, self(), Name, Pid};
- true ->
- ok
- end.
-
%% Keeps the entry in global_names for whereis_name/1.
delete_global_name_keep_pid(Name, S) ->
case ets:lookup(global_names, Name) of
@@ -1986,7 +1953,6 @@ pid_is_locking(Pid, PidRefs) ->
delete_lock(Ref, S0) ->
Locks = pid_locks(Ref),
- del_locks(Locks, Ref, S0#state.known),
F = fun({ResourceId, LockRequesterId, PidRefs}, S) ->
{Pid, _RPid, Ref} = lists:keyfind(Ref, 3, PidRefs),
remove_lock(ResourceId, LockRequesterId, Pid, PidRefs, true,S)
@@ -2003,20 +1969,6 @@ pid_locks(Ref) ->
rpid_is_locking(Ref, PidRefs) ->
lists:keyfind(Ref, 3, PidRefs) =/= false.
-%% Send {async_del_lock, ...} to old nodes (pre R11B-3).
-del_locks([{ResourceId, _LockReqId, PidRefs} | Tail], Ref, KnownNodes) ->
- {Pid, _RPid, Ref} = lists:keyfind(Ref, 3, PidRefs),
- case node(Pid) =:= node() of
- true ->
- gen_server:abcast(KnownNodes, global_name_server,
- {async_del_lock, ResourceId, Pid});
- false ->
- ok
- end,
- del_locks(Tail, Ref, KnownNodes);
-del_locks([], _Ref, _KnownNodes) ->
- ok.
-
handle_nodedown(Node, S) ->
%% DOWN signals from monitors have removed locks and registered names.
#state{known = Known, synced = Syncs} = S,
@@ -2147,51 +2099,6 @@ get_own_nodes() ->
OkTup
end.
-%%-----------------------------------------------------------------
-%% The deleter process is a satellite process to global_name_server
-%% that does background batch deleting of names when a process
-%% that had globally registered names dies. It is started by and
-%% linked to global_name_server.
-%%-----------------------------------------------------------------
-
-start_the_deleter(Global) ->
- spawn_link(fun() -> loop_the_deleter(Global) end).
-
-loop_the_deleter(Global) ->
- Deletions = collect_deletions(Global, []),
- ?trace({loop_the_deleter, self(), {deletions,Deletions},
- {names,get_names()}}),
- %% trans_all_known is called rather than trans/3 with nodes() as
- %% third argument. The reason is that known gets updated by
- %% new_nodes when the lock is still set. nodes() on the other hand
- %% could be updated later (if in_sync is received after the lock
- %% is gone). It is not likely that in_sync would be received after
- %% the lock has been taken here, but using trans_all_known makes it
- %% even less likely.
- trans_all_known(
- fun(Known) ->
- lists:map(
- fun({Name,Pid}) ->
- gen_server:abcast(Known, global_name_server,
- {async_del_name, Name, Pid})
- end, Deletions)
- end),
- loop_the_deleter(Global).
-
-collect_deletions(Global, Deletions) ->
- receive
- {delete_name, Global, Name, Pid} ->
- collect_deletions(Global, [{Name,Pid} | Deletions]);
- Other ->
- unexpected_message(Other, deleter),
- collect_deletions(Global, Deletions)
- after case Deletions of
- [] -> infinity;
- _ -> 0
- end ->
- lists:reverse(Deletions)
- end.
-
%% The registrar is a helper process that registers and unregisters
%% names. Since it never dies it assures that names are registered and
%% unregistered on all known nodes. It is started by and linked to
diff --git a/lib/kernel/test/global_SUITE.erl b/lib/kernel/test/global_SUITE.erl
index a8c68985e2..7a84ad5e75 100644
--- a/lib/kernel/test/global_SUITE.erl
+++ b/lib/kernel/test/global_SUITE.erl
@@ -1,25 +1,23 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1997-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
-module(global_SUITE).
--compile(r11). % some code is run from r11-nodes
-
%-define(line_trace, 1).
-export([all/1,
@@ -2616,19 +2614,6 @@ proc(Parent) ->
name_exit(suite) -> [];
name_exit(doc) -> ["OTP-5563. Registered process dies."];
name_exit(Config) when is_list(Config) ->
- case ?t:is_release_available("r11b") of
- true ->
- StartOldFun =
- fun() ->
- {ok, N1} = start_node_rel(n_1, r11b, Config),
- {ok, N2} = start_node_rel(n_2, this, Config),
- [N1, N2]
- end,
- ?t:format("Test of r11~n"),
- do_name_exit(StartOldFun, old, Config);
- false ->
- ok
- end,
StartFun = fun() ->
{ok, N1} = start_node_rel(n_1, this, Config),
{ok, N2} = start_node_rel(n_2, this, Config),
@@ -2855,14 +2840,7 @@ many_nodes(Config) when is_list(Config) ->
N_nodes = quite_a_few_nodes(32),
{node_rel(1, N_nodes, this), N_nodes};
{unix, _} ->
- case ?t:is_release_available("r11b") of
- true ->
- This = node_rel(1, 16, this),
- R11B = node_rel(17, 32, r11b),
- {This ++ R11B, 32};
- false ->
- {node_rel(1, 32, this), 32}
- end;
+ {node_rel(1, 32, this), 32};
_ ->
{node_rel(1, 32, this), 32}
end,
@@ -3864,12 +3842,7 @@ start_node_rel(Name0, Rel, Config) ->
RelList ->
{RelList, ""}
end,
- Env = case Rel of
- r11b ->
- [{env, [{"ERL_R11B_FLAGS", []}]}];
- _ ->
- []
- end,
+ Env = [],
Pa = filename:dirname(code:which(?MODULE)),
Res = test_server:start_node(Name, peer,
[{args,
diff --git a/lib/megaco/doc/src/megaco_mib.xml b/lib/megaco/doc/src/megaco_mib.xml
index 3c0a549590..f1abe08fb5 100644
--- a/lib/megaco/doc/src/megaco_mib.xml
+++ b/lib/megaco/doc/src/megaco_mib.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2002</year><year>2009</year>
+ <year>2002</year><year>2010</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -13,12 +13,12 @@
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at http://www.erlang.org/.
-
+
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitations
under the License.
-
+
</legalnotice>
<title>Megaco mib</title>
@@ -50,15 +50,15 @@
lightweight. I.e. the statistic counters are handled
separately by different entities of the application. For
instance our two transport module(s) (see <seealso marker="megaco_tcp#stats">megaco_tcp</seealso> and <seealso marker="megaco_udp#stats">megaco_udp</seealso>) maintain their
- own counters and the application engine (see <seealso marker="megaco#stats">megaco</seealso>) maintain it's own
+ own counters and the application engine (see <seealso marker="megaco#stats">megaco</seealso>) maintain its own
counters.</p>
<p>This also means that if a user implement their own transport
- service then it has to maintain it's own statistics.</p>
+ service then it has to maintain its own statistics.</p>
</section>
<section>
<title>Distribution</title>
- <p>Each megaco application maintains it's own set of counters. So
+ <p>Each megaco application maintains its own set of counters. So
in a large (distributed) MG/MGC it could be necessary to
collect the statistics from several nodes (each) running the
megaco application (only one of them with the transport).</p>
diff --git a/lib/megaco/doc/src/megaco_run.xml b/lib/megaco/doc/src/megaco_run.xml
index 3afc638bcf..9ed589b079 100644
--- a/lib/megaco/doc/src/megaco_run.xml
+++ b/lib/megaco/doc/src/megaco_run.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2009</year>
+ <year>2000</year><year>2010</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -13,12 +13,12 @@
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at http://www.erlang.org/.
-
+
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitations
under the License.
-
+
</legalnotice>
<title>Running the stack</title>
@@ -365,7 +365,7 @@
then the specified max message size (see the
<seealso marker="megaco#user_info">max_pdu_size</seealso> option).
Finally, if segmentation is decided, then each action reply
- will make up it's own (segment) message.</p>
+ will make up its own (segment) message.</p>
</item>
</list>
</section>
diff --git a/lib/megaco/doc/src/megaco_user.xml b/lib/megaco/doc/src/megaco_user.xml
index 37942007bc..6a0de29385 100644
--- a/lib/megaco/doc/src/megaco_user.xml
+++ b/lib/megaco/doc/src/megaco_user.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2000</year><year>2009</year>
+ <year>2000</year><year>2010</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -13,12 +13,12 @@
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at http://www.erlang.org/.
-
+
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitations
under the License.
-
+
</legalnotice>
<title>megaco_user</title>
@@ -669,7 +669,7 @@ protocol_version() = integer() ]]></code>
<p>Invoked when a unexpected message is received</p>
<p>If a reply to a request is not received in time, the
megaco stack removes all info about the request from
- it's tables. If a reply should arrive after this has been
+ its tables. If a reply should arrive after this has been
done the app has no way of knowing where to send this message.
The message is delivered to the "user" by calling this
function on the local node (the node which has the link).</p>
diff --git a/lib/megaco/doc/src/notes_history.xml b/lib/megaco/doc/src/notes_history.xml
index 97aa4c66a5..640b62230f 100644
--- a/lib/megaco/doc/src/notes_history.xml
+++ b/lib/megaco/doc/src/notes_history.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2006</year><year>2009</year>
+ <year>2006</year><year>2010</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -13,12 +13,12 @@
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at http://www.erlang.org/.
-
+
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitations
under the License.
-
+
</legalnotice>
<title>Megaco Release Notes history</title>
@@ -2764,7 +2764,7 @@
<p>Added a new configuration parameter, threaded.
This tells the megaco app, that all
transaction requests in a message should be executed
- in parallel (e.g. each in it's own process).
+ in parallel (e.g. each in its own process).
<br></br>See the
<seealso marker="megaco#user_info">threaded</seealso> parameter
of the user_info function (also conn_info).</p>
@@ -2911,7 +2911,7 @@
<title>Improvements and new features</title>
<list type="bulleted">
<item>
- <p>This is just a code up-/downgrade cleanup release. I.e. It's the
+ <p>This is just a code up-/downgrade cleanup release. I.e. it's the
same as version 1.2 minus the ugly stuff needed to handle up-/downgrade
from/to version 1.1.2, 1.1.1 and 1.1.0.</p>
</item>
diff --git a/lib/megaco/test/megaco_app_test.erl b/lib/megaco/test/megaco_app_test.erl
index 8e2148c236..597ec26338 100644
--- a/lib/megaco/test/megaco_app_test.erl
+++ b/lib/megaco/test/megaco_app_test.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2002-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2002-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
@@ -87,6 +87,10 @@ is_app(App) ->
case file:consult(File) of
{ok, [{application, App, AppFile}]} ->
{ok, AppFile};
+ {error, {LineNo, Mod, Code}} ->
+ IoList = lists:concat([File, ":", LineNo, ": ",
+ Mod:format_error(Code)]),
+ {error, list_to_atom(lists:flatten(IoList))};
Error ->
{error, {invalid_format, Error}}
end.
diff --git a/lib/reltool/src/Makefile b/lib/reltool/src/Makefile
index fa24efbb8c..7fac7cbf88 100644
--- a/lib/reltool/src/Makefile
+++ b/lib/reltool/src/Makefile
@@ -1,19 +1,19 @@
#
# %CopyrightBegin%
-#
-# Copyright Ericsson AB 2009. All Rights Reserved.
-#
+#
+# Copyright Ericsson AB 2009-2010. 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
# compliance with the License. You should have received a copy of the
# Erlang Public License along with this software. If not, it can be
# retrieved online at http://www.erlang.org/.
-#
+#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and limitations
# under the License.
-#
+#
# %CopyrightEnd%
include $(ERL_TOP)/make/target.mk
@@ -85,7 +85,7 @@ $(TARGET_FILES): $(HRL_FILES) $(INTERNAL_HRL_FILES)
# ----------------------------------------------------
# Release Target
-# ----------------------------------------------------
+# ----------------------------------------------------
include $(ERL_TOP)/make/otp_release_targets.mk
diff --git a/lib/reltool/src/reltool.erl b/lib/reltool/src/reltool.erl
index e6548bfe68..e6a8bca069 100644
--- a/lib/reltool/src/reltool.erl
+++ b/lib/reltool/src/reltool.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2009-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
-module(reltool).
@@ -24,106 +24,16 @@
start/0, start/1, start_link/1, debug/0, % GUI
start_server/1, get_server/1, stop/1,
get_config/1, get_config/3, get_rel/2, get_script/2,
- create_target/2, get_target_spec/1, eval_target_spec/3,
+ create_target/2, get_target_spec/1, eval_target_spec/3,
install/2
]).
--type file() :: string().
--type dir() :: string().
--type mod_cond() :: all | app | ebin | derived | none.
--type incl_cond() :: include | exclude | derived.
--type debug_info() :: keep | strip.
--type app_file() :: keep | strip | all.
--type re_regexp() :: string().
--type regexps() :: [re_regexp()] | {add, [re_regexp()]} | {del, [re_regexp()]} .
--type incl_sys_filters() :: regexps().
--type excl_sys_filters() :: regexps().
--type incl_app_filters() :: regexps().
--type excl_app_filters() :: regexps().
--type incl_archive_filters() :: regexps().
--type excl_archive_filters() :: regexps().
--type archive_opt() :: term().
--type root_dir() :: dir().
--type lib_dir() :: dir().
--type profile() :: development | embedded | standalone.
--type relocatable() :: boolean().
--type escript_file() :: file().
--type mod_name() :: atom().
--type app_name() :: atom().
--type app_vsn() :: string().
--type app_type() :: permanent | transient | temporary | load | none.
--type incl_app() :: app_name().
--type rel_name() :: string().
--type rel_vsn() :: string().
--type boot_rel() :: rel_name().
--type rel_app() :: app_name()
- | {app_name(), app_type()}
- | {app_name(), [incl_app()]}
- | {app_name(), app_type(), [incl_app()]}.
--type mod() :: {incl_cond, incl_cond()}
- | {debug_info, debug_info()}.
--type app() :: {vsn, app_vsn()}
- | {mod, mod_name(), mod()}
- | {mod_cond, mod_cond()}
- | {incl_cond, incl_cond()}
- | {app_file, app_file()}
- | {debug_info, debug_info()}
- | {incl_app_filters, incl_app_filters()}
- | {excl_app_filters, excl_app_filters()}
- | {incl_archive_filters, incl_archive_filters()}
- | {excl_archive_filters, excl_archive_filters()}.
--type escript() :: {incl_cond, incl_cond()}.
--type sys() :: {mod_cond, mod_cond()}
- | {incl_cond, incl_cond()}
- | {debug_info, debug_info()}
- | {app_file, app_file()}
- | {profile, profile()}
- | {incl_sys_filters, incl_sys_filters()}
- | {excl_sys_filters, excl_sys_filters()}
- | {incl_app_filters, incl_app_filters()}
- | {excl_app_filters, excl_app_filters()}
- | {incl_archive_filters, incl_archive_filters()}
- | {excl_archive_filters, excl_archive_filters()}
- | {archive_opts, [archive_opt()]}
- | {root_dir, root_dir()}
- | {lib_dirs, [lib_dir()]}
- | {boot_rel, boot_rel()}
- | {rel, rel_name(), rel_vsn(), [rel_app()]}
- | {relocatable, relocatable()}
- | {erts, app()}
- | {escript, escript_file(), [escript()]}
- | {app, app_name(), [app()]}.
--type config() :: {sys, [sys()]}.
--type option() :: {wx_debug, term()} | {trap_exit, boolean()} | config() | {config, config() | file()}.
--type options() :: [option()].
--type server_pid() :: pid().
--type window_pid() :: pid().
--type server() :: server_pid() | options().
--type rel_file() :: term().
--type script_file() :: term().
--type reason() :: string().
--type escript_arg() :: string().
-%%-type base_dir() :: dir().
-%%-type base_file() :: file().
-%%-type top_dir() :: file().
-%%-type top_file() :: file().
-%%-type target_spec() :: [target_spec()]
-%% | {create_dir, base_dir(), [target_spec()]}
-%% | {create_dir, base_dir(), top_dir(), [target_spec()]}
-%% | {archive, base_file(), [archive_opt()], [target_spec()]}
-%% | {copy_file, base_file()}
-%% | {copy_file, base_file(), top_file()}
-%% | {write_file, base_file(), iolist()}
-%% | {strip_beam_file, base_file()}.
--type target_spec() :: term().
--type target_dir() :: dir().
--type incl_defaults() :: boolean().
--type incl_derived() :: boolean().
+-include("reltool.hrl").
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Main function for escript
--spec main([escript_arg()]) -> ok.
+-spec main([escript_arg()]) -> ok.
main(_) ->
process_flag(trap_exit, true),
{ok, WinPid} = start_link([]),
@@ -164,7 +74,7 @@ start_link(Options) when is_list(Options) ->
{ok, WinPid};
{error, Reason} ->
{error, lists:flatten(io_lib:format("~p", [Reason]))}
- end.
+ end.
%% Start server process with options
-spec start_server(options()) -> {ok, server_pid()} | {error, reason()}.
@@ -200,7 +110,8 @@ stop(Pid) when is_pid(Pid) ->
end.
%% Internal library function
--spec eval_server(server(), fun((server_pid()) -> term())) -> {ok, server_pid()} | {error, reason()}.
+-spec eval_server(server(), fun((server_pid()) -> term())) ->
+ {ok, server_pid()} | {error, reason()}.
eval_server(Pid, Fun) when is_pid(Pid) ->
Fun(Pid);
eval_server(Options, Fun) when is_list(Options), is_function(Fun, 1) ->
@@ -212,39 +123,54 @@ eval_server(Options, Fun) when is_list(Options), is_function(Fun, 1) ->
{error, Reason} ->
{error, Reason}
end.
-
+
%% Get reltool configuration
-spec get_config(server()) -> {ok, config()} | {error, reason()}.
get_config(PidOrOption) ->
get_config(PidOrOption, false, false).
--spec get_config(server(), incl_defaults(), incl_derived()) -> {ok, config()} | {error, reason()}.
-get_config(PidOrOptions, InclDefaults, InclDerived) when is_pid(PidOrOptions); is_list(PidOrOptions) ->
- eval_server(PidOrOptions, fun(Pid) -> reltool_server:get_config(Pid, InclDefaults, InclDerived) end).
+-spec get_config(server(), incl_defaults(), incl_derived()) ->
+ {ok, config()} | {error, reason()}.
+get_config(PidOrOptions, InclDef, InclDeriv)
+ when is_pid(PidOrOptions); is_list(PidOrOptions) ->
+ eval_server(PidOrOptions,
+ fun(Pid) ->
+ reltool_server:get_config(Pid, InclDef, InclDeriv)
+ end).
%% Get contents of release file
-spec get_rel(server(), rel_name()) -> {ok, rel_file()} | {error, reason()}.
-get_rel(PidOrOptions, RelName) when is_pid(PidOrOptions); is_list(PidOrOptions) ->
- eval_server(PidOrOptions, fun(Pid) -> reltool_server:get_rel(Pid, RelName) end).
+get_rel(PidOrOptions, RelName)
+ when is_pid(PidOrOptions); is_list(PidOrOptions) ->
+ eval_server(PidOrOptions,
+ fun(Pid) -> reltool_server:get_rel(Pid, RelName) end).
%% Get contents of boot script file
--spec get_script(server(), rel_name()) -> {ok, script_file()} | {error, reason()}.
-get_script(PidOrOptions, RelName) when is_pid(PidOrOptions); is_list(PidOrOptions) ->
- eval_server(PidOrOptions, fun(Pid) -> reltool_server:get_script(Pid, RelName) end).
+-spec get_script(server(), rel_name()) ->
+ {ok, script_file()} | {error, reason()}.
+get_script(PidOrOptions, RelName)
+ when is_pid(PidOrOptions); is_list(PidOrOptions) ->
+ eval_server(PidOrOptions,
+ fun(Pid) -> reltool_server:get_script(Pid, RelName) end).
%% Generate a target system
-spec create_target(server(), target_dir()) -> ok | {error, reason()}.
-create_target(PidOrOptions, TargetDir) when is_pid(PidOrOptions); is_list(PidOrOptions) ->
- eval_server(PidOrOptions, fun(Pid) -> reltool_server:gen_target(Pid, TargetDir) end).
+create_target(PidOrOptions, TargetDir)
+ when is_pid(PidOrOptions); is_list(PidOrOptions) ->
+ eval_server(PidOrOptions,
+ fun(Pid) -> reltool_server:gen_target(Pid, TargetDir) end).
%% Generate a target system
-spec get_target_spec(server()) -> {ok, target_spec()} | {error, reason()}.
-get_target_spec(PidOrOptions) when is_pid(PidOrOptions); is_list(PidOrOptions) ->
+get_target_spec(PidOrOptions)
+ when is_pid(PidOrOptions); is_list(PidOrOptions) ->
eval_server(PidOrOptions, fun(Pid) -> reltool_server:gen_spec(Pid) end).
%% Generate a target system
--spec eval_target_spec(target_spec(), root_dir(), target_dir()) -> ok | {error, reason()}.
-eval_target_spec(Spec, SourceDir, TargetDir) when is_list(SourceDir), is_list(TargetDir) ->
+-spec eval_target_spec(target_spec(), root_dir(), target_dir()) ->
+ ok | {error, reason()}.
+eval_target_spec(Spec, SourceDir, TargetDir)
+ when is_list(SourceDir), is_list(TargetDir) ->
reltool_target:eval_spec(Spec, SourceDir, TargetDir).
%% Install a target system
diff --git a/lib/reltool/src/reltool.hrl b/lib/reltool/src/reltool.hrl
index e7d84f97db..8a6a2142fd 100644
--- a/lib/reltool/src/reltool.hrl
+++ b/lib/reltool/src/reltool.hrl
@@ -16,119 +16,144 @@
%%
%% %CopyrightEnd%
--define(APPLICATION, reltool).
+-define(APPLICATION, reltool).
-define(MISSING_APP, '*MISSING*').
-define(MISSING_APP_TEXT, "*MISSING*").
--record(common,
- {
- sys_debug, % term()
- wx_debug, % term()
- trap_exit, % bool()
- app_tab, % ets_tab()
- mod_tab, % ets_tab()
- mod_used_by_tab % ets_tab()
- }).
-
--record(sys,
- {
- %% Sources
- root_dir, % directory()
- lib_dirs, % [directory()]
- escripts, % [file()]
- mod_cond, % all | app | ebin | derived | none
- incl_cond, % include | exclude | derived
- apps, % [#app{}]
-
- %% Target cond
- boot_rel, % string()
- rels, % [#rel{}]
- emu_name, % string()
- profile, % standalone | development | embedded
- incl_sys_filters, % [regexp()]
- excl_sys_filters, % [regexp()]
- incl_app_filters, % [regexp()]
- excl_app_filters, % [regexp()]
- incl_archive_filters, % [regexp()]
- excl_archive_filters, % [regexp()]
- archive_opts, % [zip:create()]
- relocatable, % bool()
- app_type, % permanent | transient | temporary | load | none
- app_file, % keep | strip | all
- debug_info % keep | strip
- }).
-
--record(rel,
- {
- name, % string()
- vsn, % string()
- rel_apps % [#rel_app{}]
- }).
+-type file() :: string().
+-type dir() :: string().
+%% app - Include all modules in app file
+%% ebin - Include all modules on ebin directory
+%% derived - Include only those modules that others are dependent on
+-type mod_cond() :: all | app | ebin | derived | none.
+-type incl_cond() :: include | exclude | derived.
+-type debug_info() :: keep | strip.
+-type app_file() :: keep | strip | all.
+-type re_regexp() :: string(). % re:regexp()
+-type regexps() :: [re_regexp()] |
+ {add, [re_regexp()]} |
+ {del, [re_regexp()]} .
+-type incl_sys_filters() :: regexps().
+-type excl_sys_filters() :: regexps().
+-type incl_app_filters() :: regexps().
+-type excl_app_filters() :: regexps().
+-type incl_archive_filters() :: regexps().
+-type excl_archive_filters() :: regexps().
+-type archive_opt() :: term(). % zip:create()
+-type root_dir() :: dir().
+-type lib_dir() :: dir().
+-type profile() :: development | embedded | standalone.
+-type relocatable() :: boolean().
+-type escript_file() :: file().
+-type mod_name() :: atom().
+-type app_name() :: atom().
+-type app_vsn() :: string(). % e.g. "4.7"
+-type app_label() :: string().% e.g. "mnesia" or "mnesia-4.7"
+-type app_type() :: permanent | transient | temporary | load | none.
+-type incl_app() :: app_name().
+-type emu_name() :: string().
+-type rel_name() :: string().
+-type rel_vsn() :: string().
+-type boot_rel() :: rel_name().
+-type rel_app() :: app_name()
+ | {app_name(), app_type()}
+ | {app_name(), [incl_app()]}
+ | {app_name(), app_type(), [incl_app()]}.
+-type mod() :: {incl_cond, incl_cond()}
+ | {debug_info, debug_info()}.
+-type app() :: {vsn, app_vsn()}
+ | {mod, mod_name(), mod()}
+ | {mod_cond, mod_cond()}
+ | {incl_cond, incl_cond()}
+ | {app_file, app_file()}
+ | {debug_info, debug_info()}
+ | {incl_app_filters, incl_app_filters()}
+ | {excl_app_filters, excl_app_filters()}
+ | {incl_archive_filters, incl_archive_filters()}
+ | {excl_archive_filters, excl_archive_filters()}.
+-type escript() :: {incl_cond, incl_cond()}.
+-type sys() :: {mod_cond, mod_cond()}
+ | {incl_cond, incl_cond()}
+ | {debug_info, debug_info()}
+ | {app_file, app_file()}
+ | {profile, profile()}
+ | {incl_sys_filters, incl_sys_filters()}
+ | {excl_sys_filters, excl_sys_filters()}
+ | {incl_app_filters, incl_app_filters()}
+ | {excl_app_filters, excl_app_filters()}
+ | {incl_archive_filters, incl_archive_filters()}
+ | {excl_archive_filters, excl_archive_filters()}
+ | {archive_opts, [archive_opt()]}
+ | {root_dir, root_dir()}
+ | {lib_dirs, [lib_dir()]}
+ | {boot_rel, boot_rel()}
+ | {rel, rel_name(), rel_vsn(), [rel_app()]}
+ | {relocatable, relocatable()}
+ | {erts, app()}
+ | {escript, escript_file(), [escript()]}
+ | {app, app_name(), [app()]}.
+-type config() :: {sys, [sys()]}.
+-type option() :: {wx_debug, term()} |
+ {trap_exit, boolean()} |
+ config() |
+ {config, config() | file()}.
+-type options() :: [option()].
+-type server_pid() :: pid().
+-type window_pid() :: pid().
+-type server() :: server_pid() | options().
+-type rel_file() :: term().
+-type script_file() :: term().
+-type reason() :: string().
+-type escript_arg() :: string().
+-type base_dir() :: dir().
+-type base_file() :: file().
+-type top_dir() :: file().
+-type top_file() :: file().
+-type target_spec() :: [target_spec()]
+ | {create_dir, base_dir(), [target_spec()]}
+ | {create_dir, base_dir(), top_dir(), [target_spec()]}
+ | {archive,
+ base_file(),
+ [archive_opt()],
+ [target_spec()]}
+ | {copy_file, base_file()}
+ | {copy_file, base_file(), top_file()}
+ | {write_file, base_file(), iolist()}
+ | {strip_beam_file, base_file()}.
+-type target_dir() :: dir().
+-type incl_defaults() :: boolean().
+-type incl_derived() :: boolean().
+-type ets_tab() :: term().
+-type status() :: missing | ok.
--record(rel_app,
+-record(common,
{
- name, % atom()
- app_type, % permanent | transient | temporary | load | none
- incl_apps % [atom()]
+ sys_debug :: term(),
+ wx_debug :: term(),
+ trap_exit :: boolean(),
+ app_tab :: ets_tab(),
+ mod_tab :: ets_tab(),
+ mod_used_by_tab :: ets_tab()
}).
--record(app,
- {%% Static info
- name, % atom()
- is_escript, % bool()
- use_selected_vsn,% bool() | undefined
- active_dir, % dir_name()
- sorted_dirs, % [dir_name()]
- vsn, % string() e.g. "4.7"
- label, % string() e.g. "mnesia" or "mnesia-4.7"
- info, % #app_info{} | undefined
- mods, % [#mod{}]
-
- %% Static source cond
- mod_cond, % all | app | ebin | derived | none | undefined
- incl_cond, % include | exclude | derived | undefined
-
- %% Static target cond
- debug_info, % keep | strip | undefined
- app_file, % keep | strip | all | undefined
- app_type, % permanent | transient | temporary | load | none
- incl_app_filters, % [regexp()]
- excl_app_filters, % [regexp()]
- incl_archive_filters, % [regexp()]
- excl_archive_filters, % [regexp()]
- archive_opts, % [zip_create_opt()]
-
- %% Dynamic
- status, % missing | ok
- uses_mods, % [atom()]
- used_by_mods, % [atom()]
- uses_apps, % [atom()]
- used_by_apps, % [atom()]
- is_pre_included, % bool()
- is_included % bool()
- }).
-record(mod,
{%% Static
- name, % atom()
- app_name, % atom()
- incl_cond, % include | exclude | derived | undefined
- debug_info, % keep | strip | undefined
- is_app_mod, % bool(),
- is_ebin_mod, % bool(),
- uses_mods, % [module()]
- exists, % bool()
+ name :: mod_name(),
+ app_name :: app_name(),
+ incl_cond :: incl_cond() | undefined,
+ debug_info :: debug_info() | undefined,
+ is_app_mod :: boolean(),
+ is_ebin_mod :: boolean(),
+ uses_mods :: [mod_name()],
+ exists :: boolean(),
%% Dynamic
- status, % missing | ok
- used_by_mods, % [atom()]
- is_pre_included, % bool() | undefined
- is_included % bool() | undefined
+ status :: status(),
+ used_by_mods :: [mod_name()],
+ is_pre_included :: boolean() | undefined,
+ is_included :: boolean() | undefined
}).
-%% app - Include all modules in app file
-%% ebin - Include all modules on ebin directory
-%% derived - Include only those modules that others are dependent on
-
-record(app_info,
{
description = "",
@@ -145,8 +170,86 @@
start_phases = undefined
}).
+-record(app,
+ {%% Static info
+ name :: app_name(),
+ is_escript :: boolean(),
+ use_selected_vsn :: boolean() | undefined,
+ active_dir :: dir(),
+ sorted_dirs :: [dir()],
+ vsn :: app_vsn(),
+ label :: app_label(),
+ info :: #app_info{} | undefined,
+ mods :: [#mod{}],
+
+ %% Static source cond
+ mod_cond :: mod_cond() | undefined,
+ incl_cond :: incl_cond() | undefined,
+
+ %% Static target cond
+ debug_info :: debug_info() | undefined,
+ app_file :: app_file() | undefined,
+ app_type :: app_type(),
+ incl_app_filters :: incl_app_filters(),
+ excl_app_filters :: excl_app_filters(),
+ incl_archive_filters :: incl_archive_filters(),
+ excl_archive_filters :: excl_archive_filters(),
+ archive_opts :: [archive_opt()],
+
+ %% Dynamic
+ status :: status(),
+ uses_mods :: [mod_name()],
+ used_by_mods :: [mod_name()],
+ uses_apps :: [app_name()],
+ used_by_apps :: [app_name()],
+ is_pre_included :: boolean(),
+ is_included :: boolean()
+ }).
+
+-record(rel_app,
+ {
+ name :: app_name(),
+ app_type :: app_type(),
+ incl_apps :: [incl_app()]
+ }).
+
+-record(rel,
+ {
+ name :: rel_name(),
+ vsn :: rel_vsn(),
+ rel_apps :: [#rel_app{}]
+ }).
+
+-record(sys,
+ {
+ %% Sources
+ root_dir :: dir(),
+ lib_dirs :: [dir()],
+ escripts :: [file()],
+ mod_cond :: mod_cond(),
+ incl_cond :: incl_cond(),
+ apps :: [#app{}],
+
+ %% Target cond
+ boot_rel :: boot_rel(),
+ rels :: [#rel{}],
+ emu_name :: emu_name(),
+ profile :: profile(),
+ incl_sys_filters :: incl_sys_filters(),
+ excl_sys_filters :: excl_sys_filters(),
+ incl_app_filters :: incl_app_filters(),
+ excl_app_filters :: excl_app_filters(),
+ incl_archive_filters :: incl_archive_filters(),
+ excl_archive_filters :: excl_archive_filters(),
+ archive_opts :: [archive_opt()],
+ relocatable :: boolean(),
+ app_type :: app_type(),
+ app_file :: app_file(),
+ debug_info :: debug_info()
+ }).
+
-record(regexp, {source, compiled}).
-
+
-define(ERR_IMAGE, 0).
-define(WARN_IMAGE, 1).
-define(QUEST_IMAGE, 2).
@@ -170,7 +273,7 @@
-define(DEFAULT_DEBUG_INFO, keep).
-define(DEFAULT_INCL_ARCHIVE_FILTERS, [".*"]).
--define(DEFAULT_EXCL_ARCHIVE_FILTERS, ["^include$", "^priv$"]).
+-define(DEFAULT_EXCL_ARCHIVE_FILTERS, ["^include\$", "^priv\$"]).
-define(DEFAULT_ARCHIVE_OPTS, []).
-define(DEFAULT_INCL_SYS_FILTERS, [".*"]).
@@ -178,25 +281,27 @@
-define(DEFAULT_INCL_APP_FILTERS, [".*"]).
-define(DEFAULT_EXCL_APP_FILTERS, []).
--define(EMBEDDED_INCL_SYS_FILTERS, ["^bin",
+-define(EMBEDDED_INCL_SYS_FILTERS, ["^bin",
"^erts",
"^lib",
"^releases"]).
--define(EMBEDDED_EXCL_SYS_FILTERS, ["^bin/(erlc|dialyzer|typer)(|\\.exe)$",
- "^erts.*/bin/(erlc|dialyzer|typer)(|\\.exe)$",
- "^erts.*/bin/.*(debug|pdb)"]).
+-define(EMBEDDED_EXCL_SYS_FILTERS,
+ ["^bin/(erlc|dialyzer|typer)(|\\.exe)\$",
+ "^erts.*/bin/(erlc|dialyzer|typer)(|\\.exe)\$",
+ "^erts.*/bin/.*(debug|pdb)"]).
-define(EMBEDDED_INCL_APP_FILTERS, ["^ebin",
- "^priv",
+ "^priv",
"^include"]).
-define(EMBEDDED_EXCL_APP_FILTERS, []).
--define(STANDALONE_INCL_SYS_FILTERS, ["^bin/(erl|epmd)(|\\.exe|\\.ini)$",
- "^bin/start(|_clean).boot$",
+-define(STANDALONE_INCL_SYS_FILTERS, ["^bin/(erl|epmd)(|\\.exe|\\.ini)\$",
+ "^bin/start(|_clean).boot\$",
"^erts.*/bin",
- "^lib$"]).
--define(STANDALONE_EXCL_SYS_FILTERS, ["^erts.*/bin/(erlc|dialyzer|typer)(|\\.exe)$",
- "^erts.*/bin/(start|escript|to_erl|run_erl)(|\\.exe)$",
- "^erts.*/bin/.*(debug|pdb)"]).
--define(STANDALONE_INCL_APP_FILTERS, ["^ebin",
+ "^lib\$"]).
+-define(STANDALONE_EXCL_SYS_FILTERS,
+ ["^erts.*/bin/(erlc|dialyzer|typer)(|\\.exe)\$",
+ "^erts.*/bin/(start|escript|to_erl|run_erl)(|\\.exe)\$",
+ "^erts.*/bin/.*(debug|pdb)"]).
+-define(STANDALONE_INCL_APP_FILTERS, ["^ebin",
"^priv"]).
--define(STANDALONE_EXCL_APP_FILTERS, ["^ebin/.*\\.appup$"]).
+-define(STANDALONE_EXCL_APP_FILTERS, ["^ebin/.*\\.appup\$"]).
diff --git a/lib/reltool/src/reltool_app_win.erl b/lib/reltool/src/reltool_app_win.erl
index 6083493c02..70bd72b258 100644
--- a/lib/reltool/src/reltool_app_win.erl
+++ b/lib/reltool/src/reltool_app_win.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2009-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
-module(reltool_app_win).
@@ -34,7 +34,7 @@
-include_lib("wx/include/wx.hrl").
-include("reltool.hrl").
--record(state,
+-record(state,
{parent_pid,
xref_pid,
mod_wins,
@@ -63,7 +63,7 @@
%% -define(APPS_APP_COL_WIDTH, 250).
-define(CLOSE_ITEM, ?wxID_EXIT). %% Use OS specific version if available
--define(ABOUT_ITEM, ?wxID_ABOUT). %% Use OS specific
+-define(ABOUT_ITEM, ?wxID_ABOUT). %% Use OS specific
-define(CONTENTS_ITEM, 300).
-define(MODS_MOD_COL, 0).
@@ -79,7 +79,11 @@
%% Client
start_link(WxEnv, Xref, Common, AppName) ->
- proc_lib:start_link(?MODULE, init, [self(), WxEnv, Xref, Common, AppName], infinity, []).
+ proc_lib:start_link(?MODULE,
+ init,
+ [self(), WxEnv, Xref, Common, AppName],
+ infinity,
+ []).
raise(Pid) ->
reltool_utils:cast(Pid, raise).
@@ -121,7 +125,12 @@ loop(#state{xref_pid = Xref, common = C, app = App} = S) ->
receive
{system, From, Msg} ->
Dbg = C#common.sys_debug,
- sys:handle_system_msg(Msg, From, S#state.parent_pid, ?MODULE, Dbg, S);
+ sys:handle_system_msg(Msg,
+ From,
+ S#state.parent_pid,
+ ?MODULE,
+ Dbg,
+ S);
{cast, _From, raise} ->
wxFrame:raise(S#state.frame),
wxFrame:setFocus(S#state.frame),
@@ -131,7 +140,8 @@ loop(#state{xref_pid = Xref, common = C, app = App} = S) ->
{ok, App2} ->
{ok, Sys} = reltool_server:get_sys(Xref),
S2 = redraw_window(S#state{sys = Sys, app = App2}),
- [ok = reltool_mod_win:refresh(MW#mod_win.pid) || MW <- S2#state.mod_wins],
+ [ok = reltool_mod_win:refresh(MW#mod_win.pid) ||
+ MW <- S2#state.mod_wins],
?MODULE:loop(S2);
{error, _Reason} ->
wxFrame:destroy(S#state.frame),
@@ -139,7 +149,8 @@ loop(#state{xref_pid = Xref, common = C, app = App} = S) ->
end;
{call, ReplyTo, Ref, {open_mod, ModName}} ->
S2 = create_mod_window(S, ModName),
- {value, #mod_win{pid = ModPid}} = lists:keysearch(ModName, #mod_win.name, S2#state.mod_wins),
+ {value, #mod_win{pid = ModPid}} =
+ lists:keysearch(ModName, #mod_win.name, S2#state.mod_wins),
reltool_utils:reply(ReplyTo, Ref, {ok, ModPid}),
?MODULE:loop(S2);
#wx{event = #wxSize{}} = Wx ->
@@ -157,7 +168,9 @@ loop(#state{xref_pid = Xref, common = C, app = App} = S) ->
exit(Reason);
{'EXIT', Pid, _Reason} = Exit ->
exit_warning(Exit),
- S2 = S#state{mod_wins = lists:keydelete(Pid, #mod_win.pid, S#state.mod_wins)},
+ S2 = S#state{mod_wins = lists:keydelete(Pid,
+ #mod_win.pid,
+ S#state.mod_wins)},
?MODULE:loop(S2);
Msg ->
error_logger:format("~p~p got unexpected message:\n\t~p\n",
@@ -179,7 +192,7 @@ create_window(#state{app = App} = S) ->
StatusBar = wxFrame:createStatusBar(Frame,[]),
Book = wxNotebook:new(Panel, ?wxID_ANY, []),
-
+
S2 = S#state{frame = Frame,
panel = Panel,
book = Book,
@@ -210,12 +223,16 @@ create_apps_page(S, Derived) ->
Lower = wxBoxSizer:new(?wxHORIZONTAL),
UsedByCtrl = create_apps_list_ctrl(Panel, Upper, "Used by"),
- wxSizer:add(Upper, wxStaticLine:new(Panel, [{style, ?wxLI_VERTICAL}]), [{border, 2}, {flag, ?wxALL bor ?wxEXPAND}]),
-
+ wxSizer:add(Upper,
+ wxStaticLine:new(Panel, [{style, ?wxLI_VERTICAL}]),
+ [{border, 2}, {flag, ?wxALL bor ?wxEXPAND}]),
+
RequiredCtrl = create_apps_list_ctrl(Panel, Upper, "Required"),
- wxSizer:add(Upper, wxStaticLine:new(Panel, [{style, ?wxLI_VERTICAL}]), [{border, 2}, {flag, ?wxALL bor ?wxEXPAND}]),
+ wxSizer:add(Upper, wxStaticLine:new(Panel, [{style, ?wxLI_VERTICAL}]),
+ [{border, 2}, {flag, ?wxALL bor ?wxEXPAND}]),
InclCtrl = create_apps_list_ctrl(Panel, Upper, "Included"),
- wxSizer:add(Upper, wxStaticLine:new(Panel, [{style, ?wxLI_VERTICAL}]), [{border, 2}, {flag, ?wxALL bor ?wxEXPAND}]),
+ wxSizer:add(Upper, wxStaticLine:new(Panel, [{style, ?wxLI_VERTICAL}]),
+ [{border, 2}, {flag, ?wxALL bor ?wxEXPAND}]),
UsesCtrl = create_apps_list_ctrl(Panel, Upper, "Uses"),
S2 = S#state{app_required_ctrl = RequiredCtrl,
app_used_by_ctrl = UsedByCtrl,
@@ -262,8 +279,10 @@ create_apps_list_ctrl(Panel, Sizer, Text) ->
[{border, 2},
{flag, ?wxALL bor ?wxEXPAND},
{proportion, 1}]),
- wxEvtHandler:connect(ListCtrl, size, [{skip, true}, {userData, apps_list_ctrl}]),
- wxListCtrl:connect(ListCtrl, command_list_item_activated, [{userData, open_app}]),
+ wxEvtHandler:connect(ListCtrl, size,
+ [{skip, true}, {userData, apps_list_ctrl}]),
+ wxListCtrl:connect(ListCtrl, command_list_item_activated,
+ [{userData, open_app}]),
wxWindow:connect(ListCtrl, enter_window),
ListCtrl.
@@ -271,9 +290,20 @@ create_deps_page(S, Derived) ->
Panel = wxPanel:new(S#state.book, []),
Main = wxBoxSizer:new(?wxHORIZONTAL),
- UsedByCtrl = create_mods_list_ctrl(Panel, Main, "Modules used by others", " and their applications", undefined, undefined),
- wxSizer:add(Main, wxStaticLine:new(Panel, [{style, ?wxLI_VERTICAL}]), [{border, 2}, {flag, ?wxALL bor ?wxEXPAND}]),
- UsesCtrl = create_mods_list_ctrl(Panel, Main, "Used modules", " and their applications", undefined, undefined),
+ UsedByCtrl = create_mods_list_ctrl(Panel,
+ Main,
+ "Modules used by others",
+ " and their applications",
+ undefined,
+ undefined),
+ wxSizer:add(Main, wxStaticLine:new(Panel, [{style, ?wxLI_VERTICAL}]),
+ [{border, 2}, {flag, ?wxALL bor ?wxEXPAND}]),
+ UsesCtrl = create_mods_list_ctrl(Panel,
+ Main,
+ "Used modules",
+ " and their applications",
+ undefined,
+ undefined),
S2 = S#state{deps_used_by_ctrl = UsedByCtrl,
deps_uses_ctrl = UsesCtrl},
redraw_mods(S2, Derived),
@@ -285,13 +315,36 @@ create_mods_page(S, Derived) ->
Panel = wxPanel:new(S#state.book, []),
MainSz = wxBoxSizer:new(?wxHORIZONTAL),
- SourceCtrl = create_mods_list_ctrl(Panel, MainSz, ?source, "", whitelist_add, blacklist_add),
- wxSizer:add(MainSz, wxStaticLine:new(Panel, [{style, ?wxLI_VERTICAL}]), [{border, 2}, {flag, ?wxALL bor ?wxEXPAND}]),
- WhiteCtrl = create_mods_list_ctrl(Panel, MainSz, ?whitelist, "", whitelist_del, blacklist_add),
- wxSizer:add(MainSz, wxStaticLine:new(Panel, [{style, ?wxLI_VERTICAL}]), [{border, 2}, {flag, ?wxALL bor ?wxEXPAND}]),
- BlackCtrl = create_mods_list_ctrl(Panel, MainSz, ?blacklist, "", whitelist_add, blacklist_del),
- wxSizer:add(MainSz, wxStaticLine:new(Panel, [{style, ?wxLI_VERTICAL}]), [{border, 2}, {flag, ?wxALL bor ?wxEXPAND}]),
- DerivedCtrl = create_mods_list_ctrl(Panel, MainSz, ?derived, "", whitelist_add, blacklist_add),
+ SourceCtrl = create_mods_list_ctrl(Panel,
+ MainSz,
+ ?source,
+ "",
+ whitelist_add,
+ blacklist_add),
+ wxSizer:add(MainSz, wxStaticLine:new(Panel, [{style, ?wxLI_VERTICAL}]),
+ [{border, 2}, {flag, ?wxALL bor ?wxEXPAND}]),
+ WhiteCtrl = create_mods_list_ctrl(Panel,
+ MainSz,
+ ?whitelist,
+ "",
+ whitelist_del,
+ blacklist_add),
+ wxSizer:add(MainSz, wxStaticLine:new(Panel, [{style, ?wxLI_VERTICAL}]),
+ [{border, 2}, {flag, ?wxALL bor ?wxEXPAND}]),
+ BlackCtrl = create_mods_list_ctrl(Panel,
+ MainSz,
+ ?blacklist,
+ "",
+ whitelist_add,
+ blacklist_del),
+ wxSizer:add(MainSz, wxStaticLine:new(Panel, [{style, ?wxLI_VERTICAL}]),
+ [{border, 2}, {flag, ?wxALL bor ?wxEXPAND}]),
+ DerivedCtrl = create_mods_list_ctrl(Panel,
+ MainSz,
+ ?derived,
+ "",
+ whitelist_add,
+ blacklist_add),
S2 = S#state{mods_source_ctrl = SourceCtrl,
mods_white_ctrl = WhiteCtrl,
mods_black_ctrl = BlackCtrl,
@@ -309,7 +362,8 @@ create_mods_list_ctrl(Panel, OuterSz, Title, AppText, Tick, Cross) ->
%% ?wxLC_SINGLE_SEL bor
?wxHSCROLL bor
?wxVSCROLL}]),
- ToolTip = "Select module(s) or open separate module window with a double click.",
+ ToolTip = "Select module(s) or open separate module "
+ "window with a double click.",
wxListCtrl:setToolTip(ListCtrl, ToolTip),
%% Prep images
@@ -326,7 +380,8 @@ create_mods_list_ctrl(Panel, OuterSz, Title, AppText, Tick, Cross) ->
true ->
wxListItem:setText(ListItem, AppText),
wxListCtrl:insertColumn(ListCtrl, ?MODS_APP_COL, ListItem),
- %% wxListCtrl:setColumnWidth(ListCtrl, ?MODS_APP_COL, ?MODS_APP_COL_WIDTH),
+ %% wxListCtrl:setColumnWidth(ListCtrl, ?MODS_APP_COL,
+ %% ?MODS_APP_COL_WIDTH),
2;
false ->
1
@@ -336,9 +391,11 @@ create_mods_list_ctrl(Panel, OuterSz, Title, AppText, Tick, Cross) ->
ButtonSz = wxBoxSizer:new(?wxHORIZONTAL),
create_button(Panel, ButtonSz, ListCtrl, Title, "wxART_TICK_MARK", Tick),
create_button(Panel, ButtonSz, ListCtrl, Title, "wxART_CROSS_MARK", Cross),
- wxEvtHandler:connect(ListCtrl, size, [{skip, true}, {userData, mods_list_ctrl}]),
- wxListCtrl:connect(ListCtrl, command_list_item_activated, [{userData, open_mod}]),
- wxWindow:connect(ListCtrl, enter_window),
+ wxEvtHandler:connect(ListCtrl, size,
+ [{skip, true}, {userData, mods_list_ctrl}]),
+ wxListCtrl:connect(ListCtrl, command_list_item_activated,
+ [{userData, open_mod}]),
+ wxWindow:connect(ListCtrl, enter_window),
InnerSz = wxBoxSizer:new(?wxVERTICAL),
wxSizer:add(InnerSz, ListCtrl,
[{border, 2},
@@ -377,7 +434,7 @@ action_to_tool_tip(Label, Action) ->
"Remove selected module(s)from whitelist.";
blacklist_add when Label =:= ?blacklist ->
"Remove selected module(s) from blacklist.";
- blacklist_add ->
+ blacklist_add ->
"Add selected module(s) to blacklist.";
blacklist_del ->
"Remove selected module(s) from blacklist."
@@ -444,8 +501,8 @@ create_config_page(#state{app = App} = S) ->
wxNotebook:addPage(S2#state.book, Panel, "Application settings", []),
S2.
-create_double_box(Panel, Sizer, TopLabel,
- OuterText, OuterData,
+create_double_box(Panel, Sizer, TopLabel,
+ OuterText, OuterData,
InnerText, InnerData,
InternalLabel, InternalChoices, InternalChoiceData) ->
TopSizer = wxStaticBoxSizer:new(?wxVERTICAL, Panel,
@@ -457,10 +514,10 @@ create_double_box(Panel, Sizer, TopLabel,
[{userData, OuterData}]),
InnerRadio = wxRadioButton:new(Panel, ?wxID_ANY, InnerText),
wxEvtHandler:connect(InnerRadio, command_radiobutton_selected,
- [{userData, InnerData}]),
- InnerBox = wxRadioBox:new(Panel,
+ [{userData, InnerData}]),
+ InnerBox = wxRadioBox:new(Panel,
?wxID_ANY,
- InternalLabel,
+ InternalLabel,
?wxDefaultPosition,
?wxDefaultSize,
InternalChoices,
@@ -487,29 +544,38 @@ handle_event(#state{sys = Sys, app = App} = S, Wx) ->
#wx{obj = ObjRef, event = #wxMouse{type = enter_window}} ->
wxWindow:setFocus(ObjRef),
S;
- #wx{obj= ListCtrl, userData = mods_list_ctrl, event = #wxSize{type = size, size = {W, _H}}} ->
+ #wx{obj= ListCtrl,
+ userData = mods_list_ctrl,
+ event = #wxSize{type = size, size = {W, _H}}} ->
HasApps = (wxListCtrl:getColumnCount(ListCtrl) > 1),
case HasApps of
false ->
wxListCtrl:setColumnWidth(ListCtrl, ?MODS_MOD_COL, W);
true ->
- wxListCtrl:setColumnWidth(ListCtrl, ?MODS_MOD_COL, (2 * W) div 3),
+ wxListCtrl:setColumnWidth(ListCtrl,
+ ?MODS_MOD_COL,
+ (2 * W) div 3),
wxListCtrl:setColumnWidth(ListCtrl, ?MODS_APP_COL, W div 3)
end,
S;
- #wx{obj= ListCtrl, userData = apps_list_ctrl, event = #wxSize{type = size, size = {W, _H}}} ->
+ #wx{obj = ListCtrl,
+ userData = apps_list_ctrl,
+ event = #wxSize{type = size, size = {W, _H}}} ->
wxListCtrl:setColumnWidth(ListCtrl, ?APPS_APP_COL, W),
S;
#wx{userData = open_app,
obj = ListCtrl,
- event = #wxList{type = command_list_item_activated, itemIndex = Pos}} ->
+ event = #wxList{type = command_list_item_activated,
+ itemIndex = Pos}} ->
AppBase = wxListCtrl:getItemText(ListCtrl, Pos),
{AppName, _AppVsn} = reltool_utils:split_app_name(AppBase),
- {ok, _AppPid} = reltool_sys_win:open_app(S#state.parent_pid, AppName),
+ {ok, _AppPid} = reltool_sys_win:open_app(S#state.parent_pid,
+ AppName),
S;
#wx{userData = open_mod,
obj = ListCtrl,
- event = #wxList{type = command_list_item_activated, itemIndex = Pos}} ->
+ event = #wxList{type = command_list_item_activated,
+ itemIndex = Pos}} ->
ModName = list_to_atom(wxListCtrl:getItemText(ListCtrl, Pos)),
create_mod_window(S, ModName);
#wx{userData = global_incl_cond} ->
@@ -560,16 +626,19 @@ handle_event(#state{sys = Sys, app = App} = S, Wx) ->
Items = reltool_utils:get_items(ListCtrl),
handle_mod_button(S, Items, Action);
_ ->
- error_logger:format("~p~p got unexpected app event from wx:\n\t~p\n",
+ error_logger:format("~p~p got unexpected app event from "
+ "wx:\n\t~p\n",
[?MODULE, self(), Wx]),
S
end.
-create_mod_window(#state{parent_pid = RelPid, xref_pid = Xref, common = C} = S, ModName) ->
+create_mod_window(#state{parent_pid = RelPid, xref_pid = Xref, common = C} = S,
+ ModName) ->
case lists:keysearch(ModName, #mod_win.name, S#state.mod_wins) of
false ->
WxEnv = wx:get_env(),
- {ok, Pid} = reltool_mod_win:start_link(WxEnv, Xref, RelPid, C, ModName),
+ {ok, Pid} =
+ reltool_mod_win:start_link(WxEnv, Xref, RelPid, C, ModName),
MW = #mod_win{name = ModName, pid = Pid},
S#state{mod_wins = [MW | S#state.mod_wins]};
{value, MW} ->
@@ -578,7 +647,9 @@ create_mod_window(#state{parent_pid = RelPid, xref_pid = Xref, common = C} = S,
end.
handle_mod_button(#state{app = App} = S, Items, Action) ->
- App2 = lists:foldl(fun(Item, A) -> move_mod(A, Item, Action) end, App, Items),
+ App2 = lists:foldl(fun(Item, A) -> move_mod(A, Item, Action) end,
+ App,
+ Items),
{ok, App3} = reltool_sys_win:set_app(S#state.parent_pid, App2),
S2 = S#state{app = App3},
redraw_window(S2).
@@ -587,7 +658,7 @@ move_mod(App, {_ItemNo, ModStr}, Action) ->
ModName = list_to_atom(ModStr),
Mods = App#app.mods,
{value, M} = lists:keysearch(ModName, #mod.name, Mods),
- AppCond =
+ AppCond =
case Action of
whitelist_add ->
case M#mod.incl_cond of
@@ -597,12 +668,13 @@ move_mod(App, {_ItemNo, ModStr}, Action) ->
end;
whitelist_del ->
undefined;
- blacklist_add ->
+ blacklist_add ->
exclude;
blacklist_del ->
undefined;
_ ->
- error_logger:format("~p~p got unexpected mod button event: ~p\n\t ~p\n",
+ error_logger:format("~p~p got unexpected mod "
+ "button event: ~p\n\t ~p\n",
[?MODULE, self(), ModName, Action]),
M#mod.incl_cond
end,
@@ -623,7 +695,10 @@ change_mod_cond(S, App, NewModCond) ->
redraw_window(S2).
change_version(S, App, NewDir) ->
- App2 = App#app{active_dir = NewDir, label = undefined, vsn = undefined, info = undefined},
+ App2 = App#app{active_dir = NewDir,
+ label = undefined,
+ vsn = undefined,
+ info = undefined},
{ok, App3} = reltool_sys_win:set_app(S#state.parent_pid, App2),
Title = app_title(App3),
wxFrame:setTitle(S#state.frame, Title),
@@ -635,8 +710,14 @@ redraw_apps(#state{app = #app{info = AppInfo},
app_incl_ctrl = InclCtrl,
app_uses_ctrl = UsesCtrl,
xref_pid = Xref},
- {_SourceMods, _WhiteMods, _BlackMods, _DerivedMods, UsedByMods, UsesMods}) ->
- UsedByApps = lists:usort([{M#mod.app_name, Image} || {Image, _, M} <- UsedByMods]),
+ {_SourceMods,
+ _WhiteMods,
+ _BlackMods,
+ _DerivedMods,
+ UsedByMods,
+ UsesMods}) ->
+ UsedByApps =
+ lists:usort([{M#mod.app_name, Image} || {Image, _, M} <- UsedByMods]),
Select =
fun(AppName) ->
{ok, App} = reltool_server:get_app(Xref, AppName),
@@ -647,7 +728,8 @@ redraw_apps(#state{app = #app{info = AppInfo},
end,
RequiredApps = lists:sort(lists:map(Select, AppInfo#app_info.applications)),
InclApps = lists:map(Select, AppInfo#app_info.incl_apps),
- UsesApps = lists:usort([{M#mod.app_name, Image} || {Image, _, M} <- UsesMods]),
+ UsesApps =
+ lists:usort([{M#mod.app_name, Image} || {Image, _, M} <- UsesMods]),
do_redraw_apps(UsedByCtrl, UsedByApps),
do_redraw_apps(RequiredCtrl, RequiredApps),
do_redraw_apps(InclCtrl, InclApps),
@@ -656,19 +738,26 @@ redraw_apps(#state{app = #app{info = AppInfo},
do_redraw_apps(ListCtrl, []) ->
wxListCtrl:deleteAllItems(ListCtrl);
- %% wxListCtrl:setColumnWidth(ListCtrl, ?APPS_APP_COL, ?wxLIST_AUTOSIZE_USEHEADER);
+ %% wxListCtrl:setColumnWidth(ListCtrl, ?APPS_APP_COL,
+%% ?wxLIST_AUTOSIZE_USEHEADER);
do_redraw_apps(ListCtrl, AppImages) ->
wxListCtrl:deleteAllItems(ListCtrl),
Add =
fun({AppName, ImageId}, {Row, Prev}) when AppName =/= Prev ->
- wxListCtrl:insertItem(ListCtrl, Row, ""),
- if (Row rem 2) =:= 0 ->
- wxListCtrl:setItemBackgroundColour(ListCtrl, Row, {240,240,255});
+ wxListCtrl:insertItem(ListCtrl, Row, ""),
+ if (Row rem 2) =:= 0 ->
+ wxListCtrl:setItemBackgroundColour(ListCtrl,
+ Row,
+ {240,240,255});
true ->
ignore
end,
Str = atom_to_list(AppName),
- wxListCtrl:setItem(ListCtrl, Row, ?APPS_APP_COL, Str, [{imageId, ImageId}]),
+ wxListCtrl:setItem(ListCtrl,
+ Row,
+ ?APPS_APP_COL,
+ Str,
+ [{imageId, ImageId}]),
{Row + 1, AppName};
({_, _}, Acc) ->
Acc
@@ -688,8 +777,13 @@ redraw_mods(#state{mods_source_ctrl = SourceCtrl,
deps_uses_ctrl = UsesCtrl,
app = #app{is_pre_included = IsPre, is_included = IsIncl},
status_bar = Bar},
- {SourceMods, WhiteMods, BlackMods, DerivedMods, UsedByMods, UsesMods}) ->
- InclStatus =
+ {SourceMods,
+ WhiteMods,
+ BlackMods,
+ DerivedMods,
+ UsedByMods,
+ UsesMods}) ->
+ InclStatus =
case IsIncl of
true when IsPre =:= true -> "Whitelist - ";
true -> "Derived - ";
@@ -711,7 +805,7 @@ app_to_mods(#state{xref_pid = Xref, app = App}) ->
SourceMods = [M || M <- App#app.mods,
M#mod.is_included =/= true,
M#mod.is_pre_included =/= false],
- WhiteMods = [M || M <- App#app.mods,
+ WhiteMods = [M || M <- App#app.mods,
M#mod.is_pre_included =:= true],
BlackMods = [M || M <- App#app.mods,
M#mod.is_pre_included =:= false],
@@ -722,7 +816,8 @@ app_to_mods(#state{xref_pid = Xref, app = App}) ->
fun(ModName) when is_atom(ModName) ->
{ok, M} = reltool_server:get_mod(Xref, ModName),
if
- M#mod.app_name =:= App#app.name, M#mod.is_included =:= true ->
+ M#mod.app_name =:= App#app.name,
+ M#mod.is_included =:= true ->
false;
true ->
{true, M}
@@ -780,20 +875,26 @@ opt_redraw_mods(undefined, _ImageMods) ->
opt_redraw_mods(ListCtrl, ImageMods) ->
HasApps = (wxListCtrl:getColumnCount(ListCtrl) > 1),
do_redraw_mods(ListCtrl, ImageMods, HasApps).
-
+
do_redraw_mods(ListCtrl, [], _HasApps) ->
wxListCtrl:deleteAllItems(ListCtrl);
do_redraw_mods(ListCtrl, ImageMods, HasApps) ->
wxListCtrl:deleteAllItems(ListCtrl),
Add =
fun({ImageId, AppName, #mod{name = ModName}}, Row) ->
- wxListCtrl:insertItem(ListCtrl, Row, ""),
- if (Row rem 2) =:= 0 ->
- wxListCtrl:setItemBackgroundColour(ListCtrl, Row, {240,240,255});
+ wxListCtrl:insertItem(ListCtrl, Row, ""),
+ if (Row rem 2) =:= 0 ->
+ wxListCtrl:setItemBackgroundColour(ListCtrl,
+ Row,
+ {240,240,255});
true ->
ignore
end,
- wxListCtrl:setItem(ListCtrl, Row, ?MODS_MOD_COL, atom_to_list(ModName), [{imageId, ImageId}]),
+ wxListCtrl:setItem(ListCtrl,
+ Row,
+ ?MODS_MOD_COL,
+ atom_to_list(ModName),
+ [{imageId, ImageId}]),
case HasApps of
false ->
ok;
@@ -842,13 +943,14 @@ redraw_config(#state{sys = #sys{incl_cond = GlobalIncl,
SelectedRadio,
SourceBox,
fun(true) ->
- reltool_utils:elem_to_index(ActiveDir, SortedDirs) - 1;
+ reltool_utils:elem_to_index(ActiveDir,
+ SortedDirs) - 1;
(false) ->
0
end).
redraw_double_box(Global, Local, GlobalRadio, LocalRadio, LocalBox, GetChoice) ->
- AppCond =
+ AppCond =
case Local of
undefined ->
wxRadioButton:setValue(GlobalRadio, true),
diff --git a/lib/reltool/src/reltool_fgraph.erl b/lib/reltool/src/reltool_fgraph.erl
index 09c4f8c8ce..2e8f39e418 100644
--- a/lib/reltool/src/reltool_fgraph.erl
+++ b/lib/reltool/src/reltool_fgraph.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2009-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
-module(reltool_fgraph).
@@ -80,7 +80,7 @@ foreach(Fun, Fg) ->
end, Fg),
Fg.
-map(Fun, Fg) ->
+map(Fun, Fg) ->
lists:foreach(fun
(Key) -> put(Key,Fun(get(Key)))
end, Fg),
@@ -105,7 +105,9 @@ step(Vs, Es) -> step(Vs, Es, {0,0}).
step(Vs, Es, Pa) ->
?MODULE:map(fun
(Node = {_, #fg_v{ type = static }}) -> Node;
- ({Key, Value = #fg_v{ p = {Px, Py}, v = {Vx, Vy}, type = dynamic}}) when is_float(Px), is_float(Py), is_float(Vx), is_float(Vy) ->
+ ({Key, Value = #fg_v{ p = {Px, Py}, v = {Vx, Vy}, type = dynamic}})
+ when is_float(Px), is_float(Py),
+ is_float(Vx), is_float(Vy) ->
F0 = {0.0,0.0},
F1 = coulomb_repulsion(Key, Value, Vs, F0),
F2 = hooke_attraction(Key, Value, Vs, Es, F1),
@@ -115,7 +117,7 @@ step(Vs, Es, Pa) ->
Vx1 = (Vx + ?fg_th*Fx)*?fg_damp,
Vy1 = (Vy + ?fg_th*Fy)*?fg_damp,
-
+
Px1 = Px + ?fg_th*Vx1,
Py1 = Py + ?fg_th*Vy1,
@@ -123,14 +125,16 @@ step(Vs, Es, Pa) ->
(Node) -> Node
end, Vs).
-point_attraction(_, #fg_v{ p = P0 }, Pa, {Fx, Fy}) when is_float(Fx), is_float(Fy) ->
+point_attraction(_, #fg_v{ p = P0 }, Pa, {Fx, Fy})
+ when is_float(Fx), is_float(Fy) ->
K = 20,
L = 150,
{R, {Cx,Cy}} = composition(P0, Pa),
F = -K*?fg_stretch*(R - L),
{Fx + Cx*F, Fy + Cy*F}.
-
-coulomb_repulsion(K0, #fg_v{ p = P0, q = Q0}, Vs, {Fx0, Fy0}) when is_float(Fx0), is_float(Fy0) ->
+
+coulomb_repulsion(K0, #fg_v{ p = P0, q = Q0}, Vs, {Fx0, Fy0})
+ when is_float(Fx0), is_float(Fy0) ->
?MODULE:foldl(fun
({K1, _}, F) when K1 == K0 -> F;
({_, #fg_v{ p = P1, q = Q1}}, {Fx, Fy}) ->
@@ -140,7 +144,8 @@ coulomb_repulsion(K0, #fg_v{ p = P0, q = Q0}, Vs, {Fx0, Fy0}) when is_float(Fx0)
(_, F) -> F
end, {Fx0, Fy0}, Vs).
-hooke_attraction(Key0, #fg_v{ p = P0 }, Vs, Es, {Fx0, Fy0}) when is_float(Fx0), is_float(Fy0) ->
+hooke_attraction(Key0, #fg_v{ p = P0 }, Vs, Es, {Fx0, Fy0})
+ when is_float(Fx0), is_float(Fy0) ->
?MODULE:foldl(fun
({{Key1,Key1}, _}, F) -> F;
({{Key1,Key2}, #fg_e{ l = L, k = K}}, {Fx, Fy}) when Key1 =:= Key0->
@@ -153,10 +158,11 @@ hooke_attraction(Key0, #fg_v{ p = P0 }, Vs, Es, {Fx0, Fy0}) when is_float(Fx0),
{R, {Cx,Cy}} = composition(P0, P1),
F = -K*?fg_stretch*(R - L),
{Fx + Cx*F, Fy + Cy*F};
- (_, F) -> F
+ (_, F) -> F
end, {Fx0, Fy0}, Es).
-composition({Px1, Py1}, {Px0, Py0}) when is_float(Px1), is_float(Py1), is_float(Px0), is_float(Py0) ->
+composition({Px1, Py1}, {Px0, Py0})
+ when is_float(Px1), is_float(Py1), is_float(Px0), is_float(Py0) ->
Dx = Px1 - Px0,
Dy = Py1 - Py0,
R = math:sqrt(Dx*Dx + Dy*Dy + 0.001),
diff --git a/lib/reltool/src/reltool_fgraph_win.erl b/lib/reltool/src/reltool_fgraph_win.erl
index b063fb94ba..b0deb1bab2 100644
--- a/lib/reltool/src/reltool_fgraph_win.erl
+++ b/lib/reltool/src/reltool_fgraph_win.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2009-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
-module(reltool_fgraph_win).
@@ -95,7 +95,7 @@ change_node(Pid, Key, Color) -> Pid ! {change_node, Key, Color}.
add_link(Pid, {FromKey, ToKey}) -> Pid ! {add_link, {FromKey, ToKey}}.
del_link(Pid, {FromKey, ToKey}) -> Pid ! {del_link, {FromKey, ToKey}}.
-stop(Pid, Reason) ->
+stop(Pid, Reason) ->
Ref = erlang:monitor(process, Pid),
Pid ! {stop, Reason},
receive
@@ -110,21 +110,24 @@ new(Parent, Options) ->
Me = self(),
Pid = spawn_link(fun() -> init([Parent, Me, Env, Options]) end),
receive {Pid, {?MODULE, Panel}} -> {Pid,Panel} end.
-
+
init([ParentWin, Pid, Env, Options]) ->
wx:set_env(Env),
-
+
BReset = wxButton:new(ParentWin, ?reset, [{label,"Reset"}]),
BFreeze = wxButton:new(ParentWin, ?freeze, [{label,"Freeze"}]),
BLock = wxButton:new(ParentWin, ?lock, [{label,"Lock"}]),
BUnlock = wxButton:new(ParentWin, ?unlock, [{label,"Unlock"}]),
BDelete = wxButton:new(ParentWin, ?delete, [{label,"Delete"}]),
- SQ = wxSlider:new(ParentWin, ?q_slider, ?default_q, 1, 500, [{style, ?wxVERTICAL}]),
- SL = wxSlider:new(ParentWin, ?l_slider, ?default_l, 1, 500, [{style, ?wxVERTICAL}]),
- SK = wxSlider:new(ParentWin, ?k_slider, ?default_k, 1, 500, [{style, ?wxVERTICAL}]),
+ SQ = wxSlider:new(ParentWin, ?q_slider, ?default_q, 1, 500,
+ [{style, ?wxVERTICAL}]),
+ SL = wxSlider:new(ParentWin, ?l_slider, ?default_l, 1, 500,
+ [{style, ?wxVERTICAL}]),
+ SK = wxSlider:new(ParentWin, ?k_slider, ?default_k, 1, 500,
+ [{style, ?wxVERTICAL}]),
Win = wxWindow:new(ParentWin, ?wxID_ANY, Options),
-
+
ButtonSizer = wxBoxSizer:new(?wxVERTICAL),
wxSizer:add(ButtonSizer, BReset),
wxSizer:add(ButtonSizer, BFreeze),
@@ -141,31 +144,34 @@ init([ParentWin, Pid, Env, Options]) ->
WindowSizer = wxBoxSizer:new(?wxHORIZONTAL),
wxSizer:add(WindowSizer, ButtonSizer, [{flag, ?wxEXPAND}, {proportion, 0}]),
wxSizer:add(WindowSizer, Win, [{flag, ?wxEXPAND}, {proportion, 1}]),
-
+
wxButton:setToolTip(BReset, "Remove selection and unlock all nodes."),
wxButton:setToolTip(BFreeze, "Start/stop redraw of screen."),
wxButton:setToolTip(BLock, "Lock all selected nodes."),
wxButton:setToolTip(BUnlock, "Unlock all selected nodes."),
wxButton:setToolTip(BDelete, "Delete all selected nodes."),
- wxButton:setToolTip(SQ, "Control repulsive force. This can also be controlled with the mouse wheel on the canvas."),
+ wxButton:setToolTip(SQ, "Control repulsive force. This can also be"
+ " controlled with the mouse wheel on the canvas."),
wxButton:setToolTip(SL, "Control link length."),
wxButton:setToolTip(SK, "Control attractive force. Use with care."),
- wxButton:setToolTip(Win,
- "Drag mouse while left mouse button is pressed to perform various operations. "
- "Combine with control key to select. Combine with shift key to lock single node."),
+ wxButton:setToolTip(Win,
+ "Drag mouse while left mouse button is pressed "
+ "to perform various operations. "
+ "Combine with control key to select. Combine "
+ "with shift key to lock single node."),
wxButton:connect(BReset, command_button_clicked),
wxButton:connect(BFreeze, command_button_clicked),
wxButton:connect(BLock, command_button_clicked),
wxButton:connect(BUnlock, command_button_clicked),
wxButton:connect(BDelete, command_button_clicked),
-
+
wxWindow:connect(SQ, command_slider_updated),
wxWindow:connect(SL, command_slider_updated),
wxWindow:connect(SK, command_slider_updated),
-
- wxWindow:connect(Win, enter_window),
+
+ wxWindow:connect(Win, enter_window),
wxWindow:connect(Win, move),
wxWindow:connect(Win, motion),
wxWindow:connect(Win, mousewheel),
@@ -174,7 +180,7 @@ init([ParentWin, Pid, Env, Options]) ->
wxWindow:connect(Win, left_up),
wxWindow:connect(Win, right_down),
wxWindow:connect(Win, paint, [{skip, true}]),
-
+
Pen = wxPen:new({0,0,0}, [{width, 3}]),
Font = wxFont:new(12, ?wxSWISS, ?wxNORMAL, ?wxNORMAL,[]),
Brush = wxBrush:new({0,0,0}),
@@ -182,13 +188,13 @@ init([ParentWin, Pid, Env, Options]) ->
Pid ! {self(), {?MODULE, WindowSizer}},
wxWindow:setFocus(Win), %% Get keyboard focus
-
+
Vs = reltool_fgraph:new(),
Es = reltool_fgraph:new(),
Me = self(),
Ticker = spawn_link(fun() -> ticker_init(Me) end),
-
+
loop( #state{ parent_pid = Pid,
q_slider = SQ,
l_slider = SL,
@@ -215,14 +221,17 @@ graph_add_node(Key, Color, G = #graph{ vs = Vs}) ->
M = 0.5, % mass
P = {float(450 + random:uniform(100)),
float(450 + random:uniform(100))},
- G#graph{ vs = reltool_fgraph:add(Key, #fg_v{ p = P, m = M, q = Q, color = Color}, Vs)}.
+ G#graph{ vs = reltool_fgraph:add(Key,
+ #fg_v{ p = P, m = M, q = Q, color = Color},
+ Vs)}.
graph_change_node(Key, Color, G) ->
case reltool_fgraph:get(Key, G#graph.vs) of
- undefined ->
+ undefined ->
G;
V ->
- G#graph{ vs = reltool_fgraph:set(Key, V#fg_v{ color = Color }, G#graph.vs)}
+ G#graph{ vs = reltool_fgraph:set(Key, V#fg_v{ color = Color },
+ G#graph.vs)}
end.
graph_del_node(Key, G = #graph{ vs = Vs0, es = Es0}) ->
@@ -231,7 +240,7 @@ graph_del_node(Key, G = #graph{ vs = Vs0, es = Es0}) ->
G#graph{ vs = Vs, es = Es }.
graph_add_link(Key0, Key1, G = #graph{ es = Es}) ->
- K = 60.0, % attractive force
+ K = 60.0, % attractive force
L = 5.0, % spring length
G#graph{ es = reltool_fgraph:add({Key0, Key1}, #fg_e{ k = K, l = L}, Es) }.
@@ -249,15 +258,17 @@ ticker_loop(Pid, Time) ->
D = timer:now_diff(T1, T0)/1000,
case round(40 - D) of
Ms when Ms < 0 ->
- %io:format("ticker: wait is 0 ms [fg ~7s ms] [fps ~7s]~n", [s(D), s(1000/D)]),
+ %io:format("ticker: wait is 0 ms [fg ~7s ms] [fps ~7s]~n",
+ % [s(D), s(1000/D)]),
ticker_loop(Pid, 0);
Ms ->
- %io:format("ticker: wait is ~3s ms [fg ~7s ms] [fps ~7s]~n", [s(Ms), s(D), s(1000/40)]),
+ %io:format("ticker: wait is ~3s ms [fg ~7s ms] [fps ~7s]~n",
+ % [s(Ms), s(D), s(1000/40)]),
ticker_loop(Pid, Ms)
end
end.
-delete_edges(Es, []) ->
+delete_edges(Es, []) ->
Es;
delete_edges(Es, [Key|Keys]) ->
Edges = reltool_fgraph:foldl(fun
@@ -269,7 +280,7 @@ delete_edges(Es, [Key|Keys]) ->
(K, Esi) -> reltool_fgraph:del(K, Esi)
end, Es, Edges),
delete_edges(Es1, Keys).
-
+
set_charge(Q, Vs) -> % Repulsive force
F = fun({Key, Value}) -> {Key, Value#fg_v{ q = Q}} end,
@@ -295,36 +306,47 @@ loop(S, G) ->
wxSlider:setValue(S#state.k_slider, K),
Es = set_length(L, G#graph.es),
Es2 = set_spring(K, Es),
-
- Vs2 = reltool_fgraph:map(fun({Key, V}) ->
- {Key, V#fg_v{selected = false, type = dynamic, q = Q}}
- end,
- G#graph.vs),
-
- {Xs, Ys} = reltool_fgraph:foldl(fun({_Key, #fg_v{p = {X, Y}}}, {Xs, Ys}) ->
- {[X| Xs], [Y | Ys]}
- end,
- {[], []},
- Vs2),
+
+ Vs2 =
+ reltool_fgraph:map(fun({Key, V}) ->
+ {Key, V#fg_v{selected = false,
+ type = dynamic,
+ q = Q}}
+ end,
+ G#graph.vs),
+
+ {Xs, Ys} =
+ reltool_fgraph:foldl(fun({_Key,
+ #fg_v{p = {X, Y}}}, {Xs, Ys}) ->
+ {[X| Xs], [Y | Ys]}
+ end,
+ {[], []},
+ Vs2),
%% io:format("Before: ~p\n", [G#graph.offset]),
Offset =
case length(Xs) of
0 ->
{0, 0};
N ->
- MeanX = (lists:sum(Xs) / N),
+ MeanX = (lists:sum(Xs) / N),
MeanY = (lists:sum(Ys) / N),
{SizeX, SizeY} = wxWindow:getSize(S#state.window),
- %% io:format("Min: ~p\n", [{lists:min(Xs), lists:min(Ys)}]),
- %% io:format("Mean: ~p\n", [{MeanX, MeanY}]),
- %% io:format("Max: ~p\n", [{lists:max(Xs), lists:max(Ys)}]),
+ %% io:format("Min: ~p\n",
+ %% [{lists:min(Xs), lists:min(Ys)}]),
+ %% io:format("Mean: ~p\n",
+ %% [{MeanX, MeanY}]),
+ %% io:format("Max: ~p\n",
+ %% [{lists:max(Xs), lists:max(Ys)}]),
%% io:format("Size: ~p\n", [{SizeX, SizeY}]),
%% {XM - (XS / 2), YM - (YS / 2)}
%% {0 - lists:min(Xs) + 20, 0 - lists:min(Ys) + 20}
{0 - MeanX + (SizeX / 2), 0 - MeanY + (SizeY / 2)}
end,
%% io:format("After: ~p\n", [Offset]),
- loop(S, G#graph{vs = Vs2, es = Es2, offset = Offset, offset_state = false});
+ loop(S, G#graph{vs = Vs2,
+ es = Es2,
+ offset = Offset,
+ offset_state = false});
#wx{id = ?freeze, event = #wxCommand{type=command_button_clicked}} ->
%% Start/stop redraw of screen
IsFrozen =
@@ -354,10 +376,15 @@ loop(S, G) ->
loop(S, G#graph{ vs = Vs });
#wx{id = ?delete, event = #wxCommand{type=command_button_clicked}} ->
%% Delete all selected nodes
- {Vs1, Keys} = reltool_fgraph:foldl(fun
- ({Key, #fg_v{ selected = true}}, {Vs, Ks}) ->
- {reltool_fgraph:del(Key,Vs), [Key|Ks]};
- (_, {Vs, Ks}) -> {Vs, Ks}
+ {Vs1, Keys} =
+ reltool_fgraph:foldl(fun
+ ({Key,
+ #fg_v{ selected = true}},
+ {Vs, Ks}) ->
+ {reltool_fgraph:del(Key,Vs),
+ [Key|Ks]};
+ (_, {Vs, Ks}) ->
+ {Vs, Ks}
end, {G#graph.vs,[]}, G#graph.vs),
Es = delete_edges(G#graph.es, Keys),
loop(S, G#graph{ vs = Vs1, es = Es});
@@ -368,20 +395,26 @@ loop(S, G) ->
#wx{id = ?move, event = #wxCommand{type=command_button_clicked}} ->
loop(S#state{ mouse_act = ?move }, G);
- #wx{id = ?q_slider, event = #wxCommand{type=command_slider_updated, commandInt = Q}} ->
+ #wx{id = ?q_slider, event = #wxCommand{type=command_slider_updated,
+ commandInt = Q}} ->
loop(S, G#graph{ vs = set_charge(Q, G#graph.vs)});
- #wx{id = ?l_slider, event = #wxCommand{type=command_slider_updated, commandInt = L}} ->
+ #wx{id = ?l_slider, event = #wxCommand{type=command_slider_updated,
+ commandInt = L}} ->
loop(S, G#graph{ es = set_length(L, G#graph.es)});
- #wx{id = ?k_slider, event = #wxCommand{type=command_slider_updated, commandInt = K}} ->
+ #wx{id = ?k_slider, event = #wxCommand{type=command_slider_updated,
+ commandInt = K}} ->
loop(S, G#graph{ es = set_spring(K, G#graph.es)});
#wx{event=#wxKey{type=key_up, keyCode = 127}} -> % delete
{Vs1, Keys} =
- reltool_fgraph:foldl(fun({Key, #fg_v{ selected = true}}, {Vs, Ks}) ->
- {reltool_fgraph:del(Key,Vs), [Key|Ks]};
- (_, {Vs, Ks}) ->
- {Vs, Ks}
- end,
- {G#graph.vs,[]}, G#graph.vs),
+ reltool_fgraph:foldl(fun({Key,
+ #fg_v{ selected = true}},
+ {Vs, Ks}) ->
+ {reltool_fgraph:del(Key,Vs),
+ [Key|Ks]};
+ (_, {Vs, Ks}) ->
+ {Vs, Ks}
+ end,
+ {G#graph.vs,[]}, G#graph.vs),
Es = delete_edges(G#graph.es, Keys),
loop(S, G#graph{ vs = Vs1, es = Es});
#wx{event=#wxKey{type=key_up}} ->
@@ -390,7 +423,11 @@ loop(S, G) ->
loop(S, G);
%% mouse
- #wx{event=#wxMouse{type=left_down, shiftDown=Shift, controlDown=Ctrl, x=X, y=Y}} ->
+ #wx{event=#wxMouse{type=left_down,
+ shiftDown=Shift,
+ controlDown=Ctrl,
+ x=X,
+ y=Y}} ->
if
Shift ->
loop(S, mouse_left_down_move(G, {X,Y}));
@@ -401,7 +438,11 @@ loop(S, G) ->
S#state.mouse_act =:= ?select ->
loop(S, mouse_left_down_select(G, {X,Y}))
end;
- #wx{event=#wxMouse{type=motion, shiftDown=Shift, controlDown=Ctrl, x=X, y=Y}} ->
+ #wx{event=#wxMouse{type=motion,
+ shiftDown=Shift,
+ controlDown=Ctrl,
+ x=X,
+ y=Y}} ->
if
Shift ->
loop(S, mouse_motion_move(G, {X,Y}));
@@ -412,7 +453,9 @@ loop(S, G) ->
S#state.mouse_act =:= ?select ->
loop(S, mouse_motion_select(G, {X,Y}))
end;
- #wx{event=#wxMouse{type=left_up, shiftDown=Shift, controlDown=Ctrl, x=X, y=Y}} ->
+ #wx{event=#wxMouse{type=left_up,
+ shiftDown=Shift,
+ controlDown=Ctrl, x=X, y=Y}} ->
if
Shift ->
loop(S, mouse_left_up_move(G, {X,Y}, Shift));
@@ -424,7 +467,7 @@ loop(S, G) ->
loop(S, mouse_left_up_select(G, {X,Y}))
end;
- #wx{event=#wxMouse{type=right_down,x=_X,y=_Y}} ->
+ #wx{event=#wxMouse{type=right_down,x=_X,y=_Y}} ->
loop(S, G);
%% mouse wheel
#wx{event=#wxMouse{type=mousewheel, wheelRotation=Rotation}} ->
@@ -436,7 +479,7 @@ loop(S, G) ->
Rotation < 0 ->
wxSlider:setValue(S#state.q_slider, Q + 4),
loop(S, G#graph{ vs = set_charge(Q + 4, G#graph.vs) });
- true ->
+ true ->
loop(S, G)
end;
@@ -448,7 +491,7 @@ loop(S, G) ->
redraw(S, G),
loop(S, G);
#wx{obj=Win,event=#wxMouse{type=enter_window}} ->
- wxWindow:setFocus(Win),
+ wxWindow:setFocus(Win),
loop(S, G);
%% Graph manipulation
@@ -465,9 +508,11 @@ loop(S, G) ->
{Req, redraw} ->
{SizeX, SizeY} = wxWindow:getSize(S#state.window),
- Vs = reltool_fgraph:step(G#graph.vs, G#graph.es, {SizeX/2.0 - 20.0, SizeY/2.0}),
+ Vs = reltool_fgraph:step(G#graph.vs,
+ G#graph.es,
+ {SizeX/2.0 - 20.0, SizeY/2.0}),
case S#state.is_frozen of
- false ->
+ false ->
Req ! {self(), ok};
true ->
ignore
@@ -481,7 +526,7 @@ loop(S, G) ->
Other ->
error_logger:format("~p~p got unexpected message:\n\t~p\n",
- [?MODULE, self(), Other]),
+ [?MODULE, self(), Other]),
loop(S, G)
end.
@@ -494,17 +539,22 @@ mouse_left_down_move(#graph{vs = Vs} = G, {X, Y}) ->
false ->
G#graph{ offset_state = {X,Y}};
{true, Key} ->
- V = #fg_v{ type = Type} = reltool_fgraph:get(Key, Vs),
- G#graph{ vs = reltool_fgraph:set(Key, V#fg_v{ type = moving}, Vs), select = {node, Key, Type, X, Y} }
+ V = #fg_v{ type = Type} = reltool_fgraph:get(Key, Vs),
+ G#graph{ vs = reltool_fgraph:set(Key,
+ V#fg_v{ type = moving}, Vs),
+ select = {node, Key, Type, X, Y} }
end.
coord_to_key(#graph{vs = Vs, offset = {Xo, Yo}}, {X, Y}) ->
Xr = X - Xo,
Yr = Y - Yo,
- reltool_fgraph:foldl(fun({Key, #fg_v{ p = {Px, Py}}}, _) when abs(Px - Xr) < 10,
- abs(Py - Yr) < 10 -> {true, Key};
- (_, Out) -> Out
- end, false, Vs).
+ reltool_fgraph:foldl(fun({Key, #fg_v{ p = {Px, Py}}}, _)
+ when abs(Px - Xr) < 10,
+ abs(Py - Yr) < 10 ->
+ {true, Key};
+ (_, Out) ->
+ Out
+ end, false, Vs).
mouse_left_up_select(G, {_X,_Y}) ->
case G#graph.select of
@@ -524,7 +574,7 @@ mouse_left_up_select(G, {_X,_Y}) ->
_ ->
G#graph{ select = none}
end.
-
+
mouse_left_up_move(G = #graph{ select = Select, vs = Vs} = G, {X,Y}, Shift) ->
case Select of
{node, Key, _, X, Y} ->
@@ -543,7 +593,7 @@ mouse_left_up_move(G = #graph{ select = Select, vs = Vs} = G, {X,Y}, Shift) ->
_ ->
G#graph{ select = none, offset_state = false }
end.
-
+
mouse_motion_select(G, {X,Y}) ->
case G#graph.select of
{P0, _P1} -> G#graph{ select = {P0, {X,Y}}};
@@ -557,11 +607,11 @@ mouse_motion_move(G = #graph{ select = {node, Key, _, _, _}, vs = Vs}, {X,Y}) ->
G#graph{ vs = reltool_fgraph:set(Key, V2, Vs) };
mouse_motion_move(G, {X,Y}) ->
case G#graph.offset_state of
- {X1,Y1} ->
+ {X1,Y1} ->
{X0, Y0} = G#graph.offset,
G#graph{ offset_state = {X,Y},
offset = {X0 - (X1 - X), Y0 - (Y1 - Y)} };
- _ ->
+ _ ->
G
end.
@@ -574,9 +624,9 @@ redraw(#state{window=Win}, G) ->
wxClientDC:destroy(DC0),
ok.
-redraw(DC, _Size, G) ->
- wx:batch(fun() ->
-
+redraw(DC, _Size, G) ->
+ wx:batch(fun() ->
+
Pen = G#graph.pen,
Font = G#graph.font,
Brush = G#graph.brush,
@@ -587,7 +637,7 @@ redraw(DC, _Size, G) ->
wxPen:setWidth(Pen, 1),
wxDC:clear(DC),
- % draw vertices and edges
+ % draw vertices and edges
wxPen:setColour(Pen, ?color_fg),
wxDC:setPen(DC,Pen),
@@ -602,7 +652,9 @@ redraw(DC, _Size, G) ->
% draw information text
wxFont:setWeight(Font,?wxNORMAL),
- draw_text(DC, reltool_fgraph:size(G#graph.vs), reltool_fgraph:size(G#graph.es), G#graph.ke),
+ draw_text(DC,
+ reltool_fgraph:'size'(G#graph.vs),
+ reltool_fgraph:'size'(G#graph.es), G#graph.ke),
ok
end).
@@ -612,14 +664,14 @@ draw_select_box(DC, {{X0,Y0}, {X1,Y1}}) ->
draw_line(DC, {X1,Y1}, {X0,Y1}, {0,0}),
draw_line(DC, {X0,Y0}, {X0,Y1}, {0,0}),
ok;
-draw_select_box(_DC, _) ->
+draw_select_box(_DC, _) ->
ok.
draw_es(DC, Vs, Es, Po, Pen, Brush) ->
reltool_fgraph:foreach(fun
({{K1, K2}, _}) ->
- #fg_v{ p = P1} = reltool_fgraph:get(K1, Vs),
- #fg_v{ p = P2} = reltool_fgraph:get(K2, Vs),
+ #fg_v{ p = P1} = reltool_fgraph:'get'(K1, Vs),
+ #fg_v{ p = P2} = reltool_fgraph:'get'(K2, Vs),
draw_arrow(DC, P1, P2, Po, Pen, Brush)
end, Es).
@@ -650,10 +702,15 @@ draw_arrow(DC, {X0,Y0}, {X1, Y1}, {X, Y}, Pen, Brush) ->
wxDC:drawPolygon(DC, Points, []).
draw_line(DC, {X0,Y0}, {X1, Y1}, {X, Y}) ->
- wxDC:drawLine(DC, {round(X0 + X), round(Y0 + Y)}, {round(X1 + X), round(Y1 + Y)}).
-
+ wxDC:drawLine(DC,
+ {round(X0 + X), round(Y0 + Y)},
+ {round(X1 + X), round(Y1 + Y)}).
+
draw_vs(DC, Vs, {Xo, Yo}, Pen, Brush) ->
- reltool_fgraph:foreach(fun({Key, #fg_v{ p ={X, Y}, color = Color, selected = Sel}}) ->
+ reltool_fgraph:foreach(fun({Key,
+ #fg_v{p ={X, Y},
+ color = Color,
+ selected = Sel}}) ->
String = s(Key),
case Sel of
true ->
@@ -661,35 +718,49 @@ draw_vs(DC, Vs, {Xo, Yo}, Pen, Brush) ->
wxBrush:setColour(Brush, ?color_bg),
wxDC:setPen(DC,Pen),
wxDC:setBrush(DC, Brush),
- SelProps = {round(X-12 + Xo), round(Y-12 + Yo), 24, 24},
- wxDC:drawRoundedRectangle(DC, SelProps, float(?ARC_R)),
+ SelProps = {round(X-12 + Xo),
+ round(Y-12 + Yo),
+ 24,
+ 24},
+ wxDC:drawRoundedRectangle(DC,
+ SelProps,
+ float(?ARC_R)),
ok;
false ->
ok
end,
case Color of
- default ->
+ default ->
wxPen:setColour(Pen, ?color_default),
- wxBrush:setColour(Brush, ?color_default_bg);
- alternate ->
- wxPen:setColour(Pen, ?color_alternate),
- wxBrush:setColour(Brush, ?color_alternate_bg);
+ wxBrush:setColour(Brush,
+ ?color_default_bg);
+ alternate ->
+ wxPen:setColour(Pen,
+ ?color_alternate),
+ wxBrush:setColour(Brush,
+ ?color_alternate_bg);
{FgColor, BgColor} ->
wxPen:setColour(Pen, FgColor),
- wxBrush:setColour(Brush, BgColor);
+ wxBrush:setColour(Brush, BgColor);
Color ->
wxPen:setColour(Pen, Color),
wxBrush:setColour(Brush, Color)
end,
wxDC:setPen(DC,Pen),
wxDC:setBrush(DC, Brush),
- NodeProps = {round(X-8 + Xo),round(Y-8 + Yo),17,17},
- wxDC:drawRoundedRectangle(DC, NodeProps, float(?ARC_R)),
- wxDC:drawText(DC, String, {round(X + Xo), round(Y + Yo)}),
+ NodeProps = {round(X-8 + Xo),
+ round(Y-8 + Yo),17,17},
+ wxDC:drawRoundedRectangle(DC,
+ NodeProps,
+ float(?ARC_R)),
+ wxDC:drawText(DC,
+ String,
+ {round(X + Xo),
+ round(Y + Yo)}),
ok;
(_) ->
ok
- end,
+ end,
Vs).
draw_text(DC, Nvs, Nes, _KE) ->
@@ -720,7 +791,7 @@ calc_point({X, Y}, Length, Radians) ->
%% %% Convert from an angle in radians to degrees
%% radians_to_degrees(Radians) ->
%% Radians * 180 / math:pi().
-%%
+%%
%% %% Convert from an angle in degrees to radians
%% degrees_to_radians(Degrees) ->
%% Degrees * math:pi() / 180.
diff --git a/lib/reltool/src/reltool_mod_win.erl b/lib/reltool/src/reltool_mod_win.erl
index c05f73cde8..c2544cc2d8 100644
--- a/lib/reltool/src/reltool_mod_win.erl
+++ b/lib/reltool/src/reltool_mod_win.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2009-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
-module(reltool_mod_win).
@@ -34,7 +34,7 @@
-include_lib("wx/include/wx.hrl").
-include("reltool.hrl").
--record(state,
+-record(state,
{parent_pid,
xref_pid,
rel_pid,
@@ -73,7 +73,7 @@
-define(WIN_HEIGHT, 600).
-define(CLOSE_ITEM, ?wxID_EXIT). %% Use OS specific version if available
--define(ABOUT_ITEM, ?wxID_ABOUT). %% Use OS specific
+-define(ABOUT_ITEM, ?wxID_ABOUT). %% Use OS specific
-define(CONTENTS_ITEM, 300).
-define(SEARCH_ENTRY, 413).
-define(GOTO_ENTRY, 414).
@@ -87,7 +87,11 @@
%% Client
start_link(WxEnv, Xref, RelPid, Common, ModName) ->
- proc_lib:start_link(?MODULE, init, [self(), WxEnv, Xref, RelPid, Common, ModName], infinity, []).
+ proc_lib:start_link(?MODULE,
+ init,
+ [self(), WxEnv, Xref, RelPid, Common, ModName],
+ infinity,
+ []).
raise(Pid) ->
reltool_utils:cast(Pid, raise).
@@ -127,10 +131,15 @@ loop(#state{xref_pid = Xref, common = C, mod = Mod} = S) ->
receive
Msg ->
%% io:format("~s~p -> ~p\n", [S#state.name, self(), Msg]),
- case Msg of
+ case Msg of
{system, From, SysMsg} ->
Dbg = C#common.sys_debug,
- sys:handle_system_msg(SysMsg, From, S#state.parent_pid, ?MODULE, Dbg, S);
+ sys:handle_system_msg(SysMsg,
+ From,
+ S#state.parent_pid,
+ ?MODULE,
+ Dbg,
+ S);
{cast, _From, raise} ->
wxFrame:raise(S#state.frame),
wxFrame:setFocus(S#state.frame),
@@ -169,7 +178,7 @@ loop(#state{xref_pid = Xref, common = C, mod = Mod} = S) ->
create_window(#state{mod = Mod, name = ModStr} = S) ->
Title = atom_to_list(?APPLICATION) ++ " - " ++
- atom_to_list(Mod#mod.app_name) ++ " - " ++
+ atom_to_list(Mod#mod.app_name) ++ " - " ++
ModStr ++ ".erl",
Frame = wxFrame:new(wx:null(), ?wxID_ANY, Title, []),
%% wxFrame:setSize(Frame, {?WIN_WIDTH, ?WIN_HEIGHT}),
@@ -177,7 +186,7 @@ create_window(#state{mod = Mod, name = ModStr} = S) ->
StatusBar = wxFrame:createStatusBar(Frame,[]),
Book = wxNotebook:new(Panel, ?wxID_ANY, []),
-
+
S2 = S#state{frame = Frame,
panel = Panel,
book = Book,
@@ -204,11 +213,17 @@ create_deps_page(S) ->
Panel = wxPanel:new(S#state.book, []),
Main = wxBoxSizer:new(?wxHORIZONTAL),
- UsedByCtrl = create_mods_list_ctrl(Panel, Main, "Modules used by others", " and their applications"),
+ UsedByCtrl = create_mods_list_ctrl(Panel,
+ Main,
+ "Modules used by others",
+ " and their applications"),
wxSizer:add(Main,
wxStaticLine:new(Panel, [{style, ?wxLI_VERTICAL}]),
[{border, 2}, {flag, ?wxALL bor ?wxEXPAND}]),
- UsesCtrl = create_mods_list_ctrl(Panel, Main, "Used modules", " and their applications"),
+ UsesCtrl = create_mods_list_ctrl(Panel,
+ Main,
+ "Used modules",
+ " and their applications"),
S2 = S#state{deps_used_by_ctrl = UsedByCtrl,
deps_uses_ctrl = UsesCtrl},
redraw_mods(S2),
@@ -242,8 +257,10 @@ create_mods_list_ctrl(Panel, Sizer, ModText, AppText) ->
%% wxListCtrl:setColumnWidth(ListCtrl, ?MODS_APP_COL, ?MODS_APP_COL_WIDTH),
wxListItem:destroy(ListItem),
- wxEvtHandler:connect(ListCtrl, size, [{skip, true}, {userData, mods_list_ctrl}]),
- wxListCtrl:connect(ListCtrl, command_list_item_activated, [{userData, open_app}]),
+ wxEvtHandler:connect(ListCtrl, size,
+ [{skip, true}, {userData, mods_list_ctrl}]),
+ wxListCtrl:connect(ListCtrl, command_list_item_activated,
+ [{userData, open_app}]),
wxWindow:connect(ListCtrl, enter_window),
wxSizer:add(Sizer, ListCtrl,
@@ -252,7 +269,8 @@ create_mods_list_ctrl(Panel, Sizer, ModText, AppText) ->
{proportion, 1}]),
ListCtrl.
-create_code_page(#state{book = Book, code_pages = Pages, name = ModStr} = S, PageName) ->
+create_code_page(#state{book = Book, code_pages = Pages, name = ModStr} = S,
+ PageName) ->
case find_page(S, PageName) of
not_found ->
Page = do_create_code_page(S, PageName),
@@ -260,7 +278,7 @@ create_code_page(#state{book = Book, code_pages = Pages, name = ModStr} = S, Pag
Pos = length(Pages2),
wxNotebook:setSelection(Book, Pos),
case find_page(S, ?INITIAL_CODE_PAGE_NAME) of
- not_found ->
+ not_found ->
ignore;
{found, _, CodePos} ->
%% Rename initial code page
@@ -288,25 +306,29 @@ find_page([], _PageName, _Pos) ->
do_create_code_page(#state{xref_pid = Xref, mod = M} = S, PageName) ->
Panel = wxPanel:new(S#state.book, []),
Editor = create_editor(Panel),
- ToolTip = "Double click on a function call to search the function definition.",
+ ToolTip = "Double click on a function call to "
+ "search the function definition.",
wxBitmapButton:setToolTip(Editor, ToolTip),
{Objs, Data, SearchSz} = create_search_area(Panel),
{ok, App} = reltool_server:get_app(Xref, M#mod.app_name),
- ErlBin =
+ ErlBin =
case App#app.is_escript of
true -> find_escript_bin(App, M);
false -> find_regular_bin(App, M)
end,
-
+
load_code(Editor, ErlBin),
-
+
Sizer = wxBoxSizer:new(?wxVERTICAL),
wxSizer:add(Sizer, Editor, [{flag, ?wxEXPAND}, {proportion, 1}]),
wxSizer:add(Sizer, SearchSz, [{flag, ?wxEXPAND}]),
wxPanel:setSizer(Panel, Sizer),
wxNotebook:addPage(S#state.book, Panel, PageName, []),
- #code_page{name = PageName, editor = Editor, find_objs = Objs, find_data = Data}.
+ #code_page{name = PageName,
+ editor = Editor,
+ find_objs = Objs,
+ find_data = Data}.
find_regular_bin(App, Mod) ->
ActiveDir = App#app.active_dir,
@@ -322,9 +344,11 @@ find_regular_bin(App, Mod) ->
BeamFile = filename:join([ActiveDir, "ebin", ModStr ++ ".beam"]),
case beam_lib:chunks(BeamFile, [abstract_code]) of
{ok,{_,[{abstract_code,{_,AC}}]}} ->
- list_to_binary(erl_prettypr:format(erl_syntax:form_list(AC)));
+ IoList = erl_prettypr:format(erl_syntax:form_list(AC)),
+ list_to_binary(IoList);
_ ->
- list_to_binary(["%% Bad luck, cannot find any debug info in the file \"", BeamFile])
+ list_to_binary(["%% Bad luck, cannot find any "
+ "debug info in the file \"", BeamFile])
end
end.
@@ -340,10 +364,17 @@ find_escript_bin(#app{active_dir = ActiveDir}, Mod) ->
[_] ->
Bin = GetBin(),
case beam_lib:version(Bin) of
- {ok,{M, _}} when M =:= ModName; FullName =:= "." ->
- case beam_lib:chunks(Bin, [abstract_code]) of
+ {ok,{M, _}} when M =:= ModName;
+ FullName =:= "." ->
+ case beam_lib:chunks(Bin,
+ [abstract_code]) of
{ok,{_,[{abstract_code,{_,AC}}]}} ->
- {obj, list_to_binary(erl_prettypr:format(erl_syntax:form_list(AC)))};
+ Form =
+ erl_syntax:form_list(AC),
+ IoList =
+ erl_prettypr:format(Form),
+ {obj,
+ list_to_binary(IoList)};
_ ->
Acc
end;
@@ -363,10 +394,14 @@ find_escript_bin(#app{active_dir = ActiveDir}, Mod) ->
{fun(FullName, _GetInfo, GetBin, Acc) ->
io:format("", []),
case filename:split(FullName) of
- [_AppName, "ebin", F] when F =:= ObjFile, Acc =:= NotFound ->
- case beam_lib:chunks(GetBin(), [abstract_code]) of
+ [_AppName, "ebin", F]
+ when F =:= ObjFile, Acc =:= NotFound ->
+ case beam_lib:chunks(GetBin(),
+ [abstract_code]) of
{ok,{_,[{abstract_code,{_,AC}}]}} ->
- {obj, list_to_binary(erl_prettypr:format(erl_syntax:form_list(AC)))};
+ Form = erl_syntax:form_list(AC),
+ IoList = erl_prettypr:format(Form),
+ {obj, list_to_binary(IoList)};
_ ->
Acc
end;
@@ -379,17 +414,19 @@ find_escript_bin(#app{active_dir = ActiveDir}, Mod) ->
filename:dirname(ActiveDir)}
end,
try
- case escript:foldl(Fun, NotFound, Escript) of
+ case reltool_utils:escript_foldl(Fun, NotFound, Escript) of
{ok, {text, Bin}} ->
Bin;
{ok, {obj, Bin}} ->
Bin;
_ ->
- list_to_binary(["%% Bad luck, cannot find the code in the escript ", Escript, "."])
+ list_to_binary(["%% Bad luck, cannot find the "
+ "code in the escript ", Escript, "."])
end
- catch
+ catch
throw:Reason when is_list(Reason) ->
- list_to_binary(["%% Bad luck, cannot find the code in the escript ", Escript, ": ", Reason])
+ list_to_binary(["%% Bad luck, cannot find the code "
+ "in the escript ", Escript, ": ", Reason])
end.
create_config_page(S) ->
@@ -400,13 +437,16 @@ create_config_page(S) ->
handle_event(#state{xref_pid = Xref} = S, Wx) ->
%% io:format("wx: ~p\n", [Wx]),
case Wx of
- #wx{obj= ListCtrl, userData = mods_list_ctrl, event = #wxSize{type = size, size = {W, _H}}} ->
+ #wx{obj= ListCtrl,
+ userData = mods_list_ctrl,
+ event = #wxSize{type = size, size = {W, _H}}} ->
wxListCtrl:setColumnWidth(ListCtrl, ?MODS_MOD_COL, (2 * W) div 3),
wxListCtrl:setColumnWidth(ListCtrl, ?MODS_APP_COL, W div 3),
S;
#wx{userData = open_app,
obj = ListCtrl,
- event = #wxList{type = command_list_item_activated, itemIndex = Pos}} ->
+ event = #wxList{type = command_list_item_activated,
+ itemIndex = Pos}} ->
ModStr = wxListCtrl:getItemText(ListCtrl, Pos),
ModName = list_to_atom(ModStr),
{ok, Mod} = reltool_server:get_mod(Xref, ModName),
@@ -431,13 +471,15 @@ handle_event(#state{xref_pid = Xref} = S, Wx) ->
Page = lists:nth(N, S#state.code_pages),
S#state{active_page = Page}
end;
- #wx{event = #wxCommand{type = command_button_clicked}, userData = history_back} ->
+ #wx{event = #wxCommand{type = command_button_clicked},
+ userData = history_back} ->
goto_back(S);
#wx{obj = ObjRef, event = #wxMouse{type = enter_window}} ->
wxWindow:setFocus(ObjRef),
S;
_ ->
- error_logger:format("~p~p got unexpected mod event from wx:\n\t~p\n",
+ error_logger:format("~p~p got unexpected mod event from "
+ "wx:\n\t~p\n",
[?MODULE, self(), Wx]),
S
end.
@@ -450,7 +492,7 @@ redraw_mods(#state{xref_pid = Xref,
uses_mods = UsesModNames,
used_by_mods = UsedByModNames},
status_bar = Bar}) ->
- InclStatus =
+ InclStatus =
case IsIncl of
true when IsPre =:= true -> "Whitelist - ";
true -> "Derived - ";
@@ -458,8 +500,10 @@ redraw_mods(#state{xref_pid = Xref,
undefined -> "Source - "
end,
Status = lists:concat([InclStatus,
- " uses ", length(UsesModNames), " modules and ",
- " is used by ", length(UsedByModNames), " modules."]),
+ " uses ", length(UsesModNames),
+ " modules and ",
+ " is used by ", length(UsedByModNames),
+ " modules."]),
wxStatusBar:setStatusText(Bar, Status),
UsesMods = [select_image(Xref, M) || M <- UsesModNames],
UsedByMods = [select_image(Xref, M) || M <- UsedByModNames],
@@ -483,9 +527,11 @@ redraw_mods(ListCtrl, ImageMods) ->
wxListCtrl:deleteAllItems(ListCtrl),
Add =
fun({ImageId, AppName, #mod{name = ModName}}, Row) ->
- wxListCtrl:insertItem(ListCtrl, Row, ""),
- if (Row rem 2) =:= 0 ->
- wxListCtrl:setItemBackgroundColour(ListCtrl, Row, {240,240,255});
+ wxListCtrl:insertItem(ListCtrl, Row, ""),
+ if (Row rem 2) =:= 0 ->
+ wxListCtrl:setItemBackgroundColour(ListCtrl,
+ Row,
+ {240,240,255});
true ->
ignore
end,
@@ -515,16 +561,16 @@ goto_line(#state{active_page = P} = S, LineNo) when is_integer(LineNo) ->
wxStyledTextCtrl:setSelection(Editor, Left, Right),
S;
goto_line(#state{active_page = P} =S, Str) when is_list(Str) ->
- try
+ try
LineNo = list_to_integer(Str),
CurrentPos = wxStyledTextCtrl:getCurrentPos(P#code_page.editor),
S2 = add_pos_to_history(S, CurrentPos),
goto_line(S2, LineNo - 1)
- catch
+ catch
_:_ ->
wxStatusBar:setStatusText(S#state.status_bar, "Not a line number"),
S
- end.
+ end.
find_string(S, Str) ->
find_string(S, Str, 0).
@@ -535,19 +581,20 @@ find_regexp_forward(S, Str) ->
wxTextCtrl:setValue(TextCtrl, Str),
S2.
-find_string(#state{active_page = #code_page{editor = Editor,
- find_objs = #find_objs{radio={NextO,_,CaseO}},
- find_data = #find_data{found = Found} = Data} = P} = S,
+find_string(#state{active_page =
+ #code_page{editor = Editor,
+ find_objs = #find_objs{radio={NextO,_,CaseO}},
+ find_data = #find_data{found = Found} = Data} = P} = S,
Str,
Flag) ->
wxStyledTextCtrl:hideSelection(Editor, true),
Dir = wxRadioButton:getValue(NextO) xor wx_misc:getKeyState(?WXK_SHIFT),
Case = wxCheckBox:getValue(CaseO),
Pos =
- if
+ if
Found, Dir -> %% Forward Continuation
wxStyledTextCtrl:getAnchor(Editor);
- Found -> %% Backward Continuation
+ Found -> %% Backward Continuation
wxStyledTextCtrl:getCurrentPos(Editor);
Dir -> %% Forward wrap
0;
@@ -556,18 +603,18 @@ find_string(#state{active_page = #code_page{editor = Editor,
end,
wxStyledTextCtrl:gotoPos(Editor,Pos),
wxStyledTextCtrl:searchAnchor(Editor),
- Flag2 =
+ Flag2 =
if Case -> Flag bor ?wxSTC_FIND_MATCHCASE;
true -> Flag
end,
- Res =
- if
+ Res =
+ if
Dir -> wxStyledTextCtrl:searchNext(Editor, Flag2, Str);
true -> wxStyledTextCtrl:searchPrev(Editor, Flag2, Str)
end,
- Found2 =
+ Found2 =
case Res >= 0 of
- true ->
+ true ->
wxStyledTextCtrl:hideSelection(Editor, false),
%% io:format("Found ~p ~n",[Res]),
LineNo = wxStyledTextCtrl:lineFromPosition(Editor,Res),
@@ -576,11 +623,15 @@ find_string(#state{active_page = #code_page{editor = Editor,
true;
false ->
wxStatusBar:setStatusText(S#state.status_bar,
- "Not found (Hit Enter to wrap search)"),
+ "Not found (Hit Enter to "
+ "wrap search)"),
false
- end,
+ end,
P2 = P#code_page{find_data = Data#find_data{found = Found2}},
- Pages = lists:keystore(P#code_page.name, #code_page.name, S#state.code_pages, P2),
+ Pages = lists:keystore(P#code_page.name,
+ #code_page.name,
+ S#state.code_pages,
+ P2),
S#state{active_page = P2, code_pages = Pages}.
goto_function(S, Editor) ->
@@ -589,14 +640,14 @@ goto_function(S, Editor) ->
Left = wxStyledTextCtrl:wordStartPosition(Editor, CurrentPos, true),
Right = wxStyledTextCtrl:wordEndPosition(Editor, CurrentPos, true),
ColonPos = Left - 1,
- Left2 =
+ Left2 =
case wxStyledTextCtrl:getCharAt(Editor, ColonPos) of
$: ->
wxStyledTextCtrl:wordStartPosition(Editor, ColonPos, true);
_ ->
Left
end,
- Right2 =
+ Right2 =
case wxStyledTextCtrl:getCharAt(Editor, Right) of
$: ->
wxStyledTextCtrl:wordEndPosition(Editor, Right + 1, true);
@@ -627,29 +678,37 @@ do_goto_function(S, [ModStr, FunStr]) ->
S2 = create_code_page(S#state{mod = Mod}, ModStr),
find_regexp_forward(S2, "^" ++ FunStr ++ "(");
{ok, _} ->
- wxStatusBar:setStatusText(S#state.status_bar, "No such module: " ++ ModStr),
+ wxStatusBar:setStatusText(S#state.status_bar,
+ "No such module: " ++ ModStr),
S
end.
-goto_back(#state{active_page = #code_page{editor = Editor, find_data = Data} = Page,
+goto_back(#state{active_page =
+ #code_page{editor = Editor, find_data = Data} = Page,
code_pages = Pages} = S) ->
case Data#find_data.history of
[PrevPos | History] ->
LineNo = wxStyledTextCtrl:lineFromPosition(Editor, PrevPos),
Data2 = Data#find_data{history = History},
Page2 = Page#code_page{find_data = Data2},
- Pages2 = lists:keystore(Page2#code_page.name, #code_page.name, Pages, Page2),
- goto_line(S#state{active_page = Page2, code_pages = Pages2}, LineNo);
+ Pages2 = lists:keystore(Page2#code_page.name,
+ #code_page.name,
+ Pages,
+ Page2),
+ goto_line(S#state{active_page = Page2, code_pages = Pages2},
+ LineNo);
[] ->
wxStatusBar:setStatusText(S#state.status_bar, "No history"),
S
end.
-add_pos_to_history(#state{active_page = Page, code_pages = Pages} = S, CurrentPos) ->
+add_pos_to_history(#state{active_page = Page, code_pages = Pages} = S,
+ CurrentPos) ->
Data = Page#code_page.find_data,
Data2 = Data#find_data{history = [CurrentPos | Data#find_data.history]},
Page2 = Page#code_page{find_data = Data2},
- Pages2 = lists:keystore(Page2#code_page.name, #code_page.name, Pages, Page2),
+ Pages2 =
+ lists:keystore(Page2#code_page.name, #code_page.name, Pages, Page2),
S#state{active_page = Page2, code_pages = Pages2}.
create_editor(Parent) ->
@@ -690,19 +749,26 @@ create_editor(Parent) ->
%% Margins Markers
%% Breakpoint Should be a pixmap?
- wxStyledTextCtrl:markerDefine(Ed, 0, ?wxSTC_MARK_CIRCLE, [{foreground, {170,20,20}}]),
- wxStyledTextCtrl:markerDefine(Ed, 0, ?wxSTC_MARK_CIRCLE, [{background, {200,120,120}}]),
- %% Disabled Breakpoint
- wxStyledTextCtrl:markerDefine(Ed, 1, ?wxSTC_MARK_CIRCLE, [{foreground, {20,20,170}}]),
- wxStyledTextCtrl:markerDefine(Ed, 1, ?wxSTC_MARK_CIRCLE, [{background, {120,120,200}}]),
-
+ wxStyledTextCtrl:markerDefine(Ed, 0, ?wxSTC_MARK_CIRCLE,
+ [{foreground, {170,20,20}}]),
+ wxStyledTextCtrl:markerDefine(Ed, 0, ?wxSTC_MARK_CIRCLE,
+ [{background, {200,120,120}}]),
+ %% Disabled Breakpoint
+ wxStyledTextCtrl:markerDefine(Ed, 1, ?wxSTC_MARK_CIRCLE,
+ [{foreground, {20,20,170}}]),
+ wxStyledTextCtrl:markerDefine(Ed, 1, ?wxSTC_MARK_CIRCLE,
+ [{background, {120,120,200}}]),
+
%% Current Line
- wxStyledTextCtrl:markerDefine(Ed, 2, ?wxSTC_MARK_ARROW, [{foreground, {20,170,20}}]),
- wxStyledTextCtrl:markerDefine(Ed, 2, ?wxSTC_MARK_ARROW, [{background, {200,255,200}}]),
- wxStyledTextCtrl:markerDefine(Ed, 3, ?wxSTC_MARK_BACKGROUND, [{background, {200,255,200}}]),
+ wxStyledTextCtrl:markerDefine(Ed, 2, ?wxSTC_MARK_ARROW,
+ [{foreground, {20,170,20}}]),
+ wxStyledTextCtrl:markerDefine(Ed, 2, ?wxSTC_MARK_ARROW,
+ [{background, {200,255,200}}]),
+ wxStyledTextCtrl:markerDefine(Ed, 3, ?wxSTC_MARK_BACKGROUND,
+ [{background, {200,255,200}}]),
%% Scrolling
- Policy = ?wxSTC_CARET_SLOP bor ?wxSTC_CARET_JUMPS bor ?wxSTC_CARET_EVEN,
+ Policy = ?wxSTC_CARET_SLOP bor ?wxSTC_CARET_JUMPS bor ?wxSTC_CARET_EVEN,
wxStyledTextCtrl:setYCaretPolicy(Ed, Policy, 3),
wxStyledTextCtrl:setVisiblePolicy(Ed, Policy, 3),
@@ -714,9 +780,9 @@ create_editor(Parent) ->
create_search_area(Parent) ->
Sizer = wxBoxSizer:new(?wxHORIZONTAL),
- wxSizer:add(Sizer, wxStaticText:new(Parent, ?wxID_ANY, "Find:"),
+ wxSizer:add(Sizer, wxStaticText:new(Parent, ?wxID_ANY, "Find:"),
[{flag,?wxALIGN_CENTER_VERTICAL}]),
- TC1 = wxTextCtrl:new(Parent, ?SEARCH_ENTRY, [{style, ?wxTE_PROCESS_ENTER}]),
+ TC1 = wxTextCtrl:new(Parent, ?SEARCH_ENTRY, [{style, ?wxTE_PROCESS_ENTER}]),
wxSizer:add(Sizer, TC1, [{proportion,3}, {flag, ?wxEXPAND}]),
Nbtn = wxRadioButton:new(Parent, ?wxID_ANY, "Next"),
wxRadioButton:setValue(Nbtn, true),
@@ -726,14 +792,15 @@ create_search_area(Parent) ->
Cbtn = wxCheckBox:new(Parent, ?wxID_ANY, "Match Case"),
wxSizer:add(Sizer,Cbtn,[{flag,?wxALIGN_CENTER_VERTICAL}]),
wxSizer:add(Sizer, 15,15, [{proportion,1}, {flag, ?wxEXPAND}]),
- wxSizer:add(Sizer, wxStaticText:new(Parent, ?wxID_ANY, "Goto Line:"),
+ wxSizer:add(Sizer, wxStaticText:new(Parent, ?wxID_ANY, "Goto Line:"),
[{flag,?wxALIGN_CENTER_VERTICAL}]),
- TC2 = wxTextCtrl:new(Parent, ?GOTO_ENTRY, [{style, ?wxTE_PROCESS_ENTER}]),
+ TC2 = wxTextCtrl:new(Parent, ?GOTO_ENTRY, [{style, ?wxTE_PROCESS_ENTER}]),
wxSizer:add(Sizer, TC2, [{proportion,0}, {flag, ?wxEXPAND}]),
Button = wxButton:new(Parent, ?wxID_ANY, [{label, "Back"}]),
wxSizer:add(Sizer, Button, []),
- wxEvtHandler:connect(Button, command_button_clicked, [{userData, history_back}]),
+ wxEvtHandler:connect(Button, command_button_clicked,
+ [{userData, history_back}]),
%% wxTextCtrl:connect(TC1, command_text_updated),
wxTextCtrl:connect(TC1, command_text_enter),
%% wxTextCtrl:connect(TC1, kill_focus),
@@ -748,7 +815,9 @@ load_code(Ed, Code) when is_binary(Code) ->
wxStyledTextCtrl:setTextRaw(Ed, <<Code/binary, 0:8>>),
Lines = wxStyledTextCtrl:getLineCount(Ed),
Sz = trunc(math:log10(Lines))+1,
- LW = wxStyledTextCtrl:textWidth(Ed, ?wxSTC_STYLE_LINENUMBER, lists:duplicate(Sz, $9)),
+ LW = wxStyledTextCtrl:textWidth(Ed,
+ ?wxSTC_STYLE_LINENUMBER,
+ lists:duplicate(Sz, $9)),
%%io:format("~p ~p ~p~n", [Lines, Sz, LW]),
wxStyledTextCtrl:setMarginWidth(Ed, 0, LW+5),
wxStyledTextCtrl:setReadOnly(Ed, true),
diff --git a/lib/reltool/src/reltool_server.erl b/lib/reltool/src/reltool_server.erl
index 8d4530131f..a7064f7651 100644
--- a/lib/reltool/src/reltool_server.erl
+++ b/lib/reltool/src/reltool_server.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2009-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
-module(reltool_server).
@@ -44,7 +44,7 @@
-include("reltool.hrl").
--record(state,
+-record(state,
{options,
parent_pid,
common,
@@ -60,16 +60,20 @@ start_link() ->
start_link([]).
start_link(Options) ->
- proc_lib:start_link(?MODULE, init, [[{parent, self()} | Options]], infinity, []).
+ proc_lib:start_link(?MODULE,
+ init,
+ [[{parent, self()} | Options]],
+ infinity,
+ []).
-get_config(Pid, InclDefaults, InclDerivates) ->
- reltool_utils:call(Pid, {get_config, InclDefaults, InclDerivates}).
+get_config(Pid, InclDef, InclDeriv) ->
+ reltool_utils:call(Pid, {get_config, InclDef, InclDeriv}).
load_config(Pid, FilenameOrConfig) ->
reltool_utils:call(Pid, {load_config, FilenameOrConfig}).
-save_config(Pid, Filename, InclDefaults, InclDerivates) ->
- reltool_utils:call(Pid, {save_config, Filename, InclDefaults, InclDerivates}).
+save_config(Pid, Filename, InclDef, InclDeriv) ->
+ reltool_utils:call(Pid, {save_config, Filename, InclDef, InclDeriv}).
reset_config(Pid) ->
reltool_utils:call(Pid, reset_config).
@@ -131,7 +135,8 @@ do_init(Options) ->
case parse_options(Options) of
{#state{parent_pid = ParentPid, common = C, sys = Sys} = S, Status} ->
%% process_flag(trap_exit, (S#state.common)#common.trap_exit),
- proc_lib:init_ack(ParentPid, {ok, self(), C, Sys#sys{apps = undefined}}),
+ proc_lib:init_ack(ParentPid,
+ {ok, self(), C, Sys#sys{apps = undefined}}),
{S2, Status2} = refresh(S, true, Status),
{S3, Status3} = analyse(S2#state{old_sys = S2#state.sys}, Status2),
case Status3 of
@@ -156,15 +161,33 @@ parse_options(Opts) ->
rels = reltool_utils:default_rels(),
emu_name = ?DEFAULT_EMU_NAME,
profile = ?DEFAULT_PROFILE,
- incl_sys_filters = reltool_utils:decode_regexps(incl_sys_filters, ?DEFAULT_INCL_SYS_FILTERS, []),
- excl_sys_filters = reltool_utils:decode_regexps(excl_sys_filters, ?DEFAULT_EXCL_SYS_FILTERS, []),
- incl_app_filters = reltool_utils:decode_regexps(incl_app_filters, ?DEFAULT_INCL_APP_FILTERS, []),
- excl_app_filters = reltool_utils:decode_regexps(excl_app_filters, ?DEFAULT_EXCL_APP_FILTERS, []),
+ incl_sys_filters =
+ reltool_utils:decode_regexps(incl_sys_filters,
+ ?DEFAULT_INCL_SYS_FILTERS,
+ []),
+ excl_sys_filters =
+ reltool_utils:decode_regexps(excl_sys_filters,
+ ?DEFAULT_EXCL_SYS_FILTERS,
+ []),
+ incl_app_filters =
+ reltool_utils:decode_regexps(incl_app_filters,
+ ?DEFAULT_INCL_APP_FILTERS,
+ []),
+ excl_app_filters =
+ reltool_utils:decode_regexps(excl_app_filters,
+ ?DEFAULT_EXCL_APP_FILTERS,
+ []),
relocatable = ?DEFAULT_RELOCATABLE,
app_type = ?DEFAULT_APP_TYPE,
app_file = ?DEFAULT_APP_FILE,
- incl_archive_filters = reltool_utils:decode_regexps(incl_archive_filters, ?DEFAULT_INCL_ARCHIVE_FILTERS, []),
- excl_archive_filters = reltool_utils:decode_regexps(excl_archive_filters, ?DEFAULT_EXCL_ARCHIVE_FILTERS, []),
+ incl_archive_filters =
+ reltool_utils:decode_regexps(incl_archive_filters,
+ ?DEFAULT_INCL_ARCHIVE_FILTERS,
+ []),
+ excl_archive_filters =
+ reltool_utils:decode_regexps(excl_archive_filters,
+ ?DEFAULT_EXCL_ARCHIVE_FILTERS,
+ []),
archive_opts = ?DEFAULT_ARCHIVE_OPTS,
debug_info = ?DEFAULT_DEBUG_INFO},
C2 = #common{sys_debug = [],
@@ -194,30 +217,38 @@ parse_options([{Key, Val} | KeyVals], S, C, Sys, Status) ->
parse_options(KeyVals, S, C, Sys2, Status2);
_ ->
Text = lists:flatten(io_lib:format("~p", [{Key, Val}])),
- Status2 = reltool_utils:return_first_error(Status, "Illegal option: " ++ Text),
+ Status2 =
+ reltool_utils:return_first_error(Status,
+ "Illegal option: " ++ Text),
parse_options(KeyVals, S, C, Sys, Status2)
end;
parse_options([], S, C, Sys, Status) ->
{S#state{common = C, sys = Sys}, Status};
parse_options(KeyVals, S, C, Sys, Status) ->
Text = lists:flatten(io_lib:format("~p", [KeyVals])),
- Status2 = reltool_utils:return_first_error(Status, "Illegal options: " ++ Text),
+ Status2 = reltool_utils:return_first_error(Status,
+ "Illegal options: " ++ Text),
{S#state{common = C, sys = Sys}, Status2}.
loop(#state{common = C, sys = Sys} = S) ->
receive
{system, From, Msg} ->
- sys:handle_system_msg(Msg, From, S#state.parent_pid, ?MODULE, C#common.sys_debug, S);
- {call, ReplyTo, Ref, {get_config, InclDefaults, InclDerivates}} ->
- Reply = do_get_config(S, InclDefaults, InclDerivates),
+ sys:handle_system_msg(Msg,
+ From,
+ S#state.parent_pid,
+ ?MODULE,
+ C#common.sys_debug,
+ S);
+ {call, ReplyTo, Ref, {get_config, InclDef, InclDeriv}} ->
+ Reply = do_get_config(S, InclDef, InclDeriv),
reltool_utils:reply(ReplyTo, Ref, Reply),
?MODULE:loop(S);
{call, ReplyTo, Ref, {load_config, SysConfig}} ->
{S2, Reply} = do_load_config(S, SysConfig),
reltool_utils:reply(ReplyTo, Ref, Reply),
?MODULE:loop(S2);
- {call, ReplyTo, Ref, {save_config, Filename, InclDefaults, InclDerivates}} ->
- Reply = do_save_config(S, Filename, InclDefaults, InclDerivates),
+ {call, ReplyTo, Ref, {save_config, Filename, InclDef, InclDeriv}} ->
+ Reply = do_save_config(S, Filename, InclDef, InclDeriv),
reltool_utils:reply(ReplyTo, Ref, Reply),
?MODULE:loop(S);
{call, ReplyTo, Ref, reset_config} ->
@@ -225,7 +256,7 @@ loop(#state{common = C, sys = Sys} = S) ->
S3 = shrink_sys(S2),
{S4, Status2} = refresh(S3, true, Status),
{S5, Status3} = analyse(S4#state{old_sys = S4#state.sys}, Status2),
- S6 =
+ S6 =
case Status3 of
{ok, _Warnings} ->
S5#state{status = Status3, old_status = S#state.status};
@@ -236,14 +267,14 @@ loop(#state{common = C, sys = Sys} = S) ->
?MODULE:loop(S6);
{call, ReplyTo, Ref, undo_config} ->
reltool_utils:reply(ReplyTo, Ref, ok),
- S2 = S#state{sys = S#state.old_sys,
+ S2 = S#state{sys = S#state.old_sys,
old_sys = S#state.sys,
status = S#state.old_status,
old_status = S#state.status},
?MODULE:loop(S2);
{call, ReplyTo, Ref, {get_rel, RelName}} ->
Sys = S#state.sys,
- Reply =
+ Reply =
case lists:keysearch(RelName, #rel.name, Sys#sys.rels) of
{value, Rel} ->
{ok, reltool_target:gen_rel(Rel, Sys)};
@@ -254,12 +285,12 @@ loop(#state{common = C, sys = Sys} = S) ->
?MODULE:loop(S);
{call, ReplyTo, Ref, {get_script, RelName}} ->
Sys = S#state.sys,
- Reply =
+ Reply =
case lists:keysearch(RelName, #rel.name, Sys#sys.rels) of
{value, Rel} ->
PathFlag = true,
- Variables = [],
- reltool_target:gen_script(Rel, Sys, PathFlag, Variables);
+ Vars = [],
+ reltool_target:gen_script(Rel, Sys, PathFlag, Vars);
false ->
{error, "No such release"}
end,
@@ -276,7 +307,7 @@ loop(#state{common = C, sys = Sys} = S) ->
reltool_utils:reply(ReplyTo, Ref, Reply),
?MODULE:loop(S);
{call, ReplyTo, Ref, {get_app, AppName}} when is_atom(AppName) ->
- Reply =
+ Reply =
case lists:keysearch(AppName, #app.name, Sys#sys.apps) of
{value, App} ->
{ok, App};
@@ -302,15 +333,15 @@ loop(#state{common = C, sys = Sys} = S) ->
{call, ReplyTo, Ref, {get_apps, Kind}} ->
AppNames =
case Kind of
- whitelist ->
+ whitelist ->
[A ||
A <- Sys#sys.apps,
A#app.is_pre_included =:= true];
- blacklist ->
+ blacklist ->
[A ||
A <- Sys#sys.apps,
A#app.is_pre_included =:= false];
- source ->
+ source ->
[A ||
A <- Sys#sys.apps,
A#app.is_included =/= true,
@@ -324,9 +355,10 @@ loop(#state{common = C, sys = Sys} = S) ->
reltool_utils:reply(ReplyTo, Ref, {ok, AppNames}),
?MODULE:loop(S);
{call, ReplyTo, Ref, {set_apps, Apps}} ->
- {S2, Status} = lists:foldl(fun(A, {X, Y}) -> do_set_app(X, A, Y) end,
- {S, {ok, []}},
- Apps),
+ {S2, Status} =
+ lists:foldl(fun(A, {X, Y}) -> do_set_app(X, A, Y) end,
+ {S, {ok, []}},
+ Apps),
{S3, Status2} = analyse(S2, Status),
reltool_utils:reply(ReplyTo, Ref, Status2),
?MODULE:loop(S3);
@@ -335,13 +367,13 @@ loop(#state{common = C, sys = Sys} = S) ->
?MODULE:loop(S);
{call, ReplyTo, Ref, {set_sys, Sys2}} ->
S2 = S#state{sys = Sys2#sys{apps = Sys#sys.apps}},
- Force =
+ Force =
(Sys2#sys.root_dir =/= Sys#sys.root_dir) orelse
(Sys2#sys.lib_dirs =/= Sys#sys.lib_dirs) orelse
(Sys2#sys.escripts =/= Sys#sys.escripts),
{S3, Status} = refresh(S2, Force, {ok, []}),
{S4, Status2} = analyse(S3#state{old_sys = S#state.sys}, Status),
- S6 =
+ S6 =
case Status2 of
{ok, _Warnings} ->
S4#state{status = Status2, old_status = S#state.status};
@@ -354,7 +386,7 @@ loop(#state{common = C, sys = Sys} = S) ->
reltool_utils:reply(ReplyTo, Ref, S#state.status),
?MODULE:loop(S);
{call, ReplyTo, Ref, {gen_rel_files, Dir}} ->
- Status =
+ Status =
case reltool_target:gen_rel_files(S#state.sys, Dir) of
ok ->
{ok, []};
@@ -404,7 +436,7 @@ analyse(#state{common = C, sys = #sys{apps = Apps0} = Sys} = S, Status) ->
ets:insert(C#common.app_tab, MissingApp),
Apps2 = lists:map(fun(App) -> app_init_is_included(C, Sys, App) end, Apps),
- Apps3 =
+ Apps3 =
case app_propagate_is_included(C, Sys, Apps2, []) of
[] ->
Apps2;
@@ -412,14 +444,15 @@ analyse(#state{common = C, sys = #sys{apps = Apps0} = Sys} = S, Status) ->
%% io:format("Missing mods: ~p\n", [MissingMods]),
MissingApp2 = MissingApp#app{label = ?MISSING_APP_TEXT,
info = missing_app_info(""),
- mods = MissingMods,
+ mods = MissingMods,
status = missing,
uses_mods = []},
[MissingApp2 | Apps2]
end,
app_propagate_is_used_by(C, Apps3),
Apps4 = read_apps(C, Sys, Apps3, []),
- %% io:format("Missing app: ~p\n", [lists:keysearch(?MISSING_APP, #app.name, Apps4)]),
+ %% io:format("Missing app: ~p\n",
+ %% [lists:keysearch(?MISSING_APP, #app.name, Apps4)]),
Sys2 = Sys#sys{apps = Apps4},
try
Status2 = verify_config(Sys2, Status),
@@ -430,7 +463,7 @@ analyse(#state{common = C, sys = #sys{apps = Apps0} = Sys} = S, Status) ->
end.
app_init_is_included(C, Sys, #app{mods = Mods} = A) ->
- AppCond =
+ AppCond =
case A#app.incl_cond of
undefined -> Sys#sys.incl_cond;
_ -> A#app.incl_cond
@@ -448,7 +481,14 @@ app_init_is_included(C, Sys, #app{mods = Mods} = A) ->
end,
A2 = A#app{is_pre_included = IsIncl, is_included = IsIncl},
ets:insert(C#common.app_tab, A2),
- lists:foreach(fun(Mod) -> mod_init_is_included(C, Mod, ModCond, AppCond, undefined) end, Mods),
+ lists:foreach(fun(Mod) ->
+ mod_init_is_included(C,
+ Mod,
+ ModCond,
+ AppCond,
+ undefined)
+ end,
+ Mods),
%%app_mod_init_is_included(C, AppName, Info, ModCond, AppCond),
A2.
@@ -463,7 +503,8 @@ mod_init_is_included(C, M, ModCond, AppCond, Default) ->
exclude ->
false;
undefined ->
- %% print(M#mod.name, hipe, "mod_cond -> ~p\n", [ModCond]),
+ %% print(M#mod.name, hipe, "mod_cond -> ~p\n",
+ %% [ModCond]),
case ModCond of
all -> true;
app -> false_to_undefined(M#mod.is_app_mod);
@@ -493,7 +534,7 @@ false_to_undefined(Bool) ->
false -> undefined;
_ -> Bool
end.
-
+
app_propagate_is_included(C, Sys, [#app{mods = Mods} = A | Apps], Acc) ->
Acc2 = mod_propagate_is_included(C, Sys, A, Mods, Acc),
app_propagate_is_included(C, Sys, Apps, Acc2);
@@ -502,9 +543,11 @@ app_propagate_is_included(_C, _Sys, [], Acc) ->
mod_propagate_is_included(C, Sys, A, [#mod{name = ModName} | Mods], Acc) ->
[M2] = ets:lookup(C#common.mod_tab, ModName),
- %% print(ModName, file, "Maybe Prop ~p -> ~p\n", [M2, M2#mod.is_included]),
- %% print(ModName, filename, "Maybe Prop ~p -> ~p\n", [M2, M2#mod.is_included]),
- Acc2 =
+ %% print(ModName, file, "Maybe Prop ~p -> ~p\n",
+ %% [M2, M2#mod.is_included]),
+ %% print(ModName, filename, "Maybe Prop ~p -> ~p\n",
+ %% [M2, M2#mod.is_included]),
+ Acc2 =
case M2#mod.is_included of
true ->
%% Propagate include mark
@@ -519,11 +562,13 @@ mod_propagate_is_included(_C, _Sys, _A, [], Acc) ->
Acc.
mod_mark_is_included(C, Sys, UsedByName, [ModName | ModNames], Acc) ->
- Acc3 =
+ Acc3 =
case ets:lookup(C#common.mod_tab, ModName) of
- [M] ->
- %% print(UsedByName, file, "Maybe Mark ~p -> ~p\n", [M, M#mod.is_included]),
- %% print(UsedByName, filename, "Maybe Mark ~p -> ~p\n", [M, M#mod.is_included]),
+ [M] ->
+ %% print(UsedByName, file, "Maybe Mark ~p -> ~p\n",
+ %% [M, M#mod.is_included]),
+ %% print(UsedByName, filename, "Maybe Mark ~p -> ~p\n",
+ %% [M, M#mod.is_included]),
case M#mod.is_included of
true ->
%% Already marked
@@ -533,19 +578,22 @@ mod_mark_is_included(C, Sys, UsedByName, [ModName | ModNames], Acc) ->
Acc;
undefined ->
%% Mark and propagate
- M2 =
+ M2 =
case M#mod.incl_cond of
include ->
- M#mod{is_pre_included = true, is_included = true};
+ M#mod{is_pre_included = true,
+ is_included = true};
exclude ->
- M#mod{is_pre_included = true, is_included = true};
+ M#mod{is_pre_included = true,
+ is_included = true};
undefined ->
M#mod{is_included = true}
end,
ets:insert(C#common.mod_tab, M2),
- %% io:format("Propagate mod: ~p -> ~p (~p)\n", [UsedByName, ModName, M#mod.incl_cond]),
+ %% io:format("Propagate mod: ~p -> ~p (~p)\n",
+ %% [UsedByName, ModName, M#mod.incl_cond]),
[A] = ets:lookup(C#common.app_tab, M2#mod.app_name),
- Acc2 =
+ Acc2 =
case A#app.is_included of
true ->
Acc;
@@ -557,7 +605,7 @@ mod_mark_is_included(C, Sys, UsedByName, [ModName | ModNames], Acc) ->
undefined -> Sys#sys.mod_cond;
_ -> A#app.mod_cond
end,
- Filter =
+ Filter =
fun(M3) ->
case ModCond of
all -> true;
@@ -569,12 +617,22 @@ mod_mark_is_included(C, Sys, UsedByName, [ModName | ModNames], Acc) ->
end,
Mods = lists:filter(Filter, A#app.mods),
%% io:format("Propagate app: ~p ~p -> ~p\n",
- %% [UsedByName, A#app.name, [M3#mod.name || M3 <- Mods]]),
+ %% [UsedByName, A#app.name,
+ %% [M3#mod.name || M3 <- Mods]]),
A2 = A#app{is_included = true},
- ets:insert(C#common.app_tab, A2),
- mod_mark_is_included(C, Sys, ModName, [M3#mod.name || M3 <- Mods], Acc)
+ ets:insert(C#common.app_tab, A2),
+ mod_mark_is_included(C,
+ Sys,
+ ModName,
+ [M3#mod.name ||
+ M3 <- Mods],
+ Acc)
end,
- mod_mark_is_included(C, Sys, ModName, M2#mod.uses_mods, Acc2)
+ mod_mark_is_included(C,
+ Sys,
+ ModName,
+ M2#mod.uses_mods,
+ Acc2)
end;
[] ->
M = missing_mod(ModName, ?MISSING_APP),
@@ -614,21 +672,24 @@ mod_propagate_is_used_by(_C, []) ->
read_apps(C, Sys, [#app{mods = Mods, is_included = IsIncl} = A | Apps], Acc) ->
{Mods2, IsIncl2} = read_apps(C, Sys, A, Mods, [], IsIncl),
- %% reltool_utils:print(A#app.name, stdlib, "Mods2: ~p\n", [[M#mod.status || M <- Mods2]]),
- Status =
+ %% reltool_utils:print(A#app.name, stdlib, "Mods2: ~p\n",
+ %% [[M#mod.status || M <- Mods2]]),
+ Status =
case lists:keysearch(missing, #mod.status, Mods2) of
{value, _} -> missing;
false -> ok
end,
UsesMods = [M#mod.uses_mods || M <- Mods2, M#mod.is_included =:= true],
UsesMods2 = lists:usort(lists:flatten(UsesMods)),
- UsesApps = [M#mod.app_name || ModName <- UsesMods2, M <- ets:lookup(C#common.mod_tab, ModName)],
+ UsesApps = [M#mod.app_name || ModName <- UsesMods2,
+ M <- ets:lookup(C#common.mod_tab, ModName)],
UsesApps2 = lists:usort(UsesApps),
UsedByMods = [M#mod.used_by_mods || M <- Mods2, M#mod.is_included =:= true],
UsedByMods2 = lists:usort(lists:flatten(UsedByMods)),
- UsedByApps = [M#mod.app_name || ModName <- UsedByMods2, M <- ets:lookup(C#common.mod_tab, ModName)],
+ UsedByApps = [M#mod.app_name || ModName <- UsedByMods2,
+ M <- ets:lookup(C#common.mod_tab, ModName)],
UsedByApps2 = lists:usort(UsedByApps),
-
+
A2 = A#app{mods = Mods2,
status = Status,
uses_mods = UsesMods2,
@@ -644,12 +705,14 @@ read_apps(C, Sys, A, [#mod{name = ModName} | Mods], Acc, IsIncl) ->
[M2] = ets:lookup(C#common.mod_tab, ModName),
Status = do_get_status(M2),
%% print(M2#mod.name, hipe, "status -> ~p\n", [Status]),
- {IsIncl2, M3} =
+ {IsIncl2, M3} =
case M2#mod.is_included of
true ->
- UsedByMods = [N || {_, N} <- ets:lookup(C#common.mod_used_by_tab, ModName)],
+ UsedByMods =
+ [N || {_, N} <- ets:lookup(C#common.mod_used_by_tab,
+ ModName)],
{true, M2#mod{status = Status, used_by_mods = UsedByMods}};
- _ ->
+ _ ->
{IsIncl, M2#mod{status = Status, used_by_mods = []}}
end,
ets:insert(C#common.mod_tab, M3),
@@ -669,14 +732,14 @@ shrink_sys(#state{sys = #sys{apps = Apps} = Sys} = S) ->
Apps2 = lists:zf(fun filter_app/1, Apps),
S#state{sys = Sys#sys{apps = Apps2}}.
-filter_app(A) ->
+filter_app(A) ->
Mods = [M#mod{is_app_mod = undefined,
is_ebin_mod = undefined,
uses_mods = undefined,
exists = false,
is_pre_included = undefined,
is_included = undefined} ||
- M <- A#app.mods,
+ M <- A#app.mods,
M#mod.incl_cond =/= undefined],
if
A#app.is_escript ->
@@ -692,9 +755,9 @@ filter_app(A) ->
A#app.use_selected_vsn =:= undefined ->
false;
true ->
- {Dir, Dirs} =
+ {Dir, Dirs} =
case A#app.use_selected_vsn of
- undefined ->
+ undefined ->
{shrinked, []};
false ->
{shrinked, []};
@@ -730,37 +793,45 @@ refresh_app(#app{name = AppName,
Status) ->
if
Force; OptLabel =:= undefined ->
- {AppInfo, EbinMods, Status3} =
+ {AppInfo, EbinMods, Status3} =
case IsEscript of
false ->
-
+
%% Add info from .app file
Base = get_base(AppName, ActiveDir),
{_, DefaultVsn} = reltool_utils:split_app_name(Base),
Ebin = filename:join([ActiveDir, "ebin"]),
- AppFile = filename:join([Ebin, atom_to_list(AppName) ++ ".app"]),
- {AI, Status2} = read_app_info(AppFile, AppFile, AppName, DefaultVsn, Status),
+ AppFile =
+ filename:join([Ebin,
+ atom_to_list(AppName) ++ ".app"]),
+ {AI, Status2} =
+ read_app_info(AppFile,
+ AppFile,
+ AppName,
+ DefaultVsn,
+ Status),
{AI, read_ebin_mods(Ebin, AppName), Status2};
true ->
{App#app.info, Mods, Status}
end,
-
+
%% Add non-existing modules
AppModNames =
case AppInfo#app_info.mod of
{StartModName, _} ->
- case lists:member(StartModName, AppInfo#app_info.modules) of
+ case lists:member(StartModName,
+ AppInfo#app_info.modules) of
true -> AppInfo#app_info.modules;
false -> [StartModName | AppInfo#app_info.modules]
end;
- undefined ->
+ undefined ->
AppInfo#app_info.modules
end,
MissingMods = add_missing_mods(AppName, EbinMods, AppModNames),
-
+
%% Add optional user config for each module
Mods2 = add_mod_config(MissingMods ++ EbinMods, Mods),
-
+
%% Set app flag for each module in app file
Mods3 = set_mod_flags(Mods2, AppModNames),
AppVsn = AppInfo#app_info.vsn,
@@ -770,7 +841,7 @@ refresh_app(#app{name = AppName,
_ -> atom_to_list(AppName) ++ "-" ++ AppVsn
end,
App2 = App#app{vsn = AppVsn,
- label = AppLabel,
+ label = AppLabel,
info = AppInfo,
mods = lists:keysort(#mod.name, Mods3)},
{App2, Status3};
@@ -790,30 +861,55 @@ read_app_info(AppFileOrBin, AppFile, AppName, DefaultVsn, Status) ->
AI = #app_info{vsn = DefaultVsn},
parse_app_info(AppFile, Info, AI, Status);
{ok, _BadApp} ->
- Text = lists:concat([AppName, ": Illegal contents in app file ", AppFile]),
- {missing_app_info(DefaultVsn), reltool_utils:add_warning(Status, Text)};
+ Text = lists:concat([AppName,
+ ": Illegal contents in app file ", AppFile]),
+ {missing_app_info(DefaultVsn),
+ reltool_utils:add_warning(Status, Text)};
{error, Text} when Text =:= EnoentText->
{missing_app_info(DefaultVsn), Status};
{error, Text} ->
- Text2 = lists:concat([AppName, ": Cannot parse app file ", AppFile, " (", Text, ")."]),
- {missing_app_info(DefaultVsn), reltool_utils:add_warning(Status, Text2)}
+ Text2 = lists:concat([AppName,
+ ": Cannot parse app file ",
+ AppFile, " (", Text, ")."]),
+ {missing_app_info(DefaultVsn),
+ reltool_utils:add_warning(Status, Text2)}
end.
parse_app_info(File, [{Key, Val} | KeyVals], AI, Status) ->
case Key of
- description -> parse_app_info(File, KeyVals, AI#app_info{description = Val}, Status);
- id -> parse_app_info(File, KeyVals, AI#app_info{id = Val}, Status);
- vsn -> parse_app_info(File, KeyVals, AI#app_info{vsn = Val}, Status);
- modules -> parse_app_info(File, KeyVals, AI#app_info{modules = Val}, Status);
- maxP -> parse_app_info(File, KeyVals, AI#app_info{maxP = Val}, Status);
- maxT -> parse_app_info(File, KeyVals, AI#app_info{maxT = Val}, Status);
- registered -> parse_app_info(File, KeyVals, AI#app_info{registered = Val}, Status);
- included_applications -> parse_app_info(File, KeyVals, AI#app_info{incl_apps = Val}, Status);
- applications -> parse_app_info(File, KeyVals, AI#app_info{applications = Val}, Status);
- env -> parse_app_info(File, KeyVals, AI#app_info{env = Val}, Status);
- mod -> parse_app_info(File, KeyVals, AI#app_info{mod = Val}, Status);
- start_phases -> parse_app_info(File, KeyVals, AI#app_info{start_phases = Val}, Status);
- _ -> parse_app_info(File, KeyVals, AI, reltool_utils:add_warning(Status, lists:concat(["Unexpected item ", Key, "in app file ", File])))
+ description ->
+ parse_app_info(File, KeyVals, AI#app_info{description = Val},
+ Status);
+ id ->
+ parse_app_info(File, KeyVals, AI#app_info{id = Val}, Status);
+ vsn ->
+ parse_app_info(File, KeyVals, AI#app_info{vsn = Val}, Status);
+ modules ->
+ parse_app_info(File, KeyVals, AI#app_info{modules = Val}, Status);
+ maxP ->
+ parse_app_info(File, KeyVals, AI#app_info{maxP = Val}, Status);
+ maxT ->
+ parse_app_info(File, KeyVals, AI#app_info{maxT = Val}, Status);
+ registered ->
+ parse_app_info(File, KeyVals, AI#app_info{registered = Val},
+ Status);
+ included_applications ->
+ parse_app_info(File, KeyVals, AI#app_info{incl_apps = Val}, Status);
+ applications ->
+ parse_app_info(File, KeyVals, AI#app_info{applications = Val},
+ Status);
+ env ->
+ parse_app_info(File, KeyVals, AI#app_info{env = Val}, Status);
+ mod ->
+ parse_app_info(File, KeyVals, AI#app_info{mod = Val}, Status);
+ start_phases ->
+ parse_app_info(File, KeyVals, AI#app_info{start_phases = Val},
+ Status);
+ _ ->
+ String = lists:concat(["Unexpected item ",
+ Key, "in app file ", File]),
+ parse_app_info(File, KeyVals, AI,
+ reltool_utils:add_warning(Status, String))
end;
parse_app_info(_, [], AI, Status) ->
{AI, Status}.
@@ -824,7 +920,7 @@ read_ebin_mods(Ebin, AppName) ->
Ext = code:objfile_extension(),
InitMod = fun(F) ->
File = filename:join([Ebin, F]),
- init_mod(AppName, File, File, Ext)
+ init_mod(AppName, File, File, Ext)
end,
Files2 = [F || F <- Files, filename:extension(F) =:= Ext],
pmap(InitMod, Files2);
@@ -839,7 +935,7 @@ pmap(Fun, List) ->
%% -record(pmap_res, {count, ref, res}).
%% -record(pmap_wait, {count, ref, pid}).
-%%
+%%
%% pmap(Fun, [H | T], N, Max, Count, WaitFor, Results) when N < Max ->
%% Ref = make_ref(),
%% Parent = self(),
@@ -943,16 +1039,16 @@ set_mod_flags(Mods, AppModNames) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-do_get_config(S, InclDefaults, InclDerivates) ->
+do_get_config(S, InclDef, InclDeriv) ->
S2 =
- case InclDerivates of
+ case InclDeriv of
false -> shrink_sys(S);
true -> S
end,
- {ok, reltool_target:gen_config(S2#state.sys, InclDefaults)}.
+ {ok, reltool_target:gen_config(S2#state.sys, InclDef)}.
-do_save_config(S, Filename, InclDefaults, InclDerivates) ->
- {ok, Config} = do_get_config(S, InclDefaults, InclDerivates),
+do_save_config(S, Filename, InclDef, InclDeriv) ->
+ {ok, Config} = do_get_config(S, InclDef, InclDeriv),
IoList = io_lib:format("%% config generated at ~w ~w\n~p.\n\n",
[date(), time(), Config]),
file:write_file(Filename, IoList).
@@ -963,13 +1059,15 @@ do_load_config(S, SysConfig) ->
OldSys = S#state.sys,
S2 = shrink_sys(S),
ShrinkedSys = S2#state.sys,
- {NewSys, Status} = read_config(ShrinkedSys#sys{apps = []}, SysConfig, {ok, []}),
+ {NewSys, Status} =
+ read_config(ShrinkedSys#sys{apps = []}, SysConfig, {ok, []}),
case Status of
{ok, _Warnings} ->
Force = false,
{MergedSys, Status2} = merge_config(OldSys, NewSys, Force, Status),
- {S3, Status3} = analyse(S2#state{sys = MergedSys, old_sys = OldSys}, Status2),
- S4 =
+ {S3, Status3} =
+ analyse(S2#state{sys = MergedSys, old_sys = OldSys}, Status2),
+ S4 =
case Status3 of
{ok, _Warnings2} ->
S3#state{status = Status3, old_status = S#state.status};
@@ -988,10 +1086,15 @@ read_config(OldSys, Filename, Status) when is_list(Filename) ->
read_config(OldSys, SysConfig, Status);
{ok, Content} ->
Text = lists:flatten(io_lib:format("~p", [Content])),
- {OldSys, reltool_utils:return_first_error(Status, "Illegal file content: " ++ Text)};
+ {OldSys,
+ reltool_utils:return_first_error(Status,
+ "Illegal file content: " ++
+ Text)};
{error, Reason} ->
Text = file:format_error(Reason),
- {OldSys, reltool_utils:return_first_error(Status, "File access: " ++ Text)}
+ {OldSys,
+ reltool_utils:return_first_error(Status, "File access: " ++
+ Text)}
end;
read_config(OldSys, {sys, KeyVals}, Status) ->
{NewSys, Status2} =
@@ -1006,7 +1109,7 @@ read_config(OldSys, {sys, KeyVals}, Status) ->
[] -> Rels = reltool_utils:default_rels();
Rels -> ok
end,
- NewSys2 = NewSys#sys{apps = lists:sort(Apps), rels = lists:sort(Rels)},
+ NewSys2 = NewSys#sys{apps = lists:sort(Apps), rels = lists:sort(Rels)},
case lists:keysearch(NewSys2#sys.boot_rel, #rel.name, NewSys2#sys.rels) of
{value, _} ->
{NewSys2, Status2};
@@ -1016,9 +1119,11 @@ read_config(OldSys, {sys, KeyVals}, Status) ->
end;
read_config(OldSys, BadConfig, Status) ->
Text = lists:flatten(io_lib:format("~p", [BadConfig])),
- {OldSys, reltool_utils:return_first_error(Status, "Illegal content: " ++ Text)}.
+ {OldSys,
+ reltool_utils:return_first_error(Status, "Illegal content: " ++ Text)}.
-decode(#sys{apps = Apps} = Sys, [{erts = Name, AppKeyVals} | SysKeyVals], Status)
+decode(#sys{apps = Apps} = Sys, [{erts = Name, AppKeyVals} | SysKeyVals],
+ Status)
when is_atom(Name), is_list(AppKeyVals) ->
App = default_app(Name),
{App2, Status2} = decode(App, AppKeyVals, Status),
@@ -1028,7 +1133,8 @@ decode(#sys{apps = Apps} = Sys, [{app, Name, AppKeyVals} | SysKeyVals], Status)
App = default_app(Name),
{App2, Status2} = decode(App, AppKeyVals, Status),
decode(Sys#sys{apps = [App2 | Apps]}, SysKeyVals, Status2);
-decode(#sys{apps = Apps, escripts = Escripts} = Sys, [{escript, File, AppKeyVals} | SysKeyVals], Status)
+decode(#sys{apps = Apps, escripts = Escripts} = Sys,
+ [{escript, File, AppKeyVals} | SysKeyVals], Status)
when is_list(File), is_list(AppKeyVals) ->
{Name, Label} = split_escript_name(File),
App = default_app(Name, File),
@@ -1038,14 +1144,17 @@ decode(#sys{apps = Apps, escripts = Escripts} = Sys, [{escript, File, AppKeyVals
active_dir = File,
sorted_dirs = [File]},
{App3, Status2} = decode(App2, AppKeyVals, Status),
- decode(Sys#sys{apps = [App3 | Apps], escripts = [File | Escripts]}, SysKeyVals, Status2);
-decode(#sys{rels = Rels} = Sys, [{rel, Name, Vsn, RelApps} | SysKeyVals], Status)
+ decode(Sys#sys{apps = [App3 | Apps], escripts = [File | Escripts]},
+ SysKeyVals,
+ Status2);
+decode(#sys{rels = Rels} = Sys, [{rel, Name, Vsn, RelApps} | SysKeyVals],
+ Status)
when is_list(Name), is_list(Vsn), is_list(RelApps) ->
Rel = #rel{name = Name, vsn = Vsn, rel_apps = []},
{Rel2, Status2} = decode(Rel, RelApps, Status),
decode(Sys#sys{rels = [Rel2 | Rels]}, SysKeyVals, Status2);
decode(#sys{} = Sys, [{Key, Val} | KeyVals], Status) ->
- {Sys3, Status3} =
+ {Sys3, Status3} =
case Key of
root_dir when is_list(Val) ->
{Sys#sys{root_dir = Val}, Status};
@@ -1053,10 +1162,10 @@ decode(#sys{} = Sys, [{Key, Val} | KeyVals], Status) ->
{Sys#sys{lib_dirs = Val}, Status};
mod_cond when Val =:= all; Val =:= app;
Val =:= ebin; Val =:= derived;
- Val =:= none ->
+ Val =:= none ->
{Sys#sys{mod_cond = Val}, Status};
incl_cond when Val =:= include; Val =:= exclude;
- Val =:= derived ->
+ Val =:= derived ->
{Sys#sys{incl_cond = Val}, Status};
boot_rel when is_list(Val) ->
{Sys#sys{boot_rel = Val}, Status};
@@ -1065,122 +1174,194 @@ decode(#sys{} = Sys, [{Key, Val} | KeyVals], Status) ->
profile when Val =:= development ->
Val = ?DEFAULT_PROFILE, % assert,
{Sys#sys{profile = Val,
- incl_sys_filters = reltool_utils:decode_regexps(incl_sys_filters,
- ?DEFAULT_INCL_SYS_FILTERS,
- Sys#sys.incl_sys_filters),
- excl_sys_filters = reltool_utils:decode_regexps(excl_sys_filters,
- ?DEFAULT_EXCL_SYS_FILTERS,
- Sys#sys.excl_sys_filters),
- incl_app_filters = reltool_utils:decode_regexps(incl_app_filters,
- ?DEFAULT_INCL_APP_FILTERS,
- Sys#sys.incl_app_filters),
- excl_app_filters = reltool_utils:decode_regexps(excl_app_filters,
- ?DEFAULT_EXCL_APP_FILTERS,
- Sys#sys.excl_app_filters)},
+ incl_sys_filters =
+ reltool_utils:decode_regexps(incl_sys_filters,
+ ?DEFAULT_INCL_SYS_FILTERS,
+ Sys#sys.incl_sys_filters),
+ excl_sys_filters =
+ reltool_utils:decode_regexps(excl_sys_filters,
+ ?DEFAULT_EXCL_SYS_FILTERS,
+ Sys#sys.excl_sys_filters),
+ incl_app_filters =
+ reltool_utils:decode_regexps(incl_app_filters,
+ ?DEFAULT_INCL_APP_FILTERS,
+ Sys#sys.incl_app_filters),
+ excl_app_filters =
+ reltool_utils:decode_regexps(excl_app_filters,
+ ?DEFAULT_EXCL_APP_FILTERS,
+ Sys#sys.excl_app_filters)},
Status};
profile when Val =:= embedded ->
{Sys#sys{profile = Val,
- incl_sys_filters = reltool_utils:decode_regexps(incl_sys_filters,
- ?EMBEDDED_INCL_SYS_FILTERS,
- Sys#sys.incl_sys_filters),
- excl_sys_filters = reltool_utils:decode_regexps(excl_sys_filters,
- ?EMBEDDED_EXCL_SYS_FILTERS,
- Sys#sys.excl_sys_filters),
- incl_app_filters = reltool_utils:decode_regexps(incl_app_filters,
- ?EMBEDDED_INCL_APP_FILTERS,
- Sys#sys.incl_app_filters),
- excl_app_filters = reltool_utils:decode_regexps(excl_app_filters,
- ?EMBEDDED_EXCL_APP_FILTERS,
- Sys#sys.excl_app_filters)},
+ incl_sys_filters =
+ reltool_utils:decode_regexps(incl_sys_filters,
+ ?EMBEDDED_INCL_SYS_FILTERS,
+ Sys#sys.incl_sys_filters),
+ excl_sys_filters =
+ reltool_utils:decode_regexps(excl_sys_filters,
+ ?EMBEDDED_EXCL_SYS_FILTERS,
+ Sys#sys.excl_sys_filters),
+ incl_app_filters =
+ reltool_utils:decode_regexps(incl_app_filters,
+ ?EMBEDDED_INCL_APP_FILTERS,
+ Sys#sys.incl_app_filters),
+ excl_app_filters =
+ reltool_utils:decode_regexps(excl_app_filters,
+ ?EMBEDDED_EXCL_APP_FILTERS,
+ Sys#sys.excl_app_filters)},
Status};
profile when Val =:= standalone ->
{Sys#sys{profile = Val,
- incl_sys_filters = reltool_utils:decode_regexps(incl_sys_filters,
- ?STANDALONE_INCL_SYS_FILTERS,
- Sys#sys.incl_sys_filters),
- excl_sys_filters = reltool_utils:decode_regexps(excl_sys_filters,
- ?STANDALONE_EXCL_SYS_FILTERS,
- Sys#sys.excl_sys_filters),
- incl_app_filters = reltool_utils:decode_regexps(incl_app_filters,
- ?STANDALONE_INCL_APP_FILTERS,
- Sys#sys.incl_app_filters),
- excl_app_filters = reltool_utils:decode_regexps(excl_app_filters,
- ?STANDALONE_EXCL_APP_FILTERS,
- Sys#sys.excl_app_filters)},
+ incl_sys_filters =
+ reltool_utils:decode_regexps(incl_sys_filters,
+ ?STANDALONE_INCL_SYS_FILTERS,
+ Sys#sys.incl_sys_filters),
+ excl_sys_filters =
+ reltool_utils:decode_regexps(excl_sys_filters,
+ ?STANDALONE_EXCL_SYS_FILTERS,
+ Sys#sys.excl_sys_filters),
+ incl_app_filters =
+ reltool_utils:decode_regexps(incl_app_filters,
+ ?STANDALONE_INCL_APP_FILTERS,
+ Sys#sys.incl_app_filters),
+ excl_app_filters =
+ reltool_utils:decode_regexps(excl_app_filters,
+ ?STANDALONE_EXCL_APP_FILTERS,
+ Sys#sys.excl_app_filters)},
Status};
incl_sys_filters ->
- {Sys#sys{incl_sys_filters = reltool_utils:decode_regexps(Key, Val, Sys#sys.incl_sys_filters)}, Status};
+ {Sys#sys{incl_sys_filters =
+ reltool_utils:decode_regexps(Key,
+ Val,
+ Sys#sys.incl_sys_filters)},
+ Status};
excl_sys_filters ->
- {Sys#sys{excl_sys_filters = reltool_utils:decode_regexps(Key, Val, Sys#sys.excl_sys_filters)}, Status};
+ {Sys#sys{excl_sys_filters =
+ reltool_utils:decode_regexps(Key,
+ Val,
+ Sys#sys.excl_sys_filters)},
+ Status};
incl_app_filters ->
- {Sys#sys{incl_app_filters = reltool_utils:decode_regexps(Key, Val, Sys#sys.incl_app_filters)}, Status};
+ {Sys#sys{incl_app_filters =
+ reltool_utils:decode_regexps(Key,
+ Val,
+ Sys#sys.incl_app_filters)},
+ Status};
excl_app_filters ->
- {Sys#sys{excl_app_filters = reltool_utils:decode_regexps(Key, Val, Sys#sys.excl_app_filters)}, Status};
+ {Sys#sys{excl_app_filters =
+ reltool_utils:decode_regexps(Key,
+ Val,
+ Sys#sys.excl_app_filters)},
+ Status};
incl_archive_filters ->
- {Sys#sys{incl_archive_filters = reltool_utils:decode_regexps(Key, Val, Sys#sys.incl_archive_filters)}, Status};
+ {Sys#sys{incl_archive_filters =
+ reltool_utils:decode_regexps(Key,
+ Val,
+ Sys#sys.incl_archive_filters)},
+ Status};
excl_archive_filters ->
- {Sys#sys{excl_archive_filters = reltool_utils:decode_regexps(Key, Val, Sys#sys.excl_archive_filters)}, Status};
+ {Sys#sys{excl_archive_filters =
+ reltool_utils:decode_regexps(Key,
+ Val,
+ Sys#sys.excl_archive_filters)},
+ Status};
archive_opts when is_list(Val) ->
{Sys#sys{archive_opts = Val}, Status};
relocatable when Val =:= true; Val =:= false ->
{Sys#sys{relocatable = Val}, Status};
- app_type when Val =:= permanent; Val =:= transient; Val =:= temporary;
- Val =:= load; Val =:= none ->
+ app_type when Val =:= permanent;
+ Val =:= transient;
+ Val =:= temporary;
+ Val =:= load; Val =:= none ->
{Sys#sys{app_type = Val}, Status};
- app_file when Val =:= keep; Val =:= strip, Val =:= all ->
+ app_file when Val =:= keep; Val =:= strip, Val =:= all ->
{Sys#sys{app_file = Val}, Status};
- debug_info when Val =:= keep; Val =:= strip ->
+ debug_info when Val =:= keep; Val =:= strip ->
{Sys#sys{debug_info = Val}, Status};
_ ->
Text = lists:flatten(io_lib:format("~p", [{Key, Val}])),
- {Sys, reltool_utils:return_first_error(Status, "Illegal option: " ++ Text)}
+ {Sys, reltool_utils:return_first_error(Status,
+ "Illegal option: " ++
+ Text)}
end,
decode(Sys3, KeyVals, Status3);
decode(#app{} = App, [{Key, Val} | KeyVals], Status) ->
- {App2, Status2} =
+ {App2, Status2} =
case Key of
- mod_cond when Val =:= all; Val =:= app; Val =:= ebin; Val =:= derived; Val =:= none ->
+ mod_cond when Val =:= all;
+ Val =:= app;
+ Val =:= ebin;
+ Val =:= derived;
+ Val =:= none ->
{App#app{mod_cond = Val}, Status};
- incl_cond when Val =:= include; Val =:= exclude; Val =:= derived ->
+ incl_cond when Val =:= include;
+ Val =:= exclude;
+ Val =:= derived ->
{App#app{incl_cond = Val}, Status};
- debug_info when Val =:= keep; Val =:= strip ->
+ debug_info when Val =:= keep;
+ Val =:= strip ->
{App#app{debug_info = Val}, Status};
- app_file when Val =:= keep; Val =:= strip, Val =:= all ->
+ app_file when Val =:= keep;
+ Val =:= strip,
+ Val =:= all ->
{App#app{app_file = Val}, Status};
- app_type when Val =:= permanent; Val =:= transient; Val =:= temporary;
- Val =:= load; Val =:= none ->
+ app_type when Val =:= permanent;
+ Val =:= transient;
+ Val =:= temporary;
+ Val =:= load;
+ Val =:= none ->
{App#app{app_type = Val}, Status};
incl_app_filters ->
- {App#app{incl_app_filters = reltool_utils:decode_regexps(Key, Val, App#app.incl_app_filters)}, Status};
+ {App#app{incl_app_filters =
+ reltool_utils:decode_regexps(Key,
+ Val,
+ App#app.incl_app_filters)},
+ Status};
excl_app_filters ->
- {App#app{excl_app_filters = reltool_utils:decode_regexps(Key, Val, App#app.excl_app_filters)}, Status};
+ {App#app{excl_app_filters =
+ reltool_utils:decode_regexps(Key,
+ Val,
+ App#app.excl_app_filters)},
+ Status};
incl_archive_filters ->
- {App#app{incl_archive_filters = reltool_utils:decode_regexps(Key, Val, App#app.incl_archive_filters)}, Status};
+ {App#app{incl_archive_filters =
+ reltool_utils:decode_regexps(Key,
+ Val,
+ App#app.incl_archive_filters)},
+ Status};
excl_archive_filters ->
- {App#app{excl_archive_filters = reltool_utils:decode_regexps(Key, Val, App#app.excl_archive_filters)}, Status};
+ {App#app{excl_archive_filters =
+ reltool_utils:decode_regexps(Key,
+ Val,
+ App#app.excl_archive_filters)},
+ Status};
archive_opts when is_list(Val) ->
{App#app{archive_opts = Val}, Status};
- vsn when is_list(Val) ->
+ vsn when is_list(Val) ->
{App#app{use_selected_vsn = true, vsn = Val}, Status};
_ ->
Text = lists:flatten(io_lib:format("~p", [{Key, Val}])),
- {App, reltool_utils:return_first_error(Status, "Illegal option: " ++ Text)}
+ {App, reltool_utils:return_first_error(Status,
+ "Illegal option: " ++ Text)}
end,
decode(App2, KeyVals, Status2);
-decode(#app{mods = Mods} = App, [{mod, Name, ModKeyVals} | AppKeyVals], Status) ->
+decode(#app{mods = Mods} = App, [{mod, Name, ModKeyVals} | AppKeyVals],
+ Status) ->
{Mod, Status2} = decode(#mod{name = Name}, ModKeyVals, Status),
decode(App#app{mods = [Mod | Mods]}, AppKeyVals, Status2);
decode(#mod{} = Mod, [{Key, Val} | KeyVals], Status) ->
- {Mod2, Status2} =
+ {Mod2, Status2} =
case Key of
- incl_cond when Val =:= include; Val =:= exclude; Val =:= derived ->
+ incl_cond when Val =:= include; Val =:= exclude; Val =:= derived ->
{Mod#mod{incl_cond = Val}, Status};
- debug_info when Val =:= keep; Val =:= strip ->
+ debug_info when Val =:= keep; Val =:= strip ->
{Mod#mod{debug_info = Val}, Status};
_ ->
Text = lists:flatten(io_lib:format("~p", [{Key, Val}])),
- {Mod, reltool_utils:return_first_error(Status, "Illegal option: " ++ Text)}
+ {Mod,
+ reltool_utils:return_first_error(Status,
+ "Illegal option: " ++ Text)}
end,
decode(Mod2, KeyVals, Status2);
decode(#rel{rel_apps = RelApps} = Rel, [RelApp | KeyVals], Status) ->
@@ -1191,7 +1372,9 @@ decode(#rel{rel_apps = RelApps} = Rel, [RelApp | KeyVals], Status) ->
{Name, Type} when is_atom(Name) ->
#rel_app{name = Name, app_type = Type, incl_apps = []};
{Name, InclApps} when is_atom(Name), is_list(InclApps) ->
- #rel_app{name = Name, app_type = undefined, incl_apps = InclApps};
+ #rel_app{name = Name,
+ app_type = undefined,
+ incl_apps = InclApps};
{Name, Type, InclApps} when is_atom(Name), is_list(InclApps) ->
#rel_app{name = Name, app_type = Type, incl_apps = InclApps};
_ ->
@@ -1204,7 +1387,9 @@ decode(#rel{rel_apps = RelApps} = Rel, [RelApp | KeyVals], Status) ->
decode(Rel#rel{rel_apps = RelApps ++ [RA]}, KeyVals, Status);
true ->
Text = lists:flatten(io_lib:format("~p", [RelApp])),
- Status2 = reltool_utils:return_first_error(Status, "Illegal option: " ++ Text),
+ Status2 =
+ reltool_utils:return_first_error(Status,
+ "Illegal option: " ++ Text),
decode(Rel, KeyVals, Status2)
end;
decode(Acc, [], Status) ->
@@ -1227,7 +1412,7 @@ is_type(Type) ->
split_escript_name(File) when is_list(File) ->
Label = filename:basename(File, ".escript"),
{list_to_atom("*escript* " ++ Label), Label}.
-
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
refresh(#state{sys = Sys} = S, Force, Status) ->
@@ -1245,7 +1430,8 @@ merge_config(OldSys, NewSys, Force, Status) ->
escripts_to_apps(Escripts, MergedApps, OldSys#sys.apps, Status2),
{RefreshedApps, Status4} =
refresh_apps(OldSys#sys.apps, AllApps, [], Force, Status3),
- {PatchedApps, Status5} = patch_erts_version(RootDir, RefreshedApps, Status4),
+ {PatchedApps, Status5} =
+ patch_erts_version(RootDir, RefreshedApps, Status4),
Escripts2 = [A#app.active_dir || A <- PatchedApps, A#app.is_escript],
NewSys2 = NewSys#sys{root_dir = RootDir,
lib_dirs = LibDirs,
@@ -1255,8 +1441,9 @@ merge_config(OldSys, NewSys, Force, Status) ->
verify_config(Sys, Status) ->
case lists:keymember(Sys#sys.boot_rel, #rel.name, Sys#sys.rels) of
- true ->
- lists:foreach(fun(Rel)-> check_rel(Rel, Sys, Status) end, Sys#sys.rels),
+ true ->
+ lists:foreach(fun(Rel)-> check_rel(Rel, Sys, Status) end,
+ Sys#sys.rels),
Status;
false ->
Text = lists:concat([Sys#sys.boot_rel, ": release is mandatory"]),
@@ -1264,15 +1451,19 @@ verify_config(Sys, Status) ->
throw({error, Status2})
end.
-check_rel(#rel{name = RelName, rel_apps = RelApps}, #sys{apps = Apps}, Status) ->
+check_rel(#rel{name = RelName, rel_apps = RelApps},
+ #sys{apps = Apps},
+ Status) ->
EnsureApp =
fun(AppName) ->
case lists:keymember(AppName, #rel_app.name, RelApps) of
true ->
ok;
false ->
- Text = lists:concat([RelName, ": ", AppName, " is not included."]),
- Status2 = reltool_utils:return_first_error(Status, Text),
+ Text = lists:concat([RelName, ": ", AppName,
+ " is not included."]),
+ Status2 =
+ reltool_utils:return_first_error(Status, Text),
throw({error, Status2})
end
end,
@@ -1286,9 +1477,11 @@ check_rel(#rel{name = RelName, rel_apps = RelApps}, #sys{apps = Apps}, Status) -
{value, App} when App#app.is_included ->
ok;
_ ->
- Text = lists:concat([RelName, ": uses application ",
- AppName, " that not is included."]),
- Status2 = reltool_utils:return_first_error(Status, Text),
+ Text =
+ lists:concat([RelName, ": uses application ",
+ AppName, " that not is included."]),
+ Status2 =
+ reltool_utils:return_first_error(Status, Text),
%% throw BUGBUG: add throw
({error, Status2})
end
@@ -1308,13 +1501,14 @@ patch_erts_version(RootDir, Apps, Status) ->
Apps2 = lists:keystore(AppName, #app.name, Apps, Erts2),
{Apps2, Status};
Vsn =:= "" ->
- {Apps, reltool_utils:add_warning(Status, "erts has no version")};
+ {Apps, reltool_utils:add_warning(Status,
+ "erts has no version")};
true ->
{Apps, Status}
end;
false ->
Text = "erts cannnot be found in the root directory " ++ RootDir,
- Status2 = reltool_utils:return_first_error(Status, Text),
+ Status2 = reltool_utils:return_first_error(Status, Text),
{Apps, Status2}
end.
@@ -1327,21 +1521,31 @@ libs_to_dirs(RootDir, LibDirs, Status) ->
[] ->
Fun = fun(Base) ->
AppDir = filename:join([RootLibDir, Base]),
- case filelib:is_dir(filename:join([AppDir, "ebin"]), erl_prim_loader) of
+ case filelib:is_dir(filename:join([AppDir,
+ "ebin"]),
+ erl_prim_loader) of
true ->
AppDir;
false ->
- filename:join([RootDir, Base, "preloaded"])
+ filename:join([RootDir,
+ Base,
+ "preloaded"])
end
end,
- ErtsFiles = [{erts, Fun(F)} || F <- RootFiles, lists:prefix("erts", F)],
+ ErtsFiles = [{erts, Fun(F)} || F <- RootFiles,
+ lists:prefix("erts", F)],
app_dirs2(AllLibDirs, [ErtsFiles], Status);
[Duplicate | _] ->
- {[], reltool_utils:return_first_error(Status, "Duplicate library: " ++ Duplicate)}
+ {[],
+ reltool_utils:return_first_error(Status,
+ "Duplicate library: " ++
+ Duplicate)}
end;
{error, Reason} ->
Text = file:format_error(Reason),
- {[], reltool_utils:return_first_error(Status, "Missing root library " ++ RootDir ++ ": " ++ Text)}
+ {[], reltool_utils:return_first_error(Status,
+ "Missing root library " ++
+ RootDir ++ ": " ++ Text)}
end.
app_dirs2([Lib | Libs], Acc, Status) ->
@@ -1352,8 +1556,9 @@ app_dirs2([Lib | Libs], Acc, Status) ->
AppDir = filename:join([Lib, Base]),
EbinDir = filename:join([AppDir, "ebin"]),
case filelib:is_dir(EbinDir, erl_prim_loader) of
- true ->
- {Name, _Vsn} = reltool_utils:split_app_name(Base),
+ true ->
+ {Name, _Vsn} =
+ reltool_utils:split_app_name(Base),
case Name of
erts -> false;
_ -> {true, {Name, AppDir}}
@@ -1366,7 +1571,9 @@ app_dirs2([Lib | Libs], Acc, Status) ->
app_dirs2(Libs, [Files2 | Acc], Status);
{error, Reason} ->
Text = file:format_error(Reason),
- {[], reltool_utils:return_first_error(Status, "Illegal library " ++ Lib ++ ": " ++ Text)}
+ {[], reltool_utils:return_first_error(Status,
+ "Illegal library " ++
+ Lib ++ ": " ++ Text)}
end;
app_dirs2([], Acc, Status) ->
{lists:sort(lists:append(Acc)), Status}.
@@ -1380,17 +1587,29 @@ escripts_to_apps([Escript | Escripts], Apps, OldApps, Status) ->
[AppLabel, "ebin", File] ->
case filename:extension(File) of
".app" ->
- {AppName, DefaultVsn} = reltool_utils:split_app_name(AppLabel),
- AppFileName = filename:join([Escript, FullName]),
+ {AppName, DefaultVsn} =
+ reltool_utils:split_app_name(AppLabel),
+ AppFileName =
+ filename:join([Escript, FullName]),
{Info, StatusAcc2} =
- read_app_info(GetBin(), AppFileName, AppName, DefaultVsn, Status),
+ read_app_info(GetBin(),
+ AppFileName,
+ AppName,
+ DefaultVsn,
+ Status),
Dir = filename:join([Escript, AppName]),
- {[{AppName, app, Dir, Info} | FileAcc], StatusAcc2};
+ {[{AppName, app, Dir, Info} | FileAcc],
+ StatusAcc2};
E when E =:= Ext ->
- {AppName, _} = reltool_utils:split_app_name(AppLabel),
- Mod = init_mod(AppName, File, {File, GetBin()}, Ext),
+ {AppName, _} =
+ reltool_utils:split_app_name(AppLabel),
+ Mod = init_mod(AppName,
+ File,
+ {File, GetBin()},
+ Ext),
Dir = filename:join([Escript, AppName]),
- {[{AppName, mod, Dir, Mod} | FileAcc], StatusAcc};
+ {[{AppName, mod, Dir, Mod} | FileAcc],
+ StatusAcc};
_ ->
{FileAcc, StatusAcc}
end;
@@ -1398,13 +1617,21 @@ escripts_to_apps([Escript | Escripts], Apps, OldApps, Status) ->
Bin = GetBin(),
{ok, {ModName, _}} = beam_lib:version(Bin),
ModStr = atom_to_list(ModName) ++ Ext,
- Mod = init_mod(EscriptAppName, ModStr, {ModStr, GetBin()}, Ext),
- {[{EscriptAppName, mod, Escript, Mod} | FileAcc], StatusAcc};
+ Mod = init_mod(EscriptAppName,
+ ModStr,
+ {ModStr, GetBin()},
+ Ext),
+ {[{EscriptAppName, mod, Escript, Mod} | FileAcc],
+ StatusAcc};
[File] ->
case filename:extension(File) of
E when E =:= Ext ->
- Mod = init_mod(EscriptAppName, File, {File, GetBin()}, Ext),
- {[{EscriptAppName, mod, File, Mod} | FileAcc], StatusAcc};
+ Mod = init_mod(EscriptAppName,
+ File,
+ {File, GetBin()},
+ Ext),
+ {[{EscriptAppName, mod, File, Mod} | FileAcc],
+ StatusAcc};
_ ->
{FileAcc, StatusAcc}
end;
@@ -1412,43 +1639,82 @@ escripts_to_apps([Escript | Escripts], Apps, OldApps, Status) ->
{FileAcc, StatusAcc}
end
end,
- try
- case escript:foldl(Fun, {[], Status}, Escript) of
- {ok, {Files, Status2}} ->
- {Apps2, Status3} = files_to_apps(Escript, lists:sort(Files), Apps, Apps, OldApps, Status2),
- escripts_to_apps(Escripts, Apps2, OldApps, Status3);
- {error, Reason} ->
- Text = lists:flatten(io_lib:format("~p", [Reason])),
- {[], reltool_utils:return_first_error(Status, "Illegal escript " ++ Escript ++ ": " ++ Text)}
- end
- catch
- throw:Reason2 when is_list(Reason2) ->
- {[], reltool_utils:return_first_error(Status, "Illegal escript " ++ Escript ++ ": " ++ Reason2)}
+ case reltool_utils:escript_foldl(Fun, {[], Status}, Escript) of
+ {ok, {Files, Status2}} ->
+ {Apps2, Status3} =
+ files_to_apps(Escript,
+ lists:sort(Files),
+ Apps,
+ Apps,
+ OldApps,
+ Status2),
+ escripts_to_apps(Escripts, Apps2, OldApps, Status3);
+ {error, Reason} ->
+ Text = lists:flatten(io_lib:format("~p", [Reason])),
+ {[], reltool_utils:return_first_error(Status,
+ "Illegal escript " ++
+ Escript ++ ": " ++ Text)}
end;
escripts_to_apps([], Apps, _OldApps, Status) ->
{Apps, Status}.
%% Assume that all files for an app are in consecutive order
%% Assume the app info is before the mods
-files_to_apps(Escript, [{AppName, Type, Dir, ModOrInfo} | Files] = AllFiles, Acc, Apps, OldApps, Status) ->
+files_to_apps(Escript,
+ [{AppName, Type, Dir, ModOrInfo} | Files] = AllFiles,
+ Acc,
+ Apps,
+ OldApps,
+ Status) ->
case Type of
mod ->
case Acc of
[] ->
Info = missing_app_info(""),
- {NewApp, Status2} = merge_escript_app(AppName, Dir, Info, [ModOrInfo], Apps, OldApps, Status),
- files_to_apps(Escript, AllFiles, [NewApp | Acc], Apps, OldApps, Status2);
+ {NewApp, Status2} =
+ merge_escript_app(AppName,
+ Dir,
+ Info,
+ [ModOrInfo],
+ Apps,
+ OldApps,
+ Status),
+ files_to_apps(Escript,
+ AllFiles,
+ [NewApp | Acc],
+ Apps,
+ OldApps, Status2);
[App | Acc2] when App#app.name =:= ModOrInfo#mod.app_name ->
App2 = App#app{mods = [ModOrInfo | App#app.mods]},
- files_to_apps(Escript, Files, [App2 | Acc2], Apps, OldApps, Status);
+ files_to_apps(Escript,
+ Files,
+ [App2 | Acc2],
+ Apps,
+ OldApps,
+ Status);
[App | Acc2] ->
- PrevApp = App#app{mods = lists:keysort(#mod.name, App#app.mods)},
+ PrevApp = App#app{mods = lists:keysort(#mod.name,
+ App#app.mods)},
Info = missing_app_info(""),
- {NewApp, Status2} = merge_escript_app(AppName, Dir, Info, [ModOrInfo], Apps, OldApps, Status),
- files_to_apps(Escript, Files, [NewApp, PrevApp | Acc2], Apps, OldApps, Status2)
+ {NewApp, Status2} =
+ merge_escript_app(AppName,
+ Dir,
+ Info,
+ [ModOrInfo],
+ Apps,
+ OldApps,
+ Status),
+ files_to_apps(Escript,
+ Files,
+ [NewApp, PrevApp | Acc2],
+ Apps,
+ OldApps,
+ Status2)
end;
app ->
- {App, Status2} = merge_escript_app(AppName, Dir, ModOrInfo, [], Apps, OldApps, Status),
+ {App, Status2} =
+ merge_escript_app(AppName, Dir, ModOrInfo, [], Apps, OldApps,
+ Status),
files_to_apps(Escript, Files, [App | Acc], Apps, OldApps, Status2)
end;
files_to_apps(_Escript, [], Acc, _Apps, _OldApps, Status) ->
@@ -1470,13 +1736,14 @@ merge_escript_app(AppName, Dir, Info, Mods, Apps, OldApps, Status) ->
case lists:keysearch(AppName, #app.name, Apps) of
{value, _} ->
Error = lists:concat([AppName, ": Application name clash. ",
- "Escript ", Dir," contains application ", AppName, "."]),
+ "Escript ", Dir," contains application ",
+ AppName, "."]),
{App2, reltool_utils:return_first_error(Status, Error)};
false ->
{App2, Status}
end.
-merge_app_dirs([{Name, Dir} | Rest], [App | Apps], OldApps)
+merge_app_dirs([{Name, Dir} | Rest], [App | Apps], OldApps)
when App#app.name =:= Name ->
%% Add new dir to app
App2 = App#app{sorted_dirs = [Dir | App#app.sorted_dirs]},
@@ -1491,10 +1758,11 @@ merge_app_dirs([{Name, Dir} | Rest], Apps, OldApps) ->
{value, OldApp} when OldApp#app.active_dir =:= Dir ->
[OldApp | Apps2];
{value, OldApp} ->
- App =
+ App =
case filter_app(OldApp) of
{true, NewApp} ->
- NewApp#app{active_dir = Dir, sorted_dirs = [Dir]};
+ NewApp#app{active_dir = Dir,
+ sorted_dirs = [Dir]};
false ->
default_app(Name, Dir)
end,
@@ -1547,10 +1815,11 @@ default_app(Name) ->
is_pre_included = undefined,
is_included = undefined}.
-%% Assume that the application are sorted
-refresh_apps([Old | OldApps], [New | NewApps], Acc, Force, Status) when New#app.name =:= Old#app.name ->
+%% Assume that the application are sorted
+refresh_apps([Old | OldApps], [New | NewApps], Acc, Force, Status)
+ when New#app.name =:= Old#app.name ->
{Info, ActiveDir, Status2} = ensure_app_info(New, Status),
- OptLabel =
+ OptLabel =
case Info#app_info.vsn =:= New#app.vsn of
true -> New#app.label;
false -> undefined % Cause refresh
@@ -1559,23 +1828,28 @@ refresh_apps([Old | OldApps], [New | NewApps], Acc, Force, Status) when New#app.
refresh_app(New#app{label = OptLabel,
active_dir = ActiveDir,
vsn = Info#app_info.vsn,
- info = Info},
+ info = Info},
Force,
Status2),
refresh_apps(OldApps, NewApps, [Refreshed | Acc], Force, Status3);
-refresh_apps([Old | OldApps], [New | NewApps], Acc, Force, Status) when New#app.name < Old#app.name ->
+refresh_apps([Old | OldApps], [New | NewApps], Acc, Force, Status)
+ when New#app.name < Old#app.name ->
%% No old app version exists. Use new as is.
%% BUGBUG: Issue warning if the active_dir is not defined
{New2, Status2} = refresh_app(New, Force, Status),
refresh_apps([Old | OldApps], NewApps, [New2 | Acc], Force, Status2);
-refresh_apps([Old | OldApps], [New | NewApps], Acc, Force, Status) when New#app.name > Old#app.name ->
+refresh_apps([Old | OldApps], [New | NewApps], Acc, Force, Status)
+ when New#app.name > Old#app.name ->
%% No new version. Remove the old.
Status2 =
case Old#app.name =:= ?MISSING_APP of
true ->
Status;
false ->
- Warning = lists:concat([Old#app.name, ": The source dirs does not contain the application anymore."]),
+ Warning =
+ lists:concat([Old#app.name,
+ ": The source dirs does not ",
+ "contain the application anymore."]),
reltool_utils:add_warning(Status, Warning)
end,
refresh_apps(OldApps, [New | NewApps], Acc, Force, Status2);
@@ -1590,21 +1864,28 @@ refresh_apps([Old | OldApps], [], Acc, Force, Status) ->
true ->
Status;
false ->
- Warning = lists:concat([Old#app.name, ": The source dirs ",
- "does not contain the application anymore."]),
+ Warning =
+ lists:concat([Old#app.name,
+ ": The source dirs does not "
+ "contain the application anymore."]),
reltool_utils:add_warning(Status, Warning)
end,
refresh_apps(OldApps, [], Acc, Force, Status2);
refresh_apps([], [], Acc, _Force, Status) ->
{lists:reverse(Acc), Status}.
-ensure_app_info(#app{is_escript = true, active_dir = Dir, info = Info}, Status) ->
+ensure_app_info(#app{is_escript = true, active_dir = Dir, info = Info},
+ Status) ->
{Info, Dir, Status};
ensure_app_info(#app{name = Name, sorted_dirs = []}, Status) ->
Error = lists:concat([Name, ": Missing application directory."]),
Status2 = reltool_utils:return_first_error(Status, Error),
{missing_app_info(""), undefined, Status2};
-ensure_app_info(#app{name = Name, vsn = Vsn, sorted_dirs = Dirs, info = undefined}, Status) ->
+ensure_app_info(#app{name = Name,
+ vsn = Vsn,
+ sorted_dirs = Dirs,
+ info = undefined},
+ Status) ->
ReadInfo =
fun(Dir, StatusAcc) ->
Base = get_base(Name, Dir),
@@ -1621,8 +1902,10 @@ ensure_app_info(#app{name = Name, vsn = Vsn, sorted_dirs = Dirs, info = undefine
%% No redundant info
Status2;
[BadVsn | _] ->
- Error2 = lists:concat([Name, ": Application version clash. ",
- "Multiple directories contains version \"", BadVsn, "\"."]),
+ Error2 =
+ lists:concat([Name, ": Application version clash. ",
+ "Multiple directories contains version \"",
+ BadVsn, "\"."]),
reltool_utils:return_first_error(Status2, Error2)
end,
FirstInfo = hd(AllInfo),
@@ -1637,7 +1920,11 @@ ensure_app_info(#app{name = Name, vsn = Vsn, sorted_dirs = Dirs, info = undefine
{Info, VsnDir} ->
{Info, VsnDir, Status3};
false ->
- Error3 = lists:concat([Name, ": No application directory contains selected version \"", Vsn, "\"."]),
+ Error3 =
+ lists:concat([Name,
+ ": No application directory contains ",
+ "selected version \"",
+ Vsn, "\"."]),
Status4 = reltool_utils:return_first_error(Status3, Error3),
{FirstInfo, FirstDir, Status4}
end
diff --git a/lib/reltool/src/reltool_sys_win.erl b/lib/reltool/src/reltool_sys_win.erl
index ea80ab7e85..2e226d9147 100644
--- a/lib/reltool/src/reltool_sys_win.erl
+++ b/lib/reltool/src/reltool_sys_win.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2009-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
-module(reltool_sys_win).
@@ -34,7 +34,7 @@
-include_lib("wx/include/wx.hrl").
-include("reltool.hrl").
--record(state,
+-record(state,
{parent_pid,
server_pid,
app_wins,
@@ -61,7 +61,7 @@
-define(WIN_HEIGHT, 600).
-define(CLOSE_ITEM, ?wxID_EXIT). %% Use OS specific version if available
--define(ABOUT_ITEM, ?wxID_ABOUT). %% Use OS specific
+-define(ABOUT_ITEM, ?wxID_ABOUT). %% Use OS specific
-define(CONTENTS_ITEM, 300).
-define(APP_GRAPH_ITEM, 301).
-define(MOD_GRAPH_ITEM, 302).
@@ -100,7 +100,11 @@
%% Client
start_link(Opts) ->
- proc_lib:start_link(?MODULE, init, [[{parent, self()} | Opts]], infinity, []).
+ proc_lib:start_link(?MODULE,
+ init,
+ [[{parent, self()} | Opts]],
+ infinity,
+ []).
get_server(Pid) ->
reltool_utils:call(Pid, get_server).
@@ -146,9 +150,13 @@ do_init([{parent, Parent} | Options]) ->
S3 = S2#state{sys = Sys2},
S5 = wx:batch(fun() ->
Title = atom_to_list(?APPLICATION),
- wxFrame:setTitle(S3#state.frame, Title),
- %% wxFrame:setMinSize(Frame, {?WIN_WIDTH, ?WIN_HEIGHT}),
- wxStatusBar:setStatusText(S3#state.status_bar, "Done."),
+ wxFrame:setTitle(S3#state.frame,
+ Title),
+ %% wxFrame:setMinSize(Frame,
+ %% {?WIN_WIDTH, ?WIN_HEIGHT}),
+ wxStatusBar:setStatusText(
+ S3#state.status_bar,
+ "Done."),
S4 = redraw_apps(S3),
redraw_libs(S4)
end),
@@ -182,7 +190,12 @@ loop(S) ->
receive
{system, From, Msg} ->
Common = S#state.common,
- sys:handle_system_msg(Msg, From, S#state.parent_pid, ?MODULE, Common#common.sys_debug, S);
+ sys:handle_system_msg(Msg,
+ From,
+ S#state.parent_pid,
+ ?MODULE,
+ Common#common.sys_debug,
+ S);
#wx{obj = ObjRef,
event = #wxClose{type = close_window}} = Msg ->
if
@@ -193,17 +206,22 @@ loop(S) ->
FWs = S#state.fgraph_wins,
case lists:keysearch(ObjRef, #fgraph_win.frame, FWs) of
{value, FW} ->
- reltool_fgraph_win:stop(FW#fgraph_win.pid, shutdown),
+ reltool_fgraph_win:stop(FW#fgraph_win.pid,
+ shutdown),
wxFrame:destroy(ObjRef),
- FWs2 = lists:keydelete(ObjRef, #fgraph_win.frame, FWs),
+ FWs2 =
+ lists:keydelete(ObjRef, #fgraph_win.frame, FWs),
?MODULE:loop(S#state{fgraph_wins = FWs2});
false ->
- error_logger:format("~p~p got unexpected message:\n\t~p\n",
- [?MODULE, self(), Msg]),
+ error_logger:format("~p~p got unexpected "
+ "message:\n\t~p\n",
+ [?MODULE, self(), Msg]),
?MODULE:loop(S)
end
end;
- #wx{id = ?CLOSE_ITEM, event = #wxCommand{type = command_menu_selected}, userData = main_window} ->
+ #wx{id = ?CLOSE_ITEM,
+ event = #wxCommand{type = command_menu_selected},
+ userData = main_window} ->
wxFrame:destroy(S#state.frame),
exit(shutdown);
#wx{event = #wxSize{}} = Wx ->
@@ -222,14 +240,18 @@ loop(S) ->
?MODULE:loop(S2);
{call, ReplyTo, Ref, {open_app, AppName}} ->
S2 = do_open_app(S, AppName),
- {value, #app_win{pid = AppPid}} = lists:keysearch(AppName, #app_win.name, S2#state.app_wins),
+ {value, #app_win{pid = AppPid}} =
+ lists:keysearch(AppName, #app_win.name, S2#state.app_wins),
reltool_utils:reply(ReplyTo, Ref, {ok, AppPid}),
?MODULE:loop(S2);
{'EXIT', Pid, Reason} when Pid =:= S#state.parent_pid ->
- [reltool_fgraph_win:stop(FW#fgraph_win.pid, Reason) || FW <- S#state.fgraph_wins],
+ [reltool_fgraph_win:stop(FW#fgraph_win.pid, Reason) ||
+ FW <- S#state.fgraph_wins],
exit(Reason);
{'EXIT', _Pid, _Reason} = Exit ->
- {FWs, AWs} = handle_child_exit(Exit, S#state.fgraph_wins, S#state.app_wins),
+ {FWs, AWs} = handle_child_exit(Exit,
+ S#state.fgraph_wins,
+ S#state.app_wins),
?MODULE:loop(S#state{fgraph_wins = FWs, app_wins = AWs});
Msg ->
error_logger:format("~p~p got unexpected message:\n\t~p\n",
@@ -261,7 +283,8 @@ msg_warning(Exit, Type) ->
create_window(S) ->
Title = lists:concat([?APPLICATION, " - starting up"]),
- Frame = wxFrame:new(wx:null(), ?wxID_ANY, Title, [{size, {?WIN_WIDTH, ?WIN_HEIGHT}}]),
+ Frame = wxFrame:new(wx:null(), ?wxID_ANY, Title,
+ [{size, {?WIN_WIDTH, ?WIN_HEIGHT}}]),
%%wxFrame:setSize(Frame, {?WIN_WIDTH, ?WIN_HEIGHT}),
%% wxFrame:setMinSize(Frame, {?WIN_WIDTH, ?WIN_HEIGHT}),
Bar = wxFrame:createStatusBar(Frame,[]),
@@ -306,21 +329,29 @@ create_menubar(Frame) ->
File = wxMenu:new([]),
Help = wxMenu:new([]),
wxMenuBar:append(MenuBar, File, "File" ),
- wxMenu:append(File, ?APP_GRAPH_ITEM, "Display application dependency graph" ),
- wxMenu:append(File, ?MOD_GRAPH_ITEM, "Display module dependency graph" ),
+ wxMenu:append(File, ?APP_GRAPH_ITEM,
+ "Display application dependency graph" ),
+ wxMenu:append(File, ?MOD_GRAPH_ITEM,
+ "Display module dependency graph" ),
wxMenu:appendSeparator(File),
wxMenu:append(File, ?RESET_CONFIG_ITEM, "Reset configuration to default" ),
wxMenu:append(File, ?UNDO_CONFIG_ITEM, "Undo configuration (toggle)" ),
wxMenu:append(File, ?LOAD_CONFIG_ITEM, "Load configuration" ),
Save = wxMenu:new(),
- wxMenu:append(Save, ?SAVE_CONFIG_NODEF_NODER_ITEM, "Save explicit configuration (neither defaults nor derivates)"),
- wxMenu:append(Save, ?SAVE_CONFIG_DEF_NODER_ITEM , "Save configuration defaults (defaults only)"),
- wxMenu:append(Save, ?SAVE_CONFIG_NODEF_DER_ITEM, "Save configuration derivates (derivates only))"),
- wxMenu:append(Save, ?SAVE_CONFIG_DEF_DER_ITEM, "Save extended configuration (both defaults and derivates)"),
+ wxMenu:append(Save, ?SAVE_CONFIG_NODEF_NODER_ITEM,
+ "Save explicit configuration "
+ "(neither defaults nor derivates)"),
+ wxMenu:append(Save, ?SAVE_CONFIG_DEF_NODER_ITEM,
+ "Save configuration defaults (defaults only)"),
+ wxMenu:append(Save, ?SAVE_CONFIG_NODEF_DER_ITEM,
+ "Save configuration derivates (derivates only))"),
+ wxMenu:append(Save, ?SAVE_CONFIG_DEF_DER_ITEM,
+ "Save extended configuration (both defaults and derivates)"),
wxMenu:append(File, ?wxID_ANY, "Save configuration", Save),
wxMenu:appendSeparator(File),
- wxMenu:append(File, ?GEN_REL_FILES_ITEM, "Generate rel, script and boot files" ),
+ wxMenu:append(File, ?GEN_REL_FILES_ITEM,
+ "Generate rel, script and boot files" ),
wxMenu:append(File, ?GEN_TARGET_ITEM, "Generate target system" ),
wxMenu:appendSeparator(File),
wxMenu:append(File, ?CLOSE_ITEM, "Close" ),
@@ -375,12 +406,13 @@ create_app_list_ctrl(Panel, OuterSz, Title, Tick, Cross) ->
%% ?wxLC_SINGLE_SEL bor
?wxVSCROLL},
{size, {Width, Height}}]),
- ToolTip = "Select application(s) or open separate application window with a double click.",
+ ToolTip = "Select application(s) or open separate "
+ "application window with a double click.",
wxListCtrl:setToolTip(ListCtrl, ToolTip),
%% Prep images
reltool_utils:assign_image_list(ListCtrl),
-
+
%% Prep column label
ListItem = wxListItem:new(),
wxListItem:setAlign(ListItem, ?wxLIST_FORMAT_LEFT),
@@ -395,7 +427,7 @@ create_app_list_ctrl(Panel, OuterSz, Title, Tick, Cross) ->
InnerSz = wxBoxSizer:new(?wxVERTICAL),
- wxSizer:add(InnerSz,
+ wxSizer:add(InnerSz,
ListCtrl,
[{border, 2},
{flag, ?wxALL bor ?wxEXPAND},
@@ -408,9 +440,10 @@ create_app_list_ctrl(Panel, OuterSz, Title, Tick, Cross) ->
[{flag, ?wxEXPAND}, {proportion, 1}]),
%% Subscribe on events
- wxEvtHandler:connect(ListCtrl, size, [{skip, true}, {userData, app_list_ctrl}]),
+ wxEvtHandler:connect(ListCtrl, size,
+ [{skip, true}, {userData, app_list_ctrl}]),
wxEvtHandler:connect(ListCtrl, command_list_item_activated),
- wxWindow:connect(ListCtrl, enter_window),
+ wxWindow:connect(ListCtrl, enter_window),
ListCtrl.
@@ -423,7 +456,7 @@ create_button(Panel, Sizer, ListCtrl, Title, BitMapName, Action) ->
wxBitmapButton:setToolTip(Button, ToolTip),
Options = [{userData, {app_button, Action, ListCtrl}}],
wxEvtHandler:connect(Button, command_button_clicked, Options),
- wxSizer:add(Sizer,
+ wxSizer:add(Sizer,
Button,
[{border, 2},
{flag, ?wxALL},
@@ -439,7 +472,7 @@ action_to_tool_tip(Label, Action) ->
"Remove selected application(s)from whitelist.";
blacklist_add when Label =:= ?blacklist ->
"Remove selected application(s) from blacklist.";
- blacklist_add ->
+ blacklist_add ->
"Add selected application(s) to blacklist.";
blacklist_del ->
"Remove selected application(s) from blacklist."
@@ -448,8 +481,9 @@ action_to_tool_tip(Label, Action) ->
create_lib_page(#state{book = Book} = S) ->
Panel = wxPanel:new(Book, []),
Sizer = wxBoxSizer:new(?wxHORIZONTAL),
-
- Tree = wxTreeCtrl:new(Panel, [{style , ?wxTR_HAS_BUTTONS bor ?wxTR_HIDE_ROOT}]),
+
+ Tree = wxTreeCtrl:new(Panel,
+ [{style , ?wxTR_HAS_BUTTONS bor ?wxTR_HIDE_ROOT}]),
ToolTip = "Edit application sources.",
wxBitmapButton:setToolTip(Tree, ToolTip),
@@ -478,7 +512,9 @@ redraw_libs(#state{lib_tree = Tree, sys = Sys} = S) ->
[append_lib(Tree, LibItem, Dir) || Dir <- Sys#sys.lib_dirs],
EscriptItem = append_item(Tree, Top, "Escript files", undefined),
- EscriptData = #escript_data{file = undefined, tree = Tree, item = EscriptItem},
+ EscriptData = #escript_data{file = undefined,
+ tree = Tree,
+ item = EscriptItem},
wxTreeCtrl:setItemData(Tree,EscriptItem, EscriptData),
[append_escript(Tree, EscriptItem, File) || File <- Sys#sys.escripts],
wxTreeCtrl:expand(Tree, LibItem),
@@ -529,9 +565,9 @@ create_config_page(#state{sys = Sys, book = Book} = S) ->
Panel = wxPanel:new(Book, []),
Sizer = wxBoxSizer:new(?wxHORIZONTAL),
AppConds = reltool_utils:incl_conds(),
- AppBox = wxRadioBox:new(Panel,
+ AppBox = wxRadioBox:new(Panel,
?wxID_ANY,
- "Application inclusion policy",
+ "Application inclusion policy",
?wxDefaultPosition,
?wxDefaultSize,
AppConds,
@@ -543,9 +579,9 @@ create_config_page(#state{sys = Sys, book = Book} = S) ->
wxEvtHandler:connect(AppBox, command_radiobox_selected,
[{userData, config_incl_cond}]),
ModConds = reltool_utils:mod_conds(),
- ModBox = wxRadioBox:new(Panel,
+ ModBox = wxRadioBox:new(Panel,
?wxID_ANY,
- "Module inclusion policy",
+ "Module inclusion policy",
?wxDefaultPosition,
?wxDefaultSize,
ModConds,
@@ -582,19 +618,19 @@ create_main_release_page(#state{book = Book} = S) ->
wxButton:setToolTip(Create, "Create a new release."),
wxButton:connect(Create, command_button_clicked, [{userData, create_rel}]),
wxSizer:add(ButtonSizer, Create),
-
+
Delete = wxButton:new(Panel, ?wxID_ANY, [{label, "Delete"}]),
wxButton:setToolTip(Delete, "Delete a release."),
wxButton:connect(Delete, command_button_clicked, [{userData, delete_rel}]),
wxSizer:add(ButtonSizer, Delete),
-
+
View = wxButton:new(Panel, ?wxID_ANY, [{label, "View script"}]),
wxButton:setToolTip(View, "View generated script file."),
wxButton:connect(View, command_button_clicked, [{userData, view_script}]),
wxSizer:add(ButtonSizer, View),
[add_release_page(RelBook, Rel) || Rel <- (S#state.sys)#sys.rels],
-
+
wxSizer:add(Sizer, RelBook, [{flag, ?wxEXPAND}, {proportion, 1}]),
wxSizer:add(Sizer, ButtonSizer, [{flag, ?wxEXPAND}]),
wxPanel:setSizer(Panel, Sizer),
@@ -604,16 +640,18 @@ create_main_release_page(#state{book = Book} = S) ->
add_release_page(Book, #rel{name = RelName, rel_apps = RelApps}) ->
Panel = wxPanel:new(Book, []),
Sizer = wxBoxSizer:new(?wxHORIZONTAL),
- RelBox = wxRadioBox:new(Panel,
+ RelBox = wxRadioBox:new(Panel,
?wxID_ANY,
- "Applications included in the release " ++ RelName,
+ "Applications included in the release " ++ RelName,
?wxDefaultPosition,
?wxDefaultSize,
[atom_to_list(RA#rel_app.name) || RA <- RelApps],
[]),
%% wxRadioBox:setSelection(RelBox, 2), % mandatory
- wxEvtHandler:connect(RelBox, command_radiobox_selected, [{userData, {config_rel_cond, RelName}}]),
- RelToolTip = "Choose which applications that shall be included in the release resource file.",
+ wxEvtHandler:connect(RelBox, command_radiobox_selected,
+ [{userData, {config_rel_cond, RelName}}]),
+ RelToolTip = "Choose which applications that shall "
+ "be included in the release resource file.",
wxBitmapButton:setToolTip(RelBox, RelToolTip),
wxSizer:add(Sizer,
@@ -629,11 +667,14 @@ do_open_app(S, AppBase) when is_list(AppBase) ->
do_open_app(S, AppName);
do_open_app(S, '') ->
S;
-do_open_app(#state{server_pid = ServerPid, common = C, app_wins = AppWins} = S, AppName) when is_atom(AppName) ->
+do_open_app(#state{server_pid = ServerPid, common = C, app_wins = AppWins} = S,
+ AppName)
+ when is_atom(AppName) ->
case lists:keysearch(AppName, #app_win.name, AppWins) of
false ->
WxEnv = wx:get_env(),
- {ok, Pid} = reltool_app_win:start_link(WxEnv, ServerPid, C, AppName),
+ {ok, Pid} =
+ reltool_app_win:start_link(WxEnv, ServerPid, C, AppName),
AW = #app_win{name = AppName, pid = Pid},
S#state{app_wins = [AW | AppWins]};
{value, AW} ->
@@ -651,7 +692,10 @@ root_popup(S, Root, Tree, Item) ->
wxEvtHandler:connect(PopupMenu, menu_close),
wxWindow:popupMenu(S#state.frame, PopupMenu),
- Popup = #root_popup{dir = Root, choices = Choices, tree = Tree, item = Item},
+ Popup = #root_popup{dir = Root,
+ choices = Choices,
+ tree = Tree,
+ item = Item},
S#state{popup_menu = Popup}.
lib_popup(S, Lib, Tree, Item) ->
@@ -693,7 +737,10 @@ escript_popup(S, File, Tree, Item) ->
wxEvtHandler:connect(PopupMenu, menu_close),
wxWindow:popupMenu(S#state.frame, PopupMenu),
- Popup = #escript_popup{file = File, choices = Choices, tree = Tree, item = Item},
+ Popup = #escript_popup{file = File,
+ choices = Choices,
+ tree = Tree,
+ item = Item},
S#state{popup_menu = Popup}.
@@ -705,29 +752,40 @@ handle_event(S, #wx{id = Id, obj= ObjRef, userData = UserData, event = Event} =
#wxSize{type = size, size = {W, _H}} when UserData =:= app_list_ctrl ->
wxListCtrl:setColumnWidth(ObjRef, ?APPS_APP_COL, W),
S;
- #wxCommand{type = command_menu_selected} when Id =:= ?APP_GRAPH_ITEM ->
+ #wxCommand{type = command_menu_selected}
+ when Id =:= ?APP_GRAPH_ITEM ->
update_app_graph(S);
- #wxCommand{type = command_menu_selected} when Id =:= ?MOD_GRAPH_ITEM ->
+ #wxCommand{type = command_menu_selected}
+ when Id =:= ?MOD_GRAPH_ITEM ->
update_mod_graph(S);
- #wxCommand{type = command_menu_selected} when Id =:= ?RESET_CONFIG_ITEM ->
+ #wxCommand{type = command_menu_selected}
+ when Id =:= ?RESET_CONFIG_ITEM ->
reset_config(S);
- #wxCommand{type = command_menu_selected} when Id =:= ?UNDO_CONFIG_ITEM ->
+ #wxCommand{type = command_menu_selected}
+ when Id =:= ?UNDO_CONFIG_ITEM ->
undo_config(S);
- #wxCommand{type = command_menu_selected} when Id =:= ?LOAD_CONFIG_ITEM ->
+ #wxCommand{type = command_menu_selected}
+ when Id =:= ?LOAD_CONFIG_ITEM ->
load_config(S);
- #wxCommand{type = command_menu_selected} when Id =:= ?SAVE_CONFIG_NODEF_NODER_ITEM ->
+ #wxCommand{type = command_menu_selected}
+ when Id =:= ?SAVE_CONFIG_NODEF_NODER_ITEM ->
save_config(S, false, false);
- #wxCommand{type = command_menu_selected} when Id =:= ?SAVE_CONFIG_NODEF_DER_ITEM ->
+ #wxCommand{type = command_menu_selected}
+ when Id =:= ?SAVE_CONFIG_NODEF_DER_ITEM ->
save_config(S, false, true);
#wxCommand{type = command_menu_selected} when Id =:= ?SAVE_CONFIG_DEF_NODER_ITEM ->
save_config(S, true, false);
- #wxCommand{type = command_menu_selected} when Id =:= ?SAVE_CONFIG_DEF_DER_ITEM ->
+ #wxCommand{type = command_menu_selected}
+ when Id =:= ?SAVE_CONFIG_DEF_DER_ITEM ->
save_config(S, true, true);
- #wxCommand{type = command_menu_selected} when Id =:= ?GEN_REL_FILES_ITEM ->
+ #wxCommand{type = command_menu_selected}
+ when Id =:= ?GEN_REL_FILES_ITEM ->
gen_rel_files(S);
- #wxCommand{type = command_menu_selected} when Id =:= ?GEN_TARGET_ITEM ->
+ #wxCommand{type = command_menu_selected}
+ when Id =:= ?GEN_TARGET_ITEM ->
gen_target(S);
- #wxCommand{type = command_menu_selected} when UserData =:= main_window, Id =:= ?CONTENTS_ITEM ->
+ #wxCommand{type = command_menu_selected}
+ when UserData =:= main_window, Id =:= ?CONTENTS_ITEM ->
{file, BeamFile} = code:is_loaded(?MODULE),
EbinDir = filename:dirname(BeamFile),
AppDir = filename:dirname(EbinDir),
@@ -735,16 +793,17 @@ handle_event(S, #wx{id = Id, obj= ObjRef, userData = UserData, event = Event} =
Url = "file://" ++ filename:absname(HelpFile),
wx_misc:launchDefaultBrowser(Url),
S;
- #wxCommand{type = command_menu_selected} when UserData =:= main_window, Id =:= ?ABOUT_ITEM ->
- AboutStr = "Reltool is a release management tool. It analyses a given"
- " Erlang/OTP installation and determines various dependencies"
- " between applications. The graphical frontend depicts the"
- " dependencies and enables interactive customization of a"
- " target system. The backend provides a batch interface"
- " for generation of customized target systems.",
- MD = wxMessageDialog:new(S#state.frame,
+ #wxCommand{type = command_menu_selected}
+ when UserData =:= main_window, Id =:= ?ABOUT_ITEM ->
+ AboutStr = "Reltool is a release management tool. It analyses a "
+ " given Erlang/OTP installation and determines various "
+ " dependencies between applications. The graphical frontend "
+ " depicts the dependencies and enables interactive "
+ " customization of a target system. The backend provides a "
+ " batch interface for generation of customized target systems.",
+ MD = wxMessageDialog:new(S#state.frame,
AboutStr,
- [{style, ?wxOK bor ?wxICON_INFORMATION},
+ [{style, ?wxOK bor ?wxICON_INFORMATION},
{caption, "About Reltool"}]),
wxMessageDialog:showModal(MD),
wxMessageDialog:destroy(MD),
@@ -758,7 +817,8 @@ handle_event(S, #wx{id = Id, obj= ObjRef, userData = UserData, event = Event} =
wxWindow:setFocus(ObjRef),
S;
_ ->
- case wxNotebook:getPageText(S#state.book, wxNotebook:getSelection(S#state.book)) of
+ case wxNotebook:getPageText(S#state.book,
+ wxNotebook:getSelection(S#state.book)) of
?APP_PAGE -> handle_app_event(S, Event, ObjRef, UserData);
?LIB_PAGE -> handle_source_event(S, Event, ObjRef, UserData);
?SYS_PAGE -> handle_system_event(S, Event, ObjRef, UserData);
@@ -768,13 +828,17 @@ handle_event(S, #wx{id = Id, obj= ObjRef, userData = UserData, event = Event} =
handle_popup_event(S, _Type, 0, _ObjRef, _UserData, _Str) ->
S#state{popup_menu = undefined};
-handle_popup_event(#state{popup_menu = #root_popup{dir = OldDir, choices = Choices},
+handle_popup_event(#state{popup_menu = #root_popup{dir = OldDir,
+ choices = Choices},
sys = Sys} = S,
_Type, Pos, _ObjRef, _UserData, _Str) ->
case lists:nth(Pos, Choices) of
edit ->
Style = ?wxFD_OPEN bor ?wxFD_FILE_MUST_EXIST,
- case select_dir(S#state.frame, "Change root directory", OldDir, Style) of
+ case select_dir(S#state.frame,
+ "Change root directory",
+ OldDir,
+ Style) of
{ok, NewDir} when NewDir =:= OldDir ->
%% Same dir.Ignore.
S#state{popup_menu = undefined};
@@ -785,7 +849,8 @@ handle_popup_event(#state{popup_menu = #root_popup{dir = OldDir, choices = Choic
S#state{popup_menu = undefined}
end
end;
-handle_popup_event(#state{popup_menu = #lib_popup{dir = OldDir, choices = Choices},
+handle_popup_event(#state{popup_menu = #lib_popup{dir = OldDir,
+ choices = Choices},
sys = Sys} = S,
_Type, Pos, _ObjRef, _UserData, _Str) ->
case lists:nth(Pos, Choices) of
@@ -801,14 +866,18 @@ handle_popup_event(#state{popup_menu = #lib_popup{dir = OldDir, choices = Choice
false ->
LibDirs = Sys#sys.lib_dirs ++ [NewDir],
Sys2 = Sys#sys{lib_dirs = LibDirs},
- do_set_sys(S#state{popup_menu = undefined, sys = Sys2})
+ do_set_sys(S#state{popup_menu = undefined,
+ sys = Sys2})
end;
cancel ->
S#state{popup_menu = undefined}
end;
edit ->
Style = ?wxFD_OPEN bor ?wxFD_FILE_MUST_EXIST,
- case select_dir(S#state.frame, "Change library directory", OldDir, Style) of
+ case select_dir(S#state.frame,
+ "Change library directory",
+ OldDir,
+ Style) of
{ok, NewDir} ->
case lists:member(NewDir, Sys#sys.lib_dirs) of
true ->
@@ -820,7 +889,8 @@ handle_popup_event(#state{popup_menu = #lib_popup{dir = OldDir, choices = Choice
lists:splitwith(Pred, Sys#sys.lib_dirs),
LibDirs2 = Before ++ [NewDir | After],
Sys2 = Sys#sys{lib_dirs = LibDirs2},
- do_set_sys(S#state{popup_menu = undefined, sys = Sys2})
+ do_set_sys(S#state{popup_menu = undefined,
+ sys = Sys2})
end;
cancel ->
S#state{popup_menu = undefined}
@@ -828,14 +898,15 @@ handle_popup_event(#state{popup_menu = #lib_popup{dir = OldDir, choices = Choice
delete ->
LibDirs = Sys#sys.lib_dirs -- [OldDir],
Sys2 = Sys#sys{lib_dirs = LibDirs},
- do_set_sys(S#state{popup_menu = undefined, sys = Sys2})
+ do_set_sys(S#state{popup_menu = undefined, sys = Sys2})
end;
-handle_popup_event(#state{popup_menu = #escript_popup{file = OldFile, choices = Choices},
+handle_popup_event(#state{popup_menu = #escript_popup{file = OldFile,
+ choices = Choices},
sys = Sys} = S,
_Type, Pos, _ObjRef, _UserData, _Str) ->
case lists:nth(Pos, Choices) of
add ->
- OldFile2 =
+ OldFile2 =
case OldFile of
undefined ->
{ok, Cwd} = file:get_cwd(),
@@ -844,7 +915,10 @@ handle_popup_event(#state{popup_menu = #escript_popup{file = OldFile, choices =
OldFile
end,
Style = ?wxFD_OPEN bor ?wxFD_FILE_MUST_EXIST,
- case select_file(S#state.frame, "Select an escript file to add", OldFile2, Style) of
+ case select_file(S#state.frame,
+ "Select an escript file to add",
+ OldFile2,
+ Style) of
{ok, NewFile} ->
case lists:member(NewFile, Sys#sys.escripts) of
true ->
@@ -860,7 +934,10 @@ handle_popup_event(#state{popup_menu = #escript_popup{file = OldFile, choices =
end;
edit ->
Style = ?wxFD_OPEN bor ?wxFD_FILE_MUST_EXIST,
- case select_file(S#state.frame, "Change escript file name", OldFile, Style) of
+ case select_file(S#state.frame,
+ "Change escript file name",
+ OldFile,
+ Style) of
{ok, NewFile} ->
case lists:member(NewFile, Sys#sys.escripts) of
true ->
@@ -868,10 +945,12 @@ handle_popup_event(#state{popup_menu = #escript_popup{file = OldFile, choices =
S#state{popup_menu = undefined};
false ->
Pred = fun(E) -> E =/= OldFile end,
- {Before, [_| After]} = lists:splitwith(Pred, Sys#sys.escripts),
+ {Before, [_| After]} =
+ lists:splitwith(Pred, Sys#sys.escripts),
Escripts2 = Before ++ [NewFile | After],
Sys2 = Sys#sys{escripts = Escripts2},
- do_set_sys(S#state{popup_menu = undefined, sys = Sys2})
+ do_set_sys(S#state{popup_menu = undefined,
+ sys = Sys2})
end;
cancel ->
S#state{popup_menu = undefined}
@@ -879,25 +958,28 @@ handle_popup_event(#state{popup_menu = #escript_popup{file = OldFile, choices =
delete ->
Escripts = Sys#sys.escripts -- [OldFile],
Sys2 = Sys#sys{escripts = Escripts},
- do_set_sys(S#state{popup_menu = undefined, sys = Sys2})
+ do_set_sys(S#state{popup_menu = undefined, sys = Sys2})
end.
handle_system_event(#state{sys = Sys} = S,
- #wxCommand{type = command_radiobox_selected, cmdString = Choice},
+ #wxCommand{type = command_radiobox_selected,
+ cmdString = Choice},
_ObjRef,
config_mod_cond) ->
ModCond = reltool_utils:list_to_mod_cond(Choice),
Sys2 = Sys#sys{mod_cond = ModCond},
do_set_sys(S#state{sys = Sys2});
handle_system_event(#state{sys = Sys} = S,
- #wxCommand{type = command_radiobox_selected, cmdString = Choice},
+ #wxCommand{type = command_radiobox_selected,
+ cmdString = Choice},
_ObjRef,
config_incl_cond) ->
AppCond = reltool_utils:list_to_incl_cond(Choice),
Sys2 = Sys#sys{incl_cond = AppCond},
do_set_sys(S#state{sys = Sys2});
handle_system_event(S, Event, ObjRef, UserData) ->
- error_logger:format("~p~p got unexpected wx sys event to ~p with user data: ~p\n\t ~p\n",
+ error_logger:format("~p~p got unexpected wx sys event to ~p "
+ "with user data: ~p\n\t ~p\n",
[?MODULE, self(), ObjRef, UserData, Event]),
S.
@@ -905,7 +987,11 @@ handle_release_event(S, _Event, _ObjRef, UserData) ->
io:format("Release data: ~p\n", [UserData]),
S.
-handle_source_event(S, #wxTree{type = command_tree_item_activated, item = Item}, ObjRef, _UserData) ->
+handle_source_event(S,
+ #wxTree{type = command_tree_item_activated,
+ item = Item},
+ ObjRef,
+ _UserData) ->
case wxTreeCtrl:getItemData(ObjRef, Item) of
#root_data{dir = _Dir} ->
%% io:format("Root dialog: ~p\n", [Dir]),
@@ -921,7 +1007,11 @@ handle_source_event(S, #wxTree{type = command_tree_item_activated, item = Item},
undefined ->
S
end;
-handle_source_event(S, #wxTree{type = command_tree_item_right_click, item = Item}, Tree, _UserData) ->
+handle_source_event(S,
+ #wxTree{type = command_tree_item_right_click,
+ item = Item},
+ Tree,
+ _UserData) ->
case wxTreeCtrl:getItemData(Tree, Item) of
#root_data{dir = Dir} ->
wx:batch(fun() -> root_popup(S, Dir, Tree, Item) end);
@@ -936,18 +1026,28 @@ handle_source_event(S, #wxTree{type = command_tree_item_right_click, item = Item
S
end.
-handle_app_event(S, #wxList{type = command_list_item_activated, itemIndex = Pos}, ListCtrl, _UserData) ->
+handle_app_event(S,
+ #wxList{type = command_list_item_activated,
+ itemIndex = Pos},
+ ListCtrl,
+ _UserData) ->
AppName = wxListCtrl:getItemText(ListCtrl, Pos),
do_open_app(S, AppName);
-handle_app_event(S, #wxCommand{type = command_button_clicked}, _ObjRef, {app_button, Action, ListCtrl}) ->
+handle_app_event(S,
+ #wxCommand{type = command_button_clicked},
+ _ObjRef,
+ {app_button, Action, ListCtrl}) ->
Items = reltool_utils:get_items(ListCtrl),
handle_app_button(S, Items, Action);
handle_app_event(S, Event, ObjRef, UserData) ->
- error_logger:format("~p~p got unexpected wx app event to ~p with user data: ~p\n\t ~p\n",
+ error_logger:format("~p~p got unexpected wx app event to "
+ "~p with user data: ~p\n\t ~p\n",
[?MODULE, self(), ObjRef, UserData, Event]),
S.
-handle_app_button(#state{server_pid = ServerPid, app_wins = AppWins} = S, Items, Action) ->
+handle_app_button(#state{server_pid = ServerPid, app_wins = AppWins} = S,
+ Items,
+ Action) ->
NewApps = [move_app(S, Item, Action) || Item <- Items],
case reltool_server:set_apps(ServerPid, NewApps) of
{ok, []} ->
@@ -967,9 +1067,9 @@ do_set_sys(#state{sys = Sys, server_pid = ServerPid, status_bar = Bar} = S) ->
check_and_refresh(S, Status).
move_app(S, {_ItemNo, AppBase}, Action) ->
- {AppName, _Vsn} = reltool_utils:split_app_name(AppBase),
+ {AppName, _Vsn} = reltool_utils:split_app_name(AppBase),
{ok, OldApp} = reltool_server:get_app(S#state.server_pid, AppName),
- AppCond =
+ AppCond =
case Action of
whitelist_add ->
case OldApp#app.incl_cond of
@@ -979,12 +1079,13 @@ move_app(S, {_ItemNo, AppBase}, Action) ->
end;
whitelist_del ->
undefined;
- blacklist_add ->
+ blacklist_add ->
exclude;
blacklist_del ->
undefined;
_ ->
- error_logger:format("~p~p got unexpected app button event: ~p ~p\n",
+ error_logger:format("~p~p got unexpected app "
+ "button event: ~p ~p\n",
[?MODULE, self(), Action, AppBase]),
OldApp#app.incl_cond
end,
@@ -1047,14 +1148,21 @@ do_redraw_apps(ListCtrl, Apps, OkImage, ErrImage) ->
ImageApps = lists:map(AddImage, Apps),
Show =
fun({ImageId, Text, App}, {Row, ModCount, Items}) ->
- wxListCtrl:insertItem(ListCtrl, Row, ""),
- if (Row rem 2) =:= 0 ->
- wxListCtrl:setItemBackgroundColour(ListCtrl, Row, {240,240,255});
+ wxListCtrl:insertItem(ListCtrl, Row, ""),
+ if (Row rem 2) =:= 0 ->
+ wxListCtrl:setItemBackgroundColour(ListCtrl,
+ Row,
+ {240,240,255});
true ->
ignore
end,
- wxListCtrl:setItem(ListCtrl, Row, ?APPS_APP_COL, Text, [{imageId, ImageId}]),
- N = length([M || M <- App#app.mods, M#mod.is_included =:= true]),
+ wxListCtrl:setItem(ListCtrl,
+ Row,
+ ?APPS_APP_COL,
+ Text,
+ [{imageId, ImageId}]),
+ N = length([M || M <- App#app.mods,
+ M#mod.is_included =:= true]),
{Row + 1, ModCount + N, [{Row, Text} | Items]}
end,
{_, N, NewItems} = wx:foldl(Show, {0, 0, []}, lists:sort(ImageApps)),
@@ -1068,8 +1176,10 @@ update_app_graph(S) ->
WhiteNames = [A#app.name || A <- WhiteApps],
DerivedNames = [A#app.name || A <- DerivedApps],
Nodes = WhiteNames ++ DerivedNames,
- %% WhiteUses = [N || A <- WhiteApps, N <- A#app.uses_apps, lists:member(N, Nodes)],
- %% DerivedUses = [N || A <- DerivedApps, N <- A#app.uses_apps, lists:member(N, Nodes)],
+ %% WhiteUses = [N || A <- WhiteApps,
+ %% N <- A#app.uses_apps, lists:member(N, Nodes)],
+ %% DerivedUses = [N || A <- DerivedApps,
+ %% N <- A#app.uses_apps, lists:member(N, Nodes)],
WhiteLinks = [[A#app.name, U] || A <- WhiteApps,
U <- A#app.uses_apps,
@@ -1078,7 +1188,7 @@ update_app_graph(S) ->
DerivedLinks = [[A#app.name, U] || A <- DerivedApps,
U <- A#app.uses_apps,
U =/= A#app.name,
- lists:member(U, Nodes)],
+ lists:member(U, Nodes)],
Links = lists:usort(WhiteLinks ++ DerivedLinks),
%% io:format("Links: ~p\n", [Links]),
Title = lists:concat([?APPLICATION, " - application graph"]),
@@ -1087,8 +1197,12 @@ update_app_graph(S) ->
update_mod_graph(S) ->
{ok, WhiteApps} = reltool_server:get_apps(S#state.server_pid, whitelist),
{ok, DerivedApps} = reltool_server:get_apps(S#state.server_pid, derived),
- WhiteMods = lists:usort([M || A <- WhiteApps, M <- A#app.mods, M#mod.is_included =:= true]),
- DerivedMods = lists:usort([M || A <- DerivedApps, M <- A#app.mods, M#mod.is_included =:= true]),
+ WhiteMods = lists:usort([M || A <- WhiteApps,
+ M <- A#app.mods,
+ M#mod.is_included =:= true]),
+ DerivedMods = lists:usort([M || A <- DerivedApps,
+ M <- A#app.mods,
+ M#mod.is_included =:= true]),
WhiteNames = [M#mod.name || M <- WhiteMods],
DerivedNames = [M#mod.name || M <- DerivedMods],
@@ -1141,7 +1255,10 @@ undo_config(#state{status_bar = Bar} = S) ->
load_config(#state{status_bar = Bar, config_file = OldFile} = S) ->
Style = ?wxFD_OPEN bor ?wxFD_FILE_MUST_EXIST,
- case select_file(S#state.frame, "Select a file to load the configuration from", OldFile, Style) of
+ case select_file(S#state.frame,
+ "Select a file to load the configuration from",
+ OldFile,
+ Style) of
{ok, NewFile} ->
wxStatusBar:setStatusText(Bar, "Processing libraries..."),
Status = reltool_server:load_config(S#state.server_pid, NewFile),
@@ -1151,18 +1268,27 @@ load_config(#state{status_bar = Bar, config_file = OldFile} = S) ->
end.
save_config(#state{config_file = OldFile} = S, InclDefaults, InclDerivates) ->
- Style = ?wxFD_SAVE bor ?wxFD_OVERWRITE_PROMPT,
- case select_file(S#state.frame, "Select a file to save the configuration to", OldFile, Style) of
+ Style = ?wxFD_SAVE bor ?wxFD_OVERWRITE_PROMPT,
+ case select_file(S#state.frame,
+ "Select a file to save the configuration to",
+ OldFile,
+ Style) of
{ok, NewFile} ->
- Status = reltool_server:save_config(S#state.server_pid, NewFile, InclDefaults, InclDerivates),
+ Status = reltool_server:save_config(S#state.server_pid,
+ NewFile,
+ InclDefaults,
+ InclDerivates),
check_and_refresh(S#state{config_file = NewFile}, Status);
cancel ->
S
end.
gen_rel_files(#state{target_dir = OldDir} = S) ->
- Style = ?wxFD_SAVE bor ?wxFD_OVERWRITE_PROMPT,
- case select_dir(S#state.frame, "Select a directory to generate rel, script and boot files to", OldDir, Style) of
+ Style = ?wxFD_SAVE bor ?wxFD_OVERWRITE_PROMPT,
+ case select_dir(S#state.frame,
+ "Select a directory to generate rel, script and boot files to",
+ OldDir,
+ Style) of
{ok, NewDir} ->
Status = reltool_server:gen_rel_files(S#state.server_pid, NewDir),
check_and_refresh(S, Status);
@@ -1171,8 +1297,11 @@ gen_rel_files(#state{target_dir = OldDir} = S) ->
end.
gen_target(#state{target_dir = OldDir} = S) ->
- Style = ?wxFD_SAVE bor ?wxFD_OVERWRITE_PROMPT,
- case select_dir(S#state.frame, "Select a directory to generate a target system to", OldDir, Style) of
+ Style = ?wxFD_SAVE bor ?wxFD_OVERWRITE_PROMPT,
+ case select_dir(S#state.frame,
+ "Select a directory to generate a target system to",
+ OldDir,
+ Style) of
{ok, NewDir} ->
Status = reltool_server:gen_target(S#state.server_pid, NewDir),
check_and_refresh(S#state{target_dir = NewDir}, Status);
@@ -1186,7 +1315,7 @@ select_file(Frame, Message, DefaultFile, Style) ->
{defaultDir, filename:dirname(DefaultFile)},
{defaultFile, filename:basename(DefaultFile)},
{style, Style}]),
- Choice =
+ Choice =
case wxMessageDialog:showModal(Dialog) of
?wxID_CANCEL -> cancel;
?wxID_OK -> {ok, wxFileDialog:getPath(Dialog)}
@@ -1199,7 +1328,7 @@ select_dir(Frame, Message, DefaultDir, Style) ->
[{title, Message},
{defaultPath, DefaultDir},
{style, Style}]),
- Choice =
+ Choice =
case wxMessageDialog:showModal(Dialog) of
?wxID_CANCEL -> cancel;
?wxID_OK -> {ok, wxDirDialog:getPath(Dialog)}
@@ -1229,28 +1358,34 @@ refresh(S) ->
S2 = S#state{sys = Sys},
S3 = redraw_libs(S2),
redraw_apps(S3).
-
+
question_dialog(Question, Details) ->
%% Parent = S#state.frame,
Parent = wx:typeCast(wx:null(), wxWindow),
%% [{style, ?wxYES_NO bor ?wxICON_ERROR bor ?wx}]),
DialogStyle = ?wxRESIZE_BORDER bor ?wxCAPTION bor ?wxSYSTEM_MENU bor
?wxMINIMIZE_BOX bor ?wxMAXIMIZE_BOX bor ?wxCLOSE_BOX,
- Dialog = wxDialog:new(Parent, ?wxID_ANY, "Undo dialog", [{style, DialogStyle}]),
+ Dialog = wxDialog:new(Parent, ?wxID_ANY, "Undo dialog",
+ [{style, DialogStyle}]),
Color = wxWindow:getBackgroundColour(Dialog),
TextStyle = ?wxTE_READONLY bor ?wxTE_MULTILINE bor ?wxHSCROLL,
- Text1 = wxTextCtrl:new(Dialog, ?wxID_ANY, [{style, ?wxTE_READONLY bor ?wxBORDER_NONE}]),
+ Text1 = wxTextCtrl:new(Dialog, ?wxID_ANY,
+ [{style, ?wxTE_READONLY bor ?wxBORDER_NONE}]),
wxWindow:setBackgroundColour(Text1, Color),
wxTextCtrl:appendText(Text1, Question),
- Text2 = wxTextCtrl:new(Dialog, ?wxID_ANY, [{size, {600, 400}}, {style, TextStyle}]),
+ Text2 = wxTextCtrl:new(Dialog, ?wxID_ANY,
+ [{size, {600, 400}}, {style, TextStyle}]),
wxWindow:setBackgroundColour(Text2, Color),
wxTextCtrl:appendText(Text2, Details),
%% wxDialog:setAffirmativeId(Dialog, ?wxID_YES),
%% wxDialog:setEscapeId(Dialog, ?wxID_NO),
Sizer = wxBoxSizer:new(?wxVERTICAL),
wxSizer:add(Sizer, Text1, [{border, 2}, {flag, ?wxEXPAND}]),
- wxSizer:add(Sizer, Text2, [{border, 2}, {flag, ?wxEXPAND}, {proportion, 1}]),
- ButtSizer = wxDialog:createStdDialogButtonSizer(Dialog, ?wxOK bor ?wxCANCEL),
+ wxSizer:add(Sizer, Text2, [{border, 2},
+ {flag, ?wxEXPAND},
+ {proportion, 1}]),
+ ButtSizer = wxDialog:createStdDialogButtonSizer(Dialog,
+ ?wxOK bor ?wxCANCEL),
wxSizer:add(Sizer, ButtSizer, [{border, 2}, {flag, ?wxEXPAND}]),
wxPanel:setSizer(Dialog, Sizer),
wxSizer:fit(Sizer, Dialog),
diff --git a/lib/reltool/src/reltool_target.erl b/lib/reltool/src/reltool_target.erl
index 6d85a98d9f..e079a02f3c 100644
--- a/lib/reltool/src/reltool_target.erl
+++ b/lib/reltool/src/reltool_target.erl
@@ -22,7 +22,7 @@
-export([
gen_config/2,
gen_app/1,
- gen_rel/2,
+ gen_rel/2,
gen_rel_files/2,
gen_boot/1,
gen_script/4,
@@ -55,7 +55,9 @@ kernel_processes(KernelApp) ->
[
{kernelProcess, heart, {heart, start, []}},
{kernelProcess, error_logger , {error_logger, start_link, []}},
- {kernelProcess, application_controller, {application_controller, start, [KernelApp]}}
+ {kernelProcess,
+ application_controller,
+ {application_controller, start, [KernelApp]}}
].
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -82,120 +84,126 @@ gen_config(#sys{root_dir = RootDir,
app_type = AppType,
app_file = AppFile,
debug_info = DebugInfo},
- InclDefaults) ->
- ErtsItems =
+ InclDefs) ->
+ ErtsItems =
case lists:keysearch(erts, #app.name, Apps) of
{value, Erts} ->
- [{erts, gen_config(Erts, InclDefaults)}];
+ [{erts, gen_config(Erts, InclDefs)}];
false ->
[]
end,
AppsItems =
- [{app, A#app.name, gen_config(A, InclDefaults)}
- || A <- Apps,
+ [{app, A#app.name, gen_config(A, InclDefs)}
+ || A <- Apps,
A#app.name =/= ?MISSING_APP,
A#app.name =/= erts,
A#app.is_included =:= true,
A#app.is_escript =/= true],
- EscriptItems = [{escript, A#app.active_dir, emit(incl_cond, A#app.incl_cond, undefined, InclDefaults)}
+ EscriptItems = [{escript,
+ A#app.active_dir,
+ emit(incl_cond, A#app.incl_cond, undefined, InclDefs)}
|| A <- Apps, A#app.is_escript],
DefaultRels = reltool_utils:default_rels(),
RelsItems =
- case {[{rel, R#rel.name, R#rel.vsn, gen_config(R, InclDefaults)} || R <- Rels],
- [{rel, R#rel.name, R#rel.vsn, gen_config(R, InclDefaults)} || R <- DefaultRels]} of
+ case {[{rel, R#rel.name, R#rel.vsn, gen_config(R, InclDefs)} ||
+ R <- Rels],
+ [{rel, R#rel.name, R#rel.vsn, gen_config(R, InclDefs)} ||
+ R <- DefaultRels]} of
{RI, RI} -> [];
{RI, _} -> RI
end,
X = fun(List) -> [Re || #regexp{source = Re} <- List] end,
{sys,
- emit(root_dir, RootDir, code:root_dir(), InclDefaults) ++
- emit(lib_dirs, LibDirs, ?DEFAULT_LIBS, InclDefaults) ++
+ emit(root_dir, RootDir, code:root_dir(), InclDefs) ++
+ emit(lib_dirs, LibDirs, ?DEFAULT_LIBS, InclDefs) ++
EscriptItems ++
- emit(mod_cond, ModCond, ?DEFAULT_MOD_COND, InclDefaults) ++
- emit(incl_cond, AppCond, ?DEFAULT_INCL_COND, InclDefaults) ++
+ emit(mod_cond, ModCond, ?DEFAULT_MOD_COND, InclDefs) ++
+ emit(incl_cond, AppCond, ?DEFAULT_INCL_COND, InclDefs) ++
ErtsItems ++
AppsItems ++
- emit(boot_rel, BootRel, ?DEFAULT_REL_NAME, InclDefaults) ++
+ emit(boot_rel, BootRel, ?DEFAULT_REL_NAME, InclDefs) ++
RelsItems ++
- emit(emu_name, EmuName, ?DEFAULT_EMU_NAME, InclDefaults) ++
- emit(relocatable, Relocatable, ?DEFAULT_RELOCATABLE, InclDefaults) ++
- emit(profile, Profile, ?DEFAULT_PROFILE, InclDefaults) ++
- emit(incl_sys_filters, X(InclSysFiles), ?DEFAULT_INCL_SYS_FILTERS, InclDefaults) ++
- emit(excl_sys_filters, X(ExclSysFiles), ?DEFAULT_EXCL_SYS_FILTERS, InclDefaults) ++
- emit(incl_app_filters, X(InclAppFiles), ?DEFAULT_INCL_APP_FILTERS, InclDefaults) ++
- emit(excl_app_filters, X(ExclAppFiles), ?DEFAULT_EXCL_APP_FILTERS, InclDefaults) ++
- emit(incl_archive_filters, X(InclArchiveDirs), ?DEFAULT_INCL_ARCHIVE_FILTERS, InclDefaults) ++
- emit(excl_archive_filters, X(ExclArchiveDirs), ?DEFAULT_EXCL_ARCHIVE_FILTERS, InclDefaults) ++
- emit(archive_opts, ArchiveOpts, ?DEFAULT_ARCHIVE_OPTS, InclDefaults) ++
- emit(app_type, AppType, ?DEFAULT_APP_TYPE, InclDefaults) ++
- emit(app_file, AppFile, ?DEFAULT_APP_FILE, InclDefaults) ++
- emit(debug_info, DebugInfo, ?DEFAULT_DEBUG_INFO, InclDefaults)};
-gen_config(#app{name = _Name,
- mod_cond = ModCond,
- incl_cond = AppCond,
- debug_info = DebugInfo,
- app_file = AppFile,
- incl_app_filters = InclAppFiles,
- excl_app_filters = ExclAppFiles,
+ emit(emu_name, EmuName, ?DEFAULT_EMU_NAME, InclDefs) ++
+ emit(relocatable, Relocatable, ?DEFAULT_RELOCATABLE, InclDefs) ++
+ emit(profile, Profile, ?DEFAULT_PROFILE, InclDefs) ++
+ emit(incl_sys_filters, X(InclSysFiles), ?DEFAULT_INCL_SYS_FILTERS, InclDefs) ++
+ emit(excl_sys_filters, X(ExclSysFiles), ?DEFAULT_EXCL_SYS_FILTERS, InclDefs) ++
+ emit(incl_app_filters, X(InclAppFiles), ?DEFAULT_INCL_APP_FILTERS, InclDefs) ++
+ emit(excl_app_filters, X(ExclAppFiles), ?DEFAULT_EXCL_APP_FILTERS, InclDefs) ++
+ emit(incl_archive_filters, X(InclArchiveDirs), ?DEFAULT_INCL_ARCHIVE_FILTERS, InclDefs) ++
+ emit(excl_archive_filters, X(ExclArchiveDirs), ?DEFAULT_EXCL_ARCHIVE_FILTERS, InclDefs) ++
+ emit(archive_opts, ArchiveOpts, ?DEFAULT_ARCHIVE_OPTS, InclDefs) ++
+ emit(app_type, AppType, ?DEFAULT_APP_TYPE, InclDefs) ++
+ emit(app_file, AppFile, ?DEFAULT_APP_FILE, InclDefs) ++
+ emit(debug_info, DebugInfo, ?DEFAULT_DEBUG_INFO, InclDefs)};
+gen_config(#app{name = _Name,
+ mod_cond = ModCond,
+ incl_cond = AppCond,
+ debug_info = DebugInfo,
+ app_file = AppFile,
+ incl_app_filters = InclAppFiles,
+ excl_app_filters = ExclAppFiles,
incl_archive_filters = InclArchiveDirs,
excl_archive_filters = ExclArchiveDirs,
- archive_opts = ArchiveOpts,
+ archive_opts = ArchiveOpts,
use_selected_vsn = UseSelected,
vsn = Vsn,
mods = Mods},
- InclDefaults) ->
- emit(mod_cond, ModCond, undefined, InclDefaults) ++
- emit(incl_cond, AppCond, undefined, InclDefaults) ++
- emit(debug_info, DebugInfo, undefined, InclDefaults) ++
- emit(app_file, AppFile, undefined, InclDefaults) ++
- emit(incl_app_filters, InclAppFiles, undefined, InclDefaults) ++
- emit(excl_app_filters, ExclAppFiles, undefined, InclDefaults) ++
- emit(incl_archive_filters, InclArchiveDirs, undefined, InclDefaults) ++
- emit(excl_archive_filters, ExclArchiveDirs, undefined, InclDefaults) ++
- emit(archive_opts, ArchiveOpts, undefined, InclDefaults) ++
- emit(vsn, Vsn, undefined, InclDefaults orelse UseSelected =/= true) ++
- [{mod, M#mod.name, gen_config(M, InclDefaults)} || M <- Mods, M#mod.is_included =:= true];
+ InclDefs) ->
+ emit(mod_cond, ModCond, undefined, InclDefs) ++
+ emit(incl_cond, AppCond, undefined, InclDefs) ++
+ emit(debug_info, DebugInfo, undefined, InclDefs) ++
+ emit(app_file, AppFile, undefined, InclDefs) ++
+ emit(incl_app_filters, InclAppFiles, undefined, InclDefs) ++
+ emit(excl_app_filters, ExclAppFiles, undefined, InclDefs) ++
+ emit(incl_archive_filters, InclArchiveDirs, undefined, InclDefs) ++
+ emit(excl_archive_filters, ExclArchiveDirs, undefined, InclDefs) ++
+ emit(archive_opts, ArchiveOpts, undefined, InclDefs) ++
+ emit(vsn, Vsn, undefined, InclDefs orelse UseSelected =/= true) ++
+ [{mod, M#mod.name, gen_config(M, InclDefs)} ||
+ M <- Mods,
+ M#mod.is_included =:= true];
gen_config(#mod{name = _Name,
incl_cond = AppCond,
debug_info = DebugInfo},
- InclDefaults) ->
- emit(incl_cond, AppCond, undefined, InclDefaults) ++
- emit(debug_info, DebugInfo, undefined, InclDefaults);
+ InclDefs) ->
+ emit(incl_cond, AppCond, undefined, InclDefs) ++
+ emit(debug_info, DebugInfo, undefined, InclDefs);
gen_config(#rel{name = _Name,
vsn = _Vsn,
rel_apps = RelApps},
- InclDefaults) ->
- [gen_config(RA, InclDefaults) || RA <- RelApps];
+ InclDefs) ->
+ [gen_config(RA, InclDefs) || RA <- RelApps];
gen_config(#rel_app{name = Name,
app_type = Type,
incl_apps = InclApps},
- _InclDefaults) ->
+ _InclDefs) ->
case {Type, InclApps} of
{undefined, []} -> Name;
{undefined, _} -> {Name, InclApps};
{_, []} -> {Name, Type};
{_, _} -> {Name, Type, InclApps}
end;
-gen_config({Tag, Val}, InclDefaults) ->
- emit(Tag, Val, undefined, InclDefaults);
-gen_config([], _InclDefaults) ->
+gen_config({Tag, Val}, InclDefs) ->
+ emit(Tag, Val, undefined, InclDefs);
+gen_config([], _InclDefs) ->
[];
-gen_config([H | T], InclDefaults) ->
- lists:flatten([gen_config(H, InclDefaults), gen_config(T, InclDefaults)]).
+gen_config([H | T], InclDefs) ->
+ lists:flatten([gen_config(H, InclDefs), gen_config(T, InclDefs)]).
-emit(Tag, Val, Default, InclDefaults) ->
+emit(Tag, Val, Default, InclDefs) ->
if
Val == undefined -> [];
- InclDefaults -> [{Tag, Val}];
+ InclDefs -> [{Tag, Val}];
Val =/= Default -> [{Tag, Val}];
true -> []
- end.
+ end.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Generate the contents of an app file
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-gen_app(#app{name = Name,
+gen_app(#app{name = Name,
info = #app_info{description = Desc,
id = Id,
vsn = Vsn,
@@ -234,19 +242,20 @@ gen_app(#app{name = Name,
gen_rel(#rel{name = RelName, vsn = RelVsn, rel_apps = RelApps},
#sys{apps = Apps}) ->
{value, Erts} = lists:keysearch(erts, #app.name, Apps),
- {release,
+ {release,
{RelName, RelVsn},
{erts, Erts#app.vsn},
[app_to_rel(RA, Apps ) || RA <- RelApps]}.
-app_to_rel(#rel_app{name = Name, app_type = Type, incl_apps = InclApps}, Apps) ->
+app_to_rel(#rel_app{name = Name, app_type = Type, incl_apps = InclApps},
+ Apps) ->
{value, #app{vsn = Vsn}} = lists:keysearch(Name, #app.name, Apps),
case {Type, InclApps} of
{undefined, []} -> {Name, Vsn};
{undefined, _} -> {Name, Vsn, InclApps};
{_, []} -> {Name, Vsn, Type};
{_, _} -> {Name, Vsn, Type, InclApps}
- end.
+ end.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Generate the contents of a boot file
@@ -262,7 +271,7 @@ gen_boot({script, {_, _}, _} = Script) ->
gen_script(Rel, Sys, PathFlag, Variables) ->
try
do_gen_script(Rel, Sys, PathFlag, Variables)
- catch
+ catch
throw:{error, Text} ->
{error, Text}
end.
@@ -279,7 +288,9 @@ do_gen_script(#rel{name = RelName, vsn = RelVsn, rel_apps = RelApps},
SortedApps = sort_apps(MergedApps),
{value, KernelApp} = lists:keysearch(kernel, #app.name, SortedApps),
- InclApps = lists:append([I || #app{info = #app_info{incl_apps = I}} <- SortedApps]),
+ InclApps =
+ lists:append([I ||
+ #app{info = #app_info{incl_apps = I}} <- SortedApps]),
%% Create the script
DeepList =
@@ -312,9 +323,9 @@ do_gen_script(#rel{name = RelName, vsn = RelVsn, rel_apps = RelApps},
%% Start applications
[{apply, {application, start_boot, [Name, Type]}} ||
- #app{name = Name, app_type = Type} <- SortedApps,
- Type =/= none,
- Type =/= load,
+ #app{name = Name, app_type = Type} <- SortedApps,
+ Type =/= none,
+ Type =/= load,
not lists:member(Name, InclApps)],
%% Apply user specific customizations
@@ -323,7 +334,9 @@ do_gen_script(#rel{name = RelName, vsn = RelVsn, rel_apps = RelApps},
],
{ok, {script, {RelName, RelVsn}, lists:flatten(DeepList)}}.
-merge_app(#rel_app{name = Name, app_type = Type, incl_apps = RelIncl}, Apps, DefaultType) ->
+merge_app(#rel_app{name = Name, app_type = Type, incl_apps = RelIncl},
+ Apps,
+ DefaultType) ->
{value, App} = lists:keysearch(Name, #app.name, Apps),
Type2 =
case {Type, App#app.app_type} of
@@ -334,10 +347,12 @@ merge_app(#rel_app{name = Name, app_type = Type, incl_apps = RelIncl}, Apps, Def
Info = App#app.info,
case RelIncl -- Info#app_info.incl_apps of
[] ->
- App#app{app_type = Type2, info = Info#app_info{incl_apps = RelIncl}};
+ App#app{app_type = Type2,
+ info = Info#app_info{incl_apps = RelIncl}};
BadIncl ->
- reltool_utils:throw_error("~p: These applications are missing as "
- "included_applications in the app file: ~p\n",
+ reltool_utils:throw_error("~p: These applications are "
+ "missing as included_applications "
+ "in the app file: ~p\n",
[Name, BadIncl])
end.
@@ -359,7 +374,7 @@ load_app_mods(#app{mods = Mods} = App, Mand, PathFlag, Variables) ->
Subs ->
[{Subs, [M]}|[{Last,Acc}|Rest]]
end
- end,
+ end,
[{[],
[]}],
PartNames),
@@ -381,17 +396,26 @@ load_app_mods(#app{mods = Mods} = App, Mand, PathFlag, Variables) ->
%% Mod. by mbj
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-sort_apps(Apps) ->
+sort_apps(Apps) ->
sort_apps(Apps, [], [], []).
-sort_apps([#app{name = Name, info = Info} = App | Apps], Missing, Circular, Visited) ->
- {Uses, Apps1, NotFnd1} = find_all(Name, Info#app_info.applications, Apps, Visited, [], []),
- {Incs, Apps2, NotFnd2} = find_all(Name, lists:reverse(Info#app_info.incl_apps),
- Apps1, Visited, [], []),
-
+sort_apps([#app{name = Name, info = Info} = App | Apps],
+ Missing,
+ Circular,
+ Visited) ->
+ {Uses, Apps1, NotFnd1} =
+ find_all(Name, Info#app_info.applications, Apps, Visited, [], []),
+ {Incs, Apps2, NotFnd2} =
+ find_all(Name,
+ lists:reverse(Info#app_info.incl_apps),
+ Apps1,
+ Visited,
+ [],
+ []),
+
Missing1 = NotFnd1 ++ NotFnd2 ++ Missing,
case Uses ++ Incs of
- [] ->
+ [] ->
%% No more app that must be started before this one is
%% found; they are all already taken care of (and present
%% in Visited list)
@@ -401,8 +425,8 @@ sort_apps([#app{name = Name, info = Info} = App | Apps], Missing, Circular, Visi
%% Check if we have already taken care of some app in L,
%% in that case we have a circular dependency.
NewCircular = [N1 || N1 <- L, N2 <- Visited, N1 =:= N2],
- Circular1 = case NewCircular of
- [] -> Circular;
+ Circular1 = case NewCircular of
+ [] -> Circular;
_ -> [Name | NewCircular] ++ Circular
end,
%% L must be started before N, try again, with all apps
@@ -414,9 +438,11 @@ sort_apps([], [], [], _) ->
[];
sort_apps([], Missing, [], _) ->
%% this has already been checked before, but as we have the info...
- reltool_utils:throw_error("Undefined applications: ~p\n", [make_set(Missing)]);
+ reltool_utils:throw_error("Undefined applications: ~p\n",
+ [make_set(Missing)]);
sort_apps([], [], Circular, _) ->
- reltool_utils:throw_error("Circular dependencies: ~p\n", [make_set(Circular)]);
+ reltool_utils:throw_error("Circular dependencies: ~p\n",
+ [make_set(Circular)]);
sort_apps([], Missing, Circular, _) ->
reltool_utils:throw_error("Circular dependencies: ~p\n"
"Undefined applications: ~p\n",
@@ -431,24 +457,49 @@ find_all(CheckingApp, [Name | Names], Apps, Visited, Found, NotFound) ->
true ->
case lists:member(Name, Visited) of
true ->
- find_all(CheckingApp, Names, Apps, Visited, Found, NotFound);
+ find_all(CheckingApp,
+ Names,
+ Apps,
+ Visited,
+ Found,
+ NotFound);
false ->
- find_all(CheckingApp, Names, Apps, Visited, Found, [Name | NotFound])
+ find_all(CheckingApp,
+ Names,
+ Apps,
+ Visited,
+ Found,
+ [Name | NotFound])
end;
false ->
- find_all(CheckingApp, Names, Apps -- [App], Visited, [App|Found], NotFound)
+ find_all(CheckingApp,
+ Names,
+ Apps -- [App],
+ Visited,
+ [App|Found],
+ NotFound)
end;
false ->
case lists:member(Name, Visited) of
true ->
- find_all(CheckingApp, Names, Apps, Visited, Found, NotFound);
+ find_all(CheckingApp,
+ Names,
+ Apps,
+ Visited,
+ Found,
+ NotFound);
false ->
- find_all(CheckingApp, Names, Apps, Visited, Found, [Name|NotFound])
+ find_all(CheckingApp,
+ Names,
+ Apps,
+ Visited,
+ Found,
+ [Name|NotFound])
end
end;
find_all(_CheckingApp, [], Apps, _Visited, Found, NotFound) ->
{Found, Apps, NotFound}.
-
+
del_apps([Name | Names], Apps) ->
del_apps(Names, lists:keydelete(Name, #app.name, Apps));
del_apps([], Apps) ->
@@ -470,7 +521,9 @@ create_path(Apps, PathFlag, Variables) ->
%% (The otp_build flag is only used for OTP internal system make)
cr_path(#app{label = Label}, true, []) ->
filename:join(["$ROOT", "lib", Label, "ebin"]);
-cr_path(#app{name = Name, vsn = Vsn, label = Label, active_dir = Dir}, true, Variables) ->
+cr_path(#app{name = Name, vsn = Vsn, label = Label, active_dir = Dir},
+ true,
+ Variables) ->
Tail = [Label, "ebin"],
case variable_dir(Dir, atom_to_list(Name), Vsn, Variables) of
{ok, VarDir} ->
@@ -542,7 +595,7 @@ gen_rel_files(Sys, TargetDir) ->
try
Spec = spec_rel_files(Sys),
eval_spec(Spec, Sys#sys.root_dir, TargetDir)
- catch
+ catch
throw:{error, Text} ->
{error, Text}
end.
@@ -579,15 +632,15 @@ gen_target(Sys, TargetDir) ->
try
Spec = do_gen_spec(Sys),
eval_spec(Spec, Sys#sys.root_dir, TargetDir)
- catch
+ catch
throw:{error, Text} ->
{error, Text}
end.
-
+
gen_spec(Sys) ->
try
{ok, do_gen_spec(Sys)}
- catch
+ catch
throw:{error, Text} ->
{error, Text}
end.
@@ -598,14 +651,16 @@ do_gen_spec(#sys{root_dir = RootDir,
relocatable = Relocatable,
apps = Apps} = Sys) ->
{create_dir, _, SysFiles} = spec_dir(RootDir),
- {ExclRegexps2, SysFiles2} = strip_sys_files(Relocatable, SysFiles, Apps, ExclRegexps),
+ {ExclRegexps2, SysFiles2} =
+ strip_sys_files(Relocatable, SysFiles, Apps, ExclRegexps),
RelFiles = spec_rel_files(Sys),
- {InclRegexps2, BinFiles} = spec_bin_files(Sys, SysFiles, SysFiles2, RelFiles, InclRegexps),
+ {InclRegexps2, BinFiles} =
+ spec_bin_files(Sys, SysFiles, SysFiles2, RelFiles, InclRegexps),
LibFiles = spec_lib_files(Sys),
{BootVsn, StartFile} = spec_start_file(Sys),
SysFiles3 =
[
- {create_dir, "releases",
+ {create_dir, "releases",
[StartFile,
{create_dir,BootVsn, RelFiles}]},
{create_dir, "bin", BinFiles}
@@ -621,14 +676,15 @@ strip_sys_files(Relocatable, SysFiles, Apps, ExclRegexps) ->
ExclRegexps2 =
case Relocatable of
true ->
- ExtraExcl = ["^erts.*/bin/.*src$"],
- reltool_utils:decode_regexps(excl_sys_filters, {add, ExtraExcl}, ExclRegexps);
+ ExtraExcl = ["^erts.*/bin/.*src\$"],
+ reltool_utils:decode_regexps(excl_sys_filters,
+ {add, ExtraExcl}, ExclRegexps);
false ->
ExclRegexps
end,
{value, Erts} = lists:keysearch(erts, #app.name, Apps),
FilterErts =
- fun(Spec) ->
+ fun(Spec) ->
File = element(2, Spec),
case lists:prefix("erts", File) of
true ->
@@ -636,7 +692,7 @@ strip_sys_files(Relocatable, SysFiles, Apps, ExclRegexps) ->
File =:= Erts#app.label ->
replace_dyn_erl(Relocatable, Spec);
true ->
- false
+ false
end;
false ->
true
@@ -660,7 +716,11 @@ replace_dyn_erl(true, {create_dir, ErtsDir, ErtsFiles}) ->
[{copy_file, ErlIni}] ->
%% Remove Windows .ini file
BinFiles2 = lists:keydelete(ErlIni, 2, BinFiles),
- ErtsFiles2 = lists:keyreplace("bin", 2, ErtsFiles, {create_dir, "bin", BinFiles2}),
+ ErtsFiles2 =
+ lists:keyreplace("bin",
+ 2,
+ ErtsFiles,
+ {create_dir, "bin", BinFiles2}),
{true, {create_dir, ErtsDir, ErtsFiles2}}
end;
[{copy_file, DynErlExe}] ->
@@ -668,33 +728,42 @@ replace_dyn_erl(true, {create_dir, ErtsDir, ErtsFiles}) ->
ErlExe = "erl" ++ filename:extension(DynErlExe),
BinFiles2 = lists:keydelete(DynErlExe, 2, BinFiles),
DynErlExe2 = filename:join([ErtsDir, "bin", DynErlExe]),
- BinFiles3 = lists:keyreplace(ErlExe, 2, BinFiles2, {copy_file, ErlExe, DynErlExe2}),
- ErtsFiles2 = lists:keyreplace("bin", 2, ErtsFiles, {create_dir, "bin", BinFiles3}),
+ BinFiles3 = lists:keyreplace(ErlExe,
+ 2,
+ BinFiles2,
+ {copy_file, ErlExe, DynErlExe2}),
+ ErtsFiles2 = lists:keyreplace("bin",
+ 2,
+ ErtsFiles,
+ {create_dir, "bin", BinFiles3}),
{true, {create_dir, ErtsDir, ErtsFiles2}}
end.
spec_bin_files(Sys, AllSysFiles, StrippedSysFiles, RelFiles, InclRegexps) ->
- [{create_dir, ErtsLabel, ErtsFiles}] = safe_lookup_spec("erts", StrippedSysFiles),
+ [{create_dir, ErtsLabel, ErtsFiles}] =
+ safe_lookup_spec("erts", StrippedSysFiles),
[{create_dir, _, BinFiles}] = safe_lookup_spec("bin", ErtsFiles),
ErtsBin = filename:join([ErtsLabel, "bin"]),
Escripts = spec_escripts(Sys, ErtsBin, BinFiles),
Map = fun({copy_file, File}) ->
{copy_file, File, filename:join([ErtsBin, File])};
({copy_file, NewFile, OldFile}) ->
- {_, OldFile2} = abs_to_rel_path(ErtsBin, filename:join([ErtsBin, OldFile])),
+ {_, OldFile2} =
+ abs_to_rel_path(ErtsBin,
+ filename:join([ErtsBin, OldFile])),
{copy_file, NewFile, OldFile2}
end,
%% Do only copy those bin files from erts/bin that also exists in bin
[{create_dir, _, OldBinFiles}] = safe_lookup_spec("bin", AllSysFiles),
GoodNames = [F || {copy_file, F} <- OldBinFiles,
- not lists:suffix(".boot", F),
+ not lists:suffix(".boot", F),
not lists:suffix(".script", F)],
BinFiles2 = [Map(S) || S <- BinFiles, lists:member(element(2, S), GoodNames)],
BootFiles = [F || F <- RelFiles, lists:suffix(".boot", element(2, F))],
[{write_file, _, BootRel}] = safe_lookup_spec(Sys#sys.boot_rel ++ ".boot", BootFiles),
BootFiles2 = lists:keystore("start.boot", 2, BootFiles, {write_file, "start.boot", BootRel}),
- MakeRegexp = fun(File) -> "^bin/" ++ element(2, File) ++ "(|.escript)$" end,
+ MakeRegexp = fun(File) -> "^bin/" ++ element(2, File) ++ "(|.escript)\$" end,
ExtraIncl = lists:map(MakeRegexp, Escripts),
InclRegexps2 = reltool_utils:decode_regexps(incl_sys_filters, {add, ExtraIncl}, InclRegexps),
{InclRegexps2, Escripts ++ BinFiles2 ++ BootFiles2}.
@@ -722,7 +791,7 @@ do_spec_escript(File, ErtsBin, BinFiles) ->
ExeExt = filename:extension(EscriptExe),
[{copy_file, Base ++ EscriptExt, File},
{copy_file, Base ++ ExeExt, filename:join([ErtsBin, EscriptExe])}].
-
+
check_sys(Mandatory, SysFiles) ->
lists:foreach(fun(M) -> do_check_sys(M, SysFiles) end, Mandatory).
@@ -730,7 +799,8 @@ 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 is not included",
+ reltool_utils:throw_error("Mandatory system directory ~s "
+ "is not included",
[Prefix]);
_ ->
ok
@@ -750,7 +820,8 @@ lookup_spec(Prefix, Specs) ->
safe_lookup_spec(Prefix, Specs) ->
case lookup_spec(Prefix, Specs) of
[] ->
- reltool_utils:throw_error("Mandatory system file ~s is not included", [Prefix]);
+ reltool_utils:throw_error("Mandatory system file ~s is "
+ "not included", [Prefix]);
Match ->
Match
end.
@@ -780,7 +851,8 @@ spec_lib_files(#sys{apps = Apps} = Sys) ->
check_apps([Mandatory | Names], Apps) ->
case lists:keymember(Mandatory, #app.name, Apps) of
false ->
- reltool_utils:throw_error("Mandatory application ~p is not included in ~p",
+ reltool_utils:throw_error("Mandatory application ~p is "
+ "not included in ~p",
[Mandatory, Apps]);
true ->
check_apps(Names, Apps)
@@ -804,8 +876,12 @@ spec_app(#app{name = Name,
EbinDir = filename:join([SourceDir, "ebin"]),
OptAppUpFileSpec = spec_opt_copy_file(EbinDir, AppUpFilename),
OptAppFileSpec = spec_app_file(App, Sys, EbinDir),
- ModSpecs = [spec_mod(M, SysDebugInfo) || M <- Mods, M#mod.is_included, M#mod.exists],
- NewEbin = {create_dir, "ebin", OptAppUpFileSpec ++ OptAppFileSpec ++ ModSpecs},
+ ModSpecs = [spec_mod(M, SysDebugInfo) || M <- Mods,
+ M#mod.is_included,
+ M#mod.exists],
+ NewEbin = {create_dir,
+ "ebin",
+ OptAppUpFileSpec ++ OptAppFileSpec ++ ModSpecs},
AppFiles2 = lists:keystore("ebin", 2, AppFiles, NewEbin),
%% Apply file filter
@@ -826,24 +902,32 @@ spec_archive(#app{label = Label,
excl_archive_filters = SysExclArchiveDirs,
archive_opts = SysArchiveOpts},
Files) ->
- InclArchiveDirs = reltool_utils:default_val(AppInclArchiveDirs, SysInclArchiveDirs),
- ExclArchiveDirs = reltool_utils:default_val(AppExclArchiveDirs, SysExclArchiveDirs),
- ArchiveOpts = reltool_utils:default_val(AppArchiveOpts, SysArchiveOpts),
+ InclArchiveDirs =
+ reltool_utils:default_val(AppInclArchiveDirs, SysInclArchiveDirs),
+ ExclArchiveDirs =
+ reltool_utils:default_val(AppExclArchiveDirs, SysExclArchiveDirs),
+ ArchiveOpts =
+ reltool_utils:default_val(AppArchiveOpts, SysArchiveOpts),
Match = fun(F) -> match(element(2, F), InclArchiveDirs, ExclArchiveDirs) end,
case lists:filter(Match, Files) of
[] ->
%% Nothing to archive
[spec_create_dir(RootDir, SourceDir, Label, Files)];
ArchiveFiles ->
- OptDir =
+ OptDir =
case Files -- ArchiveFiles of
[] ->
[];
ExternalFiles ->
- [spec_create_dir(RootDir, SourceDir, Label, ExternalFiles)]
+ [spec_create_dir(RootDir,
+ SourceDir,
+ Label,
+ ExternalFiles)]
end,
- ArchiveOpts = reltool_utils:default_val(AppArchiveOpts, SysArchiveOpts),
- ArchiveDir = spec_create_dir(RootDir, SourceDir, Label, ArchiveFiles),
+ ArchiveOpts =
+ reltool_utils:default_val(AppArchiveOpts, SysArchiveOpts),
+ ArchiveDir =
+ spec_create_dir(RootDir, SourceDir, Label, ArchiveFiles),
[{archive, Label ++ ".ez", ArchiveOpts, [ArchiveDir]} | OptDir]
end.
@@ -854,7 +938,9 @@ spec_dir(Dir) ->
case erl_prim_loader:list_dir(Dir) of
{ok, Files} ->
%% Directory
- {create_dir, Base, [spec_dir(filename:join([Dir, F])) || F <- Files]};
+ {create_dir,
+ Base,
+ [spec_dir(filename:join([Dir, F])) || F <- Files]};
error ->
reltool_utils:throw_error("list dir ~s failed\n", [Dir])
end;
@@ -895,7 +981,7 @@ spec_app_file(#app{name = Name,
App2 = App#app{info = Info#app_info{modules = ModNames}},
Contents = gen_app(App2),
AppIoList = io_lib:format("%% app generated at ~w ~w\n~p.\n\n",
- [date(), time(), Contents]),
+ [date(), time(), Contents]),
[{write_file, AppFilename, AppIoList}];
all ->
%% Include all included modules
@@ -904,13 +990,14 @@ spec_app_file(#app{name = Name,
App2 = App#app{info = Info#app_info{modules = ModNames}},
Contents = gen_app(App2),
AppIoList = io_lib:format("%% app generated at ~w ~w\n~p.\n\n",
- [date(), time(), Contents]),
+ [date(), time(), Contents]),
[{write_file, AppFilename, AppIoList}]
-
+
end.
spec_opt_copy_file(DirName, BaseName) ->
- case filelib:is_regular(filename:join([DirName, BaseName]), erl_prim_loader) of
+ case filelib:is_regular(filename:join([DirName, BaseName]),
+ erl_prim_loader) of
true -> [{copy_file, BaseName}];
false -> []
end.
@@ -949,14 +1036,17 @@ eval_spec(Spec, SourceDir, TargetDir) ->
false ->
{error, TargetDir2 ++ ": " ++ file:format_error(enoent)}
end
- catch
+ catch
throw:{error, Text} ->
cleanup_spec(Spec, TargetDir2),
{error, Text}
end.
do_eval_spec(List, OrigSourceDir, SourceDir, TargetDir) when is_list(List) ->
- lists:foreach(fun(F) -> do_eval_spec(F, OrigSourceDir, SourceDir, TargetDir) end, List);
+ lists:foreach(fun(F) ->
+ do_eval_spec(F, OrigSourceDir, SourceDir, TargetDir)
+ end,
+ List);
%% do_eval_spec({source_dir, SourceDir2, Spec}, OrigSourceDir, _SourceDir, TargetDir) ->
%% %% Source dir is absolute or relative the original source dir
%% SourceDir3 = filename:join([OrigSourceDir, SourceDir2]),
@@ -966,12 +1056,18 @@ do_eval_spec({create_dir, Dir, Files}, OrigSourceDir, SourceDir, TargetDir) ->
TargetDir2 = filename:join([TargetDir, Dir]),
reltool_utils:create_dir(TargetDir2),
do_eval_spec(Files, OrigSourceDir, SourceDir2, TargetDir2);
-do_eval_spec({create_dir, Dir, OldDir, Files}, OrigSourceDir, _SourceDir, TargetDir) ->
+do_eval_spec({create_dir, Dir, OldDir, Files},
+ OrigSourceDir,
+ _SourceDir,
+ TargetDir) ->
SourceDir2 = filename:join([OrigSourceDir, OldDir]),
TargetDir2 = filename:join([TargetDir, Dir]),
reltool_utils:create_dir(TargetDir2),
do_eval_spec(Files, SourceDir2, SourceDir2, TargetDir2);
-do_eval_spec({archive, Archive, Options, Files}, OrigSourceDir, SourceDir, TargetDir) ->
+do_eval_spec({archive, Archive, Options, Files},
+ OrigSourceDir,
+ SourceDir,
+ TargetDir) ->
TmpSpec = {create_dir, "tmp", Files},
TmpDir = filename:join([TargetDir, "tmp"]),
reltool_utils:create_dir(TmpDir),
@@ -986,17 +1082,24 @@ do_eval_spec({archive, Archive, Options, Files}, OrigSourceDir, SourceDir, Targe
{ok, _} ->
ok;
{error, Reason} ->
- reltool_utils:throw_error("create archive ~s: ~p\n", [ArchiveFile, Reason])
+ reltool_utils:throw_error("create archive ~s: ~p\n",
+ [ArchiveFile, Reason])
end;
do_eval_spec({copy_file, File}, _OrigSourceDir, SourceDir, TargetDir) ->
SourceFile = filename:join([SourceDir, File]),
TargetFile = filename:join([TargetDir, File]),
reltool_utils:copy_file(SourceFile, TargetFile);
-do_eval_spec({copy_file, File, OldFile}, OrigSourceDir, _SourceDir, TargetDir) ->
+do_eval_spec({copy_file, File, OldFile},
+ OrigSourceDir,
+ _SourceDir,
+ TargetDir) ->
SourceFile = filename:join([OrigSourceDir, OldFile]),
TargetFile = filename:join([TargetDir, File]),
reltool_utils:copy_file(SourceFile, TargetFile);
-do_eval_spec({write_file, File, IoList}, _OrigSourceDir, _SourceDir, TargetDir) ->
+do_eval_spec({write_file, File, IoList},
+ _OrigSourceDir,
+ _SourceDir,
+ TargetDir) ->
TargetFile = filename:join([TargetDir, File]),
reltool_utils:write_file(TargetFile, IoList);
do_eval_spec({strip_beam, File}, _OrigSourceDir, SourceDir, TargetDir) ->
@@ -1039,9 +1142,12 @@ cleanup_spec({strip_beam, File}, TargetDir) ->
filter_spec(List, InclRegexps, ExclRegexps) ->
do_filter_spec("", List, InclRegexps, ExclRegexps).
-
+
do_filter_spec(Path, List, InclRegexps, ExclRegexps) when is_list(List) ->
- lists:zf(fun(File) -> do_filter_spec(Path, File, InclRegexps, ExclRegexps) end, List);
+ lists:zf(fun(File) ->
+ do_filter_spec(Path, File, InclRegexps, ExclRegexps)
+ end,
+ List);
%% do_filter_spec(Path, {source_dir, _SourceDir, Spec}, InclRegexps, ExclRegexps) ->
%% do_filter_spec(Path, Spec, InclRegexps, ExclRegexps);
do_filter_spec(Path, {create_dir, Dir, Files}, InclRegexps, ExclRegexps) ->
@@ -1057,7 +1163,10 @@ do_filter_spec(Path, {create_dir, Dir, Files}, InclRegexps, ExclRegexps) ->
Files2 when is_list(Files2) ->
{true, {create_dir, Dir, Files2}}
end;
-do_filter_spec(Path, {create_dir, NewDir, OldDir, Files}, InclRegexps, ExclRegexps) ->
+do_filter_spec(Path,
+ {create_dir, NewDir, OldDir, Files},
+ InclRegexps,
+ ExclRegexps) ->
Path2 = opt_join(Path, NewDir),
case do_filter_spec(Path2, Files, InclRegexps, ExclRegexps) of
[] ->
@@ -1070,7 +1179,10 @@ do_filter_spec(Path, {create_dir, NewDir, OldDir, Files}, InclRegexps, ExclRegex
Files2 when is_list(Files2) ->
{true, {create_dir, NewDir, OldDir, Files2}}
end;
-do_filter_spec(Path, {archive, Archive, Options, Files}, InclRegexps, ExclRegexps) ->
+do_filter_spec(Path,
+ {archive, Archive, Options, Files},
+ InclRegexps,
+ ExclRegexps) ->
case do_filter_spec(Path, Files, InclRegexps, ExclRegexps) of
[] ->
case match(Path, InclRegexps, ExclRegexps) of
@@ -1085,7 +1197,10 @@ do_filter_spec(Path, {archive, Archive, Options, Files}, InclRegexps, ExclRegexp
do_filter_spec(Path, {copy_file, File}, InclRegexps, ExclRegexps) ->
Path2 = opt_join(Path, File),
match(Path2, InclRegexps, ExclRegexps);
-do_filter_spec(Path, {copy_file, NewFile, _OldFile}, InclRegexps, ExclRegexps) ->
+do_filter_spec(Path,
+ {copy_file, NewFile, _OldFile},
+ InclRegexps,
+ ExclRegexps) ->
Path2 = opt_join(Path, NewFile),
match(Path2, InclRegexps, ExclRegexps);
do_filter_spec(Path, {write_file, File, _IoList}, InclRegexps, ExclRegexps) ->
@@ -1101,7 +1216,7 @@ opt_join(Path, File) ->
filename:join([Path, File]).
match(String, InclRegexps, ExclRegexps) ->
- %%case
+ %%case
match(String, InclRegexps) andalso not match(String, ExclRegexps).
%% of
%% true ->
@@ -1109,7 +1224,7 @@ match(String, InclRegexps, ExclRegexps) ->
%% false ->
%% io:format("no match: ~p\n"
%% " incl: ~p\n"
-%% " excl: ~p\n",
+%% " excl: ~p\n",
%% [String, InclRegexps, ExclRegexps]),
%% false
%% end.
@@ -1131,7 +1246,7 @@ match(String, [#regexp{source = _, compiled = MP} | Regexps]) ->
install(RelName, TargetDir) ->
try
do_install(RelName, TargetDir)
- catch
+ catch
throw:{error, Text} ->
{error, Text}
end.
@@ -1148,7 +1263,8 @@ do_install(RelName, TargetDir) ->
case os:type() of
{win32, _} ->
NativeRootDir = filename:nativename(TargetDir2),
- %% NativeBinDir = filename:nativename(filename:join([BinDir, "win32"])),
+ %% NativeBinDir =
+ %% filename:nativename(filename:join([BinDir, "win32"])),
NativeBinDir = filename:nativename(BinDir),
IniData = ["[erlang]\r\n",
"Bindir=", NativeBinDir, "\r\n",
@@ -1157,8 +1273,11 @@ do_install(RelName, TargetDir) ->
IniFile = filename:join([BinDir, "erl.ini"]),
ok = file:write_file(IniFile, IniData);
_ ->
- subst_src_scripts(start_scripts(), ErtsBinDir, BinDir,
- [{"FINAL_ROOTDIR", TargetDir2}, {"EMU", "beam"}],
+ subst_src_scripts(start_scripts(),
+ ErtsBinDir,
+ BinDir,
+ [{"FINAL_ROOTDIR", TargetDir2},
+ {"EMU", "beam"}],
[preserve])
end,
RelFile = filename:join([RelDir, RelVsn, RelName ++ ".rel"]),
@@ -1169,13 +1288,15 @@ do_install(RelName, TargetDir) ->
end.
subst_src_scripts(Scripts, SrcDir, DestDir, Vars, Opts) ->
- Fun = fun(Script) -> subst_src_script(Script, SrcDir, DestDir, Vars, Opts) end,
+ Fun = fun(Script) ->
+ subst_src_script(Script, SrcDir, DestDir, Vars, Opts)
+ end,
lists:foreach(Fun, Scripts).
-subst_src_script(Script, SrcDir, DestDir, Vars, Opts) ->
+subst_src_script(Script, SrcDir, DestDir, Vars, Opts) ->
subst_file(filename:join([SrcDir, Script ++ ".src"]),
filename:join([DestDir, Script]),
- Vars,
+ Vars,
Opts).
subst_file(Src, Dest, Vars, Opts) ->
diff --git a/lib/reltool/src/reltool_utils.erl b/lib/reltool/src/reltool_utils.erl
index 8d52ade9be..403fa574c5 100644
--- a/lib/reltool/src/reltool_utils.erl
+++ b/lib/reltool/src/reltool_utils.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2009-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
-module(reltool_utils).
@@ -30,11 +30,11 @@ root_dir() ->
erl_libs() ->
case os:getenv("ERL_LIBS") of
- false ->
+ false ->
[];
LibStr ->
string:tokens(LibStr, ":;")
- end.
+ end.
lib_dirs(Dir) ->
case erl_prim_loader:list_dir(Dir) of
@@ -42,7 +42,7 @@ lib_dirs(Dir) ->
[F || F <- Files,
filelib:is_dir(filename:join([Dir, F]),
erl_prim_loader)];
- error ->
+ error ->
[]
end.
@@ -55,7 +55,7 @@ split_app_name(Name) ->
Elem >= $0, Elem =< $9 -> true;
true -> false
end
- end,
+ end,
case lists:splitwith(Pred, lists:reverse(Name)) of
{Vsn, [$- | App]} ->
{list_to_atom(lists:reverse(App)), lists:reverse(Vsn)};
@@ -119,7 +119,7 @@ default_rels() ->
assign_image_list(ListCtrl) ->
Art = wxImageList:new(16,16),
- [wxImageList:add(Art, wxArtProvider:getBitmap(Image, [{size, {16,16}}]))
+ [wxImageList:add(Art, wxArtProvider:getBitmap(Image, [{size, {16,16}}]))
|| Image <- ["wxART_ERROR",
"wxART_WARNING",
"wxART_QUESTION",
@@ -206,7 +206,7 @@ split_app_dir(Dir) ->
ParentDir = filename:dirname(Dir),
Base = filename:basename(Dir),
{Name, Vsn} = split_app_name(Base),
- Vsn2 =
+ Vsn2 =
try
[list_to_integer(N) || N <- string:tokens(Vsn, ".")]
catch
@@ -276,7 +276,9 @@ get_selected_items(ListCtrl, PrevItem, Acc) ->
ItemNo ->
case wxListCtrl:getItemText(ListCtrl, ItemNo) of
Text when Text =/= ?MISSING_APP_TEXT ->
- get_selected_items(ListCtrl, ItemNo, [{ItemNo, Text} | Acc]);
+ get_selected_items(ListCtrl,
+ ItemNo,
+ [{ItemNo, Text} | Acc]);
_Text ->
get_selected_items(ListCtrl, ItemNo, Acc)
end
@@ -306,7 +308,8 @@ select_items(ListCtrl, OldItems, NewItems) ->
select_item(ListCtrl, NewItems);
ValidItems ->
%% Some old selections are still valid. Select them again.
- lists:foreach(fun(Item) -> select_item(ListCtrl, [Item]) end, ValidItems)
+ lists:foreach(fun(Item) -> select_item(ListCtrl, [Item]) end,
+ ValidItems)
end.
select_item(ListCtrl, [{ItemNo, Text} | Items]) ->
@@ -339,7 +342,7 @@ print(_, _, _, _) ->
ok.
%% -define(SAFE(M,F,A), safe(M, F, A, ?MODULE, ?LINE)).
-%%
+%%
%% safe(M, F, A, Mod, Line) ->
%% case catch apply(M, F, A) of
%% {'EXIT', Reason} ->
@@ -356,7 +359,7 @@ return_first_error(Status, NewError) when is_list(NewError) ->
{error, OldError} ->
{error, OldError}
end.
-
+
add_warning(Status, Warning) ->
case Status of
{ok, Warnings} ->
@@ -429,7 +432,8 @@ recursive_delete(Dir) ->
true ->
case file:list_dir(Dir) of
{ok, Files} ->
- Fun = fun(F) -> recursive_delete(filename:join([Dir, F])) end,
+ Fun =
+ fun(F) -> recursive_delete(filename:join([Dir, F])) end,
lists:foreach(Fun, Files),
delete(Dir, directory);
{error, enoent} ->
@@ -514,7 +518,9 @@ decode_regexps(Key, Regexps, _Old) when is_list(Regexps) ->
do_decode_regexps(Key, [Regexp | Regexps], Acc) ->
case catch re:compile(Regexp, []) of
{ok, MP} ->
- do_decode_regexps(Key, Regexps, [#regexp{source = Regexp, compiled = MP} | Acc]);
+ do_decode_regexps(Key,
+ Regexps,
+ [#regexp{source = Regexp, compiled = MP} | Acc]);
_ ->
Text = lists:flatten(io_lib:format("~p", [{Key, Regexp}])),
throw({error, "Illegal option: " ++ Text})
@@ -532,6 +538,27 @@ default_val(Val, Default) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+escript_foldl(Fun, Acc, File) ->
+ case escript:extract(File, [compile_source]) of
+ {ok, [_Shebang, _Comment, _EmuArgs, Body]} ->
+ case Body of
+ {source, BeamCode} ->
+ GetInfo = fun() -> file:read_file_info(File) end,
+ GetBin = fun() -> BeamCode end,
+ {ok, Fun(".", GetInfo, GetBin, Acc)};
+ {beam, BeamCode} ->
+ GetInfo = fun() -> file:read_file_info(File) end,
+ GetBin = fun() -> BeamCode end,
+ {ok, Fun(".", GetInfo, GetBin, Acc)};
+ {archive, ArchiveBin} ->
+ zip:foldl(Fun, Acc, {File, ArchiveBin})
+ end;
+ {error, Reason} ->
+ {error, Reason}
+ end.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
call(Name, Msg) when is_atom(Name) ->
call(whereis(Name), Msg);
call(Pid, Msg) when is_pid(Pid) ->
diff --git a/lib/runtime_tools/doc/src/erts_alloc_config.xml b/lib/runtime_tools/doc/src/erts_alloc_config.xml
index 5e7cbe4172..6acf498411 100644
--- a/lib/runtime_tools/doc/src/erts_alloc_config.xml
+++ b/lib/runtime_tools/doc/src/erts_alloc_config.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2007</year><year>2009</year>
+ <year>2007</year><year>2010</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -13,12 +13,12 @@
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at http://www.erlang.org/.
-
+
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitations
under the License.
-
+
</legalnotice>
<title>erts_alloc_config</title>
@@ -68,7 +68,7 @@
command-line flag to the Erlang runtime system you are going
to use for creation of the allocator configuration. It will
disable features that prevent <c>erts_alloc_config</c> from
- doing it's job. Note, you should <em>not</em> use this flag
+ doing its job. Note, you should <em>not</em> use this flag
when using the created configuration. Also note that it is
important that you use the same
<seealso marker="erts:erl#+S">amount of schedulers</seealso>
diff --git a/lib/runtime_tools/src/dbg.erl b/lib/runtime_tools/src/dbg.erl
index 66ac0422eb..56283f4d3d 100644
--- a/lib/runtime_tools/src/dbg.erl
+++ b/lib/runtime_tools/src/dbg.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1996-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
-module(dbg).
@@ -945,7 +945,7 @@ dhandler(end_of_trace, Out) ->
dhandler(Trace, Out) when element(1, Trace) == trace, tuple_size(Trace) >= 3 ->
dhandler1(Trace, tuple_size(Trace), Out);
dhandler(Trace, Out) when element(1, Trace) == trace_ts, tuple_size(Trace) >= 4 ->
- dhandler1(Trace, tuple_size(Trace)-1, Out);
+ dhandler1(Trace, tuple_size(Trace)-1, element(tuple_size(Trace),Trace), Out);
dhandler(Trace, Out) when element(1, Trace) == drop, tuple_size(Trace) =:= 2 ->
io:format(Out, "*** Dropped ~p messages.~n", [element(2,Trace)]),
Out;
@@ -978,24 +978,18 @@ dhandler(_Trace, Out) ->
Out.
dhandler1(Trace, Size, Out) ->
-%%%! Self = self(),
From = element(2, Trace),
case element(3, Trace) of
'receive' ->
case element(4, Trace) of
{dbg,ok} -> ok;
- Message -> io:format(Out, "(~p) << ~p~n", [From,Message])
+ Message ->
+ io:format(Out, "(~p) << ~p~n", [From,Message])
end;
'send' ->
Message = element(4, Trace),
- case element(5, Trace) of
-%%%! This causes messages to disappear when used by ttb (observer). Tests
-%%%! so far show that there is no difference in results with dbg even if I
-%%%! comment it out, so I hope this is only some old code which isn't
-%%%! needed anymore... /siri
-%%%! Self -> ok;
- To -> io:format(Out, "(~p) ~p ! ~p~n", [From,To,Message])
- end;
+ To = element(5, Trace),
+ io:format(Out, "(~p) ~p ! ~p~n", [From,To,Message]);
call ->
case element(4, Trace) of
MFA when Size == 5 ->
@@ -1028,6 +1022,51 @@ dhandler1(Trace, Size, Out) ->
end,
Out.
+dhandler1(Trace, Size, TS, Out) ->
+ From = element(2, Trace),
+ case element(3, Trace) of
+ 'receive' ->
+ case element(4, Trace) of
+ {dbg,ok} -> ok;
+ Message ->
+ io:format(Out, "(~p) << ~p (Timestamp: ~p)~n", [From,Message,TS])
+ end;
+ 'send' ->
+ Message = element(4, Trace),
+ To = element(5, Trace),
+ io:format(Out, "(~p) ~p ! ~p (Timestamp: ~p)~n", [From,To,Message,TS]);
+ call ->
+ case element(4, Trace) of
+ MFA when Size == 5 ->
+ Message = element(5, Trace),
+ io:format(Out, "(~p) call ~s (~p) (Timestamp: ~p)~n", [From,ffunc(MFA),Message,TS]);
+ MFA ->
+ io:format(Out, "(~p) call ~s (Timestamp: ~p)~n", [From,ffunc(MFA),TS])
+ end;
+ return -> %% To be deleted...
+ case element(4, Trace) of
+ MFA when Size == 5 ->
+ Ret = element(5, Trace),
+ io:format(Out, "(~p) old_ret ~s -> ~p (Timestamp: ~p)~n", [From,ffunc(MFA),Ret,TS]);
+ MFA ->
+ io:format(Out, "(~p) old_ret ~s (Timestamp: ~p)~n", [From,ffunc(MFA),TS])
+ end;
+ return_from ->
+ MFA = element(4, Trace),
+ Ret = element(5, Trace),
+ io:format(Out, "(~p) returned from ~s -> ~p (Timestamp: ~p)~n", [From,ffunc(MFA),Ret,TS]);
+ return_to ->
+ MFA = element(4, Trace),
+ io:format(Out, "(~p) returning to ~s (Timestamp: ~p)~n", [From,ffunc(MFA),TS]);
+ spawn when Size == 5 ->
+ Pid = element(4, Trace),
+ MFA = element(5, Trace),
+ io:format(Out, "(~p) spawn ~p as ~s (Timestamp: ~p)~n", [From,Pid,ffunc(MFA),TS]);
+ Op ->
+ io:format(Out, "(~p) ~p ~s (Timestamp: ~p)~n", [From,Op,ftup(Trace,4,Size),TS])
+ end,
+ Out.
+
%%% These f* functions returns non-flat strings
diff --git a/lib/snmp/doc/src/notes_history.xml b/lib/snmp/doc/src/notes_history.xml
index 8739400773..934df87866 100644
--- a/lib/snmp/doc/src/notes_history.xml
+++ b/lib/snmp/doc/src/notes_history.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2004</year><year>2009</year>
+ <year>2004</year><year>2010</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -13,12 +13,12 @@
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at http://www.erlang.org/.
-
+
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitations
under the License.
-
+
</legalnotice>
<title>SNMP Release Notes history</title>
@@ -1732,7 +1732,7 @@
version 4.1. </p>
<p>When performing a downgrade, make sure the verbosity of the
manager server process is silence, or else the process will crash
- (due to a bug in version 4.0.4) and be restarted by it's
+ (due to a bug in version 4.0.4) and be restarted by its
supervisor.</p>
<section>
@@ -1773,7 +1773,7 @@
version 4.0.4. </p>
<p>When performing a downgrade, make sure the verbosity of the
manager server process is silence, or else the process will crash
- (due to a bug in version 4.0.4) and be restarted by it's
+ (due to a bug in version 4.0.4) and be restarted by its
supervisor.</p>
<section>
@@ -1827,8 +1827,8 @@
</item>
<item>
<p>[manager] The server process contained a bug that caused it
- to crash, if it received an exit message from it's gct (GC timer)
- process and it's verbosity was <em>log</em> or higher. </p>
+ to crash, if it received an exit message from its gct (GC timer)
+ process and its verbosity was <em>log</em> or higher. </p>
<p>This also effects the application downgrade. </p>
<p>Own Id: OTP-5306</p>
</item>
diff --git a/lib/snmp/doc/src/snmp_app.xml b/lib/snmp/doc/src/snmp_app.xml
index e5a725d720..57eb87a759 100644
--- a/lib/snmp/doc/src/snmp_app.xml
+++ b/lib/snmp/doc/src/snmp_app.xml
@@ -80,7 +80,7 @@
<!-- The info below is also found in the snmp_config.xml file -->
- <p>Each snmp component has it's own set of configuration parameters,
+ <p>Each snmp component has its own set of configuration parameters,
even though some of the types are common to both components. </p>
<pre>
@@ -693,7 +693,7 @@
<p>Specifies if and how the audit trail log shall be repaired
when opened. Unless this parameter has the value <c>snmp_repair</c>
it is sent to <c>disk_log</c>. If, on the other hand, the value is
- <c>snmp_repair</c>, snmp attempts to handle certain faults on it's
+ <c>snmp_repair</c>, snmp attempts to handle certain faults on its
own. And even if it cannot repair the file, it does not truncate it
directly, but instead <em>moves it aside</em> for later off-line
analysis.</p>
diff --git a/lib/snmp/doc/src/snmp_config.xml b/lib/snmp/doc/src/snmp_config.xml
index 6fc9cc49f2..5bd36305fc 100644
--- a/lib/snmp/doc/src/snmp_config.xml
+++ b/lib/snmp/doc/src/snmp_config.xml
@@ -704,7 +704,7 @@
<p>Specifies if and how the audit trail log shall be repaired
when opened. Unless this parameter has the value <c>snmp_repair</c>
it is sent to <c>disk_log</c>. If, on the other hand, the value is
- <c>snmp_repair</c>, snmp attempts to handle certain faults on it's
+ <c>snmp_repair</c>, snmp attempts to handle certain faults on its
own. And even if it cannot repair the file, it does not truncate it
directly, but instead <em>moves it aside</em> for later off-line
analysis.</p>
diff --git a/lib/snmp/doc/src/snmpa_network_interface_filter.xml b/lib/snmp/doc/src/snmpa_network_interface_filter.xml
index d625fd3e4a..10419517dd 100644
--- a/lib/snmp/doc/src/snmpa_network_interface_filter.xml
+++ b/lib/snmp/doc/src/snmpa_network_interface_filter.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2007</year><year>2009</year>
+ <year>2007</year><year>2010</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -13,12 +13,12 @@
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at http://www.erlang.org/.
-
+
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitations
under the License.
-
+
</legalnotice>
<title>snmpa_network_interface_filter</title>
@@ -153,7 +153,7 @@ pdu_type() = 'get-request' | 'get-next-request' | 'get-response' | 'set-request'
<p>For the message to be discarded all together, the function
<em>must</em> return <em>false</em>. </p>
<p>Note that it is possible for this function to filter out targets
- (but <em>not</em> add it's own) by returning an updated
+ (but <em>not</em> add its own) by returning an updated
<c>Targets</c> list (<c>NewTargets</c>). </p>
</desc>
</func>
diff --git a/lib/snmp/doc/src/snmpm.xml b/lib/snmp/doc/src/snmpm.xml
index 9e7ac75daf..1ee391d9ba 100644
--- a/lib/snmp/doc/src/snmpm.xml
+++ b/lib/snmp/doc/src/snmpm.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2004</year><year>2009</year>
+ <year>2004</year><year>2010</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -13,12 +13,12 @@
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at http://www.erlang.org/.
-
+
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitations
under the License.
-
+
</legalnotice>
<title>snmpm</title>
@@ -920,7 +920,7 @@ priv_key = [integer()] (length is 16 if priv = usmDESPrivProtocol | usmAesCfb1
<v>Oids = [oid()]</v>
</type>
<desc>
- <p>Transform a alias-name to it's oid.</p>
+ <p>Transform a alias-name to its oid.</p>
<p>Note that an alias-name is only unique within the mib, so
when loading several mib's into a manager, there might be
several instances of the same aliasname.</p>
@@ -938,7 +938,7 @@ priv_key = [integer()] (length is 16 if priv = usmDESPrivProtocol | usmAesCfb1
<v>Reason = term()</v>
</type>
<desc>
- <p>Transform a oid to it's aliasname.</p>
+ <p>Transform a oid to its aliasname.</p>
<marker id="oid_to_type"></marker>
</desc>
diff --git a/lib/ssh/doc/src/notes.xml b/lib/ssh/doc/src/notes.xml
index 9597137cdf..2533ab8085 100644
--- a/lib/ssh/doc/src/notes.xml
+++ b/lib/ssh/doc/src/notes.xml
@@ -29,6 +29,30 @@
<file>notes.xml</file>
</header>
+ <section><title>Ssh 1.1.9</title>
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>The configuration parameter ip_v6_disabled is now available,
+ which makes it possible for the user to alter the IP version
+ SSH shall use.</p>
+ <p>Own Id: OTP-8535 Aux Id:</p>
+ </item>
+ <item>
+ <p>The ssh_connection:send operation now accepts infinity as timeout.</p>
+ <p>Own Id: OTP-8534 Aux Id:</p>
+ </item>
+ <item>
+ <p>The connection handler now include stack traces when a channel
+ message is not handled correctly.</p>
+ <p>Own Id: OTP-8524 Aux Id:</p>
+ </item>
+ </list>
+ </section>
+
+ </section>
+
<section><title>Ssh 1.1.8</title>
<section><title>Fixed Bugs and Malfunctions</title>
diff --git a/lib/ssh/doc/src/ssh.xml b/lib/ssh/doc/src/ssh.xml
index aca5c9cdc4..71e6b2cd3d 100644
--- a/lib/ssh/doc/src/ssh.xml
+++ b/lib/ssh/doc/src/ssh.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2004</year><year>2009</year>
+ <year>2004</year><year>2010</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -13,12 +13,12 @@
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at http://www.erlang.org/.
-
+
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitations
under the License.
-
+
</legalnotice>
<title>ssh</title>
@@ -159,6 +159,9 @@
<item>
<p>Allow an existing file-descriptor to be used
(simply passed on to the transport protocol).</p></item>
+ <tag><c><![CDATA[{ip_v6_disabled, boolean()}]]></c></tag>
+ <item>
+ <p>Determines if SSH shall use IPv6 or not.</p></item>
</taglist>
</desc>
</func>
@@ -198,8 +201,8 @@
<item>
Provides specifications for handling of subsystems. The
"sftp" subsystem-spec can be retrieved by calling
- ssh_sftd:subsystem_spec/1. If the subsystems option in not present
- the value of <c>[ssh_sftd:subsystem_spec([])]</c> will be used.
+ ssh_sftpd:subsystem_spec/1. If the subsystems option in not present
+ the value of <c>[ssh_sftpd:subsystem_spec([])]</c> will be used.
It is of course possible to set the option to the empty list
if you do not want the daemon to run any subsystems at all.
</item>
@@ -252,6 +255,10 @@
<item>
<p>Allow an existing file-descriptor to be used
(simply passed on to the transport protocol).</p></item>
+ <tag><c><![CDATA[{ip_v6_disabled, boolean()}]]></c></tag>
+ <item>
+ <p>Determines if SSH shall use IPv6 or not (only used when
+ HostAddress is set to any).</p></item>
</taglist>
</desc>
</func>
diff --git a/lib/ssh/src/ssh.appup.src b/lib/ssh/src/ssh.appup.src
index 5329373862..b082d66988 100644
--- a/lib/ssh/src/ssh.appup.src
+++ b/lib/ssh/src/ssh.appup.src
@@ -19,7 +19,13 @@
{"%VSN%",
[
- {"1.1.7", [{load_module, ssh_connection_handler, soft_purge, soft_purge, []}]},
+ {"1.1.8", [{load_module, ssh_connection_manager, soft_purge, soft_purge, []},
+ {load_module, ssh, soft_purge, soft_purge, []},
+ {load_module, ssh_connection, soft_purge, soft_purge, []}]},
+ {"1.1.7", [{load_module, ssh_connection_handler, soft_purge, soft_purge, []},
+ {load_module, ssh_connection, soft_purge, soft_purge, []},
+ {load_module, ssh, soft_purge, soft_purge, []},
+ {load_module, ssh_connection_manager, soft_purge, soft_purge, []}]},
{"1.1.6", [{restart_application, ssh}]},
{"1.1.5", [{restart_application, ssh}]},
{"1.1.4", [{restart_application, ssh}]},
@@ -27,7 +33,13 @@
{"1.1.2", [{restart_application, ssh}]}
],
[
- {"1.1.7", [{load_module, ssh_connection_handler, soft_purge, soft_purge, []}]},
+ {"1.1.8", [{load_module, ssh_connection_manager, soft_purge, soft_purge, []},
+ {load_module, ssh, soft_purge, soft_purge, []},
+ {load_module, ssh_connection, soft_purge, soft_purge, []}]},
+ {"1.1.7", [{load_module, ssh_connection_handler, soft_purge, soft_purge, []},
+ {load_module, ssh_connection, soft_purge, soft_purge, []},
+ {load_module, ssh, soft_purge, soft_purge, []},
+ {load_module, ssh_connection_manager, soft_purge, soft_purge, []}]},
{"1.1.6", [{restart_application, ssh}]},
{"1.1.5", [{restart_application, ssh}]},
{"1.1.4", [{restart_application, ssh}]},
diff --git a/lib/ssh/src/ssh.erl b/lib/ssh/src/ssh.erl
index f9a986a8b6..0eef3f95c0 100644
--- a/lib/ssh/src/ssh.erl
+++ b/lib/ssh/src/ssh.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2004-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
@@ -330,10 +330,10 @@ handle_options([{nodelay, _} = Opt | Rest], SockOpts, Opts) ->
handle_options([Opt | Rest], SockOpts, Opts) ->
handle_options(Rest, SockOpts, [Opt | Opts]).
+%% Has IPv6 been disabled?
inetopt(true) ->
- inet6;
-
+ inet;
inetopt(false) ->
- inet.
+ inet6.
diff --git a/lib/ssh/src/ssh_connection.erl b/lib/ssh/src/ssh_connection.erl
index 0aaf1c18d2..b9827c90ea 100644
--- a/lib/ssh/src/ssh_connection.erl
+++ b/lib/ssh/src/ssh_connection.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2008-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
@@ -123,6 +123,8 @@ send(ConnectionManager, ChannelId, Data) ->
send(ConnectionManager, ChannelId, 0, Data, infinity).
send(ConnectionManager, ChannelId, Data, TimeOut) when is_integer(TimeOut) ->
send(ConnectionManager, ChannelId, 0, Data, TimeOut);
+send(ConnectionManager, ChannelId, Data, infinity) ->
+ send(ConnectionManager, ChannelId, 0, Data, infinity);
send(ConnectionManager, ChannelId, Type, Data) ->
send(ConnectionManager, ChannelId, Type, Data, infinity).
send(ConnectionManager, ChannelId, Type, Data, TimeOut) ->
diff --git a/lib/ssh/src/ssh_connection_manager.erl b/lib/ssh/src/ssh_connection_manager.erl
index 3863005e74..a2effc177e 100644
--- a/lib/ssh/src/ssh_connection_manager.erl
+++ b/lib/ssh/src/ssh_connection_manager.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2008-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
@@ -272,18 +272,18 @@ handle_call({ssh_msg, Pid, Msg}, From,
{stop, normal, State#state{connection_state = Connection}}
catch
exit:{noproc, Reason} ->
- Report = io_lib:format("Connection probably terminated:~n~p~n~p~n",
- [ConnectionMsg, Reason]),
+ Report = io_lib:format("Connection probably terminated:~n~p~n~p~n~p~n",
+ [ConnectionMsg, Reason, erlang:get_stacktrace()]),
error_logger:info_report(Report),
{noreply, State};
error:Error ->
- Report = io_lib:format("Connection message returned:~n~p~n~p~n",
- [ConnectionMsg, Error]),
+ Report = io_lib:format("Connection message returned:~n~p~n~p~n~p~n",
+ [ConnectionMsg, Error, erlang:get_stacktrace()]),
error_logger:info_report(Report),
{noreply, State};
exit:Exit ->
- Report = io_lib:format("Connection message returned:~n~p~n~p~n",
- [ConnectionMsg, Exit]),
+ Report = io_lib:format("Connection message returned:~n~p~n~p~n~p~n",
+ [ConnectionMsg, Exit, erlang:get_stacktrace()]),
error_logger:info_report(Report),
{noreply, State}
end;
diff --git a/lib/ssh/vsn.mk b/lib/ssh/vsn.mk
index bc7bceeb24..c275cb7acf 100644
--- a/lib/ssh/vsn.mk
+++ b/lib/ssh/vsn.mk
@@ -1,9 +1,13 @@
#-*-makefile-*- ; force emacs to enter makefile-mode
-SSH_VSN = 1.1.8
+SSH_VSN = 1.1.9
APP_VSN = "ssh-$(SSH_VSN)"
-TICKETS = OTP-8356 \
+TICKETS = OTP-8524 \
+ OTP-8534 \
+ OTP-8535
+
+TICKETS_1.1.8 = OTP-8356 \
OTP-8401
TICKETS_1.1.7 = OTP-8121 \
diff --git a/lib/ssl/doc/src/notes.xml b/lib/ssl/doc/src/notes.xml
index 4265445d23..2dd11bc88e 100644
--- a/lib/ssl/doc/src/notes.xml
+++ b/lib/ssl/doc/src/notes.xml
@@ -31,6 +31,21 @@
<p>This document describes the changes made to the SSL application.
</p>
+<section><title>SSL 3.10.9</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Fixed a crash in the certificate certification part.</p>
+ <p>
+ Own Id: OTP-8510 Aux Id: seq11525 </p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>SSL 3.10.8</title>
<section><title>Fixed Bugs and Malfunctions</title>
diff --git a/lib/ssl/src/ssl.appup.src b/lib/ssl/src/ssl.appup.src
index 3aea2428c9..fdda65021d 100644
--- a/lib/ssl/src/ssl.appup.src
+++ b/lib/ssl/src/ssl.appup.src
@@ -8,7 +8,8 @@
{"3.10.4", [{restart_application, ssl}]},
{"3.10.5", [{restart_application, ssl}]},
{"3.10.6", [{restart_application, ssl}]},
- {"3.10.7", [{restart_application, ssl}]}
+ {"3.10.7", [{restart_application, ssl}]},
+ {"3.10.8", [{restart_application, ssl}]}
],
[
{"3.10", [{restart_application, ssl}]},
@@ -18,6 +19,6 @@
{"3.10.4", [{restart_application, ssl}]},
{"3.10.5", [{restart_application, ssl}]},
{"3.10.6", [{restart_application, ssl}]},
- {"3.10.7", [{restart_application, ssl}]}
+ {"3.10.8", [{restart_application, ssl}]}
]}.
diff --git a/lib/ssl/src/ssl_certificate_db.erl b/lib/ssl/src/ssl_certificate_db.erl
index adae92530a..b8c3c6f6b7 100644
--- a/lib/ssl/src/ssl_certificate_db.erl
+++ b/lib/ssl/src/ssl_certificate_db.erl
@@ -159,6 +159,8 @@ issuer_candidate(no_candidate) ->
case ets:first(Db) of
'$end_of_table' ->
no_more_candidates;
+ {file, _} = Key ->
+ issuer_candidate(Key);
Key ->
[Cert] = lookup(Key, Db),
{Key, Cert}
diff --git a/lib/ssl/vsn.mk b/lib/ssl/vsn.mk
index 7c038e5818..bf67fcd257 100644
--- a/lib/ssl/vsn.mk
+++ b/lib/ssl/vsn.mk
@@ -17,9 +17,10 @@
# %CopyrightEnd%
#
-SSL_VSN = 3.10.8
+SSL_VSN = 3.10.9
+TICKETS = OTP-8510
-TICKETS = OTP-8372 OTP-8441 OTP-8459
+#TICKETS_3.10.8 = OTP-8372 OTP-8441 OTP-8459
#TICKETS_3.10.7 = OTP-8260 OTP-8218 OTP-8250
#TICKETS_3.10.6 = OTP-8275
diff --git a/lib/stdlib/doc/src/io_protocol.xml b/lib/stdlib/doc/src/io_protocol.xml
index 201787f7b5..b52e862a5c 100644
--- a/lib/stdlib/doc/src/io_protocol.xml
+++ b/lib/stdlib/doc/src/io_protocol.xml
@@ -195,7 +195,7 @@ latin1, Module, Function, Args} respectively. </p>
below).</p>
<p>The function will be called with the data the io_server finds on
- it's device, returning {done, Result, RestChars} when enough data is
+ its device, returning {done, Result, RestChars} when enough data is
read (in which case Result is sent to the client and RestChars are
kept in the io_server as a buffer for subsequent input) or {more,
Continuation}, indicating that more characters are needed to
@@ -741,7 +741,7 @@ optimize anything however. It is important though that the returned
data is of the right type depending on the options set, so we convert
the lists to binaries in the correct encoding <em>if possible</em>
before returning. The function supplied in the get_until request may,
-as it's final result return anything, so only functions actually
+as its final result return anything, so only functions actually
returning lists can get them converted to binaries. If the request
contained the encoding tag unicode, the lists can contain all unicode
codepoints and the binaries should be in UTF-8, if the encoding tag
diff --git a/lib/stdlib/doc/src/ms_transform.xml b/lib/stdlib/doc/src/ms_transform.xml
index 9f178b426c..ba9f89685b 100644
--- a/lib/stdlib/doc/src/ms_transform.xml
+++ b/lib/stdlib/doc/src/ms_transform.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2002</year><year>2009</year>
+ <year>2002</year><year>2010</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -13,12 +13,12 @@
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at http://www.erlang.org/.
-
+
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitations
under the License.
-
+
</legalnotice>
<title>ms_transform</title>
@@ -245,7 +245,7 @@ ets:select(emp_tab, ets:fun2ms(
fun(#emp{empno = [$0 | Rest] }) ->
{[$0|Rest],[$1|Rest]}
end)). </code>
- <p>As a matter of fact, this query hit's the feature of partially bound
+ <p>As a matter of fact, this query hits the feature of partially bound
keys in the table type <c>ordered_set</c>, so that not the whole
table need be searched, only the part of the table containing keys
beginning with <c>0</c> is in fact looked into. </p>
diff --git a/lib/stdlib/doc/src/unicode_usage.xml b/lib/stdlib/doc/src/unicode_usage.xml
index c5bf10b63d..f1b0659ea2 100644
--- a/lib/stdlib/doc/src/unicode_usage.xml
+++ b/lib/stdlib/doc/src/unicode_usage.xml
@@ -143,7 +143,7 @@ en_US.UTF-8</pre>
<pre>
$ echo <input>$LC_CTYPE</input>
en_US.UTF-8</pre>
-<p>The LANG or LC_CTYPE setting should be consistent with what the terminal is capable of, there is no portable way for Erlang to ask the actual terminal about it's UTF-8 capacity, we have to rely on the language and character type settings.</p>
+<p>The LANG or LC_CTYPE setting should be consistent with what the terminal is capable of, there is no portable way for Erlang to ask the actual terminal about its UTF-8 capacity, we have to rely on the language and character type settings.</p>
<p>To investigate what Erlang thinks about the terminal, the <c>io:getopts()</c> call can be used when the shell is started:</p>
<pre>
$ <input>LC_CTYPE=en_US.ISO-8859-1 erl</input>
@@ -185,7 +185,7 @@ Eshell V5.7 (abort with ^G)
<tag><c>file</c>, <c>group</c> and <c>user</c></tag>
<item>
<p>I/O-servers throughout the system are able both to handle Unicode data and has options for converting data upon actual output or input to/from the device. As shown earlier, the <seealso marker="stdlib:shell">shell</seealso> has support for Unicode terminals and the <seealso marker="kernel:file">file</seealso> module allows for translation to and from various Unicode formats on disk.</p>
-<p>The actual reading and writing of files with Unicode data is however not best done with the <c>file</c> module as it's interface is byte oriented. A file opened with a Unicode encoding (like UTF-8), is then best read or written using the <seealso marker="stdlib:io">io</seealso> module.</p>
+<p>The actual reading and writing of files with Unicode data is however not best done with the <c>file</c> module as its interface is byte oriented. A file opened with a Unicode encoding (like UTF-8), is then best read or written using the <seealso marker="stdlib:io">io</seealso> module.</p>
</item>
<tag><c>re</c></tag>
<item>
diff --git a/lib/stdlib/doc/src/zip.xml b/lib/stdlib/doc/src/zip.xml
index af407f1925..4d98a20206 100644
--- a/lib/stdlib/doc/src/zip.xml
+++ b/lib/stdlib/doc/src/zip.xml
@@ -42,16 +42,18 @@
<p>By convention, the name of a zip file should end in "<c>.zip</c>".
To abide to the convention, you'll need to add "<c>.zip</c>" yourself
to the name.</p>
- <p>Zip archives are created with the
- <seealso marker="#zip_2">zip/2</seealso> or the
+ <p>Zip archives are created with the
+ <seealso marker="#zip_2">zip/2</seealso> or the
<seealso marker="#zip_2">zip/3</seealso> function. (They are
also available as <c>create</c>, to resemble the <c>erl_tar</c>
module.)</p>
- <p>To extract files from a zip archive, use the
- <seealso marker="#unzip_1">unzip/1</seealso> or the
+ <p>To extract files from a zip archive, use the
+ <seealso marker="#unzip_1">unzip/1</seealso> or the
<seealso marker="#unzip_2">unzip/2</seealso> function. (They are
also available as <c>extract</c>.)</p>
- <p>To return a list of the files in a zip archive, use the
+ <p>To fold a function over all files in a zip archive, use the
+ <seealso marker="#foldl_3">foldl_3</seealso>.</p>
+ <p>To return a list of the files in a zip archive, use the
<seealso marker="#list_dir_1">list_dir/1</seealso> or the
<seealso marker="#list_dir_2">list_dir/2</seealso> function. (They
are also available as <c>table</c>.)</p>
@@ -132,7 +134,7 @@ zip_file() </code>
<type>
<v>Name = filename()</v>
<v>FileList = [FileSpec]</v>
- <v>FileSpec = filename() | {filename(), binary()}</v>
+ <v>FileSpec = filename() | {filename(), binary()} | {filename(), binary(), #file_info{}}</v>
<v>Options = [Option]</v>
<v>Option = memory | cooked | verbose | {comment, Comment} | {cwd, CWD} | {compress, What} | {uncompress, What}</v>
<v>What = all | [Extension] | {add, [Extension]} | {del, [Extension]}</v>
@@ -212,16 +214,16 @@ zip_file() </code>
<taglist>
<tag><c>all</c></tag>
<item><p> means that all files will be compressed (as long
- as they pass the <c>uncompress</c> condition).</p></item>
+ as they pass the <c>uncompress</c> condition).</p></item>
<tag><c>[Extension]</c></tag>
<item><p>means that only files with exactly these extensions
- will be compressed.</p></item>
+ will be compressed.</p></item>
<tag><c>{add,[Extension]}</c></tag>
<item><p>adds these extensions to the list of compress
- extensions.</p></item>
+ extensions.</p></item>
<tag><c>{del,[Extension]}</c></tag>
<item><p>deletes these extensions from the list of compress
- extensions.</p></item>
+ extensions.</p></item>
</taglist>
</item>
<tag><c>{uncompress, What}</c></tag>
@@ -231,16 +233,16 @@ zip_file() </code>
The following values of <c>What</c> are allowed:</p>
<taglist>
<tag><c>all</c></tag>
- <item><p> means that no files will be compressed.</p></item>
+ <item><p> means that no files will be compressed.</p></item>
<tag><c>[Extension]</c></tag>
<item><p>means that files with these extensions will be
- uncompressed.</p></item>
+ uncompressed.</p></item>
<tag><c>{add,[Extension]}</c></tag>
<item><p>adds these extensions to the list of uncompress
- extensions.</p></item>
+ extensions.</p></item>
<tag><c>{del,[Extension]}</c></tag>
<item><p>deletes these extensions from the list of uncompress
- extensions.</p></item>
+ extensions.</p></item>
</taglist>
</item>
</taglist>
@@ -283,7 +285,7 @@ zip_file() </code>
the <c>unzip/2</c> function will only extract the files
whose names are included in <c>FileList</c>. The full
paths, including the names of all sub directories within
- the zip archive, must be specified.</p>
+ the zip archive, must be specified.</p>
</item>
<tag><c>cooked</c></tag>
<item>
@@ -327,6 +329,64 @@ zip_file() </code>
</desc>
</func>
<func>
+ <name>foldl(Fun, Acc0, Archive) -> {ok, Acc1} | {error, Reason}</name>
+ <fsummary>Fold a function over all files in a zip archive</fsummary>
+ <type>
+ <v>Fun = fun(FileInArchive, GetInfo, GetBin, AccIn) -> AccOut</v>
+ <v>FileInArchive = filename()</v>
+ <v>GetInfo = fun() -> #file_info{}</v>
+ <v>GetBin = fun() -> binary()</v>
+ <v>Acc0 = Acc1 = AccIn = AccOut = term()</v>
+ <v>Archive = filename() | {filename(), binary()}</v>
+ </type>
+ <desc>
+ <p>The <marker id="foldl_3"></marker> <c>foldl/3</c> function
+ calls <c>Fun(FileInArchive, GetInfo, GetBin, AccIn)</c> on
+ successive files in the <c>Archive</c>, starting with <c>AccIn
+ == Acc0</c>. <c>FileInArchive</c> is the name that the file
+ has in the archive. <c>GetInfo</c> is a fun that returns info
+ about the the file. <c>GetBin</c> returns the contents of the
+ file. Both <c>GetInfo</c> and <c>GetBin</c> must be called
+ within the <c>Fun</c>. Their behavior is undefined if they are
+ called outside the context of the <c>Fun</c>. The <c>Fun</c>
+ must return a new accumulator which is passed to the next
+ call. <c>foldl/3</c> returns the final value of the
+ accumulator. <c>Acc0</c> is returned if the archive is
+ empty. It is not necessary to iterate over all files in the
+ archive. The iteration may be ended prematurely in a
+ controlled manner by throwing an exception.</p>
+
+ <p>For example:</p>
+ <pre>
+&gt; <input>Name = "dummy.zip".</input>
+"dummy.zip"
+&gt; <input>{ok, {Name, Bin}} = zip:create(Name, [{"foo", &lt;&lt;"FOO"&gt;&gt;}, {"bar", &lt;&lt;"BAR"&gt;&gt;}], [memory]).</input>
+{ok,{"dummy.zip",
+ &lt;&lt;80,75,3,4,20,0,0,0,0,0,74,152,97,60,171,39,212,26,3,0,
+ 0,0,3,0,0,...&gt;&gt;}}
+&gt; <input>{ok, FileSpec} = zip:foldl(fun(N, I, B, Acc) -> [{N, B(), I()} | Acc] end, [], {Name, Bin}).</input>
+{ok,[{"bar",&lt;&lt;"BAR"&gt;&gt;,
+ {file_info,3,regular,read_write,
+ {{2010,3,1},{19,2,10}},
+ {{2010,3,1},{19,2,10}},
+ {{2010,3,1},{19,2,10}},
+ 54,1,0,0,0,0,0}},
+ {"foo",&lt;&lt;"FOO"&gt;&gt;,
+ {file_info,3,regular,read_write,
+ {{2010,3,1},{19,2,10}},
+ {{2010,3,1},{19,2,10}},
+ {{2010,3,1},{19,2,10}},
+ 54,1,0,0,0,0,0}}]}
+&gt; <input>{ok, {Name, Bin}} = zip:create(Name, lists:reverse(FileSpec), [memory]).</input>
+{ok,{"dummy.zip",
+ &lt;&lt;80,75,3,4,20,0,0,0,0,0,74,152,97,60,171,39,212,26,3,0,
+ 0,0,3,0,0,...&gt;&gt;}}
+&gt; <input>catch zip:foldl(fun("foo", _, B, _) -> throw(B()); (_, _, _, Acc) -> Acc end, [], {Name, Bin}). </input>
+&lt;&lt;"FOO"&gt;&gt;
+</pre>
+ </desc>
+ </func>
+ <func>
<name>list_dir(Archive) -> RetValue</name>
<name>list_dir(Archive, Options)</name>
<name>table(Archive) -> RetValue</name>
diff --git a/lib/stdlib/src/erl_expand_records.erl b/lib/stdlib/src/erl_expand_records.erl
index 6fa77f2c3b..a38b7639d8 100644
--- a/lib/stdlib/src/erl_expand_records.erl
+++ b/lib/stdlib/src/erl_expand_records.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2005-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%% Purpose : Expand records into tuples.
@@ -191,7 +191,6 @@ guard_test1(Test, St) ->
normalise_test(atom, 1) -> is_atom;
normalise_test(binary, 1) -> is_binary;
-normalise_test(constant, 1) -> is_constant;
normalise_test(float, 1) -> is_float;
normalise_test(function, 1) -> is_function;
normalise_test(integer, 1) -> is_integer;
@@ -346,9 +345,6 @@ expr({'fun',Line,{clauses,Cs0}}, St0) ->
{{'fun',Line,{clauses,Cs}},St1};
expr({call,Line,{atom,_,is_record},[A,{atom,_,Name}]}, St) ->
record_test(Line, A, Name, St);
-expr({'cond',Line,Cs0}, St0) ->
- {Cs,St1} = clauses(Cs0, St0),
- {{'cond',Line,Cs},St1};
expr({call,Line,{remote,_,{atom,_,erlang},{atom,_,is_record}},
[A,{atom,_,Name}]}, St) ->
record_test(Line, A, Name, St);
diff --git a/lib/stdlib/src/erl_lint.erl b/lib/stdlib/src/erl_lint.erl
index 22f435aff8..94ad560549 100644
--- a/lib/stdlib/src/erl_lint.erl
+++ b/lib/stdlib/src/erl_lint.erl
@@ -1940,8 +1940,6 @@ expr({'case',Line,E,Cs}, Vt, St0) ->
{Evt,St1} = expr(E, Vt, St0),
{Cvt,St2} = icrt_clauses(Cs, {'case',Line}, vtupdate(Evt, Vt), St1),
{vtmerge(Evt, Cvt),St2};
-expr({'cond',Line,Cs}, Vt, St) ->
- cond_clauses(Cs,{'cond',Line}, Vt, St);
expr({'receive',Line,Cs}, Vt, St) ->
icrt_clauses(Cs, {'receive',Line}, Vt, St);
expr({'receive',Line,Cs,To,ToEs}, Vt, St0) ->
@@ -2717,45 +2715,6 @@ icrt_clause({clause,_Line,H,G,B}, Vt0, St0) ->
{Bvt,St3} = exprs(B, Vt2, St2),
{vtupdate(Bvt, Vt2),St3}.
-%% The tests of 'cond' clauses are normal expressions - not guards.
-%% Variables bound in a test is visible both in the corresponding body
-%% and in the tests and bodies of subsequent clauses: a 'cond' is
-%% *equivalent* to nested case-switches on boolean expressions.
-
-cond_clauses([C], In, Vt, St) ->
- last_cond_clause(C, In, Vt, St);
-cond_clauses([C | Cs], In, Vt, St) ->
- cond_clause(C, Cs, In, Vt, St).
-
-%% see expr/3 for 'case'
-cond_clause({clause,_L,[],[[E]],B}, Cs, In, Vt, St0) ->
- {Evt,St1} = expr(E, Vt, St0),
- {Cvt, St2} = cond_cases(B, Cs, In, vtupdate(Evt, Vt), St1),
- Mvt = vtmerge(Evt, Cvt),
- {Mvt,St2}.
-
-%% see icrt_clauses/4
-cond_cases(B, Cs, In, Vt, St0) ->
- %% note that Vt is used for both cases
- {Bvt,St1} = exprs(B, Vt, St0), % true case
- Vt1 = vtupdate(Bvt, Vt),
- {Cvt, St2} = cond_clauses(Cs, In, Vt, St1), % false case
- Vt2 = vtupdate(Cvt, Vt),
- %% and this also uses Vt
- icrt_export([Vt1,Vt2], Vt, In, St2).
-
-%% last case must call icrt_export/4 with only one vartable
-last_cond_clause({clause,_L,[],[[E]],B}, In, Vt, St0) ->
- {Evt,St1} = expr(E, Vt, St0),
- {Cvt, St2} = last_cond_case(B, In, vtupdate(Evt, Vt), St1),
- Mvt = vtmerge(Evt, Cvt),
- {Mvt,St2}.
-
-last_cond_case(B, In, Vt, St0) ->
- {Bvt,St1} = exprs(B, Vt, St0),
- Vt1 = vtupdate(Bvt, Vt),
- icrt_export([Vt1], Vt, In, St1).
-
icrt_export(Csvt, Vt, In, St) ->
Vt1 = vtmerge(Csvt),
All = ordsets:subtract(vintersection(Csvt), vtnames(Vt)),
diff --git a/lib/stdlib/src/erl_parse.yrl b/lib/stdlib/src/erl_parse.yrl
index fd5d905797..ea91ec5927 100644
--- a/lib/stdlib/src/erl_parse.yrl
+++ b/lib/stdlib/src/erl_parse.yrl
@@ -1,20 +1,20 @@
%% -*- erlang -*-
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1996-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
@@ -57,7 +57,6 @@ char integer float atom string var
'(' ')' ',' '->' ':-' '{' '}' '[' ']' '|' '||' '<-' ';' ':' '#' '.'
'after' 'begin' 'case' 'try' 'catch' 'end' 'fun' 'if' 'of' 'receive' 'when'
'andalso' 'orelse' 'query' 'spec'
-%% 'cond'
'bnot' 'not'
'*' '/' 'div' 'rem' 'band' 'and'
'+' '-' 'bor' 'bxor' 'bsl' 'bsr' 'or' 'xor'
@@ -422,14 +421,6 @@ try_clause -> var ':' expr clause_guard clause_body :
L = ?line('$1'),
{clause,L,[{tuple,L,['$1','$3',{var,L,'_'}]}],'$4','$5'}.
-%%cond_expr -> 'cond' cond_clauses 'end' : {'cond',?line('$1'),'$2'}.
-
-%%cond_clauses -> cond_clause : ['$1'].
-%%cond_clauses -> cond_clause ';' cond_clauses : ['$1' | '$3'].
-
-%%cond_clause -> expr clause_body :
-%% {clause,?line('$1'),[],[['$1']],'$2'}.
-
query_expr -> 'query' list_comprehension 'end' :
{'query',?line('$1'),'$2'}.
@@ -743,13 +734,29 @@ record_fields([{typed,Expr,TypeInfo}|Fields]) ->
case Expr of
{match, _, _, _} -> TypeInfo; %% If we have an initializer.
{atom, La, _} ->
- lift_unions(abstract(undefined, La), TypeInfo)
+ case has_undefined(TypeInfo) of
+ false ->
+ lift_unions(abstract(undefined, La), TypeInfo);
+ true ->
+ TypeInfo
+ end
end,
[{typed_record_field,Field,TypeInfo1}|record_fields(Fields)];
record_fields([Other|_Fields]) ->
ret_err(?line(Other), "bad record field");
record_fields([]) -> [].
+has_undefined({atom,_,undefined}) ->
+ true;
+has_undefined({ann_type,_,[_,T]}) ->
+ has_undefined(T);
+has_undefined({paren_type,_,[T]}) ->
+ has_undefined(T);
+has_undefined({type,_,union,Ts}) ->
+ lists:any(fun has_undefined/1, Ts);
+has_undefined(_) ->
+ false.
+
term(Expr) ->
try normalise(Expr)
catch _:_R -> ret_err(?line(Expr), "bad attribute")
diff --git a/lib/stdlib/src/escript.erl b/lib/stdlib/src/escript.erl
index 5958a58d7c..d26443f277 100644
--- a/lib/stdlib/src/escript.erl
+++ b/lib/stdlib/src/escript.erl
@@ -19,11 +19,16 @@
-module(escript).
%% Useful functions that can be called from scripts.
--export([script_name/0, foldl/3]).
+-export([script_name/0, create/2, extract/2]).
%% Internal API.
-export([start/0, start/1]).
+-include_lib("kernel/include/file.hrl").
+
+-define(SHEBANG, "/usr/bin/env escript").
+-define(COMMENT, "This is an -*- erlang -*- file").
+
-record(state, {file,
module,
forms_or_bin,
@@ -32,89 +37,223 @@
mode,
exports_main,
has_records}).
-
+-record(sections, {type,
+ shebang,
+ comment,
+ emu_args,
+ body}).
+-record(extract_options, {compile_source}).
+
+-type shebang() :: string().
+-type comment() :: string().
+-type emu_args() :: string().
+-type escript_filename() :: string().
+-type filename() :: string().
+-type zip_file() ::
+ filename()
+ | {filename(), binary()}
+ | {filename(), binary(), #file_info{}}.
+-type zip_create_option() :: term().
+-type section() ::
+ shebang
+ | {shebang, shebang()}
+ | comment
+ | {comment, comment()}
+ | {emu_args, emu_args()}
+ | {source, filename() | binary()}
+ | {beam, filename() | binary()}
+ | {archive, filename() | binary()}
+ | {archive, [zip_file()], [zip_create_option()]}.
+
+%% Create a complete escript file with both header and body
+-spec create(escript_filename() | binary, [section()]) ->
+ ok | {ok, binary()} | {error, term()}.
+
+create(File, Options) when is_list(Options) ->
+ try
+ S = prepare(Options, #sections{}),
+ BinList =
+ [Section || Section <- [S#sections.shebang,
+ S#sections.comment,
+ S#sections.emu_args,
+ S#sections.body],
+ Section =/= undefined],
+ case File of
+ binary ->
+ {ok, list_to_binary(BinList)};
+ _ ->
+ case file:write_file(File, BinList) of
+ ok ->
+ ok;
+ {error, Reason} ->
+ {error, {Reason, File}}
+ end
+ end
+ catch
+ throw:PrepareReason ->
+ {error, PrepareReason}
+ end.
+
+prepare([H | T], S) ->
+ case H of
+ {shebang, undefined} ->
+ prepare(T, S);
+ shebang ->
+ prepare(T, S#sections{shebang = "#!" ++ ?SHEBANG ++ "\n"});
+ {shebang, default} ->
+ prepare(T, S#sections{shebang = "#!" ++ ?SHEBANG ++ "\n"});
+ {shebang, Shebang} when is_list(Shebang) ->
+ prepare(T, S#sections{shebang = "#!" ++ Shebang ++ "\n"});
+ {comment, undefined} ->
+ prepare(T, S);
+ comment ->
+ prepare(T, S#sections{comment = "%% " ++ ?COMMENT ++ "\n"});
+ {comment, default} ->
+ prepare(T, S#sections{comment = "%% " ++ ?COMMENT ++ "\n"});
+ {comment, Comment} when is_list(Comment) ->
+ prepare(T, S#sections{comment = "%% " ++ Comment ++ "\n"});
+ {emu_args, undefined} ->
+ prepare(T, S);
+ {emu_args, Args} when is_list(Args) ->
+ prepare(T, S#sections{emu_args = "%%!" ++ Args ++ "\n"});
+ {Type, File} when is_list(File) ->
+ case file:read_file(File) of
+ {ok, Bin} ->
+ prepare(T, S#sections{type = Type, body = Bin});
+ {error, Reason} ->
+ throw({Reason, H})
+ end;
+ {Type, Bin} when is_binary(Bin) ->
+ prepare(T, S#sections{type = Type, body = Bin});
+ {archive = Type, ZipFiles, ZipOptions}
+ when is_list(ZipFiles), is_list(ZipOptions) ->
+ File = "dummy.zip",
+ case zip:create(File, ZipFiles, ZipOptions ++ [memory]) of
+ {ok, {File, ZipBin}} ->
+ prepare(T, S#sections{type = Type, body = ZipBin});
+ {error, Reason} ->
+ throw({Reason, H})
+ end;
+ _ ->
+ throw({badarg, H})
+ end;
+prepare([], #sections{body = undefined}) ->
+ throw(missing_body);
+prepare([], #sections{type = Type} = S)
+ when Type =:= source; Type =:= beam; Type =:= archive ->
+ S;
+prepare([], #sections{type = Type}) ->
+ throw({illegal_type, Type});
+prepare(BadOptions, _) ->
+ throw({badarg, BadOptions}).
+
+-type section_name() :: shebang | comment | emu_args | body .
+-type extract_option() :: compile_source | {section, [section_name()]}.
+-spec extract(filename(), [extract_option()]) -> {ok, [section()]} | {error, term()}.
+extract(File, Options) when is_list(File), is_list(Options) ->
+ try
+ EO = parse_extract_options(Options,
+ #extract_options{compile_source = false}),
+ {HeaderSz, NextLineNo, Fd, Sections} =
+ parse_header(File, not EO#extract_options.compile_source),
+ Type = Sections#sections.type,
+ case {Type, EO#extract_options.compile_source} of
+ {source, true} ->
+ Bin = compile_source(Type, File, Fd, NextLineNo, HeaderSz);
+ {_, _} ->
+ ok = file:close(Fd),
+ case file:read_file(File) of
+ {ok, <<_Header:HeaderSz/binary, Bin/binary>>} ->
+ ok;
+ {error, ReadReason} ->
+ Bin = get_rid_of_compiler_warning,
+ throw(ReadReason)
+ end
+ end,
+ return_sections(Sections, Bin)
+ catch
+ throw:Reason ->
+ {error, Reason}
+ end.
+
+parse_extract_options([H | T], EO) ->
+ case H of
+ compile_source ->
+ EO2 = EO#extract_options{compile_source = true},
+ parse_extract_options(T, EO2);
+ _ ->
+ throw({badarg, H})
+ end;
+parse_extract_options([], EO) ->
+ EO.
+
+compile_source(Type, File, Fd, NextLineNo, HeaderSz) ->
+ {text, _Module, Forms, _HasRecs, _Mode} =
+ do_parse_file(Type, File, Fd, NextLineNo, HeaderSz, false),
+ ok = file:close(Fd),
+ case compile:forms(Forms, [return_errors, debug_info]) of
+ {ok, _, BeamBin} ->
+ BeamBin;
+ {error, Errors, Warnings} ->
+ throw({compile, [{errors, format_errors(Errors)},
+ {warnings, format_errors(Warnings)}]})
+ end.
+
+format_errors(CompileErrors) ->
+ [lists:flatten([File, ":", integer_to_list(LineNo), ": ",
+ Mod:format_error(Error)]) ||
+ {File, FileErrors} <- CompileErrors,
+ {LineNo, Mod, Error} <- FileErrors].
+
+return_sections(S, Bin) ->
+ {ok, [normalize_section(shebang, S#sections.shebang),
+ normalize_section(comment, S#sections.comment),
+ normalize_section(emu_args, S#sections.emu_args),
+ normalize_section(S#sections.type, Bin)]}.
+
+normalize_section(Name, undefined) ->
+ {Name, undefined};
+normalize_section(shebang, "#!" ++ Chars) ->
+ Chopped = string:strip(Chars, right, $\n),
+ Stripped = string:strip(Chopped, both),
+ if
+ Stripped =:= ?SHEBANG ->
+ {shebang, default};
+ true ->
+ {shebang, Stripped}
+ end;
+normalize_section(comment, Chars) ->
+ Chopped = string:strip(Chars, right, $\n),
+ Stripped = string:strip(string:strip(Chopped, left, $%), both),
+ if
+ Stripped =:= ?COMMENT ->
+ {comment, default};
+ true ->
+ {comment, Stripped}
+ end;
+normalize_section(emu_args, "%%!" ++ Chars) ->
+ Chopped = string:strip(Chars, right, $\n),
+ Stripped = string:strip(Chopped, both),
+ {emu_args, Stripped};
+normalize_section(Name, Chars) ->
+ {Name, Chars}.
+
+-spec script_name() -> string().
script_name() ->
[ScriptName|_] = init:get_plain_arguments(),
ScriptName.
-%% Apply Fun(Name, GetInfo, GetBin, Acc) for each file in the escript.
-%%
-%% Fun/2 must return a new accumulator which is passed to the next call.
-%% The function returns the final value of the accumulator. Acc0 is
-%% returned if the escript contain an empty archive.
-%%
-%% GetInfo/0 is a fun that returns a #file_info{} record for the file.
-%% GetBin/0 is a fun that returns a the contents of the file as a binary.
-%%
-%% An escript may contain erlang code, beam code or an archive:
-%%
-%% archive - the Fun/2 will be applied for each file in the archive
-%% beam - the Fun/2 will be applied once and GetInfo/0 returns the file
-%% info for the (entire) escript file
-%% erl - the Fun/2 will be applied once, GetInfo/0 returns the file
-%% info for the (entire) escript file and the GetBin returns
-%% the compiled beam code
-
-%%-spec foldl(fun((string(),
-%% fun(() -> #file_info()),
-%% fun(() -> binary() -> term()),
-%% term()) -> term()),
-%% term(),
-%% string()).
-foldl(Fun, Acc0, File) when is_function(Fun, 4) ->
- case parse_file(File, false) of
- {text, _, Forms, _HasRecs, _Mode} when is_list(Forms) ->
- GetInfo = fun() -> file:read_file_info(File) end,
- GetBin =
- fun() ->
- case compile:forms(Forms, [return_errors, debug_info]) of
- {ok, _, BeamBin} ->
- BeamBin;
- {error, _Errors, _Warnings} ->
- fatal("There were compilation errors.")
- end
- end,
- try
- {ok, Fun(".", GetInfo, GetBin, Acc0)}
- catch
- throw:Reason ->
- {error, Reason}
- end;
- {beam, _, BeamBin, _HasRecs, _Mode} when is_binary(BeamBin) ->
- GetInfo = fun() -> file:read_file_info(File) end,
- GetBin = fun() -> BeamBin end,
- try
- {ok, Fun(".", GetInfo, GetBin, Acc0)}
- catch
- throw:Reason ->
- {error, Reason}
- end;
- {archive, _, ArchiveBin, _HasRecs, _Mode} when is_binary(ArchiveBin) ->
- ZipFun =
- fun({Name, GetInfo, GetBin}, A) ->
- A2 = Fun(Name, GetInfo, GetBin, A),
- {true, false, A2}
- end,
- case prim_zip:open(ZipFun, Acc0, {File, ArchiveBin}) of
- {ok, PrimZip, Res} ->
- ok = prim_zip:close(PrimZip),
- {ok, Res};
- {error, bad_eocd} ->
- {error, "Not an archive file"};
- {error, Reason} ->
- {error, Reason}
- end
- end.
-
%%
%% Internal API.
%%
+-spec start() -> no_return().
start() ->
start([]).
+-spec start([string()]) -> no_return().
start(EscriptOptions) ->
- try
+ try
%% Commands run using -run or -s are run in a process
%% trap_exit set to false. Because this behaviour is
%% surprising for users of escript, make sure to reset
@@ -143,11 +282,11 @@ parse_and_run(File, Args, Options) ->
parse_file(File, CheckOnly),
Mode2 =
case lists:member("d", Options) of
- true ->
+ true ->
debug;
false ->
case lists:member("c", Options) of
- true ->
+ true ->
compile;
false ->
case lists:member("i", Options) of
@@ -177,7 +316,7 @@ parse_and_run(File, Args, Options) ->
_Other ->
fatal("There were compilation errors.")
end
- end;
+ end;
is_binary(FormsOrBin) ->
case Source of
archive ->
@@ -190,11 +329,13 @@ parse_and_run(File, Args, Options) ->
true ->
my_halt(0);
false ->
- Text = lists:concat(["Function ", Module, ":main/1 is not exported"]),
+ Text = lists:concat(["Function ", Module,
+ ":main/1 is not exported"]),
fatal(Text)
end;
_ ->
- Text = lists:concat(["Cannot load module ", Module, " from archive"]),
+ Text = lists:concat(["Cannot load module ", Module,
+ " from archive"]),
fatal(Text)
end;
ok ->
@@ -212,7 +353,7 @@ parse_and_run(File, Args, Options) ->
run ->
{module, Module} = code:load_binary(Module, File, FormsOrBin),
run(Module, Args);
- debug ->
+ debug ->
[Base | Rest] = lists:reverse(filename:split(File)),
Base2 = filename:basename(Base, code:objfile_extension()),
Rest2 =
@@ -222,8 +363,8 @@ parse_and_run(File, Args, Options) ->
end,
SrcFile = filename:join(lists:reverse([Base2 ++ ".erl" | Rest2])),
debug(Module, {Module, SrcFile, File, FormsOrBin}, Args)
- end
- end
+ end
+ end
end.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -231,25 +372,19 @@ parse_and_run(File, Args, Options) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
parse_file(File, CheckOnly) ->
- S = #state{file = File,
- n_errors = 0,
- mode = interpret,
- exports_main = false,
- has_records = false},
- {ok, Fd} =
- case file:open(File, [read]) of
- {ok, Fd0} ->
- {ok, Fd0};
- {error, R} ->
- fatal(lists:concat([file:format_error(R), ": '", File, "'"]))
- end,
- {HeaderSz, StartLine, ScriptType} = skip_header(Fd, 1),
+ {HeaderSz, NextLineNo, Fd, Sections} =
+ parse_header(File, false),
+ do_parse_file(Sections#sections.type,
+ File, Fd, NextLineNo, HeaderSz, CheckOnly).
+
+do_parse_file(Type, File, Fd, NextLineNo, HeaderSz, CheckOnly) ->
+ S = initial_state(File),
#state{mode = Mode,
source = Source,
module = Module,
forms_or_bin = FormsOrBin,
has_records = HasRecs} =
- case ScriptType of
+ case Type of
archive ->
%% Archive file
ok = file:close(Fd),
@@ -260,51 +395,93 @@ parse_file(File, CheckOnly) ->
parse_beam(S, File, HeaderSz, CheckOnly);
source ->
%% Source code
- parse_source(S, File, Fd, StartLine, HeaderSz, CheckOnly)
+ parse_source(S, File, Fd, NextLineNo, HeaderSz, CheckOnly)
end,
{Source, Module, FormsOrBin, HasRecs, Mode}.
+initial_state(File) ->
+ #state{file = File,
+ n_errors = 0,
+ mode = interpret,
+ exports_main = false,
+ has_records = false}.
+
%% Skip header and make a heuristic guess about the script type
-skip_header(P, LineNo) ->
+parse_header(File, KeepFirst) ->
+ LineNo = 1,
+ {ok, Fd} =
+ case file:open(File, [read]) of
+ {ok, Fd0} ->
+ {ok, Fd0};
+ {error, R} ->
+ fatal(lists:concat([file:format_error(R), ": '", File, "'"]))
+ end,
+
%% Skip shebang on first line
- {ok, HeaderSz0} = file:position(P, cur),
- Line1 = get_line(P),
+ {ok, HeaderSz0} = file:position(Fd, cur),
+ Line1 = get_line(Fd),
case classify_line(Line1) of
shebang ->
- find_first_body_line(P, LineNo);
+ find_first_body_line(Fd, HeaderSz0, LineNo, KeepFirst,
+ #sections{shebang = Line1});
archive ->
- {HeaderSz0, LineNo, archive};
+ {HeaderSz0, LineNo, Fd,
+ #sections{type = archive}};
beam ->
- {HeaderSz0, LineNo, beam};
+ {HeaderSz0, LineNo, Fd,
+ #sections{type = beam}};
_ ->
- find_first_body_line(P, LineNo)
+ find_first_body_line(Fd, HeaderSz0, LineNo, KeepFirst,
+ #sections{})
end.
-find_first_body_line(P, LineNo) ->
- {ok, HeaderSz1} = file:position(P, cur),
+find_first_body_line(Fd, HeaderSz0, LineNo, KeepFirst, Sections) ->
+ {ok, HeaderSz1} = file:position(Fd, cur),
%% Look for special comment on second line
- Line2 = get_line(P),
- {ok, HeaderSz2} = file:position(P, cur),
+ Line2 = get_line(Fd),
+ {ok, HeaderSz2} = file:position(Fd, cur),
case classify_line(Line2) of
emu_args ->
%% Skip special comment on second line
- Line3 = get_line(P),
- {HeaderSz2, LineNo + 2, guess_type(Line3)};
- _ ->
+ Line3 = get_line(Fd),
+ {HeaderSz2, LineNo + 2, Fd,
+ Sections#sections{type = guess_type(Line3),
+ comment = undefined,
+ emu_args = Line2}};
+ Line2Type ->
%% Look for special comment on third line
- Line3 = get_line(P),
- {ok, HeaderSz3} = file:position(P, cur),
- case classify_line(Line3) of
- emu_args ->
+ Line3 = get_line(Fd),
+ {ok, HeaderSz3} = file:position(Fd, cur),
+ Line3Type = classify_line(Line3),
+ if
+ Line3Type =:= emu_args ->
%% Skip special comment on third line
- Line4 = get_line(P),
- {HeaderSz3, LineNo + 3, guess_type(Line4)};
- _ ->
+ Line4 = get_line(Fd),
+ {HeaderSz3, LineNo + 3, Fd,
+ Sections#sections{type = guess_type(Line4),
+ comment = Line2,
+ emu_args = Line3}};
+ Sections#sections.shebang =:= undefined,
+ KeepFirst =:= true ->
+ %% No shebang. Use the entire file
+ {HeaderSz0, LineNo, Fd,
+ Sections#sections{type = guess_type(Line2)}};
+ Sections#sections.shebang =:= undefined ->
+ %% No shebang. Skip the first line
+ {HeaderSz1, LineNo, Fd,
+ Sections#sections{type = guess_type(Line2)}};
+ Line2Type =:= comment ->
+ %% Skip shebang on first line and comment on second
+ {HeaderSz2, LineNo + 2, Fd,
+ Sections#sections{type = guess_type(Line3),
+ comment = Line2}};
+ true ->
%% Just skip shebang on first line
- {HeaderSz1, LineNo + 1, guess_type(Line2)}
+ {HeaderSz1, LineNo + 1, Fd,
+ Sections#sections{type = guess_type(Line2)}}
end
end.
-
+
classify_line(Line) ->
case Line of
[$\#, $\! | _] ->
@@ -313,8 +490,10 @@ classify_line(Line) ->
archive;
[$F, $O, $R, $1 | _] ->
beam;
- [$\%, $\%, $\! | _] ->
+ [$%, $%, $\! | _] ->
emu_args;
+ [$% | _] ->
+ comment;
_ ->
undefined
end.
@@ -336,8 +515,8 @@ get_line(P) ->
parse_archive(S, File, HeaderSz) ->
case file:read_file(File) of
- {ok, <<_FirstLine:HeaderSz/binary, Bin/binary>>} ->
- Mod =
+ {ok, <<_Header:HeaderSz/binary, Bin/binary>>} ->
+ Mod =
case init:get_argument(escript) of
{ok, [["main", M]]} ->
%% Use explicit module name
@@ -345,14 +524,14 @@ parse_archive(S, File, HeaderSz) ->
_ ->
%% Use escript name without extension as module name
RevBase = lists:reverse(filename:basename(File)),
- RevBase2 =
+ RevBase2 =
case lists:dropwhile(fun(X) -> X =/= $. end, RevBase) of
[$. | Rest] -> Rest;
[] -> RevBase
end,
list_to_atom(lists:reverse(RevBase2))
end,
-
+
S#state{source = archive,
mode = run,
module = Mod,
@@ -365,7 +544,7 @@ parse_archive(S, File, HeaderSz) ->
parse_beam(S, File, HeaderSz, CheckOnly) ->
- {ok, <<_FirstLine:HeaderSz/binary, Bin/binary>>} =
+ {ok, <<_Header:HeaderSz/binary, Bin/binary>>} =
file:read_file(File),
case beam_lib:chunks(Bin, [exports]) of
{ok, {Module, [{exports, Exports}]}} ->
@@ -399,7 +578,7 @@ parse_source(S, File, Fd, StartLine, HeaderSz, CheckOnly) ->
{ok, FileForm} = epp:parse_erl_form(Epp),
OptModRes = epp:parse_erl_form(Epp),
S2 = S#state{source = text, module = Module},
- S3 =
+ S3 =
case OptModRes of
{ok, {attribute,_, module, M} = Form} ->
epp_parse_file(Epp, S2#state{module = M}, [Form, FileForm]);
@@ -448,12 +627,12 @@ check_source(S, CheckOnly) ->
pre_def_macros(File) ->
{MegaSecs, Secs, MicroSecs} = erlang:now(),
- Replace = fun(Char) ->
+ Replace = fun(Char) ->
case Char of
$\. -> $\_;
_ -> Char
end
- end,
+ end,
CleanBase = lists:map(Replace, filename:basename(File)),
ModuleStr =
CleanBase ++ "__" ++
@@ -642,8 +821,8 @@ eval_exprs([E|Es], Bs0, Lf, Ef, RBs) ->
eval_exprs(Es, Bs, Lf, Ef, RBs).
format_exception(Class, Reason) ->
- PF = fun(Term, I) ->
- io_lib:format("~." ++ integer_to_list(I) ++ "P", [Term, 50])
+ PF = fun(Term, I) ->
+ io_lib:format("~." ++ integer_to_list(I) ++ "P", [Term, 50])
end,
StackTrace = erlang:get_stacktrace(),
StackFun = fun(M, _F, _A) -> (M =:= erl_eval) or (M =:= ?MODULE) end,
@@ -651,7 +830,7 @@ format_exception(Class, Reason) ->
fatal(Str) ->
throw(Str).
-
+
my_halt(Reason) ->
case process_info(group_leader(), status) of
{_,waiting} ->
@@ -675,7 +854,7 @@ hidden_apply(App, M, F, Args) ->
Arity = length(Args),
Text = io_lib:format("Call to ~w:~w/~w in application ~w failed.\n",
[M, F, Arity, App]),
- fatal(Text);
+ fatal(Text);
Stk ->
erlang:raise(error, undef, Stk)
end
diff --git a/lib/stdlib/src/zip.erl b/lib/stdlib/src/zip.erl
index e76d588cb5..d41aeefa59 100644
--- a/lib/stdlib/src/zip.erl
+++ b/lib/stdlib/src/zip.erl
@@ -20,7 +20,7 @@
%% Basic api
-export([unzip/1, unzip/2, extract/1, extract/2,
- zip/2, zip/3, create/2, create/3,
+ zip/2, zip/3, create/2, create/3, foldl/3,
list_dir/1, list_dir/2, table/1, table/2,
t/1, tt/1]).
@@ -38,7 +38,7 @@
zip_t/1, zip_tt/1,
zip_list_dir/1, zip_list_dir/2,
zip_close/1]).
-
+
%% just for debugging zip server, not documented, not tested, not to be used
-export([zip_get_state/1]).
@@ -82,7 +82,7 @@
-record(openzip_opts, {
output, % output object (fun)
open_opts, % file:open options
- cwd % directory to relate paths to
+ cwd % directory to relate paths to
}).
% openzip record, state for an open zip-file
@@ -93,10 +93,10 @@
input, % archive io object (fun)
output, % output io object (fun)
zlib, % handle to open zlib
- cwd % directory to relate paths to
+ cwd % directory to relate paths to
}).
-% Things that I would like to add to the public record #zip_file,
+% Things that I would like to add to the public record #zip_file,
% but can't as it would make things fail at upgrade.
% Instead we use {#zip_file,#zip_file_extra} internally.
-record(zip_file_extra, {
@@ -278,7 +278,7 @@ file_name_search(Name,Files) ->
[ZFile|_] -> ZFile;
[] -> false
end.
-
+
%% %% add a file to an open archive
%% openzip_add(File, OpenZip) ->
%% case ?CATCH do_openzip_add(File, OpenZip) of
@@ -344,6 +344,25 @@ do_unzip(F, Options) ->
Input(close, In1),
{ok, Files}.
+%% Iterate over all files in a zip archive
+foldl(Fun, Acc0, Archive) when is_function(Fun, 4) ->
+ ZipFun =
+ fun({Name, GetInfo, GetBin}, A) ->
+ A2 = Fun(Name, GetInfo, GetBin, A),
+ {true, false, A2}
+ end,
+ case prim_zip:open(ZipFun, Acc0, Archive) of
+ {ok, PrimZip, Acc1} ->
+ ok = prim_zip:close(PrimZip),
+ {ok, Acc1};
+ {error, bad_eocd} ->
+ {error, "Not an archive file"};
+ {error, Reason} ->
+ {error, Reason}
+ end;
+foldl(_,_, _) ->
+ {error, einval}.
+
%% Create zip archive name F from Files or binaries
%%
%% Accepted options:
@@ -383,7 +402,7 @@ list_dir(F, Options) ->
do_list_dir(F, Options) ->
Opts = get_list_dir_options(F, Options),
- #list_dir_opts{input = Input, open_opts = OpO,
+ #list_dir_opts{input = Input, open_opts = OpO,
raw_iterator = RawIterator} = Opts,
In0 = Input({open, F, OpO}, []),
{Info, In1} = get_central_dir(In0, RawIterator, Input),
@@ -417,7 +436,7 @@ tt(F) when is_record(F, openzip) -> openzip_tt(F);
tt(F) -> t(F, fun raw_long_print_info_etc/5).
-%% option utils
+%% option utils
get_unzip_opt([], Opts) ->
Opts;
get_unzip_opt([verbose | Rest], Opts) ->
@@ -470,7 +489,7 @@ get_zip_opt([{cwd, CWD} | Rest], Opts) ->
get_zip_opt([{comment, C} | Rest], Opts) ->
get_zip_opt(Rest, Opts#zip_opts{comment = C});
get_zip_opt([{compress, Which} = O| Rest], Opts) ->
- Which2 =
+ Which2 =
case Which of
all ->
all;
@@ -485,7 +504,7 @@ get_zip_opt([{compress, Which} = O| Rest], Opts) ->
end,
get_zip_opt(Rest, Opts#zip_opts{compress = Which2});
get_zip_opt([{uncompress, Which} = O| Rest], Opts) ->
- Which2 =
+ Which2 =
case Which of
all ->
all;
@@ -560,16 +579,24 @@ get_openzip_options(Options) ->
get_input(F) when is_binary(F) ->
fun binary_io/2;
get_input(F) when is_list(F) ->
- fun file_io/2.
+ fun file_io/2;
+get_input(_) ->
+ throw(einval).
get_zip_input({F, B}) when is_binary(B), is_list(F) ->
fun binary_io/2;
+get_zip_input({F, B, #file_info{}}) when is_binary(B), is_list(F) ->
+ fun binary_io/2;
+get_zip_input({F, #file_info{}, B}) when is_binary(B), is_list(F) ->
+ fun binary_io/2;
get_zip_input(F) when is_list(F) ->
fun file_io/2;
get_zip_input({files, []}) ->
fun binary_io/2;
get_zip_input({files, [File | _]}) ->
- get_zip_input(File).
+ get_zip_input(File);
+get_zip_input(_) ->
+ throw(einval).
get_list_dir_options(F, Options) ->
Opts = #list_dir_opts{raw_iterator = fun raw_file_info_public/5,
@@ -620,6 +647,8 @@ put_eocd(N, Pos, Sz, Comment, Output, Out0) ->
get_filename({Name, _}, Type) ->
get_filename(Name, Type);
+get_filename({Name, _, _}, Type) ->
+ get_filename(Name, Type);
get_filename(Name, regular) ->
Name;
get_filename(Name, directory) ->
@@ -895,7 +924,7 @@ local_file_header_to_bin(
CompSize:32/little,
UncompSize:32/little,
FileNameLength:16/little,
- ExtraFieldLength:16/little>>.
+ ExtraFieldLength:16/little>>.
eocd_to_bin(#eocd{disk_num = DiskNum,
start_disk_num = StartDiskNum,
@@ -912,7 +941,7 @@ eocd_to_bin(#eocd{disk_num = DiskNum,
Offset:32/little,
ZipCommentLength:16/little>>.
-%% put together a local file header
+%% put together a local file header
local_file_header_from_info_method_name(#file_info{mtime = MTime},
UncompSize,
CompMethod, Name) ->
@@ -939,7 +968,7 @@ server_loop(OpenZip) ->
server_loop(NewOpenZip);
Error ->
From ! {self(), Error}
- end;
+ end;
{From, close} ->
From ! {self(), openzip_close(OpenZip)};
{From, get} ->
@@ -1024,7 +1053,7 @@ lists_foreach(F, [Hd|Tl]) ->
F(Hd),
lists_foreach(F, Tl).
-%% option utils
+%% option utils
get_openzip_opt([], Opts) ->
Opts;
get_openzip_opt([cooked | Rest], #openzip_opts{open_opts = OO} = Opts) ->
@@ -1121,7 +1150,7 @@ raw_file_info_public(CD, FileName, FileComment, BExtraField, Acc0) ->
Other -> Other
end,
[H2|T].
-
+
%% make a file_info from a central directory header
cd_file_header_to_file_info(FileName,
@@ -1213,8 +1242,8 @@ get_z_file(In0, Z, Input, Output, OpO, FB, CWD, {ZipFile,Extra}) ->
{dir, In3};
_ ->
%% FileInfo = local_file_header_to_file_info(LH)
- %%{Out, In4, CRC, UncompSize} =
- {Out, In4, CRC, _UncompSize} =
+ %%{Out, In4, CRC, UncompSize} =
+ {Out, In4, CRC, _UncompSize} =
get_z_data(CompMethod, In3, FileName1,
CompSize, Input, Output, OpO, Z),
In5 = skip_z_data_descriptor(GPFlag, Input, In4),
@@ -1280,7 +1309,7 @@ get_z_data_loop(CompSize, UncompSize, In0, Out0, Input, Output, Z) ->
Out1 = Output({write, Uncompressed}, Out0),
get_z_data_loop(CompSize-N, UncompSize + iolist_size(Uncompressed),
In1, Out1, Input, Output, Z)
- end.
+ end.
%% skip data descriptor if any
@@ -1298,7 +1327,7 @@ dos_date_time_to_datetime(DosDate, DosTime) ->
<<Hour:5, Min:6, Sec:5>> = <<DosTime:16>>,
<<YearFrom1980:7, Month:4, Day:5>> = <<DosDate:16>>,
{{YearFrom1980+1980, Month, Day},
- {Hour, Min, Sec}}.
+ {Hour, Min, Sec}}.
dos_date_time_from_datetime({{Year, Month, Day}, {Hour, Min, Sec}}) ->
YearFrom1980 = Year-1980,
@@ -1319,7 +1348,6 @@ unix_extra_field_and_var_from_bin(<<TSize:16/little,
Var};
unix_extra_field_and_var_from_bin(_) ->
throw(bad_unix_extra_field).
-
%% A pwrite-like function for iolists (used by memory-option)
@@ -1478,6 +1506,8 @@ local_file_header_from_bin(_) ->
%% io functions
binary_io({file_info, {_Filename, _B, #file_info{} = FI}}, _A) ->
FI;
+binary_io({file_info, {_Filename, #file_info{} = FI, _B}}, _A) ->
+ FI;
binary_io({file_info, {_Filename, B}}, A) ->
binary_io({file_info, B}, A);
binary_io({file_info, B}, _) ->
@@ -1493,9 +1523,11 @@ binary_io({file_info, B}, _) ->
links = 1, major_device = 0,
minor_device = 0, inode = 0,
uid = 0, gid = 0};
-binary_io({open, {_Filename, B, _FI}, _Opts}, _) ->
+binary_io({open, {_Filename, B, _FI}, _Opts}, _) when is_binary(B) ->
+ {0, B};
+binary_io({open, {_Filename, _FI, B}, _Opts}, _) when is_binary(B) ->
{0, B};
-binary_io({open, {_Filename, B}, _Opts}, _) ->
+binary_io({open, {_Filename, B}, _Opts}, _) when is_binary(B) ->
{0, B};
binary_io({open, B, _Opts}, _) when is_binary(B) ->
{0, B};
diff --git a/lib/stdlib/test/erl_pp_SUITE.erl b/lib/stdlib/test/erl_pp_SUITE.erl
index a695374908..92a54108aa 100644
--- a/lib/stdlib/test/erl_pp_SUITE.erl
+++ b/lib/stdlib/test/erl_pp_SUITE.erl
@@ -46,7 +46,7 @@
neg_indent/1,
tickets/1,
otp_6321/1, otp_6911/1, otp_6914/1, otp_8150/1, otp_8238/1,
- otp_8473/1]).
+ otp_8473/1, otp_8522/1]).
%% Internal export.
-export([ehook/6]).
@@ -764,7 +764,7 @@ neg_indent(Config) when is_list(Config) ->
ok.
tickets(suite) ->
- [otp_6321, otp_6911, otp_6914, otp_8150, otp_8238, otp_8473].
+ [otp_6321, otp_6911, otp_6914, otp_8150, otp_8238, otp_8473, otp_8522].
otp_6321(doc) ->
"OTP_6321. Bug fix of exprs().";
@@ -847,7 +847,7 @@ type_examples() ->
{ex4,<<"-type t1() :: atom(). ">>},
{ex5,<<"-type t2() :: [t1()]. ">>},
{ex6,<<"-type t3(Atom) :: integer(Atom). ">>},
- {ex7,<<"-type t4() :: t3(foobar). ">>},
+ {ex7,<<"-type '\\'t::4'() :: t3('\\'foobar'). ">>},
{ex8,<<"-type t5() :: {t1(), t3(foo)}. ">>},
{ex9,<<"-type t6() :: 1 | 2 | 3 | 'foo' | 'bar'. ">>},
{ex10,<<"-type t7() :: []. ">>},
@@ -883,16 +883,16 @@ type_examples() ->
"1|2|3|4|a|b|c|d| "
"nonempty_maybe_improper_list(integer, any())]}. ">>},
{ex30,<<"-type t99() ::"
- "{t2(),t4(),t5(),t6(),t7(),t8(),t10(),t14(),"
+ "{t2(),'\\'t::4'(),t5(),t6(),t7(),t8(),t10(),t14(),"
"t15(),t20(),t21(), t22(),t25()}. ">>},
{ex31,<<"-spec t1(FooBar :: t99()) -> t99();"
"(t2()) -> t2();"
- "(t4()) -> t4() when is_subtype(t4(), t24);"
+ "('\\'t::4'()) -> '\\'t::4'() when is_subtype('\\'t::4'(), t24);"
"(t23()) -> t23() when is_subtype(t23(), atom()),"
" is_subtype(t23(), t14());"
"(t24()) -> t24() when is_subtype(t24(), atom()),"
" is_subtype(t24(), t14()),"
- " is_subtype(t24(), t4()).">>},
+ " is_subtype(t24(), '\\'t::4'()).">>},
{ex32,<<"-spec mod:t2() -> any(). ">>},
{ex33,<<"-opaque attributes_data() :: "
"[{'column', column()} | {'line', info_line()} |"
@@ -922,6 +922,33 @@ otp_8473(Config) when is_list(Config) ->
{N,B} <- Ex],
ok.
+otp_8522(doc) ->
+ "OTP_8522. Avoid duplicated 'undefined' in record field types.";
+otp_8522(suite) -> [];
+otp_8522(Config) when is_list(Config) ->
+ FileName = filename('otp_8522.erl', Config),
+ C = <<"-module(otp_8522).\n"
+ "-record(r, {f1 :: undefined,\n"
+ " f2 :: A :: undefined,\n"
+ " f3 :: (undefined),\n"
+ " f4 :: x | y | undefined | z,\n"
+ " f5 :: a}).\n">>,
+ ?line ok = file:write_file(FileName, C),
+ ?line {ok, _} = compile:file(FileName, [{outdir,?privdir},debug_info]),
+ BF = filename("otp_8522", Config),
+ ?line {ok, A} = beam_lib:chunks(BF, [abstract_code]),
+ ?line 5 = count_atom(A, undefined),
+ ok.
+
+count_atom(A, A) ->
+ 1;
+count_atom(T, A) when is_tuple(T) ->
+ count_atom(tuple_to_list(T), A);
+count_atom(L, A) when is_list(L) ->
+ lists:sum([count_atom(T, A) || T <- L]);
+count_atom(_, _) ->
+ 0.
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
compile(Config, Tests) ->
diff --git a/lib/stdlib/test/escript_SUITE.erl b/lib/stdlib/test/escript_SUITE.erl
index f36ae34633..77fd190e45 100644
--- a/lib/stdlib/test/escript_SUITE.erl
+++ b/lib/stdlib/test/escript_SUITE.erl
@@ -22,16 +22,20 @@
init_per_testcase/2,
fin_per_testcase/2,
basic/1,
- errors/1,
+ errors/1,
strange_name/1,
emulator_flags/1,
module_script/1,
beam_script/1,
archive_script/1,
- epp/1
+ epp/1,
+ create_and_extract/1,
+ foldl/1,
+ verify_sections/3
]).
-include("test_server.hrl").
+-include_lib("kernel/include/file.hrl").
all(suite) ->
[
@@ -42,7 +46,9 @@ all(suite) ->
module_script,
beam_script,
archive_script,
- epp
+ epp,
+ create_and_extract,
+ foldl
].
init_per_testcase(_Case, Config) ->
@@ -68,11 +74,11 @@ basic(Config) when is_list(Config) ->
?line run(Dir, "factorial_warning 20",
[data_dir,<<"factorial_warning:12: Warning: function bar/0 is unused\n"
"factorial 20 = 2432902008176640000\nExitCode:0">>]),
- ?line run(Dir, "-s", "factorial_warning",
+ ?line run_with_opts(Dir, "-s", "factorial_warning",
[data_dir,<<"factorial_warning:12: Warning: function bar/0 is unused\nExitCode:0">>]),
- ?line run(Dir, "-s -i", "factorial_warning",
+ ?line run_with_opts(Dir, "-s -i", "factorial_warning",
[data_dir,<<"factorial_warning:12: Warning: function bar/0 is unused\nExitCode:0">>]),
- ?line run(Dir, "-c -s", "factorial_warning",
+ ?line run_with_opts(Dir, "-c -s", "factorial_warning",
[data_dir,<<"factorial_warning:12: Warning: function bar/0 is unused\nExitCode:0">>]),
?line run(Dir, "filesize "++filename:join(?config(data_dir, Config),"filesize"),
[data_dir,<<"filesize:11: Warning: function id/1 is unused\n324\nExitCode:0">>]),
@@ -100,7 +106,7 @@ errors(Config) when is_list(Config) ->
[data_dir,<<"lint_error:6: function main/1 already defined\n">>,
data_dir,"lint_error:8: variable 'ExitCode' is unbound\n",
<<"escript: There were compilation errors.\nExitCode:127">>]),
- ?line run(Dir, "-s", "lint_error",
+ ?line run_with_opts(Dir, "-s", "lint_error",
[data_dir,<<"lint_error:6: function main/1 already defined\n">>,
data_dir,"lint_error:8: variable 'ExitCode' is unbound\n",
<<"escript: There were compilation errors.\nExitCode:127">>]),
@@ -140,31 +146,31 @@ module_script(Config) when is_list(Config) ->
OrigFile = filename:join([Data,"emulator_flags"]),
{ok, OrigBin} = file:read_file(OrigFile),
?line [Shebang, Mode, Flags | Source] = string:tokens(binary_to_list(OrigBin), "\n"),
- ?line {ok, OrigFI} = file:read_file_info(OrigFile),
+ ?line {ok, OrigFI} = file:read_file_info(OrigFile),
%% Write source file
Priv = ?config(priv_dir, Config),
Dir = filename:absname(Priv), % Get rid of trailing slash.
Base = "module_script",
ErlFile = filename:join([Priv, Base ++ ".erl"]),
- ErlCode = ["-module(", Base, ").\n",
+ ErlCode = ["\n-module(", Base, ").\n",
"-export([main/1]).\n\n",
string:join(Source, "\n"),
"\n"],
?line ok = file:write_file(ErlFile, ErlCode),
-
+
%%%%%%%
%% Create and run scripts without emulator flags
%% With shebang
NoArgsBase = Base ++ "_no_args_with_shebang",
NoArgsFile = filename:join([Priv, NoArgsBase]),
- ?line ok = file:write_file(NoArgsFile,
+ ?line ok = file:write_file(NoArgsFile,
[Shebang, "\n",
ErlCode]),
?line ok = file:write_file_info(NoArgsFile, OrigFI),
-
- ?line run(Dir, NoArgsBase ++ " -arg1 arg2 arg3",
+
+ ?line run(Dir, NoArgsBase ++ " -arg1 arg2 arg3",
[<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
"nostick:[]\n"
"mnesia:[]\n"
@@ -172,7 +178,7 @@ module_script(Config) when is_list(Config) ->
"unknown:[]\n"
"ExitCode:0">>]),
- ?line run(Dir, "", NoArgsBase ++ " -arg1 arg2 arg3",
+ ?line run_with_opts(Dir, "", NoArgsBase ++ " -arg1 arg2 arg3",
[<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
"nostick:[]\n"
"mnesia:[]\n"
@@ -183,33 +189,33 @@ module_script(Config) when is_list(Config) ->
%% Without shebang
NoArgsBase2 = Base ++ "_no_args_without_shebang",
NoArgsFile2 = filename:join([Priv, NoArgsBase2]),
- ?line ok = file:write_file(NoArgsFile2,
+ ?line ok = file:write_file(NoArgsFile2,
["Something else than shebang!!!", "\n",
ErlCode]),
?line ok = file:write_file_info(NoArgsFile2, OrigFI),
-
- ?line run(Dir, "", NoArgsBase2 ++ " -arg1 arg2 arg3",
+
+ ?line run_with_opts(Dir, "", NoArgsBase2 ++ " -arg1 arg2 arg3",
[<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
"nostick:[]\n"
"mnesia:[]\n"
"ERL_FLAGS=false\n"
"unknown:[]\n"
"ExitCode:0">>]),
-
+
%% Plain module without header
NoArgsBase3 = Base ++ "_no_args_without_header",
NoArgsFile3 = filename:join([Priv, NoArgsBase3]),
?line ok = file:write_file(NoArgsFile3, [ErlCode]),
?line ok = file:write_file_info(NoArgsFile3, OrigFI),
-
- ?line run(Dir, "", NoArgsBase3 ++ " -arg1 arg2 arg3",
+
+ ?line run_with_opts(Dir, "", NoArgsBase3 ++ " -arg1 arg2 arg3",
[<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
"nostick:[]\n"
"mnesia:[]\n"
"ERL_FLAGS=false\n"
"unknown:[]\n"
"ExitCode:0">>]),
-
+
%%%%%%%
%% Create and run scripts with emulator flags
@@ -217,12 +223,12 @@ module_script(Config) when is_list(Config) ->
ArgsBase = Base ++ "_args_with_shebang",
ArgsFile = filename:join([Priv, ArgsBase]),
?line ok = file:write_file(ArgsFile,
- [Shebang, "\n",
+ [Shebang, "\n",
Mode, "\n",
Flags, "\n",
ErlCode]),
- ?line ok = file:write_file_info(ArgsFile, OrigFI),
-
+ ?line ok = file:write_file_info(ArgsFile, OrigFI),
+
?line run(Dir, ArgsBase ++ " -arg1 arg2 arg3",
[<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
"nostick:[{nostick,[]}]\n"
@@ -242,32 +248,32 @@ beam_script(Config) when is_list(Config) ->
OrigFile = filename:join([Data,"emulator_flags"]),
{ok, OrigBin} = file:read_file(OrigFile),
?line [Shebang, Mode, Flags | Source] = string:tokens(binary_to_list(OrigBin), "\n"),
- ?line {ok, OrigFI} = file:read_file_info(OrigFile),
+ ?line {ok, OrigFI} = file:read_file_info(OrigFile),
%% Write source file
Priv = ?config(priv_dir, Config),
Dir = filename:absname(Priv), % Get rid of trailing slash.
Base = "beam_script",
ErlFile = filename:join([Priv, Base ++ ".erl"]),
- ?line ok = file:write_file(ErlFile,
- ["-module(", Base, ").\n",
+ ?line ok = file:write_file(ErlFile,
+ ["\n-module(", Base, ").\n",
"-export([main/1]).\n\n",
string:join(Source, "\n"),
"\n"]),
%% Compile the code
?line {ok, _Mod, BeamCode} = compile:file(ErlFile, [binary]),
-
+
%%%%%%%
%% Create and run scripts without emulator flags
%% With shebang
NoArgsBase = Base ++ "_no_args_with_shebang",
NoArgsFile = filename:join([Priv, NoArgsBase]),
- ?line ok = file:write_file(NoArgsFile,
+ ?line ok = file:write_file(NoArgsFile,
[Shebang, "\n",
BeamCode]),
- ?line ok = file:write_file_info(NoArgsFile, OrigFI),
+ ?line ok = file:write_file_info(NoArgsFile, OrigFI),
?line run(Dir, NoArgsBase ++ " -arg1 arg2 arg3",
[<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
@@ -277,7 +283,7 @@ beam_script(Config) when is_list(Config) ->
"unknown:[]\n"
"ExitCode:0">>]),
- ?line run(Dir, "", NoArgsBase ++ " -arg1 arg2 arg3",
+ ?line run_with_opts(Dir, "", NoArgsBase ++ " -arg1 arg2 arg3",
[<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
"nostick:[]\n"
"mnesia:[]\n"
@@ -288,12 +294,12 @@ beam_script(Config) when is_list(Config) ->
%% Without shebang
NoArgsBase2 = Base ++ "_no_args_without_shebang",
NoArgsFile2 = filename:join([Priv, NoArgsBase2]),
- ?line ok = file:write_file(NoArgsFile2,
+ ?line ok = file:write_file(NoArgsFile2,
["Something else than shebang!!!", "\n",
BeamCode]),
- ?line ok = file:write_file_info(NoArgsFile2, OrigFI),
+ ?line ok = file:write_file_info(NoArgsFile2, OrigFI),
- ?line run(Dir, "", NoArgsBase2 ++ " -arg1 arg2 arg3",
+ ?line run_with_opts(Dir, "", NoArgsBase2 ++ " -arg1 arg2 arg3",
[<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
"nostick:[]\n"
"mnesia:[]\n"
@@ -305,9 +311,9 @@ beam_script(Config) when is_list(Config) ->
NoArgsBase3 = Base ++ "_no_args_without_header",
NoArgsFile3 = filename:join([Priv, NoArgsBase3]),
?line ok = file:write_file(NoArgsFile3, [BeamCode]),
- ?line ok = file:write_file_info(NoArgsFile3, OrigFI),
+ ?line ok = file:write_file_info(NoArgsFile3, OrigFI),
- ?line run(Dir, "", NoArgsBase3 ++ " -arg1 arg2 arg3",
+ ?line run_with_opts(Dir, "", NoArgsBase3 ++ " -arg1 arg2 arg3",
[<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
"nostick:[]\n"
"mnesia:[]\n"
@@ -322,12 +328,12 @@ beam_script(Config) when is_list(Config) ->
ArgsBase = Base ++ "_args",
ArgsFile = filename:join([Priv, ArgsBase]),
?line ok = file:write_file(ArgsFile,
- [Shebang, "\n",
+ [Shebang, "\n",
Mode, "\n",
Flags, "\n",
BeamCode]),
- ?line ok = file:write_file_info(ArgsFile, OrigFI),
-
+ ?line ok = file:write_file_info(ArgsFile, OrigFI),
+
?line run(Dir, ArgsBase ++ " -arg1 arg2 arg3",
[<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
"nostick:[{nostick,[]}]\n"
@@ -356,13 +362,13 @@ archive_script(Config) when is_list(Config) ->
?line ok = compile_app(TopDir, "archive_script_dict"),
?line ok = compile_app(TopDir, "archive_script_dummy"),
?line {ok, MainFiles} = file:list_dir(TopDir),
- ?line ok = compile_files(MainFiles, TopDir, TopDir),
-
+ ?line ok = compile_files(MainFiles, TopDir, TopDir),
+
%% Create the archive
{ok, TopFiles} = file:list_dir(TopDir),
?line {ok, {_, ArchiveBin}} = zip:create(Archive, TopFiles,
[memory, {compress, []}, {cwd, TopDir}]),
-
+
%% Read the source script
OrigFile = filename:join([DataDir, "emulator_flags"]),
{ok, OrigBin} = file:read_file(OrigFile),
@@ -371,73 +377,73 @@ archive_script(Config) when is_list(Config) ->
Flags = "%%! -archive_script_dict foo bar"
" -archive_script_dict foo"
" -archive_script_dummy bar",
- ?line {ok, OrigFI} = file:read_file_info(OrigFile),
-
+ ?line {ok, OrigFI} = file:read_file_info(OrigFile),
+
%%%%%%%
%% Create and run scripts without emulator flags
- MainBase = "archive_script_main",
- MainScript = filename:join([PrivDir, MainBase]),
+ MainBase = "archive_script_main",
+ MainScript = filename:join([PrivDir, MainBase]),
%% With shebang
- ?line ok = file:write_file(MainScript,
+ ?line ok = file:write_file(MainScript,
[Shebang, "\n",
Flags, "\n",
ArchiveBin]),
- ?line ok = file:write_file_info(MainScript, OrigFI),
-
+ ?line ok = file:write_file_info(MainScript, OrigFI),
+
?line run(PrivDir, MainBase ++ " -arg1 arg2 arg3",
- [<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
+ [<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
"dict:[{archive_script_dict,[\"foo\",\"bar\"]},{archive_script_dict,[\"foo\"]}]\n"
"dummy:[{archive_script_dummy,[\"bar\"]}]\n"
"priv:{ok,<<\"Some private data...\\n\">>}\n"
"ExitCode:0">>]),
- ?line run(PrivDir, "", MainBase ++ " -arg1 arg2 arg3",
- [<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
+ ?line run_with_opts(PrivDir, "", MainBase ++ " -arg1 arg2 arg3",
+ [<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
"dict:[{archive_script_dict,[\"foo\",\"bar\"]},{archive_script_dict,[\"foo\"]}]\n"
"dummy:[{archive_script_dummy,[\"bar\"]}]\n"
"priv:{ok,<<\"Some private data...\\n\">>}\n"
"ExitCode:0">>]),
-
+
?line ok = file:rename(MainScript, MainScript ++ "_with_shebang"),
%% Without shebang (no flags)
- ?line ok = file:write_file(MainScript,
+ ?line ok = file:write_file(MainScript,
["Something else than shebang!!!", "\n",
ArchiveBin]),
- ?line ok = file:write_file_info(MainScript, OrigFI),
-
- ?line run(PrivDir, "", MainBase ++ " -arg1 arg2 arg3",
- [<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
+ ?line ok = file:write_file_info(MainScript, OrigFI),
+
+ ?line run_with_opts(PrivDir, "", MainBase ++ " -arg1 arg2 arg3",
+ [<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
"dict:[]\n"
"dummy:[]\n"
"priv:{ok,<<\"Some private data...\\n\">>}\n"
"ExitCode:0">>]),
?line ok = file:rename(MainScript, MainScript ++ "_without_shebang"),
-
+
%% Plain archive without header (no flags)
-
+
?line ok = file:write_file(MainScript, [ArchiveBin]),
- ?line ok = file:write_file_info(MainScript, OrigFI),
-
- ?line run(PrivDir, "", MainBase ++ " -arg1 arg2 arg3",
- [<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
+ ?line ok = file:write_file_info(MainScript, OrigFI),
+
+ ?line run_with_opts(PrivDir, "", MainBase ++ " -arg1 arg2 arg3",
+ [<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
"dict:[]\n"
"dummy:[]\n"
"priv:{ok,<<\"Some private data...\\n\">>}\n"
"ExitCode:0">>]),
?line ok = file:rename(MainScript, MainScript ++ "_without_header"),
-
+
%%%%%%%
%% Create and run scripts with emulator flags
AltBase = "archive_script_alternate_main",
AltScript = filename:join([PrivDir, AltBase]),
- ?line ok = file:write_file(AltScript,
+ ?line ok = file:write_file(AltScript,
[Shebang, "\n",
Mode, "\n",
Flags, " -escript main archive_script_main2\n",
ArchiveBin]),
- ?line ok = file:write_file_info(AltScript, OrigFI),
+ ?line ok = file:write_file_info(AltScript, OrigFI),
?line run(PrivDir, AltBase ++ " -arg1 arg2 arg3",
[<<"main2:[\"-arg1\",\"arg2\",\"arg3\"]\n"
@@ -445,7 +451,7 @@ archive_script(Config) when is_list(Config) ->
"dummy:[{archive_script_dummy,[\"bar\"]}]\n"
"priv:{ok,<<\"Some private data...\\n\">>}\n"
"ExitCode:0">>]),
-
+
ok.
compile_app(TopDir, AppName) ->
@@ -482,6 +488,254 @@ epp(Config) when is_list(Config) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+create_and_extract(Config) when is_list(Config) ->
+ {NewFile, FileInfo,
+ EmuArg, Source,
+ _ErlBase, ErlCode,
+ _BeamBase, BeamCode,
+ ArchiveBin} =
+ prepare_creation("create_and_extract", Config),
+
+ Bodies =
+ [[{source, ErlCode}],
+ [{beam, BeamCode}],
+ [{archive, ArchiveBin}]],
+
+ %% Verify all combinations of scripts with shebangs
+ [verify_sections(NewFile, FileInfo, S ++ C ++ E ++ B) ||
+ S <- [[{shebang, default}],
+ [{shebang, "/usr/bin/env escript"}]],
+ C <- [[],
+ [{comment, undefined}],
+ [{comment, default}],
+ [{comment, "This is a nonsense comment"}]],
+ E <- [[],
+ [{emu_args, undefined}],
+ [{emu_args, EmuArg}]],
+ B <- [[{source, Source}] | Bodies]],
+
+ %% Verify all combinations of scripts without shebangs
+ [verify_sections(NewFile, FileInfo, S ++ C ++ E ++ B) ||
+ S <- [[], [{shebang, undefined}]],
+ C <- [[], [{comment, undefined}]],
+ E <- [[], [{emu_args, undefined}]],
+ B <- Bodies],
+
+ %% Verify the compile_source option
+ file:delete(NewFile),
+ ?line ok = escript:create(NewFile, [{source, Source}]),
+ ?line {ok, [_, _, _, {source, Source}]} = escript:extract(NewFile, []),
+ ?line {ok, [_, _, _, {source, BeamCode2}]} =
+ escript:extract(NewFile, [compile_source]),
+ verify_sections(NewFile, FileInfo,
+ [{shebang, default},
+ {comment, default},
+ {beam, BeamCode2}]),
+
+ file:delete(NewFile),
+ ok.
+
+prepare_creation(Base, Config) ->
+ %% Read the source
+ PrivDir = ?config(priv_dir, Config),
+ DataDir = ?config(data_dir, Config),
+ OrigFile = filename:join([DataDir,"emulator_flags"]),
+ ?line {ok, FileInfo} = file:read_file_info(OrigFile),
+ NewFile = filename:join([PrivDir, Base]),
+ ?line {ok, [{shebang, default},
+ {comment, _},
+ {emu_args, EmuArg},
+ {source, Source}]} =
+ escript:extract(OrigFile, []),
+
+ %% Compile the code
+ ErlFile = NewFile ++ ".erl",
+ ErlCode = list_to_binary(["\n-module(", Base, ").\n",
+ "-export([main/1]).\n\n",
+ Source, "\n\n"]),
+ ?line ok = file:write_file(ErlFile, ErlCode),
+
+ %% Compile the code
+ ?line {ok, _Mod, BeamCode} =
+ compile:file(ErlFile, [binary, debug_info]),
+
+ %% Create an archive
+ ?line {ok, {_, ArchiveBin}} =
+ zip:create("dummy_archive_name",
+ [{Base ++ ".erl", ErlCode},
+ {Base ++ ".beam", BeamCode}],
+ [{compress, []}, memory]),
+ {NewFile, FileInfo,
+ EmuArg, Source,
+ Base ++ ".erl", ErlCode,
+ Base ++ ".beam", BeamCode,
+ ArchiveBin}.
+
+verify_sections(File, FileInfo, Sections) ->
+ io:format("~p:verify_sections(\n\t~p,\n\t~p,\n\t~p).\n",
+ [?MODULE, File, FileInfo, Sections]),
+
+ %% Create
+ file:delete(File),
+ ?line ok = escript:create(File, Sections),
+ ?line ok = file:write_file_info(File, FileInfo),
+
+ %% Run
+ Dir = filename:absname(filename:dirname(File)),
+ Base = filename:basename(File),
+
+ HasArg = fun(Tag) ->
+ case lists:keysearch(Tag, 1, Sections) of
+ false -> false;
+ {value, {_, undefined}} -> false;
+ {value, _} -> true
+ end
+ end,
+ ExpectedMain = <<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n">>,
+ ExpectedOutput =
+ case HasArg(emu_args) of
+ true ->
+ <<"nostick:[{nostick,[]}]\n"
+ "mnesia:[{mnesia,[\"dir\",\"a/directory\"]},{mnesia,[\"debug\",\"verbose\"]}]\n"
+ "ERL_FLAGS=false\n"
+ "unknown:[]\n"
+ "ExitCode:0">>;
+ false ->
+ <<"nostick:[]\nmnesia:[]\nERL_FLAGS=false\nunknown:[]\nExitCode:0">>
+ end,
+
+ InputArgs = Base ++ " -arg1 arg2 arg3",
+ Expected = <<ExpectedMain/binary, ExpectedOutput/binary>>,
+ case HasArg(shebang) of
+ true ->
+ ?line run(Dir, InputArgs, [Expected]);
+ false ->
+ ?line run_with_opts(Dir, [], InputArgs, [Expected])
+ end,
+
+ %% Verify
+ ?line {ok, Bin} = escript:create(binary, Sections),
+ ?line {ok, Read} = file:read_file(File),
+ ?line Bin = Read, % Assert
+
+ Normalized = normalize_sections(Sections),
+ ?line {ok, Extracted} = escript:extract(File, []),
+ io:format("Normalized; ~p\n", [Normalized]),
+ io:format("Extracted ; ~p\n", [Extracted]),
+ ?line Normalized = Extracted, % Assert
+ ok.
+
+normalize_sections(Sections) ->
+ AtomToTuple =
+ fun(Val) ->
+ if
+ is_atom(Val) -> {Val, default};
+ true -> Val
+ end
+ end,
+ case lists:map(AtomToTuple, [{K, V} || {K, V} <- Sections, V =/= undefined]) of
+ [{shebang, Shebang} | Rest] ->
+ [{shebang, Shebang} |
+ case Rest of
+ [{comment, Comment} | Rest2] ->
+ [{comment, Comment} |
+ case Rest2 of
+ [{emu_args, EmuArgs}, Body] ->
+ [{emu_args, EmuArgs}, Body];
+ [Body] ->
+ [{emu_args, undefined}, Body]
+ end
+ ];
+ [{emu_args, EmuArgs}, Body] ->
+ [{comment, undefined}, {emu_args, EmuArgs}, Body];
+ [Body] ->
+ [{comment, undefined}, {emu_args, undefined}, Body]
+ end
+ ];
+ [Body] ->
+ [{shebang, undefined}, {comment, undefined}, {emu_args, undefined}, Body]
+ end.
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+foldl(Config) when is_list(Config) ->
+ {NewFile, _FileInfo,
+ _EmuArg, _Source,
+ ErlBase, ErlCode,
+ BeamBase, _BeamCode,
+ ArchiveBin} =
+ prepare_creation("foldl", Config),
+
+ Collect = fun(Name, GetInfo, GetBin, Acc) ->
+ [{Name, GetInfo(), GetBin()} | Acc]
+ end,
+
+ %% Get line numbers and the file attribute right
+ SourceFile = NewFile ++ ".erl",
+ <<_:1/binary, ErlCode2/binary>> = ErlCode,
+ ?line ok = file:write_file(SourceFile, ErlCode2),
+ ?line {ok, _Mod, BeamCode} =
+ compile:file(SourceFile, [binary, debug_info]),
+
+ %% Verify source script
+ ?line ok = escript:create(SourceFile, [{source, ErlCode}]),
+ ?line {ok, [{".", _, BeamCode2}]}
+ = escript_foldl(Collect, [], SourceFile),
+
+ ?line {ok, Abstr} = beam_lib:chunks(BeamCode, [abstract_code]),
+ ?line {ok, Abstr2} = beam_lib:chunks(BeamCode2, [abstract_code]),
+ %% io:format("abstr1=~p\n", [Abstr]),
+ %% io:format("abstr2=~p\n", [Abstr2]),
+ ?line Abstr = Abstr2, % Assert
+
+ %% Verify beam script
+ ?line ok = escript:create(NewFile, [{beam, BeamCode}]),
+ ?line {ok, [{".", _, BeamCode}]}
+ = escript_foldl(Collect, [], NewFile),
+
+ %% Verify archive scripts
+ ?line ok = escript:create(NewFile, [{archive, ArchiveBin}]),
+ ?line {ok, [{BeamBase, #file_info{}, _},
+ {ErlBase, #file_info{}, _}]}
+ = escript_foldl(Collect, [], NewFile),
+
+ ArchiveFiles = [{ErlBase, ErlCode}, {BeamBase, BeamCode}],
+ ?line ok = escript:create(NewFile, [{archive, ArchiveFiles, []}]),
+ ?line {ok, [{BeamBase, _, _},
+ {ErlBase, _, _}]}
+ = escript_foldl(Collect, [], NewFile),
+
+ ok.
+
+escript_foldl(Fun, Acc, File) ->
+ code:ensure_loaded(zip),
+ case erlang:function_exported(zip, foldl, 3) of
+ true ->
+ emulate_escript_foldl(Fun, Acc, File);
+ false ->
+ escript:foldl(Fun, Acc, File)
+ end.
+
+emulate_escript_foldl(Fun, Acc, File) ->
+ case escript:extract(File, [compile_source]) of
+ {ok, [_Shebang, _Comment, _EmuArgs, Body]} ->
+ case Body of
+ {source, BeamCode} ->
+ GetInfo = fun() -> file:read_file_info(File) end,
+ GetBin = fun() -> BeamCode end,
+ {ok, Fun(".", GetInfo, GetBin, Acc)};
+ {beam, BeamCode} ->
+ GetInfo = fun() -> file:read_file_info(File) end,
+ GetBin = fun() -> BeamCode end,
+ {ok, Fun(".", GetInfo, GetBin, Acc)};
+ {archive, ArchiveBin} ->
+ zip:foldl(Fun, Acc, {File, ArchiveBin})
+ end;
+ {error, Reason} ->
+ {error, Reason}
+ end.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
run(Dir, Cmd0, Expected0) ->
Expected = iolist_to_binary(expected_output(Expected0, Dir)),
Cmd = case os:type() of
@@ -490,7 +744,7 @@ run(Dir, Cmd0, Expected0) ->
end,
do_run(Dir, Cmd, Expected).
-run(Dir, Opts, Cmd0, Expected) ->
+run_with_opts(Dir, Opts, Cmd0, Expected) ->
Cmd = case os:type() of
{win32,_} -> "escript " ++ Opts ++ " " ++ filename:nativename(Dir) ++ "\\" ++ Cmd0;
_ -> "escript " ++ Opts ++ " " ++ Dir ++ "/" ++ Cmd0
@@ -533,8 +787,8 @@ expected_output([data_dir|T], Data) ->
[filename:nativename(Data)++Slash|expected_output(T, Data)];
expected_output([H|T], Data) ->
[H|expected_output(T, Data)];
-expected_output([], _) ->
+expected_output([], _) ->
[];
-expected_output(Bin, _) when is_binary(Bin) ->
+expected_output(Bin, _) when is_binary(Bin) ->
Bin.
diff --git a/lib/stdlib/test/zip_SUITE.erl b/lib/stdlib/test/zip_SUITE.erl
index 12ca655000..48b14396c1 100644
--- a/lib/stdlib/test/zip_SUITE.erl
+++ b/lib/stdlib/test/zip_SUITE.erl
@@ -18,12 +18,13 @@
%%
-module(zip_SUITE).
--export([all/1, borderline/1, atomic/1,
+-export([all/1, borderline/1, atomic/1,
bad_zip/1, unzip_from_binary/1, unzip_to_binary/1,
zip_to_binary/1,
unzip_options/1, zip_options/1, list_dir_options/1, aliases/1,
openzip_api/1, zip_api/1, unzip_jar/1,
- compress_control/1]).
+ compress_control/1,
+ foldl/1]).
-include("test_server.hrl").
-include("test_server_line.hrl").
@@ -35,7 +36,8 @@ all(suite) -> [borderline, atomic, bad_zip,
zip_to_binary,
unzip_options, zip_options, list_dir_options, aliases,
openzip_api, zip_api, unzip_jar,
- compress_control].
+ compress_control,
+ foldl].
borderline(doc) ->
["Test creating, listing and extracting one file from an archive "
@@ -110,17 +112,17 @@ get_data(Port, Expect) ->
{Port, {data, Bytes}} ->
get_data(Port, match_output(Bytes, Expect, Port));
{Port, eof} ->
- Port ! {self(), close},
+ Port ! {self(), close},
receive
{Port, closed} ->
true
- end,
+ end,
receive
- {'EXIT', Port, _} ->
+ {'EXIT', Port, _} ->
ok
after 1 -> % force context switch
ok
- end,
+ end,
match_output(eof, Expect, Port)
end.
@@ -290,7 +292,7 @@ unzip_options(Config) when is_list(Config) ->
DataDir = ?config(data_dir, Config),
PrivDir = ?config(priv_dir, Config),
Long = filename:join(DataDir, "abc.zip"),
-
+
%% create a temp directory
Subdir = filename:join(PrivDir, "t"),
ok = file:make_dir(Subdir),
@@ -303,7 +305,7 @@ unzip_options(Config) when is_list(Config) ->
%% Verify.
?line true = (length(FList) =:= length(RetList)),
- ?line lists:foreach(fun(F)-> {ok,B} = file:read_file(filename:join(DataDir, F)),
+ ?line lists:foreach(fun(F)-> {ok,B} = file:read_file(filename:join(DataDir, F)),
{ok,B} = file:read_file(filename:join(Subdir, F)) end,
FList),
?line lists:foreach(fun(F)-> ok = file:delete(F) end,
@@ -321,7 +323,7 @@ unzip_jar(Config) when is_list(Config) ->
DataDir = ?config(data_dir, Config),
PrivDir = ?config(priv_dir, Config),
JarFile = filename:join(DataDir, "test.jar"),
-
+
%% create a temp directory
Subdir = filename:join(PrivDir, "jartest"),
ok = file:make_dir(Subdir),
@@ -479,7 +481,7 @@ unzip_to_binary(Config) when is_list(Config) ->
DataDir = ?config(data_dir, Config),
PrivDir = ?config(priv_dir, Config),
- delete_all_in(PrivDir),
+ delete_all_in(PrivDir),
file:set_cwd(PrivDir),
Long = filename:join(DataDir, "abc.zip"),
@@ -595,17 +597,17 @@ do_delete_files([],Cnt) ->
Cnt;
do_delete_files([Item|Rest], Cnt) ->
case file:delete(Item) of
- ok ->
+ ok ->
DelCnt = 1;
{error,eperm} ->
file:change_mode(Item, 8#777),
DelCnt = delete_files(filelib:wildcard(filename:join(Item, "*"))),
- file:del_dir(Item);
+ file:del_dir(Item);
{error,eacces} ->
%% We'll see about that!
file:change_mode(Item, 8#777),
case file:delete(Item) of
- ok ->
+ ok ->
DelCnt = 1;
{error,_} ->
erlang:yield(),
@@ -643,22 +645,22 @@ compress_control(Config) when is_list(Config) ->
],
test_compress_control(Dir,
- Files,
+ Files,
[{compress, []}],
[]),
test_compress_control(Dir,
- Files,
+ Files,
[{uncompress, all}],
[]),
test_compress_control(Dir,
- Files,
+ Files,
[{uncompress, []}],
[".txt", ".exe", ".zip", ".lzh", ".arj"]),
test_compress_control(Dir,
- Files,
+ Files,
[],
[".txt", ".exe"]),
@@ -686,7 +688,7 @@ test_compress_control(Dir, Files, ZipOptions, Expected) ->
create_files(Files),
{ok, Zip} = zip:create(Zip, [Dir], ZipOptions),
-
+
{ok, OpenZip} = zip:openzip_open(Zip, [memory]),
{ok,[#zip_comment{comment = ""} | ZipList]} = zip:openzip_list_dir(OpenZip),
io:format("compress_control: -> ~p -> ~p\n -> ~pn", [Expected, ZipOptions, ZipList]),
@@ -698,19 +700,19 @@ test_compress_control(Dir, Files, ZipOptions, Expected) ->
delete_files(lists:reverse(Names)), % Remove plain files before directories
ok.
-
+
verify_compression([{Name, Kind, _Filler} | Files], ZipList, OpenZip, ZipOptions, Expected) ->
{Name2, BinSz} =
case Kind of
- dir ->
+ dir ->
{Name ++ "/", 0};
- _ ->
+ _ ->
{ok, {Name, Bin}} = zip:openzip_get(Name, OpenZip),
{Name, size(Bin)}
end,
{Name2, {value, ZipFile}} = {Name2, lists:keysearch(Name2, #zip_file.name, ZipList)},
#zip_file{info = #file_info{size = InfoSz, type = InfoType}, comp_size = InfoCompSz} = ZipFile,
-
+
Ext = filename:extension(Name),
IsComp = is_compressed(Ext, Kind, ZipOptions),
ExpComp = lists:member(Ext, Expected),
@@ -757,3 +759,33 @@ extensions([H | T], Old) ->
extensions([], Old) ->
Old.
+foldl(Config) ->
+ PrivDir = ?config(priv_dir, Config),
+ File = filename:join([PrivDir, "foldl.zip"]),
+
+ FooBin = <<"FOO">>,
+ BarBin = <<"BAR">>,
+ Files = [{"foo", FooBin}, {"bar", BarBin}],
+ ?line {ok, {File, Bin}} = zip:create(File, Files, [memory]),
+ ZipFun = fun(N, I, B, Acc) -> [{N, B(), I()} | Acc] end,
+ ?line {ok, FileSpec} = zip:foldl(ZipFun, [], {File, Bin}),
+ ?line [{"bar", BarBin, #file_info{}}, {"foo", FooBin, #file_info{}}] = FileSpec,
+ ?line {ok, {File, Bin}} = zip:create(File, lists:reverse(FileSpec), [memory]),
+ ?line {foo_bin, FooBin} =
+ try
+ zip:foldl(fun("foo", _, B, _) -> throw(B()); (_, _, _, Acc) -> Acc end, [], {File, Bin})
+ catch
+ throw:FooBin ->
+ {foo_bin, FooBin}
+ end,
+ ?line ok = file:write_file(File, Bin),
+ ?line {ok, FileSpec} = zip:foldl(ZipFun, [], File),
+
+ ?line {error, einval} = zip:foldl(fun() -> ok end, [], File),
+ ?line {error, einval} = zip:foldl(ZipFun, [], 42),
+ ?line {error, einval} = zip:foldl(ZipFun, [], {File, 42}),
+
+ ?line ok = file:delete(File),
+ ?line {error, enoent} = zip:foldl(ZipFun, [], File),
+
+ ok.
diff --git a/lib/test_server/doc/src/test_server_ctrl.xml b/lib/test_server/doc/src/test_server_ctrl.xml
index 0ed5f88544..4a778bcaf7 100644
--- a/lib/test_server/doc/src/test_server_ctrl.xml
+++ b/lib/test_server/doc/src/test_server_ctrl.xml
@@ -610,7 +610,7 @@ Optional, if not given the test server controller node
<tag><c>NAME name</c></tag>
<item>Names the test suite to something else than the
default name. This does not apply to <c>SPEC</c> which keeps
- it's names.
+ its names.
</item>
<tag><c>PARAMETERS parameterfile</c></tag>
<item>Specifies the parameter file to use when starting
diff --git a/lib/tools/emacs/test.erl.indented b/lib/tools/emacs/test.erl.indented
index faf1cc68ef..d0ea4c29cf 100644
--- a/lib/tools/emacs/test.erl.indented
+++ b/lib/tools/emacs/test.erl.indented
@@ -1,20 +1,20 @@
%% -*- erlang -*-
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2009-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%%-------------------------------------------------------------------
diff --git a/lib/tools/emacs/test.erl.orig b/lib/tools/emacs/test.erl.orig
index 764566005a..70e97a2e91 100644
--- a/lib/tools/emacs/test.erl.orig
+++ b/lib/tools/emacs/test.erl.orig
@@ -1,20 +1,20 @@
%% -*- erlang -*-
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2009-2010. 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
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%%-------------------------------------------------------------------
diff --git a/lib/wx/c_src/wxe_driver.c b/lib/wx/c_src/wxe_driver.c
index 3b951bec57..310325ea26 100644
--- a/lib/wx/c_src/wxe_driver.c
+++ b/lib/wx/c_src/wxe_driver.c
@@ -1,19 +1,19 @@
/*
* %CopyrightBegin%
- *
- * Copyright Ericsson AB 2008-2009. All Rights Reserved.
- *
+ *
+ * Copyright Ericsson AB 2008-2010. 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
* compliance with the License. You should have received a copy of the
* Erlang Public License along with this software. If not, it can be
* retrieved online at http://www.erlang.org/.
- *
+ *
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and limitations
* under the License.
- *
+ *
* %CopyrightEnd%
*/
@@ -113,6 +113,7 @@ wxe_driver_start(ErlDrvPort port, char *buff)
data->driver_data = NULL;
data->bin = NULL;
data->port = port;
+ data->pdl = driver_pdl_create(port);
if(WXE_DRV_PORT == 0) {
for(; *buff != 32; buff++);
buff++;
@@ -124,7 +125,7 @@ wxe_driver_start(ErlDrvPort port, char *buff)
if(!(start_native_gui(data) == 1))
return(ERL_DRV_ERROR_GENERAL); /* ENOMEM */
} else {
- meta_command(CREATE_PORT,data);
+ meta_command(CREATE_PORT,data);
}
return (ErlDrvData) data;
}
diff --git a/lib/wx/c_src/wxe_driver.h b/lib/wx/c_src/wxe_driver.h
index 8437b4eb36..13a17e356f 100644
--- a/lib/wx/c_src/wxe_driver.h
+++ b/lib/wx/c_src/wxe_driver.h
@@ -1,19 +1,19 @@
/*
* %CopyrightBegin%
- *
- * Copyright Ericsson AB 2008-2009. All Rights Reserved.
- *
+ *
+ * Copyright Ericsson AB 2008-2010. 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
* compliance with the License. You should have received a copy of the
* Erlang Public License along with this software. If not, it can be
* retrieved online at http://www.erlang.org/.
- *
+ *
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and limitations
* under the License.
- *
+ *
* %CopyrightEnd%
*/
@@ -45,6 +45,7 @@ typedef struct wxe_data_def {
WXEBinRef * bin; /* Argument binaries */
ErlDrvPort port;
int is_cbport;
+ ErlDrvPDL pdl;
} wxe_data;
diff --git a/lib/wx/c_src/wxe_impl.cpp b/lib/wx/c_src/wxe_impl.cpp
index 4486dff63b..528a08e654 100644
--- a/lib/wx/c_src/wxe_impl.cpp
+++ b/lib/wx/c_src/wxe_impl.cpp
@@ -101,7 +101,7 @@ int start_native_gui(wxe_data *sd)
init_caller = driver_connected(sd->port);
if((res = erl_drv_thread_create((char *)"wxwidgets",
- &wxe_thread,wxe_main_loop,NULL,NULL)) == 0) {
+ &wxe_thread,wxe_main_loop,(void *) sd->pdl,NULL)) == 0) {
erl_drv_mutex_lock(wxe_status_m);
for(;wxe_status == WXE_NOT_INITIATED;) {
erl_drv_cond_wait(wxe_status_c, wxe_status_m);
@@ -179,12 +179,15 @@ void meta_command(int what, wxe_data *sd) {
* wxWidgets Thread
* ************************************************************/
-void *wxe_main_loop(void * not_used)
+void *wxe_main_loop(void *vpdl)
{
int result;
int argc = 1;
char * temp = (char *) "Erlang\0";
char ** argv = &temp;
+ ErlDrvPDL pdl = (ErlDrvPDL) vpdl;
+
+ driver_pdl_inc_refc(pdl);
// ErlDrvSysInfo einfo;
// driver_system_info(&einfo, sizeof(ErlDrvSysInfo));
@@ -199,6 +202,7 @@ void *wxe_main_loop(void * not_used)
if(result >= 0 && wxe_status == WXE_INITIATED) {
/* We are done try to make a clean exit */
wxe_status = WXE_EXITED;
+ driver_pdl_dec_refc(pdl);
erl_drv_thread_exit(NULL);
return NULL;
} else {
@@ -206,6 +210,7 @@ void *wxe_main_loop(void * not_used)
wxe_status = WXE_ERROR;
erl_drv_cond_signal(wxe_status_c);
erl_drv_mutex_unlock(wxe_status_m);
+ driver_pdl_dec_refc(pdl);
return NULL;
}
}
@@ -401,11 +406,12 @@ void WxeApp::dispatch_cb(wxList * batch, wxList * temp, ErlDrvTermData process)
node = batch->GetFirst())
{
wxeCommand *event = (wxeCommand *)node->GetData();
+ wxeMemEnv *memenv = getMemEnv(event->port);
batch->Erase(node);
if(event->caller == process || // Callbacks from CB process only
event->op == WXE_CB_START || // Recursive event callback allow
// Allow connect_cb during CB i.e. msg from wxe_server.
- event->caller == driver_connected(event->port))
+ event->caller == memenv->owner)
{
switch(event->op) {
case WXE_BATCH_END:
@@ -456,6 +462,9 @@ void WxeApp::dispatch_cb(wxList * batch, wxList * temp, ErlDrvTermData process)
void WxeApp::newMemEnv(wxeMetaCommand& Ecmd) {
wxeMemEnv * memenv = new wxeMemEnv();
+
+ driver_pdl_inc_refc(Ecmd.pdl);
+
for(int i = 0; i < global_me->next; i++) {
memenv->ref2ptr[i] = global_me->ref2ptr[i];
}
@@ -576,6 +585,7 @@ void WxeApp::destroyMemEnv(wxeMetaCommand& Ecmd) {
// }
// fflush(stderr);
delete memenv;
+ driver_pdl_dec_refc(Ecmd.pdl);
refmap.erase((ErlDrvTermData) Ecmd.port);
}
diff --git a/lib/wx/c_src/wxe_impl.h b/lib/wx/c_src/wxe_impl.h
index 5e9d596633..39c02f8c1a 100644
--- a/lib/wx/c_src/wxe_impl.h
+++ b/lib/wx/c_src/wxe_impl.h
@@ -1,19 +1,19 @@
/*
* %CopyrightBegin%
- *
- * Copyright Ericsson AB 2008-2009. All Rights Reserved.
- *
+ *
+ * Copyright Ericsson AB 2008-2010. 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
* compliance with the License. You should have received a copy of the
* Erlang Public License along with this software. If not, it can be
* retrieved online at http://www.erlang.org/.
- *
+ *
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and limitations
* under the License.
- *
+ *
* %CopyrightEnd%
*/
@@ -34,15 +34,16 @@ class wxeMetaCommand : public wxEvent
public:
wxeMetaCommand(wxe_data *sd, int EvId)
: wxEvent(EvId, wxeEVT_META_COMMAND)
- { caller = driver_caller(sd->port); port = sd->port; } ;
+ { caller = driver_caller(sd->port); port = sd->port; pdl = sd->pdl; } ;
wxeMetaCommand(const wxeMetaCommand& event)
: wxEvent(event)
- { caller = event.caller; port = event.port; };
+ { caller = event.caller; port = event.port; pdl = event.pdl; };
virtual ~wxeMetaCommand() {};
virtual wxEvent *Clone() const { return new wxeMetaCommand(*this); }
ErlDrvTermData caller;
ErlDrvPort port;
+ ErlDrvPDL pdl;
};
class wxeCommand : public wxObject
diff --git a/lib/xmerl/doc/src/notes.xml b/lib/xmerl/doc/src/notes.xml
index 0f30ae9eca..3106c72bd8 100644
--- a/lib/xmerl/doc/src/notes.xml
+++ b/lib/xmerl/doc/src/notes.xml
@@ -54,7 +54,7 @@
<item>
<p>
A continuation clause of <c>parse_reference/3</c> had
- it's parameters in wrong order.</p>
+ its parameters in wrong order.</p>
<p>
Own Id: OTP-8251 Aux Id: seq11429 </p>
</item>