Index: common.scm ================================================================== --- common.scm +++ common.scm @@ -348,32 +348,36 @@ "unknown" (caar uname-res)))) (define (save-environment-as-files fname #!key (ignorevars (list "USER" "HOME" "DISPLAY" "LS_COLORS" "XKEYSYMDB" "EDITOR"))) (let ((envvars (get-environment-variables)) - (whitesp (regexp "[^a-zA-Z0-9_\\-:;,.\\/%$]"))) + (whitesp (regexp "[^a-zA-Z0-9_\\-:,.\\/%$]"))) (with-output-to-file (conc fname ".csh") (lambda () (for-each (lambda (keyval) - (let* ((key (car keyval)) - (val (cdr keyval)) - (sval (if (string-search whitesp val)(conc "\"" val "\"") val))) + (let* ((key (car keyval)) + (val (cdr keyval)) + (delim (if (string-search whitesp val) + "\"" + ""))) (print (if (member key ignorevars) "# setenv " "setenv ") - key " " sval))) - envvars))) + key " " delim val delim))) + envvars))) (with-output-to-file (conc fname ".sh") (lambda () (for-each (lambda (keyval) (let* ((key (car keyval)) (val (cdr keyval)) - (sval (if (string-search whitesp val)(conc "\"" val "\"") val))) + (delim (if (string-search whitesp val) + "\"" + ""))) (print (if (member key ignorevars) "# export " "export ") - key "=" sval))) + key "=" delim val delim))) envvars))))) ;; set some env vars from an alist, return an alist with original values ;; (("VAR" "value") ...) (define (alist->env-vars lst) Index: megatest.scm ================================================================== --- megatest.scm +++ megatest.scm @@ -108,10 +108,12 @@ -list-db-targets : list the target combinations used in the db -show-config : dump the internal representation of the megatest.config file -show-runconfig : dump the internal representation of the runconfigs.config file -dumpmode json : dump in json format instead of sexpr -show-cmdinfo : dump the command info for a test (run in test environment) + -section sectionName + -var varName : for config and runconfig lookup value for sectionName varName Misc -start-dir path : switch to this directory before running megatest -rebuild-db : bring the database schema up to date -cleanup-db : remove any orphan records, vacuum the db @@ -201,10 +203,12 @@ "-debug" ;; for *verbosity* > 2 "-gen-megatest-test" "-override-timeout" "-test-files" ;; -test-paths is for listing all "-load" ;; load and exectute a scheme file + "-section" + "-var" "-dumpmode" ) (list "-h" "-version" "-force" @@ -477,10 +481,13 @@ (let ((tl (setup-for-run))) (push-directory *toppath*) (let ((data (full-runconfigs-read))) ;; keep this one local (cond + ((and (args:get-arg "-section") + (args:get-arg "-var")) + (print (configf:lookup data (args:get-arg "-section")(args:get-arg "-var")))) ((not (args:get-arg "-dumpmode")) (pp (hash-table->alist data))) ((string=? (args:get-arg "-dumpmode") "json") (json-write data)) (else @@ -492,10 +499,13 @@ (let ((tl (setup-for-run)) (data *configdat*)) ;; (read-config "megatest.config" #f #t))) (push-directory *toppath*) ;; keep this one local (cond + ((and (args:get-arg "-section") + (args:get-arg "-var")) + (print (configf:lookup data (args:get-arg "-section")(args:get-arg "-var")))) ((not (args:get-arg "-dumpmode")) (pp (hash-table->alist data))) ((string=? (args:get-arg "-dumpmode") "json") (json-write data)) (else