[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/35: guix: Add download-svn-to-store.
From: |
Ricardo Wurmus |
Subject: |
01/35: guix: Add download-svn-to-store. |
Date: |
Thu, 15 Jun 2017 11:04:05 -0400 (EDT) |
rekado pushed a commit to branch master
in repository guix.
commit bef0db37690201573419f19946494a5e5188c1bd
Author: Ricardo Wurmus <address@hidden>
Date: Sun Jun 4 11:54:23 2017 +0200
guix: Add download-svn-to-store.
* guix/svn-download.scm (download-svn-to-store): New procedure.
---
guix/svn-download.scm | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/guix/svn-download.scm b/guix/svn-download.scm
index c1200fa..c118869 100644
--- a/guix/svn-download.scm
+++ b/guix/svn-download.scm
@@ -1,6 +1,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2014, 2015, 2016 Ludovic Courtès <address@hidden>
;;; Copyright © 2014 Sree Harsha Totakura <address@hidden>
+;;; Copyright © 2017 Ricardo Wurmus <address@hidden>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -23,12 +24,15 @@
#:use-module (guix store)
#:use-module (guix monads)
#:use-module (guix packages)
+ #:use-module (guix utils)
+ #:use-module ((guix build svn) #:prefix build:)
#:use-module (ice-9 match)
#:export (svn-reference
svn-reference?
svn-reference-url
svn-reference-revision
- svn-fetch))
+ svn-fetch
+ download-svn-to-store))
;;; Commentary:
;;;
@@ -79,4 +83,21 @@ HASH-ALGO (a symbol). Use NAME as the file name, or a
generic name if #f."
#:guile-for-build guile
#:local-build? #t)))
+(define* (download-svn-to-store store ref
+ #:optional (name (basename (svn-reference-url
ref)))
+ #:key (log (current-error-port)))
+ "Download from REF, a <svn-reference> object to STORE. Write progress
+reports to LOG."
+ (call-with-temporary-directory
+ (lambda (temp)
+ (let ((result
+ (parameterize ((current-output-port log))
+ (build:svn-fetch (svn-reference-url ref)
+ (svn-reference-revision ref)
+ temp
+ #:user-name (svn-reference-user-name ref)
+ #:password (svn-reference-password ref)))))
+ (and result
+ (add-to-store store name #t "sha256" temp))))))
+
;;; svn-download.scm ends here
- branch master updated (32fdad7 -> afbc941), Ricardo Wurmus, 2017/06/15
- 01/35: guix: Add download-svn-to-store.,
Ricardo Wurmus <=
- 03/35: gnu: Add texlive-dvips., Ricardo Wurmus, 2017/06/15
- 09/35: gnu: Add texlive-fonts-cm., Ricardo Wurmus, 2017/06/15
- 12/35: gnu: Add texlive-tex-plain., Ricardo Wurmus, 2017/06/15
- 16/35: gnu: Add texlive-generic-ifxetex., Ricardo Wurmus, 2017/06/15
- 19/35: gnu: Add texlive-latex-xcolor., Ricardo Wurmus, 2017/06/15
- 02/35: licenses: Add common TeX and LaTeX licenses., Ricardo Wurmus, 2017/06/15
- 10/35: gnu: Add texlive-fonts-knuth-lib., Ricardo Wurmus, 2017/06/15
- 11/35: gnu: Add texlive-fonts-latex., Ricardo Wurmus, 2017/06/15
- 15/35: gnu: Add texlive-latex-filecontents., Ricardo Wurmus, 2017/06/15
- 24/35: gnu: Add texlive-latex-l3kernel., Ricardo Wurmus, 2017/06/15