pm/install

This commit is contained in:
Marc Beninca 2024-08-26 11:58:06 +02:00
parent 0af77deec9
commit 4db5c7ce08
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -618,7 +618,6 @@ ${SPCD_PROJECT_ROOT}$(basename "${GITHUB_SERVER_URL}")"
spcd_os_printenv "SPCD_PM" spcd_os_printenv "SPCD_PM"
case "${SPCD_PM}" in case "${SPCD_PM}" in
"${SPCD_PM_DNF}") "${SPCD_PM_DNF}")
SPCD_PM_INSTALL="dnf install --assumeyes"
SPCD_PM_QUERY="rpm --query" SPCD_PM_QUERY="rpm --query"
SPCD_PM_CONF_PATH="/etc/dnf/dnf.conf" SPCD_PM_CONF_PATH="/etc/dnf/dnf.conf"
SPCD_PM_CONF_TEXT="\ SPCD_PM_CONF_TEXT="\
@ -635,7 +634,6 @@ sslverify=False
" "
;; ;;
"${SPCD_PM_APK}") "${SPCD_PM_APK}")
SPCD_PM_INSTALL="apk add"
SPCD_PM_QUERY="apk info" SPCD_PM_QUERY="apk info"
SPCD_PM_CONF_PATH="" SPCD_PM_CONF_PATH=""
SPCD_PM_CONF_TEXT="" SPCD_PM_CONF_TEXT=""
@ -645,7 +643,6 @@ sslverify=False
" "
;; ;;
"${SPCD_PM_PACMAN}") "${SPCD_PM_PACMAN}")
SPCD_PM_INSTALL="pacman --sync --noconfirm"
SPCD_PM_QUERY="pacman --query" SPCD_PM_QUERY="pacman --query"
SPCD_PM_CONF_PATH="" SPCD_PM_CONF_PATH=""
SPCD_PM_CONF_TEXT="" SPCD_PM_CONF_TEXT=""
@ -655,7 +652,6 @@ SSLVerify = No
" "
;; ;;
"${SPCD_PM_APT}") "${SPCD_PM_APT}")
SPCD_PM_INSTALL="apt-get install --assume-yes"
SPCD_PM_QUERY="dpkg-query --show" SPCD_PM_QUERY="dpkg-query --show"
SPCD_PM_CONF_PATH="/etc/apt/apt.conf.d/apt.conf" SPCD_PM_CONF_PATH="/etc/apt/apt.conf.d/apt.conf"
SPCD_PM_CONF_TEXT="\ SPCD_PM_CONF_TEXT="\
@ -671,7 +667,6 @@ Acquire::https::Verify-Peer False;
" "
;; ;;
"${SPCD_PM_ZYPPER}") "${SPCD_PM_ZYPPER}")
SPCD_PM_INSTALL="zypper --non-interactive install"
SPCD_PM_QUERY="rpm --query" SPCD_PM_QUERY="rpm --query"
SPCD_PM_CONF_PATH="" SPCD_PM_CONF_PATH=""
SPCD_PM_CONF_TEXT="\ SPCD_PM_CONF_TEXT="\
@ -683,7 +678,7 @@ Acquire::https::Verify-Peer False;
*) ;; *) ;;
esac esac
spcd_split spcd_split
spcd_os_printenv "SPCD_PM_INSTALL" "SPCD_PM_QUERY" spcd_os_printenv "SPCD_PM_QUERY"
spcd_split spcd_split
spcd_os_printenv "SPCD_PM_CONF_PATH" "SPCD_PM_HTTPS_PATH" spcd_os_printenv "SPCD_PM_CONF_PATH" "SPCD_PM_HTTPS_PATH"
# specific # specific
@ -851,11 +846,15 @@ spcd_clean_cache() {
} }
spcd_install_package() { spcd_install_package() {
spcd_install_package__name="${1}" case "${SPCD_PM}" in
if [ -n "${spcd_install_package__name}" ]; then "${SPCD_PM_APK}") apk add "${1}" ;;
${SPCD_PM_INSTALL} "${spcd_install_package__name}" "${SPCD_PM_APT}") apt-get install --assume-yes "${1}" ;;
spcd_clean_cache "${SPCD_PM_DNF}") dnf install --assumeyes "${1}" ;;
fi "${SPCD_PM_PACMAN}") pacman --sync --noconfirm "${1}" ;;
"${SPCD_PM_ZYPPER}") zypper --non-interactive install "${1}" ;;
*) ;;
esac
spcd_clean_cache
} }
# ╭───────┬─────╮ # ╭───────┬─────╮