[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
09/11: cache: Gracefully handle non-existent cache.
From: |
guix-commits |
Subject: |
09/11: cache: Gracefully handle non-existent cache. |
Date: |
Mon, 25 Oct 2021 14:13:29 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit 2cb0b3709ace41078872578f657ab0ee45d20ac9
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Fri Oct 1 23:12:09 2021 +0200
cache: Gracefully handle non-existent cache.
* 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 0401a9d..5100980 100644
--- a/guix/cache.scm
+++ b/guix/cache.scm
@@ -101,7 +101,13 @@ CLEANUP-PERIOD denotes the minimum time between two cache
cleanups."
#: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
- 01/11: packages: Add 'package-development-inputs'., (continued)
- 01/11: packages: Add 'package-development-inputs'., guix-commits, 2021/10/25
- 02/11: profiles: Add 'package->development-manifest'., guix-commits, 2021/10/25
- 03/11: Add 'guix shell'., guix-commits, 2021/10/25
- 04/11: shell: By default load the local 'manifest.scm' or 'guix.scm' file., guix-commits, 2021/10/25
- 08/11: environment: Autoload some modules., guix-commits, 2021/10/25
- 07/11: environment: Do not connect to the daemon when '--profile' is used., guix-commits, 2021/10/25
- 05/11: environment: Add tests for '--profile'., guix-commits, 2021/10/25
- 10/11: shell: Maintain a profile cache., guix-commits, 2021/10/25
- 11/11: news: Add entry about "guix shell"., guix-commits, 2021/10/25
- 06/11: environment: Skip derivation computation when '--profile' is used., guix-commits, 2021/10/25
- 09/11: cache: Gracefully handle non-existent cache.,
guix-commits <=