summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2017-03-22 12:57:37 +0200
committerEfraim Flashner <efraim@flashner.co.il>2017-03-22 12:57:37 +0200
commit378de69c59ee0700c67b10b38592c213821b41f2 (patch)
treeee9b6465430077a79cace3cb8fab1a85a8c1e4c5 /guix
parent049e02eaa258942515260a58c8d9ddfc4e7caffe (diff)
parentd8be338f16c7da4acfa55f29f58beaf908d3ad60 (diff)
Merge remote-tracking branch 'origin/master' into core-updates
Diffstat (limited to 'guix')
-rw-r--r--guix/build/download.scm13
-rw-r--r--guix/download.scm1
-rw-r--r--guix/ftp-client.scm7
3 files changed, 17 insertions, 4 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)))))
diff --git a/guix/download.scm b/guix/download.scm
index dda18ff04d..3f9263d757 100644
--- a/guix/download.scm
+++ b/guix/download.scm
@@ -125,7 +125,6 @@
"http://vorboss.dl.sourceforge.net/project/"
"http://netassist.dl.sourceforge.net/project/")
(kernel.org
- "http://www.all.kernel.org/pub/"
"http://ramses.wh2.tu-dresden.de/pub/mirrors/kernel.org/"
"http://linux-kernel.uio.no/pub/"
"http://kernel.osuosl.org/pub/"
diff --git a/guix/ftp-client.scm b/guix/ftp-client.scm
index 0a179282ed..054a00ad7f 100644
--- a/guix/ftp-client.scm
+++ b/guix/ftp-client.scm
@@ -121,7 +121,10 @@ seconds to wait for the connection to succeed."
(raise-error errno)))))
(connect s sockaddr)))
-(define* (ftp-open host #:optional (port "ftp") #:key timeout)
+(define* (ftp-open host #:optional (port "ftp")
+ #:key timeout
+ (username "anonymous")
+ (password "guix@example.com"))
"Open an FTP connection to HOST on PORT (a service-identifying string,
or a TCP port number), and return it.
@@ -156,7 +159,7 @@ TIMEOUT, an ETIMEDOUT error is raised."
(if (eqv? code 220)
(begin
;;(%ftp-command "OPTS UTF8 ON" 200 s)
- (%ftp-login "anonymous" "guix@example.com" s)
+ (%ftp-login username password s)
(%make-ftp-connection s ai))
(begin
(close s)