[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#69328] [PATCH v2 07/12] hg-download: Use ‘swh-download-directory-by
From: |
Ludovic Courtès |
Subject: |
[bug#69328] [PATCH v2 07/12] hg-download: Use ‘swh-download-directory-by-nar-hash’. |
Date: |
Tue, 5 Mar 2024 12:06:55 +0100 |
This allows content-addressed access to the checkout, which is
preferable.
* guix/hg-download.scm (hg-fetch): Add call to
‘swh-download-directory-by-nar-hash’ before ‘swh-download’ call.
Change-Id: I2afc8badc1f8bb2c8bdd3a47abbb72d455d93e64
---
guix/hg-download.scm | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/guix/hg-download.scm b/guix/hg-download.scm
index 6d02de47e4..dd28d9c244 100644
--- a/guix/hg-download.scm
+++ b/guix/hg-download.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2014, 2015, 2016, 2017, 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2014-2017, 2019, 2024 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
;;;
@@ -117,9 +117,11 @@ (define* (hg-fetch ref hash-algo hash
(parameterize ((%verify-swh-certificate? #f))
(format (current-error-port)
"Trying to download from Software Heritage...~%")
- (swh-download #$(hg-reference-url ref)
- #$(hg-reference-changeset ref)
- #$output)))))))
+ (or (swh-download-directory-by-nar-hash #$hash '#$hash-algo
+ #$output)
+ (swh-download #$(hg-reference-url ref)
+ #$(hg-reference-changeset ref)
+ #$output))))))))
(mlet %store-monad ((guile (package->derivation guile system)))
(gexp->derivation (or name "hg-checkout") build
--
2.41.0
- [bug#69328] [PATCH 00/12] Better source code recovery from SWH, (continued)
- [bug#69328] [PATCH 00/12] Better source code recovery from SWH, Ludovic Courtès, 2024/03/05
- [bug#69328] [PATCH v2 03/12] lint: archival: Trigger “Save Code Now” for VCSes other than Git., Ludovic Courtès, 2024/03/05
- [bug#69328] [PATCH v2 02/12] lint: archival: Fix crash in non-Git case., Ludovic Courtès, 2024/03/05
- [bug#69328] [PATCH v2 09/12] bzr-download: Implement nar fallback., Ludovic Courtès, 2024/03/05
- [bug#69328] [PATCH v2 04/12] swh: Add ‘type’ field to <visit>., Ludovic Courtès, 2024/03/05
- [bug#69328] [PATCH v2 06/12] swh: ‘lookup-origin-revision’ handles branches pointing to directories., Ludovic Courtès, 2024/03/05
- [bug#69328] [PATCH v2 01/12] lint: Switch to SRFI-71., Ludovic Courtès, 2024/03/05
- [bug#69328] [PATCH v2 07/12] hg-download: Use ‘swh-download-directory-by-nar-hash’.,
Ludovic Courtès <=
- [bug#69328] [PATCH v2 05/12] swh: ‘origin-visits’ takes an optional ‘max’ parameter., Ludovic Courtès, 2024/03/05
- [bug#69328] [PATCH v2 12/12] download: Honor ‘GUIX_DOWNLOAD_METHODS’ environment variable., Ludovic Courtès, 2024/03/05
- [bug#69328] [PATCH v2 11/12] perform-download: Allow use of ‘download-nar’ for ‘--check’ builds., Ludovic Courtès, 2024/03/05
- [bug#69328] [PATCH v2 10/12] download-nar: Distinguish ‘output’ and ‘item’ parameter., Ludovic Courtès, 2024/03/05
- [bug#69328] [PATCH v2 08/12] svn-download: Use ‘swh-download-directory-by-nar-hash’., Ludovic Courtès, 2024/03/05