summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2024-06-23 17:29:37 +0200
committerChristopher Baines <mail@cbaines.net>2024-07-11 10:25:20 +0100
commit33006275db8627267e1a43ba939bc5ca9847e751 (patch)
tree5cfd9729a10b420c3c1a26c4045e93fd8e06541d
parent21c042a3013754e0239a941bae8b469df496561e (diff)
downloadguix-patches-33006275db8627267e1a43ba939bc5ca9847e751.tar
guix-patches-33006275db8627267e1a43ba939bc5ca9847e751.tar.gz
guix: download-multi-svn-to-store: Allow exporting from base URL.
* guix/svn-download.scm (download-multi-svn-to-store): Allow exporting from locations such as "./" or "somefile.txt". Change-Id: If37362e4672b175fe413acc56ed67064ad998fe3
-rw-r--r--guix/svn-download.scm40
1 files changed, 24 insertions, 16 deletions
diff --git a/guix/svn-download.scm b/guix/svn-download.scm
index 62649e4374..b20cdc79d1 100644
--- a/guix/svn-download.scm
+++ b/guix/svn-download.scm
@@ -351,21 +351,29 @@ reports to LOG."
reports to LOG."
(call-with-temporary-directory
(lambda (temp)
- (and (every (lambda (location)
- (let ((dir (string-append temp "/" (dirname location))))
- (mkdir-p dir))
- (parameterize ((current-output-port log))
- (build:svn-fetch (string-append (svn-multi-reference-url ref)
- "/" location)
- (svn-multi-reference-revision ref)
- (if (string-suffix? "/" location)
- (string-append temp "/" location)
- (string-append temp "/" (dirname location)))
- #:recursive?
- (svn-multi-reference-recursive? ref)
- #:user-name (svn-multi-reference-user-name ref)
- #:password (svn-multi-reference-password ref))))
- (svn-multi-reference-locations ref))
- (add-to-store store name #t "sha256" temp)))))
+ ;; When "svn" is called, TEMP already exists. As a consequence, "svn"
+ ;; refuses to export files there, assuming it would overwrite a previous
+ ;; export. It can be an issue if locations includes files at SVN URL.
+ ;; To circumvent this, export in a fresh sub-directory.
+ (let ((output (string-append temp "/svn")))
+ (mkdir-p output)
+ (and (every (lambda (location)
+ (unless (string-suffix? "/" location)
+ (mkdir-p (string-append output "/" (dirname location))))
+ (parameterize ((current-output-port log))
+ (build:svn-fetch
+ (string-append (svn-multi-reference-url ref)
+ "/"
+ location)
+ (svn-multi-reference-revision ref)
+ (if (string-suffix? "/" location)
+ (string-append output "/" location)
+ (string-append output "/" (dirname location)))
+ #:recursive?
+ (svn-multi-reference-recursive? ref)
+ #:user-name (svn-multi-reference-user-name ref)
+ #:password (svn-multi-reference-password ref))))
+ (svn-multi-reference-locations ref))
+ (add-to-store store name #t "sha256" output))))))
;;; svn-download.scm ends here