summaryrefslogtreecommitdiff
path: root/guix/build
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-01-06 17:33:02 +0100
committerLudovic Courtès <ludo@gnu.org>2013-01-06 17:33:02 +0100
commit4050e5d6cfe8f7af29f10b2f1b3c7febdc10946a (patch)
tree574828c84e7bfb0b6850db4f30fc38bd8143584e /guix/build
parent79580eb698d07e4b21334ddfbcbcf620d27b5e41 (diff)
parent233e76769ae3a438bff7117c68f2c88739a28db0 (diff)
Merge branch 'master' into core-updates
Conflicts: build-aux/download.scm distro/packages/autotools.scm distro/packages/base.scm distro/packages/bootstrap.scm distro/packages/lsh.scm distro/packages/make-bootstrap.scm distro/packages/ncurses.scm distro/packages/perl.scm tests/derivations.scm tests/union.scm
Diffstat (limited to 'guix/build')
-rw-r--r--guix/build/download.scm15
1 files changed, 9 insertions, 6 deletions
diff --git a/guix/build/download.scm b/guix/build/download.scm
index 5813ea81ea..27f5557692 100644
--- a/guix/build/download.scm
+++ b/guix/build/download.scm
@@ -60,15 +60,18 @@ which is not available during bootstrap."
((http) 80) ; /etc/services, not for me!
(else
(error "unsupported URI scheme" uri))))))
- (getaddrinfo (uri-host uri)
- (number->string port)
- AI_NUMERICSERV)))
+ (delete-duplicates (getaddrinfo (uri-host uri)
+ (number->string port)
+ AI_NUMERICSERV)
+ (lambda (ai1 ai2)
+ (equal? (addrinfo:addr ai1)
+ (addrinfo:addr ai2))))))
(let loop ((addresses addresses))
(let* ((ai (car addresses))
(s (with-fluids ((%default-port-encoding #f))
- (socket (addrinfo:fam ai) (addrinfo:socktype ai)
- (addrinfo:protocol ai)))))
+ ;; Restrict ourselves to TCP.
+ (socket (addrinfo:fam ai) SOCK_STREAM IPPROTO_IP))))
(catch 'system-error
(lambda ()
(connect s (addrinfo:addr ai))
@@ -81,7 +84,7 @@ which is not available during bootstrap."
(lambda args
;; Connection failed, so try one of the other addresses.
(close s)
- (if (null? addresses)
+ (if (null? (cdr addresses))
(apply throw args)
(loop (cdr addresses))))))))