From 9fc6c5fea3f6eeffaa7a0722522e284cab1e9a81 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 26 Aug 2024 12:04:01 +0200 Subject: [PATCH] spcd_query_package --- spcd/bootstrap.sh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/spcd/bootstrap.sh b/spcd/bootstrap.sh index 5667c7a..6cf0ca8 100644 --- a/spcd/bootstrap.sh +++ b/spcd/bootstrap.sh @@ -618,7 +618,6 @@ ${SPCD_PROJECT_ROOT}$(basename "${GITHUB_SERVER_URL}")" spcd_os_printenv "SPCD_PM" case "${SPCD_PM}" in "${SPCD_PM_DNF}") - SPCD_PM_QUERY="rpm --query" SPCD_PM_CONF_PATH="/etc/dnf/dnf.conf" SPCD_PM_CONF_TEXT="\ [main] @@ -634,7 +633,6 @@ sslverify=False " ;; "${SPCD_PM_APK}") - SPCD_PM_QUERY="apk info" SPCD_PM_CONF_PATH="" SPCD_PM_CONF_TEXT="" SPCD_PM_HTTPS_PATH="/etc/apk/repositories.d/https" @@ -643,7 +641,6 @@ sslverify=False " ;; "${SPCD_PM_PACMAN}") - SPCD_PM_QUERY="pacman --query" SPCD_PM_CONF_PATH="" SPCD_PM_CONF_TEXT="" SPCD_PM_HTTPS_PATH="/etc/pacman.d/https.conf" @@ -652,7 +649,6 @@ SSLVerify = No " ;; "${SPCD_PM_APT}") - SPCD_PM_QUERY="dpkg-query --show" SPCD_PM_CONF_PATH="/etc/apt/apt.conf.d/apt.conf" SPCD_PM_CONF_TEXT="\ Acquire::Check-Valid-Until True; @@ -667,7 +663,6 @@ Acquire::https::Verify-Peer False; " ;; "${SPCD_PM_ZYPPER}") - SPCD_PM_QUERY="rpm --query" SPCD_PM_CONF_PATH="" SPCD_PM_CONF_TEXT="\ " @@ -678,8 +673,6 @@ Acquire::https::Verify-Peer False; *) ;; esac spcd_split - spcd_os_printenv "SPCD_PM_QUERY" - spcd_split spcd_os_printenv "SPCD_PM_CONF_PATH" "SPCD_PM_HTTPS_PATH" # specific case "${SPCD_OS_ID}" in @@ -857,6 +850,17 @@ spcd_install_package() { 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 │ # ╰───────┴─────╯