aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Nieuwenhuizen <janneke@gnu.org>2016-09-15 23:15:54 +0200
committerMathieu Lirzin <mthl@gnu.org>2016-09-23 16:50:36 +0200
commit5ef0701f54482b83c433beb578715eb0d5321a74 (patch)
treec7d970a1b7c1a11f6005aa497fcfcc6d5d3c415f
parentfca42b010e56532fded536534ccb15b078a33e77 (diff)
downloadcuirass-5ef0701f54482b83c433beb578715eb0d5321a74.tar
cuirass-5ef0701f54482b83c433beb578715eb0d5321a74.tar.gz
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>
-rw-r--r--src/cuirass/base.scm5
-rw-r--r--src/cuirass/database.scm15
-rw-r--r--src/schema.sql3
-rw-r--r--tests/database.scm3
4 files changed, 16 insertions, 10 deletions
diff --git a/src/cuirass/base.scm b/src/cuirass/base.scm
index 8ad6af4..3d542b1 100644
--- a/src/cuirass/base.scm
+++ b/src/cuirass/base.scm
@@ -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*)))
diff --git a/src/cuirass/database.scm b/src/cuirass/database.scm
index 2d2dfd2..f1505e8 100644
--- a/src/cuirass/database.scm
+++ b/src/cuirass/database.scm
@@ -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)
diff --git a/src/schema.sql b/src/schema.sql
index a545da5..f8042d1 100644
--- a/src/schema.sql
+++ b/src/schema.sql
@@ -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 (
diff --git a/tests/database.scm b/tests/database.scm
index 46c5794..2dd3746 100644
--- a/tests/database.scm
+++ b/tests/database.scm
@@ -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)