@@ -19,13 +19,13 @@ REBOL [
19
19
20
20
start : func [
21
21
"INIT: Completes the boot sequence. Loads extras, handles args, security, scripts."
22
- /local dir file tmp script-path script-args code ver
23
- ] bind [ ; context is: system/options
22
+ /local file tmp script-path script-args code ver
23
+ ] bind [ ; context is: system/options (must use full path sys/log/.. as there is options/log too!)
24
24
25
25
;** Note ** We need to make this work for lower boot levels too!
26
26
27
27
;-- DEBUG: enable these lines for debug or related testing
28
- log/debug 'REBOL ["Starting... boot level:" boot-level]
28
+ sys / log/debug 'REBOL ["Starting... boot level:" boot-level]
29
29
;trace 1
30
30
;crash-here ; test error handling (undefined word)
31
31
@@ -55,25 +55,25 @@ start: func [
55
55
if any [do-arg script] [quiet: true]
56
56
57
57
;-- Set up option/paths for /path, /boot, /home, and script path (for SECURE):
58
- log/more 'REBOL ["Initial path:" path]
59
- log/more 'REBOL ["Initial boot:" boot]
60
- ;log/more 'REBOL ["Initial home:" home] ; always NONE at this state!
58
+ sys / log/more 'REBOL ["Initial path:" path]
59
+ sys / log/more 'REBOL ["Initial boot:" boot]
60
+ ;sys/ log/more 'REBOL ["Initial home:" home] ; always NONE at this state!
61
61
;- 1. /path - that is current directory (resolved from C as a part of args processing)
62
62
; nothing to do here
63
63
;- 2. /boot - path to executable (must handle relative paths)
64
64
boot: any [to-real-file boot boot]
65
65
unless exists? boot [
66
66
; the executable must be inside one of the system PATH directories...
67
67
file: second split-path boot
68
- foreach tmp parse any [get-env "PATH" "" ] pick ";:" system/platform = 'Windows [
69
- dir: dirize as file! tmp
70
- if exists? tmp: dir/: file [
68
+ foreach dir parse any [get-env "PATH" "" ] pick ";:" system/platform = 'Windows [
69
+ dir: dirize as file! dir
70
+ if exists? probe tmp: dir/: file [
71
71
boot: tmp
72
72
break
73
73
]
74
74
]
75
75
if boot <> tmp [
76
- log/error 'REBOL "Path to executable was not resolved!"
76
+ sys / log/error 'REBOL "Path to executable was not resolved!"
77
77
boot: none
78
78
]
79
79
]
@@ -114,7 +114,7 @@ start: func [
114
114
; For example: mods, plus, host, and full
115
115
if boot-level [
116
116
load-boot-exts
117
- log/debug 'REBOL "Init mezz plus..."
117
+ sys / log/debug 'REBOL "Init mezz plus..."
118
118
119
119
do bind-lib boot-mezz
120
120
boot-mezz: 'done
@@ -132,7 +132,7 @@ start: func [
132
132
]
133
133
134
134
if boot-host [
135
- log/debug 'REBOL "Init host code..."
135
+ sys / log/debug 'REBOL "Init host code..."
136
136
;probe load boot-host
137
137
do load boot-host
138
138
boot-host: none
@@ -167,23 +167,23 @@ start: func [
167
167
;-- Evaluate rebol.reb script:
168
168
;@@ https://github.com/Oldes/Rebol-issues/issues/706
169
169
tmp: first split-path boot
170
- log/info 'REBOL ["Checking for rebol.reb file in" tmp]
170
+ sys / log/info 'REBOL ["Checking for rebol.reb file in" tmp]
171
171
172
172
if all [
173
173
#"/" = first tmp ; only if we know absolute path
174
174
exists? tmp/rebol.reb
175
175
][
176
- try /except [do tmp/rebol.reb ][log/error 'REBOL system/state/last-error ]
176
+ try /except [do tmp/rebol.reb ][sys / log/error 'REBOL system/state/last-error ]
177
177
]
178
178
179
179
;-- Make the user's global context:
180
180
tmp: make object! 320
181
181
append tmp reduce ['REBOL :system 'lib-local :tmp ]
182
182
system/contexts/user: tmp
183
183
184
- log/info 'REBOL ["Checking for user.reb file in" home]
184
+ sys / log/info 'REBOL ["Checking for user.reb file in" home]
185
185
if exists? home/user.reb [
186
- try /except [do home/user.reb ][log/error 'REBOL system/state/last-error ]
186
+ try /except [do home/user.reb ][sys / log/error 'REBOL system/state/last-error ]
187
187
]
188
188
189
189
@@ -208,7 +208,7 @@ start: func [
208
208
; /path dir is where our script gets started.
209
209
change-dir first script-path
210
210
either exists? second script-path [
211
- log/info 'REBOL ["Evaluating:" script]
211
+ sys / log/info 'REBOL ["Evaluating:" script]
212
212
code: load/header/type second script-path 'unbound
213
213
; update system/script (Make into a function?)
214
214
system/script: make system/standard/script [
0 commit comments