diff options
author | Ludovic Courtès <ludovic.courtes@inria.fr> | 2017-06-12 17:11:22 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2017-06-12 17:53:51 +0200 |
commit | 015f17e8b9eff97f656852180ac51c75438d7f9d (patch) | |
tree | d2fe6f9a2917aa3f2bf57e4220e23a3e7d63d8d2 /guix/scripts/perform-download.scm | |
parent | b46712159c15f72fc28b71d17d5a7c74fcb64ed0 (diff) | |
download | gnu-guix-015f17e8b9eff97f656852180ac51c75438d7f9d.tar gnu-guix-015f17e8b9eff97f656852180ac51c75438d7f9d.tar.gz |
derivations: Introduce 'read-derivation-from-file'.
This avoids the open/fstat/close syscalls upon a cache hit that we had
with the previous idiom:
(call-with-input-file file read-derivation)
where caching happened in 'read-derivation' itself.
* guix/derivations.scm (%read-derivation): Rename to...
(read-derivation): ... this.
(read-derivation-from-file): New procedure.
(derivation-prerequisites, substitution-oracle)
(derivation-prerequisites-to-build):
(derivation-path->output-path, derivation-path->output-paths):
(derivation-path->base16-hash, map-derivation): Use
'read-derivation-from-file' instead of (call-with-input-file …
read-derivation).
* guix/grafts.scm (item->deriver): Likewise.
* guix/scripts/build.scm (log-url, options->things-to-build): Likewise.
* guix/scripts/graph.scm (file->derivation): Remove.
(derivation-dependencies, %derivation-node-type): Use
'read-derivation-from-file' instead.
* guix/scripts/offload.scm (guix-offload): Likewise.
* guix/scripts/perform-download.scm (guix-perform-download): Likewise.
* guix/scripts/publish.scm (load-derivation): Remove.
(narinfo-string): Use 'read-derivation-from-file'.
Diffstat (limited to 'guix/scripts/perform-download.scm')
-rw-r--r-- | guix/scripts/perform-download.scm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/guix/scripts/perform-download.scm b/guix/scripts/perform-download.scm index aee506af46..18e2fc92f2 100644 --- a/guix/scripts/perform-download.scm +++ b/guix/scripts/perform-download.scm @@ -106,11 +106,11 @@ of GnuTLS over HTTPS, before we have built GnuTLS. See (match args (((? derivation-path? drv) (? store-path? output)) (assert-low-privileges) - (perform-download (call-with-input-file drv read-derivation) + (perform-download (read-derivation-from-file drv) output)) (((? derivation-path? drv)) ;backward compatibility (assert-low-privileges) - (perform-download (call-with-input-file drv read-derivation))) + (perform-download (read-derivation-from-file drv))) (("--version") (show-version-and-exit)) (x |