From patchwork Fri Sep 22 22:27:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 54167 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 8981D27BBE9; Fri, 22 Sep 2023 23:29:34 +0100 (BST) 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,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 EF14C27BBE2 for ; Fri, 22 Sep 2023 23:29:33 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qjodx-0001hZ-0q; Fri, 22 Sep 2023 18:29:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qjods-0001gy-Og for guix-patches@gnu.org; Fri, 22 Sep 2023 18:28:57 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qjods-0005sz-AU; Fri, 22 Sep 2023 18:28:56 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qjodz-0006lL-Vx; Fri, 22 Sep 2023 18:29:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#65866] [PATCH v2 3/8] perform-download: Remove unused one-argument clause. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, rekado@elephly.net, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Fri, 22 Sep 2023 22:29:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65866 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 65866@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= , Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 65866-submit@debbugs.gnu.org id=B65866.169542174225974 (code B ref 65866); Fri, 22 Sep 2023 22:29:03 +0000 Received: (at 65866) by debbugs.gnu.org; 22 Sep 2023 22:29:02 +0000 Received: from localhost ([127.0.0.1]:37408 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qjodx-0006kk-Ur for submit@debbugs.gnu.org; Fri, 22 Sep 2023 18:29:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45538) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qjodp-0006jJ-5C for 65866@debbugs.gnu.org; Fri, 22 Sep 2023 18:28:55 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qjodZ-0005m1-0G; Fri, 22 Sep 2023 18:28:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=gNug78rp8gIAX876iiouNa+KGe0CY0p3NljM9It7aTE=; b=qTu/Q3cgDVIDaCLUgU+8 GtQ95DcpHgT4y8kVXhPSiyMkOvw8q8IrNVqoJFPb5iKK5UM9W9PfcVx8Avm00tT5K8RQpp4qEovmH DnTTX3s6/vZpTz2dsxxlvS1BHH7Ahe+SNUxTtk1GAIthKBzo/3JtqGF+OacE4N9dfMQhUWCCjlJt+ tZCWPsOjNVkTK3NnJIqudWGjA9Y2k430CseeYQ+mCJYeIuaOySKq6KxHM1Foy2YydR5Fh/38k0eYJ dC9KcYoZNbwGGmnJL0zwGll0JYKcJXmoKCioumqApoFG3zC6FFnk5rrzupUro+1WtVKl4o9ynkihc g7/whf4uVciR0A==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Sat, 23 Sep 2023 00:27:59 +0200 Message-ID: X-Mailer: git-send-email 2.41.0 In-Reply-To: References: <87o7hwas61.fsf@gnu.org> MIME-Version: 1.0 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-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches Code in ‘builtins.cc’ only ever invokes ‘guix perform-download’ with two arguments. * guix/scripts/perform-download.scm (guix-perform-download): Remove unused one-argument clause. (perform-download): Make ‘output’ parameter mandatory; remove ‘output*’ variable. --- guix/scripts/perform-download.scm | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/guix/scripts/perform-download.scm b/guix/scripts/perform-download.scm index 6889bcef79..3b29a3c81d 100644 --- a/guix/scripts/perform-download.scm +++ b/guix/scripts/perform-download.scm @@ -42,16 +42,14 @@ (define %user-module (module-use! module (resolve-interface '(guix base32))) module)) -(define* (perform-download drv #:optional output +(define* (perform-download drv output #:key print-build-trace?) "Perform the download described by DRV, a fixed-output derivation, to OUTPUT. -Note: Unless OUTPUT is #f, we don't read the value of 'out' in DRV since the -actual output is different from that when we're doing a 'bmCheck' or -'bmRepair' build." +Note: OUTPUT may differ from the 'out' value of DRV, notably for 'bmCheck' or +'bmRepair' builds." (derivation-let drv ((url "url") - (output* "out") (executable "executable") (mirrors "mirrors") (content-addressed-mirrors "content-addressed-mirrors") @@ -59,8 +57,7 @@ (define* (perform-download drv #:optional output (unless url (leave (G_ "~a: missing URL~%") (derivation-file-name drv))) - (let* ((output (or output output*)) - (url (call-with-input-string url read)) + (let* ((url (call-with-input-string url read)) (drv-output (assoc-ref (derivation-outputs drv) "out")) (algo (derivation-output-hash-algo drv-output)) (hash (derivation-output-hash drv-output))) @@ -120,13 +117,8 @@ (define-command (guix-perform-download . args) (match args (((? derivation-path? drv) (? store-path? output)) (assert-low-privileges) - (perform-download (read-derivation-from-file drv) - output - #:print-build-trace? print-build-trace?)) - (((? derivation-path? drv)) ;backward compatibility - (assert-low-privileges) - (perform-download (read-derivation-from-file drv) - #:print-build-trace? print-build-trace?)) + (let ((drv (read-derivation-from-file drv))) + (perform-download drv output #:print-build-trace? print-build-trace?))) (("--version") (show-version-and-exit)) (x