guix: svn: Allow dropping externals.

* guix/build/svn.scm (svn-fetch): Allow to ignore externals.
* guix/svn-download.scm (svn-reference, svn-multi-reference): Add
recursive? field.
This commit is contained in:
Julien Lepiller 2019-10-21 21:48:31 +02:00
parent 934b83e45a
commit 277ba1d4f8
No known key found for this signature in database
GPG key ID: 43111F4520086A0C
2 changed files with 15 additions and 4 deletions

View file

@ -31,6 +31,7 @@ (define-module (guix build svn)
(define* (svn-fetch url revision directory
#:key (svn-command "svn")
(recursive? #t)
(user-name #f)
(password #f))
"Fetch REVISION from URL into DIRECTORY. REVISION must be an integer, and a
@ -45,6 +46,9 @@ (define* (svn-fetch url revision directory
(list (string-append "--username=" user-name)
(string-append "--password=" password))
'())
,@(if recursive?
'()
(list "--ignore-externals"))
,url ,directory))
#t)

View file

@ -31,6 +31,7 @@ (define-module (guix svn-download)
svn-reference?
svn-reference-url
svn-reference-revision
svn-reference-recursive?
svn-fetch
download-svn-to-store
@ -39,6 +40,7 @@ (define-module (guix svn-download)
svn-multi-reference-url
svn-multi-reference-revision
svn-multi-reference-locations
svn-multi-reference-recursive?
svn-multi-fetch))
;;; Commentary:
@ -52,10 +54,11 @@ (define-module (guix svn-download)
(define-record-type* <svn-reference>
svn-reference make-svn-reference
svn-reference?
(url svn-reference-url) ; string
(revision svn-reference-revision) ; number
(user-name svn-reference-user-name (default #f))
(password svn-reference-password (default #f)))
(url svn-reference-url) ; string
(revision svn-reference-revision) ; number
(recursive? svn-reference-recursive? (default #t))
(user-name svn-reference-user-name (default #f))
(password svn-reference-password (default #f)))
(define (subversion-package)
"Return the default Subversion package."
@ -78,6 +81,7 @@ (define build
'#$(svn-reference-revision ref)
#$output
#:svn-command (string-append #+svn "/bin/svn")
#:recursive? #$(svn-reference-recursive? ref)
#:user-name #$(svn-reference-user-name ref)
#:password #$(svn-reference-password ref)))))
@ -96,6 +100,7 @@ (define-record-type* <svn-multi-reference>
(url svn-multi-reference-url) ; string
(revision svn-multi-reference-revision) ; number
(locations svn-multi-reference-locations) ; list of strings
(recursive? svn-multi-reference-recursive? (default #t))
(user-name svn-multi-reference-user-name (default #f))
(password svn-multi-reference-password (default #f)))
@ -125,6 +130,8 @@ (define build
(string-append #$output "/" location)
(string-append #$output "/" (dirname location)))
#:svn-command (string-append #+svn "/bin/svn")
#:recursive?
#$(svn-multi-reference-recursive? ref)
#:user-name #$(svn-multi-reference-user-name ref)
#:password #$(svn-multi-reference-password ref)))
'#$(svn-multi-reference-locations ref)))))