GNU bug report logs - #50960
[PATCH 00/10] Add 'guix shell' to subsume 'guix environment'

Previous Next

Package: guix-patches;

Reported by: Ludovic Courtès <ludo <at> gnu.org>

Date: Sat, 2 Oct 2021 10:22:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #302 received at 50960 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: 50960 <at> debbugs.gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>
Subject: [PATCH v3 09/10] cache: Gracefully handle non-existent cache.
Date: Mon, 18 Oct 2021 21:52:18 +0200
* guix/cache.scm (maybe-remove-expired-cache-entries): Ignore ENOENT
when writing EXPIRY-FILE.
---
 guix/cache.scm | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/guix/cache.scm b/guix/cache.scm
index 0401a9d428..51009809bd 100644
--- a/guix/cache.scm
+++ b/guix/cache.scm
@@ -101,7 +101,13 @@ (define last-expiry-date
                                   #:now now
                                   #:entry-expiration entry-expiration
                                   #:delete-entry delete-entry)
-    (call-with-output-file expiry-file
-      (cute write (time-second now) <>))))
+    (catch 'system-error
+      (lambda ()
+        (call-with-output-file expiry-file
+          (cute write (time-second now) <>)))
+      (lambda args
+        ;; ENOENT means CACHE does not exist.
+        (unless (= ENOENT (system-error-errno args))
+          (apply throw args))))))
 
 ;;; cache.scm ends here
-- 
2.33.0





This bug report was last modified 3 years and 210 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.