aboutsummaryrefslogtreecommitdiff
path: root/guix/swh.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-07-20 20:13:39 +0200
committerLudovic Courtès <ludo@gnu.org>2019-07-22 11:53:39 +0200
commit96f1cbeff84819f9886d15763b4c477cdecd7784 (patch)
treeeffda7227bcda05d87cd317a29301b55c3328858 /guix/swh.scm
parent5a90d5635226255e65b19a094a4851ff3886c0c5 (diff)
downloadguix-96f1cbeff84819f9886d15763b4c477cdecd7784.tar
guix-96f1cbeff84819f9886d15763b4c477cdecd7784.tar.gz
swh: Add basic tests.
* guix/swh.scm (%swh-base-url): Turn into a parameter and export it. * tests/swh.scm: New file. * Makefile.am (SCM_TESTS): Add it.
Diffstat (limited to 'guix/swh.scm')
-rw-r--r--guix/swh.scm10
1 files changed, 6 insertions, 4 deletions
diff --git a/guix/swh.scm b/guix/swh.scm
index 89cddb2bdd..d692f81806 100644
--- a/guix/swh.scm
+++ b/guix/swh.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2018 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2018, 2019 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -31,7 +31,9 @@
#:use-module (ice-9 regex)
#:use-module (ice-9 popen)
#:use-module ((ice-9 ftw) #:select (scandir))
- #:export (origin?
+ #:export (%swh-base-url
+
+ origin?
origin-id
origin-type
origin-url
@@ -115,11 +117,11 @@
(define %swh-base-url
;; Presumably we won't need to change it.
- "https://archive.softwareheritage.org")
+ (make-parameter "https://archive.softwareheritage.org"))
(define (swh-url path . rest)
(define url
- (string-append %swh-base-url path
+ (string-append (%swh-base-url) path
(string-join rest "/" 'prefix)))
;; Ensure there's a trailing slash or we get a redirect.