From 1181e2411f140299bedb13bbd605683cfbc95671 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 17:54:04 +0200 Subject: [PATCH] wip/clean,install,update,upgrade --- cd.sh | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/cd.sh b/cd.sh index b9ded73..a2cc590 100644 --- a/cd.sh +++ b/cd.sh @@ -89,12 +89,26 @@ cd_set_environment_variables () { # common case "${CD_OS_ID}" in "${CD_OS_ALMA}"|"${CD_OS_ROCKY}") + CD_CMD_CLEAN="dnf clean all" + CD_CMD_INSTALL="dnf install --assumeyes" + CD_CMD_UPDATE="dnf makecache" + CD_CMD_UPGRADE="dnf upgrade --assumeyes" ;; "${CD_OS_ALPINE}") + CD_CMD_CLEAN="apk cache purge" + CD_CMD_INSTALL="apk add" + CD_CMD_UPDATE="apk update" + CD_CMD_UPGRADE="apk upgrade" ;; "${CD_OS_DEBIAN}"|"${CD_OS_UBUNTU}") + CD_CMD_CLEAN="apt-get clean" + CD_CMD_INSTALL="apt-get install --assume-yes" + CD_CMD_UPDATE="apt-get update" + CD_CMD_UPGRADE="apt-get upgrade --assume-yes" ;; esac + cd_split + cd_echo "CD_CMD_CLEAN" "CD_CMD_INSTALL" "CD_CMD_UPDATE" "CD_CMD_UPGRADE" # case "${CD_OS_ID}" in "${CD_OS_ALMA}") @@ -104,10 +118,6 @@ cd_set_environment_variables () { "8"|"9") ;; *) cd_error_os "CD_OS_VERSION" ;; esac - CD_CMD_CLEAN="dnf clean all" - CD_CMD_INSTALL="dnf install --assumeyes" - CD_CMD_UPDATE="dnf makecache" - CD_CMD_UPGRADE="dnf upgrade --assumeyes" CD_PKG_PKG="" CD_PM_CONF_PATH="/etc/dnf/dnf.conf" CD_PM_CONF_TEXT="\ @@ -131,10 +141,6 @@ skip_if_unavailable=False "3.18"|"3.19") ;; *) cd_error_os "CD_OS_VERSION" ;; esac - CD_CMD_CLEAN="apk cache purge" - CD_CMD_INSTALL="apk add" - CD_CMD_UPDATE="apk update" - CD_CMD_UPGRADE="apk upgrade" CD_PKG_PKG="" CD_PM_CONF_PATH="" CD_PM_CONF_TEXT="" @@ -154,10 +160,6 @@ skip_if_unavailable=False "bullseye") CD_PYTHON_COMMAND="python3.9" ;; *) cd_error_os "CD_OS_VERSION" ;; esac - CD_CMD_CLEAN="apt-get clean" - CD_CMD_INSTALL="apt-get install --assume-yes" - CD_CMD_UPDATE="apt-get update" - CD_CMD_UPGRADE="apt-get upgrade --assume-yes" CD_PKG_PKG="apt-utils" CD_PM_CONF_PATH="/etc/apt/apt.conf.d/apt.conf" CD_PM_CONF_TEXT="\ @@ -201,8 +203,6 @@ Dir::Etc::SourceParts \"\"; CD_PROJECT_URL="${CD_PROJECTS_URL}/${CD_PROJECT_NAME}" # cd_split - cd_echo "CD_CMD_CLEAN" "CD_CMD_INSTALL" "CD_CMD_UPDATE" "CD_CMD_UPGRADE" - cd_split cd_echo "CD_PKG_PKG" cd_split cd_echo "CD_PM_CONF_PATH" "CD_PM_HTTPS_PATH"