forked from RefPerSys/RefPerSys
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCreate-RefPerSys.ocaml
More file actions
executable file
·72 lines (64 loc) · 2.27 KB
/
Copy pathCreate-RefPerSys.ocaml
File metadata and controls
executable file
·72 lines (64 loc) · 2.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/ocaml
(** SPDX-License-Identifier: GPL-3.0-or-later -*- caml -*-
* script file Create-RefPerSys.ocaml in RefPerSys - see http://refpersys.org/
*
* © Copyright 2024 - 2024 The Reflective Persistent System Team
* team@refpersys.org & http://refpersys.org/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
**)
#use "Unix";;
let refpersys_topdir : string =
try
Sys.getenv "REFPERSYS_TOPDIR"
with
Not_found -> begin
Printf.eprintf "Create-RefPerSys: missing REFPERSY_TOPDIR\n";
Stdlib.exit 1
end;;
let this_script_basename : string =
let res = ref "" in begin
List.iter (fun (s : string) -> res := s) (String.split_on_char '/' __FILE__);
!res
end
;;
let short_gitid : string =
let res = ref "" in begin
let cmdch = Stdlib.open_process_args_in
(refpersys_topdir ^ "/" ^ "rps-generate-gitid.sh")
[| "rps-generate-gitid.sh" ; "-s" |]
in
res := Stdlib.input_line cmdch;
Stdlib.close_in cmdch;
!res
end
;;
Printf.printf "hello from Create-RefPerSys (%s:%d) topdir %s shortgit %S invocation\n%t\nthis script %s\n"
__FILE__
__LINE__
refpersys_topdir
short_gitid
(fun out -> Array.iteri
(fun i a -> Printf.fprintf out "[%d] %S\n" i a)
Sys.argv)
this_script_basename
;;
(**** notice to GNU emacs users
Install the ELPA caml-mode and tuareg and
add the following lines in your ~/.emacs file:
(add-to-list 'auto-mode-alist '("\\.ml[iylp]?$" . caml-mode))
(add-to-list 'auto-mode-alist '("\\.ocaml$" . caml-mode))
(if window-system (require 'caml-font))
****)
(** end of file Create-RefPerSys.ocaml **)