Commit 8ff2af42 by Kenji Okimoto

Specify inet protocol

parent c8197908
...@@ -247,19 +247,31 @@ http() { ...@@ -247,19 +247,31 @@ http() {
} }
http_head_curl() { http_head_curl() {
curl -qsILf "$1" >&4 2>&1 options=""
[ -n "${IPV4}" ] && options="--ipv4"
[ -n "${IPV6}" ] && options="--ipv6"
curl -qsILf "${options}" "$1" >&4 2>&1
} }
http_get_curl() { http_get_curl() {
curl -q -o "${2:--}" -sSLf "$1" options=""
[ -n "${IPV4}" ] && options="--ipv4"
[ -n "${IPV6}" ] && options="--ipv6"
curl -q -o "${2:--}" -sSLf "${options}" "$1"
} }
http_head_wget() { http_head_wget() {
wget -q --spider "$1" >&4 2>&1 options=""
[ -n "${IPV4}" ] && options="--inet4-only"
[ -n "${IPV6}" ] && options="--inet6-only"
wget -q --spider "${options}" "$1" >&4 2>&1
} }
http_get_wget() { http_get_wget() {
wget -nv -O "${2:--}" "$1" options=""
[ -n "${IPV4}" ] && options="--inet4-only"
[ -n "${IPV6}" ] && options="--inet6-only"
wget -nv "${options}" -O "${2:--}" "$1"
} }
fetch_tarball() { fetch_tarball() {
...@@ -897,7 +909,7 @@ version() { ...@@ -897,7 +909,7 @@ version() {
usage() { usage() {
{ version { version
echo "usage: ruby-build [-k|--keep] [-v|--verbose] [-p|--patch] definition prefix" echo "usage: ruby-build [-k|--keep] [-v|--verbose] [-p|--patch] [-4|--ipv4|-6|--ipv6] definition prefix"
echo " ruby-build --definitions" echo " ruby-build --definitions"
} >&2 } >&2
...@@ -918,6 +930,8 @@ list_definitions() { ...@@ -918,6 +930,8 @@ list_definitions() {
unset VERBOSE unset VERBOSE
unset KEEP_BUILD_PATH unset KEEP_BUILD_PATH
unset HAS_PATCH unset HAS_PATCH
unset IPV4
unset IPV6
RUBY_BUILD_ROOT="$(abs_dirname "$0")/.." RUBY_BUILD_ROOT="$(abs_dirname "$0")/.."
parse_options "$@" parse_options "$@"
...@@ -930,6 +944,8 @@ for option in "${OPTIONS[@]}"; do ...@@ -930,6 +944,8 @@ for option in "${OPTIONS[@]}"; do
echo " -k/--keep Do not remove source tree after installation" echo " -k/--keep Do not remove source tree after installation"
echo " -v/--verbose Verbose mode: print compilation status to stdout" echo " -v/--verbose Verbose mode: print compilation status to stdout"
echo " -p/--patch Apply a patch from stdin before building" echo " -p/--patch Apply a patch from stdin before building"
echo " -4/--ipv4 Resolve names to IPv4 addresses only"
echo " -6/--ipv6 Resolve names to IPv6 addresses only"
echo " --definitions List all built-in definitions" echo " --definitions List all built-in definitions"
echo echo
} >&2 } >&2
...@@ -948,6 +964,12 @@ for option in "${OPTIONS[@]}"; do ...@@ -948,6 +964,12 @@ for option in "${OPTIONS[@]}"; do
"p" | "patch" ) "p" | "patch" )
HAS_PATCH=true HAS_PATCH=true
;; ;;
"4" | "ipv4")
IPV4=true
;;
"6" | "ipv6")
IPV6=true
;;
"version" ) "version" )
version version
exit 0 exit 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment