summary refs log tree commit diff
path: root/tests/store.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-07-13 15:52:29 +0200
committerLudovic Courtès <ludo@gnu.org>2015-07-13 18:29:01 +0200
commit895d1eda547708dd46074a2dd2f934de275fb102 (patch)
treefb3558b5f659585eee03df3b3b7d8e7c07a75aee /tests/store.scm
parent074efd63a8b220fc1c6e450c4ac31b153ebd5f84 (diff)
downloadguix-895d1eda547708dd46074a2dd2f934de275fb102.tar.gz
substitute: Store cached narinfo in cache-specific sub-directories.
This ensures that switching between different substitute servers doesn't lead
to a polluted narinfo cache.

* guix/scripts/substitute.scm (narinfo-cache-file): Add 'cache-url'
  parameter.  Add the base32 of CACHE-URL as a sub-directory under
  %NARINFO-CACHE-DIRECTORY.  Update callers.
  (cached-narinfo): Likewise.  Call 'mkdir-p' on the dirname of the cache
  file.  Update callers.
  (remove-expired-cached-narinfos): Add 'directory' parameter and use it
  instead of %NARINFO-CACHE-DIRECTORY.
  (narinfo-cache-directories): New procedure.
  (maybe-remove-expired-cached-narinfo): Call 'remove-expired-cached-narinfos'
  for each item returned by 'narinfo-cache-directories'.
Diffstat (limited to 'tests/store.scm')
-rw-r--r--tests/store.scm6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/store.scm b/tests/store.scm
index faa924fce9..f2d6d513f8 100644
--- a/tests/store.scm
+++ b/tests/store.scm
@@ -25,6 +25,7 @@
   #:use-module (guix packages)
   #:use-module (guix derivations)
   #:use-module (guix serialization)
+  #:use-module (guix build utils)
   #:use-module (guix gexp)
   #:use-module (gnu packages)
   #:use-module (gnu packages bootstrap)
@@ -371,9 +372,8 @@
       (with-derivation-narinfo d
         ;; Remove entry from the local cache.
         (false-if-exception
-         (delete-file (string-append (getenv "XDG_CACHE_HOME")
-                                     "/guix/substitute/"
-                                     (store-path-hash-part o))))
+         (delete-file-recursively (string-append (getenv "XDG_CACHE_HOME")
+                                                 "/guix/substitute")))
 
         ;; Make sure 'guix substitute' correctly communicates the above
         ;; data.