* guix/build/download.scm: Autoload (gnutls).
(tls-wrap): New procedure.
(open-connection-for-uri): Add support for `https'. Wrap the socket
with `tls-wrap' in that case.
(url-fetch): Add `https'.
* guix/download.scm (gnutls-derivation): New procedure.
(url-fetch)[need-gnutls?]: New variable.
Call `gnutls-derivation' when NEED-GNUTLS? is true, and add its output
to the `GUILE_LOAD_PATH' env. var. in that case.
* guix/build/download.scm (uri-abbreviation): New procedure.
(ftp-fetch, http-fetch): Use it instead of `uri->string' when calling
`progress-proc'. Reported by Andreas Enge.
* guix/build/download.scm (http-fetch): Rename `bv' to `bv-or-port'.
Use `http-get*' followed by `dump-port' when the former is available,
and pass a progress procedure to `dump-port'.
* guix/build/download.scm (progress-proc): New procedure.
(ftp-fetch): Call `ftp-size' on URI. Use `progress-proc', and pass
the result to `dump-port', along with #:buffer-size.
* guix/build/download.scm (open-connection-for-uri): Delete addrinfos
with the same address. Always open SOCK_STREAM/IPPROTO_IP sockets.
Fix the error handler's condition to determine what to do.
Reported by Nikita Karetnikov <nikita.karetnikov@gmail.com> at
<http://lists.gnu.org/archive/html/bug-guix/2012-12/msg00150.html>.
* guix/download.scm (%mirrors): New variable. Mirror lists taken from
Nixpkgs.
(url-fetch): New `mirrors' keyword parameter.
[builder]: Pass it.
* guix/build/download.scm (url-fetch): New `mirrors' keyword parameter.
[maybe-expand-mirrors]: New procedure.
[uri]: Use it.