From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id kBlMLQOvZGF3KAEAgWs5BA (envelope-from ) for ; Mon, 11 Oct 2021 23:39:15 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id QE4XKAOvZGFVOQAAB5/wlQ (envelope-from ) for ; Mon, 11 Oct 2021 21:39:15 +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 0545417E7F for ; Mon, 11 Oct 2021 23:39:15 +0200 (CEST) Received: from localhost ([::1]:35422 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ma30s-0006hE-2S for larch@yhetil.org; Mon, 11 Oct 2021 17:39:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47532) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ma30j-0006c0-NK for guix-patches@gnu.org; Mon, 11 Oct 2021 17:39:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:49617) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ma30j-0004s0-Eo for guix-patches@gnu.org; Mon, 11 Oct 2021 17:39:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ma30j-0001QQ-Ch for guix-patches@gnu.org; Mon, 11 Oct 2021 17:39:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50960] [PATCH v2 10/11] 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: Mon, 11 Oct 2021 21:39:05 +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.16339883335384 (code B ref 50960); Mon, 11 Oct 2021 21:39:05 +0000 Received: (at 50960) by debbugs.gnu.org; 11 Oct 2021 21:38:53 +0000 Received: from localhost ([127.0.0.1]:32918 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ma30X-0001Og-5v for submit@debbugs.gnu.org; Mon, 11 Oct 2021 17:38:53 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45516) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ma30G-0001Mn-N5 for 50960@debbugs.gnu.org; Mon, 11 Oct 2021 17:38:36 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:40584) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ma30B-0004ag-EC; Mon, 11 Oct 2021 17:38:31 -0400 Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:53321 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 1ma30B-0007Y0-4u; Mon, 11 Oct 2021 17:38:31 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Mon, 11 Oct 2021 23:38:08 +0200 Message-Id: <20211011213809.17482-11-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211011213809.17482-1-ludo@gnu.org> References: <20211002102116.27726-1-ludo@gnu.org> <20211011213809.17482-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=1633988355; 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=jgp66JS0AZ9tq+ot6lmNJSLImyecm3OPYGMR2RTtEfM=; b=Bx4GGT4OdDHOzheSWhkklsGBwAFQII6CmsHT9pIJWG39ZheR6z22y/qm11fzaRZV7Wh73p bUULg9r+yG2Y6lh77a6tunNLmY/uwcvyw6osuDqghnKPuQHNIJC+v3yHyRxoZin2OZ4h1T 05bZt3UDy19Gu1XVKcInlk763bMmRLwOtWhA9QzlxOx+2inyhwZgScUOQ1cK1+OtKl8ufM 9HEBb0x0aX6WWraR7F2t5pLsIDk+/q7m8lRLRGhq/Js4CKdwhJ8CTGgd/N7yI6e7fUsKyF k/GcKdCeJxzhVMlQiYqoFXojbguhXbVwnGJQi7fM7d2ZxpeQcwrUa70D/f649w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1633988355; a=rsa-sha256; cv=none; b=VhWQNlVkdLvKmCurUT4YmmNVEYI8iWGkaLsLuBm+fKA0oSL3WlKN1d+J1soFYME6eEoO3n yP5bcrI7fNoVADazu8Pk41AkZVXqpSXmf+kIRaPx5rRNb4tXyc3EsaKE9YYA86/B0tDE0x KNmmwEWzDbM2jiVk6BRnISgkO1ZYzhjoOZ9llM+aUZOVtD9++wZryxn1KyV0TtBw+k1r3H LKzdiqCEbwvE+j91KneDvDH7fDa/KfGzKohJqG+++sSWfiKe+nHZIifGiMU+MjeSr+uEzh YJHURpZskr6PsAN6vY7BXskIX8QTZ38tWynUCE5nsCVZmwyxBElepDuCqe1l0A== 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: 2.08 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: 0545417E7F X-Spam-Score: 2.08 X-Migadu-Scanner: scn0.migadu.com X-TUID: L4pUvqhDeVOF * 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 @@ (define last-expiry-date #: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