493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
|
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
|
-
+
|
;; special case
(if (or force (not (hash-table? *configdat*))) ;; no need to re-open on every call
(begin
(set! *configinfo* (or (if (get-environment-variable "MT_CMDINFO") ;; we are inside a test - do not reprocess configs
(let ((alistconfig (conc (get-environment-variable "MT_LINKTREE") "/"
(get-environment-variable "MT_TARGET") "/"
(get-environment-variable "MT_RUNNAME") "/"
".megatest.cfg")))
".megatest.cfg-" megatest-version "-" megatest-fossil-hash)))
(if (file-exists? alistconfig)
(list (configf:read-alist alistconfig)
(get-environment-variable "MT_RUN_AREA_HOME"))
#f))
#f) ;; no config cached - give up
(let ((runname (or (args:get-arg "-runname")(args:get-arg ":runname"))))
(if runname (setenv "MT_RUNNAME" runname))
|
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
|
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
|
-
+
|
(begin
(if (not (file-exists? fulldir))
(create-directory fulldir #t)) ;; need to protect with exception handler
(if (and target
runname
(file-exists? fulldir))
(let ((tmpfile (conc fulldir "/.megatest.cfg." (current-seconds)))
(targfile (conc fulldir "/.megatest.cfg")))
(targfile (conc fulldir "/.megatest.cfg-" megatest-version "-" megatest-fossil-hash)))
(debug:print-info 0 "Caching megatest.config in " fulldir "/.megatest.cfg")
(configf:write-alist *configdat* tmpfile)
(system (conc "ln -sf " tmpfile " " targfile))
)))))))
(define (get-best-disk confdat)
(let* ((disks (hash-table-ref/default confdat "disks" #f))
|