Index: runs.scm ================================================================== --- runs.scm +++ runs.scm @@ -32,32 +32,34 @@ ;; register a test run with the db ;; ;; Use: (db-get-value-by-header (db:get-header runinfo)(db:get-row runinfo)) ;; to extract info from the structure returned ;; -(define (runs:get-runs-by-patt db keys runnamepatt . params) ;; test-name) +(define (runs:get-runs-by-patt db keys runnamepatt) ;; test-name) (let* ((keyvallst (keys->vallist keys)) (tmp (runs:get-std-run-fields keys '("id" "runname" "state" "status" "owner" "event_time"))) (keystr (car tmp)) (header (cadr tmp)) (res '()) - (key-patt "")) + (key-patt "") + (runwildtype (if (substring-index "%" runnamepatt) "like" "glob"))) (for-each (lambda (keyval) (let* ((key (vector-ref keyval 0)) (fulkey (conc ":" key)) - (patt (args:get-arg fulkey))) + (patt (args:get-arg fulkey)) + (wildtype (if (substring-index "%" patt) "like" "glob"))) (if patt - (set! key-patt (conc key-patt " AND " key " like '" patt "'")) + (set! key-patt (conc key-patt " AND " key " " wildtype " '" patt "'")) (begin (debug:print 0 "ERROR: searching for runs with no pattern set for " fulkey) (exit 6))))) keys) (sqlite3:for-each-row (lambda (a . r) (set! res (cons (list->vector (cons a r)) res))) db - (conc "SELECT " keystr " FROM runs WHERE runname like ? " key-patt ";") + (conc "SELECT " keystr " FROM runs WHERE runname " runwildtype " ? " key-patt ";") runnamepatt) (vector header res))) (define (runs:test-get-full-path test) (let* ((testname (db:test-get-testname test))