From patchwork Fri Feb 23 15:48:14 2024 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: 60930 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 C492527BBEA; Fri, 23 Feb 2024 16:16:17 +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,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham 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 4BFB927BBE2 for ; Fri, 23 Feb 2024 16:16:17 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rdYCN-00067Z-Qs; Fri, 23 Feb 2024 11:14:55 -0500 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 1rdXnx-00047b-W5 for guix-patches@gnu.org; Fri, 23 Feb 2024 10:49:42 -0500 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 1rdXnx-0007Ea-NH for guix-patches@gnu.org; Fri, 23 Feb 2024 10:49:41 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rdXoL-0002Af-5T for guix-patches@gnu.org; Fri, 23 Feb 2024 10:50:05 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#69328] [PATCH 10/12] download-nar: Distinguish =?utf-8?b?4oCY?= =?utf-8?b?b3V0cHV04oCZ?= and =?utf-8?b?4oCYaXRlbeKAmQ==?= parameter. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 23 Feb 2024 15:50:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69328 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 69328@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 69328-submit@debbugs.gnu.org id=B69328.17087033668079 (code B ref 69328); Fri, 23 Feb 2024 15:50:05 +0000 Received: (at 69328) by debbugs.gnu.org; 23 Feb 2024 15:49:26 +0000 Received: from localhost ([127.0.0.1]:49233 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rdXni-000269-2y for submit@debbugs.gnu.org; Fri, 23 Feb 2024 10:49:26 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52694) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rdXnS-00021r-6B for 69328@debbugs.gnu.org; Fri, 23 Feb 2024 10:49:16 -0500 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 1rdXn0-00078w-R6; Fri, 23 Feb 2024 10:48:42 -0500 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=r1S7QRxOSIfz/tH9fyNFWCjkYdbX+9xm2B1kmVqebQ0=; b=V6sg8oxMFGm0aCgPVRPc lID+XCzOJ4lD4UEvvA/aiQ5ZxB6r/Ja+pIYT3onwKTR5eLzIHlj3WG9x8URFzJj8r026v8LTyOKqj IfLDnjbZT7tqVHYHWpi7lgTfDiDX3Of0aGumCz22hEnKMCnTGNwyYq/2xiP1OYEd+eGabToJ9Wa05 8idnXDPL43Knf7sga2UV1vfh5S9ACnmAVrSaaXAWyF/JsWB5ZLrX8pTGVh8V3pCeI+caxEXwCt/H/ 0NAuf6WGkSB6Hb624VHYiKAOdvXgSQy8/IHSeYbpW49vmRx8uUj/0WYFHW35iG+YZac6hlmUvM5L0 zau8XL1IamMLmQ==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Fri, 23 Feb 2024 16:48:14 +0100 Message-ID: X-Mailer: git-send-email 2.41.0 In-Reply-To: References: 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 This is useful when running a ‘--check’ build, where the output file name differs from the store file name we are trying to restore. * guix/build/download-nar.scm (download-nar): Add ‘output’ parameter and distinguish it from ‘item’. Change-Id: I42219b6d4c8fd1ed506720301384efc1aa351561 --- guix/build/download-nar.scm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/guix/build/download-nar.scm b/guix/build/download-nar.scm index 3ba121b7fb..f26ad28cd0 100644 --- a/guix/build/download-nar.scm +++ b/guix/build/download-nar.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2017, 2019, 2020 Ludovic Courtès +;;; Copyright © 2017, 2019, 2020, 2024 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -57,9 +57,9 @@ (define (restore-lzipped-nar port item size) (restore-file decompressed-port item)))) -(define (download-nar item) - "Download and extract the normalized archive for ITEM. Return #t on -success, #f otherwise." +(define* (download-nar item #:optional (output item)) + "Download and extract to OUTPUT the normalized archive for ITEM, a store +item. Return #t on success, #f otherwise." ;; Let progress reports go through. (setvbuf (current-error-port) 'none) (setvbuf (current-output-port) 'none) @@ -96,10 +96,10 @@ (define (download-nar item) #:download-size size))) (if (string-contains url "/lzip") (restore-lzipped-nar port-with-progress - item + output size) (restore-file port-with-progress - item))) + output))) (newline) #t)))) (()