Compare commits
44 commits
4e645dfc0c
...
5fcb208d0b
Author | SHA1 | Date | |
---|---|---|---|
5fcb208d0b | |||
4b7fb8a89f | |||
bc76b3f3b5 | |||
56c1e88ded | |||
2aff78913d | |||
ab1be3c78d | |||
a6e39413e4 | |||
2b0107035b | |||
040b1f03e4 | |||
e647554a48 | |||
261540d503 | |||
a8e8e29912 | |||
1fa2c9f34b | |||
516c18ca51 | |||
b3acd1f8fe | |||
dabb5814e5 | |||
cb250650ff | |||
8af733e5df | |||
de32d1ba2f | |||
217f1a1b73 | |||
088762f1ee | |||
1a5dcbf4d1 | |||
a2d668f740 | |||
712757e084 | |||
7a0ca145fb | |||
e040e3e474 | |||
b3f74c2664 | |||
363fa82bd8 | |||
2da608c462 | |||
8053d5f231 | |||
5928a2fdcc | |||
1c1a60bc64 | |||
d021f61997 | |||
164420d418 | |||
81db5ca397 | |||
f136bd1f07 | |||
19eee535c5 | |||
9972005755 | |||
dd1a9ed807 | |||
74e2335cdb | |||
c64014d617 | |||
1398431521 | |||
389f8cc737 | |||
11c144c7c3 |
3 changed files with 280 additions and 227 deletions
|
@ -217,11 +217,12 @@ Handle project workflows in a unified way:
|
||||||
|
|
||||||
* build instead of readme
|
* build instead of readme
|
||||||
* generate graphs
|
* generate graphs
|
||||||
* list CI behavior differences
|
* list behavior differences
|
||||||
|
* Continuous Integration platforms
|
||||||
|
* Operating Systems
|
||||||
|
|
||||||
#### Shell
|
#### Shell
|
||||||
|
|
||||||
* command to echo & run
|
|
||||||
* comment
|
* comment
|
||||||
* handle errors
|
* handle errors
|
||||||
* packages
|
* packages
|
||||||
|
@ -238,8 +239,6 @@ Handle project workflows in a unified way:
|
||||||
* disable & enable https
|
* disable & enable https
|
||||||
* locales
|
* locales
|
||||||
* persist
|
* persist
|
||||||
* restrict LC_* variables set for alpine
|
|
||||||
* test LC_* variables
|
|
||||||
* test
|
* test
|
||||||
|
|
||||||
#### Shell → Python
|
#### Shell → Python
|
||||||
|
|
27
spcd.sh
Executable file
27
spcd.sh
Executable 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
|
|
@ -1,8 +1,20 @@
|
||||||
#! /usr/bin/env sh
|
#! /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_HORIZONTAL="┬"
|
||||||
_SPCD_BOX_DOWN_AND_LEFT="╮"
|
_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_BOTTOM="${_SPCD_BOX_UP_AND_RIGHT}${_SPCD_BOX_LEFT}"
|
||||||
|
|
||||||
_spcd_frame_open() {
|
_spcd_frame_open() {
|
||||||
echo "${_SPCD_FRAME_TOP}${1}"
|
echo "${_SPCD_FRAME_TOP}${*}"
|
||||||
}
|
}
|
||||||
|
|
||||||
_spcd_frame_shut() {
|
_spcd_frame_shut() {
|
||||||
echo "${_SPCD_FRAME_BOTTOM}${1}"
|
echo "${_SPCD_FRAME_BOTTOM}${*}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# ╭───┬────╮
|
# ╭───┬────╮
|
||||||
|
@ -195,9 +207,9 @@ _spcd_txt_pick() {
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
# ╭───────────╮
|
# ╭────────────╮
|
||||||
# │ functions │
|
# │ p = public │
|
||||||
# ╰───────────╯
|
# ╰────────────╯
|
||||||
|
|
||||||
spcd_ca() {
|
spcd_ca() {
|
||||||
local grep="\(After\|Before\|Issuer\|Signature Algorithm\|Subject:\)"
|
local grep="\(After\|Before\|Issuer\|Signature Algorithm\|Subject:\)"
|
||||||
|
@ -247,9 +259,17 @@ nameserver ${value}
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# ╭───────────┬───────╮
|
spcd_run() {
|
||||||
# │ functions │ error │
|
if [ -n "${1}" ]; then
|
||||||
# ╰───────────┴───────╯
|
_spcd_frame_open "${@}"
|
||||||
|
"${@}"
|
||||||
|
_spcd_frame_shut "${@}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# ╭───┬───────╮
|
||||||
|
# │ p │ error │
|
||||||
|
# ╰───┴───────╯
|
||||||
|
|
||||||
spcd_error_ci() {
|
spcd_error_ci() {
|
||||||
echo "× CI: ${*}"
|
echo "× CI: ${*}"
|
||||||
|
@ -262,9 +282,9 @@ spcd_error_os() {
|
||||||
exit "${_SPCD_ERROR_OS}"
|
exit "${_SPCD_ERROR_OS}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# ╭───────────┬────╮
|
# ╭───┬────╮
|
||||||
# │ functions │ os │
|
# │ p │ os │
|
||||||
# ╰───────────┴────╯
|
# ╰───┴────╯
|
||||||
|
|
||||||
spcd_os_grep() {
|
spcd_os_grep() {
|
||||||
local variable="${1}"
|
local variable="${1}"
|
||||||
|
@ -329,17 +349,17 @@ spcd_os_write() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# ╭───────────┬───────╮
|
# ╭───┬───────╮
|
||||||
# │ functions │ split │
|
# │ p │ split │
|
||||||
# ╰───────────┴───────╯
|
# ╰───┴───────╯
|
||||||
|
|
||||||
spcd_split() {
|
spcd_split() {
|
||||||
echo "${_SPCD_RULE_LEFT}${_SPCD_RULE_MIDDLE}${_SPCD_RULE_RIGHT}"
|
echo "${_SPCD_RULE_LEFT}${_SPCD_RULE_MIDDLE}${_SPCD_RULE_RIGHT}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# ╭───────────┬──────╮
|
# ╭───┬──────╮
|
||||||
# │ functions │ step │
|
# │ p │ step │
|
||||||
# ╰───────────┴──────╯
|
# ╰───┴──────╯
|
||||||
|
|
||||||
spcd_step() {
|
spcd_step() {
|
||||||
if [ -n "${1}" ]; then
|
if [ -n "${1}" ]; then
|
||||||
|
@ -363,9 +383,9 @@ spcd_step_out() {
|
||||||
__SPCD_STEP_LEVEL=$((__SPCD_STEP_LEVEL - 1))
|
__SPCD_STEP_LEVEL=$((__SPCD_STEP_LEVEL - 1))
|
||||||
}
|
}
|
||||||
|
|
||||||
# ╭───────────┬─────╮
|
# ╭───┬─────╮
|
||||||
# │ functions │ txt │
|
# │ p │ txt │
|
||||||
# ╰───────────┴─────╯
|
# ╰───┴─────╯
|
||||||
|
|
||||||
SPCD_TXT_LOCALE_ENGLISH="en_US"
|
SPCD_TXT_LOCALE_ENGLISH="en_US"
|
||||||
SPCD_TXT_LOCALE_FRENCH="fr_FR"
|
SPCD_TXT_LOCALE_FRENCH="fr_FR"
|
||||||
|
@ -377,13 +397,13 @@ spcd_txt_get() {
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
# ╭──────╮
|
# ╭──────────╮
|
||||||
# │ step │
|
# │ s = step │
|
||||||
# ╰──────╯
|
# ╰──────────╯
|
||||||
|
|
||||||
# ╭──────┬───────────╮
|
# ╭───┬───────────╮
|
||||||
# │ step │ constants │
|
# │ s │ constants │
|
||||||
# ╰──────┴───────────╯
|
# ╰───┴───────────╯
|
||||||
|
|
||||||
SPCD_OS_ALMA="alma"
|
SPCD_OS_ALMA="alma"
|
||||||
SPCD_OS_ALPINE="alpine"
|
SPCD_OS_ALPINE="alpine"
|
||||||
|
@ -400,9 +420,9 @@ SPCD_PM_DNF="dnf"
|
||||||
SPCD_PM_PACMAN="pacman"
|
SPCD_PM_PACMAN="pacman"
|
||||||
SPCD_PM_ZYPPER="zypper"
|
SPCD_PM_ZYPPER="zypper"
|
||||||
|
|
||||||
# ╭──────┬─────────────╮
|
# ╭───┬─────────────╮
|
||||||
# │ step │ environment │
|
# │ s │ environment │
|
||||||
# ╰──────┴─────────────╯
|
# ╰───┴─────────────╯
|
||||||
|
|
||||||
spcd_step__environment_print() {
|
spcd_step__environment_print() {
|
||||||
spcd_ca "list"
|
spcd_ca "list"
|
||||||
|
@ -770,20 +790,9 @@ spcd_step__environment_list_workspace() {
|
||||||
spcd_os_ls "$(realpath .)"
|
spcd_os_ls "$(realpath .)"
|
||||||
}
|
}
|
||||||
|
|
||||||
# ╭──────┬───────────╮
|
# ╭──────────────╮
|
||||||
# │ step │ functions │
|
# │ f = function │
|
||||||
# ╰──────┴───────────╯
|
# ╰──────────────╯
|
||||||
|
|
||||||
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
|
|
||||||
}
|
|
||||||
|
|
||||||
spcd_git_clone() {
|
spcd_git_clone() {
|
||||||
if [ -n "${1}" ]; then
|
if [ -n "${1}" ]; then
|
||||||
|
@ -806,29 +815,6 @@ spcd_git_url() {
|
||||||
fi
|
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() {
|
spcd_python_ln() {
|
||||||
local command="${1}"
|
local command="${1}"
|
||||||
if [ -n "${command}" ]; then
|
if [ -n "${command}" ]; then
|
||||||
|
@ -850,17 +836,6 @@ spcd_python_pip() {
|
||||||
fi
|
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() {
|
spcd_txt_locale() {
|
||||||
local action="${1}"
|
local action="${1}"
|
||||||
local chosen="${2}"
|
local chosen="${2}"
|
||||||
|
@ -915,6 +890,37 @@ spcd_txt_locale() {
|
||||||
spcd_split
|
spcd_split
|
||||||
spcd_txt_locale "list"
|
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
|
esac
|
||||||
}
|
}
|
||||||
|
@ -932,7 +938,7 @@ spcd_txt_locales() {
|
||||||
spcd_split
|
spcd_split
|
||||||
case "${SPCD_PM}" in
|
case "${SPCD_PM}" in
|
||||||
"${SPCD_PM_APK}")
|
"${SPCD_PM_APK}")
|
||||||
spcd_install_package "musl-locales"
|
spcd_f_pm_install "musl-locales"
|
||||||
export MUSL_LOCPATH="/usr/share/i18n/locales/musl"
|
export MUSL_LOCPATH="/usr/share/i18n/locales/musl"
|
||||||
;;
|
;;
|
||||||
"${SPCD_PM_APT}")
|
"${SPCD_PM_APT}")
|
||||||
|
@ -943,17 +949,17 @@ ${name}.${_SPCD_TXT_CHARSET} ${_SPCD_TXT_CHARSET}
|
||||||
"
|
"
|
||||||
done
|
done
|
||||||
spcd_os_write "/etc/locale.gen" "${text}"
|
spcd_os_write "/etc/locale.gen" "${text}"
|
||||||
spcd_install_package "locales"
|
spcd_f_pm_install "locales"
|
||||||
;;
|
;;
|
||||||
"${SPCD_PM_DNF}")
|
"${SPCD_PM_DNF}")
|
||||||
local language
|
local language
|
||||||
for name in "${@}"; do
|
for name in "${@}"; do
|
||||||
language="$(echo "${name}" | cut -d _ -f 1)"
|
language="$(echo "${name}" | cut -d _ -f 1)"
|
||||||
spcd_install_package "glibc-langpack-${language}"
|
spcd_f_pm_install "glibc-langpack-${language}"
|
||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
"${SPCD_PM_PACMAN}") spcd_install_package "glibc-locales" ;;
|
"${SPCD_PM_PACMAN}") spcd_f_pm_install "glibc-locales" ;;
|
||||||
"${SPCD_PM_ZYPPER}") spcd_install_package "glibc-locale" ;;
|
"${SPCD_PM_ZYPPER}") spcd_f_pm_install "glibc-locale" ;;
|
||||||
*) ;;
|
*) ;;
|
||||||
esac
|
esac
|
||||||
spcd_split
|
spcd_split
|
||||||
|
@ -975,7 +981,7 @@ ${name}.${_SPCD_TXT_CHARSET} ${_SPCD_TXT_CHARSET}
|
||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
"list")
|
"list")
|
||||||
if ! locale --all-locales; then
|
if ! spcd_run locale --all-locales; then
|
||||||
echo "No locales yet!"
|
echo "No locales yet!"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
@ -983,18 +989,133 @@ ${name}.${_SPCD_TXT_CHARSET} ${_SPCD_TXT_CHARSET}
|
||||||
esac
|
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_step "DNS"
|
spcd_step "DNS"
|
||||||
spcd_dns "write"
|
spcd_dns "write"
|
||||||
}
|
}
|
||||||
|
|
||||||
# ╭──────┬──────────╮
|
# ╭───┬──────────╮
|
||||||
# │ step │ packages │
|
# │ s │ packages │
|
||||||
# ╰──────┴──────────╯
|
# ╰───┴──────────╯
|
||||||
|
|
||||||
spcd_step__packages_set_repositories() {
|
spcd_step__packages_set_repositories() {
|
||||||
spcd_step "Set repositories"
|
spcd_step "Set repositories"
|
||||||
|
@ -1167,60 +1288,20 @@ Dir::Etc::SourceParts \"\";
|
||||||
esac
|
esac
|
||||||
case "${SPCD_OS_ID}" in
|
case "${SPCD_OS_ID}" in
|
||||||
"${SPCD_OS_ARCH}")
|
"${SPCD_OS_ARCH}")
|
||||||
pacman-key --init
|
spcd_run pacman-key --init
|
||||||
;;
|
;;
|
||||||
"${SPCD_OS_DEBIAN}" | "${SPCD_OS_UBUNTU}")
|
"${SPCD_OS_DEBIAN}" | "${SPCD_OS_UBUNTU}")
|
||||||
export DEBIAN_FRONTEND="noninteractive"
|
export DEBIAN_FRONTEND="noninteractive"
|
||||||
|
spcd_os_printenv DEBIAN_FRONTEND
|
||||||
;;
|
;;
|
||||||
*) ;;
|
*) ;;
|
||||||
esac
|
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__packages_install_tools() {
|
||||||
spcd_step "Install tools"
|
spcd_step "Install tools"
|
||||||
case "${SPCD_PM}" in
|
case "${SPCD_PM}" in
|
||||||
"${SPCD_PM_APT}") spcd_install_package "apt-utils" ;;
|
"${SPCD_PM_APT}") spcd_f_pm_install "apt-utils" ;;
|
||||||
*) ;;
|
*) ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
@ -1231,51 +1312,18 @@ spcd_step__packages_install_locales() {
|
||||||
spcd_txt_locales "install"
|
spcd_txt_locales "install"
|
||||||
spcd_step "Set"
|
spcd_step "Set"
|
||||||
spcd_txt_locale "set" "${SPCD_TXT_LOCALE}"
|
spcd_txt_locale "set" "${SPCD_TXT_LOCALE}"
|
||||||
spcd_step "Test"
|
spcd_step "Show"
|
||||||
# CTYPE
|
spcd_txt_locale "show"
|
||||||
# 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_out
|
spcd_step_out
|
||||||
}
|
}
|
||||||
|
|
||||||
# ╭──────┬────╮
|
# ╭───┬────╮
|
||||||
# │ step │ ca │
|
# │ s │ ca │
|
||||||
# ╰──────┴────╯
|
# ╰───┴────╯
|
||||||
|
|
||||||
spcd_step__ca_install_package() {
|
spcd_step__ca_install_package() {
|
||||||
spcd_step "Install package"
|
spcd_step "Install package"
|
||||||
spcd_install_package "ca-certificates"
|
spcd_f_pm_install "ca-certificates"
|
||||||
}
|
}
|
||||||
|
|
||||||
spcd_step__ca_write_certificates() {
|
spcd_step__ca_write_certificates() {
|
||||||
|
@ -1307,60 +1355,39 @@ spcd_step__ca_update_certificates() {
|
||||||
"${SPCD_OS_ALMA}" | \
|
"${SPCD_OS_ALMA}" | \
|
||||||
"${SPCD_OS_FEDORA}" | \
|
"${SPCD_OS_FEDORA}" | \
|
||||||
"${SPCD_OS_ROCKY}")
|
"${SPCD_OS_ROCKY}")
|
||||||
update-ca-trust
|
spcd_run update-ca-trust
|
||||||
;;
|
;;
|
||||||
"${SPCD_OS_ALPINE}" | \
|
"${SPCD_OS_ALPINE}" | \
|
||||||
"${SPCD_OS_DEBIAN}" | \
|
"${SPCD_OS_DEBIAN}" | \
|
||||||
"${SPCD_OS_OPENSUSE}" | \
|
"${SPCD_OS_OPENSUSE}" | \
|
||||||
"${SPCD_OS_UBUNTU}")
|
"${SPCD_OS_UBUNTU}")
|
||||||
update-ca-certificates
|
spcd_run update-ca-certificates
|
||||||
;;
|
;;
|
||||||
*) ;;
|
*) ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
# ╭──────┬──────────╮
|
# ╭───┬──────────╮
|
||||||
# │ step │ packages │
|
# │ s │ 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
|
|
||||||
}
|
|
||||||
|
|
||||||
spcd_step__packages_install_dos2unix() {
|
spcd_step__packages_install_dos2unix() {
|
||||||
spcd_step "Install dos2unix"
|
spcd_step "Install dos2unix"
|
||||||
spcd_install_package "dos2unix"
|
spcd_f_pm_install "dos2unix"
|
||||||
}
|
}
|
||||||
|
|
||||||
spcd_step__packages_install_git() {
|
spcd_step__packages_install_git() {
|
||||||
spcd_step "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__python_install() {
|
||||||
spcd_step "Install package"
|
spcd_step "Install package"
|
||||||
spcd_install_package "${SPCD_PYTHON_PACKAGE}"
|
spcd_f_pm_install "${SPCD_PYTHON_PACKAGE}"
|
||||||
spcd_step "Link alias to command"
|
spcd_step "Link alias to command"
|
||||||
spcd_python_ln "${SPCD_PYTHON_COMMAND}"
|
spcd_python_ln "${SPCD_PYTHON_COMMAND}"
|
||||||
# venv
|
# venv
|
||||||
|
@ -1368,7 +1395,7 @@ spcd_step__python_install() {
|
||||||
spcd_step "Install package"
|
spcd_step "Install package"
|
||||||
case "${SPCD_OS_ID}" in
|
case "${SPCD_OS_ID}" in
|
||||||
"${SPCD_OS_DEBIAN}" | "${SPCD_OS_UBUNTU}")
|
"${SPCD_OS_DEBIAN}" | "${SPCD_OS_UBUNTU}")
|
||||||
spcd_install_package "python3-venv"
|
spcd_f_pm_install "python3-venv"
|
||||||
;;
|
;;
|
||||||
*) ;;
|
*) ;;
|
||||||
esac
|
esac
|
||||||
|
@ -1418,7 +1445,7 @@ spcd_step__install_packages() {
|
||||||
spcd_step "EPEL"
|
spcd_step "EPEL"
|
||||||
case "${SPCD_OS_ID}" in
|
case "${SPCD_OS_ID}" in
|
||||||
"${SPCD_OS_ALMA}" | "${SPCD_OS_ROCKY}")
|
"${SPCD_OS_ALMA}" | "${SPCD_OS_ROCKY}")
|
||||||
spcd_install_package "epel-release"
|
spcd_f_pm_install "epel-release"
|
||||||
case "${SPCD_OS_VERSION}" in
|
case "${SPCD_OS_VERSION}" in
|
||||||
"9")
|
"9")
|
||||||
set -- \
|
set -- \
|
||||||
|
@ -1450,32 +1477,32 @@ spcd_step__install_packages() {
|
||||||
esac
|
esac
|
||||||
# graphviz
|
# graphviz
|
||||||
spcd_step "GraphViz"
|
spcd_step "GraphViz"
|
||||||
spcd_install_package "graphviz"
|
spcd_f_pm_install "graphviz"
|
||||||
# openssh
|
# openssh
|
||||||
spcd_step "OpenSSH"
|
spcd_step "OpenSSH"
|
||||||
case "${SPCD_PM}" in
|
case "${SPCD_PM}" in
|
||||||
"${SPCD_PM_APK}" | "${SPCD_PM_APT}")
|
"${SPCD_PM_APK}" | "${SPCD_PM_APT}")
|
||||||
spcd_install_package "openssh-client"
|
spcd_f_pm_install "openssh-client"
|
||||||
;;
|
;;
|
||||||
"${SPCD_PM_DNF}" | "${SPCD_PM_ZYPPER}")
|
"${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
|
esac
|
||||||
# plantuml
|
# plantuml
|
||||||
spcd_step "PlantUML"
|
spcd_step "PlantUML"
|
||||||
spcd_install_package "plantuml"
|
spcd_f_pm_install "plantuml"
|
||||||
# rsync
|
# rsync
|
||||||
spcd_step "Rsync"
|
spcd_step "Rsync"
|
||||||
spcd_install_package "rsync"
|
spcd_f_pm_install "rsync"
|
||||||
# shell check
|
# shell check
|
||||||
spcd_step "ShellCheck"
|
spcd_step "ShellCheck"
|
||||||
case "${SPCD_PM}" in
|
case "${SPCD_PM}" in
|
||||||
"${SPCD_PM_DNF}" | "${SPCD_PM_ZYPPER}")
|
"${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
|
esac
|
||||||
# shfmt
|
# shfmt
|
||||||
spcd_step "ShellFormat"
|
spcd_step "ShellFormat"
|
||||||
|
@ -1484,10 +1511,10 @@ spcd_step__install_packages() {
|
||||||
"${SPCD_OS_DEBIAN}")
|
"${SPCD_OS_DEBIAN}")
|
||||||
case "${SPCD_OS_VERSION}" in
|
case "${SPCD_OS_VERSION}" in
|
||||||
"bullseye") ;;
|
"bullseye") ;;
|
||||||
*) spcd_install_package "shfmt" ;;
|
*) spcd_f_pm_install "shfmt" ;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
*) spcd_install_package "shfmt" ;;
|
*) spcd_f_pm_install "shfmt" ;;
|
||||||
esac
|
esac
|
||||||
spcd_step_out
|
spcd_step_out
|
||||||
}
|
}
|
||||||
|
@ -1548,8 +1575,8 @@ spcd_main() {
|
||||||
spcd_step_in "Packages"
|
spcd_step_in "Packages"
|
||||||
spcd_step__packages_set_repositories
|
spcd_step__packages_set_repositories
|
||||||
spcd_step__packages_set_configuration
|
spcd_step__packages_set_configuration
|
||||||
spcd_step__packages_trust_https
|
spcd_f_pm_https_trust
|
||||||
spcd_step__packages_update_catalog
|
spcd_f_pm_update
|
||||||
spcd_step__packages_install_tools
|
spcd_step__packages_install_tools
|
||||||
spcd_step__packages_install_locales
|
spcd_step__packages_install_locales
|
||||||
spcd_step_out
|
spcd_step_out
|
||||||
|
@ -1561,9 +1588,9 @@ spcd_main() {
|
||||||
spcd_step_out
|
spcd_step_out
|
||||||
# packages
|
# packages
|
||||||
spcd_step_in "Packages"
|
spcd_step_in "Packages"
|
||||||
spcd_step__packages_verify_https
|
spcd_f_pm_https_verify
|
||||||
spcd_step__packages_update_catalog
|
spcd_f_pm_update
|
||||||
spcd_step__packages_upgrade_system
|
spcd_f_pm_upgrade
|
||||||
spcd_step__packages_install_dos2unix
|
spcd_step__packages_install_dos2unix
|
||||||
spcd_step__packages_install_git
|
spcd_step__packages_install_git
|
||||||
spcd_step_out
|
spcd_step_out
|
||||||
|
|
Loading…
Reference in a new issue