Subject: [PATCH v2 3/4] substitutes: Ignore corrupt cached narinfos.

From: Ludovic Courtès <[email-masked]>
Date: Fri, 11 Apr 2025 15:54:59 +0200

* guix/substitutes.scm (cached-narinfo): Add ‘eof-object?’ clause.

Change-Id: I2d776f64b6521f778b4ab3f956b35cdef2ddb383
---
 guix/substitutes.scm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/guix/substitutes.scm b/guix/substitutes.scm
index 86b9f5472a..9edce5b2f8 100644
--- a/guix/substitutes.scm
+++ b/guix/substitutes.scm
@@ -316,6 +316,8 @@ (define (cached-narinfo cache-url path)
                  (values #f #f)
                  (values #t (string->narinfo value cache-uri))))
             (('narinfo ('version v) _ ...)
+             (values #f #f))
+            ((? eof-object?)                      ;corrupt file
              (values #f #f))))))
     (lambda _
       (values #f #f))))
-- 
2.49.0