[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/13: download: Add Software Heritage as a content-addressed mirror.
From: |
Ludovic Courtès |
Subject: |
01/13: download: Add Software Heritage as a content-addressed mirror. |
Date: |
Wed, 14 Nov 2018 15:35:48 -0500 (EST) |
civodul pushed a commit to branch master
in repository guix.
commit ee2cfdfe86b0ba7de0312592cbfb96ea175e8863
Author: Ludovic Courtès <address@hidden>
Date: Tue Nov 13 22:26:07 2018 +0100
download: Add Software Heritage as a content-addressed mirror.
* guix/download.scm (%content-addressed-mirrors): Add Software
Heritage.
---
guix/download.scm | 34 ++++++++++++++++++++++------------
1 file changed, 22 insertions(+), 12 deletions(-)
diff --git a/guix/download.scm b/guix/download.scm
index 9881178..b74fd31 100644
--- a/guix/download.scm
+++ b/guix/download.scm
@@ -373,18 +373,28 @@
;; procedure that takes a file name, an algorithm (symbol) and a hash
;; (bytevector), and returns a URL or #f.
;; Note: Avoid 'https' to mitigate <http://bugs.gnu.org/22774>.
- ;; TODO: Add more.
- '(list (lambda (file algo hash)
- ;; Files served by 'guix publish' are accessible under a single
- ;; hash algorithm.
- (string-append "http://mirror.hydra.gnu.org/file/"
- file "/" (symbol->string algo) "/"
- (bytevector->nix-base32-string hash)))
- (lambda (file algo hash)
- ;; 'tarballs.nixos.org' supports several algorithms.
- (string-append "http://tarballs.nixos.org/"
- (symbol->string algo) "/"
- (bytevector->nix-base32-string hash)))))
+ '(begin
+ (use-modules (guix base32) (guix base16))
+
+ (list (lambda (file algo hash)
+ ;; Files served by 'guix publish' are accessible under a single
+ ;; hash algorithm.
+ (string-append "http://mirror.hydra.gnu.org/file/"
+ file "/" (symbol->string algo) "/"
+ (bytevector->nix-base32-string hash)))
+ (lambda (file algo hash)
+ ;; 'tarballs.nixos.org' supports several algorithms.
+ (string-append "http://tarballs.nixos.org/"
+ (symbol->string algo) "/"
+ (bytevector->nix-base32-string hash)))
+ (lambda (file algo hash)
+ ;; Software Heritage usually archives VCS history rather than
+ ;; tarballs, but tarballs are sometimes available (and can be
+ ;; explicitly stored there.) For example, see
+ ;;
<https://archive.softwareheritage.org/api/1/content/sha256:92d0fa1c311cacefa89853bdb53c62f4110cdfda3820346b59cbd098f40f955e/>.
+ (string-append
"http://archive.softwareheritage.org/api/1/content/"
+ (symbol->string algo) ":"
+ (bytevector->base16-string hash) "/raw/")))))
(define %content-addressed-mirror-file
;; Content-addressed mirrors stored in a file.
- 08/13: gnu: Add python-fenics-dijitso., (continued)
- 08/13: gnu: Add python-fenics-dijitso., Ludovic Courtès, 2018/11/14
- 07/13: gnu: Add python-slepc4py., Ludovic Courtès, 2018/11/14
- 03/13: gnu: guix-daemon: Install 'guix-authenticate'., Ludovic Courtès, 2018/11/14
- 02/13: download: Access content-addressed mirrors over HTTPS., Ludovic Courtès, 2018/11/14
- 06/13: gnu: Add python-petsc4py., Ludovic Courtès, 2018/11/14
- 10/13: gnu: Add python-fenics-fiat., Ludovic Courtès, 2018/11/14
- 05/13: gnu: Add python-mpi4py., Ludovic Courtès, 2018/11/14
- 13/13: gnu: Add fenics., Ludovic Courtès, 2018/11/14
- 09/13: gnu: Add python-fenics-ufl., Ludovic Courtès, 2018/11/14
- 12/13: gnu: Add fenics-dolfin., Ludovic Courtès, 2018/11/14
- 01/13: download: Add Software Heritage as a content-addressed mirror.,
Ludovic Courtès <=
- 04/13: daemon: Install 'authenticate' script under LIBEXECDIR/guix., Ludovic Courtès, 2018/11/14
- 11/13: gnu: Add python-fenics-ffc., Ludovic Courtès, 2018/11/14