Compare commits

...

5 commits

Author SHA1 Message Date
14aa8def2e
10,11,12 2024-09-29 18:19:19 +02:00
37277d1dc2
sub 2024-09-29 18:14:47 +02:00
c271c7de58
simple 2024-09-29 18:11:16 +02:00
719aa2f9fd
indent 2024-09-29 18:08:39 +02:00
37af0dbe2d
versions 2024-09-29 17:52:47 +02:00

View file

@ -41,47 +41,59 @@ tmp="${root}/tmp"
rm --force --recursive \
~/.cache/pip "${root}"
python3 -m pip \
download \
--dest "${root}" \
"${@}"
for version in "3.10" "3.11" "3.12"; do
export VIRTUAL_ENV="/prj/venv/${version}"
export OLD_PATH="${PATH}"
export PATH="${VIRTUAL_ENV}/bin:${PATH}"
prefix="Name: "
for wheel in "${root}/"*; do
echo
echo "${wheel}"
file="$(basename "${wheel}")"
case "${file}" in
*.tar.gz)
short="${file%.*}"
short="${short%.*}"
;;
*.whl)
short="${file%.*}"
;;
esac
file_name="$(echo "${short}" | cut -d "-" -f 1)"
file_version="$(echo "${short}" | cut -d "-" -f 2)"
case "${file}" in
*.tar.gz)
meta_data="${file_name}-${file_version}/${file_name}.egg-info/PKG-INFO"
tar xf "${wheel}" -C "${tmp}" "${meta_data}"
;;
*.whl)
meta_data="${file_name}-${file_version}.dist-info/METADATA"
unzip "${wheel}" "${meta_data}" -d "${tmp}"
;;
esac
name="$(grep "${prefix}" "${tmp}/${meta_data}" | sed "s|${prefix}||")"
echo "${name}"
name="$(echo "${name}" | tr "[:upper:]" "[:lower:]")"
name="$(echo "${name}" | tr "." "-")"
name="$(echo "${name}" | tr "_" "-")"
name="$(echo "${name}" | tr -d "\r")"
echo "${name}"
sub="${root}/simple/${name}"
mkdir --parents "${sub}"
mv -i "${root}/${file_name}-"* "${sub}/"
sub="${root}/${version}"
python -m pip \
download \
--dest "${sub}" \
"${@}"
prefix="Name: "
for wheel in "${sub}/"*; do
rm --force --recursive "${tmp}"
echo
echo "${wheel}"
file="$(basename "${wheel}")"
case "${file}" in
*.tar.gz)
short="${file%.*}"
short="${short%.*}"
;;
*.whl)
short="${file%.*}"
;;
esac
file_name="$(echo "${short}" | cut -d "-" -f 1)"
file_version="$(echo "${short}" | cut -d "-" -f 2)"
case "${file}" in
*.tar.gz)
meta_data="${file_name}-${file_version}/${file_name}.egg-info/PKG-INFO"
tar xf "${wheel}" -C "${tmp}" "${meta_data}"
;;
*.whl)
meta_data="${file_name}-${file_version}.dist-info/METADATA"
unzip "${wheel}" "${meta_data}" -d "${tmp}"
;;
esac
name="$(grep "${prefix}" "${tmp}/${meta_data}" | sed "s|${prefix}||")"
echo "${name}"
name="$(echo "${name}" | tr "[:upper:]" "[:lower:]")"
name="$(echo "${name}" | tr "." "-")"
name="$(echo "${name}" | tr "_" "-")"
name="$(echo "${name}" | tr -d "\r")"
echo "${name}"
simple="${sub}/simple/${name}"
mkdir --parents "${simple}"
mv -i "${sub}/${file_name}-"* "${simple}/"
done
export PATH="${OLD_PATH}"
unset OLD_PATH VIRTUAL_ENV
done
rm --force --recursive "${tmp}"