Compare commits

..

44 commits

Author SHA1 Message Date
5fcb208d0b
spcd.sh
Some checks failed
/ arch (push) Failing after 8s
/ alpine (push) Failing after 7s
/ fedora (push) Failing after 6s
/ debian (push) Failing after 7s
/ opensuse (push) Failing after 7s
/ ubuntu (push) Failing after 6s
/ alma (push) Failing after 7s
/ rocky (push) Failing after 6s
2024-09-08 02:22:18 +02:00
4b7fb8a89f
mv
Some checks failed
/ arch (push) Successful in 2m51s
/ alpine (push) Successful in 1m56s
/ fedora (push) Successful in 12m1s
/ opensuse (push) Successful in 3m36s
/ alma (push) Successful in 12m34s
/ rocky (push) Successful in 13m59s
/ ubuntu (push) Successful in 6m26s
/ debian (push) Failing after 3m38s
2024-09-07 13:24:58 +02:00
bc76b3f3b5
f/pm/https 2024-09-07 13:24:10 +02:00
56c1e88ded
mv 2024-09-07 13:21:04 +02:00
2aff78913d
https/trust 2024-09-07 13:20:19 +02:00
ab1be3c78d
mv 2024-09-07 13:19:05 +02:00
a6e39413e4
https/verify 2024-09-07 13:17:54 +02:00
2b0107035b
https/path 2024-09-07 13:13:55 +02:00
040b1f03e4
mv 2024-09-07 12:34:08 +02:00
e647554a48
pm/update 2024-09-07 12:33:09 +02:00
261540d503
mv 2024-09-07 12:31:12 +02:00
a8e8e29912
pm/upgrade 2024-09-07 12:30:36 +02:00
1fa2c9f34b
spcd_run 2024-09-07 12:26:18 +02:00
516c18ca51
pm/query 2024-09-07 12:22:03 +02:00
b3acd1f8fe
pm/install 2024-09-07 12:21:30 +02:00
dabb5814e5
pm/https 2024-09-07 12:19:16 +02:00
cb250650ff
pm/clean 2024-09-07 12:13:10 +02:00
8af733e5df
f 2024-09-07 11:01:40 +02:00
de32d1ba2f
pkg/clean 2024-09-07 10:45:07 +02:00
217f1a1b73
pkg/https 2024-09-07 10:43:45 +02:00
088762f1ee
pkg/install 2024-09-07 10:41:59 +02:00
1a5dcbf4d1
pkg/query 2024-09-07 10:41:11 +02:00
a2d668f740
e 2024-09-07 10:40:22 +02:00
712757e084
show/print 2024-09-07 10:06:35 +02:00
7a0ca145fb
__ 2024-09-07 07:57:56 +02:00
e040e3e474
_ 2024-09-07 07:50:13 +02:00
b3f74c2664
s 2024-09-07 07:48:35 +02:00
363fa82bd8
pass 2024-09-07 07:45:39 +02:00
2da608c462
tasks/behaviors 2024-09-07 00:50:54 +02:00
8053d5f231
−task 2024-09-07 00:44:16 +02:00
5928a2fdcc
eval/open,shut
Some checks failed
/ arch (push) Successful in 2m55s
/ alpine (push) Successful in 1m52s
/ fedora (push) Successful in 12m33s
/ opensuse (push) Successful in 3m53s
/ alma (push) Successful in 12m56s
/ rocky (push) Successful in 14m24s
/ ubuntu (push) Successful in 5m47s
/ debian (push) Failing after 3m31s
2024-09-07 00:42:17 +02:00
1c1a60bc64
frame/* 2024-09-07 00:40:10 +02:00
d021f61997
−eval 2024-09-07 00:38:09 +02:00
164420d418
eval/locales
Some checks failed
/ arch (push) Successful in 2m57s
/ alpine (push) Successful in 2m24s
/ fedora (push) Successful in 7m59s
/ debian (push) Failing after 5m20s
/ opensuse (push) Successful in 2m54s
/ ubuntu (push) Successful in 11m0s
/ rocky (push) Blocked by required conditions
/ alma (push) Has been cancelled
2024-09-07 00:04:42 +02:00
81db5ca397
eval/pacman-key,update 2024-09-06 23:54:37 +02:00
f136bd1f07
eval/update-ca,upgrade 2024-09-06 23:52:24 +02:00
19eee535c5
eval/clean,install 2024-09-06 23:49:23 +02:00
9972005755
spcd_eval 2024-09-06 23:47:00 +02:00
dd1a9ed807
tasks/−restrict 2024-09-06 22:31:42 +02:00
74e2335cdb
monetary/alpine
Some checks failed
/ arch (push) Successful in 3m43s
/ alpine (push) Successful in 1m58s
/ fedora (push) Successful in 12m57s
/ opensuse (push) Failing after 2m57s
/ alma (push) Successful in 12m33s
/ rocky (push) Successful in 13m17s
/ ubuntu (push) Successful in 7m12s
/ debian (push) Failing after 3m41s
2024-09-06 22:22:14 +02:00
c64014d617
unset regex
Some checks failed
/ arch (push) Successful in 2m43s
/ alpine (push) Failing after 10s
/ fedora (push) Successful in 12m45s
/ opensuse (push) Successful in 3m38s
/ ubuntu (push) Blocked by required conditions
/ debian (push) Blocked by required conditions
/ rocky (push) Has been cancelled
/ alma (push) Has been cancelled
2024-09-06 21:43:02 +02:00
1398431521
indent 2024-09-06 21:40:28 +02:00
389f8cc737
locale/debug
Some checks failed
/ arch (push) Failing after 20s
/ alpine (push) Failing after 8s
/ fedora (push) Failing after 1m9s
/ opensuse (push) Failing after 45s
/ alma (push) Failing after 30s
/ rocky (push) Failing after 39s
/ ubuntu (push) Failing after 16s
/ debian (push) Failing after 15s
2024-09-06 21:22:46 +02:00
11c144c7c3
locale/show 2024-09-06 21:20:13 +02:00
3 changed files with 280 additions and 227 deletions

View file

@ -217,11 +217,12 @@ Handle project workflows in a unified way:
* build instead of readme
* generate graphs
* list CI behavior differences
* list behavior differences
* Continuous Integration platforms
* Operating Systems
#### Shell
* command to echo & run
* comment
* handle errors
* packages
@ -238,8 +239,6 @@ Handle project workflows in a unified way:
* disable & enable https
* locales
* persist
* restrict LC_* variables set for alpine
* test LC_* variables
* test
#### Shell → Python

27
spcd.sh Executable file
View file

@ -0,0 +1,27 @@
#! /usr/bin/env sh
gource \
--auto-skip-seconds 1 \
--date-format "%Y / %m / %d ⋅ %H : %M : %S" \
--disable-progress \
-f \
--hide mouse,usernames \
--highlight-dirs \
--key \
--output-framerate 60 \
--seconds-per-day 2.0 \
--output-ppm-stream - \
| \
ffmpeg \
-codec:v ppm \
-format image2pipe \
-framerate 120 \
-i - \
-codec:v libx264 \
-preset veryslow \
-qp 23 \
-movflags \
+faststart \
-pix_fmt yuv420p \
-y \
spcd.mp4

View file

@ -1,8 +1,20 @@
#! /usr/bin/env sh
# ╭───╮
# │ _ │
# ╰───╯
# ╭───────────────╮
# │ __ = internal │
# ╰───────────────╯
# __SPCD_BANNER_TOP
# __SPCD_BANNER_MIDDLE
# __SPCD_BANNER_BOTTOM
# __SPCD_STEP_LEVEL
# __SPCD_STEP_level_INDEX
# __SPCD_STEP_level_LABEL
# ╭─────────────╮
# │ _ = private │
# ╰─────────────╯
_SPCD_BOX_DOWN_AND_HORIZONTAL="┬"
_SPCD_BOX_DOWN_AND_LEFT="╮"
@ -143,11 +155,11 @@ _SPCD_FRAME_TOP="${_SPCD_BOX_DOWN_AND_RIGHT}${_SPCD_BOX_LEFT}"
_SPCD_FRAME_BOTTOM="${_SPCD_BOX_UP_AND_RIGHT}${_SPCD_BOX_LEFT}"
_spcd_frame_open() {
echo "${_SPCD_FRAME_TOP}${1}"
echo "${_SPCD_FRAME_TOP}${*}"
}
_spcd_frame_shut() {
echo "${_SPCD_FRAME_BOTTOM}${1}"
echo "${_SPCD_FRAME_BOTTOM}${*}"
}
# ╭───┬────╮
@ -195,9 +207,9 @@ _spcd_txt_pick() {
esac
}
# ╭───────────
# │ functions
# ╰───────────
# ╭───────────
# │ p = public
# ╰───────────
spcd_ca() {
local grep="\(After\|Before\|Issuer\|Signature Algorithm\|Subject:\)"
@ -247,9 +259,17 @@ nameserver ${value}
fi
}
# ╭───────────┬───────╮
# │ functions │ error │
# ╰───────────┴───────╯
spcd_run() {
if [ -n "${1}" ]; then
_spcd_frame_open "${@}"
"${@}"
_spcd_frame_shut "${@}"
fi
}
# ╭───┬───────╮
# │ p │ error │
# ╰───┴───────╯
spcd_error_ci() {
echo "× CI: ${*}"
@ -262,9 +282,9 @@ spcd_error_os() {
exit "${_SPCD_ERROR_OS}"
}
# ╭───────────┬────╮
# │ functions │ os │
# ╰───────────┴────╯
# ╭───┬────╮
# │ p │ os │
# ╰───┴────╯
spcd_os_grep() {
local variable="${1}"
@ -329,17 +349,17 @@ spcd_os_write() {
fi
}
# ╭───────────┬───────╮
# │ functions │ split │
# ╰───────────┴───────╯
# ╭───┬───────╮
# │ p │ split │
# ╰───┴───────╯
spcd_split() {
echo "${_SPCD_RULE_LEFT}${_SPCD_RULE_MIDDLE}${_SPCD_RULE_RIGHT}"
}
# ╭───────────┬──────╮
# │ functions │ step │
# ╰───────────┴──────╯
# ╭───┬──────╮
# │ p │ step │
# ╰───┴──────╯
spcd_step() {
if [ -n "${1}" ]; then
@ -363,9 +383,9 @@ spcd_step_out() {
__SPCD_STEP_LEVEL=$((__SPCD_STEP_LEVEL - 1))
}
# ╭───────────┬─────╮
# │ functions │ txt │
# ╰───────────┴─────╯
# ╭───┬─────╮
# │ p │ txt │
# ╰───┴─────╯
SPCD_TXT_LOCALE_ENGLISH="en_US"
SPCD_TXT_LOCALE_FRENCH="fr_FR"
@ -377,13 +397,13 @@ spcd_txt_get() {
esac
}
# ╭──────
# │ step │
# ╰──────
# ╭──────────
# │ s = step │
# ╰──────────
# ╭──────┬───────────╮
# │ step │ constants │
# ╰──────┴───────────╯
# ╭───┬───────────╮
# │ s │ constants │
# ╰───┴───────────╯
SPCD_OS_ALMA="alma"
SPCD_OS_ALPINE="alpine"
@ -400,9 +420,9 @@ SPCD_PM_DNF="dnf"
SPCD_PM_PACMAN="pacman"
SPCD_PM_ZYPPER="zypper"
# ╭──────┬─────────────╮
# │ step │ environment │
# ╰──────┴─────────────╯
# ╭───┬─────────────╮
# │ s │ environment │
# ╰───┴─────────────╯
spcd_step__environment_print() {
spcd_ca "list"
@ -770,20 +790,9 @@ spcd_step__environment_list_workspace() {
spcd_os_ls "$(realpath .)"
}
# ╭──────┬───────────╮
# │ step │ functions │
# ╰──────┴───────────╯
spcd_clean_cache() {
case "${SPCD_PM}" in
"${SPCD_PM_APK}") apk cache purge ;;
"${SPCD_PM_APT}") apt-get clean ;;
"${SPCD_PM_DNF}") dnf clean all ;;
"${SPCD_PM_PACMAN}") pacman --sync --clean --noconfirm ;;
"${SPCD_PM_ZYPPER}") zypper clean ;;
*) ;;
esac
}
# ╭──────────────╮
# │ f = function │
# ╰──────────────╯
spcd_git_clone() {
if [ -n "${1}" ]; then
@ -806,29 +815,6 @@ spcd_git_url() {
fi
}
spcd_https_path() {
case "${SPCD_PM}" in
"${SPCD_PM_APK}") echo "/etc/apk/repositories.d/https" ;;
"${SPCD_PM_APT}") echo "/etc/apt/apt.conf.d/https" ;;
"${SPCD_PM_DNF}") echo "/etc/dnf/dnf.conf.d/https.conf" ;;
"${SPCD_PM_PACMAN}") echo "/etc/pacman.d/https.conf" ;;
"${SPCD_PM_ZYPPER}") ;;
*) ;;
esac
}
spcd_install_package() {
case "${SPCD_PM}" in
"${SPCD_PM_APK}") apk add "${1}" ;;
"${SPCD_PM_APT}") apt-get install --assume-yes "${1}" ;;
"${SPCD_PM_DNF}") dnf install --assumeyes "${1}" ;;
"${SPCD_PM_PACMAN}") pacman --sync --noconfirm "${1}" ;;
"${SPCD_PM_ZYPPER}") zypper --non-interactive install "${1}" ;;
*) ;;
esac
spcd_clean_cache
}
spcd_python_ln() {
local command="${1}"
if [ -n "${command}" ]; then
@ -850,17 +836,6 @@ spcd_python_pip() {
fi
}
spcd_query_package() {
case "${SPCD_PM}" in
"${SPCD_PM_APK}") apk info "${1}" ;;
"${SPCD_PM_APT}") dpkg-query --show "${1}" ;;
"${SPCD_PM_DNF}") rpm --query "${1}" ;;
"${SPCD_PM_PACMAN}") pacman --query "${1}" ;;
"${SPCD_PM_ZYPPER}") rpm --query "${1}" ;;
*) ;;
esac
}
spcd_txt_locale() {
local action="${1}"
local chosen="${2}"
@ -915,6 +890,37 @@ spcd_txt_locale() {
spcd_split
spcd_txt_locale "list"
;;
"show")
local regex
for name in "${@}"; do
unset regex
case "${name}" in
# LC_CTYPE
"LC_NUMERIC") regex="^\(decimal\|thousands\|grouping\)" ;;
"LC_TIME") regex="^\(day\|mon\)" ;;
# LC_COLLATE
"LC_MONETARY")
case "${SPCD_OS_ID}" in
"${SPCD_OS_ALPINE}") ;;
*) regex="^\(int_curr\|currency\|mon_\)" ;;
esac
;;
"LC_MESSAGES") regex="^\(yes\|no\)" ;;
"LC_PAPER") regex="^\(height\|width\)" ;;
"LC_NAME") regex="^name_m" ;;
"LC_ADDRESS") regex="^\(country\|lang\)_name" ;;
"LC_TELEPHONE") regex="^int_" ;;
"LC_MEASUREMENT") regex="^measurement=" ;;
"LC_IDENTIFICATION") regex="^\(language\|territory\|title\)" ;;
*) ;;
esac
spcd_split
spcd_os_printenv "${name}"
if [ -n "${regex}" ]; then
locale --keyword-name "${name}" | grep "${regex}"
fi
done
;;
*) ;;
esac
}
@ -932,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}")
@ -943,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
@ -975,7 +981,7 @@ ${name}.${_SPCD_TXT_CHARSET} ${_SPCD_TXT_CHARSET}
done
;;
"list")
if ! locale --all-locales; then
if ! spcd_run locale --all-locales; then
echo "No locales yet!"
fi
;;
@ -983,18 +989,133 @@ ${name}.${_SPCD_TXT_CHARSET} ${_SPCD_TXT_CHARSET}
esac
}
# ╭──────┬─────╮
# │ step │ dns │
# ╰──────┴─────╯
# ╭───┬────╮
# │ f │ pm │
# ╰───┴────╯
spcd_f_pm_clean() {
case "${SPCD_PM}" in
"${SPCD_PM_APK}") spcd_run apk cache purge ;;
"${SPCD_PM_APT}") spcd_run apt-get clean ;;
"${SPCD_PM_DNF}") spcd_run dnf clean all ;;
"${SPCD_PM_PACMAN}") spcd_run pacman --sync --clean --noconfirm ;;
"${SPCD_PM_ZYPPER}") spcd_run zypper clean ;;
*) ;;
esac
}
spcd_f_pm_install() {
case "${SPCD_PM}" in
"${SPCD_PM_APK}") spcd_run apk add "${1}" ;;
"${SPCD_PM_APT}") spcd_run apt-get install --assume-yes "${1}" ;;
"${SPCD_PM_DNF}") spcd_run dnf install --assumeyes "${1}" ;;
"${SPCD_PM_PACMAN}") spcd_run pacman --sync --noconfirm "${1}" ;;
"${SPCD_PM_ZYPPER}") spcd_run zypper --non-interactive install "${1}" ;;
*) ;;
esac
spcd_f_pm_clean
}
spcd_f_pm_query() {
case "${SPCD_PM}" in
"${SPCD_PM_APK}") apk info "${1}" ;;
"${SPCD_PM_APT}") dpkg-query --show "${1}" ;;
"${SPCD_PM_DNF}") rpm --query "${1}" ;;
"${SPCD_PM_PACMAN}") pacman --query "${1}" ;;
"${SPCD_PM_ZYPPER}") rpm --query "${1}" ;;
*) ;;
esac
}
spcd_f_pm_update() {
spcd_step "Update"
case "${SPCD_PM}" in
"${SPCD_PM_APK}") spcd_run apk update ;;
"${SPCD_PM_APT}") spcd_run apt-get update ;;
"${SPCD_PM_DNF}") spcd_run dnf makecache ;;
"${SPCD_PM_PACMAN}") spcd_run pacman --sync --refresh ;;
"${SPCD_PM_ZYPPER}") spcd_run zypper refresh ;;
*) ;;
esac
}
spcd_f_pm_upgrade() {
spcd_step "Upgrade"
case "${SPCD_PM}" in
"${SPCD_PM_APK}") spcd_run apk upgrade ;;
"${SPCD_PM_APT}") spcd_run apt-get upgrade --assume-yes ;;
"${SPCD_PM_DNF}") spcd_run dnf upgrade --assumeyes ;;
"${SPCD_PM_PACMAN}") spcd_run pacman --sync --sysupgrade --noconfirm ;;
"${SPCD_PM_ZYPPER}") spcd_run zypper --non-interactive update ;;
*) ;;
esac
}
# ╭───┬────┬───────╮
# │ f │ pm │ https │
# ╰───┴────┴───────╯
spcd_f_pm_https_path() {
case "${SPCD_PM}" in
"${SPCD_PM_APK}") echo "/etc/apk/repositories.d/https" ;;
"${SPCD_PM_APT}") echo "/etc/apt/apt.conf.d/https" ;;
"${SPCD_PM_DNF}") echo "/etc/dnf/dnf.conf.d/https.conf" ;;
"${SPCD_PM_PACMAN}") echo "/etc/pacman.d/https.conf" ;;
"${SPCD_PM_ZYPPER}") ;;
*) ;;
esac
}
spcd_f_pm_https_trust() {
spcd_step "Trust"
local path text
if [ -n "${SPCD_CA_1}" ] || [ "${SPCD_PM}" = "${SPCD_PM_APT}" ]; then
path="$(spcd_f_pm_https_path)"
if [ -n "${path}" ]; then
spcd_os_mkdir "$(dirname "${path}")"
case "${SPCD_PM}" in
"${SPCD_PM_APK}") text="\
--no-verify
" ;;
"${SPCD_PM_APT}") text="\
Acquire::https::Verify-Peer False;
" ;;
"${SPCD_PM_DNF}") text="\
sslverify=False
" ;;
"${SPCD_PM_PACMAN}") text="\
SSLVerify = No
" ;;
"${SPCD_PM_ZYPPER}") ;;
*) ;;
esac
[ -n "${text}" ] &&
spcd_os_write "${path}" "${text}"
fi
fi
}
spcd_f_pm_https_verify() {
spcd_step "Verify"
local path
path="$(spcd_f_pm_https_path)"
if [ -n "${path}" ]; then
spcd_os_rm "${path}"
fi
}
# ╭───┬─────╮
# │ s │ dns │
# ╰───┴─────╯
spcd_step__dns() {
spcd_step "DNS"
spcd_dns "write"
}
# ╭──────┬──────────╮
# │ step │ packages │
# ╰──────┴──────────╯
# ╭───┬──────────╮
# │ s │ packages │
# ╰───┴──────────╯
spcd_step__packages_set_repositories() {
spcd_step "Set repositories"
@ -1167,60 +1288,20 @@ Dir::Etc::SourceParts \"\";
esac
case "${SPCD_OS_ID}" in
"${SPCD_OS_ARCH}")
pacman-key --init
spcd_run pacman-key --init
;;
"${SPCD_OS_DEBIAN}" | "${SPCD_OS_UBUNTU}")
export DEBIAN_FRONTEND="noninteractive"
spcd_os_printenv DEBIAN_FRONTEND
;;
*) ;;
esac
}
spcd_step__packages_trust_https() {
spcd_step "Trust HTTPS"
local path text
if [ -n "${SPCD_CA_1}" ] || [ "${SPCD_PM}" = "${SPCD_PM_APT}" ]; then
path="$(spcd_https_path)"
if [ -n "${path}" ]; then
spcd_os_mkdir "$(dirname "${path}")"
case "${SPCD_PM}" in
"${SPCD_PM_APK}") text="\
--no-verify
" ;;
"${SPCD_PM_APT}") text="\
Acquire::https::Verify-Peer False;
" ;;
"${SPCD_PM_DNF}") text="\
sslverify=False
" ;;
"${SPCD_PM_PACMAN}") text="\
SSLVerify = No
" ;;
"${SPCD_PM_ZYPPER}") ;;
*) ;;
esac
[ -n "${text}" ] &&
spcd_os_write "${path}" "${text}"
fi
fi
}
spcd_step__packages_update_catalog() {
spcd_step "Update catalog"
case "${SPCD_PM}" in
"${SPCD_PM_APK}") apk update ;;
"${SPCD_PM_APT}") apt-get update ;;
"${SPCD_PM_DNF}") dnf makecache ;;
"${SPCD_PM_PACMAN}") pacman --sync --refresh ;;
"${SPCD_PM_ZYPPER}") zypper refresh ;;
*) ;;
esac
}
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
}
@ -1231,51 +1312,18 @@ spcd_step__packages_install_locales() {
spcd_txt_locales "install"
spcd_step "Set"
spcd_txt_locale "set" "${SPCD_TXT_LOCALE}"
spcd_step "Test"
# CTYPE
# NUMERIC
spcd_split
locale --keyword-name LC_NUMERIC | grep "^\(decimal\|thousands\|grouping\)"
# TIME
spcd_split
locale --keyword-name LC_TIME | grep "^\(day\|mon\)"
# COLLATE
# MONETARY
spcd_split
locale --keyword-name LC_MONETARY | grep "^\(int_curr\|currency\|mon_\)"
# MESSAGES
spcd_split
locale --keyword-name LC_MESSAGES | grep "^\(yes\|no\)"
#
# PAPER
spcd_split
locale --keyword-name LC_PAPER | grep "^\(height\|width\)"
# NAME
spcd_split
locale --keyword-name LC_NAME | grep "^name_m"
# ADDRESS
spcd_split
locale --keyword-name LC_ADDRESS | grep "^\(country\|lang\)_name"
# TELEPHONE
spcd_split
locale --keyword-name LC_TELEPHONE | grep "^int_"
# MEASUREMENT
spcd_split
locale --keyword-name LC_MEASUREMENT | grep "^measurement="
# IDENTIFICATION
spcd_split
locale --keyword-name LC_IDENTIFICATION |
grep "^\(language\|territory\|title\)"
spcd_step "Show"
spcd_txt_locale "show"
spcd_step_out
}
# ╭──────┬────╮
# │ step │ ca │
# ╰──────┴────╯
# ╭───┬────╮
# │ s │ ca │
# ╰───┴────╯
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() {
@ -1307,60 +1355,39 @@ spcd_step__ca_update_certificates() {
"${SPCD_OS_ALMA}" | \
"${SPCD_OS_FEDORA}" | \
"${SPCD_OS_ROCKY}")
update-ca-trust
spcd_run update-ca-trust
;;
"${SPCD_OS_ALPINE}" | \
"${SPCD_OS_DEBIAN}" | \
"${SPCD_OS_OPENSUSE}" | \
"${SPCD_OS_UBUNTU}")
update-ca-certificates
spcd_run update-ca-certificates
;;
*) ;;
esac
}
# ╭──────┬──────────╮
# │ step │ packages │
# ╰──────┴──────────╯
spcd_step__packages_verify_https() {
spcd_step "Verify HTTPS"
local path
path="$(spcd_https_path)"
if [ -n "${path}" ]; then
spcd_os_rm "${path}"
fi
}
spcd_step__packages_upgrade_system() {
spcd_step "Upgrade system"
case "${SPCD_PM}" in
"${SPCD_PM_APK}") apk upgrade ;;
"${SPCD_PM_APT}") apt-get upgrade --assume-yes ;;
"${SPCD_PM_DNF}") dnf upgrade --assumeyes ;;
"${SPCD_PM_PACMAN}") pacman --sync --sysupgrade --noconfirm ;;
"${SPCD_PM_ZYPPER}") zypper --non-interactive update ;;
*) ;;
esac
}
# ╭───┬──────────╮
# │ s │ packages │
# ╰───┴──────────╯
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"
}
# ╭──────┬────────╮
# │ step │ python │
# ╰──────┴────────╯
# ╭───┬────────╮
# │ s │ python │
# ╰───┴────────╯
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
@ -1368,7 +1395,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
@ -1418,7 +1445,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 -- \
@ -1450,32 +1477,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"
@ -1484,10 +1511,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
}
@ -1548,8 +1575,8 @@ spcd_main() {
spcd_step_in "Packages"
spcd_step__packages_set_repositories
spcd_step__packages_set_configuration
spcd_step__packages_trust_https
spcd_step__packages_update_catalog
spcd_f_pm_https_trust
spcd_f_pm_update
spcd_step__packages_install_tools
spcd_step__packages_install_locales
spcd_step_out
@ -1561,9 +1588,9 @@ spcd_main() {
spcd_step_out
# packages
spcd_step_in "Packages"
spcd_step__packages_verify_https
spcd_step__packages_update_catalog
spcd_step__packages_upgrade_system
spcd_f_pm_https_verify
spcd_f_pm_update
spcd_f_pm_upgrade
spcd_step__packages_install_dos2unix
spcd_step__packages_install_git
spcd_step_out