[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
06/07: shell: Actually clean up the profile cache.
From: |
guix-commits |
Subject: |
06/07: shell: Actually clean up the profile cache. |
Date: |
Sun, 7 Nov 2021 17:13:02 -0500 (EST) |
civodul pushed a commit to branch master
in repository guix.
commit 859122e5abeddfdfbe419713e19ed573ed2d5d78
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Sun Nov 7 22:32:18 2021 +0100
shell: Actually clean up the profile cache.
Previously, most actions would leave the cache as-is because
'guix-environment*' would indirectly call 'exit', and thus its
continuation was never reached.
* guix/scripts/shell.scm (guix-shell): Move call to
'maybe-remove-expired-cache-entries' to EXIT-HOOK.
---
guix/scripts/shell.scm | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/guix/scripts/shell.scm b/guix/scripts/shell.scm
index 5749485..bd62803 100644
--- a/guix/scripts/shell.scm
+++ b/guix/scripts/shell.scm
@@ -387,8 +387,14 @@ echo ~a >> ~a
(display-hint (G_ "Consider passing the @option{--check} option once
to make sure your shell does not clobber environment variables."))) )
- (let ((result (guix-environment* opts)))
- (maybe-remove-expired-cache-entries (%profile-cache-directory)
- cache-entries
- #:entry-expiration entry-expiration)
- result))
+ ;; Clean the cache in EXIT-HOOK so that (1) it happens after potential use
+ ;; of cached profiles, and (2) cleanup actually happens, even when
+ ;; 'guix-environment*' calls 'exit'.
+ (add-hook! exit-hook
+ (lambda _
+ (maybe-remove-expired-cache-entries
+ (%profile-cache-directory)
+ cache-entries
+ #:entry-expiration entry-expiration)))
+
+ (guix-environment* opts))
- branch master updated (dab2ac2 -> bd41e59), guix-commits, 2021/11/07
- 01/07: ui: 'load*' correctly reports 'read-error' in all cases., guix-commits, 2021/11/07
- 04/07: doc: Improve documentation of the Bash home service, guix-commits, 2021/11/07
- 07/07: gnu: ardour: Update to 6.9., guix-commits, 2021/11/07
- 05/07: import: egg: Allow imports of a specific version., guix-commits, 2021/11/07
- 03/07: home: services: bash: Add ‘aliases’ field., guix-commits, 2021/11/07
- 02/07: file-systems: Validate the 'flags' field., guix-commits, 2021/11/07
- 06/07: shell: Actually clean up the profile cache.,
guix-commits <=