From ca19c5dc1bc4965507977b549036bc3fd3d80f0c Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 29 Apr 2024 17:23:10 +0200 Subject: [PATCH] install,python --- cd.sh | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/cd.sh b/cd.sh index 9b78b05..4488d70 100644 --- a/cd.sh +++ b/cd.sh @@ -39,13 +39,19 @@ cd_set_environment () { case "${CD_OS_NAME}" in "debian") CD_PYTHON_COMMAND="python3" + CD_PYTHON_PACKAGE="python3" CD_PYTHON_PACKAGES="/usr/lib/python3/dist-packages" case "${CD_OS_VERSION}" in "bookworm") echo "TODO" ;; *) cd_error_os "CD_OS_VERSION=" ;; esac ;; - "alma") echo "TODO" ;; + "alma") + case "${CD_OS_VERSION}" in + "8") CD_PYTHON_PACKAGE="python3.11" ;; + *) cd_error_os "CD_OS_VERSION=" ;; + esac + ;; *) cd_error_os "CD_OS_NAME=" ;; esac # ci / github @@ -221,27 +227,19 @@ cd_upgrade_packages () { cd_install_git () { cd_step "Install Git" - case "${CD_OS_NAME}" in - "debian") cd_install_package "git" ;; - "alma") echo "TODO" ;; - *) cd_error_os "cd_install_git" ;; - esac + cd_install_package "git" } cd_install_python () { cd_step "Install Python" - case "${CD_OS_NAME}" in - "debian") cd_install_package "python3" ;; - "alma") echo "TODO" ;; - *) cd_error_os "cd_install_python" ;; - esac + cd_install_package "${CD_PYTHON_PACKAGE}" ;; } cd_clean_packages_cache () { cd_step "Clean packages cache" case "${CD_OS_NAME}" in "debian") apt-get clean || exit ;; - "alma") echo "TODO" ;; + "alma") dnf clean all || exit ;; *) cd_error_os "cd_clean_packages_cache" ;; esac } @@ -310,6 +308,7 @@ cd_install_package () { if [ "${1}" ] ; then case "${CD_OS_NAME}" in "debian") apt-get install --assume-yes "${1}" || exit ;; + "alma") dnf install --assumeyes "${1}" || exit ;; *) exit 1 ;; esac fi