[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: using Cuirass to track a guix packages' git
From: |
Jan Nieuwenhuizen |
Subject: |
Re: using Cuirass to track a guix packages' git |
Date: |
Fri, 23 Sep 2016 15:44:45 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Jan Nieuwenhuizen writes:
Oops, sent too soon, patch 2 needed this fix
diff --git a/src/cuirass/database.scm b/src/cuirass/database.scm
index 0dcf544..5d3922b 100644
--- a/src/cuirass/database.scm
+++ b/src/cuirass/database.scm
@@ -141,7 +141,7 @@ INSERT INTO Specifications\
(#:branch . ,branch)
(#:tag . ,(if (string=? tag "NULL") #f tag))
(#:commit . ,(if (string=? rev "NULL") #f rev))
- (#:no-compile? . ,(zero? no-compile?)))
+ (#:no-compile? . ,(not (zero? no-compile?))))
specs))))))
(define (db-add-derivation db job)
Greetings,
Jan
>From 2ddac2390c42836cb5073ce67466802e2306e1aa Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <address@hidden>
Date: Thu, 15 Sep 2016 23:15:54 +0200
Subject: [PATCH 2/4] cuirass: 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.
* src/cuirass/base.scm (process-specs): Skip compilation if #:no-compile?.
---
src/cuirass/base.scm | 5 +++--
src/cuirass/database.scm | 12 +++++++-----
src/schema.sql | 3 ++-
3 files changed, 12 insertions(+), 8 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..5d3922b 100644
--- a/src/cuirass/database.scm
+++ b/src/cuirass/database.scm
@@ -116,11 +116,12 @@ database object."
"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');"
+ (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,7 @@ 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 +140,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? . ,(not (zero? 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 (
--
2.9.3
--
Jan Nieuwenhuizen <address@hidden> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | AvatarĀ® http://AvatarAcademy.nl
- using Cuirass to track a guix packages' git, Jan Nieuwenhuizen, 2016/09/16
- Re: using Cuirass to track a guix packages' git, Mathieu Lirzin, 2016/09/20
- Re: using Cuirass to track a guix packages' git, Mathieu Lirzin, 2016/09/22
- Re: using Cuirass to track a guix packages' git, Jan Nieuwenhuizen, 2016/09/23
- Re: using Cuirass to track a guix packages' git,
Jan Nieuwenhuizen <=
- Re: using Cuirass to track a guix packages' git, Mathieu Lirzin, 2016/09/23
- Re: using Cuirass to track a guix packages' git, Jan Nieuwenhuizen, 2016/09/23
- Re: using Cuirass to track a guix packages' git, Mathieu Lirzin, 2016/09/23
- Re: using Cuirass to track a guix packages' git, Jan Nieuwenhuizen, 2016/09/23
- Re: using Cuirass to track a guix packages' git, Mathieu Lirzin, 2016/09/23
- Re: using Cuirass to track a guix packages' git, David Craven, 2016/09/23
- Re: using Cuirass to track a guix packages' git, Mathieu Lirzin, 2016/09/23
- Re: using Cuirass to track a guix packages' git, Jan Nieuwenhuizen, 2016/09/24
- Re: using Cuirass to track a guix packages' git, Mathieu Lirzin, 2016/09/28