Compare commits

...

2 commits

Author SHA1 Message Date
d7142f2b1d
banner → bar
Some checks failed
/ arch (push) Successful in 2m56s
/ alpine (push) Successful in 2m7s
/ fedora (push) Successful in 14m54s
/ opensuse (push) Successful in 5m23s
/ alma (push) Successful in 13m3s
/ rocky (push) Successful in 23m26s
/ ubuntu (push) Successful in 7m15s
/ debian (push) Failing after 5m32s
2024-09-10 12:38:10 +02:00
03829cc4b4
rpm/fusion 2024-09-10 10:14:22 +02:00
2 changed files with 59 additions and 58 deletions

View file

@ -285,6 +285,7 @@ Handle project workflows in a unified way:
* automate versions fetching * automate versions fetching
* gource, xvfb, xauth * gource, xvfb, xauth
* handle openh264 repositories * handle openh264 repositories
* rpm fusion
* tex * tex
* translate to french * translate to french
* try to support nix * try to support nix

View file

@ -4,9 +4,9 @@
# │ __ = internal │ # │ __ = internal │
# ╰───────────────╯ # ╰───────────────╯
# __SPCD_BANNER_TOP # __SPCD_BAR_TOP
# __SPCD_BANNER_MIDDLE # __SPCD_BAR_MIDDLE
# __SPCD_BANNER_BOTTOM # __SPCD_BAR_BOTTOM
# __SPCD_STEP_LEVEL # __SPCD_STEP_LEVEL
# __SPCD_STEP_level_INDEX # __SPCD_STEP_level_INDEX
@ -36,35 +36,35 @@ _spcd_fill() {
done done
} }
# ╭───┬──────── # ╭───┬─────
# │ _ │ banner │ # │ _ │ bar │
# ╰───┴──────── # ╰───┴─────
_SPCD_BANNER_BOTTOM_LEFT="${_SPCD_BOX_UP_AND_RIGHT}" _SPCD_BAR_BOTTOM_LEFT="${_SPCD_BOX_UP_AND_RIGHT}"
_SPCD_BANNER_BOTTOM_MIDDLE="${_SPCD_BOX_UP_AND_HORIZONTAL}" _SPCD_BAR_BOTTOM_MIDDLE="${_SPCD_BOX_UP_AND_HORIZONTAL}"
_SPCD_BANNER_BOTTOM_RIGHT="${_SPCD_BOX_UP_AND_LEFT}" _SPCD_BAR_BOTTOM_RIGHT="${_SPCD_BOX_UP_AND_LEFT}"
_SPCD_BANNER_HORIZONTAL="${_SPCD_BOX_HORIZONTAL}" _SPCD_BAR_HORIZONTAL="${_SPCD_BOX_HORIZONTAL}"
_SPCD_BANNER_TOP_LEFT="${_SPCD_BOX_DOWN_AND_RIGHT}" _SPCD_BAR_TOP_LEFT="${_SPCD_BOX_DOWN_AND_RIGHT}"
_SPCD_BANNER_TOP_MIDDLE="${_SPCD_BOX_DOWN_AND_HORIZONTAL}" _SPCD_BAR_TOP_MIDDLE="${_SPCD_BOX_DOWN_AND_HORIZONTAL}"
_SPCD_BANNER_TOP_RIGHT="${_SPCD_BOX_DOWN_AND_LEFT}" _SPCD_BAR_TOP_RIGHT="${_SPCD_BOX_DOWN_AND_LEFT}"
_SPCD_BANNER_VERTICAL="${_SPCD_BOX_VERTICAL}" _SPCD_BAR_VERTICAL="${_SPCD_BOX_VERTICAL}"
_spcd_banner_add() { _spcd_bar_add() {
if [ -n "${1}" ]; then if [ -n "${1}" ]; then
local text length filler local text length filler
text=" ${1} " text=" ${1} "
length=${#text} length=${#text}
filler="$(_spcd_fill "${length}" "${_SPCD_BANNER_HORIZONTAL}")" filler="$(_spcd_fill "${length}" "${_SPCD_BAR_HORIZONTAL}")"
if [ -n "${__SPCD_BANNER_MIDDLE}" ]; then if [ -n "${__SPCD_BAR_MIDDLE}" ]; then
_spcd_banner_split _spcd_bar_split
else else
_spcd_banner_open _spcd_bar_open
fi fi
_spcd_banner_append "${filler}" "${text}" "${filler}" _spcd_bar_append "${filler}" "${text}" "${filler}"
fi fi
} }
_spcd_banner_add_index() { _spcd_bar_add_index() {
local level value label local level value label
while true; do while true; do
level=$((level + 1)) level=$((level + 1))
@ -76,68 +76,68 @@ _spcd_banner_add_index() {
label="${value}" label="${value}"
fi fi
done done
_spcd_banner_add "${label}" _spcd_bar_add "${label}"
} }
_spcd_banner_append() { _spcd_bar_append() {
if [ -n "${3}" ]; then if [ -n "${3}" ]; then
__SPCD_BANNER_TOP="${__SPCD_BANNER_TOP}${1}" __SPCD_BAR_TOP="${__SPCD_BAR_TOP}${1}"
__SPCD_BANNER_MIDDLE="${__SPCD_BANNER_MIDDLE}${2}" __SPCD_BAR_MIDDLE="${__SPCD_BAR_MIDDLE}${2}"
__SPCD_BANNER_BOTTOM="${__SPCD_BANNER_BOTTOM}${3}" __SPCD_BAR_BOTTOM="${__SPCD_BAR_BOTTOM}${3}"
fi fi
} }
_spcd_banner_echo() { _spcd_bar_echo() {
echo "\ echo "\
${__SPCD_BANNER_TOP} ${__SPCD_BAR_TOP}
${__SPCD_BANNER_MIDDLE} ${__SPCD_BAR_MIDDLE}
${__SPCD_BANNER_BOTTOM}" ${__SPCD_BAR_BOTTOM}"
} }
_spcd_banner_open() { _spcd_bar_open() {
_spcd_banner_append \ _spcd_bar_append \
"${_SPCD_BANNER_TOP_LEFT}" \ "${_SPCD_BAR_TOP_LEFT}" \
"${_SPCD_BANNER_VERTICAL}" \ "${_SPCD_BAR_VERTICAL}" \
"${_SPCD_BANNER_BOTTOM_LEFT}" "${_SPCD_BAR_BOTTOM_LEFT}"
} }
_spcd_banner_render() { _spcd_bar_render() {
_spcd_banner_wipe _spcd_bar_wipe
_spcd_banner_add "S" _spcd_bar_add "S"
_spcd_banner_add_index _spcd_bar_add_index
# #
local level value local level 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}\""
[ -n "${value}" ] || break [ -n "${value}" ] || break
_spcd_banner_add "${value}" _spcd_bar_add "${value}"
done done
# #
_spcd_banner_shut _spcd_bar_shut
_spcd_banner_echo _spcd_bar_echo
_spcd_banner_wipe _spcd_bar_wipe
} }
_spcd_banner_shut() { _spcd_bar_shut() {
_spcd_banner_append \ _spcd_bar_append \
"${_SPCD_BANNER_TOP_RIGHT}" \ "${_SPCD_BAR_TOP_RIGHT}" \
"${_SPCD_BANNER_VERTICAL}" \ "${_SPCD_BAR_VERTICAL}" \
"${_SPCD_BANNER_BOTTOM_RIGHT}" "${_SPCD_BAR_BOTTOM_RIGHT}"
} }
_spcd_banner_split() { _spcd_bar_split() {
_spcd_banner_append \ _spcd_bar_append \
"${_SPCD_BANNER_TOP_MIDDLE}" \ "${_SPCD_BAR_TOP_MIDDLE}" \
"${_SPCD_BANNER_VERTICAL}" \ "${_SPCD_BAR_VERTICAL}" \
"${_SPCD_BANNER_BOTTOM_MIDDLE}" "${_SPCD_BAR_BOTTOM_MIDDLE}"
} }
_spcd_banner_wipe() { _spcd_bar_wipe() {
unset \ unset \
__SPCD_BANNER_TOP \ __SPCD_BAR_TOP \
__SPCD_BANNER_MIDDLE \ __SPCD_BAR_MIDDLE \
__SPCD_BANNER_BOTTOM __SPCD_BAR_BOTTOM
} }
# ╭───┬───────╮ # ╭───┬───────╮
@ -320,7 +320,7 @@ spcd_step() {
local index="${prefix}_INDEX" local index="${prefix}_INDEX"
eval "${index}=\$((${index} + 1))" eval "${index}=\$((${index} + 1))"
eval "${prefix}_LABEL=\"${1}\"" eval "${prefix}_LABEL=\"${1}\""
_spcd_banner_render _spcd_bar_render
fi fi
} }