From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id SDnTD8MzWGH1qQAAgWs5BA (envelope-from ) for ; Sat, 02 Oct 2021 12:26:11 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id iHZpC8MzWGH8CQAAbx9fmQ (envelope-from ) for ; Sat, 02 Oct 2021 10:26:11 +0000 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 089392B719 for ; Sat, 2 Oct 2021 12:26:11 +0200 (CEST) Received: from localhost ([::1]:53638 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWcDa-0003Lm-59 for larch@yhetil.org; Sat, 02 Oct 2021 06:26:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38430) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWcBY-0002Gz-81 for guix-patches@gnu.org; Sat, 02 Oct 2021 06:24:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:46432) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mWcBY-0000Ca-0H for guix-patches@gnu.org; Sat, 02 Oct 2021 06:24:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mWcBX-0007ZF-TN for guix-patches@gnu.org; Sat, 02 Oct 2021 06:24:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50960] [PATCH 09/10] cache: Gracefully handle non-existent cache. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 02 Oct 2021 10:24:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50960 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50960@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 50960-submit@debbugs.gnu.org id=B50960.163317019328979 (code B ref 50960); Sat, 02 Oct 2021 10:24:03 +0000 Received: (at 50960) by debbugs.gnu.org; 2 Oct 2021 10:23:13 +0000 Received: from localhost ([127.0.0.1]:57969 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mWcAi-0007XE-Rf for submit@debbugs.gnu.org; Sat, 02 Oct 2021 06:23:13 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33146) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mWcAY-0007UW-0t for 50960@debbugs.gnu.org; Sat, 02 Oct 2021 06:23:02 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:49204) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWcAS-0007gK-RS; Sat, 02 Oct 2021 06:22:56 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=36460 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mWcAS-0007gb-I5; Sat, 02 Oct 2021 06:22:56 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Sat, 2 Oct 2021 12:22:39 +0200 Message-Id: <20211002102240.27815-9-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211002102240.27815-1-ludo@gnu.org> References: <20211002102240.27815-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1633170371; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=8vHSrkrcbW7RwUsuAE+uw6hmhhMup2+E9K0p3ji0120=; b=oRg9+MBXteA751pKlPBaL6rlsbBXwbrDGjfC6gar7+gurwnZK1dlgNM4QmfVAdo68NdJc9 c3Dycv22GU4PK3TVbihqmnV0WHOCBL6uj+ZyisgEjZqghT8K9b5yxKgU7DHfxnlVBDloZq 75TReSGwNaL2XTcrPMcAQA2PBQ4fxm9+XTVeHCYSYPo4xM1FbwxDzFmeRZGmpMVLV1RL0+ QBxvaJ74YcY22ASYXGugh5K5kg1nLoLSQN3UVvKY05Gts4atzyij7YEJRbzGScy82ZNsdY DbDCWadJLfUV4l93RjhmiJuY27cUHFlBwT8/dPebWKlcKMUyLauZChKIaukiHQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1633170371; a=rsa-sha256; cv=none; b=e49kor5dgltGwvgBX9Hd0JzCSi/Cm/fo4j04lGv9NDiORp2j/5Zk4qcd3ZEiMontJ1sA0S i4dQoBT6v4BwT13bXCOx6LgefbmWvKwyXfreKcSqxdNeSG9ZQQvVfq0ePientONgz7CTCf G7YAwJDv+9Fk736u0h2unc0gVY/OdC3M2ppQHV0AnbOQR+WHiBIm3rMq2LKAquOcXtQcK1 oCd/DsVtpOY3yBY091JIr98/lQaiT5W3N73+kqde36jzTsIzvXgiuBK07UXBqO2F3OWF+Z rJKknUpgxMrcKRO6feF4sSoe4j+NglLoJQ1PprkQ2brj8exXfSTBC4u5cbwqmg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: 3.59 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 089392B719 X-Spam-Score: 3.59 X-Migadu-Scanner: scn0.migadu.com X-TUID: AY2eJLXkJF1M * guix/cache.scm (maybe-remove-expired-cache-entries): Ignore ENOENT when writing EXPIRY-FILE. --- guix/cache.scm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/guix/cache.scm b/guix/cache.scm index 0401a9d428..51009809bd 100644 --- a/guix/cache.scm +++ b/guix/cache.scm @@ -101,7 +101,13 @@ CLEANUP-PERIOD denotes the minimum time between two cache cleanups." #:now now #:entry-expiration entry-expiration #:delete-entry delete-entry) - (call-with-output-file expiry-file - (cute write (time-second now) <>)))) + (catch 'system-error + (lambda () + (call-with-output-file expiry-file + (cute write (time-second now) <>))) + (lambda args + ;; ENOENT means CACHE does not exist. + (unless (= ENOENT (system-error-errno args)) + (apply throw args)))))) ;;; cache.scm ends here -- 2.33.0