Compare commits

...

12 commits

Author SHA1 Message Date
ab655c52d9
readme/tasks
Some checks failed
/ arch (push) Successful in 2m51s
/ alpine (push) Successful in 1m56s
/ fedora (push) Successful in 12m48s
/ opensuse (push) Successful in 3m22s
/ alma (push) Successful in 11m57s
/ rocky (push) Successful in 13m9s
/ ubuntu (push) Successful in 6m51s
/ debian (push) Failing after 3m21s
2024-09-01 19:04:16 +02:00
5324148136
spcd_txt_locales 2024-09-01 19:01:54 +02:00
7fc27c2733
tasks/locales 2024-09-01 18:47:27 +02:00
d23e61da49
variables 2024-09-01 17:32:01 +02:00
d9f4ea7e25
local/names 2024-09-01 17:01:00 +02:00
29a33e5787
x509/grep 2024-09-01 16:53:44 +02:00
fbe85048a7
later/tex 2024-09-01 16:10:17 +02:00
14d65d902a
readme 2024-09-01 16:09:07 +02:00
cb52cf2488
frame 2024-09-01 16:08:51 +02:00
0c312ed03c
banner 2024-09-01 16:05:17 +02:00
f6bba57159
box constants 2024-09-01 15:56:18 +02:00
861f89c060
readme/fixes 2024-09-01 02:58:26 +02:00
2 changed files with 86 additions and 48 deletions

View file

@ -142,7 +142,7 @@ Handle project workflows in a unified way:
| SPCD_URL_EPEL | EPEL repository URL | https://dl.fedoraproject.org | | SPCD_URL_EPEL | EPEL repository URL | https://dl.fedoraproject.org |
| SPCD_URL_FEDORA | Fedora repository URL | https://rpmfind.net | | SPCD_URL_FEDORA | Fedora repository URL | https://rpmfind.net |
| SPCD_URL_OPENSUSE | OpenSUSE repository URL | https://download.opensuse.org | | SPCD_URL_OPENSUSE | OpenSUSE repository URL | https://download.opensuse.org |
| SPCD_URL_PYTHON | Python repository URL | https://pypi.org/simple | | SPCD_URL_PYTHON | Python repository URL | https://pypi.org |
| SPCD_URL_ROCKY | Rocky repository URL | https://dl.rockylinux.org | | SPCD_URL_ROCKY | Rocky repository URL | https://dl.rockylinux.org |
| SPCD_URL_UBUNTU | Ubuntu repository URL | https://ubuntu.mirrors.ovh.net | | SPCD_URL_UBUNTU | Ubuntu repository URL | https://ubuntu.mirrors.ovh.net |
@ -222,9 +222,14 @@ Handle project workflows in a unified way:
#### Shell #### Shell
* comment * comment
* drawing characters constants * display locales
* default
* available
* effective
* selected
* available
* effective
* handle errors * handle errors
* local variables
* packages * packages
* configure * configure
* apk * apk
@ -234,7 +239,11 @@ Handle project workflows in a unified way:
* opensuse * opensuse
* codecs repository * codecs repository
* disable & enable https * disable & enable https
* persist locales
* test * test
* variables
* CA_n
* DNS_n
#### Shell → Python #### Shell → Python
@ -278,5 +287,6 @@ Handle project workflows in a unified way:
* automate versions fetching * automate versions fetching
* handle openh264 repositories * handle openh264 repositories
* tex
* translate to french * translate to french
* try to support nix * try to support nix

View file

@ -4,6 +4,16 @@
# │ _ │ # │ _ │
# ╰───╯ # ╰───╯
_SPCD_BOX_DOWN_AND_HORIZONTAL="┬"
_SPCD_BOX_DOWN_AND_LEFT="╮"
_SPCD_BOX_DOWN_AND_RIGHT="╭"
_SPCD_BOX_HORIZONTAL="─"
_SPCD_BOX_LEFT="╴"
_SPCD_BOX_UP_AND_HORIZONTAL="┴"
_SPCD_BOX_UP_AND_LEFT="╯"
_SPCD_BOX_UP_AND_RIGHT="╰"
_SPCD_BOX_VERTICAL="│"
_SPCD_CMD_SUM="sha512sum" _SPCD_CMD_SUM="sha512sum"
_spcd_fill() { _spcd_fill() {
@ -18,14 +28,14 @@ _spcd_fill() {
# │ _ │ banner │ # │ _ │ banner │
# ╰───┴────────╯ # ╰───┴────────╯
_SPCD_BANNER_DOWN_AND_HORIZONTAL="┬" _SPCD_BANNER_BOTTOM_LEFT="${_SPCD_BOX_UP_AND_RIGHT}"
_SPCD_BANNER_DOWN_AND_LEFT="╮" _SPCD_BANNER_BOTTOM_MIDDLE="${_SPCD_BOX_UP_AND_HORIZONTAL}"
_SPCD_BANNER_DOWN_AND_RIGHT="╭" _SPCD_BANNER_BOTTOM_RIGHT="${_SPCD_BOX_UP_AND_LEFT}"
_SPCD_BANNER_HORIZONTAL="" _SPCD_BANNER_HORIZONTAL="${_SPCD_BOX_HORIZONTAL}"
_SPCD_BANNER_UP_AND_HORIZONTAL="┴" _SPCD_BANNER_TOP_LEFT="${_SPCD_BOX_DOWN_AND_RIGHT}"
_SPCD_BANNER_UP_AND_LEFT="╯" _SPCD_BANNER_TOP_MIDDLE="${_SPCD_BOX_DOWN_AND_HORIZONTAL}"
_SPCD_BANNER_UP_AND_RIGHT="╰" _SPCD_BANNER_TOP_RIGHT="${_SPCD_BOX_DOWN_AND_LEFT}"
_SPCD_BANNER_VERTICAL="" _SPCD_BANNER_VERTICAL="${_SPCD_BOX_VERTICAL}"
_spcd_banner_add() { _spcd_banner_add() {
if [ -n "${1}" ]; then if [ -n "${1}" ]; then
@ -43,9 +53,7 @@ _spcd_banner_add() {
} }
_spcd_banner_add_index() { _spcd_banner_add_index() {
local label local level value label
local level
local value
while true; do while true; do
level=$((level + 1)) level=$((level + 1))
eval "value=\"\${__SPCD_STEP_${level}_INDEX}\"" eval "value=\"\${__SPCD_STEP_${level}_INDEX}\""
@ -76,9 +84,9 @@ ${__SPCD_BANNER_BOTTOM}"
_spcd_banner_open() { _spcd_banner_open() {
_spcd_banner_append \ _spcd_banner_append \
"${_SPCD_BANNER_DOWN_AND_RIGHT}" \ "${_SPCD_BANNER_TOP_LEFT}" \
"${_SPCD_BANNER_VERTICAL}" \ "${_SPCD_BANNER_VERTICAL}" \
"${_SPCD_BANNER_UP_AND_RIGHT}" "${_SPCD_BANNER_BOTTOM_LEFT}"
} }
_spcd_banner_render() { _spcd_banner_render() {
@ -86,8 +94,7 @@ _spcd_banner_render() {
_spcd_banner_add "S" _spcd_banner_add "S"
_spcd_banner_add_index _spcd_banner_add_index
# #
local level local level value
local value
while true; do while true; do
level=$((level + 1)) level=$((level + 1))
eval "value=\"\${__SPCD_STEP_${level}_LABEL}\"" eval "value=\"\${__SPCD_STEP_${level}_LABEL}\""
@ -102,16 +109,16 @@ _spcd_banner_render() {
_spcd_banner_shut() { _spcd_banner_shut() {
_spcd_banner_append \ _spcd_banner_append \
"${_SPCD_BANNER_DOWN_AND_LEFT}" \ "${_SPCD_BANNER_TOP_RIGHT}" \
"${_SPCD_BANNER_VERTICAL}" \ "${_SPCD_BANNER_VERTICAL}" \
"${_SPCD_BANNER_UP_AND_LEFT}" "${_SPCD_BANNER_BOTTOM_RIGHT}"
} }
_spcd_banner_split() { _spcd_banner_split() {
_spcd_banner_append \ _spcd_banner_append \
"${_SPCD_BANNER_DOWN_AND_HORIZONTAL}" \ "${_SPCD_BANNER_TOP_MIDDLE}" \
"${_SPCD_BANNER_VERTICAL}" \ "${_SPCD_BANNER_VERTICAL}" \
"${_SPCD_BANNER_UP_AND_HORIZONTAL}" "${_SPCD_BANNER_BOTTOM_MIDDLE}"
} }
_spcd_banner_wipe() { _spcd_banner_wipe() {
@ -132,8 +139,8 @@ _SPCD_ERROR_OS=2
# │ _ │ frame │ # │ _ │ frame │
# ╰───┴───────╯ # ╰───┴───────╯
_SPCD_FRAME_TOP="╭╴" _SPCD_FRAME_TOP="${_SPCD_BOX_DOWN_AND_RIGHT}${_SPCD_BOX_LEFT}"
_SPCD_FRAME_BOTTOM="╰╴" _SPCD_FRAME_BOTTOM="${_SPCD_BOX_UP_AND_RIGHT}${_SPCD_BOX_LEFT}"
_spcd_frame_open() { _spcd_frame_open() {
echo "${_SPCD_FRAME_TOP}${1}" echo "${_SPCD_FRAME_TOP}${1}"
@ -215,7 +222,8 @@ spcd_openssl_x509() {
if [ -f "${1}" ]; then if [ -f "${1}" ]; then
openssl x509 \ openssl x509 \
-in "${1}" \ -in "${1}" \
-noout -text -noout -text |
grep "\(After\|Before\|Issuer\|Signature A\|Subject:\)"
fi fi
} }
@ -246,8 +254,7 @@ spcd_os_mkdir() {
spcd_os_printenv() { spcd_os_printenv() {
if [ -n "${1}" ]; then if [ -n "${1}" ]; then
local name local name text
local text
for name in "${@}"; do for name in "${@}"; do
eval "text=\"\${${name}}\"" eval "text=\"\${${name}}\""
echo "${name} = \"${text}\"" echo "${name} = \"${text}\""
@ -336,9 +343,7 @@ spcd_txt_get() {
} }
spcd_txt_locale() { spcd_txt_locale() {
# LANGUAGE local value name
local name
local value
if [ -n "${1}" ]; then if [ -n "${1}" ]; then
value="${1}" value="${1}"
else else
@ -364,6 +369,43 @@ spcd_txt_locale() {
done done
} }
spcd_txt_locales() {
set -- \
"${SPCD_TXT_LOCALE_ENGLISH}" \
"${SPCD_TXT_LOCALE_FRENCH}"
local locale
case "${1}" in
"glibc-langpack-")
local language
for locale in "${@}"; do
language="$(echo "${locale}" | cut -d _ -f 1)"
spcd_install_package "glibc-langpack-${language}"
done
;;
"LANGUAGE")
local text
for locale in "${@}"; do
if [ -n "${text}" ]; then
text="${text}:${locale}"
else
text="${locale}"
fi
done
export LANGUAGE="${text}"
;;
"locale.gen")
local text
for locale in "${@}"; do
text="${text}\
${locale}.${_SPCD_TXT_CHARSET} ${_SPCD_TXT_CHARSET}
"
done
spcd_os_write "/etc/locale.gen" "${text}"
;;
*) ;;
esac
}
# ╭──────╮ # ╭──────╮
# │ step │ # │ step │
# ╰──────╯ # ╰──────╯
@ -412,9 +454,7 @@ spcd_step__environment_defaults_print() {
"URL_PYTHON" \ "URL_PYTHON" \
"URL_ROCKY" \ "URL_ROCKY" \
"URL_UBUNTU" "URL_UBUNTU"
local item local item name value
local name
local value
for item in "${@}"; do for item in "${@}"; do
name="SPCD_${item}" name="SPCD_${item}"
eval "value=\"\${${name}}\"" eval "value=\"\${${name}}\""
@ -1174,32 +1214,20 @@ spcd_step__packages_verify_https() {
spcd_step__packages_install_locales() { spcd_step__packages_install_locales() {
spcd_step "Install locales" spcd_step "Install locales"
set -- \
"${SPCD_TXT_LOCALE_ENGLISH}" \
"${SPCD_TXT_LOCALE_FRENCH}"
case "${SPCD_PM}" in case "${SPCD_PM}" in
"${SPCD_PM_APK}") spcd_install_package "musl-locales" ;; "${SPCD_PM_APK}") spcd_install_package "musl-locales" ;;
"${SPCD_PM_APT}") "${SPCD_PM_APT}")
local locale text spcd_txt_locales "locale.gen"
for locale in "${@}"; do
text="${text}\
${locale}.${_SPCD_TXT_CHARSET} ${_SPCD_TXT_CHARSET}
"
done
spcd_os_write "/etc/locale.gen" "${text}"
spcd_install_package "locales" spcd_install_package "locales"
;; ;;
"${SPCD_PM_DNF}") "${SPCD_PM_DNF}")
local locale language spcd_txt_locales "glibc-langpack-"
for locale in "${@}"; do
language="$(echo "${locale}" | cut -d _ -f 1)"
spcd_install_package "glibc-langpack-${language}"
done
;; ;;
"${SPCD_PM_PACMAN}") spcd_install_package "glibc-locales" ;; "${SPCD_PM_PACMAN}") spcd_install_package "glibc-locales" ;;
"${SPCD_PM_ZYPPER}") spcd_install_package "glibc-locale" ;; "${SPCD_PM_ZYPPER}") spcd_install_package "glibc-locale" ;;
*) ;; *) ;;
esac esac
spcd_txt_locales "LANGUAGE"
spcd_txt_locale "${SPCD_TXT_LOCALE}" spcd_txt_locale "${SPCD_TXT_LOCALE}"
} }