diff options
author | Siri Hansen <[email protected]> | 2012-09-12 10:12:55 +0200 |
---|---|---|
committer | Siri Hansen <[email protected]> | 2012-09-12 10:12:55 +0200 |
commit | 8d74edab223477c704af62b19793f0f8282fc749 (patch) | |
tree | e050d38b8b7cc76434b9363f2289703f2e6ac8c6 /lib/reltool/src | |
parent | 6f3205aed3acfb0a8426e87bfe52d6a36bceeb08 (diff) | |
download | otp-8d74edab223477c704af62b19793f0f8282fc749.tar.gz otp-8d74edab223477c704af62b19793f0f8282fc749.tar.bz2 otp-8d74edab223477c704af62b19793f0f8282fc749.zip |
[reltool] Make reltool:install/2 work on windows
The erl.ini file generated by reltool:install/2 faulty pointed out
$ROOT/bin as Bindir. This is now changed to $ROOT/erts-Vsn/bin. Also,
backslashes in erl.ini needed to be escaped.
Diffstat (limited to 'lib/reltool/src')
-rw-r--r-- | lib/reltool/src/reltool_target.erl | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/lib/reltool/src/reltool_target.erl b/lib/reltool/src/reltool_target.erl index c39ed0ecd5..8296cd95be 100644 --- a/lib/reltool/src/reltool_target.erl +++ b/lib/reltool/src/reltool_target.erl @@ -1420,12 +1420,10 @@ do_install(RelName, TargetDir) -> BinDir = filename:join([TargetDir2, "bin"]), case os:type() of {win32, _} -> - NativeRootDir = filename:nativename(TargetDir2), - %% NativeBinDir = - %% filename:nativename(filename:join([BinDir, "win32"])), - NativeBinDir = filename:nativename(BinDir), + NativeRootDir = nativename(TargetDir2), + NativeErtsBinDir = nativename(ErtsBinDir), IniData = ["[erlang]\r\n", - "Bindir=", NativeBinDir, "\r\n", + "Bindir=", NativeErtsBinDir, "\r\n", "Progname=erl\r\n", "Rootdir=", NativeRootDir, "\r\n"], IniFile = filename:join([BinDir, "erl.ini"]), @@ -1445,6 +1443,15 @@ do_install(RelName, TargetDir) -> reltool_utils:throw_error("~s: Illegal data file syntax", [DataFile]) end. +nativename(Dir) -> + escape_backslash(filename:nativename(Dir)). +escape_backslash([$\\|T]) -> + [$\\,$\\|escape_backslash(T)]; +escape_backslash([H|T]) -> + [H|escape_backslash(T)]; +escape_backslash([]) -> + []. + subst_src_scripts(Scripts, SrcDir, DestDir, Vars, Opts) -> Fun = fun(Script) -> subst_src_script(Script, SrcDir, DestDir, Vars, Opts) |