srmp/py.cpypy.sh
2024-10-09 21:51:20 +02:00

39 lines
1,014 B
Bash
Executable file

#! /usr/bin/env sh
file="$(readlink --canonicalize-existing "${0}")"
root="$(dirname "${file}")"
root="${root}/root/py/cpypy"
data="download-metadata.json"
path="${root}/${data}"
url="https://github.com\
/astral-sh/uv/raw/refs/heads/main/crates/uv-python/${data}"
rm --force --recursive "${root}"
mkdir --parents "${root}"
wget --continue --output-document "${path}" "${url}" 2>/dev/null
echo
echo "${path}"
cat "${path}"
for url in $(jq -r ".. | objects | .url?" "${path}" |
grep "\(/20241008/\|/pypy3.10-v7.3.17\)" |
grep --invert-match "\(armv7\|ppc64le\|s390x\)" |
grep --invert-match "\(apple-darwin\|macos\|win64\|windows-msvc\)"); do
case "$(basename "${url}")" in
cpython-3.13* | \
cpython-3.12* | \
cpython-3.11* | \
cpython-3.10* | \
pypy3.10*)
file="$(basename "${url}" | sed "s|%2B|+|g")"
dir="$(dirname "${url}")"
date="$(basename "${dir}")"
path="${root}/${date}"
mkdir --parents "${path}"
wget --continue --output-document "${path}/${file}" "${url}"
;;
*) ;;
esac
done