Compare commits
No commits in common. "ab655c52d9a72f9417e0e14a479cd1feb4e67d22" and "a29e296c4e5b967c9addc43b8d41178365b3957e" have entirely different histories.
ab655c52d9
...
a29e296c4e
2 changed files with 48 additions and 86 deletions
16
readme.md
16
readme.md
|
@ -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 |
|
| SPCD_URL_PYTHON | Python repository URL | https://pypi.org/simple |
|
||||||
| 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,14 +222,9 @@ Handle project workflows in a unified way:
|
||||||
#### Shell
|
#### Shell
|
||||||
|
|
||||||
* comment
|
* comment
|
||||||
* display locales
|
* drawing characters constants
|
||||||
* default
|
|
||||||
* available
|
|
||||||
* effective
|
|
||||||
* selected
|
|
||||||
* available
|
|
||||||
* effective
|
|
||||||
* handle errors
|
* handle errors
|
||||||
|
* local variables
|
||||||
* packages
|
* packages
|
||||||
* configure
|
* configure
|
||||||
* apk
|
* apk
|
||||||
|
@ -239,11 +234,7 @@ 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
|
||||||
|
|
||||||
|
@ -287,6 +278,5 @@ 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
|
||||||
|
|
|
@ -4,16 +4,6 @@
|
||||||
# │ _ │
|
# │ _ │
|
||||||
# ╰───╯
|
# ╰───╯
|
||||||
|
|
||||||
_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() {
|
||||||
|
@ -28,14 +18,14 @@ _spcd_fill() {
|
||||||
# │ _ │ banner │
|
# │ _ │ banner │
|
||||||
# ╰───┴────────╯
|
# ╰───┴────────╯
|
||||||
|
|
||||||
_SPCD_BANNER_BOTTOM_LEFT="${_SPCD_BOX_UP_AND_RIGHT}"
|
_SPCD_BANNER_DOWN_AND_HORIZONTAL="┬"
|
||||||
_SPCD_BANNER_BOTTOM_MIDDLE="${_SPCD_BOX_UP_AND_HORIZONTAL}"
|
_SPCD_BANNER_DOWN_AND_LEFT="╮"
|
||||||
_SPCD_BANNER_BOTTOM_RIGHT="${_SPCD_BOX_UP_AND_LEFT}"
|
_SPCD_BANNER_DOWN_AND_RIGHT="╭"
|
||||||
_SPCD_BANNER_HORIZONTAL="${_SPCD_BOX_HORIZONTAL}"
|
_SPCD_BANNER_HORIZONTAL="─"
|
||||||
_SPCD_BANNER_TOP_LEFT="${_SPCD_BOX_DOWN_AND_RIGHT}"
|
_SPCD_BANNER_UP_AND_HORIZONTAL="┴"
|
||||||
_SPCD_BANNER_TOP_MIDDLE="${_SPCD_BOX_DOWN_AND_HORIZONTAL}"
|
_SPCD_BANNER_UP_AND_LEFT="╯"
|
||||||
_SPCD_BANNER_TOP_RIGHT="${_SPCD_BOX_DOWN_AND_LEFT}"
|
_SPCD_BANNER_UP_AND_RIGHT="╰"
|
||||||
_SPCD_BANNER_VERTICAL="${_SPCD_BOX_VERTICAL}"
|
_SPCD_BANNER_VERTICAL="│"
|
||||||
|
|
||||||
_spcd_banner_add() {
|
_spcd_banner_add() {
|
||||||
if [ -n "${1}" ]; then
|
if [ -n "${1}" ]; then
|
||||||
|
@ -53,7 +43,9 @@ _spcd_banner_add() {
|
||||||
}
|
}
|
||||||
|
|
||||||
_spcd_banner_add_index() {
|
_spcd_banner_add_index() {
|
||||||
local level value label
|
local 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}\""
|
||||||
|
@ -84,9 +76,9 @@ ${__SPCD_BANNER_BOTTOM}"
|
||||||
|
|
||||||
_spcd_banner_open() {
|
_spcd_banner_open() {
|
||||||
_spcd_banner_append \
|
_spcd_banner_append \
|
||||||
"${_SPCD_BANNER_TOP_LEFT}" \
|
"${_SPCD_BANNER_DOWN_AND_RIGHT}" \
|
||||||
"${_SPCD_BANNER_VERTICAL}" \
|
"${_SPCD_BANNER_VERTICAL}" \
|
||||||
"${_SPCD_BANNER_BOTTOM_LEFT}"
|
"${_SPCD_BANNER_UP_AND_RIGHT}"
|
||||||
}
|
}
|
||||||
|
|
||||||
_spcd_banner_render() {
|
_spcd_banner_render() {
|
||||||
|
@ -94,7 +86,8 @@ _spcd_banner_render() {
|
||||||
_spcd_banner_add "S"
|
_spcd_banner_add "S"
|
||||||
_spcd_banner_add_index
|
_spcd_banner_add_index
|
||||||
#
|
#
|
||||||
local level value
|
local level
|
||||||
|
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}\""
|
||||||
|
@ -109,16 +102,16 @@ _spcd_banner_render() {
|
||||||
|
|
||||||
_spcd_banner_shut() {
|
_spcd_banner_shut() {
|
||||||
_spcd_banner_append \
|
_spcd_banner_append \
|
||||||
"${_SPCD_BANNER_TOP_RIGHT}" \
|
"${_SPCD_BANNER_DOWN_AND_LEFT}" \
|
||||||
"${_SPCD_BANNER_VERTICAL}" \
|
"${_SPCD_BANNER_VERTICAL}" \
|
||||||
"${_SPCD_BANNER_BOTTOM_RIGHT}"
|
"${_SPCD_BANNER_UP_AND_LEFT}"
|
||||||
}
|
}
|
||||||
|
|
||||||
_spcd_banner_split() {
|
_spcd_banner_split() {
|
||||||
_spcd_banner_append \
|
_spcd_banner_append \
|
||||||
"${_SPCD_BANNER_TOP_MIDDLE}" \
|
"${_SPCD_BANNER_DOWN_AND_HORIZONTAL}" \
|
||||||
"${_SPCD_BANNER_VERTICAL}" \
|
"${_SPCD_BANNER_VERTICAL}" \
|
||||||
"${_SPCD_BANNER_BOTTOM_MIDDLE}"
|
"${_SPCD_BANNER_UP_AND_HORIZONTAL}"
|
||||||
}
|
}
|
||||||
|
|
||||||
_spcd_banner_wipe() {
|
_spcd_banner_wipe() {
|
||||||
|
@ -139,8 +132,8 @@ _SPCD_ERROR_OS=2
|
||||||
# │ _ │ frame │
|
# │ _ │ frame │
|
||||||
# ╰───┴───────╯
|
# ╰───┴───────╯
|
||||||
|
|
||||||
_SPCD_FRAME_TOP="${_SPCD_BOX_DOWN_AND_RIGHT}${_SPCD_BOX_LEFT}"
|
_SPCD_FRAME_TOP="╭╴"
|
||||||
_SPCD_FRAME_BOTTOM="${_SPCD_BOX_UP_AND_RIGHT}${_SPCD_BOX_LEFT}"
|
_SPCD_FRAME_BOTTOM="╰╴"
|
||||||
|
|
||||||
_spcd_frame_open() {
|
_spcd_frame_open() {
|
||||||
echo "${_SPCD_FRAME_TOP}${1}"
|
echo "${_SPCD_FRAME_TOP}${1}"
|
||||||
|
@ -222,8 +215,7 @@ 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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -254,7 +246,8 @@ spcd_os_mkdir() {
|
||||||
|
|
||||||
spcd_os_printenv() {
|
spcd_os_printenv() {
|
||||||
if [ -n "${1}" ]; then
|
if [ -n "${1}" ]; then
|
||||||
local name text
|
local name
|
||||||
|
local text
|
||||||
for name in "${@}"; do
|
for name in "${@}"; do
|
||||||
eval "text=\"\${${name}}\""
|
eval "text=\"\${${name}}\""
|
||||||
echo "${name} = \"${text}\""
|
echo "${name} = \"${text}\""
|
||||||
|
@ -343,7 +336,9 @@ spcd_txt_get() {
|
||||||
}
|
}
|
||||||
|
|
||||||
spcd_txt_locale() {
|
spcd_txt_locale() {
|
||||||
local value name
|
# LANGUAGE
|
||||||
|
local name
|
||||||
|
local value
|
||||||
if [ -n "${1}" ]; then
|
if [ -n "${1}" ]; then
|
||||||
value="${1}"
|
value="${1}"
|
||||||
else
|
else
|
||||||
|
@ -369,43 +364,6 @@ 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 │
|
||||||
# ╰──────╯
|
# ╰──────╯
|
||||||
|
@ -454,7 +412,9 @@ spcd_step__environment_defaults_print() {
|
||||||
"URL_PYTHON" \
|
"URL_PYTHON" \
|
||||||
"URL_ROCKY" \
|
"URL_ROCKY" \
|
||||||
"URL_UBUNTU"
|
"URL_UBUNTU"
|
||||||
local item name value
|
local item
|
||||||
|
local name
|
||||||
|
local value
|
||||||
for item in "${@}"; do
|
for item in "${@}"; do
|
||||||
name="SPCD_${item}"
|
name="SPCD_${item}"
|
||||||
eval "value=\"\${${name}}\""
|
eval "value=\"\${${name}}\""
|
||||||
|
@ -1214,20 +1174,32 @@ 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}")
|
||||||
spcd_txt_locales "locale.gen"
|
local locale text
|
||||||
|
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}")
|
||||||
spcd_txt_locales "glibc-langpack-"
|
local locale language
|
||||||
|
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}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue