Commit Graph

8 Commits

Author SHA1 Message Date
Mark H Weaver 5a1add373a
grafts: Make grafting faster.
* guix/build/graft.scm (replace-store-references): Reimplement for
faster grafting.  Use binary I/O instead of textual I/O.  Replace
'mapping' argument (an alist) with 'replacement-table' (a vhash).
(rewrite-directory): Adapt to mapping argument change in
'replace-store-references'.  Remove 'with-fluids' that previously set
'%default-port-encoding' to #f, since we now use binary I/O.
(define-inline, hash-length): New macros.
(nix-base32-char?): New variable.
2016-08-09 17:59:26 -04:00
Ludovic Courtès 007c20b61c
graft: Fail when one of the threads raises an exception.
Fixes <http://bugs.gnu.org/23581>.

* guix/build/graft.scm (exit-on-exception): New procedure.
(rewrite-directory): Use it to wrap REWRITE-LEAF.
2016-05-24 23:52:14 +02:00
Ludovic Courtès ece6864bd0
grafts: Rename files whose name matches a graft.
Fixes <http://bugs.gnu.org/23132>.
Reported by Mark H Weaver <mhw@netris.org>.

* guix/build/graft.scm (rename-matching-files): New procedure.
(rewrite-directory): Use it.
* tests/grafts.scm ("graft-derivation, renaming"): New test.
2016-05-21 01:35:14 +02:00
Ludovic Courtès cf8b312d18
grafts: Preserve empty directories when grafting.
* guix/build/graft.scm (rewrite-directory)[rewrite-leaf]: Add case for
'directory.
Pass #:directories? #t to 'find-files'.
2016-05-21 01:35:14 +02:00
Ludovic Courtès 82f5186650 grafts: Make sure files are not created world-writable.
* guix/build/graft.scm (rewrite-directory): Add 'umask' call.
2016-02-27 23:31:52 +01:00
Ludovic Courtès 333c376c45 graft: Graft files in parallel.
* guix/build/graft.scm (rewrite-directory): Use 'n-par-for-each' instead
  of 'for-each'.
2015-11-16 14:22:58 +01:00
Ludovic Courtès 9c88f655e6 graft: Graft files in a deterministic order.
* guix/build/graft.scm (rewrite-directory)[rewrite-leaf]: Change to take
  a single parameter.  Add call to 'lstat'.  Factorize result of
  'destination'.
  Use 'find-files' instead of 'file-system-fold'.
2015-11-16 14:22:58 +01:00
Ludovic Courtès fb59e275dd derivations: Add 'graft-derivation'.
* guix/derivations.scm (graft-derivation): New procedure.
* guix/build/graft.scm: New file.
* Makefile.am (MODULES): Add it.
* tests/derivations.scm ("graft-derivation"): New test.
2014-10-08 12:01:49 +02:00