mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 21:38:07 -05:00
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
This commit is contained in:
parent
3d341a057f
commit
6df755e1a0
1 changed files with 24 additions and 16 deletions
|
@ -351,21 +351,29 @@ (define* (download-multi-svn-to-store store ref
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue