mirror of
https://github.com/pyenv/pyenv.git
synced 2025-01-05 17:50:57 +00:00
Increased verbosity of aria2c
downloader (#534)
This commit is contained in:
parent
b116f341fe
commit
fbc40aae77
4 changed files with 27 additions and 27 deletions
plugins/python-build
|
@ -339,14 +339,14 @@ http_head_aria2c() {
|
|||
options=""
|
||||
[ -n "${IPV4}" ] && options="--disable-ipv6=true"
|
||||
[ -n "${IPV6}" ] && options="--disable-ipv6=false"
|
||||
aria2c -q --dry-run ${options} "$1" >&4 2>&1
|
||||
aria2c --dry-run ${options} "$1" >&4 2>&1
|
||||
}
|
||||
|
||||
http_get_aria2c() {
|
||||
options=""
|
||||
[ -n "${IPV4}" ] && options="--disable-ipv6=true"
|
||||
[ -n "${IPV6}" ] && options="--disable-ipv6=false"
|
||||
aria2c -q -o "${2:--}" ${options} "$1"
|
||||
aria2c -o "${2:--}" ${options} "$1"
|
||||
}
|
||||
|
||||
http_head_curl() {
|
||||
|
|
|
@ -10,7 +10,7 @@ setup() {
|
|||
|
||||
|
||||
@test "packages are saved to download cache" {
|
||||
stub aria2c "-q -o * http://example.com/* : cp $FIXTURE_ROOT/\${4##*/} \$3"
|
||||
stub aria2c "-o * http://example.com/* : cp $FIXTURE_ROOT/\${3##*/} \$2"
|
||||
|
||||
install_fixture definitions/without-checksum
|
||||
|
||||
|
@ -57,8 +57,8 @@ setup() {
|
|||
local checksum="ba988b1bb4250dee0b9dd3d4d722f9c64b2bacfc805d1b6eba7426bda72dd3c5"
|
||||
|
||||
stub shasum true "echo invalid" "echo $checksum"
|
||||
stub aria2c "-q --dry-run * : true" \
|
||||
"-q -o * https://?*/$checksum : cp $FIXTURE_ROOT/package-1.0.0.tar.gz \$3"
|
||||
stub aria2c "--dry-run * : true" \
|
||||
"-o * https://?*/$checksum : cp $FIXTURE_ROOT/package-1.0.0.tar.gz \$2"
|
||||
|
||||
touch "${PYTHON_BUILD_CACHE_PATH}/package-1.0.0.tar.gz"
|
||||
|
||||
|
@ -75,7 +75,7 @@ setup() {
|
|||
|
||||
|
||||
@test "nonexistent cache directory is ignored" {
|
||||
stub aria2c "-q -o * http://example.com/* : cp $FIXTURE_ROOT/\${4##*/} \$3"
|
||||
stub aria2c "-o * http://example.com/* : cp $FIXTURE_ROOT/\${3##*/} \$2"
|
||||
|
||||
export PYTHON_BUILD_CACHE_PATH="${TMP}/nonexistent"
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ export PYTHON_BUILD_CACHE_PATH=
|
|||
|
||||
|
||||
@test "package URL without checksum" {
|
||||
stub aria2c "-q -o * http://example.com/* : cp $FIXTURE_ROOT/\${4##*/} \$3"
|
||||
stub aria2c "-o * http://example.com/* : cp $FIXTURE_ROOT/\${3##*/} \$2"
|
||||
|
||||
install_fixture definitions/without-checksum
|
||||
|
||||
|
@ -19,7 +19,7 @@ export PYTHON_BUILD_CACHE_PATH=
|
|||
|
||||
@test "package URL with valid checksum" {
|
||||
stub shasum true "echo ba988b1bb4250dee0b9dd3d4d722f9c64b2bacfc805d1b6eba7426bda72dd3c5"
|
||||
stub aria2c "-q -o * http://example.com/* : cp $FIXTURE_ROOT/\${4##*/} \$3"
|
||||
stub aria2c "-o * http://example.com/* : cp $FIXTURE_ROOT/\${3##*/} \$2"
|
||||
|
||||
install_fixture definitions/with-checksum
|
||||
|
||||
|
@ -33,7 +33,7 @@ export PYTHON_BUILD_CACHE_PATH=
|
|||
|
||||
@test "package URL with invalid checksum" {
|
||||
stub shasum true "echo ba988b1bb4250dee0b9dd3d4d722f9c64b2bacfc805d1b6eba7426bda72dd3c5"
|
||||
stub aria2c "-q -o * http://example.com/* : cp $FIXTURE_ROOT/\${4##*/} \$3"
|
||||
stub aria2c "-o * http://example.com/* : cp $FIXTURE_ROOT/\${3##*/} \$2"
|
||||
|
||||
install_fixture definitions/with-invalid-checksum
|
||||
|
||||
|
@ -47,7 +47,7 @@ export PYTHON_BUILD_CACHE_PATH=
|
|||
|
||||
@test "package URL with checksum but no shasum support" {
|
||||
stub shasum false
|
||||
stub aria2c "-q -o * http://example.com/* : cp $FIXTURE_ROOT/\${4##*/} \$3"
|
||||
stub aria2c "-o * http://example.com/* : cp $FIXTURE_ROOT/\${3##*/} \$2"
|
||||
|
||||
install_fixture definitions/with-checksum
|
||||
|
||||
|
@ -61,7 +61,7 @@ export PYTHON_BUILD_CACHE_PATH=
|
|||
|
||||
@test "package URL with valid md5 checksum" {
|
||||
stub md5 true "echo 83e6d7725e20166024a1eb74cde80677"
|
||||
stub aria2c "-q -o * http://example.com/* : cp $FIXTURE_ROOT/\${4##*/} \$3"
|
||||
stub aria2c "-o * http://example.com/* : cp $FIXTURE_ROOT/\${3##*/} \$2"
|
||||
|
||||
install_fixture definitions/with-md5-checksum
|
||||
|
||||
|
@ -75,7 +75,7 @@ export PYTHON_BUILD_CACHE_PATH=
|
|||
|
||||
@test "package URL with md5 checksum but no md5 support" {
|
||||
stub md5 false
|
||||
stub aria2c "-q -o * http://example.com/* : cp $FIXTURE_ROOT/\${4##*/} \$3"
|
||||
stub aria2c "-o * http://example.com/* : cp $FIXTURE_ROOT/\${3##*/} \$2"
|
||||
|
||||
install_fixture definitions/with-md5-checksum
|
||||
|
||||
|
@ -89,7 +89,7 @@ export PYTHON_BUILD_CACHE_PATH=
|
|||
|
||||
@test "package with invalid checksum" {
|
||||
stub shasum true "echo invalid"
|
||||
stub aria2c "-q -o * http://example.com/* : cp $FIXTURE_ROOT/\${4##*/} \$3"
|
||||
stub aria2c "-o * http://example.com/* : cp $FIXTURE_ROOT/\${3##*/} \$2"
|
||||
|
||||
install_fixture definitions/with-checksum
|
||||
|
||||
|
@ -126,7 +126,7 @@ DEF
|
|||
stub shasum true \
|
||||
"echo invalid" \
|
||||
"echo ba988b1bb4250dee0b9dd3d4d722f9c64b2bacfc805d1b6eba7426bda72dd3c5"
|
||||
stub aria2c "-q -o * http://example.com/* : cp $FIXTURE_ROOT/\${4##*/} \$3"
|
||||
stub aria2c "-o * http://example.com/* : cp $FIXTURE_ROOT/\${3##*/} \$2"
|
||||
|
||||
export -n PYTHON_BUILD_CACHE_PATH
|
||||
export PYTHON_BUILD_BUILD_PATH="${TMP}/build"
|
||||
|
@ -145,7 +145,7 @@ DEF
|
|||
}
|
||||
|
||||
@test "package URL with checksum of unexpected length" {
|
||||
stub aria2c "-q -o * http://example.com/* : cp $FIXTURE_ROOT/\${4##*/} \$3"
|
||||
stub aria2c "-o * http://example.com/* : cp $FIXTURE_ROOT/\${3##*/} \$2"
|
||||
|
||||
run_inline_definition <<DEF
|
||||
install_package "package-1.0.0" "http://example.com/packages/package-1.0.0.tar.gz#checksum_of_unexpected_length" copy
|
||||
|
|
|
@ -8,7 +8,7 @@ export PYTHON_BUILD_MIRROR_URL=http://mirror.example.com
|
|||
|
||||
@test "package URL without checksum bypasses mirror" {
|
||||
stub shasum true
|
||||
stub aria2c "-q -o * http://example.com/* : cp $FIXTURE_ROOT/\${4##*/} \$3"
|
||||
stub aria2c "-o * http://example.com/* : cp $FIXTURE_ROOT/\${3##*/} \$2"
|
||||
|
||||
install_fixture definitions/without-checksum
|
||||
echo "$output" >&2
|
||||
|
@ -23,7 +23,7 @@ export PYTHON_BUILD_MIRROR_URL=http://mirror.example.com
|
|||
|
||||
@test "package URL with checksum but no shasum support bypasses mirror" {
|
||||
stub shasum false
|
||||
stub aria2c "-q -o * http://example.com/* : cp $FIXTURE_ROOT/\${4##*/} \$3"
|
||||
stub aria2c "-o * http://example.com/* : cp $FIXTURE_ROOT/\${3##*/} \$2"
|
||||
|
||||
install_fixture definitions/with-checksum
|
||||
|
||||
|
@ -40,8 +40,8 @@ export PYTHON_BUILD_MIRROR_URL=http://mirror.example.com
|
|||
local mirror_url="${PYTHON_BUILD_MIRROR_URL}/$checksum"
|
||||
|
||||
stub shasum true "echo $checksum"
|
||||
stub aria2c "-q --dry-run $mirror_url : true" \
|
||||
"-q -o * $mirror_url : cp $FIXTURE_ROOT/package-1.0.0.tar.gz \$3"
|
||||
stub aria2c "--dry-run $mirror_url : true" \
|
||||
"-o * $mirror_url : cp $FIXTURE_ROOT/package-1.0.0.tar.gz \$2"
|
||||
|
||||
install_fixture definitions/with-checksum
|
||||
|
||||
|
@ -58,8 +58,8 @@ export PYTHON_BUILD_MIRROR_URL=http://mirror.example.com
|
|||
local mirror_url="${PYTHON_BUILD_MIRROR_URL}/$checksum"
|
||||
|
||||
stub shasum true "echo $checksum"
|
||||
stub aria2c "-q --dry-run $mirror_url : false" \
|
||||
"-q -o * http://example.com/* : cp $FIXTURE_ROOT/\${4##*/} \$3"
|
||||
stub aria2c "--dry-run $mirror_url : false" \
|
||||
"-o * http://example.com/* : cp $FIXTURE_ROOT/\${3##*/} \$2"
|
||||
|
||||
install_fixture definitions/with-checksum
|
||||
|
||||
|
@ -76,9 +76,9 @@ export PYTHON_BUILD_MIRROR_URL=http://mirror.example.com
|
|||
local mirror_url="${PYTHON_BUILD_MIRROR_URL}/$checksum"
|
||||
|
||||
stub shasum true "echo invalid" "echo $checksum"
|
||||
stub aria2c "-q --dry-run $mirror_url : true" \
|
||||
"-q -o * $mirror_url : cp $FIXTURE_ROOT/package-1.0.0.tar.gz \$3" \
|
||||
"-q -o * http://example.com/* : cp $FIXTURE_ROOT/\${4##*/} \$3"
|
||||
stub aria2c "--dry-run $mirror_url : true" \
|
||||
"-o * $mirror_url : cp $FIXTURE_ROOT/package-1.0.0.tar.gz \$2" \
|
||||
"-o * http://example.com/* : cp $FIXTURE_ROOT/\${3##*/} \$2"
|
||||
|
||||
install_fixture definitions/with-checksum
|
||||
echo "$output" >&2
|
||||
|
@ -96,8 +96,8 @@ export PYTHON_BUILD_MIRROR_URL=http://mirror.example.com
|
|||
local checksum="ba988b1bb4250dee0b9dd3d4d722f9c64b2bacfc805d1b6eba7426bda72dd3c5"
|
||||
|
||||
stub shasum true "echo $checksum"
|
||||
stub aria2c "-q --dry-run : true" \
|
||||
"-q -o * https://?*/$checksum : cp $FIXTURE_ROOT/package-1.0.0.tar.gz \$3" \
|
||||
stub aria2c "--dry-run : true" \
|
||||
"-o * https://?*/$checksum : cp $FIXTURE_ROOT/package-1.0.0.tar.gz \$2" \
|
||||
|
||||
install_fixture definitions/with-checksum
|
||||
|
||||
|
@ -114,7 +114,7 @@ export PYTHON_BUILD_MIRROR_URL=http://mirror.example.com
|
|||
local checksum="ba988b1bb4250dee0b9dd3d4d722f9c64b2bacfc805d1b6eba7426bda72dd3c5"
|
||||
|
||||
stub shasum true "echo $checksum"
|
||||
stub aria2c "-q -o * https://www.python.org/* : cp $FIXTURE_ROOT/\${4##*/} \$3"
|
||||
stub aria2c "-o * https://www.python.org/* : cp $FIXTURE_ROOT/\${3##*/} \$2"
|
||||
|
||||
run_inline_definition <<DEF
|
||||
install_package "package-1.0.0" "https://www.python.org/packages/package-1.0.0.tar.gz#ba988b1bb4250dee0b9dd3d4d722f9c64b2bacfc805d1b6eba7426bda72dd3c5" copy
|
||||
|
|
Loading…
Reference in a new issue