From 140dd8f82c4b513c182a71bbd61a9cfa1360782a Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 30 Jun 2016 15:43:23 +0200 Subject: guix: Support authentication when fetching from SVN. * guix/svn-download.scm (): Add fields for optional credentials. (svn-fetch): Pass credentials to build-side "svn-fetch". * guix/build/svn.scm (svn-fetch): Pass optional credentials to svn command. --- guix/build/svn.scm | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'guix/build/svn.scm') diff --git a/guix/build/svn.scm b/guix/build/svn.scm index 74fe084da5..31c30edaf5 100644 --- a/guix/build/svn.scm +++ b/guix/build/svn.scm @@ -29,15 +29,22 @@ ;;; Code: (define* (svn-fetch url revision directory - #:key (svn-command "svn")) + #:key (svn-command "svn") + (user-name #f) + (password #f)) "Fetch REVISION from URL into DIRECTORY. REVISION must be an integer, and a valid Subversion revision. Return #t on success, #f otherwise." - (and (zero? (system* svn-command "checkout" "--non-interactive" - ;; Trust the server certificate. This is OK as we - ;; verify the checksum later. This can be removed when - ;; ca-certificates package is added. - "--trust-server-cert" "-r" (number->string revision) - url directory)) + (and (zero? (apply system* svn-command + "checkout" "--non-interactive" + ;; Trust the server certificate. This is OK as we + ;; verify the checksum later. This can be removed when + ;; ca-certificates package is added. + "--trust-server-cert" "-r" (number->string revision) + `(,@(if (and user-name password) + (list (string-append "--username=" user-name) + (string-append "--password=" password)) + '()) + ,url ,directory))) (with-directory-excursion directory (begin ;; The contents of '.svn' vary as a function of the current status -- cgit v1.2.3