* guix/scripts/substitute-binary.scm (filtered-port): Move to utils.scm.
(decompressed-port): Upon "none", return '() as the second value.
(guix-substitute-binary): Expect `decompressed-port' to return a list
of PIDs as its second value.
* guix/utils.scm (filtered-port): New procedure. Add case for when
INPUT is not `file-port?'.
* tests/utils.scm ("filtered-port, file", "filtered-port, non-file"):
New tests.
* gnu/packages.scm (fold2): Remove.
* guix/utils.scm (fold2): New procedure. Generalization of the above to
one and two lists.
* tests/utils.scm ("fold2, 1 list", "fold2, 2 lists"): New tests.
* guix/utils.scm (define-record-type*)[make-syntactic-constructor]: Add
a `thunked' parameter.
(thunked-field?, field-bindings): New procedures. Use the latter when
generating `letrec*' bindings.
[thunked-field?, thunked-field-accessor-name, field-spec->srfi-9,
thunked-field-accessor-name]: New procedures.
Use them when generating the `define-record-type' form, and to
generated thunk field accessors, along call to
`make-syntactic-constructor' with the new argument.
* tests/utils.scm ("define-record-type* & thunked",
"define-record-type* & thunked & default",
"define-record-type* & thunked & inherited"): New tests.
* guix/utils.scm (package-name->name+version): New procedure.
* guix-package.in (guix-package)[find-package]: Use it.
* tests/utils.scm ("package-name->name+version"): New test.
* Makefile.am (.scm.go): Define $NIX_INSTANTIATE.
(TESTS_ENVIRONMENT): Likewise, and define $NIX_HASH.
* guix/utils.scm (nixpkgs-derivation): Use $NIX_INSTANTIATE when
defined.
* tests/utils.scm (%nix-hash): New variable.
("sha256 & bytevector->nix-base32-string"): Use it.
* guix/utils.scm (define-record-type*)[make-syntactic-constructor]: Bind
all the ((FIELD VALUE) ...) in a `letrec*'. Adjust `field-value'
accordingly.
* tests/utils.scm ("define-record-type* with letrec* behavior"): New
test.
* guix/utils.scm (gnu-triplet->nix-system): New procedure.
(%current-system): New variable.
* tests/utils.scm ("gnu-triplet->nix-system"): New test.
* tests/derivations.scm (%current-system): Remove. Update users to
use (%current-system) instead.
* guix/utils.scm (bytevector-quintet-ref-right,
bytevector-quintet-fold): New procedures.
(bytevector-quintet-fold-right): Add `quintet-fold' parameter; use it
instead of `bytevector-quintet-fold'.
(bytevector->base32-string): Pass BYTEVECTOR-QUINTET-FOLD as the
first parameter.
(bytevector->nix-base32-string): Pass BYTEVECTOR-QUINTET-FOLD-RIGHT as
the first parameter.
* tests/utils.scm ("sha256 & bytevector->nix-base32-string"): New test.