Index: newdashboard.scm ================================================================== --- newdashboard.scm +++ newdashboard.scm @@ -197,20 +197,32 @@ (defstruct mtdb name db path) + +;; fall back to old megatest db if .megatest/dbname not found +;; +(define (megatest-find-db path dbname) + (let ((newpath (conc path"/.megatest/"dbname)) + (oldpath (conc path"/megatest.db"))) + (if (file-exists? newpath) + newpath + (if (file-exists? oldpath) + oldpath + #f)))) ;; dbname is main.db, 1.db ... (define (megatest-open-db area-name dbname) (let* ((mtdbh (area-get-dbh area-name dbname))) (if mtdbh mtdbh (let* ((ainfo (get-area-info area-name)) (path (area-path ainfo)) - (dbpath (conc path"/.megatest/"dbname)) - (dbexists (and (file-exists? dbpath) + (dbpath (megatest-find-db path dbname)) + (dbexists (and dbpath + (file-exists? dbpath) (file-read-access? dbpath)))) (if dbexists (let* ((db (open-database dbpath))) (set-busy-handler! db (make-busy-timeout 136000)) (execute db "PRAGMA synchronous = 0;")