Overview
Comment: | Fix for runconfigs reading - picking up irrelevant variables |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | runconfigs-fix-irrelevant-vars |
Files: | files | file ages | folders |
SHA1: |
86bc7cc36fcf1e6097005473ed3a4ffa |
User & Date: | matt on 2012-04-19 23:05:51 |
Other Links: | branch diff | manifest | tags |
Context
2012-04-19
| ||
23:45 | Fixed runconfigs.config where wrong vars slipped through Closed-Leaf check-in: 7a7f9c7318 user: matt tags: runconfigs-fix-irrelevant-vars | |
23:05 | Fix for runconfigs reading - picking up irrelevant variables check-in: 86bc7cc36f user: matt tags: runconfigs-fix-irrelevant-vars | |
16:08 | Added comma separated filters to dashboard check-in: 46858112fb user: mrwellan tags: trunk | |
Changes
Modified configf.scm from [f3836ab576] to [ded12b5b7f].
︙ | ︙ | |||
115 116 117 118 119 120 121 | ;; read a config file, returns hash table of alists ;; read a config file, returns hash table of alists ;; adds to ht if given (must be #f otherwise) ;; envion-patt is a regex spec that identifies sections that will be eval'd ;; in the environment on the fly | | | | > | > > > > > | 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 | ;; read a config file, returns hash table of alists ;; read a config file, returns hash table of alists ;; adds to ht if given (must be #f otherwise) ;; envion-patt is a regex spec that identifies sections that will be eval'd ;; in the environment on the fly ;; sections: #f => get all, else list of sections to gather (define (read-config path ht allow-system #!key (environ-patt #f)(curr-section #f)(sections #f)) (debug:print 4 "INFO: read-config " path " allow-system " allow-system " environ-patt " environ-patt " curr-section: " curr-section " sections: " sections) (if (not (file-exists? path)) (begin (debug:print 4 "INFO: read-config - file not found " path " current path: " (current-directory)) (if (not ht)(make-hash-table) ht)) (let ((inp (open-input-file path)) (res (if (not ht)(make-hash-table) ht))) (let loop ((inl (configf:read-line inp res)) ;; (read-line inp)) (curr-section-name (if curr-section curr-section "default")) (var-flag #f);; turn on for key-var-pr and cont-ln-rx, turn off elsewhere (lead #f)) (if (eof-object? inl) (begin (close-input-port inp) (hash-table-delete! res "") ;; we are using "" as a dumping ground and must remove it before returning the ht res) (regex-case inl (configf:comment-rx _ (loop (configf:read-line inp res) curr-section-name #f #f)) (configf:blank-l-rx _ (loop (configf:read-line inp res) curr-section-name #f #f)) (configf:include-rx ( x include-file ) (let ((curr-dir (current-directory)) (conf-dir (pathname-directory path))) (if conf-dir (change-directory conf-dir)) (read-config include-file res allow-system environ-patt: environ-patt curr-section: curr-section-name) (change-directory curr-dir) (loop (configf:read-line inp res) curr-section-name #f #f))) (configf:section-rx ( x section-name ) (loop (configf:read-line inp res) ;; if we have the sections list then force all settings into "" and delete it later? (if (or (not sections) (member section-name sections)) section-name "") ;; stick everything into "" #f #f)) (configf:key-sys-pr ( x key cmd ) (if allow-system (let ((alist (hash-table-ref/default res curr-section-name '())) (val-proc (lambda () (let* ((cmdres (cmd-run->list cmd)) (status (cadr cmdres)) (res (car cmdres))) (debug:print 4 "INFO: " inl "\n => " (string-intersperse res "\n")) |
︙ | ︙ |
Modified runconfig.scm from [ae261d7ff6] to [f3494fab66].
︙ | ︙ | |||
14 15 16 17 18 19 20 | (define (setup-env-defaults db fname run-id already-seen #!key (environ-patt #f)) (let* ((keys (rdb:get-keys db)) (keyvals (rdb:get-key-vals db run-id)) (thekey (string-intersperse (map (lambda (x)(if x x "-na-")) keyvals) "/")) ;; Why was system disallowed in the reading of the runconfigs file? ;; NOTE: Should be setting env vars based on (target|default) | | | 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | (define (setup-env-defaults db fname run-id already-seen #!key (environ-patt #f)) (let* ((keys (rdb:get-keys db)) (keyvals (rdb:get-key-vals db run-id)) (thekey (string-intersperse (map (lambda (x)(if x x "-na-")) keyvals) "/")) ;; Why was system disallowed in the reading of the runconfigs file? ;; NOTE: Should be setting env vars based on (target|default) (confdat (read-config fname #f #t environ-patt: environ-patt sections: '("default" thekey))) (whatfound (make-hash-table)) (sections (list "default" thekey))) (if (not *target*)(set! *target* thekey)) ;; may save a db access or two but repeats db:get-target code (debug:print 4 "Using key=\"" thekey "\"") (for-each (lambda (key val) |
︙ | ︙ |