svn-download: Use download-nar in svn-multi-fetch.

This should help if there are issues fetching from the source repository.

* guix/svn-download.scm (svn-multi-fetch): Use download-nar and adjust
accordingly.
This commit is contained in:
Christopher Baines 2023-07-11 15:23:34 +01:00 committed by Nicolas Goaziou
parent a8d937d1bb
commit 32e48b8b43
No known key found for this signature in database
GPG key ID: DA00B4F048E92F2D

View file

@ -160,16 +160,32 @@ (define* (svn-multi-fetch ref hash-algo hash
"Return a fixed-output derivation that fetches REF, a <svn-multi-reference> "Return a fixed-output derivation that fetches REF, a <svn-multi-reference>
object. The output is expected to have recursive hash HASH of type object. The output is expected to have recursive hash HASH of type
HASH-ALGO (a symbol). Use NAME as the file name, or a generic name if #f." HASH-ALGO (a symbol). Use NAME as the file name, or a generic name if #f."
(define guile-json
(module-ref (resolve-interface '(gnu packages guile)) 'guile-json-4))
(define guile-lzlib
(module-ref (resolve-interface '(gnu packages guile)) 'guile-lzlib))
(define guile-gnutls
(module-ref (resolve-interface '(gnu packages tls)) 'guile-gnutls))
(define build (define build
(with-imported-modules '((guix build svn) (with-imported-modules
(guix build utils)) (source-module-closure '((guix build svn)
(guix build download-nar)
(guix build utils)))
(with-extensions (list guile-json guile-gnutls ;for (guix swh)
guile-lzlib)
#~(begin #~(begin
(use-modules (guix build svn) (use-modules (guix build svn)
(guix build utils) (guix build utils)
(guix build download-nar)
(srfi srfi-1) (srfi srfi-1)
(ice-9 match)) (ice-9 match))
(for-each (lambda (location) (or (every
(lambda (location)
;; The directory must exist if we are to fetch only a ;; The directory must exist if we are to fetch only a
;; single file. ;; single file.
(unless (string-suffix? "/" location) (unless (string-suffix? "/" location)
@ -186,7 +202,8 @@ (define build
#:user-name (getenv "svn user name") #:user-name (getenv "svn user name")
#:password (getenv "svn password"))) #:password (getenv "svn password")))
(call-with-input-string (getenv "svn locations") (call-with-input-string (getenv "svn locations")
read))))) read))
(download-nar #$output))))))
(mlet %store-monad ((guile (package->derivation guile system))) (mlet %store-monad ((guile (package->derivation guile system)))
(gexp->derivation (or name "svn-checkout") build (gexp->derivation (or name "svn-checkout") build