1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2014 Sree Harsha Totakura <sreeharsha@totakura.in>
4 ;;; Copyright © 2018 Mark H Weaver <mhw@netris.org>
6 ;;; This file is part of GNU Guix.
8 ;;; GNU Guix is free software; you can redistribute it and/or modify it
9 ;;; under the terms of the GNU General Public License as published by
10 ;;; the Free Software Foundation; either version 3 of the License, or (at
11 ;;; your option) any later version.
13 ;;; GNU Guix is distributed in the hope that it will be useful, but
14 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;;; GNU General Public License for more details.
18 ;;; You should have received a copy of the GNU General Public License
19 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21 (define-module (guix build svn)
22 #:use-module (guix build utils)
27 ;;; This is the build-side support code of (guix svn-download). It allows a
28 ;;; Subversion repository to be cloned and checked out at a specific revision.
32 (define* (svn-fetch url revision directory
33 #:key (svn-command "svn")
37 "Fetch REVISION from URL into DIRECTORY. REVISION must be an integer, and a
38 valid Subversion revision. Return #t on success, #f otherwise."
39 (apply invoke svn-command
40 "export" "--non-interactive"
41 ;; Trust the server certificate. This is OK as we
42 ;; verify the checksum later. This can be removed when
43 ;; ca-certificates package is added.
44 "--trust-server-cert" "-r" (number->string revision)
45 `(,@(if (and user-name password)
46 (list (string-append "--username=" user-name)
47 (string-append "--password=" password))
51 (list "--ignore-externals"))