Index: configf.scm ================================================================== --- configf.scm +++ configf.scm @@ -235,11 +235,11 @@ (for-each (lambda (dat) (let ((patt (car dat)) (proc (cdr dat))) (if (string-match patt curr-section-name) - (proc curr-section-name section-name ht path)))) + (proc curr-section-name section-name res path)))) post-section-procs) (loop (configf:read-line inp res allow-system settings) ;; if we have the sections list then force all settings into "" and delete it later? (if (or (not sections) (member section-name sections)) @@ -314,17 +314,18 @@ (let* ((curr-dir (current-directory)) (configinfo (find-config fname toppath: given-toppath)) (toppath (car configinfo)) (configfile (cadr configinfo)) (set-fields (lambda (curr-section next-section ht path) - (let ((field-names (keys:config-get-fields confdat)) + (let ((field-names (if ht (keys:config-get-fields ht) '())) (target (or (getenv "MT_TARGET")(args:get-arg "-reqtarg")(args:get-arg "-target")))) - (keys:target-set-args keys target #f))))) + (debug:print-info 9 "set-fields with field-names=" field-names " target=" target " curr-section=" curr-section " next-section=" next-section " path=" path " ht=" ht) + (if (not (null? field-names))(keys:target-set-args field-names target #f)))))) (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 (list (cons "^fields$" set-fields)) #f)))) + (read-config configfile #f #t environ-patt: environ-patt post-section-procs: (list (cons "^fields$" set-fields)) #f)))) (if toppath (change-directory curr-dir)) (list configdat toppath configfile fname)))) (define (config-lookup cfgdat section var) (if (hash-table? cfgdat) Index: keys.scm ================================================================== --- keys.scm +++ keys.scm @@ -35,19 +35,21 @@ ;; be called once let's use it to set the environment vars ;; ;; The setting of :keyfield in args should be turned off ASAP ;; (define (keys:target-set-args keys target ht) - (let ((vals (string-split target "/"))) - (if (eq? (length vals)(length keys)) - (for-each (lambda (key val) - (setenv key val) - (hash-table-set! ht (conc ":" key) val)) - keys - vals) - (debug:print 0 "ERROR: wrong number of values in " target ", should match " keys)) - vals)) + (if target + (let ((vals (string-split target "/"))) + (if (eq? (length vals)(length keys)) + (for-each (lambda (key val) + (setenv key val) + (if ht (hash-table-set! ht (conc ":" key) val))) + keys + vals) + (debug:print 0 "ERROR: wrong number of values in " target ", should match " keys)) + vals) + (debug:print 4 "ERROR: keys:target-set-args called with no target."))) ;; given the keys (a list of vectors or a list of keys) and a target return a keyval list ;; keyval list ( (key1 val1) (key2 val2) ...) (define (keys:target->keyval keys target) (let* ((targlist (string-split target "/"))