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
"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