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