Compare commits
29 commits
5928a2fdcc
...
4b7fb8a89f
Author | SHA1 | Date | |
---|---|---|---|
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 |
2 changed files with 211 additions and 190 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
|
||||||
|
|
|
@ -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="╮"
|
||||||
|
@ -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,7 +259,7 @@ nameserver ${value}
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
spcd_eval() {
|
spcd_run() {
|
||||||
if [ -n "${1}" ]; then
|
if [ -n "${1}" ]; then
|
||||||
_spcd_frame_open "${@}"
|
_spcd_frame_open "${@}"
|
||||||
"${@}"
|
"${@}"
|
||||||
|
@ -255,9 +267,9 @@ spcd_eval() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# ╭───────────┬───────╮
|
# ╭───┬───────╮
|
||||||
# │ functions │ error │
|
# │ p │ error │
|
||||||
# ╰───────────┴───────╯
|
# ╰───┴───────╯
|
||||||
|
|
||||||
spcd_error_ci() {
|
spcd_error_ci() {
|
||||||
echo "× CI: ${*}"
|
echo "× CI: ${*}"
|
||||||
|
@ -270,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}"
|
||||||
|
@ -337,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
|
||||||
|
@ -371,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"
|
||||||
|
@ -385,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"
|
||||||
|
@ -408,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"
|
||||||
|
@ -778,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}") spcd_eval apk cache purge ;;
|
|
||||||
"${SPCD_PM_APT}") spcd_eval apt-get clean ;;
|
|
||||||
"${SPCD_PM_DNF}") spcd_eval dnf clean all ;;
|
|
||||||
"${SPCD_PM_PACMAN}") spcd_eval pacman --sync --clean --noconfirm ;;
|
|
||||||
"${SPCD_PM_ZYPPER}") spcd_eval zypper clean ;;
|
|
||||||
*) ;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
spcd_git_clone() {
|
spcd_git_clone() {
|
||||||
if [ -n "${1}" ]; then
|
if [ -n "${1}" ]; then
|
||||||
|
@ -814,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}") spcd_eval apk add "${1}" ;;
|
|
||||||
"${SPCD_PM_APT}") spcd_eval apt-get install --assume-yes "${1}" ;;
|
|
||||||
"${SPCD_PM_DNF}") spcd_eval dnf install --assumeyes "${1}" ;;
|
|
||||||
"${SPCD_PM_PACMAN}") spcd_eval pacman --sync --noconfirm "${1}" ;;
|
|
||||||
"${SPCD_PM_ZYPPER}") spcd_eval 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
|
||||||
|
@ -858,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}"
|
||||||
|
@ -948,7 +915,7 @@ spcd_txt_locale() {
|
||||||
*) ;;
|
*) ;;
|
||||||
esac
|
esac
|
||||||
spcd_split
|
spcd_split
|
||||||
echo "${name}"
|
spcd_os_printenv "${name}"
|
||||||
if [ -n "${regex}" ]; then
|
if [ -n "${regex}" ]; then
|
||||||
locale --keyword-name "${name}" | grep "${regex}"
|
locale --keyword-name "${name}" | grep "${regex}"
|
||||||
fi
|
fi
|
||||||
|
@ -971,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}")
|
||||||
|
@ -982,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
|
||||||
|
@ -1014,7 +981,7 @@ ${name}.${_SPCD_TXT_CHARSET} ${_SPCD_TXT_CHARSET}
|
||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
"list")
|
"list")
|
||||||
if ! spcd_eval locale --all-locales; then
|
if ! spcd_run locale --all-locales; then
|
||||||
echo "No locales yet!"
|
echo "No locales yet!"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
@ -1022,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"
|
||||||
|
@ -1206,7 +1288,7 @@ Dir::Etc::SourceParts \"\";
|
||||||
esac
|
esac
|
||||||
case "${SPCD_OS_ID}" in
|
case "${SPCD_OS_ID}" in
|
||||||
"${SPCD_OS_ARCH}")
|
"${SPCD_OS_ARCH}")
|
||||||
spcd_eval 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"
|
||||||
|
@ -1216,51 +1298,10 @@ Dir::Etc::SourceParts \"\";
|
||||||
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}") spcd_eval apk update ;;
|
|
||||||
"${SPCD_PM_APT}") spcd_eval apt-get update ;;
|
|
||||||
"${SPCD_PM_DNF}") spcd_eval dnf makecache ;;
|
|
||||||
"${SPCD_PM_PACMAN}") spcd_eval pacman --sync --refresh ;;
|
|
||||||
"${SPCD_PM_ZYPPER}") spcd_eval 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
|
||||||
}
|
}
|
||||||
|
@ -1276,13 +1317,13 @@ spcd_step__packages_install_locales() {
|
||||||
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() {
|
||||||
|
@ -1314,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}")
|
||||||
spcd_eval 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}")
|
||||||
spcd_eval 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}") spcd_eval apk upgrade ;;
|
|
||||||
"${SPCD_PM_APT}") spcd_eval apt-get upgrade --assume-yes ;;
|
|
||||||
"${SPCD_PM_DNF}") spcd_eval dnf upgrade --assumeyes ;;
|
|
||||||
"${SPCD_PM_PACMAN}") spcd_eval pacman --sync --sysupgrade --noconfirm ;;
|
|
||||||
"${SPCD_PM_ZYPPER}") spcd_eval 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
|
||||||
|
@ -1375,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
|
||||||
|
@ -1425,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 -- \
|
||||||
|
@ -1457,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"
|
||||||
|
@ -1491,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
|
||||||
}
|
}
|
||||||
|
@ -1555,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
|
||||||
|
@ -1568,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