Index: common.scm ================================================================== --- common.scm +++ common.scm @@ -146,10 +146,16 @@ "disks" '("none" ""))) ;;====================================================================== ;; System stuff ;;====================================================================== + +;; return a nice clean pathname made absolute +(define (nice-path dir) + (normalize-pathname (if (absolute-pathname? dir) + dir + (conc (current-directory) "/" dir)))) (define (get-df path) (let* ((df-results (cmd-run->list (conc "df " path))) (space-rx (regexp "([0-9]+)\\s+([0-9]+)%")) (freespc #f)) Index: configf.scm ================================================================== --- configf.scm +++ configf.scm @@ -148,24 +148,24 @@ res) (regex-case inl (configf:comment-rx _ (loop (configf:read-line inp res allow-system) curr-section-name #f #f)) (configf:blank-l-rx _ (loop (configf:read-line inp res allow-system) curr-section-name #f #f)) - (configf:include-rx ( x include-file ) (let* ((curr-dir (current-directory)) - (full-conf (if (absolute-pathname? include-file) - include-file - (conc curr-dir "/" include-file))) - (conf-dir (pathname-directory include-file)) - (incfname (pathname-strip-directory include-file))) + (configf:include-rx ( x include-file ) (let* ((curr-conf-dir (pathname-directory path)) + (full-conf (if (absolute-pathname? include-file) + include-file + (nice-path + (conc curr-conf-dir "/" include-file))))) (if (file-exists? full-conf) (begin ;; (push-directory conf-dir) (read-config full-conf res allow-system environ-patt: environ-patt curr-section: curr-section-name sections: sections) ;; (pop-directory) (loop (configf:read-line inp res allow-system) curr-section-name #f #f)) (begin - (debug:print 0 "INFO: include file " include-file " not found (called from " path ")") + (debug:print 2 "INFO: include file " include-file " not found (called from " path ")") + (debug:print 2 " " full-conf) (loop (configf:read-line inp res allow-system) curr-section-name #f #f))))) (configf:section-rx ( x section-name ) (loop (configf:read-line inp res allow-system) ;; if we have the sections list then force all settings into "" and delete it later? (if (or (not sections) (member section-name sections)) Index: runconfig.scm ================================================================== --- runconfig.scm +++ runconfig.scm @@ -1,11 +1,11 @@ ;;====================================================================== ;; read a config file, loading only the section pertinent ;; to this run field1val/field2val/field3val ... ;;====================================================================== -(use format) +(use format directory-utils) (declare (unit runconfig)) (declare (uses common)) (include "common_records.scm") @@ -60,17 +60,19 @@ (debug:print 2 "---") (set! *already-seen-runconfig-info* #t))) finaldat)) (define (set-run-config-vars db run-id keys keyvals) + (push-directory *toppath*) (let ((runconfigf (conc *toppath* "/runconfigs.config")) (targ (or (args:get-arg "-target") (args:get-arg "-reqtarg") (db:get-target db run-id)))) + (pop-directory) (if (file-exists? runconfigf) (setup-env-defaults runconfigf run-id #t keys keyvals environ-patt: (conc "(default" (if targ (conc "|" targ ")") ")"))) (debug:print 0 "WARNING: You do not have a run config file: " runconfigf))))