pm/pkg/install

This commit is contained in:
Marc Beninca 2024-09-08 23:49:16 +02:00
parent d453e5eb67
commit 0c050ca1ae
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -890,14 +890,6 @@ spcd_f_ca_write() {
# │ f │ pm = package manager │ # │ f │ pm = package manager │
# ╰───┴──────────────────────╯ # ╰───┴──────────────────────╯
spcd_f_pm_install() {
spcd_step "Install tools"
case "${SPCD_PM}" in
"${SPCD_PM_APT}") spcd_f_pm_pkg_install "apt-utils" ;;
*) ;;
esac
}
# ╭───┬────┬───────╮ # ╭───┬────┬───────╮
# │ f │ pm │ https │ # │ f │ pm │ https │
# ╰───┴────┴───────╯ # ╰───┴────┴───────╯
@ -967,15 +959,27 @@ spcd_f_pm_pkg_clean() {
} }
spcd_f_pm_pkg_install() { spcd_f_pm_pkg_install() {
if [ -n "${1}" ]; then
local name
for name in "${@}"; do
case "${SPCD_PM}" in case "${SPCD_PM}" in
"${SPCD_PM_APK}") spcd_run apk add "${1}" ;; "${SPCD_PM_APK}") spcd_run apk add "${1}" ;;
"${SPCD_PM_APT}") spcd_run apt-get install --assume-yes "${1}" ;; "${SPCD_PM_APT}") spcd_run apt-get install --assume-yes "${1}" ;;
"${SPCD_PM_DNF}") spcd_run dnf install --assumeyes "${1}" ;; "${SPCD_PM_DNF}") spcd_run dnf install --assumeyes "${1}" ;;
"${SPCD_PM_PACMAN}") spcd_run pacman --sync --noconfirm "${1}" ;; "${SPCD_PM_PACMAN}") spcd_run pacman --sync --noconfirm "${1}" ;;
"${SPCD_PM_ZYPPER}") spcd_run zypper --non-interactive install "${1}" ;; "${SPCD_PM_ZYPPER}")
spcd_run zypper --non-interactive install "${1}"
;;
*) ;; *) ;;
esac esac
spcd_f_pm_pkg_clean spcd_f_pm_pkg_clean
done
else
case "${SPCD_PM}" in
"${SPCD_PM_APT}") spcd_f_pm_pkg_install "apt-utils" ;;
*) ;;
esac
fi
} }
spcd_f_pm_pkg_query() { spcd_f_pm_pkg_query() {
@ -1570,7 +1574,7 @@ spcd_main() {
spcd_step__packages_set_configuration spcd_step__packages_set_configuration
spcd_f_pm_https_trust spcd_f_pm_https_trust
spcd_f_pm_pkg_update spcd_f_pm_pkg_update
spcd_f_pm_install spcd_f_pm_pkg_install
# locales # locales
spcd_step_in "Locales" spcd_step_in "Locales"
spcd_step "Install" spcd_step "Install"