From 0dc5ad7248bbc001f96861e74761da77bb59be1c Mon Sep 17 00:00:00 2001 From: Ross Bragg Date: Mon, 23 Sep 2019 12:27:21 -0400 Subject: [PATCH 1/3] Add example of mirrored URL. --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f799fc50cf..600d6673e2 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,10 @@ URL specified in the definition file. You can point ruby-build to another mirror by specifying the `RUBY_BUILD_MIRROR_URL` environment variable--useful if you'd like to run your own local mirror, for example. Package mirror URLs are constructed by joining -this variable with the SHA2 checksum of the package file. +this variable with the SHA2 checksum of the package file. For example, the default +URL for `ruby-2.3.0.tar.bz2` is http://cache.ruby-lang.org/pub/ruby/ruby-2.3.0.tar.bz2. +That package would be mirrored at `$RUBY_BUILD_MIRROR_URL/ec7579eaba2e4c402a089dbc86c98e5f1f62507880fd800b9b34ca30166bfa5e`, +where the SHA2 sum is the package to be downloaded. If you don't have an SHA2 program installed, ruby-build will skip the download mirror and use official URLs instead. You can force ruby-build to bypass the From dafe7058f52f2325e937021b5780356c9a247820 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Wed, 9 Oct 2019 14:08:21 +0200 Subject: [PATCH 2/3] Clarify "package mirrors" section further --- README.md | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 600d6673e2..598a9e087a 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ The build process may be configured through the following environment variables: | `RUBY_BUILD_CURL_OPTS` | Additional options to pass to `curl` for downloading. | | `RUBY_BUILD_WGET_OPTS` | Additional options to pass to `wget` for downloading. | | `RUBY_BUILD_MIRROR_URL` | Custom mirror URL root. | -| `RUBY_BUILD_SKIP_MIRROR` | Always download from official sources, not mirrors. (Default: unset) | +| `RUBY_BUILD_SKIP_MIRROR` | Bypass the download mirror and fetch all package files from their original URLs. | | `RUBY_BUILD_ROOT` | Custom build definition directory. (Default: `share/ruby-build`) | | `RUBY_BUILD_DEFINITIONS` | Additional paths to search for build definitions. (Colon-separated list) | | `CC` | Path to the C compiler. | @@ -111,28 +111,30 @@ automatically verify the SHA2 checksum of each downloaded package before installing it. Checksums are optional and specified as anchors on the package URL in each -definition. (All bundled definitions include checksums.) +definition. All definitions bundled with ruby-build include checksums. #### Package Mirrors -By default, ruby-build downloads package files from a mirror hosted on Amazon -CloudFront. If a package is not available on the mirror, if the mirror is -down, or if the download is corrupt, ruby-build will fall back to the official -URL specified in the definition file. +To speed up downloads, ruby-build fetches package files from a mirror hosted on +Amazon CloudFront. To benefit from this, the packages must specify their checksum: -You can point ruby-build to another mirror by specifying the -`RUBY_BUILD_MIRROR_URL` environment variable--useful if you'd like to run your -own local mirror, for example. Package mirror URLs are constructed by joining -this variable with the SHA2 checksum of the package file. For example, the default -URL for `ruby-2.3.0.tar.bz2` is http://cache.ruby-lang.org/pub/ruby/ruby-2.3.0.tar.bz2. -That package would be mirrored at `$RUBY_BUILD_MIRROR_URL/ec7579eaba2e4c402a089dbc86c98e5f1f62507880fd800b9b34ca30166bfa5e`, -where the SHA2 sum is the package to be downloaded. +```sh +# example: +install_package "ruby-2.6.5" "https://ruby-lang.org/ruby-2.6.5.tgz#" +``` + +ruby-build will first try to fetch this package from `$RUBY_BUILD_MIRROR_URL/` +(note: this is the complete URL). It will fall back to downloading the package from +the original location if: +- the package was not found on the mirror; +- the mirror is down; +- the download is corrupt, i.e. the file's checksum doesn't match; +- no tool is available to calculate the checksum; or +- `RUBY_BUILD_SKIP_MIRROR` is enabled. -If you don't have an SHA2 program installed, ruby-build will skip the download -mirror and use official URLs instead. You can force ruby-build to bypass the -mirror by setting the `RUBY_BUILD_SKIP_MIRROR` environment variable. +You may specify a custom mirror by setting `RUBY_BUILD_MIRROR_URL`. -The official ruby-build download mirror is sponsored by +The default ruby-build download mirror is sponsored by [Basecamp](https://basecamp.com/). #### Keeping the build directory after installation From a9630784566960c43b3fc21e2f074008105d295b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Wed, 9 Oct 2019 14:11:12 +0200 Subject: [PATCH 3/3] Clarify `` --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 598a9e087a..fdfd3f725f 100644 --- a/README.md +++ b/README.md @@ -124,8 +124,8 @@ install_package "ruby-2.6.5" "https://ruby-lang.org/ruby-2.6.5.tgz#" ``` ruby-build will first try to fetch this package from `$RUBY_BUILD_MIRROR_URL/` -(note: this is the complete URL). It will fall back to downloading the package from -the original location if: +(note: this is the complete URL), where `` is the checksum for the file. It +will fall back to downloading the package from the original location if: - the package was not found on the mirror; - the mirror is down; - the download is corrupt, i.e. the file's checksum doesn't match;