mirror of https://notabug.org/mthl/cuirass.git
base: Support tracking of a Guix package's git.
* src/schema.sql (Specifications): Add no_compile_p column. * src/cuirass/database.scm (db-add-specification) (db-get-specifications): Handle #:no-compile? property. * tests/database.scm (example-spec): Adapt. * src/cuirass/base.scm (process-specs): Skip compilation if #:no-compile?. Signed-off-by: Mathieu Lirzin <mthl@gnu.org>pull/3/head
parent
fca42b010e
commit
5ef0701f54
|
@ -149,8 +149,9 @@ if required."
|
|||
(let ((commit (fetch-repository spec))
|
||||
(stamp (db-get-stamp db spec)))
|
||||
(unless (string=? commit stamp)
|
||||
(compile (string-append (%package-cachedir) "/"
|
||||
(assq-ref spec #:name)))
|
||||
(unless (assq-ref spec #:no-compile?)
|
||||
(compile (string-append (%package-cachedir) "/"
|
||||
(assq-ref spec #:name))))
|
||||
(with-store store
|
||||
(let* ((spec* (acons #:current-commit commit spec))
|
||||
(jobs (evaluate store db spec*)))
|
||||
|
|
|
@ -115,12 +115,13 @@ database object."
|
|||
(define (db-add-specification db spec)
|
||||
"Store specification SPEC in database DB and return its ID."
|
||||
(apply sqlite-exec db "\
|
||||
INSERT INTO Specifications\
|
||||
(repo_name, url, load_path, file, proc, arguments, branch, tag, revision)\
|
||||
VALUES ('~A', '~A', '~A', '~A', '~S', '~S', '~A', '~A', '~A');"
|
||||
INSERT INTO Specifications (repo_name, url, load_path, file, proc, arguments, \
|
||||
branch, tag, revision, no_compile_p) \
|
||||
VALUES ('~A', '~A', '~A', '~A', '~S', '~S', '~A', '~A', '~A', ~A);"
|
||||
(append
|
||||
(assq-refs spec '(#:name #:url #:load-path #:file #:proc #:arguments))
|
||||
(assq-refs spec '(#:branch #:tag #:commit) "NULL")))
|
||||
(assq-refs spec '(#:branch #:tag #:commit) "NULL")
|
||||
(list (if (assq-ref spec #:no-compile?) "1" "0"))))
|
||||
(last-insert-rowid db))
|
||||
|
||||
(define (db-get-specifications db)
|
||||
|
@ -128,7 +129,8 @@ INSERT INTO Specifications\
|
|||
(specs '()))
|
||||
(match rows
|
||||
(() specs)
|
||||
((#(id name url load-path file proc args branch tag rev) . rest)
|
||||
((#(id name url load-path file proc args branch tag rev no-compile?)
|
||||
. rest)
|
||||
(loop rest
|
||||
(cons `((#:id . ,id)
|
||||
(#:name . ,name)
|
||||
|
@ -139,7 +141,8 @@ INSERT INTO Specifications\
|
|||
(#:arguments . ,(with-input-from-string args read))
|
||||
(#:branch . ,branch)
|
||||
(#:tag . ,(if (string=? tag "NULL") #f tag))
|
||||
(#:commit . ,(if (string=? rev "NULL") #f rev)))
|
||||
(#:commit . ,(if (string=? rev "NULL") #f rev))
|
||||
(#:no-compile? . ,(positive? no-compile?)))
|
||||
specs))))))
|
||||
|
||||
(define (db-add-derivation db job)
|
||||
|
|
|
@ -11,7 +11,8 @@ CREATE TABLE Specifications (
|
|||
-- The following columns are optional.
|
||||
branch TEXT,
|
||||
tag TEXT,
|
||||
revision TEXT
|
||||
revision TEXT,
|
||||
no_compile_p INTEGER
|
||||
);
|
||||
|
||||
CREATE TABLE Stamps (
|
||||
|
|
|
@ -30,7 +30,8 @@
|
|||
(#:arguments (subset . "hello"))
|
||||
(#:branch . "master")
|
||||
(#:tag . #f)
|
||||
(#:commit . #f)))
|
||||
(#:commit . #f)
|
||||
(#:no-compile? . #f)))
|
||||
|
||||
(define* (make-dummy-job #:optional (name "foo"))
|
||||
`((#:name . ,name)
|
||||
|
|
Loading…
Reference in New Issue