From 6aeec4050367cd2923e58cde6ac5f0536c42d002 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 19 Aug 2024 10:23:08 +0200 Subject: [PATCH] mv --- spcd.sh | 96 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/spcd.sh b/spcd.sh index 9d1e926..069f20e 100644 --- a/spcd.sh +++ b/spcd.sh @@ -31,9 +31,9 @@ spcd_main() { spcd_install_dos2unix spcd_install_git spcd_install_python + spcd_install_python_modules # TODO move to Python spcd_install_packages - spcd_install_python_modules spcd_write_python_module spcd_switch_to_python } @@ -607,6 +607,53 @@ spcd_install_python() { spcd_ln_python "${SPCD_PYTHON_COMMAND}" } +spcd_install_python_modules() { + spcd_step "Install Python modules" + spcd_ipm__root="$(mktemp --directory)" || exit + spcd_ipm__target="${SPCD_PYTHON_VENV_PACKAGES}" + echo "→ ${spcd_ipm__root}" + for spcd_ipm__repository in "${SPCD_GIT_MAIN}" "${SPCD_GIT_ROOT}"; do + case "${spcd_ipm__repository}" in + http*) spcd_ipm__url="${spcd_ipm__repository}" ;; + */*) spcd_ipm__url="${SPCD_PROJECT_ROOT}/${spcd_ipm__repository}" ;; + *) spcd_ipm__url="\ +${SPCD_PROJECT_ROOT}/${SPCD_PROJECT_PATH}/${spcd_ipm__repository}" ;; + esac + spcd_ipm__name="$(basename "${spcd_ipm__url}")" + spcd_split + echo "\ +${spcd_ipm__url} +↓" + git clone \ + "${spcd_ipm__url}" \ + "${spcd_ipm__root}/${spcd_ipm__name}" || + exit + spcd_ipm__path="${spcd_ipm__root}/${spcd_ipm__name}/${spcd_ipm__name}" + echo "\ +${spcd_ipm__path} +↓ +${spcd_ipm__target}" + cp --recursive "${spcd_ipm__path}" "${spcd_ipm__target}" || + exit + # check matching of file and variable + spcd_ipm__script="${spcd_ipm__root}/${spcd_ipm__name}/spcd.sh" + if [ -f "${spcd_ipm__script}" ]; then + spcd_split + spcd_ipm__check="${spcd_ipm__root}/check.sha512sum" + sha512sum "${spcd_ipm__script}" >"${spcd_ipm__check}" + printf "%s" "${SPCD}" >"${spcd_ipm__script}" + ls -l "${spcd_ipm__script}" + dos2unix "${spcd_ipm__script}" + ls -l "${spcd_ipm__script}" + sha512sum -c "${spcd_ipm__check}" || spcd_error_ci "SPCD" + fi + done + spcd_split + spcd_ls "${spcd_ipm__target}" + spcd_split + spcd_rm "${spcd_ipm__root}" +} + # TODO move to Python spcd_install_packages() { # epel @@ -681,53 +728,6 @@ index-url = ${SPCD_URL_PYTHON} export VIRTUAL_ENV="${SPCD_PYTHON_VENV}" } -spcd_install_python_modules() { - spcd_step "Install Python modules" - spcd_ipm__root="$(mktemp --directory)" || exit - spcd_ipm__target="${SPCD_PYTHON_VENV_PACKAGES}" - echo "→ ${spcd_ipm__root}" - for spcd_ipm__repository in "${SPCD_GIT_MAIN}" "${SPCD_GIT_ROOT}"; do - case "${spcd_ipm__repository}" in - http*) spcd_ipm__url="${spcd_ipm__repository}" ;; - */*) spcd_ipm__url="${SPCD_PROJECT_ROOT}/${spcd_ipm__repository}" ;; - *) spcd_ipm__url="\ -${SPCD_PROJECT_ROOT}/${SPCD_PROJECT_PATH}/${spcd_ipm__repository}" ;; - esac - spcd_ipm__name="$(basename "${spcd_ipm__url}")" - spcd_split - echo "\ -${spcd_ipm__url} -↓" - git clone \ - "${spcd_ipm__url}" \ - "${spcd_ipm__root}/${spcd_ipm__name}" || - exit - spcd_ipm__path="${spcd_ipm__root}/${spcd_ipm__name}/${spcd_ipm__name}" - echo "\ -${spcd_ipm__path} -↓ -${spcd_ipm__target}" - cp --recursive "${spcd_ipm__path}" "${spcd_ipm__target}" || - exit - # check matching of file and variable - spcd_ipm__script="${spcd_ipm__root}/${spcd_ipm__name}/spcd.sh" - if [ -f "${spcd_ipm__script}" ]; then - spcd_split - spcd_ipm__check="${spcd_ipm__root}/check.sha512sum" - sha512sum "${spcd_ipm__script}" >"${spcd_ipm__check}" - printf "%s" "${SPCD}" >"${spcd_ipm__script}" - ls -l "${spcd_ipm__script}" - dos2unix "${spcd_ipm__script}" - ls -l "${spcd_ipm__script}" - sha512sum -c "${spcd_ipm__check}" || spcd_error_ci "SPCD" - fi - done - spcd_split - spcd_ls "${spcd_ipm__target}" - spcd_split - spcd_rm "${spcd_ipm__root}" -} - spcd_write_python_module() { spcd_step "Write Python module" for spcd_wpm__variable in \