summaryrefslogtreecommitdiff
path: root/guix/build/download.scm
AgeCommit message (Collapse)Author
2017-03-18http-client: Avoid name clash with 'open-connection-for-uri' in 2.2.0.Ludovic Courtès
* guix/build/download.scm (open-connection-for-uri): Add note about same-named binding in Guile 2.2.0. * guix/http-client.scm: Use 'guix:open-connection-for-uri' for the procedure coming from (guix build download). * guix/scripts/lint.scm: Likewise. * guix/scripts/substitute.scm: Likewise.
2017-03-18build: Require Guile >= 2.0.9.Ludovic Courtès
* configure.ac: Bump requirement to 2.0.9. * doc/guix.texi (Requirements): Adjust accordingly. * README (Requirements): Likewise. * build-aux/download.scm: Remove workaround for <http://bugs.gnu.org/13095>. * guix/build/download.scm: Likewise. (http-fetch)[post-2.0.7?]: Remove. Remove conditional code for not POST-2.0.7?. * guix/http-client.scm: Remove workaround for <http://bugs.gnu.org/13095>. (http-fetch)[post-2.0.7?]: Remove. Remove conditional code for not POST-2.0.7?. * guix/serialization.scm (read-latin1-string): Remove mention of 2.0.9. * tests/nar.scm: Use (ice-9 control). (let/ec): Remove.
2017-03-13download: Export '%x509-certificate-directory'.Ludovic Courtès
* guix/build/download.scm (%x509-certificate-directory): Export, as expected by (guix scripts pull) since commit 7e81d699de7a2c924a048175516fe1ac3820d8e6.
2016-12-16download: Protect against dangling symlinks in $SSL_CERT_DIR.Ludovic Courtès
Reported by Christopher Baines <mail@cbaines.net> in <https://bugs.gnu.org/25213>. * guix/build/download.scm (make-credendials-with-ca-trust-files): Check whether FILE exists before calling 'set-certificate-credentials-x509-trust-file!'.
2016-11-07download: Verify TLS certificates unless asked not to.Ludovic Courtès
Fixes <http://bugs.gnu.org/24466>. Reported by Leo Famulari <leo@famulari.name>. * guix/build/download.scm (%x509-certificate-directory): New variable. (make-credendials-with-ca-trust-files, peer-certificate) (assert-valid-server-certificate, print-tls-certificate-error): New procedures. Add 'print-tls-certificate-error' as an exception printer for 'tls-certificate-error'. (tls-wrap): Add #:verify-certificate? parameter and honor it. (open-connection-for-uri): Likewise. (http-fetch): Likewise. (url-fetch): Likewise. * guix/download.scm (url-fetch)[builder]: Pass #:verify-certificate? #f. * guix/scripts/lint.scm (probe-uri): Add case for 'tls-certificate-error'. (validate-uri): Likewise. * doc/guix.texi (Invoking guix download): Mention 'SSL_CERT_DIR'.
2016-07-31download: Pass the raw file name to content-addressed mirrors.Ludovic Courtès
* guix/build/download.scm (url-fetch)[content-addressed-uris]: Call 'strip-store-file-name' on FILE before passing it to 'make-url'.
2016-07-20download: Prepare to support the 'guix publish' /file URLs.Ludovic Courtès
* guix/download.scm (%content-addressed-mirrors): Add 'file' parameter to the lambda. * guix/build/download.scm (url-fetch)[content-addressed-uris]: Adjust accordingly.
2016-06-29download: Use basic authentication when userinfo is present in URI.David Thompson
* guix/download.scm (url-fetch): Include (guix base64) module on the build-side. * guix/build/download.scm (http-fetch): Add "Authorization" header when userinfo is present in the URI.
2016-05-27download: Default to a 10s connection establishment timeout.Ludovic Courtès
* guix/build/download.scm (ftp-fetch): Add #:timeout and pass it to 'ftp-open'. (http-fetch): Add #:timeout and pass it to 'open-connection-for-uri' and in recursive calls. (url-fetch): Add #:timeout and pass it to 'http-fetch' and 'ftp-fetch'.
2016-05-27download: Use URI objects for content-addressed mirrors.Ludovic Courtès
This fixes a bug whereby 'http-fetch' would be passed a string instead of a URI object. * guix/build/download.scm (url-fetch): Rename 'content-addressed-urls' to 'content-addressed-uris', and call 'string->uri'.
2016-05-16build: Accept dates with space-padded hour field.Ricardo Wurmus
* guix/build/download.scm: Replace "parse-rfc-822-date" from the (web http) module.
2016-05-14download: Support content-addressed mirrors.Ludovic Courtès
* guix/download.scm (%content-addressed-mirrors) (%content-addressed-mirror-file): New variables. * guix/download.scm (url-fetch)[builder]: Define 'value-from-environment. Pass #:hashes and #:content-addressed-mirrors to 'url-fetch'. Define "guix download hashes" environment variable. * guix/build/download.scm (url-fetch): Add #:content-addressed-mirrors and #:hashes. [content-addressed-urls]: New variable. Use it.
2016-04-20substitute: Better abbreviate substitute URL in progress report.Ludovic Courtès
Suggested by Danny Milosavljevic <dannym@scratchpost.org>. * guix/build/download.scm (nar-uri-abbreviation): New procedure. * guix/scripts/substitute.scm (process-substitution): Use it instead of 'store-path-abbreviation'.
2016-04-20download: 'uri-abbreviation' can abbreviate the URI's basename.Ludovic Courtès
* guix/build/download.scm (uri-abbreviation): Use 'ellipsis' instead of "...". Abbreviate the basename of PATH if needed.
2016-04-20download: Add "%COMPAT" to the priority string.Ludovic Courtès
Fixes <http://bugs.gnu.org/23311>. * guix/build/download.scm (tls-wrap): Add 'set-session-priorities!' call.
2016-04-15download: Add 'current-terminal-columns' parameter.Ludovic Courtès
* guix/build/download.scm (current-terminal-columns): New variable. (progress-proc): Use it instead of the hard-coded "80".
2016-04-15download: Send an ANSI erase-in-line sequence in addition to CR.Ludovic Courtès
Partly fixes <http://bugs.gnu.org/22536>. Reported by Danny Milosavljevic <dannym@scratchpost.org>. * guix/build/download.scm (progress-proc): Send an ANSI erase-in-line sequence.
2016-04-14download: Follow HTTP 307 "Temporary Redirection".Alex Kost
Fixes <http://bugs.gnu.org/23275>. Reported by Albin Söderqvist <albin@fripost.org>. * guix/build/download.scm (http-fetch): Follow redirections upon 307. This is what 'binaries.openttd.org' does.
2016-03-17download: Add 'close-connection'.Ludovic Courtès
Partially fixes <http://bugs.gnu.org/20145>. * guix/build/download.scm (add-weak-reference): Remove. (%tls-ports): New variable. (register-tls-record-port): New procedure. (tls-wrap): Use it instead of 'add-weak-reference'. (close-connection): New procedure.
2015-11-12download: Always use AI_ADDRCONFIG when resolving host names.Ludovic Courtès
* guix/build/download.scm (open-socket-for-uri): Always pass AI_ADDRCONFIG to 'getaddrinfo' as recommended in the fine Guile manual. * guix/ftp-client.scm (ftp-open): Ditto.
2015-11-12download: Add timeout parameter for connections.Ludovic Courtès
* guix/build/download.scm (ensure-uri): New procedure. (current-http-proxy): New variable. (open-socket-for-uri): Copy from Guile commit aaea5b2, but add #:timeout parameter and use 'connect*' instead of 'connect'. (open-connection-for-uri): Add #:timeout parameter and pass it to 'open-socket-for-uri'.
2015-10-01download: Check whether HORIZONTAL ELLIPSIS can be encoded.Ludovic Courtès
* guix/build/download.scm (ellipsis): New procedure. (store-path-abbreviation): Use it.
2015-09-24download: Don't abbreviate things that are not store items.Ludovic Courtès
Fixes a regression introduced in a8be7b9a. * guix/build/download.scm (store-path-abbreviation): Return STORE-PATH if it's not an actual store path. Fixes an out-of-range exception when running tests/substitute.scm and tests/store.scm.
2015-09-23download: Fix some minor progress-logging regressions.Steve Sprang
* guix/build/download.scm (string-pad-middle): Allow resulting padded string to overflow. (store-url-abbreviation): Remove unnecessary procedure. (progress-proc): Use BASENAME as default for parameter 'abbreviation'. (url-fetch): Display extra newlines for readability.
2015-09-17download: Only show hours in the elapsed time if necessary.Steve Sprang
* guix/build/download.scm (seconds->string): Conditionally include hours in timestamp. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2015-09-16substitute: Improve readability of download progress report.Steve Sprang
* guix/build/download.scm (string-pad-middle, store-url-abbreviation, store-path-abbreviation): New procedures. (progress-proc): Add #:abbreviation parameter and use it. Generate a better indeterminate progress string. * guix/scripts/substitute.scm (assert-valid-narinfo): Add newlines to output. (process-substitution): Use byte-count->string and store-path-abbreviation. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2015-09-14download: Avoid type errors when formatting download progress output.Steve Sprang
* guix/build/download.scm (nearest-exact-integer): New procedure. (seconds->string, byte-count->string): Use it.
2015-09-08build: Improve information density and appearance of download progress output.Steve Sprang
* guix/build/download.scm (seconds->string): New function. (byte-count->string): New function. (progress-bar): New function. (throughput->string): Remove function. (progress-proc): Display base file name, elapsed time, and progress bar. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2015-07-17download: Remove spurious warning about 'https_proxy'.Ludovic Courtès
* guix/build/download.scm (open-connection-for-uri)[with-https-proxy]: Warn about 'https_proxy' only when 'getenv' returns a non-empty string.
2015-05-06download: Work around Guile small-receive-buffer bug.Ludovic Courtès
Previously, code using directly (guix build download) was still affected by <http://bugs.gnu.org/15368>. This includes source derivations, the 'guix download' command, and (guix gnu-maintenance). 'guix substitute' was unaffected since it used (guix http-client), which already had the fix. * guix/http-client.scm (open-socket-for-uri): Remove. (http-fetch): Remove #:buffered? argument to 'open-socket-for-uri'; use 'setvbuf' instead. * guix/scripts/substitute.scm (fetch): Likewise. * guix/build/download.scm (open-socket-for-uri): New procedure, taken from guix/http-client.scm, but without the #:buffered? parameter.
2015-05-06download: Reinstate buffering on connection sockets.Ludovic Courtès
* guix/build/download.scm (open-connection-for-uri): Reinstate call to 'setvbuf' inadvertently removed in d17551d9.
2015-05-01download: Simplify 'open-connection-for-uri' to support HTTP proxies.Ludovic Courtès
Partly fixes <http://bugs.gnu.org/20402>. Reported by Joshua Randall <jcrandall@alum.mit.edu>. * guix/build/download.scm (open-connection-for-uri): Rewrite to be a small wrapper around 'open-socket-for-uri'. This procedure was initially introduced in d14ecda to work around the lack of NSS modules during bootstrap but that has become unnecessary since 0621349, which introduced a bootstrap Guile that uses static NSS modules (from commit d3b5972.) On Guile >= 2.0.10, this allows the 'http_proxy' environment variable to be used.
2015-02-27download: Comment on lack of progress report with chunked encoding.Ludovic Courtès
* guix/build/download.scm (progress-proc): Add comment.
2015-02-27download: Measure and display the throughput.Ludovic Courtès
* guix/build/download.scm (duration->seconds, throughput->string): New procedures. (progress-proc): Measure and display the throughput.
2015-02-27download: Abstract the receive buffer size.Ludovic Courtès
* guix/build/download.scm (%http-receive-buffer-size): New variable. (progress-proc, tls-wrap, http-fetch): Use it.
2015-02-24download: Cope with Guile 2.0.6 or earlier.Mark H Weaver
* guix/build/download.scm: Do not attempt to support relative URIs in "Location" headers if 'declare-relative-uri-header!' is not present. This is the case for Guile 2.0.6 or earlier.
2015-02-19download: Handle HTTP redirects to relative URI references.Mark H Weaver
Fixes <http://bugs.gnu.org/19840>. Reported by Ricardo Wurmus <rekado@elephly.net>. * guix/build/download.scm: On Guile 2.0.11 or earlier, redefine the http "Location" header to accept relative URIs. (resolve-uri-reference): New exported procedure. (http-fetch): Use 'resolve-uri-reference' to resolve redirections. * guix/http-client.scm (http-fetch): Use 'resolve-uri-reference'
2014-12-29download: Export 'maybe-expand-mirrors'.Ludovic Courtès
* guix/build/download.scm (uri-vicinity, maybe-expand-mirrors): New procedures. (url-fetch): Remove them from here.
2014-12-28lint: Add 'home-page' checker.Ludovic Courtès
* guix/build/download.scm (open-connection-for-uri): Export. * guix/scripts/lint.scm (probe-uri, check-home-page): New procedures. (%checkers): Add 'home-page' checker.
2014-10-19download: Add "Accept: */*" to the headers.Ludovic Courtès
Fixes downloads from https://alioth.debian.org. Reported by John Darrington <jmd@gnu.org>. * guix/build/download.scm (http-fetch)[headers]: Add 'Accept'.
2014-09-22download: Use the 'SERVER NAME' TLS extension when possible.Ludovic Courtès
Fixes <http://bugs.gnu.org/18526>. Reported by Mark H. Weaver. * guix/build/download.scm (tls-wrap): Add 'server' parameter. Call 'set-session-server-name!' when (gnutls) defines it. (open-connection-for-uri): Adjust 'tls-wrap' call accordingly.
2014-05-23download: Enlarge your receive buffer.Ludovic Courtès
* guix/build/download.scm (open-connection-for-uri): Remove call to 'setsockopt'. * guix/http-client.scm (open-socket-for-uri)[rmem-max, buffer-size]: New variables. Add call to 'setsockopt'.
2014-04-16download: Improve progress report output.Ludovic Courtès
* guix/build/download.scm (url-fetch): Make current-output-port unbuffered.
2014-03-25download: Don't use 'http-get*' on Guile 2.0.10+.Ludovic Courtès
* guix/build/download.scm (http-fetch)[post-2.0.7?]: Use 'string->number' and numeric comparison. This fixes version comparison with "2.0.10" and subsequent 2.0 releases.
2014-02-10download: Provide a 'User-Agent' field in HTTP requests.Ludovic Courtès
Fixes <http://bugs.gnu.org/16703>. Reported by Raimon Grau <raimonster@gmail.com>. * guix/build/download.scm (http-fetch)[headers]: New variable. Pass it as #:headers or #:extra-headers to 'http-get' and 'http-get*'.
2013-06-22download: Don't fail when abbreviating `file://' URIs.Ludovic Courtès
* guix/build/download.scm (uri-abbreviation)[elide-path]: Handle the case where URI has no `host' part.
2013-06-20substitute-binary: Report progress while downloading.Ludovic Courtès
* guix/scripts/substitute-binary.scm (decompressed-port): Improve docstring. (progress-report-port): New procedure. (guix-substitute-binary)["--substitute"]: Use it to report progress. * guix/build/download.scm: Export `progress-proc' and `uri-abbreviation'.
2013-05-10download: Fix premature socket close on TLS connections.Ludovic Courtès
This would manifest when downloading a large file such as the Bazaar tarball, leading to an "Error in the pull function" GnuTLS exception. * guix/build/download.scm (add-weak-reference): New procedure. (tls-wrap): Add (add-weak-reference record port).
2013-02-20download: Adjust to `http-get*' deprecation.Ludovic Courtès
* guix/build/download.scm (http-fetch): Adjust to use #:streaming? when using Guile 2.0.8+.
2013-01-25download: Follow HTTP redirection upon 301 "moved permanently".Ludovic Courtès
* guix/build/download.scm (http-fetch): Follow redirections upon 301. This is what `downloads.sourceforge.net' returns, for instance.