Index: .mtutil.scm ================================================================== --- .mtutil.scm +++ .mtutil.scm @@ -61,7 +61,7 @@ (hash-table-set! *runname-mappers* 'auto (lambda (target run-name area area-path reason contour mode-patt) "auto-eh")) -(print "Got here!") +;; (print "Got here!") Index: cgisetup/models/pgdb.scm ================================================================== --- cgisetup/models/pgdb.scm +++ cgisetup/models/pgdb.scm @@ -25,12 +25,17 @@ (use typed-records (prefix dbi dbi:)) ;; given a configdat lookup the connection info and open the db ;; -(define (pgdb:open configdat #!key (dbname #f)) - (let ((pgconf (or (args:get-arg "-pgsync") (configf:lookup configdat "ext-sync" (or dbname "pgdb"))))) +(define (pgdb:open configdat #!key (dbname #f)(dbispec #f)) + (let ((pgconf (or dbispec + (args:get-arg "-pgsync") + (if configdat + (configf:lookup configdat "ext-sync" (or dbname "pgdb")) + #f) + ))) (if pgconf (let* ((confdat (map (lambda (conf-item) (let ((parts (string-split conf-item ":"))) (if (> (length parts) 1) (let ((key (car parts)) @@ -252,10 +257,27 @@ (hash-table-set! data first newht) (set! coldat newht))) (hash-table-set! coldat rest run))) runs) data)) + +;; given ordered data hash return a-keys +;; +(define (pgdb:ordered-data->a-keys ordered-data) + (sort (hash-table-keys ordered-data) string>=?)) + +;; given ordered data hash return b-keys +;; +(define (pgdb:ordered-data->b-keys ordered-data a-keys) + (delete-duplicates + (sort (apply + append + (map (lambda (sub-key) + (let ((subdat (hash-table-ref ordered-data sub-key))) + (hash-table-keys subdat))) + a-keys)) + string>=?))) (define (pgdb:runs-to-hash runs ) (let* ((data (make-hash-table))) (for-each (lambda (run) Index: cgisetup/pages/home_view.scm ================================================================== --- cgisetup/pages/home_view.scm +++ cgisetup/pages/home_view.scm @@ -74,20 +74,14 @@ (s:fieldset (conc "Runs data for " tfilter) ;; ;; A very basic display ;; - (let* ((a-keys (sort (hash-table-keys ordered-data) string>=?)) - (b-keys (delete-duplicates(sort (apply - append - (map (lambda (sub-key) - (let ((subdat (hash-table-ref ordered-data sub-key))) - (hash-table-keys subdat))) - a-keys)) - string>=?)))) - ; (c-keys (delete-duplicates b-keys))) - (if #f ;; swap rows/cols + (let* ((a-keys (pgdb:ordered-data->a-keys ordered-data)) + (b-keys (pgdb:ordered-data->b-keys ordered-data a-keys))) + ;; (c-keys (delete-duplicates b-keys))) + (if #f ;; swap rows/cols (s:table (s:tr (s:td "")(map s:tr b-keys)) (map (lambda (row-key) (let ((subdat (hash-table-ref ordered-data row-key))) @@ -98,11 +92,11 @@ (s:td (if dat (list (vector-ref dat 0)(vector-ref dat 1)) ""))))) b-keys)))) a-keys)) - + (s:table (s:tr (s:td "")(map s:td a-keys)) (map (lambda (row-key) (s:tr (s:td row-key) Index: dashboard.scm ================================================================== --- dashboard.scm +++ dashboard.scm @@ -150,14 +150,19 @@ )) ;; RA => returns the tabdat stored at hashkey passed in commondat-tabdats table (e.g. 0 gives summary) ;; (define (dboard:common-get-tabdat commondat #!key (tab-num #f)) - (hash-table-ref/default - (dboard:commondat-tabdats commondat) - (or tab-num (dboard:commondat-curr-tab-num commondat)) ;; tab-num value is curr-tab-num value in passed commondat - #f)) + (let* ((tnum (or tab-num + (dboard:commondat-curr-tab-num commondat) + 0)) ;; tab-num value is curr-tab-num value in passed commondat + (ht (dboard:commondat-tabdats commondat)) + (res (hash-table-ref/default ht tnum #f))) + (or res + (let ((new-tabdat (dboard:tabdat-make-data))) + (hash-table-set! ht tnum new-tabdat) + new-tabdat)))) ;; RA => sets the tabdat passed to the hashkey at commondat:tabdats hash table ;; (define (dboard:common-set-tabdat! commondat tabnum tabdat) (hash-table-set! @@ -1934,20 +1939,20 @@ exn (begin (print-call-chain) (debug:print 0 *default-log-port* " message: " ((condition-property-accessor 'exn 'message) exn)) (debug:print 0 *default-log-port* "ERROR: failed call procedure \"" updater - "\", with; tabnum=" tabnum ", view-name=" view-name + "\", with; tabnum=" tab-num ", view-name=" view-name ", and views-cfgdat and megatest configdat as parameters. To debug try loading in the repl: megatest -repl") (set! success #f)) (debug:print 4 *default-log-port* "Running updater for tab " view-name " with proc " updater " and tab-num: " tab-num) ((eval (string->symbol updater)) commondat tabs tab-num view-name views-cfgdat *configdat*))) tab-num: tab-num)) - (if success - (begin - ;; (iup:attribute-set! tabs (conc "TABTITLE" tab-num) view-name) - (dboard:common-set-tabdat! commondat tab-num (dboard:tabdat-make-data)))) + ;;(if success + ;; (begin + ;; ;; (iup:attribute-set! tabs (conc "TABTITLE" tab-num) view-name) + ;; (dboard:common-set-tabdat! commondat tab-num (dboard:tabdat-make-data)))) result-child)) (define (dboard:runs-summary-buttons-updater tabdat) ADDED gentargets.sh Index: gentargets.sh ================================================================== --- /dev/null +++ gentargets.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +echo '[v1.63/tip/dev]' +echo 'x 1' +echo '[v1.64/tip/dev]' +echo 'x 1' Index: megatest.config ================================================================== --- megatest.config +++ megatest.config @@ -1,16 +1,22 @@ +[fields] +a text +b text +c text + [setup] pktsdirs /tmp/pkts /some/other/source [areas] # path-to-area map-target-script(future, optional) fullrun path=tests/fullrun # targtrans is name of scheme proc stored in .mtutil.scm, which lives in PWD where mtutil is run -ext-tests path=ext-tests; targtrans=prefix-contour; +# ext-tests path=ext-tests; targtrans=prefix-contour; +ext-tests path=ext-tests [contours] # mode-patt/tag-expr quick selector=QUICKPATT/quick -full areas=fullrun,ext-tests; selector=MAXPATT/all +full areas=fullrun,ext-tests; selector=MAXPATT/ all areas=fullrun,ext-tests snazy areas=%; selector=QUICKPATT/ Index: mtut.scm ================================================================== --- mtut.scm +++ mtut.scm @@ -28,14 +28,10 @@ (require-library stml) (define *target-mappers* (make-hash-table)) ;; '()) (define *runname-mappers* (make-hash-table)) ;; '()) -(let ((debugcontrolf (conc (get-environment-variable "HOME") "/.mtutilrc"))) - (if (file-exists? debugcontrolf) - (load debugcontrolf))) - ;; this needs some thought regarding security implications. ;; ;; i. Check that owner of the file and calling user are same? ;; ii. Check that we are in a legal megatest area? ;; iii. Have some form of authentication or record of the md5sum or similar of the file? @@ -393,11 +389,13 @@ (let* ((sched (cond ((vector? sched-in)(local-time->seconds sched-in)) ;; we recieved a time ((number? sched-in) sched-in) (else (current-seconds)))) (args-data (if args-alist - args-alist + (if (hash-table? args-alist) ;; seriously? + (hash-table->alist args-alist) + args-alist) (hash-table->alist args:arg-hash))) ;; if no args-alist then we assume this is a call driven directly by commandline (alldat (apply append (list 'T "cmd" 'a action 'U (current-user-name) 'D sched) @@ -883,10 +881,14 @@ (define (get-pkts-dir mtconf) (let ((pktsdirs (configf:lookup mtconf "setup" "pktsdirs")) (pktsdir (if pktsdirs (car (string-split pktsdirs " ")) #f))) pktsdir)) +(let ((debugcontrolf (conc (get-environment-variable "HOME") "/.mtutilrc"))) + (if (file-exists? debugcontrolf) + (load debugcontrolf))) + (if *action* (case (string->symbol *action*) ((run remove rerun set-ss archive kill) (let* ((mtconfdat (simple-setup (args:get-arg "-start-dir"))) (mtconf (car mtconfdat)) @@ -937,11 +939,10 @@ ;; (if (get-environment-variable "HTTP_HOST") (begin (stml:main #f) (exit))) - (if (or (args:get-arg "-repl") (args:get-arg "-load")) (begin (import extras) ;; might not be needed Index: runconfigs.config ================================================================== --- runconfigs.config +++ runconfigs.config @@ -9,13 +9,19 @@ # example of a cron entry to run sync using db spec pgdb, with pgdb setting in file local.config # [a/b/c] all:scheduled:sync cron= 0/5 * * * *;dbdest=pgdb;appendconf=/mfs/matt/.sysmaint/local.config quick:scheduled:sync cron= 0/5 * * * *;dbdest=pgdb;appendconf=/mfs/matt/.sysmaint/local.config + +[scriptinc ./gentargets.sh] +# [v1.23/45/67] # tip will be replaced with hashkey? -[v1.63/tip/dev] + +[/.*/] + +# [v1.63/tip/dev] # file: files changes since last run trigger new run # script: script is called with unix seconds as last parameter (other parameters are preserved) # # contour:sensetype:action params data quick:file:run runtrans=auto; glob=/home/matt/data/megatest/*.scm