diff --git a/cd.sh b/cd.sh index 9b71a22..60e620a 100644 --- a/cd.sh +++ b/cd.sh @@ -65,6 +65,7 @@ cd_set_environment_variables () { *) cd_error_os "CD_OS_VERSION" ;; esac CD_CA_ROOT="/etc/pki/ca-trust/source/anchors" + CD_CMD_CLEAN="dnf clean all" CD_PYTHON_COMMAND="python3.11" CD_PYTHON_PACKAGE="python3.11" CD_PYTHON_PACKAGES="/usr/lib64/python3.11/site-packages" @@ -77,6 +78,7 @@ cd_set_environment_variables () { *) cd_error_os "CD_OS_VERSION" ;; esac CD_CA_ROOT="/usr/local/share/ca-certificates" + CD_CMD_CLEAN="apt-get clean" CD_PYTHON_COMMAND="python3" CD_PYTHON_PACKAGE="python3" CD_PYTHON_PACKAGES="/usr/lib/python3/dist-packages" @@ -256,6 +258,8 @@ cd_upgrade_packages () { esac } +# agnostic steps + cd_install_git () { cd_step "Install Git" cd_install_package "${CD_GIT_PACKAGE}" @@ -268,14 +272,9 @@ cd_install_python () { cd_clean_packages_cache () { cd_step "Clean packages cache" - case "${CD_OS_ID}" in - "${CD_OS_ALMA}") dnf clean all || exit ;; - "${CD_OS_DEBIAN}") apt-get clean || exit ;; - esac + ${CD_CMD_CLEAN} || exit } -# agnostic steps - cd_install_python_modules () { local path local repository