From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id sPCvMTWLkGJwtAAAbAwnHQ (envelope-from ) for ; Fri, 27 May 2022 10:26:29 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id AMKEMTWLkGKJ/AAAauVa8A (envelope-from ) for ; Fri, 27 May 2022 10:26:29 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 7E29DB856 for ; Fri, 27 May 2022 10:26:29 +0200 (CEST) Received: from localhost ([::1]:44658 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nuVIi-0004Mz-NG for larch@yhetil.org; Fri, 27 May 2022 04:26:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57900) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nuVIJ-0004Lq-UV for guix-patches@gnu.org; Fri, 27 May 2022 04:26:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:38739) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nuVII-0001fF-4H; Fri, 27 May 2022 04:26:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nuVII-0000Oq-0W; Fri, 27 May 2022 04:26:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#55673] [PATCH] cache: Catch valid integer for 'last-expiry-cleanup'. Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: ludo@gnu.org, guix-patches@gnu.org Resent-Date: Fri, 27 May 2022 08:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 55673 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 55673@debbugs.gnu.org Cc: zimoun , ludo@gnu.org X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: ludo@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16536399421509 (code B ref -1); Fri, 27 May 2022 08:26:01 +0000 Received: (at submit) by debbugs.gnu.org; 27 May 2022 08:25:42 +0000 Received: from localhost ([127.0.0.1]:60869 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nuVHy-0000OG-GM for submit@debbugs.gnu.org; Fri, 27 May 2022 04:25:42 -0400 Received: from lists.gnu.org ([209.51.188.17]:51790) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nuVHu-0000O7-5G for submit@debbugs.gnu.org; Fri, 27 May 2022 04:25:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57864) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nuVHt-0004BV-SH for guix-patches@gnu.org; Fri, 27 May 2022 04:25:37 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:40881) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nuVHs-0001e7-8I for guix-patches@gnu.org; Fri, 27 May 2022 04:25:37 -0400 Received: by mail-wm1-x334.google.com with SMTP id v4-20020a1cac04000000b00397001398c0so4129687wme.5 for ; Fri, 27 May 2022 01:25:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=kwl/jxl6bTPVOGIUYZpAj/MGFQ5rdihSQNLywXdnc94=; b=WarJQPhQpznCan5Z020wEvswhpZBy2CQTZJMpQgDE2yeDcTt34JqlbQcsZS85ZAezj 8BfBuA6Avswb9H/4m6iX1WpX0ixUmp5vM6LL433x1efe4NTeytdQtRTuGn4Ozb9t9LrV 5qimGZ0NexDu/6nQgIpc/UnfHMHQTVftw05CRb+S0vIGarXNKHqJ4pvSVTRBgU6mCGkn PNFWGjDtpVWMsUMv9jRfZwIqHabLVGNEFHajKt1hGFNjDR1yTtjZeH83sZaKJxGEAi+h 3ZLjHOda7teJ7iII5zBXgvTihZYV0hu2rCD4e/rMrBYjYtyZHoV0uARuZE5huLOdC+LQ CwCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=kwl/jxl6bTPVOGIUYZpAj/MGFQ5rdihSQNLywXdnc94=; b=qK9eUOs4ijeuHpGy/8WO0S/CDQWjNQPF943PkZVfEjtyU/uE4GTh2PVCYMiepPupjK nbfn3PS/vCquzWKi6KAll0sxFj2MmfmNu7TE53xxxw9Mz9xDkWLjqr0/fzCoKq6Rqte+ qHtjghdpABV9DQQPvlg2AD6IClSHTXK3FFzDd6TZoT0FpgpdnQfzDUzpKyEIbA7EEEBZ VOkFu9RhEtJMvupFhi0lzyt2QyiDJ9/X22c4AdTuTaTdonbVMulaEriVgKsMbtjVe8kN P3WNW00pjp2WYHXNkKqEw5mGAUjS+2a8zmY3UdHFYc8QKzD0ITky1wKfauROjm4yDkEA Mhig== X-Gm-Message-State: AOAM532OhMO/QcOdpqRcW68j8M0dbdqGkRzZc49yW4qhYCec1GxGjYcb Qu/jN+f1i+4ONVpSC88vmzsIURyA23U= X-Google-Smtp-Source: ABdhPJwpXW8AKFFFIbPXl6ciz9r+B6XCeUhtPeDZ01vJAPwB2joM0xNhA2AmahUfYLunWOlYKurpQw== X-Received: by 2002:a05:600c:3384:b0:397:6443:5343 with SMTP id o4-20020a05600c338400b0039764435343mr5662483wmp.124.1653639932722; Fri, 27 May 2022 01:25:32 -0700 (PDT) Received: from localhost.localdomain ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id e12-20020a05600c4e4c00b003974d0d981dsm1424287wmq.35.2022.05.27.01.25.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 May 2022 01:25:32 -0700 (PDT) From: zimoun Date: Fri, 27 May 2022 10:25:19 +0200 Message-Id: <20220527082519.501697-1-zimon.toutoune@gmail.com> X-Mailer: git-send-email 2.36.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=zimon.toutoune@gmail.com; helo=mail-wm1-x334.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1653639989; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=kwl/jxl6bTPVOGIUYZpAj/MGFQ5rdihSQNLywXdnc94=; b=aVEohggLDC5ft2bnvfZZShfJr8CF35cgpT1onRADrsfge1gqeKntB8O7vCRWoN3Vgp5PVl HbbsFrar6GE+XM5jLrQYZ4Alqhac5xSISX/td8MqfHt4TiP4HPRsba1P1jtWBbr7SdvEBD uebUSDbr9V/zFak89O4WzFAQc1YLxM+TFUL5Rx9WTw5ZIgBpNERkaV4C23DPFMd4wytGWH iw+PB8cYuG0OVL8/UYYvh1j1faLJbQyQiRoYO0PA3/YRYZd4kwwQS5/74BBEpTHPPQZk0D yQezN0DTuB7vF9oactSo3vDEolANMGEykii9lu0TBAfJODM/YWsFAkg0JQqVLA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1653639989; a=rsa-sha256; cv=none; b=l9OWbi1jHcA97WK8mWmSRVeBfDgdKlKnw0ddZQnJKmvnRwG2Vwa6FJ4JfIf+TqMGfy0weJ pnBgVorjkxgb+qCKuwiCa/3XwpS8VQwP43WZoD8vuk11XZNgHQY41EBKO4m9LtR+6emP0y 0yO6GV19o52J6aKi+M0U1MpTYuyGScevU4KqJAH3mlXv3YeqGQpaY/nMCwLGMz/bOEcqdi uhj1Pd6l2IA45+dpv7rATVc7/W4IEe5Nax97TQ6NfK9dyH1NAZ/JRGgt0Ima+rGdhJd1am +OmMbB3aGNRR90z6YcCAEF3rFuCXQ4E8AcrgTVpkMigot1VzCswm01+RHaNeEg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=WarJQPhQ; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 4.96 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=WarJQPhQ; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 7E29DB856 X-Spam-Score: 4.96 X-Migadu-Scanner: scn0.migadu.com X-TUID: uTHZWxXf2/Rr Fixes . * 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 +;;; Copyright © 2022 Simon Tournier ;;; ;;; 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