This commit is contained in:
Marc Beninca 2024-08-26 11:23:50 +02:00
parent 6112868374
commit b03dd41137
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -715,8 +715,7 @@ Acquire::https::Verify-Peer False;
*) ;;
esac
spcd_split
spcd_os_printenv "SPCD_PM_CLEAN" \
"SPCD_PM_INSTALL" "SPCD_PM_QUERY"
spcd_os_printenv "SPCD_PM_INSTALL" "SPCD_PM_QUERY"
spcd_split
spcd_os_printenv "SPCD_PKG_PKG" "SPCD_PM_CONF_PATH" "SPCD_PM_HTTPS_PATH"
# specific
@ -875,11 +874,22 @@ spcd_environment_list_workspace() {
# │ steps │ functions │
# ╰───────┴───────────╯
spcd_clean_cache() {
case "${SPCD_PM}" in
"${SPCD_PM_APK}") apk cache purge ;;
"${SPCD_PM_APT}") apt-get clean ;;
"${SPCD_PM_DNF}") dnf clean all ;;
"${SPCD_PM_PACMAN}") pacman --sync --clean --noconfirm ;;
"${SPCD_PM_ZYPPER}") zypper clean ;;
*) ;;
esac
}
spcd_install_package() {
spcd_install_package__name="${1}"
if [ -n "${spcd_install_package__name}" ]; then
${SPCD_PM_INSTALL} "${spcd_install_package__name}"
${SPCD_PM_CLEAN}
spcd_clean_cache
fi
}