diff options
author | Ludovic Courtès <ludo@gnu.org> | 2019-07-20 20:13:39 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2019-07-22 11:53:39 +0200 |
commit | 96f1cbeff84819f9886d15763b4c477cdecd7784 (patch) | |
tree | effda7227bcda05d87cd317a29301b55c3328858 /guix | |
parent | 5a90d5635226255e65b19a094a4851ff3886c0c5 (diff) | |
download | gnu-guix-96f1cbeff84819f9886d15763b4c477cdecd7784.tar gnu-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')
-rw-r--r-- | guix/swh.scm | 10 |
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. |