summaryrefslogtreecommitdiff
path: root/guix/scripts/substitute-binary.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-05-12 15:46:16 +0200
committerLudovic Courtès <ludo@gnu.org>2013-05-12 15:46:16 +0200
commitc0cd1b3ea7753fe2826f7a336019000df9dea96f (patch)
treea7e376f68216dcd26eab06aea5ff529b483fea00 /guix/scripts/substitute-binary.scm
parent9b1ef2f3232e7af111ba05353008ebd2f8955f02 (diff)
downloadgnu-guix-c0cd1b3ea7753fe2826f7a336019000df9dea96f.tar
gnu-guix-c0cd1b3ea7753fe2826f7a336019000df9dea96f.tar.gz
Move record utilities to (guix records).
* guix/utils.scm (define-record-type*): Move to... * guix/records.scm: ... here. New file. * guix/build-system.scm, guix/packages.scm: Use it. * guix/gnu-maintenance.scm: Likewise. (official-gnu-packages)[alist->record]: Remove. * guix/scripts/substitute-binary.scm: Likewise. (alist->record, object->fields): Remove. * tests/utils.scm ("define-record-type*", "define-record-type* with letrec* behavior", "define-record-type* & inherit", "define-record-type* & inherit & letrec* behavior", "define-record-type* & thunked", "define-record-type* & thunked & default", "define-record-type* & thunked & inherited"): Move to... * tests/records.scm: ... here. New file.
Diffstat (limited to 'guix/scripts/substitute-binary.scm')
-rwxr-xr-xguix/scripts/substitute-binary.scm17
1 files changed, 1 insertions, 16 deletions
diff --git a/guix/scripts/substitute-binary.scm b/guix/scripts/substitute-binary.scm
index 995078e630..5965e936f9 100755
--- a/guix/scripts/substitute-binary.scm
+++ b/guix/scripts/substitute-binary.scm
@@ -21,6 +21,7 @@
#:use-module (guix store)
#:use-module (guix utils)
#:use-module (guix config)
+ #:use-module (guix records)
#:use-module (guix nar)
#:use-module ((guix build utils) #:select (mkdir-p))
#:use-module (ice-9 rdelim)
@@ -103,22 +104,6 @@ pairs."
(else
(error "unmatched line" line)))))
-(define (alist->record alist make keys)
- "Apply MAKE to the values associated with KEYS in ALIST."
- (let ((args (map (cut assoc-ref alist <>) keys)))
- (apply make args)))
-
-(define (object->fields object fields port)
- "Write OBJECT (typically a record) as a series of recutils-style fields to
-PORT, according to FIELDS. FIELDS must be a list of field name/getter pairs."
- (let loop ((fields fields))
- (match fields
- (()
- object)
- (((field . get) rest ...)
- (format port "~a: ~a~%" field (get object))
- (loop rest)))))
-
(define (fetch uri)
"Return a binary input port to URI and the number of bytes it's expected to
provide."