install,python

This commit is contained in:
Marc Beninca 2024-04-29 17:23:10 +02:00
parent 4d9a7671f9
commit ca19c5dc1b
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

23
cd.sh
View file

@ -39,13 +39,19 @@ cd_set_environment () {
case "${CD_OS_NAME}" in case "${CD_OS_NAME}" in
"debian") "debian")
CD_PYTHON_COMMAND="python3" CD_PYTHON_COMMAND="python3"
CD_PYTHON_PACKAGE="python3"
CD_PYTHON_PACKAGES="/usr/lib/python3/dist-packages" CD_PYTHON_PACKAGES="/usr/lib/python3/dist-packages"
case "${CD_OS_VERSION}" in case "${CD_OS_VERSION}" in
"bookworm") echo "TODO" ;; "bookworm") echo "TODO" ;;
*) cd_error_os "CD_OS_VERSION=" ;; *) cd_error_os "CD_OS_VERSION=" ;;
esac 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=" ;; *) cd_error_os "CD_OS_NAME=" ;;
esac esac
# ci / github # ci / github
@ -221,27 +227,19 @@ cd_upgrade_packages () {
cd_install_git () { cd_install_git () {
cd_step "Install Git" cd_step "Install Git"
case "${CD_OS_NAME}" in cd_install_package "git"
"debian") cd_install_package "git" ;;
"alma") echo "TODO" ;;
*) cd_error_os "cd_install_git" ;;
esac
} }
cd_install_python () { cd_install_python () {
cd_step "Install Python" cd_step "Install Python"
case "${CD_OS_NAME}" in cd_install_package "${CD_PYTHON_PACKAGE}" ;;
"debian") cd_install_package "python3" ;;
"alma") echo "TODO" ;;
*) cd_error_os "cd_install_python" ;;
esac
} }
cd_clean_packages_cache () { cd_clean_packages_cache () {
cd_step "Clean packages cache" cd_step "Clean packages cache"
case "${CD_OS_NAME}" in case "${CD_OS_NAME}" in
"debian") apt-get clean || exit ;; "debian") apt-get clean || exit ;;
"alma") echo "TODO" ;; "alma") dnf clean all || exit ;;
*) cd_error_os "cd_clean_packages_cache" ;; *) cd_error_os "cd_clean_packages_cache" ;;
esac esac
} }
@ -310,6 +308,7 @@ cd_install_package () {
if [ "${1}" ] ; then if [ "${1}" ] ; then
case "${CD_OS_NAME}" in case "${CD_OS_NAME}" in
"debian") apt-get install --assume-yes "${1}" || exit ;; "debian") apt-get install --assume-yes "${1}" || exit ;;
"alma") dnf install --assumeyes "${1}" || exit ;;
*) exit 1 ;; *) exit 1 ;;
esac esac
fi fi