summaryrefslogtreecommitdiff
path: root/guix/scripts
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-10-12 23:45:57 +0200
committerLudovic Courtès <ludo@gnu.org>2013-10-13 01:14:21 +0200
commit52af657aee4430c13af93829ca10b2239a9956b9 (patch)
tree22bff322c08575c594e024334bb0a8993d83f480 /guix/scripts
parentab5d72ad2b2448542adcbb0f2dc89245b77e3087 (diff)
downloadgnu-guix-52af657aee4430c13af93829ca10b2239a9956b9.tar
gnu-guix-52af657aee4430c13af93829ca10b2239a9956b9.tar.gz
pull: Simplify the builder.
* guix/scripts/pull.scm (unpack)[builder]: Use 'copy-recursively' and 'copy-file' instead of 'file-system-fold'.
Diffstat (limited to 'guix/scripts')
-rw-r--r--guix/scripts/pull.scm26
1 files changed, 5 insertions, 21 deletions
diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm
index 1ee1c91142..a93343ceef 100644
--- a/guix/scripts/pull.scm
+++ b/guix/scripts/pull.scm
@@ -47,6 +47,8 @@ files."
(ice-9 ftw)
(ice-9 match))
+ (setvbuf (current-output-port) _IOLBF)
+ (setvbuf (current-error-port) _IOLBF)
(let ((out (assoc-ref %outputs "out"))
(tar (assoc-ref %build-inputs "tar"))
(gzip (assoc-ref %build-inputs "gzip"))
@@ -66,27 +68,9 @@ files."
(format #t "copying and compiling Guix to `~a'...~%" out)
;; Copy everything under guix/ and gnu/ plus guix.scm.
- (file-system-fold (lambda (dir stat result) ; enter?
- (or (string-prefix? "./guix" dir)
- (string-prefix? "./gnu" dir)
- (string=? "." dir)))
- (lambda (file stat result) ; leaf
- (when (or (not (string=? (dirname file) "."))
- (string=? (basename file) "guix.scm"))
- (let ((target (string-drop file 1)))
- (copy-file file
- (string-append out target)))))
- (lambda (dir stat result) ; down
- (mkdir (string-append out
- (string-drop dir 1))))
- (const #t) ; up
- (const #t) ; skip
- (lambda (file stat errno result)
- (error "cannot access file"
- file (strerror errno)))
- #f
- "."
- lstat)
+ (copy-recursively "guix" (string-append out "/guix"))
+ (copy-recursively "gnu" (string-append out "/gnu"))
+ (copy-file "guix.scm" (string-append out "/guix.scm"))
;; Add a fake (guix config) module to allow the other modules to be
;; compiled. The user's (guix config) is the one that will be used.