pm/install

This commit is contained in:
Marc Beninca 2024-09-07 12:21:30 +02:00
parent dabb5814e5
commit b3acd1f8fe
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -938,7 +938,7 @@ spcd_txt_locales() {
spcd_split spcd_split
case "${SPCD_PM}" in case "${SPCD_PM}" in
"${SPCD_PM_APK}") "${SPCD_PM_APK}")
spcd_install_package "musl-locales" spcd_f_pm_install "musl-locales"
export MUSL_LOCPATH="/usr/share/i18n/locales/musl" export MUSL_LOCPATH="/usr/share/i18n/locales/musl"
;; ;;
"${SPCD_PM_APT}") "${SPCD_PM_APT}")
@ -949,17 +949,17 @@ ${name}.${_SPCD_TXT_CHARSET} ${_SPCD_TXT_CHARSET}
" "
done done
spcd_os_write "/etc/locale.gen" "${text}" spcd_os_write "/etc/locale.gen" "${text}"
spcd_install_package "locales" spcd_f_pm_install "locales"
;; ;;
"${SPCD_PM_DNF}") "${SPCD_PM_DNF}")
local language local language
for name in "${@}"; do for name in "${@}"; do
language="$(echo "${name}" | cut -d _ -f 1)" language="$(echo "${name}" | cut -d _ -f 1)"
spcd_install_package "glibc-langpack-${language}" spcd_f_pm_install "glibc-langpack-${language}"
done done
;; ;;
"${SPCD_PM_PACMAN}") spcd_install_package "glibc-locales" ;; "${SPCD_PM_PACMAN}") spcd_f_pm_install "glibc-locales" ;;
"${SPCD_PM_ZYPPER}") spcd_install_package "glibc-locale" ;; "${SPCD_PM_ZYPPER}") spcd_f_pm_install "glibc-locale" ;;
*) ;; *) ;;
esac esac
spcd_split spcd_split
@ -1015,7 +1015,7 @@ spcd_f_pm_https() {
esac esac
} }
spcd_install_package() { spcd_f_pm_install() {
case "${SPCD_PM}" in case "${SPCD_PM}" in
"${SPCD_PM_APK}") spcd_eval apk add "${1}" ;; "${SPCD_PM_APK}") spcd_eval apk add "${1}" ;;
"${SPCD_PM_APT}") spcd_eval apt-get install --assume-yes "${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__packages_install_tools() {
spcd_step "Install tools" spcd_step "Install tools"
case "${SPCD_PM}" in case "${SPCD_PM}" in
"${SPCD_PM_APT}") spcd_install_package "apt-utils" ;; "${SPCD_PM_APT}") spcd_f_pm_install "apt-utils" ;;
*) ;; *) ;;
esac esac
} }
@ -1298,7 +1298,7 @@ spcd_step__packages_install_locales() {
spcd_step__ca_install_package() { spcd_step__ca_install_package() {
spcd_step "Install package" spcd_step "Install package"
spcd_install_package "ca-certificates" spcd_f_pm_install "ca-certificates"
} }
spcd_step__ca_write_certificates() { spcd_step__ca_write_certificates() {
@ -1369,12 +1369,12 @@ spcd_step__packages_upgrade_system() {
spcd_step__packages_install_dos2unix() { spcd_step__packages_install_dos2unix() {
spcd_step "Install dos2unix" spcd_step "Install dos2unix"
spcd_install_package "dos2unix" spcd_f_pm_install "dos2unix"
} }
spcd_step__packages_install_git() { spcd_step__packages_install_git() {
spcd_step "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__python_install() {
spcd_step "Install package" spcd_step "Install package"
spcd_install_package "${SPCD_PYTHON_PACKAGE}" spcd_f_pm_install "${SPCD_PYTHON_PACKAGE}"
spcd_step "Link alias to command" spcd_step "Link alias to command"
spcd_python_ln "${SPCD_PYTHON_COMMAND}" spcd_python_ln "${SPCD_PYTHON_COMMAND}"
# venv # venv
@ -1391,7 +1391,7 @@ spcd_step__python_install() {
spcd_step "Install package" spcd_step "Install package"
case "${SPCD_OS_ID}" in case "${SPCD_OS_ID}" in
"${SPCD_OS_DEBIAN}" | "${SPCD_OS_UBUNTU}") "${SPCD_OS_DEBIAN}" | "${SPCD_OS_UBUNTU}")
spcd_install_package "python3-venv" spcd_f_pm_install "python3-venv"
;; ;;
*) ;; *) ;;
esac esac
@ -1441,7 +1441,7 @@ spcd_step__install_packages() {
spcd_step "EPEL" spcd_step "EPEL"
case "${SPCD_OS_ID}" in case "${SPCD_OS_ID}" in
"${SPCD_OS_ALMA}" | "${SPCD_OS_ROCKY}") "${SPCD_OS_ALMA}" | "${SPCD_OS_ROCKY}")
spcd_install_package "epel-release" spcd_f_pm_install "epel-release"
case "${SPCD_OS_VERSION}" in case "${SPCD_OS_VERSION}" in
"9") "9")
set -- \ set -- \
@ -1473,32 +1473,32 @@ spcd_step__install_packages() {
esac esac
# graphviz # graphviz
spcd_step "GraphViz" spcd_step "GraphViz"
spcd_install_package "graphviz" spcd_f_pm_install "graphviz"
# openssh # openssh
spcd_step "OpenSSH" spcd_step "OpenSSH"
case "${SPCD_PM}" in case "${SPCD_PM}" in
"${SPCD_PM_APK}" | "${SPCD_PM_APT}") "${SPCD_PM_APK}" | "${SPCD_PM_APT}")
spcd_install_package "openssh-client" spcd_f_pm_install "openssh-client"
;; ;;
"${SPCD_PM_DNF}" | "${SPCD_PM_ZYPPER}") "${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 esac
# plantuml # plantuml
spcd_step "PlantUML" spcd_step "PlantUML"
spcd_install_package "plantuml" spcd_f_pm_install "plantuml"
# rsync # rsync
spcd_step "Rsync" spcd_step "Rsync"
spcd_install_package "rsync" spcd_f_pm_install "rsync"
# shell check # shell check
spcd_step "ShellCheck" spcd_step "ShellCheck"
case "${SPCD_PM}" in case "${SPCD_PM}" in
"${SPCD_PM_DNF}" | "${SPCD_PM_ZYPPER}") "${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 esac
# shfmt # shfmt
spcd_step "ShellFormat" spcd_step "ShellFormat"
@ -1507,10 +1507,10 @@ spcd_step__install_packages() {
"${SPCD_OS_DEBIAN}") "${SPCD_OS_DEBIAN}")
case "${SPCD_OS_VERSION}" in case "${SPCD_OS_VERSION}" in
"bullseye") ;; "bullseye") ;;
*) spcd_install_package "shfmt" ;; *) spcd_f_pm_install "shfmt" ;;
esac esac
;; ;;
*) spcd_install_package "shfmt" ;; *) spcd_f_pm_install "shfmt" ;;
esac esac
spcd_step_out spcd_step_out
} }