aboutsummaryrefslogtreecommitdiffstats
path: root/lib/sasl/examples
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2014-02-19 17:24:27 +0100
committerSiri Hansen <[email protected]>2014-04-03 12:17:52 +0200
commitc65821b677b4ebbc05192da9b8a48d32e53b3cfe (patch)
tree863ccc36f0f3d93be0f6e5210a2088b7b8091726 /lib/sasl/examples
parent8eb20d1fb0eb3a3b96d5e80e2e2617f893ef6986 (diff)
downloadotp-c65821b677b4ebbc05192da9b8a48d32e53b3cfe.tar.gz
otp-c65821b677b4ebbc05192da9b8a48d32e53b3cfe.tar.bz2
otp-c65821b677b4ebbc05192da9b8a48d32e53b3cfe.zip
Add documentation about upgrade
The example of how to create a first target system, which is located in the System Principles document, is now extended to also include an example of code upgrade. A new chapter is added to System Principles explaining different issues when upgrade includes new versions applications within Erlang/OTP.
Diffstat (limited to 'lib/sasl/examples')
-rw-r--r--lib/sasl/examples/src/target_system.erl16
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/sasl/examples/src/target_system.erl b/lib/sasl/examples/src/target_system.erl
index fb9e9aaaaf..a0ae016791 100644
--- a/lib/sasl/examples/src/target_system.erl
+++ b/lib/sasl/examples/src/target_system.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2014. 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
@@ -65,7 +65,7 @@ create(RelFileName,SystoolsOpts) ->
[RelFileName, RelFileName]),
make_script(RelFileName,SystoolsOpts),
- TarFileName = filename:join(Dir,RelFileName ++ ".tar.gz"),
+ TarFileName = RelFileName ++ ".tar.gz",
io:fwrite("Creating tar file ~tp ...~n", [TarFileName]),
make_tar(RelFileName,SystoolsOpts),
@@ -100,6 +100,12 @@ create(RelFileName,SystoolsOpts) ->
copy_file(filename:join([ErtsBinDir, "to_erl"]),
filename:join([TmpBinDir, "to_erl"]), [preserve]),
+ %% This is needed if 'start' script created from 'start.src' shall
+ %% be used as it points out this directory as log dir for 'run_erl'
+ TmpLogDir = filename:join([TmpDir, "log"]),
+ io:fwrite("Creating temporary directory ~tp ...~n", [TmpLogDir]),
+ ok = file:make_dir(TmpLogDir),
+
StartErlDataFile = filename:join([TmpDir, "releases", "start_erl.data"]),
io:fwrite("Creating ~tp ...~n", [StartErlDataFile]),
StartErlData = io_lib:fwrite("~s ~s~n", [ErtsVsn, RelVsn]),
@@ -115,6 +121,7 @@ create(RelFileName,SystoolsOpts) ->
erl_tar:add(Tar, filename:join(TmpDir,ErtsDir), ErtsDir, []),
erl_tar:add(Tar, filename:join(TmpDir,"releases"), "releases", []),
erl_tar:add(Tar, filename:join(TmpDir,"lib"), "lib", []),
+ erl_tar:add(Tar, filename:join(TmpDir,"log"), "log", []),
erl_tar:close(Tar),
%% file:set_cwd(Cwd),
io:fwrite("Removing directory ~tp ...~n",[TmpDir]),
@@ -136,6 +143,11 @@ install(RelFileName, RootDir) ->
subst_src_scripts(["erl", "start", "start_erl"], ErtsBinDir, BinDir,
[{"FINAL_ROOTDIR", RootDir}, {"EMU", "beam"}],
[preserve]),
+ %%! Workaround for pre OTP 17.0: start.src and start_erl.src did
+ %%! not have correct permissions, so the above 'preserve' option did not help
+ ok = file:change_mode(filename:join(BinDir,"start"),8#0755),
+ ok = file:change_mode(filename:join(BinDir,"start_erl"),8#0755),
+
io:fwrite("Creating the RELEASES file ...\n"),
create_RELEASES(RootDir, filename:join([RootDir, "releases",
filename:basename(RelFileName)])).