From patchwork Sun Dec 26 16:21:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tobias Geerinckx-Rice X-Patchwork-Id: 35665 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id E78B427BBEA; Sun, 26 Dec 2021 16:24:03 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 9C1EE27BBE9 for ; Sun, 26 Dec 2021 16:24:03 +0000 (GMT) Received: from localhost ([::1]:34920 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n1WJW-0005Gp-Of for patchwork@mira.cbaines.net; Sun, 26 Dec 2021 11:24:02 -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?b?4oCYLS1jbGVhci1j?= =?utf-8?b?YWNoZeKAmQ==?= 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 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" Reply-to: Tobias Geerinckx-Rice X-ACL-Warn: , Tobias Geerinckx-Rice via Guix-patches X-Patchwork-Original-From: Tobias Geerinckx-Rice via Guix-patches via From: Tobias Geerinckx-Rice X-getmail-retrieved-from-mailbox: Patches 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)))