From 728acfded98b4c0ef9697a74515eb1923ba8896e Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 26 Aug 2024 12:36:41 +0200 Subject: [PATCH] pm/conf --- spcd/bootstrap.sh | 55 +++++++++++++++++++++++++---------------------- 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/spcd/bootstrap.sh b/spcd/bootstrap.sh index 6cf0ca8..db3dcb3 100644 --- a/spcd/bootstrap.sh +++ b/spcd/bootstrap.sh @@ -618,54 +618,30 @@ ${SPCD_PROJECT_ROOT}$(basename "${GITHUB_SERVER_URL}")" spcd_os_printenv "SPCD_PM" case "${SPCD_PM}" in "${SPCD_PM_DNF}") - SPCD_PM_CONF_PATH="/etc/dnf/dnf.conf" - SPCD_PM_CONF_TEXT="\ -[main] -best=True -clean_requirements_on_remove=True -gpgcheck=1 -installonly_limit=3 -skip_if_unavailable=False -" SPCD_PM_HTTPS_PATH="/etc/dnf/dnf.conf.d/https.conf" SPCD_PM_HTTPS_TEXT="\ sslverify=False " ;; "${SPCD_PM_APK}") - SPCD_PM_CONF_PATH="" - SPCD_PM_CONF_TEXT="" SPCD_PM_HTTPS_PATH="/etc/apk/repositories.d/https" SPCD_PM_HTTPS_TEXT="\ --no-verify " ;; "${SPCD_PM_PACMAN}") - SPCD_PM_CONF_PATH="" - SPCD_PM_CONF_TEXT="" SPCD_PM_HTTPS_PATH="/etc/pacman.d/https.conf" SPCD_PM_HTTPS_TEXT="\ SSLVerify = No " ;; "${SPCD_PM_APT}") - SPCD_PM_CONF_PATH="/etc/apt/apt.conf.d/apt.conf" - SPCD_PM_CONF_TEXT="\ -Acquire::Check-Valid-Until True; -APT::Get::Show-Versions True; -APT::Install-Recommends False; -APT::Install-Suggests False; -Dir::Etc::SourceParts \"\"; -" SPCD_PM_HTTPS_PATH="/etc/apt/apt.conf.d/https" SPCD_PM_HTTPS_TEXT="\ Acquire::https::Verify-Peer False; " ;; "${SPCD_PM_ZYPPER}") - SPCD_PM_CONF_PATH="" - SPCD_PM_CONF_TEXT="\ -" SPCD_PM_HTTPS_PATH="" SPCD_PM_HTTPS_TEXT="\ " @@ -673,7 +649,7 @@ Acquire::https::Verify-Peer False; *) ;; esac spcd_split - spcd_os_printenv "SPCD_PM_CONF_PATH" "SPCD_PM_HTTPS_PATH" + spcd_os_printenv "SPCD_PM_HTTPS_PATH" # specific case "${SPCD_OS_ID}" in "${SPCD_OS_ALMA}") @@ -951,7 +927,34 @@ deb ${SPCD_URL_CHOSEN} ${SPCD_OS_VERSION}-security main universe spcd_packages_set_configuration() { spcd_step "Set configuration" - spcd_os_write "${SPCD_PM_CONF_PATH}" "${SPCD_PM_CONF_TEXT}" + case "${SPCD_PM}" in + "${SPCD_PM_DNF}") + spcd_os_write "/etc/dnf/dnf.conf" "\ +[main] +best=True +clean_requirements_on_remove=True +gpgcheck=1 +installonly_limit=3 +skip_if_unavailable=False +" + ;; + "${SPCD_PM_APK}") + ;; + "${SPCD_PM_PACMAN}") + ;; + "${SPCD_PM_APT}") + spcd_os_write "/etc/apt/apt.conf.d/apt.conf" "\ +Acquire::Check-Valid-Until True; +APT::Get::Show-Versions True; +APT::Install-Recommends False; +APT::Install-Suggests False; +Dir::Etc::SourceParts \"\"; +" + ;; + "${SPCD_PM_ZYPPER}") + ;; + *) ;; + esac case "${SPCD_OS_ID}" in "${SPCD_OS_ARCH}") pacman-key --init