srmp/py.cpypy.sh
2024-09-29 15:42:16 +02:00

34 lines
935 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 --invert-match "\(armv7\|ppc64le\|s390x\)" |
grep --invert-match "\(apple-darwin\|macos\|windows-msvc\)"); do
case "$(basename "${url}")" in
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