Index: common.scm ================================================================== --- common.scm +++ common.scm @@ -937,16 +937,16 @@ "/megatest_localdb/" tsname (string-translate *toppath* "/" ".")) )))) (set! *db-cache-path* dbpath) - ;; ensure megatest area has .db - (let ((dbarea (conc *toppath* "/.db"))) + ;; ensure megatest area has .megatest + (let ((dbarea (conc *toppath* "/.megatest"))) (if (not (file-exists? dbarea)) (create-directory dbarea))) - ;; ensure tmp area has .db - (let ((dbarea (conc dbpath "/.db"))) + ;; ensure tmp area has .megatest + (let ((dbarea (conc dbpath "/.megatest"))) (if (not (file-exists? dbarea)) (create-directory dbarea))) dbpath)) #f))) Index: db.scm ================================================================== --- db.scm +++ db.scm @@ -651,18 +651,18 @@ (define (db:all-db-sync dbstruct) (let* ((dbdat (db:open-db dbstruct #f db:initialize-main-db)) (data-synced 0) ;; count of changed records (tmp-area (common:get-db-tmp-area)) - (dbfiles (glob (conc tmp-area"/.db/*.db"))) + (dbfiles (glob (conc tmp-area"/.megatest/*.db"))) (sync-durations (make-hash-table)) (no-sync-db (db:open-no-sync-db))) (for-each (lambda (file) (debug:print-info 3 *default-log-port* "file: " file) (let* ((fname (conc (pathname-file file) ".db")) - (fulln (conc *toppath*"/.db/"fname)) + (fulln (conc *toppath*"/.megatest/"fname)) (time1 (if (file-exists? file) (file-modification-time file) (begin (debug:print-info 0 *default-log-port* "Sync - I do not see file "file) 1))) @@ -716,22 +716,22 @@ (data-synced 0) ;; count of changed records (tmp-area (common:get-db-tmp-area)) (old2new (member 'old2new options)) (src-area (if old2new *toppath* tmp-area)) (dest-area (if old2new tmp-area *toppath*)) - (dbfiles (if old2new (glob (conc *toppath* "/.db/*.db")) (glob (conc tmp-area "/.db/*.db")))) + (dbfiles (if old2new (glob (conc *toppath* "/.megatest/*.db")) (glob (conc tmp-area "/.megatest/*.db")))) (keys (db:get-keys dbstruct)) (sync-durations (make-hash-table))) (for-each (lambda (srcfile) (debug:print-info 3 *default-log-port* "file: " srcfile) (let* ((fname (conc (pathname-file srcfile) ".db")) (basename (pathname-file srcfile)) (run-id (if (string= basename "main") #f (string->number basename))) - (destfile (conc dest-area "/.db/" fname)) - (dest-directory (conc dest-area "/.db/")) + (destfile (conc dest-area "/.megatest/" fname)) + (dest-directory (conc dest-area "/.megatest/")) (dummy (debug:print-info 0 *default-log-port* "destfile = " destfile)) (time1 (file-modification-time srcfile)) (time2 (if (file-exists? destfile) (begin @@ -4677,17 +4677,17 @@ ;; sync for filesystem local db writes ;; (define (db:run-lock-and-sync no-sync-db) (let* ((tmp-area (common:get-db-tmp-area)) - (dbfiles (glob (conc tmp-area"/.db/*.db"))) + (dbfiles (glob (conc tmp-area"/.megatest/*.db"))) (sync-durations (make-hash-table))) ;; (debug:print-info 0 *default-log-port* "lock-and-sync, dbfiles: "dbfiles) (for-each (lambda (file) (let* ((fname (conc (pathname-file file) ".db")) - (fulln (conc *toppath*"/.db/"fname)) + (fulln (conc *toppath*"/.megatest/"fname)) (time1 (if (file-exists? file) (file-modification-time file) (begin (debug:print-info 0 *default-log-port* "Sync - I do not see file "file) 1))) Index: dbfile.scm ================================================================== --- dbfile.scm +++ dbfile.scm @@ -59,16 +59,16 @@ ) ;; NOTE: Need one dbr:subdb per main.db, 1.db ... ;; (defstruct dbr:subdb - (dbname #f) ;; .db/1.db - (mtdbfile #f) ;; mtrah/.db/1.db + (dbname #f) ;; .megatest/1.db + (mtdbfile #f) ;; mtrah/.megatest/1.db (mtdbdat #f) ;; only need one of these for syncing ;; (dbdats (make-hash-table)) ;; id => dbdat - (tmpdbfile #f) ;; /tmp/.../.db/1.db - ;; (refndbfile #f) ;; /tmp/.../.db/1.db_ref + (tmpdbfile #f) ;; /tmp/.../.megatest/1.db + ;; (refndbfile #f) ;; /tmp/.../.megatest/1.db_ref (dbstack (make-stack)) ;; stack for tmp dbr:dbdat, (homehost #f) ;; not used yet (on-homehost #f) ;; not used yet (read-only #f) (last-sync 0) @@ -193,12 +193,12 @@ (define (db:dbname->path apath dbname) (conc apath"/"dbname)) (define (dbfile:run-id->dbname run-id) (cond - ((number? run-id) (conc ".db/" (modulo run-id 100) ".db")) - ((not run-id) (conc ".db/main.db")) + ((number? run-id) (conc ".megatest/" (modulo run-id 100) ".db")) + ((not run-id) (conc ".megatest/main.db")) (else run-id))) ;; Make the dbstruct, setup up auxillary db's and call for main db at least once ;; ;; called in http-transport and replicated in rmt.scm for *local* access. @@ -421,11 +421,11 @@ ;; the reference db for syncing (refdbfname (conc dbpath "/"dbname"_ref")) (refndb (db:open-megatest-db refdbfname)) ;; (mtdbpath (dbr:dbdat-dbfile mtdb)) ;; the tmpdb - (tmpdbfname (conc dbpath"/"dbname)) ;; /tmp//.db/[main|1,2...].db + (tmpdbfname (conc dbpath"/"dbname)) ;; /tmp//.megatest/[main|1,2...].db (tmpdb (db:open-megatest-db tmpdbfname)) ;; lock-create-open dbpath db:initialize-main-db)) (dbfexists (common:file-exists? tmpdbfname)) ;; (conc dbpath "/megatest.db"))) (tmpdbmodtime (if dbfexists (common:lazy-sqlite-db-modification-time tmpdbfname) #f)) (write-access (file-write-access? mtdbfname)) Index: runs.scm ================================================================== --- runs.scm +++ runs.scm @@ -2361,11 +2361,11 @@ (bup-mutex (make-mutex)) (keep-records (args:get-arg "-keep-records")) ;; used in conjunction with -remove-runs to keep the records, TODO: consolidate this with "mode". (test-records '())) ;; for tasks that we wish to operate on all tests in one fell swoop (let* ((write-access-actions '(remove-runs set-state-status archive run-wait kill-runs)) - (dbfile (conc *toppath* "/.db/main.db")) + (dbfile (conc *toppath* "/.megatest/main.db")) (readonly-mode (not (file-write-access? dbfile)))) (when (and readonly-mode (member action write-access-actions)) (debug:print-error 0 *default-log-port* dbfile " is readonly. Cannot proceed with action ["action"] in which write-access isrequired .") (exit 1))) Index: utils/mt-new-to-old.sh ================================================================== --- utils/mt-new-to-old.sh +++ utils/mt-new-to-old.sh @@ -1,8 +1,8 @@ #!/bin/bash -cp .db/main.db megatest.db +cp .megatest/main.db megatest.db -for db in $(ls .db/?.db); do +for db in $(ls .megatest/?.db); do echo $db sqlite3 $db "SELECT * FROM tests" | sqlite3 megatest.db ".import /dev/stdin tests" done Index: utils/mt-old-to-new.sh ================================================================== --- utils/mt-old-to-new.sh +++ utils/mt-old-to-new.sh @@ -1,24 +1,24 @@ #!/bin/bash -mkdir -p .db -cp megatest.db .db/main.db -sqlite3 .db/main.db << END_SQL +mkdir -p .megatest +cp megatest.db .megatest/main.db +sqlite3 .megatest/main.db << END_SQL delete from tests; delete from test_steps; END_SQL -version_id=$(sqlite3 .db/main.db "select id from metadat where var = 'MEGATEST_VERSION'") +version_id=$(sqlite3 .megatest/main.db "select id from metadat where var = 'MEGATEST_VERSION'") current_version=$(megatest -version) -sqlite3 .db/main.db "replace into metadat (id,var,val) values($version_id,'MEGATEST_VERSION','$current_version')" +sqlite3 .megatest/main.db "replace into metadat (id,var,val) values($version_id,'MEGATEST_VERSION','$current_version')" sqlite3 megatest.db 'select id from runs' > runs.txt for run in $(cat runs.txt) do dbnum=$(($run%100)) - cp megatest.db .db/$dbnum.db - sqlite3 .db/$dbnum.db << END_SQL + cp megatest.db .megatest/$dbnum.db + sqlite3 .megatest/$dbnum.db << END_SQL delete from tests where run_id != $run; delete from test_data; delete from test_meta; delete from test_rundat; delete from test_steps where not exists ( select id from tests where tests.id = test_steps.test_id);