You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
88 lines
2.9 KiB
88 lines
2.9 KiB
From: Guillaume Brochu <guillaume.brochu@gmail.com> |
|
Date: Sun, 21 Oct 2018 15:02:09 -0400 |
|
Subject: gwsetup-fhs |
|
|
|
Goal: Allow configuring various paths in gwsetup |
|
Status wrt upstream: Forwarded in the Geneweb ML |
|
--- |
|
setup/setup.ml | 17 ++++++++++------- |
|
1 file changed, 10 insertions(+), 7 deletions(-) |
|
|
|
diff --git a/setup/setup.ml b/setup/setup.ml |
|
index 294f27d..c1186bb 100644 |
|
--- a/setup/setup.ml |
|
+++ b/setup/setup.ml |
|
@@ -6,6 +6,7 @@ open Printf; |
|
value port = ref 2316; |
|
value default_lang = ref "en"; |
|
value setup_dir = ref "."; |
|
+value comm_log = ref "."; |
|
value bin_dir = ref ""; |
|
value lang_param = ref ""; |
|
value only_file = ref ""; |
|
@@ -701,7 +702,7 @@ value error conf str = |
|
; |
|
|
|
value exec_f comm = |
|
- let s = comm ^ " > " ^ "comm.log" in |
|
+ let s = comm ^ " > " ^ comm_log.val in |
|
do { |
|
eprintf "$ cd \"%s\"\n" (Sys.getcwd ()); |
|
flush stderr; |
|
@@ -924,7 +925,7 @@ value infer_rc conf rc = |
|
|
|
value gwc conf = |
|
let rc = |
|
- let comm = stringify (Filename.concat bin_dir.val "gwc") in |
|
+ let comm = "gwc" in |
|
exec_f (comm ^ parameters conf.env) |
|
in |
|
let rc = IFDEF WIN95 THEN infer_rc conf rc ELSE rc END in |
|
@@ -943,7 +944,7 @@ value gwc conf = |
|
|
|
value gwc2 conf = |
|
let rc = |
|
- let comm = stringify (Filename.concat bin_dir.val "gwc2") in |
|
+ let comm = "gwc2" in |
|
exec_f (comm ^ parameters conf.env) |
|
in |
|
let rc = IFDEF WIN95 THEN infer_rc conf rc ELSE rc END in |
|
@@ -1176,7 +1177,7 @@ value recover_2 conf = |
|
Sys.chdir dir; |
|
let c = |
|
Filename.concat bin_dir.val src_to_new ^ " " ^ tmp ^ " -f -o " ^ |
|
- out_file ^ " > " ^ "comm.log" |
|
+ out_file ^ " > " ^ comm_log.val |
|
in |
|
eprintf "$ %s\n" c; |
|
flush stderr; |
|
@@ -1269,7 +1270,7 @@ value cleanup_1 conf = |
|
Sys.rename in_base_dir (Filename.concat "old" in_base_dir); |
|
let c = |
|
Filename.concat bin_dir.val "gwc" ^ " tmp.gw -nofail -o " ^ in_base ^ |
|
- " > comm.log 2>&1" |
|
+ " > " ^ comm_log.val ^ " 2>&1" |
|
in |
|
eprintf "$ %s\n" c; |
|
flush stderr; |
|
@@ -1393,7 +1394,7 @@ value merge_1 conf = |
|
(fun s b -> |
|
if s = "" then " " ^ b ^ ".gw" else s ^ " -sep " ^ b ^ ".gw") |
|
"" bases ^ |
|
- " -f -o " ^ out_file ^ " > comm.log 2>&1" |
|
+ " -f -o " ^ out_file ^ " > " ^ comm_log.val ^ " 2>&1" |
|
in |
|
eprintf "$ %s\n" c; |
|
flush stderr; |
|
@@ -1962,8 +1963,10 @@ value speclist = |
|
string_of_int port.val ^ "); > 1024 for normal users."); |
|
("-only", Arg.String (fun s -> only_file.val := s), |
|
"<file>: File containing the only authorized address"); |
|
+ ("-log", Arg.String (fun x -> comm_log.val := x), |
|
+ "<string>: full path for last command log file") ; |
|
("-gd", Arg.String (fun x -> setup_dir.val := x), |
|
- "<string>: gwsetup directory"); |
|
+ "<string>: geneweb share directory") ; |
|
("-bindir", Arg.String (fun x -> bin_dir.val := x), |
|
"<string>: binary directory (default = value of option -gd)") :: |
|
IFDEF SYS_COMMAND THEN
|
|
|