mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2026-04-06 21:20:33 +02:00
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'.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user