Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
ruby-build
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ruby-build
Commits
f998f105
Commit
f998f105
authored
Feb 13, 2016
by
Yamashita, Yuu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow specifying custom command line options for `aria2c`, `curl` and `wget`
parent
54286dcb
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
24 deletions
+13
-24
bin/ruby-build
+10
-24
test/cache.bats
+1
-0
test/checksum.bats
+1
-0
test/mirror.bats
+1
-0
No files found.
bin/ruby-build
View file @
f998f105
...
@@ -313,45 +313,27 @@ http() {
...
@@ -313,45 +313,27 @@ http() {
}
}
http_head_aria2c
()
{
http_head_aria2c
()
{
options
=
""
aria2c
--dry-run
${
ARIA2_OPTS
}
"
$1
"
>
&4 2>&1
[
-n
"
${
IPV4
}
"
]
&&
options
=
"--disable-ipv6=true"
[
-n
"
${
IPV6
}
"
]
&&
options
=
"--disable-ipv6=false"
aria2c
--dry-run
${
options
}
"
$1
"
>
&4 2>&1
}
}
http_get_aria2c
()
{
http_get_aria2c
()
{
options
=
""
aria2c
-o
"
${
2
:-
-
}
"
${
ARIA2_OPTS
}
"
$1
"
[
-n
"
${
IPV4
}
"
]
&&
options
=
"--disable-ipv6=true"
[
-n
"
${
IPV6
}
"
]
&&
options
=
"--disable-ipv6=false"
aria2c
-o
"
${
2
:-
-
}
"
${
options
}
"
$1
"
}
}
http_head_curl
()
{
http_head_curl
()
{
options
=
""
curl
-qsILf
${
CURL_OPTS
}
"
$1
"
>
&4 2>&1
[
-n
"
${
IPV4
}
"
]
&&
options
=
"--ipv4"
[
-n
"
${
IPV6
}
"
]
&&
options
=
"--ipv6"
curl
-qsILf
${
options
}
"
$1
"
>
&4 2>&1
}
}
http_get_curl
()
{
http_get_curl
()
{
options
=
""
curl
-q
-o
"
${
2
:-
-
}
"
-sSLf
${
CURL_OPTS
}
"
$1
"
[
-n
"
${
IPV4
}
"
]
&&
options
=
"--ipv4"
[
-n
"
${
IPV6
}
"
]
&&
options
=
"--ipv6"
curl
-q
-o
"
${
2
:-
-
}
"
-sSLf
${
options
}
"
$1
"
}
}
http_head_wget
()
{
http_head_wget
()
{
options
=
""
wget
-q
--spider
${
WGET_OPTS
}
"
$1
"
>
&4 2>&1
[
-n
"
${
IPV4
}
"
]
&&
options
=
"--inet4-only"
[
-n
"
${
IPV6
}
"
]
&&
options
=
"--inet6-only"
wget
-q
--spider
${
options
}
"
$1
"
>
&4 2>&1
}
}
http_get_wget
()
{
http_get_wget
()
{
options
=
""
wget
-nv
${
WGET_OPTS
}
-O
"
${
2
:-
-
}
"
"
$1
"
[
-n
"
${
IPV4
}
"
]
&&
options
=
"--inet4-only"
[
-n
"
${
IPV6
}
"
]
&&
options
=
"--inet6-only"
wget
-nv
${
options
}
-O
"
${
2
:-
-
}
"
"
$1
"
}
}
fetch_tarball
()
{
fetch_tarball
()
{
...
@@ -1235,6 +1217,10 @@ if [ -n "$RUBY_BUILD_SKIP_MIRROR" ] || ! has_checksum_support compute_sha2; then
...
@@ -1235,6 +1217,10 @@ if [ -n "$RUBY_BUILD_SKIP_MIRROR" ] || ! has_checksum_support compute_sha2; then
unset
RUBY_BUILD_MIRROR_URL
unset
RUBY_BUILD_MIRROR_URL
fi
fi
ARIA2_OPTS
=
"
${
RUBY_BUILD_ARIA2_OPTS
}
${
IPV4
+--disable-ipv6=true
}
${
IPV6
+--disable-ipv6=false
}
"
CURL_OPTS
=
"
${
RUBY_BUILD_CURL_OPTS
}
${
IPV4
+--ipv4
}
${
IPV6
+--ipv6
}
"
WGET_OPTS
=
"
${
RUBY_BUILD_WGET_OPTS
}
${
IPV4
+--inet4-only
}
${
IPV6
+--inet6-only
}
"
SEED
=
"
$(
date
"+%Y%m%d%H%M%S"
)
.
$$
"
SEED
=
"
$(
date
"+%Y%m%d%H%M%S"
)
.
$$
"
LOG_PATH
=
"
${
TMP
}
/ruby-build.
${
SEED
}
.log"
LOG_PATH
=
"
${
TMP
}
/ruby-build.
${
SEED
}
.log"
RUBY_BIN
=
"
${
PREFIX_PATH
}
/bin/ruby"
RUBY_BIN
=
"
${
PREFIX_PATH
}
/bin/ruby"
...
...
test/cache.bats
View file @
f998f105
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
load test_helper
load test_helper
export RUBY_BUILD_SKIP_MIRROR=1
export RUBY_BUILD_SKIP_MIRROR=1
export RUBY_BUILD_CACHE_PATH="$TMP/cache"
export RUBY_BUILD_CACHE_PATH="$TMP/cache"
export RUBY_BUILD_ARIA2_OPTS=
setup() {
setup() {
mkdir "$RUBY_BUILD_CACHE_PATH"
mkdir "$RUBY_BUILD_CACHE_PATH"
...
...
test/checksum.bats
View file @
f998f105
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
load test_helper
load test_helper
export RUBY_BUILD_SKIP_MIRROR=1
export RUBY_BUILD_SKIP_MIRROR=1
export RUBY_BUILD_CACHE_PATH=
export RUBY_BUILD_CACHE_PATH=
export RUBY_BUILD_ARIA2_OPTS=
@test "package URL without checksum" {
@test "package URL without checksum" {
...
...
test/mirror.bats
View file @
f998f105
...
@@ -4,6 +4,7 @@ load test_helper
...
@@ -4,6 +4,7 @@ load test_helper
export RUBY_BUILD_SKIP_MIRROR=
export RUBY_BUILD_SKIP_MIRROR=
export RUBY_BUILD_CACHE_PATH=
export RUBY_BUILD_CACHE_PATH=
export RUBY_BUILD_MIRROR_URL=http://mirror.example.com
export RUBY_BUILD_MIRROR_URL=http://mirror.example.com
export RUBY_BUILD_ARIA2_OPTS=
@test "package URL without checksum bypasses mirror" {
@test "package URL without checksum bypasses mirror" {
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment