From b3acd1f8fef98ad1b50528428635a72f91a9b8b4 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 7 Sep 2024 12:21:30 +0200 Subject: [PATCH] pm/install --- spcd/bootstrap.sh | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/spcd/bootstrap.sh b/spcd/bootstrap.sh index 3c57b99..0e3eb16 100644 --- a/spcd/bootstrap.sh +++ b/spcd/bootstrap.sh @@ -938,7 +938,7 @@ spcd_txt_locales() { spcd_split case "${SPCD_PM}" in "${SPCD_PM_APK}") - spcd_install_package "musl-locales" + spcd_f_pm_install "musl-locales" export MUSL_LOCPATH="/usr/share/i18n/locales/musl" ;; "${SPCD_PM_APT}") @@ -949,17 +949,17 @@ ${name}.${_SPCD_TXT_CHARSET} ${_SPCD_TXT_CHARSET} " done spcd_os_write "/etc/locale.gen" "${text}" - spcd_install_package "locales" + spcd_f_pm_install "locales" ;; "${SPCD_PM_DNF}") local language for name in "${@}"; do language="$(echo "${name}" | cut -d _ -f 1)" - spcd_install_package "glibc-langpack-${language}" + spcd_f_pm_install "glibc-langpack-${language}" done ;; - "${SPCD_PM_PACMAN}") spcd_install_package "glibc-locales" ;; - "${SPCD_PM_ZYPPER}") spcd_install_package "glibc-locale" ;; + "${SPCD_PM_PACMAN}") spcd_f_pm_install "glibc-locales" ;; + "${SPCD_PM_ZYPPER}") spcd_f_pm_install "glibc-locale" ;; *) ;; esac spcd_split @@ -1015,7 +1015,7 @@ spcd_f_pm_https() { esac } -spcd_install_package() { +spcd_f_pm_install() { case "${SPCD_PM}" in "${SPCD_PM_APK}") spcd_eval apk add "${1}" ;; "${SPCD_PM_APT}") spcd_eval apt-get install --assume-yes "${1}" ;; @@ -1276,7 +1276,7 @@ spcd_step__packages_update_catalog() { spcd_step__packages_install_tools() { spcd_step "Install tools" case "${SPCD_PM}" in - "${SPCD_PM_APT}") spcd_install_package "apt-utils" ;; + "${SPCD_PM_APT}") spcd_f_pm_install "apt-utils" ;; *) ;; esac } @@ -1298,7 +1298,7 @@ spcd_step__packages_install_locales() { spcd_step__ca_install_package() { spcd_step "Install package" - spcd_install_package "ca-certificates" + spcd_f_pm_install "ca-certificates" } spcd_step__ca_write_certificates() { @@ -1369,12 +1369,12 @@ spcd_step__packages_upgrade_system() { spcd_step__packages_install_dos2unix() { spcd_step "Install dos2unix" - spcd_install_package "dos2unix" + spcd_f_pm_install "dos2unix" } spcd_step__packages_install_git() { spcd_step "Install Git" - spcd_install_package "git" + spcd_f_pm_install "git" } # ╭───┬────────╮ @@ -1383,7 +1383,7 @@ spcd_step__packages_install_git() { spcd_step__python_install() { spcd_step "Install package" - spcd_install_package "${SPCD_PYTHON_PACKAGE}" + spcd_f_pm_install "${SPCD_PYTHON_PACKAGE}" spcd_step "Link alias to command" spcd_python_ln "${SPCD_PYTHON_COMMAND}" # venv @@ -1391,7 +1391,7 @@ spcd_step__python_install() { spcd_step "Install package" case "${SPCD_OS_ID}" in "${SPCD_OS_DEBIAN}" | "${SPCD_OS_UBUNTU}") - spcd_install_package "python3-venv" + spcd_f_pm_install "python3-venv" ;; *) ;; esac @@ -1441,7 +1441,7 @@ spcd_step__install_packages() { spcd_step "EPEL" case "${SPCD_OS_ID}" in "${SPCD_OS_ALMA}" | "${SPCD_OS_ROCKY}") - spcd_install_package "epel-release" + spcd_f_pm_install "epel-release" case "${SPCD_OS_VERSION}" in "9") set -- \ @@ -1473,32 +1473,32 @@ spcd_step__install_packages() { esac # graphviz spcd_step "GraphViz" - spcd_install_package "graphviz" + spcd_f_pm_install "graphviz" # openssh spcd_step "OpenSSH" case "${SPCD_PM}" in "${SPCD_PM_APK}" | "${SPCD_PM_APT}") - spcd_install_package "openssh-client" + spcd_f_pm_install "openssh-client" ;; "${SPCD_PM_DNF}" | "${SPCD_PM_ZYPPER}") - spcd_install_package "openssh-clients" + spcd_f_pm_install "openssh-clients" ;; - "${SPCD_PM_PACMAN}") spcd_install_package "openssh" ;; + "${SPCD_PM_PACMAN}") spcd_f_pm_install "openssh" ;; *) ;; esac # plantuml spcd_step "PlantUML" - spcd_install_package "plantuml" + spcd_f_pm_install "plantuml" # rsync spcd_step "Rsync" - spcd_install_package "rsync" + spcd_f_pm_install "rsync" # shell check spcd_step "ShellCheck" case "${SPCD_PM}" in "${SPCD_PM_DNF}" | "${SPCD_PM_ZYPPER}") - spcd_install_package "ShellCheck" + spcd_f_pm_install "ShellCheck" ;; - *) spcd_install_package "shellcheck" ;; + *) spcd_f_pm_install "shellcheck" ;; esac # shfmt spcd_step "ShellFormat" @@ -1507,10 +1507,10 @@ spcd_step__install_packages() { "${SPCD_OS_DEBIAN}") case "${SPCD_OS_VERSION}" in "bullseye") ;; - *) spcd_install_package "shfmt" ;; + *) spcd_f_pm_install "shfmt" ;; esac ;; - *) spcd_install_package "shfmt" ;; + *) spcd_f_pm_install "shfmt" ;; esac spcd_step_out }