Subject: bug#55673: closed (Re: bug#55673: [PATCH] cache: Catch valid integer for 'last-expiry-cleanup'.)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 04 Jun 2022 10:12:02 +0000

Your bug report

#55673: [PATCH] cache: Catch valid integer for 'last-expiry-cleanup'.

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
55673: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=55673
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#55673: [PATCH] cache: Catch valid integer for 'last-expiry-cleanup'.
From: Ludovic Courtès <[email-masked]>
To: zimoun <[email-masked]>
Cc: [email-masked]
Date: Sat, 04 Jun 2022 12:11:42 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

zimoun <[email-masked]> 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’.

Subject: [PATCH] cache: Catch valid integer for 'last-expiry-cleanup'.
From: zimoun <[email-masked]>
To: [email-masked]
Cc: zimoun <[email-masked]>
Date: Fri, 27 May 2022 10:25:19 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

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 <[email-masked]>
+;;; Copyright © 2022 Simon Tournier <[email-masked]>
 ;;;
 ;;; 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