aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMathieu Lirzin <mthl@gnu.org>2016-07-27 19:19:26 +0200
committerMathieu Lirzin <mthl@gnu.org>2016-07-30 23:07:19 +0200
commitac4512897c6e08f26f87d9b7ddd9120436610513 (patch)
treeeb046f2216bdebd9130be902287ed099d21d9648 /src
parentad267dc86aeea70b3e1e83914f808f21ce98118f (diff)
downloadcuirass-ac4512897c6e08f26f87d9b7ddd9120436610513.tar
cuirass-ac4512897c6e08f26f87d9b7ddd9120436610513.tar.gz
schema: Evaluations: Add 'revision' column.
* src/schema.sql (Evaluations): Add 'revision' column. * src/cuirass/database.scm (db-add-evaluation): Adapt. All callers changed.
Diffstat (limited to 'src')
-rw-r--r--src/cuirass/base.scm3
-rw-r--r--src/cuirass/database.scm8
-rw-r--r--src/schema.sql1
3 files changed, 8 insertions, 4 deletions
diff --git a/src/cuirass/base.scm b/src/cuirass/base.scm
index baf8909..52e0d00 100644
--- a/src/cuirass/base.scm
+++ b/src/cuirass/base.scm
@@ -147,7 +147,8 @@ if required."
(compile (string-append (%package-cachedir) "/"
(assq-ref spec #:name)))
(with-store store
- (let ((jobs (evaluate store db spec)))
+ (let* ((spec* (acons #:current-commit commit spec))
+ (jobs (evaluate store db spec*)))
(set-build-options store #:use-substitutes? #f)
(build-packages store db jobs))))
(db-add-stamp db spec commit)))
diff --git a/src/cuirass/database.scm b/src/cuirass/database.scm
index b831833..2d2dfd2 100644
--- a/src/cuirass/database.scm
+++ b/src/cuirass/database.scm
@@ -155,9 +155,11 @@ INSERT INTO Derivations (derivation, job_name, evaluation)\
"Retrieve a job in database DB which corresponds to ID."
(car (sqlite-exec db "SELECT * FROM Derivations WHERE derivation='~A';" id)))
-(define (db-add-evaluation db spec-id)
- (sqlite-exec db "INSERT INTO Evaluations (specification) VALUES ('~A');"
- spec-id)
+(define (db-add-evaluation db eval)
+ (sqlite-exec db "\
+INSERT INTO Evaluations (specification, revision) VALUES ('~A', '~A');"
+ (assq-ref eval #:specification)
+ (assq-ref eval #:revision))
(last-insert-rowid db))
(define-syntax-rule (with-database db body ...)
diff --git a/src/schema.sql b/src/schema.sql
index 725d145..a545da5 100644
--- a/src/schema.sql
+++ b/src/schema.sql
@@ -23,6 +23,7 @@ CREATE TABLE Stamps (
CREATE TABLE Evaluations (
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
specification INTEGER NOT NULL,
+ revision TEXT NOT NULL,
FOREIGN KEY (specification) REFERENCES Specifications (id)
);