Index: configf.scm ================================================================== --- configf.scm +++ configf.scm @@ -213,16 +213,18 @@ (loop (configf:read-line inp res) curr-section-name #f #f)))) (else (debug:print 0 "ERROR: problem parsing " path ",\n \"" inl "\"") (set! var-flag #f) (loop (configf:read-line inp res) curr-section-name #f #f)))))))) -(define (find-and-read-config fname #!key (environ-patt #f)(given-toppath #f)) +;; pathenvvar will set the named var to the path of the config +(define (find-and-read-config fname #!key (environ-patt #f)(given-toppath #f)(pathenvvar #f)) (let* ((curr-dir (current-directory)) (configinfo (find-config fname toppath: given-toppath)) (toppath (car configinfo)) (configfile (cadr configinfo))) (if toppath (change-directory toppath)) + (if (and toppath pathenvvar)(setenv pathenvvar toppath)) (let ((configdat (if configfile (read-config configfile #f #t environ-patt: environ-patt) #f))) ;; (make-hash-table)))) (if toppath (change-directory curr-dir)) (list configdat toppath configfile fname)))) (define (config-lookup cfgdat section var) Index: db.scm ================================================================== --- db.scm +++ db.scm @@ -382,11 +382,12 @@ ;; returns number if string->number is successful, string otherwise ;; also updates *global-delta* (define (db:get-var db var) (let* ((start-ms (current-milliseconds)) - (throttle (string->number (config-lookup *configdat* "setup" "throttle"))) + (throttle (let ((t (config-lookup *configdat* "setup" "throttle"))) + (if t (string->number t) t))) (res #f)) (sqlite3:for-each-row (lambda (val) (set! res val)) db "SELECT val FROM metadat WHERE var=?;" var) Index: launch.scm ================================================================== --- launch.scm +++ launch.scm @@ -346,11 +346,12 @@ ;; pass on that idea for now ;; special case (set! *configinfo* (find-and-read-config (if (args:get-arg "-config")(args:get-arg "-config") "megatest.config") environ-patt: "env-override" - given-toppath: (get-environment-variable "MT_RUN_AREA_HOME"))) + given-toppath: (get-environment-variable "MT_RUN_AREA_HOME") + pathenvvar: "MT_RUN_AREA_HOME")) (set! *configdat* (if (car *configinfo*)(car *configinfo*) #f)) (set! *toppath* (if (car *configinfo*)(cadr *configinfo*) #f)) (if *toppath* (setenv "MT_RUN_AREA_HOME" *toppath*) ;; to be deprecated (debug:print 0 "ERROR: failed to find the top path to your run setup.")) Index: tests/fullrun/megatest.config ================================================================== --- tests/fullrun/megatest.config +++ tests/fullrun/megatest.config @@ -6,11 +6,11 @@ # refareas can be searched to find previous runs # the path points to where megatest.db exists [refareas] area1 /tmp/oldarea/megatest -[include config/mt_include_1.config] +[include #{getenv MT_RUN_AREA_HOME}/config/mt_include_1.config] [setup] # FULL or 2, NORMAL or 1, OFF or 0 synchronous OFF # Throttle roughly scales the db access milliseconds to seconds delay @@ -35,10 +35,11 @@ WACKYVAR3 #{getenv USER} WACKYVAR4 #{scheme (+ 5 6 7)} WACKYVAR5 #{getenv sysname}/#{getenv fsname}/#{getenv datapath} WACKYVAR6 #{scheme (args:get-arg "-target")} PREDICTABLE the_ans +MRAH MT_RUN_AREA_HOME=#{getenv MT_RUN_AREA_HOME} # XTERM [system xterm] # RUNDEAD [system exit 56] ## disks are: