srmp/py.cpypy.sh

40 lines
1,014 B
Bash
Raw Permalink Normal View History

2024-09-28 19:56:18 +00:00
#! /usr/bin/env sh
2024-09-28 20:30:23 +00:00
file="$(readlink --canonicalize-existing "${0}")"
root="$(dirname "${file}")"
root="${root}/root/py/cpypy"
2024-09-28 19:56:18 +00:00
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}"
2024-09-29 13:26:23 +00:00
wget --continue --output-document "${path}" "${url}" 2>/dev/null
echo
echo "${path}"
cat "${path}"
2024-09-28 19:56:18 +00:00
2024-09-29 13:42:16 +00:00
for url in $(jq -r ".. | objects | .url?" "${path}" |
2024-10-09 19:12:22 +00:00
grep "\(/20241008/\|/pypy3.10-v7.3.17\)" |
2024-09-29 13:42:16 +00:00
grep --invert-match "\(armv7\|ppc64le\|s390x\)" |
2024-09-29 19:49:21 +00:00
grep --invert-match "\(apple-darwin\|macos\|win64\|windows-msvc\)"); do
2024-09-29 13:26:23 +00:00
case "$(basename "${url}")" in
2024-10-09 19:51:20 +00:00
cpython-3.13* | \
cpython-3.12* | \
cpython-3.11* | \
cpython-3.10* | \
2024-10-09 19:12:22 +00:00
pypy3.10*)
2024-09-29 13:26:23 +00:00
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
2024-09-28 19:56:18 +00:00
done