Compare commits

..

26 commits

Author SHA1 Message Date
86d07730bc
step/packages
Some checks failed
/ arch (push) Successful in 2m48s
/ alpine (push) Successful in 2m8s
/ fedora (push) Successful in 12m44s
/ opensuse (push) Successful in 3m26s
/ alma (push) Successful in 12m55s
/ rocky (push) Successful in 13m0s
/ ubuntu (push) Successful in 6m21s
/ debian (push) Failing after 3m33s
2024-09-09 01:11:27 +02:00
c2459552e3
f/pkg 2024-09-09 01:09:19 +02:00
5543b5de66
py/download 2024-09-09 01:04:13 +02:00
373f5ef236
f/pkg 2024-09-09 00:55:49 +02:00
59105a0c54
py/install 2024-09-09 00:48:56 +02:00
0bb39456e2
indent 2024-09-09 00:46:16 +02:00
19b7ad4675
mv 2024-09-09 00:44:19 +02:00
5786944cf9
ca/write 2024-09-09 00:43:44 +02:00
62ca47aab3
save 2024-09-09 00:21:46 +02:00
acec3522fa
py/switch 2024-09-09 00:19:43 +02:00
a9e31fd740
py/save 2024-09-09 00:15:57 +02:00
afa1314d1a
fix 2024-09-09 00:10:07 +02:00
fb95806a0b
mv 2024-09-09 00:09:06 +02:00
ce9e4de199
py/clone 2024-09-09 00:08:32 +02:00
d8e681164d
py/link 2024-09-09 00:05:42 +02:00
992d79c125
mv 2024-09-09 00:04:20 +02:00
f3a6a848d5
f/py 2024-09-09 00:03:25 +02:00
8c9880693f
git/clone 2024-09-09 00:01:20 +02:00
7b2a026b1e
git/url 2024-09-09 00:00:26 +02:00
d83231c2fc
mv 2024-09-08 23:59:33 +02:00
46860fd69d
f/git 2024-09-08 23:58:41 +02:00
e8011a6413
env/workspace 2024-09-08 23:57:03 +02:00
0c050ca1ae
pm/pkg/install 2024-09-08 23:49:16 +02:00
d453e5eb67
f/ca 2024-09-08 23:32:36 +02:00
dc47ace951
f/dns 2024-09-08 23:01:41 +02:00
6685170c4f
steps/dns 2024-09-08 22:58:57 +02:00
2 changed files with 367 additions and 367 deletions

View file

@ -14,8 +14,7 @@ gource \
--output-ppm-stream - \ --output-ppm-stream - \
--seconds-per-day 0.6 \ --seconds-per-day 0.6 \
--stop-at-end \ --stop-at-end \
--viewport "1920x1080" \ --viewport "1920x1080" |
| \
ffmpeg \ ffmpeg \
-codec:v ppm \ -codec:v ppm \
-format image2pipe \ -format image2pipe \

View file

@ -211,54 +211,6 @@ _spcd_txt_pick() {
# │ p = public │ # │ p = public │
# ╰────────────╯ # ╰────────────╯
spcd_ca() {
local grep="\(After\|Before\|Issuer\|Signature Algorithm\|Subject:\)"
local index name value
local root="${2}"
while true; do
index=$((index + 1))
name="SPCD_CA_${index}"
eval "value=\"\${${name}}\""
[ -n "${value}" ] || break
case "${1}" in
"list")
echo "${name} ="
echo "${value}" |
openssl x509 -noout -text |
grep "${grep}"
;;
"write")
spcd_os_write "${root}/${index}.crt" "${value}"
;;
*) ;;
esac
done
}
spcd_dns() {
local index name text value
while true; do
index=$((index + 1))
name="SPCD_DNS_${index}"
eval "value=\"\${${name}}\""
[ -n "${value}" ] || break
case "${1}" in
"list")
spcd_os_printenv "${name}"
;;
"write")
text="${text}\
nameserver ${value}
"
;;
*) ;;
esac
done
if [ "${1}" = "write" ]; then
spcd_os_write "/etc/resolv.conf" "${text}"
fi
}
spcd_run() { spcd_run() {
if [ -n "${1}" ]; then if [ -n "${1}" ]; then
_spcd_frame_open "${@}" _spcd_frame_open "${@}"
@ -425,8 +377,8 @@ SPCD_PM_ZYPPER="zypper"
# ╰───┴───────────╯ # ╰───┴───────────╯
spcd_step__environment_print() { spcd_step__environment_print() {
spcd_ca "list" spcd_f_ca "list"
spcd_dns "list" spcd_f_dns "list"
set -- \ set -- \
"GIT_RWX" \ "GIT_RWX" \
"GIT_SPCD" \ "GIT_SPCD" \
@ -785,61 +737,166 @@ ${SPCD_PYTHON_VENV}/lib/${SPCD_PYTHON_COMMAND}/site-packages"
spcd_os_printenv "SPCD_DL" spcd_os_printenv "SPCD_DL"
} }
spcd_step__environment_list_workspace() {
spcd_step "List workspace"
spcd_os_ls "$(realpath .)"
}
# ╭──────────────╮ # ╭──────────────╮
# │ f = function │ # │ f = function │
# ╰──────────────╯ # ╰──────────────╯
spcd_git_clone() { spcd_f_dns() {
if [ -n "${1}" ]; then local index name text value
local name path url while true; do
name="$(basename "${1}")" index=$((index + 1))
path="${SPCD_DL}/${name}" name="SPCD_DNS_${index}"
url="$(spcd_git_url "${1}")" eval "value=\"\${${name}}\""
git clone "${url}" "${path}" [ -n "${value}" ] || break
echo "${path}"
fi
}
spcd_git_url() {
if [ -n "${1}" ]; then
case "${1}" in case "${1}" in
http*) echo "${1}" ;; "list")
*/*) echo "${SPCD_PROJECT_ROOT}/${1}" ;; spcd_os_printenv "${name}"
*) echo "${SPCD_PROJECT_ROOT}/${SPCD_PROJECT_PATH}/${1}" ;; ;;
"write")
text="${text}\
nameserver ${value}
"
;;
*) ;;
esac esac
done
if [ "${1}" = "write" ]; then
spcd_os_write "/etc/resolv.conf" "${text}"
fi fi
} }
spcd_python_ln() { spcd_f_pkg() {
local command="${1}" spcd_step_in "OS packages"
if [ -n "${command}" ]; then local file
echo "${SPCD_PYTHON_ALIAS}${command}" # epel
ln -f -s "${command}" \ spcd_step "EPEL"
"/usr/bin/${SPCD_PYTHON_ALIAS}" case "${SPCD_OS_ID}" in
fi "${SPCD_OS_ALMA}" | "${SPCD_OS_ROCKY}")
} spcd_f_pm_pkg_install "epel-release"
case "${SPCD_OS_VERSION}" in
spcd_python_pip() { "9")
if [ -n "${1}" ]; then set -- \
local name path target "-testing" \
name="$(basename "${1}")" ""
path="$(spcd_git_clone "${1}")" ;;
path="${path}/${name}" "8")
target="${SPCD_PYTHON_VENV_PACKAGES}" set -- \
cp --recursive "${path}" "${target}" "-modular" \
echo "${target}/${name}" "-testing-modular" \
"-testing" \
""
;;
*) ;;
esac
for file in "${@}"; do
spcd_os_sed "/etc/yum.repos.d/epel${file}.repo" \
"|^metalink|#metalink|" \
"|https://download.example/pub/epel|${SPCD_URL_EPEL}|" \
"|^#baseurl|baseurl|"
done
file="/etc/yum.repos.d/epel-cisco-openh264.repo"
if [ -f "${file}" ]; then
spcd_os_sed "${file}" \
"|^enabled=1|enabled=0|"
fi fi
;;
*) ;;
esac
# graphviz
spcd_step "GraphViz"
spcd_f_pm_pkg_install "graphviz"
# openssh
spcd_step "OpenSSH"
case "${SPCD_PM}" in
"${SPCD_PM_APK}" | "${SPCD_PM_APT}")
spcd_f_pm_pkg_install "openssh-client"
;;
"${SPCD_PM_DNF}" | "${SPCD_PM_ZYPPER}")
spcd_f_pm_pkg_install "openssh-clients"
;;
"${SPCD_PM_PACMAN}") spcd_f_pm_pkg_install "openssh" ;;
*) ;;
esac
# plantuml
spcd_step "PlantUML"
spcd_f_pm_pkg_install "plantuml"
# rsync
spcd_step "Rsync"
spcd_f_pm_pkg_install "rsync"
# shell check
spcd_step "ShellCheck"
case "${SPCD_PM}" in
"${SPCD_PM_DNF}" | "${SPCD_PM_ZYPPER}")
spcd_f_pm_pkg_install "ShellCheck"
;;
*) spcd_f_pm_pkg_install "shellcheck" ;;
esac
# shfmt
spcd_step "ShellFormat"
case "${SPCD_OS_ID}" in
"${SPCD_OS_ALMA}" | "${SPCD_OS_ROCKY}") ;;
"${SPCD_OS_DEBIAN}")
case "${SPCD_OS_VERSION}" in
"bullseye") ;;
*) spcd_f_pm_pkg_install "shfmt" ;;
esac
;;
*) spcd_f_pm_pkg_install "shfmt" ;;
esac
spcd_step_out
} }
# ╭───┬──────────────────────────────╮ # ╭───┬──────────────────────────────╮
# │ f │ ca = certificate authorities │ # │ f │ ca = certificate authorities │
# ╰───┴──────────────────────────────╯ # ╰───┴──────────────────────────────╯
spcd_f_ca() {
case "${1}" in
"list")
local grep="\(After\|Before\|Issuer\|Signature Algorithm\|Subject:\)"
;;
"write")
local root
case "${SPCD_OS_ID}" in
"${SPCD_OS_ALMA}" | "${SPCD_OS_FEDORA}" | "${SPCD_OS_ROCKY}")
root="/etc/pki/ca-trust/source/anchors"
;;
"${SPCD_OS_ALPINE}" | "${SPCD_OS_DEBIAN}" | "${SPCD_OS_UBUNTU}")
root="/usr/local/share/ca-certificates"
;;
"${SPCD_OS_ARCH}")
root="/etc/ca-certificates/trust-source/anchors"
;;
"${SPCD_OS_OPENSUSE}")
root="/etc/pki/trust/anchors"
;;
*) ;;
esac
spcd_os_mkdir "${root}"
;;
*) ;;
esac
local index name value
while true; do
index=$((index + 1))
name="SPCD_CA_${index}"
eval "value=\"\${${name}}\""
[ -n "${value}" ] || break
case "${1}" in
"list")
echo "${name} ="
echo "${value}" |
openssl x509 -noout -text |
grep "${grep}"
;;
"write")
spcd_os_write "${root}/${index}.crt" "${value}"
;;
*) ;;
esac
done
}
spcd_f_ca_install() { spcd_f_ca_install() {
spcd_step "Install package" spcd_step "Install package"
spcd_f_pm_pkg_install "ca-certificates" spcd_f_pm_pkg_install "ca-certificates"
@ -864,40 +921,57 @@ spcd_f_ca_update() {
esac esac
} }
spcd_f_ca_write() { # ╭───┬───────────────────╮
spcd_step "Write certificates" # │ f │ env = environment │
local root # ╰───┴───────────────────╯
case "${SPCD_OS_ID}" in
"${SPCD_OS_ALMA}" | "${SPCD_OS_FEDORA}" | "${SPCD_OS_ROCKY}") spcd_f_env_workspace() {
root="/etc/pki/ca-trust/source/anchors" spcd_os_ls "$(realpath .)"
;; }
"${SPCD_OS_ALPINE}" | "${SPCD_OS_DEBIAN}" | "${SPCD_OS_UBUNTU}")
root="/usr/local/share/ca-certificates" # ╭───┬─────╮
;; # │ f │ git │
"${SPCD_OS_ARCH}") # ╰───┴─────╯
root="/etc/ca-certificates/trust-source/anchors"
;; spcd_f_git_clone() {
"${SPCD_OS_OPENSUSE}") if [ -n "${1}" ]; then
root="/etc/pki/trust/anchors" local name path url
;; name="$(basename "${1}")"
*) ;; path="${SPCD_DL}/${name}"
url="$(spcd_f_git_url "${1}")"
git clone "${url}" "${path}"
echo "${path}"
fi
}
spcd_f_git_url() {
if [ -n "${1}" ]; then
case "${1}" in
http*) echo "${1}" ;;
*/*) echo "${SPCD_PROJECT_ROOT}/${1}" ;;
*) echo "${SPCD_PROJECT_ROOT}/${SPCD_PROJECT_PATH}/${1}" ;;
esac esac
spcd_os_mkdir "${root}" fi
spcd_ca "write" "${root}" }
# ╭───┬───────────────╮
# │ f │ pkg = package │
# ╰───┴───────────────╯
spcd_f_pkg_dos2unix() {
spcd_step "Install dos2unix"
spcd_f_pm_pkg_install "dos2unix"
}
spcd_f_pkg_git() {
spcd_step "Install Git"
spcd_f_pm_pkg_install "git"
} }
# ╭───┬──────────────────────╮ # ╭───┬──────────────────────╮
# │ f │ pm = package manager │ # │ f │ pm = package manager │
# ╰───┴──────────────────────╯ # ╰───┴──────────────────────╯
spcd_f_pm_install() {
spcd_step "Install tools"
case "${SPCD_PM}" in
"${SPCD_PM_APT}") spcd_f_pm_pkg_install "apt-utils" ;;
*) ;;
esac
}
# ╭───┬────┬───────╮ # ╭───┬────┬───────╮
# │ f │ pm │ https │ # │ f │ pm │ https │
# ╰───┴────┴───────╯ # ╰───┴────┴───────╯
@ -967,15 +1041,27 @@ spcd_f_pm_pkg_clean() {
} }
spcd_f_pm_pkg_install() { spcd_f_pm_pkg_install() {
if [ -n "${1}" ]; then
local name
for name in "${@}"; do
case "${SPCD_PM}" in case "${SPCD_PM}" in
"${SPCD_PM_APK}") spcd_run apk add "${1}" ;; "${SPCD_PM_APK}") spcd_run apk add "${1}" ;;
"${SPCD_PM_APT}") spcd_run apt-get install --assume-yes "${1}" ;; "${SPCD_PM_APT}") spcd_run apt-get install --assume-yes "${1}" ;;
"${SPCD_PM_DNF}") spcd_run dnf install --assumeyes "${1}" ;; "${SPCD_PM_DNF}") spcd_run dnf install --assumeyes "${1}" ;;
"${SPCD_PM_PACMAN}") spcd_run pacman --sync --noconfirm "${1}" ;; "${SPCD_PM_PACMAN}") spcd_run pacman --sync --noconfirm "${1}" ;;
"${SPCD_PM_ZYPPER}") spcd_run zypper --non-interactive install "${1}" ;; "${SPCD_PM_ZYPPER}")
spcd_run zypper --non-interactive install "${1}"
;;
*) ;; *) ;;
esac esac
spcd_f_pm_pkg_clean spcd_f_pm_pkg_clean
done
else
case "${SPCD_PM}" in
"${SPCD_PM_APT}") spcd_f_pm_pkg_install "apt-utils" ;;
*) ;;
esac
fi
} }
spcd_f_pm_pkg_query() { spcd_f_pm_pkg_query() {
@ -1013,6 +1099,117 @@ spcd_f_pm_pkg_upgrade() {
esac esac
} }
# ╭───┬─────────────╮
# │ f │ py = python │
# ╰───┴─────────────╯
spcd_f_py_clone() {
if [ -n "${1}" ]; then
local name path target
name="$(basename "${1}")"
path="$(spcd_f_git_clone "${1}")"
path="${path}/${name}"
target="${SPCD_PYTHON_VENV_PACKAGES}"
cp --recursive "${path}" "${target}"
echo "${target}/${name}"
fi
}
spcd_f_py_download() {
spcd_step_in "Modules"
local target path script check
target="${SPCD_PYTHON_VENV_PACKAGES}"
spcd_step "List"
spcd_os_ls "${target}"
spcd_step "Main"
path="$(spcd_f_py_clone "${SPCD_GIT_SPCD}")"
# check matching of file and variable
spcd_step "Check"
script="${path}/bootstrap.sh"
ls -l "${script}"
check="${script}.${_SPCD_CMD_SUM}"
"${_SPCD_CMD_SUM}" "${script}" >"${check}"
printf "%s" "${SPCD}" >"${script}"
ls -l "${script}"
dos2unix "${script}"
ls -l "${script}"
"${_SPCD_CMD_SUM}" -c "${check}" || spcd_error_ci "SPCD"
spcd_step "Root"
spcd_f_py_clone "${SPCD_GIT_RWX}"
spcd_step "List"
spcd_os_ls "${target}"
spcd_step_out
}
spcd_f_py_install() {
spcd_step "Install package"
spcd_f_pm_pkg_install "${SPCD_PYTHON_PACKAGE}"
spcd_step "Link alias to command"
spcd_f_py_link "${SPCD_PYTHON_COMMAND}"
# venv
spcd_step_in "Virtual environment"
spcd_step "Install package"
case "${SPCD_OS_ID}" in
"${SPCD_OS_DEBIAN}" | "${SPCD_OS_UBUNTU}")
spcd_f_pm_pkg_install "python3-venv"
;;
*) ;;
esac
spcd_step "Configure PIP"
spcd_os_write "/etc/pip.conf" "\
[global]
index-url = ${SPCD_URL_PYTHON}/simple
"
spcd_step "Create"
"${SPCD_PYTHON_ALIAS}" -m "venv" "${SPCD_PYTHON_VENV}"
spcd_step "Activate"
export PATH="${SPCD_PYTHON_VENV_BINARIES}:${PATH}"
export VIRTUAL_ENV="${SPCD_PYTHON_VENV}"
spcd_step_out
}
spcd_f_py_link() {
local command="${1}"
if [ -n "${command}" ]; then
echo "${SPCD_PYTHON_ALIAS}${command}"
ln -f -s "${command}" \
"/usr/bin/${SPCD_PYTHON_ALIAS}"
fi
}
spcd_f_py_save() {
spcd_step "Save"
local variable value text index root
for variable in \
OS_ID OS_VERSION \
PROJECT_ROOT PROJECT_PATH PROJECT_NAME \
PYTHON_VENV_BINARIES PYTHON_VENV_PACKAGES \
OPEN DOWN VERT SPLT __UP SHUT; do
value="$(spcd_os_printenv "SPCD_${variable}")"
text="${text}${value}
"
done
index=$((__SPCD_STEP_1_INDEX + 1))
for root in \
"${SPCD_PYTHON_PACKAGES}" "${SPCD_PYTHON_VENV_PACKAGES}"; do
spcd_os_write "${root}/env.py" "${text}
SPCD_STEP = ${index}
"
done
}
spcd_f_py_switch() {
spcd_step "Switch"
local name path
name="$(basename "${SPCD_GIT_SPCD}")"
path="$(realpath "${0}")"
echo "\
${path}
${SPCD_PYTHON_ALIAS} / ${name}"
"${SPCD_PYTHON_ALIAS}" -m "${name}"
}
# ╭───┬─────╮ # ╭───┬─────╮
# │ f │ txt │ # │ f │ txt │
# ╰───┴─────╯ # ╰───┴─────╯
@ -1170,22 +1367,9 @@ ${name}.${_SPCD_TXT_CHARSET} ${_SPCD_TXT_CHARSET}
esac esac
} }
# ╭───┬──────╮ # ╭──────┬──────────╮
# │ s = step │ # │ step │ packages │
# ╰───┴──────╯ # ╰──────┴──────────╯
# ╭───┬─────╮
# │ s │ dns │
# ╰───┴─────╯
spcd_step__dns() {
spcd_step "DNS"
spcd_dns "write"
}
# ╭───┬──────────╮
# │ s │ packages │
# ╰───┴──────────╯
spcd_step__packages_set_repositories() { spcd_step__packages_set_repositories() {
spcd_step "Set repositories" spcd_step "Set repositories"
@ -1368,191 +1552,6 @@ Dir::Etc::SourceParts \"\";
esac esac
} }
# ╭───┬──────────╮
# │ s │ packages │
# ╰───┴──────────╯
spcd_step__packages_install_dos2unix() {
spcd_step "Install dos2unix"
spcd_f_pm_pkg_install "dos2unix"
}
spcd_step__packages_install_git() {
spcd_step "Install Git"
spcd_f_pm_pkg_install "git"
}
# ╭───┬────────╮
# │ s │ python │
# ╰───┴────────╯
spcd_step__python_install() {
spcd_step "Install package"
spcd_f_pm_pkg_install "${SPCD_PYTHON_PACKAGE}"
spcd_step "Link alias to command"
spcd_python_ln "${SPCD_PYTHON_COMMAND}"
# venv
spcd_step_in "Virtual environment"
spcd_step "Install package"
case "${SPCD_OS_ID}" in
"${SPCD_OS_DEBIAN}" | "${SPCD_OS_UBUNTU}")
spcd_f_pm_pkg_install "python3-venv"
;;
*) ;;
esac
spcd_step "Configure PIP"
spcd_os_write "/etc/pip.conf" "\
[global]
index-url = ${SPCD_URL_PYTHON}/simple
"
spcd_step "Create"
"${SPCD_PYTHON_ALIAS}" -m "venv" "${SPCD_PYTHON_VENV}"
spcd_step "Activate"
export PATH="${SPCD_PYTHON_VENV_BINARIES}:${PATH}"
export VIRTUAL_ENV="${SPCD_PYTHON_VENV}"
spcd_step_out
}
spcd_step__python_modules() {
spcd_step_in "Modules"
local target path script check
target="${SPCD_PYTHON_VENV_PACKAGES}"
spcd_step "List"
spcd_os_ls "${target}"
spcd_step "Main"
path="$(spcd_python_pip "${SPCD_GIT_SPCD}")"
# check matching of file and variable
spcd_step "Check"
script="${path}/bootstrap.sh"
ls -l "${script}"
check="${script}.${_SPCD_CMD_SUM}"
"${_SPCD_CMD_SUM}" "${script}" >"${check}"
printf "%s" "${SPCD}" >"${script}"
ls -l "${script}"
dos2unix "${script}"
ls -l "${script}"
"${_SPCD_CMD_SUM}" -c "${check}" || spcd_error_ci "SPCD"
spcd_step "Root"
spcd_python_pip "${SPCD_GIT_RWX}"
spcd_step "List"
spcd_os_ls "${target}"
spcd_step_out
}
spcd_step__install_packages() {
spcd_step_in "OS packages"
local file
# epel
spcd_step "EPEL"
case "${SPCD_OS_ID}" in
"${SPCD_OS_ALMA}" | "${SPCD_OS_ROCKY}")
spcd_f_pm_pkg_install "epel-release"
case "${SPCD_OS_VERSION}" in
"9")
set -- \
"-testing" \
""
;;
"8")
set -- \
"-modular" \
"-testing-modular" \
"-testing" \
""
;;
*) ;;
esac
for file in "${@}"; do
spcd_os_sed "/etc/yum.repos.d/epel${file}.repo" \
"|^metalink|#metalink|" \
"|https://download.example/pub/epel|${SPCD_URL_EPEL}|" \
"|^#baseurl|baseurl|"
done
file="/etc/yum.repos.d/epel-cisco-openh264.repo"
if [ -f "${file}" ]; then
spcd_os_sed "${file}" \
"|^enabled=1|enabled=0|"
fi
;;
*) ;;
esac
# graphviz
spcd_step "GraphViz"
spcd_f_pm_pkg_install "graphviz"
# openssh
spcd_step "OpenSSH"
case "${SPCD_PM}" in
"${SPCD_PM_APK}" | "${SPCD_PM_APT}")
spcd_f_pm_pkg_install "openssh-client"
;;
"${SPCD_PM_DNF}" | "${SPCD_PM_ZYPPER}")
spcd_f_pm_pkg_install "openssh-clients"
;;
"${SPCD_PM_PACMAN}") spcd_f_pm_pkg_install "openssh" ;;
*) ;;
esac
# plantuml
spcd_step "PlantUML"
spcd_f_pm_pkg_install "plantuml"
# rsync
spcd_step "Rsync"
spcd_f_pm_pkg_install "rsync"
# shell check
spcd_step "ShellCheck"
case "${SPCD_PM}" in
"${SPCD_PM_DNF}" | "${SPCD_PM_ZYPPER}")
spcd_f_pm_pkg_install "ShellCheck"
;;
*) spcd_f_pm_pkg_install "shellcheck" ;;
esac
# shfmt
spcd_step "ShellFormat"
case "${SPCD_OS_ID}" in
"${SPCD_OS_ALMA}" | "${SPCD_OS_ROCKY}") ;;
"${SPCD_OS_DEBIAN}")
case "${SPCD_OS_VERSION}" in
"bullseye") ;;
*) spcd_f_pm_pkg_install "shfmt" ;;
esac
;;
*) spcd_f_pm_pkg_install "shfmt" ;;
esac
spcd_step_out
}
spcd_step__python_write_module() {
spcd_step "Write module"
local variable value text index root
for variable in \
OS_ID OS_VERSION \
PROJECT_ROOT PROJECT_PATH PROJECT_NAME \
PYTHON_VENV_BINARIES PYTHON_VENV_PACKAGES \
OPEN DOWN VERT SPLT __UP SHUT; do
value="$(spcd_os_printenv "SPCD_${variable}")"
text="${text}${value}
"
done
index=$((__SPCD_STEP_1_INDEX + 1))
for root in \
"${SPCD_PYTHON_PACKAGES}" "${SPCD_PYTHON_VENV_PACKAGES}"; do
spcd_os_write "${root}/env.py" "${text}
SPCD_STEP = ${index}
"
done
}
spcd_step__python_switch() {
spcd_step "Switch"
local name path
name="$(basename "${SPCD_GIT_SPCD}")"
path="$(realpath "${0}")"
echo "\
${path}
${SPCD_PYTHON_ALIAS} / ${name}"
"${SPCD_PYTHON_ALIAS}" -m "${name}"
}
# ╭──────╮ # ╭──────╮
# │ main │ # │ main │
# ╰──────╯ # ╰──────╯
@ -1568,17 +1567,19 @@ spcd_main() {
spcd_step__environment_print spcd_step__environment_print
spcd_step_out spcd_step_out
spcd_step__environment_set_variables spcd_step__environment_set_variables
spcd_step__environment_list_workspace spcd_step "List workspace"
spcd_f_env_workspace
spcd_step_out spcd_step_out
# dns # dns
spcd_step__dns spcd_step "DNS"
spcd_f_dns "write"
# packages # packages
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_f_pm_https_trust spcd_f_pm_https_trust
spcd_f_pm_pkg_update spcd_f_pm_pkg_update
spcd_f_pm_install spcd_f_pm_pkg_install
# locales # locales
spcd_step_in "Locales" spcd_step_in "Locales"
spcd_step "Install" spcd_step "Install"
@ -1592,7 +1593,7 @@ spcd_main() {
# ca # ca
spcd_step_in "CA" spcd_step_in "CA"
spcd_f_ca_install spcd_f_ca_install
spcd_f_ca_write spcd_f_ca "write"
spcd_f_ca_update spcd_f_ca_update
spcd_step_out spcd_step_out
# packages # packages
@ -1600,16 +1601,16 @@ spcd_main() {
spcd_f_pm_https_verify spcd_f_pm_https_verify
spcd_f_pm_pkg_update spcd_f_pm_pkg_update
spcd_f_pm_pkg_upgrade spcd_f_pm_pkg_upgrade
spcd_step__packages_install_dos2unix spcd_f_pkg_dos2unix
spcd_step__packages_install_git spcd_f_pkg_git
spcd_step_out spcd_step_out
# python # python
spcd_step_in "Python" spcd_step_in "Python"
spcd_step__python_install spcd_f_py_install
spcd_step__python_modules spcd_f_py_download
spcd_step__install_packages spcd_f_pkg
spcd_step__python_write_module spcd_f_py_save
spcd_step__python_switch spcd_f_py_switch
} }
spcd_main spcd_main