From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:403:4ea1::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id EKD4OCGXyGHRFgEAgWs5BA (envelope-from ) for ; Sun, 26 Dec 2021 17:24:01 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id QP/2MiGXyGE5MgEAG6o9tA (envelope-from ) for ; Sun, 26 Dec 2021 17:24:01 +0100 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 97D9621773 for ; Sun, 26 Dec 2021 17:24:01 +0100 (CET) Received: from localhost ([::1]:34920 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n1WJU-0005Gp-Qy for larch@yhetil.org; Sun, 26 Dec 2021 11:24:00 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34096) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n1WGc-0002NO-5d for guix-patches@gnu.org; Sun, 26 Dec 2021 11:21:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:58050) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n1WGb-00056z-Rg for guix-patches@gnu.org; Sun, 26 Dec 2021 11:21:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n1WGb-0002E1-PQ for guix-patches@gnu.org; Sun, 26 Dec 2021 11:21:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52805] [PATCH] substitute: Add a =?UTF-8?Q?=E2=80=98--clear-cache=E2=80=99?= option. Resent-From: Tobias Geerinckx-Rice Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 26 Dec 2021 16:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 52805 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52805@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16405356528528 (code B ref -1); Sun, 26 Dec 2021 16:21:01 +0000 Received: (at submit) by debbugs.gnu.org; 26 Dec 2021 16:20:52 +0000 Received: from localhost ([127.0.0.1]:41363 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n1WGS-0002DU-CM for submit@debbugs.gnu.org; Sun, 26 Dec 2021 11:20:52 -0500 Received: from lists.gnu.org ([209.51.188.17]:60172) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n1WGM-0002DG-WA for submit@debbugs.gnu.org; Sun, 26 Dec 2021 11:20:51 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34028) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n1WGL-00020S-JU for guix-patches@gnu.org; Sun, 26 Dec 2021 11:20:46 -0500 Received: from [2a02:c205:2020:6054::1] (port=36664 helo=tobias.gr) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n1WGH-00054C-LZ for guix-patches@gnu.org; Sun, 26 Dec 2021 11:20:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=2018; bh=8WG/O4L+dTNPM /4t/FpzzwPK3Bm/RxTqdzz1oU89it8=; h=date:subject:to:from; d=tobias.gr; b=Dp0QOuwMc11gC5sYIB7igkjra8O+Zhd8ecGsr82RyvGiZ5NWFRckX0XVR/lpA0kM7mgV Wfp2MZyLKgLnzjPb/hykwcxUGZM63CALQX+D9K27MpsHf1WzanN9RYhNLDajNURBagjpJA izVPTFHVxVGRD86EZ2UlCwcHeqYIeZ7IwYNCI4pcvwN+18v/I7pffuLa5coH5iwR5OG84+ w202tAP9kRLsbjdVYswGmX4sWLWup55lQuQfnKlkArmZBL8fgXigVOZ68X8kSkJjLUGLCp Sj33FmTfosJwjyGUt1PYFBhhKFwSufoyCUy3oHSwhUFddKgNU/MY9YtmTCJ67MgA== Received: by submission.tobias.gr (OpenSMTPD) with ESMTPSA id 01804ee8 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO) for ; Sun, 26 Dec 2021 16:20:35 +0000 (UTC) Date: Sun, 26 Dec 2021 17:21:26 +0100 Message-Id: <20211226162126.23749-1-me@tobias.gr> X-Mailer: git-send-email 2.34.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a02:c205:2020:6054::1 (failed) Received-SPF: pass client-ip=2a02:c205:2020:6054::1; envelope-from=me@tobias.gr; helo=tobias.gr X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, RDNS_NONE=0.793, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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" Reply-to: Tobias Geerinckx-Rice X-ACL-Warn: , Tobias Geerinckx-Rice via Guix-patches From: Tobias Geerinckx-Rice via Guix-patches via X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1640535841; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=8WG/O4L+dTNPM/4t/FpzzwPK3Bm/RxTqdzz1oU89it8=; b=Q0OWy6FjRKb/gBjlU5eYVEh0z9LBLKLfO0FHBFDgTY1p9vbsRjRbeclT2F0NQN9m5S8WO+ rS5mRpc4UuQWMDMOn5wVxEtMDvLYh7YX4xixjo1sLceGFl4OTtsjQQpkehzIlxo8UqODvk 7DWw5Ag+wjep8iX/Zy2J3tUqC3lXWlMQUe8tJ/tCPFvNlENZMdHmnGFVeuWdNkbdyQzSWK ypmEErbxI/AFviTx/23Vb0D6MY4aZhXPrg6tCO3/+pXH+ehEHQ/wDD0eBqk4ahrPRCRehF dkuJCrajcUzazJL9N3TMffWZkDRTnYXPYMFv6npw88Ue03u/dABjpy8mC6IccA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1640535841; a=rsa-sha256; cv=none; b=AIjNdA1xeGnEL/s/2Eb1M1SLQVFy6gFdqD4mr3/e9i0WhFEIZu5xaK6MONXuqdl/M4IVU4 jvRdsZxPqLHFS1RGNHpJ5HfclrcLbbSy5nykrcIi/9NGsV+nYcLIVfyy8MhVOQ+tKhQWlH TxbX94aSeQNBjD7rh/w0Z77N/6yFKUgfUBTu/Wl65mCV/vNijHib6QjrRNiprNicURKep8 PszmelAxDo5ftQehYNcTxbEzTietoDXPoqObKZ7dKgzvsdO/wHJ+06gLCL2TviMkK7cHeE cB1U97QKtGn+YdrhmrYD7cDZ488G0jMzPduDEt0dE7tyIpWzR4dYZfokjjCA0Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tobias.gr header.s=2018 header.b=Dp0QOuwM; dmarc=pass (policy=none) header.from=gnu.org; 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: -3.77 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tobias.gr header.s=2018 header.b=Dp0QOuwM; dmarc=pass (policy=none) header.from=gnu.org; 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: 97D9621773 X-Spam-Score: -3.77 X-Migadu-Scanner: scn1.migadu.com X-TUID: Ak9oGvk+r3Bp Unlike ‘rm -rf ~/.cache/guix/substitute’ this respects XDG_CACHE_HOME. Use the --OPTION form for consistency with the existing ‘guix substitute’ interface, where other guix subcommands would prefer an ACTION. This subcommand really supports only one OPTION at a time, anyway. * guix/scripts/substitute.scm (guix-substitute): Add a new ‘--clear-cache’ option argument. (show-help): Document it. --- guix/scripts/substitute.scm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm index c044e1d47a..1e71b4848b 100755 --- a/guix/scripts/substitute.scm +++ b/guix/scripts/substitute.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2014 Nikita Karetnikov ;;; Copyright © 2018 Kyle Meyer ;;; Copyright © 2020 Christopher Baines +;;; Copyright © 2021 Tobias Geerinckx-Rice ;;; ;;; This file is part of GNU Guix. ;;; @@ -40,7 +41,7 @@ (define-module (guix scripts substitute) #:use-module (guix cache) #:use-module (gcrypt pk-crypto) #:use-module (guix pki) - #:use-module ((guix build utils) #:select (mkdir-p)) + #:use-module ((guix build utils) #:select (delete-file-recursively mkdir-p)) #:use-module ((guix build download) #:select (uri-abbreviation nar-uri-abbreviation (open-connection-for-uri @@ -239,6 +240,8 @@ (define-syntax with-networking (define (show-help) (display (G_ "Usage: guix substitute [OPTION]... Internal tool to substitute a pre-built binary to a local build.\n")) + (display (G_ " + --clear-cache forget previously cached availability information")) (display (G_ " --query report on the availability of substitutes for the store file names passed on the standard input")) @@ -749,6 +752,10 @@ (define reply-port (with-networking (with-error-handling ; for signature errors (match args + (("--clear-cache") + ;; This is meant to be a big hammer, so don't pussyfoot around with + ;; maybe-remove-expired-cache-entries. + (delete-file-recursively %narinfo-cache-directory)) (("--query") (let ((acl (current-acl))) (let loop ((command (read-line))) -- 2.34.0