9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
(declare (uses common))
(include "common_records.scm")
(define (setup-env-defaults db fname run-id already-seen #!key (environ-patt #f))
(let* ((keys (get-keys db))
(keyvals (get-key-vals db run-id))
(keyval
(thekey (string-intersperse (map (lambda (x)(if x x "-na-")) keyvals) "/"))
(confdat (read-config fname #f #f environ-patt: environ-patt))
(whatfound (make-hash-table))
(sections (list "default" thekey)))
(debug:print 4 "Using key=\"" thekey "\"")
(for-each
(lambda (section)
(let ((section-dat (hash-table-ref/default confdat section #f)))
(if section-dat
(for-each
(lambda (envvar)
(hash-table-set! whatfound section (+ (hash-table-ref/default whatfound section 0) 1))
|
<
|
>
>
>
>
>
|
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
|
(declare (uses common))
(include "common_records.scm")
(define (setup-env-defaults db fname run-id already-seen #!key (environ-patt #f))
(let* ((keys (get-keys db))
(keyvals (get-key-vals db run-id))
(thekey (string-intersperse (map (lambda (x)(if x x "-na-")) keyvals) "/"))
(confdat (read-config fname #f #f environ-patt: environ-patt))
(whatfound (make-hash-table))
(sections (list "default" thekey)))
(debug:print 4 "Using key=\"" thekey "\"")
(for-each
(lambda (key val)
(setenv (vector-ref key 0) val))
keys keyvals)
(for-each
(lambda (section)
(let ((section-dat (hash-table-ref/default confdat section #f)))
(if section-dat
(for-each
(lambda (envvar)
(hash-table-set! whatfound section (+ (hash-table-ref/default whatfound section 0) 1))
|
40
41
42
43
44
45
46
47
|
(set! *already-seen-runconfig-info* #t)))))
(define (set-run-config-vars db run-id)
(let ((runconfigf (conc *toppath* "/runconfigs.config")))
(if (file-exists? runconfigf)
(setup-env-defaults db runconfigf run-id #f environ-patt: ".*")
(debug:print 0 "WARNING: You do not have a run config file: " runconfigf))))
|
|
|
44
45
46
47
48
49
50
51
|
(set! *already-seen-runconfig-info* #t)))))
(define (set-run-config-vars db run-id)
(let ((runconfigf (conc *toppath* "/runconfigs.config")))
(if (file-exists? runconfigf)
(setup-env-defaults db runconfigf run-id #f environ-patt: ".*")
(debug:print 0 "WARNING: You do not have a run config file: " runconfigf))))
|