derivations: Add support for recursive fixed-output derivations.
authorLudovic Courtès <ludo@gnu.org>
Fri, 21 Feb 2014 22:03:19 +0000 (23:03 +0100)
committerLudovic Courtès <ludo@gnu.org>
Fri, 21 Feb 2014 22:49:52 +0000 (23:49 +0100)
commit36bbbbd150f75c2a6dab2473643c3723e606e41d
tree3824cacfcc1762e8ca9cc3c1ccda5e81d722ae79
parent3140f2df423d1235c3766e3478a429ac89d882ed
derivations: Add support for recursive fixed-output derivations.

* guix/derivations.scm (<derivation-output>): Add 'recursive?' field.
  Adjust 'make-derivation-output' callers.
  (%read-derivation) <fixed-output>: When HASH-ALGO starts with 'r:',
  set the 'recursive?' field and drop 'r:' from the hash algo name.
  (write-derivation)[write-output]: Write the algo as 'r:HASH-ALGO' when
  the RECURSIVE? field is set.
  (derivation-hash) <fixed-output>: Prepend "r:" when RECURSIVE? is set.
  (fixed-output-path): New procedure.
  (derivation): Add #:recursive? parameter.  Use 'fixed-output-path' to
  compute the output file name of a fixed output derivation.
  (build-expression->derivation): Add #:recursive? parameter.  Pass it
  to 'derivation'.
* tests/derivations.scm ("fixed-output derivation, recursive",
  "build-expression->derivation produces recursive fixed-output",
  "build-expression->derivation uses recursive fixed-output"): New
  tests.
* doc/guix.texi (Derivations): Document #:recursive? for 'derivation'.
  Add #:recursive? for 'build-expression->derivation'.
doc/guix.texi
guix/derivations.scm
tests/derivations.scm