summary refs log tree commit diff
diff options
context:
space:
mode:
authorJulien Lepiller <julien@lepiller.eu>2019-10-21 21:48:31 +0200
committerJulien Lepiller <julien@lepiller.eu>2019-10-23 23:31:08 +0200
commit51395c84fdbf8daed6392951a973ad750cf3eefa (patch)
treef9e8132725a771b1f780d2f2943105ca9116f870
parentb40f4a5995cff00077aa60881737d0d0f6871982 (diff)
downloadguix-51395c84fdbf8daed6392951a973ad750cf3eefa.tar.gz
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.
-rw-r--r--guix/build/svn.scm4
-rw-r--r--guix/svn-download.scm15
2 files changed, 15 insertions, 4 deletions
diff --git a/guix/build/svn.scm b/guix/build/svn.scm
index e3188add3e..33783f3056 100644
--- a/guix/build/svn.scm
+++ b/guix/build/svn.scm
@@ -31,6 +31,7 @@
 
 (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 @@ valid Subversion revision.  Return #t on success, #f otherwise."
                  (list (string-append "--username=" user-name)
                        (string-append "--password=" password))
                  '())
+           ,@(if recursive?
+                 '()
+                 (list "--ignore-externals"))
            ,url ,directory))
   #t)
 
diff --git a/guix/svn-download.scm b/guix/svn-download.scm
index 4139cbc2e2..d912474aa2 100644
--- a/guix/svn-download.scm
+++ b/guix/svn-download.scm
@@ -31,6 +31,7 @@
             svn-reference?
             svn-reference-url
             svn-reference-revision
+            svn-reference-recursive?
             svn-fetch
             download-svn-to-store
 
@@ -39,6 +40,7 @@
             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-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 @@ HASH-ALGO (a symbol).  Use NAME as the file name, or a generic name if #f."
                      '#$(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 @@ HASH-ALGO (a symbol).  Use NAME as the file name, or a generic name if #f."
   (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 @@ HASH-ALGO (a symbol).  Use NAME as the file name, or a generic name if #f."
                                   (string-append #$output "/" location)
                                   (string-append #$output "/" (dirname location)))
                               #:svn-command (string-append #+svn "/bin/svn")
+                              #:recursive?
+                              #$(svn-reference-recursive? ref)
                               #:user-name #$(svn-multi-reference-user-name ref)
                               #:password #$(svn-multi-reference-password ref)))
                  '#$(svn-multi-reference-locations ref)))))