spcd_query_package

This commit is contained in:
Marc Beninca 2024-08-26 12:04:01 +02:00
parent 4db5c7ce08
commit 9fc6c5fea3
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_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="\
[main] [main]
@ -634,7 +633,6 @@ sslverify=False
" "
;; ;;
"${SPCD_PM_APK}") "${SPCD_PM_APK}")
SPCD_PM_QUERY="apk info"
SPCD_PM_CONF_PATH="" SPCD_PM_CONF_PATH=""
SPCD_PM_CONF_TEXT="" SPCD_PM_CONF_TEXT=""
SPCD_PM_HTTPS_PATH="/etc/apk/repositories.d/https" SPCD_PM_HTTPS_PATH="/etc/apk/repositories.d/https"
@ -643,7 +641,6 @@ sslverify=False
" "
;; ;;
"${SPCD_PM_PACMAN}") "${SPCD_PM_PACMAN}")
SPCD_PM_QUERY="pacman --query"
SPCD_PM_CONF_PATH="" SPCD_PM_CONF_PATH=""
SPCD_PM_CONF_TEXT="" SPCD_PM_CONF_TEXT=""
SPCD_PM_HTTPS_PATH="/etc/pacman.d/https.conf" SPCD_PM_HTTPS_PATH="/etc/pacman.d/https.conf"
@ -652,7 +649,6 @@ SSLVerify = No
" "
;; ;;
"${SPCD_PM_APT}") "${SPCD_PM_APT}")
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="\
Acquire::Check-Valid-Until True; Acquire::Check-Valid-Until True;
@ -667,7 +663,6 @@ Acquire::https::Verify-Peer False;
" "
;; ;;
"${SPCD_PM_ZYPPER}") "${SPCD_PM_ZYPPER}")
SPCD_PM_QUERY="rpm --query"
SPCD_PM_CONF_PATH="" SPCD_PM_CONF_PATH=""
SPCD_PM_CONF_TEXT="\ SPCD_PM_CONF_TEXT="\
" "
@ -678,8 +673,6 @@ Acquire::https::Verify-Peer False;
*) ;; *) ;;
esac esac
spcd_split spcd_split
spcd_os_printenv "SPCD_PM_QUERY"
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
case "${SPCD_OS_ID}" in case "${SPCD_OS_ID}" in
@ -857,6 +850,17 @@ spcd_install_package() {
spcd_clean_cache spcd_clean_cache
} }
spcd_query_package() {
case "${SPCD_PM}" in
"${SPCD_PM_APK}") apk info "${1}" ;;
"${SPCD_PM_APT}") dpkg-query --show "${1}" ;;
"${SPCD_PM_DNF}") rpm --query "${1}" ;;
"${SPCD_PM_PACMAN}") pacman --query "${1}" ;;
"${SPCD_PM_ZYPPER}") rpm --query "${1}" ;;
*) ;;
esac
}
# ╭───────┬─────╮ # ╭───────┬─────╮
# │ steps │ dns │ # │ steps │ dns │
# ╰───────┴─────╯ # ╰───────┴─────╯