Compare commits

...

7 commits

Author SHA1 Message Date
58192fa9f8
steps/locales
Some checks failed
/ arch (push) Successful in 2m56s
/ alpine (push) Successful in 1m57s
/ fedora (push) Successful in 12m8s
/ opensuse (push) Successful in 3m36s
/ alma (push) Successful in 12m35s
/ rocky (push) Successful in 12m59s
/ ubuntu (push) Successful in 6m41s
/ debian (push) Failing after 3m33s
2024-09-08 21:13:57 +02:00
39707ac621
task 2024-09-08 20:54:37 +02:00
6db5bcec5c
e 2024-09-08 20:53:43 +02:00
2696514c24
pm/install 2024-09-08 20:45:29 +02:00
126de92af4
ca/write 2024-09-08 20:33:43 +02:00
8797e27dad
ca/update 2024-09-08 20:31:35 +02:00
958fb45c09
ca/install 2024-09-08 19:52:24 +02:00
2 changed files with 83 additions and 81 deletions

View file

@ -240,6 +240,7 @@ Handle project workflows in a unified way:
* locales
* persist
* test
* workspace variable
#### Shell → Python

View file

@ -397,12 +397,12 @@ spcd_txt_get() {
esac
}
# ╭──────────
# │ s = step
# ╰──────────
# ╭─────────────────
# │ e = environment
# ╰─────────────────
# ╭───┬───────────╮
# │ s │ constants │
# │ e │ constants │
# ╰───┴───────────╯
SPCD_OS_ALMA="alma"
@ -420,9 +420,9 @@ SPCD_PM_DNF="dnf"
SPCD_PM_PACMAN="pacman"
SPCD_PM_ZYPPER="zypper"
# ╭───┬─────────────
# │ s │ environment
# ╰───┴─────────────
# ╭───┬───────────
# │ e │ functions
# ╰───┴───────────
spcd_step__environment_print() {
spcd_ca "list"
@ -836,10 +836,68 @@ spcd_python_pip() {
fi
}
# ╭───┬──────────────────────────────╮
# │ f │ ca = certificate authorities │
# ╰───┴──────────────────────────────╯
spcd_f_ca_install() {
spcd_step "Install package"
spcd_f_pm_pkg_install "ca-certificates"
}
spcd_f_ca_update() {
spcd_step "Update certificates"
case "${SPCD_OS_ID}" in
"${SPCD_OS_ARCH}" | \
"${SPCD_OS_ALMA}" | \
"${SPCD_OS_FEDORA}" | \
"${SPCD_OS_ROCKY}")
spcd_run update-ca-trust
;;
"${SPCD_OS_ALPINE}" | \
"${SPCD_OS_DEBIAN}" | \
"${SPCD_OS_OPENSUSE}" | \
"${SPCD_OS_UBUNTU}")
spcd_run update-ca-certificates
;;
*) ;;
esac
}
spcd_f_ca_write() {
spcd_step "Write certificates"
local root
case "${SPCD_OS_ID}" in
"${SPCD_OS_ALMA}" | "${SPCD_OS_FEDORA}" | "${SPCD_OS_ROCKY}")
root="/etc/pki/ca-trust/source/anchors"
;;
"${SPCD_OS_ALPINE}" | "${SPCD_OS_DEBIAN}" | "${SPCD_OS_UBUNTU}")
root="/usr/local/share/ca-certificates"
;;
"${SPCD_OS_ARCH}")
root="/etc/ca-certificates/trust-source/anchors"
;;
"${SPCD_OS_OPENSUSE}")
root="/etc/pki/trust/anchors"
;;
*) ;;
esac
spcd_os_mkdir "${root}"
spcd_ca "write" "${root}"
}
# ╭───┬──────────────────────╮
# │ 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 │
# ╰───┴────┴───────╯
@ -1112,6 +1170,10 @@ ${name}.${_SPCD_TXT_CHARSET} ${_SPCD_TXT_CHARSET}
esac
}
# ╭───┬──────╮
# │ s = step │
# ╰───┴──────╯
# ╭───┬─────╮
# │ s │ dns │
# ╰───┴─────╯
@ -1306,75 +1368,6 @@ Dir::Etc::SourceParts \"\";
esac
}
spcd_step__packages_install_tools() {
spcd_step "Install tools"
case "${SPCD_PM}" in
"${SPCD_PM_APT}") spcd_f_pm_pkg_install "apt-utils" ;;
*) ;;
esac
}
spcd_step__packages_install_locales() {
spcd_step_in "Locales"
spcd_step "Install"
spcd_f_txt_locales "install"
spcd_step "Set"
spcd_f_txt_locale "set" "${SPCD_TXT_LOCALE}"
spcd_step "Show"
spcd_f_txt_locale "show"
spcd_step_out
}
# ╭───┬────╮
# │ s │ ca │
# ╰───┴────╯
spcd_step__ca_install_package() {
spcd_step "Install package"
spcd_f_pm_pkg_install "ca-certificates"
}
spcd_step__ca_write_certificates() {
spcd_step "Write certificates"
local root
case "${SPCD_OS_ID}" in
"${SPCD_OS_ALMA}" | "${SPCD_OS_FEDORA}" | "${SPCD_OS_ROCKY}")
root="/etc/pki/ca-trust/source/anchors"
;;
"${SPCD_OS_ALPINE}" | "${SPCD_OS_DEBIAN}" | "${SPCD_OS_UBUNTU}")
root="/usr/local/share/ca-certificates"
;;
"${SPCD_OS_ARCH}")
root="/etc/ca-certificates/trust-source/anchors"
;;
"${SPCD_OS_OPENSUSE}")
root="/etc/pki/trust/anchors"
;;
*) ;;
esac
spcd_os_mkdir "${root}"
spcd_ca "write" "${root}"
}
spcd_step__ca_update_certificates() {
spcd_step "Update certificates"
case "${SPCD_OS_ID}" in
"${SPCD_OS_ARCH}" | \
"${SPCD_OS_ALMA}" | \
"${SPCD_OS_FEDORA}" | \
"${SPCD_OS_ROCKY}")
spcd_run update-ca-trust
;;
"${SPCD_OS_ALPINE}" | \
"${SPCD_OS_DEBIAN}" | \
"${SPCD_OS_OPENSUSE}" | \
"${SPCD_OS_UBUNTU}")
spcd_run update-ca-certificates
;;
*) ;;
esac
}
# ╭───┬──────────╮
# │ s │ packages │
# ╰───┴──────────╯
@ -1585,14 +1578,22 @@ spcd_main() {
spcd_step__packages_set_configuration
spcd_f_pm_https_trust
spcd_f_pm_pkg_update
spcd_step__packages_install_tools
spcd_step__packages_install_locales
spcd_f_pm_install
# locales
spcd_step_in "Locales"
spcd_step "Install"
spcd_f_txt_locales "install"
spcd_step "Set"
spcd_f_txt_locale "set" "${SPCD_TXT_LOCALE}"
spcd_step "Show"
spcd_f_txt_locale "show"
spcd_step_out
spcd_step_out
# ca
spcd_step_in "CA"
spcd_step__ca_install_package
spcd_step__ca_write_certificates
spcd_step__ca_update_certificates
spcd_f_ca_install
spcd_f_ca_write
spcd_f_ca_update
spcd_step_out
# packages
spcd_step_in "Packages"