diff --git a/readme.md b/readme.md index 8d53d3c..bb48033 100644 --- a/readme.md +++ b/readme.md @@ -97,11 +97,8 @@ from various contexts of CA, CI and OCI / OS. ## Tasks -* try git repo url variable first for shunit - ### sh -* implement substeps * review repositories handling for systems * opensuse * codecs repository @@ -135,7 +132,6 @@ from various contexts of CA, CI and OCI / OS. * .sh * maximum line length * detect ssh private key type -* implement substeps * list sys.path * set workflow templates * actions diff --git a/spcd.sh b/spcd.sh index 9301941..035717e 100644 --- a/spcd.sh +++ b/spcd.sh @@ -739,9 +739,8 @@ ${spcd_ipm__target}" } spcd_install_packages() { - spcd_step "Install packages" # epel - spcd_substep "Install EPEL" + spcd_step "Install EPEL" case "${SPCD_OS_ID}" in "${SPCD_OS_ALMA}" | "${SPCD_OS_ROCKY}") spcd_install_package "epel-release" @@ -755,13 +754,36 @@ spcd_install_packages() { *) ;; esac # bats - spcd_substep "Install BATS" + spcd_step "Install BATS" spcd_install_package "bats" # graphviz - spcd_substep "Install GraphViz" + spcd_step "Install GraphViz" spcd_install_package "graphviz" - # openssh - spcd_substep "Install OpenSSH" + # plantuml + spcd_step "Install PlantUML" + spcd_install_package "plantuml" + # rsync + spcd_step "Install Rsync" + spcd_install_package "rsync" + # shell check + spcd_step "Install ShellCheck" + case "${SPCD_PM}" in + "${SPCD_PM_DNF}" | "${SPCD_PM_ZYPPER}") + spcd_install_package "ShellCheck" + ;; + *) spcd_install_package "shellcheck" ;; + esac + # shfmt + spcd_step "Install ShellFormat" + case "${SPCD_OS_ID}" in + "${SPCD_OS_ALMA}" | "${SPCD_OS_ROCKY}") ;; + "${SPCD_OS_DEBIAN}") + [ "${SPCD_OS_VERSION}" != "bullseye" ] && spcd_install_package "shfmt" + ;; + *) spcd_install_package "shfmt" ;; + esac + # ssh + spcd_step "Install SSH" case "${SPCD_PM}" in "${SPCD_PM_APK}" | "${SPCD_PM_APT}") spcd_install_package "openssh-client" @@ -772,29 +794,6 @@ spcd_install_packages() { "${SPCD_PM_PACMAN}") spcd_install_package "openssh" ;; *) ;; esac - # plantuml - spcd_substep "Install PlantUML" - spcd_install_package "plantuml" - # rsync - spcd_substep "Install Rsync" - spcd_install_package "rsync" - # shell check - spcd_substep "Install ShellCheck" - case "${SPCD_PM}" in - "${SPCD_PM_DNF}" | "${SPCD_PM_ZYPPER}") - spcd_install_package "ShellCheck" - ;; - *) spcd_install_package "shellcheck" ;; - esac - # shfmt - spcd_substep "Install ShellFormat" - case "${SPCD_OS_ID}" in - "${SPCD_OS_ALMA}" | "${SPCD_OS_ROCKY}") ;; - "${SPCD_OS_DEBIAN}") - [ "${SPCD_OS_VERSION}" != "bullseye" ] && spcd_install_package "shfmt" - ;; - *) spcd_install_package "shfmt" ;; - esac } spcd_write_python_module() { @@ -828,13 +827,6 @@ ${SPCD_PYTHON_ALIAS} / ${spcd_stp__name}" # functions -spcd_banner() { - echo "\ -${SPCD_DOWN} -${SPCD_VERT} ${*} -${SPCD___UP}" -} - spcd_cat() { spcd_cat__file="${1}" if [ -n "${spcd_cat__file}" ]; then @@ -952,19 +944,10 @@ spcd_split() { spcd_step() { SPCD_STEP=$((SPCD_STEP + 1)) - SPCD_STEP_TEXT="${*}" - unset SPCD_SUBSTEP - spcd_banner "${SPCD_STEP}" "${SPCD_VERT}" "${SPCD_STEP_TEXT}" -} - -spcd_substep() { - SPCD_SUBSTEP=$((SPCD_SUBSTEP + 1)) - spcd_banner \ - "${SPCD_STEP}.${SPCD_SUBSTEP}" \ - "${SPCD_VERT}" \ - "${SPCD_STEP_TEXT}" \ - "${SPCD_VERT}" \ - "${*}" + echo "\ +${SPCD_DOWN} +${SPCD_VERT} ${SPCD_STEP} ${*} +${SPCD___UP}" } spcd_write() {