all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: 69328@debbugs.gnu.org
Cc: "Timothy Sample" <samplet@ngyro.com>, "Ludovic Courtès" <ludo@gnu.org>
Subject: [bug#69328] [PATCH v2 10/12] download-nar: Distinguish ‘output’ and ‘item’ parameter.
Date: Tue,  5 Mar 2024 12:06:58 +0100	[thread overview]
Message-ID: <559b047af3adb608ef8245faadb0c7089dd2de1a.1709636144.git.ludo@gnu.org> (raw)
In-Reply-To: <87o7btc5du.fsf@gnu.org>

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 <ludo@gnu.org>
+;;; Copyright © 2017, 2019, 2020, 2024 Ludovic Courtès <ludo@gnu.org>
 ;;;
 ;;; 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))))
       (()
-- 
2.41.0





  parent reply	other threads:[~2024-03-05 11:09 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-23 14:22 [bug#69328] [PATCH 00/12] Better source code recovery from SWH Ludovic Courtès
2024-02-23 15:48 ` [bug#69328] [PATCH 01/12] lint: Switch to SRFI-71 Ludovic Courtès
2024-02-23 15:48 ` [bug#69328] [PATCH 02/12] lint: archival: Fix crash in non-Git case Ludovic Courtès
2024-02-23 15:48 ` [bug#69328] [PATCH 03/12] lint: archival: Trigger “Save Code Now” for VCSes other than Git Ludovic Courtès
2024-02-23 15:48 ` [bug#69328] [PATCH 04/12] swh: Add ‘type’ field to <visit> Ludovic Courtès
2024-02-23 15:48 ` [bug#69328] [PATCH 05/12] swh: ‘origin-visits’ takes an optional ‘max’ parameter Ludovic Courtès
2024-02-23 15:48 ` [bug#69328] [PATCH 06/12] swh: ‘lookup-origin-revision’ handles branches pointing to directories Ludovic Courtès
2024-02-23 15:48 ` [bug#69328] [PATCH 07/12] hg-download: Use ‘swh-download-directory-by-nar-hash’ Ludovic Courtès
2024-02-23 15:48 ` [bug#69328] [PATCH 08/12] svn-download: " Ludovic Courtès
2024-02-23 15:48 ` [bug#69328] [PATCH 09/12] bzr-download: Implement nar fallback Ludovic Courtès
2024-02-23 15:48 ` [bug#69328] [PATCH 10/12] download-nar: Distinguish ‘output’ and ‘item’ parameter Ludovic Courtès
2024-02-23 15:48 ` [bug#69328] [PATCH 11/12] perform-download: Allow use of ‘download-nar’ for ‘--check’ builds Ludovic Courtès
2024-02-23 15:48 ` [bug#69328] [PATCH 12/12] download: Honor ‘GUIX_DOWNLOAD_SEQUENCE’ environment variable Ludovic Courtès
2024-03-03  4:53   ` Timothy Sample
2024-03-05 10:26     ` Ludovic Courtès
2024-02-23 15:53 ` [bug#69328] [PATCH 00/12] Better source code recovery from SWH Ludovic Courtès
2024-03-03  4:54 ` Timothy Sample
2024-03-05 10:58   ` Ludovic Courtès
2024-03-05 11:06     ` [bug#69328] [PATCH v2 " Ludovic Courtès
2024-03-07 18:38       ` Simon Tournier
2024-03-09 18:51         ` bug#69328: " Ludovic Courtès
2024-03-05 11:06     ` [bug#69328] [PATCH v2 01/12] lint: Switch to SRFI-71 Ludovic Courtès
2024-03-05 11:06     ` [bug#69328] [PATCH v2 02/12] lint: archival: Fix crash in non-Git case Ludovic Courtès
2024-03-05 11:06     ` [bug#69328] [PATCH v2 03/12] lint: archival: Trigger “Save Code Now” for VCSes other than Git Ludovic Courtès
2024-03-05 11:06     ` [bug#69328] [PATCH v2 04/12] swh: Add ‘type’ field to <visit> Ludovic Courtès
2024-03-05 11:06     ` [bug#69328] [PATCH v2 05/12] swh: ‘origin-visits’ takes an optional ‘max’ parameter Ludovic Courtès
2024-03-05 11:06     ` [bug#69328] [PATCH v2 06/12] swh: ‘lookup-origin-revision’ handles branches pointing to directories Ludovic Courtès
2024-03-05 11:06     ` [bug#69328] [PATCH v2 07/12] hg-download: Use ‘swh-download-directory-by-nar-hash’ Ludovic Courtès
2024-03-05 11:06     ` [bug#69328] [PATCH v2 08/12] svn-download: " Ludovic Courtès
2024-03-05 11:06     ` [bug#69328] [PATCH v2 09/12] bzr-download: Implement nar fallback Ludovic Courtès
2024-03-05 11:06     ` Ludovic Courtès [this message]
2024-03-05 11:06     ` [bug#69328] [PATCH v2 11/12] perform-download: Allow use of ‘download-nar’ for ‘--check’ builds Ludovic Courtès
2024-03-05 11:07     ` [bug#69328] [PATCH v2 12/12] download: Honor ‘GUIX_DOWNLOAD_METHODS’ environment variable Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=559b047af3adb608ef8245faadb0c7089dd2de1a.1709636144.git.ludo@gnu.org \
    --to=ludo@gnu.org \
    --cc=69328@debbugs.gnu.org \
    --cc=samplet@ngyro.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.