From 96f1cbeff84819f9886d15763b4c477cdecd7784 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sat, 20 Jul 2019 20:13:39 +0200 Subject: 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. --- guix/swh.scm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'guix/swh.scm') 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 +;;; Copyright © 2018, 2019 Ludovic Courtès ;;; ;;; 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. -- cgit v1.2.3