summaryrefslogtreecommitdiff
path: root/guix/build/svn.scm
diff options
context:
space:
mode:
Diffstat (limited to 'guix/build/svn.scm')
-rw-r--r--guix/build/svn.scm38
1 files changed, 22 insertions, 16 deletions
diff --git a/guix/build/svn.scm b/guix/build/svn.scm
index 33783f3056..44d77a968f 100644
--- a/guix/build/svn.scm
+++ b/guix/build/svn.scm
@@ -1,7 +1,8 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2014 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2014, 2020 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2014 Sree Harsha Totakura <sreeharsha@totakura.in>
;;; Copyright © 2018 Mark H Weaver <mhw@netris.org>
+;;; Copyright © 2020 Simon Tournier <zimon.toutoune@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -20,6 +21,8 @@
(define-module (guix build svn)
#:use-module (guix build utils)
+ #:use-module (srfi srfi-34)
+ #:use-module (ice-9 format)
#:export (svn-fetch))
;;; Commentary:
@@ -36,20 +39,23 @@
(password #f))
"Fetch REVISION from URL into DIRECTORY. REVISION must be an integer, and a
valid Subversion revision. Return #t on success, #f otherwise."
- (apply invoke svn-command
- "export" "--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))
- '())
- ,@(if recursive?
- '()
- (list "--ignore-externals"))
- ,url ,directory))
- #t)
+ (guard (c ((invoke-error? c)
+ (report-invoke-error c)
+ #f))
+ (apply invoke svn-command
+ "export" "--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))
+ '())
+ ,@(if recursive?
+ '()
+ (list "--ignore-externals"))
+ ,url ,directory))
+ #t))
;;; svn.scm ends here