GNU bug report logs -
#55673
[PATCH] cache: Catch valid integer for 'last-expiry-cleanup'.
Previous Next
Reported by: zimoun <zimon.toutoune <at> gmail.com>
Date: Fri, 27 May 2022 08:26:01 UTC
Severity: normal
Tags: patch
Done: Ludovic Courtès <ludo <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Sat, 04 Jun 2022 12:11:42 +0200
with message-id <87k09wg2ld.fsf_-_ <at> gnu.org>
and subject line Re: bug#55673: [PATCH] cache: Catch valid integer for 'last-expiry-cleanup'.
has caused the debbugs.gnu.org bug report #55673,
regarding [PATCH] cache: Catch valid integer for 'last-expiry-cleanup'.
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
55673: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=55673
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
Fixes <http://issues.guix.gnu.org/55638>.
* guix/cache.scm (maybe-remove-expired-cache-entries)[last-expiry-date]: Check
if the date is a valid integer.
---
guix/cache.scm | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/guix/cache.scm b/guix/cache.scm
index 51009809bd..4a74c42afe 100644
--- a/guix/cache.scm
+++ b/guix/cache.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2020, 2021 Ludovic Courtès <ludo <at> gnu.org>
+;;; Copyright © 2022 Simon Tournier <zimon.toutoune <at> gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -93,7 +94,9 @@ (define expiry-file
(define last-expiry-date
(catch 'system-error
(lambda ()
- (call-with-input-file expiry-file read))
+ (match (call-with-input-file expiry-file read)
+ ((? integer? date) date)
+ (_ 0)))
(const 0)))
(when (obsolete? last-expiry-date now cleanup-period)
base-commit: 38bf6c7d0cb588e8d4546db7d2e0bae2ec25183d
--
2.36.0
[Message part 3 (message/rfc822, inline)]
Hi,
zimoun <zimon.toutoune <at> gmail.com> skribis:
> Fixes <http://issues.guix.gnu.org/55638>.
>
> * guix/cache.scm (maybe-remove-expired-cache-entries)[last-expiry-date]: Check
> if the value is a valid integer.
> * tests/cache.scm: Test it.
I simplified it a bit and pushed as
104b4e25ab7da5697f2f6f1ddfdd4955f05afece, thanks!
Ludo’.
This bug report was last modified 2 years and 351 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.