diff options
author | Ludovic Courtès <ludo@gnu.org> | 2013-04-15 23:42:27 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2013-04-15 23:42:55 +0200 |
commit | eba783b7b20cbf84dfd0a04bc19e3bebbc9a30fc (patch) | |
tree | 7455d6c1275c168677ae25eb43f815641af22f43 /tests | |
parent | 63b7c6c1f82486604abd6e3b6a6e14643d1f6621 (diff) | |
download | guix-eba783b7b20cbf84dfd0a04bc19e3bebbc9a30fc.tar guix-eba783b7b20cbf84dfd0a04bc19e3bebbc9a30fc.tar.gz |
substitute-binary: Add a local cache.
* guix/scripts/substitute-binary.scm (%narinfo-cache-directory,
%narinfo-ttl, %narinfo-negative-ttl): New variables.
(with-atomic-file-output, object->fields, read-narinfo,
write-narinfo, narinfo->string, string->narinfo, lookup-narinfo): New
procedures.
(fetch-narinfo): Adjust to use `read-narinfo'.
(guix-substitute-binary): Ensure the existence of
%NARINFO-CACHE-DIRECTORY. Use `lookup-narinfo' instead of
`fetch-narinfo'.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/store.scm | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/store.scm b/tests/store.scm index 4ee20a9352..677e39e75d 100644 --- a/tests/store.scm +++ b/tests/store.scm @@ -159,6 +159,12 @@ Deriver: ~a~%" (%current-system) ; System (basename d)))) ; Deriver + ;; Remove entry from the local cache. + (false-if-exception + (delete-file (string-append (getenv "XDG_CACHE_HOME") + "/guix/substitute-binary/" + (store-path-hash-part o)))) + ;; Make sure `substitute-binary' correctly communicates the above data. (set-build-options s #:use-substitutes? #t) (and (has-substitutes? s o) |