diff options
author | Efraim Flashner <efraim@flashner.co.il> | 2017-03-22 12:57:37 +0200 |
---|---|---|
committer | Efraim Flashner <efraim@flashner.co.il> | 2017-03-22 12:57:37 +0200 |
commit | 378de69c59ee0700c67b10b38592c213821b41f2 (patch) | |
tree | ee9b6465430077a79cace3cb8fab1a85a8c1e4c5 /guix/build/download.scm | |
parent | 049e02eaa258942515260a58c8d9ddfc4e7caffe (diff) | |
parent | d8be338f16c7da4acfa55f29f58beaf908d3ad60 (diff) |
Merge remote-tracking branch 'origin/master' into core-updates
Diffstat (limited to 'guix/build/download.scm')
-rw-r--r-- | guix/build/download.scm | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/guix/build/download.scm b/guix/build/download.scm index 36c815c167..c5dddf83de 100644 --- a/guix/build/download.scm +++ b/guix/build/download.scm @@ -241,7 +241,18 @@ and 'guix publish', something like (define* (ftp-fetch uri file #:key timeout) "Fetch data from URI and write it to FILE. Return FILE on success. Bail out if the connection could not be established in less than TIMEOUT seconds." - (let* ((conn (ftp-open (uri-host uri) #:timeout timeout)) + (let* ((userinfo (string-split (uri-userinfo uri) #\:)) + (conn (match userinfo + (("") + (ftp-open (uri-host uri) #:timeout timeout)) + (((? string? user)) + (ftp-open (uri-host uri) #:timeout timeout + #:username user)) + (((? string? user) (? string? pass)) + (ftp-open (uri-host uri) #:timeout timeout + #:username user + #:password pass)) + (_ (ftp-open (uri-host uri) #:timeout timeout)))) (size (false-if-exception (ftp-size conn (uri-path uri)))) (in (ftp-retr conn (basename (uri-path uri)) (dirname (uri-path uri))))) |