diff --git a/.forgejo/workflows/almalinux_8.yaml b/.forgejo/workflows/almalinux_8.yaml index fea586a..98d5c0d 100644 --- a/.forgejo/workflows/almalinux_8.yaml +++ b/.forgejo/workflows/almalinux_8.yaml @@ -4,13 +4,13 @@ jobs: container: image: almalinux:8 steps: - - name: cidd + - name: pidd run: > - ${{vars.CIDD}} - "${{secrets.CIDD_SSH_KEY}}" - "${{vars.CIDD_SSH_HOSTS}}" + ${{vars.PIDD}} + "${{secrets.PIDD_SSH_KEY}}" + "${{vars.PIDD_SSH_HOSTS}}" - - run: cidd-list-environment - - run: cidd-clone-branch - - run: cidd-build-project - - run: cidd-browse-workspace + - run: pidd-list-environment + - run: pidd-clone-branch + - run: pidd-build-project + - run: pidd-browse-workspace diff --git a/.forgejo/workflows/almalinux_9.yaml b/.forgejo/workflows/almalinux_9.yaml index fa5ef03..9355241 100644 --- a/.forgejo/workflows/almalinux_9.yaml +++ b/.forgejo/workflows/almalinux_9.yaml @@ -4,13 +4,13 @@ jobs: container: image: almalinux:9 steps: - - name: cidd + - name: pidd run: > - ${{vars.CIDD}} - "${{secrets.CIDD_SSH_KEY}}" - "${{vars.CIDD_SSH_HOSTS}}" + ${{vars.PIDD}} + "${{secrets.PIDD_SSH_KEY}}" + "${{vars.PIDD_SSH_HOSTS}}" - - run: cidd-list-environment - - run: cidd-clone-branch - - run: cidd-build-project - - run: cidd-browse-workspace + - run: pidd-list-environment + - run: pidd-clone-branch + - run: pidd-build-project + - run: pidd-browse-workspace diff --git a/.forgejo/workflows/alpine_3.18.yaml b/.forgejo/workflows/alpine_3.18.yaml index c9f284c..0a1fd7f 100644 --- a/.forgejo/workflows/alpine_3.18.yaml +++ b/.forgejo/workflows/alpine_3.18.yaml @@ -4,13 +4,13 @@ jobs: container: image: alpine:3.18 steps: - - name: cidd + - name: pidd run: > - ${{vars.CIDD}} - "${{secrets.CIDD_SSH_KEY}}" - "${{vars.CIDD_SSH_HOSTS}}" + ${{vars.PIDD}} + "${{secrets.PIDD_SSH_KEY}}" + "${{vars.PIDD_SSH_HOSTS}}" - - run: cidd-list-environment - - run: cidd-clone-branch - - run: cidd-build-project - - run: cidd-browse-workspace + - run: pidd-list-environment + - run: pidd-clone-branch + - run: pidd-build-project + - run: pidd-browse-workspace diff --git a/.forgejo/workflows/alpine_3.19.yaml b/.forgejo/workflows/alpine_3.19.yaml index 8a2e539..6a736bc 100644 --- a/.forgejo/workflows/alpine_3.19.yaml +++ b/.forgejo/workflows/alpine_3.19.yaml @@ -4,13 +4,13 @@ jobs: container: image: alpine:3.19 steps: - - name: cidd + - name: pidd run: > - ${{vars.CIDD}} - "${{secrets.CIDD_SSH_KEY}}" - "${{vars.CIDD_SSH_HOSTS}}" + ${{vars.PIDD}} + "${{secrets.PIDD_SSH_KEY}}" + "${{vars.PIDD_SSH_HOSTS}}" - - run: cidd-list-environment - - run: cidd-clone-branch - - run: cidd-build-project - - run: cidd-browse-workspace + - run: pidd-list-environment + - run: pidd-clone-branch + - run: pidd-build-project + - run: pidd-browse-workspace diff --git a/.forgejo/workflows/archlinux_base-20231112.0.191179.yaml b/.forgejo/workflows/archlinux_base-20231112.0.191179.yaml index 1fb534e..484465a 100644 --- a/.forgejo/workflows/archlinux_base-20231112.0.191179.yaml +++ b/.forgejo/workflows/archlinux_base-20231112.0.191179.yaml @@ -4,13 +4,13 @@ jobs: container: image: archlinux:base-20231112.0.191179 steps: - - name: cidd + - name: pidd run: > - ${{vars.CIDD}} - "${{secrets.CIDD_SSH_KEY}}" - "${{vars.CIDD_SSH_HOSTS}}" + ${{vars.PIDD}} + "${{secrets.PIDD_SSH_KEY}}" + "${{vars.PIDD_SSH_HOSTS}}" - - run: cidd-list-environment - - run: cidd-clone-branch - - run: cidd-build-project - - run: cidd-browse-workspace + - run: pidd-list-environment + - run: pidd-clone-branch + - run: pidd-build-project + - run: pidd-browse-workspace diff --git a/.forgejo/workflows/archlinux_base-20240101.0.204074.yaml b/.forgejo/workflows/archlinux_base-20240101.0.204074.yaml index 01308a0..3de46f0 100644 --- a/.forgejo/workflows/archlinux_base-20240101.0.204074.yaml +++ b/.forgejo/workflows/archlinux_base-20240101.0.204074.yaml @@ -4,13 +4,13 @@ jobs: container: image: archlinux:base-20240101.0.204074 steps: - - name: cidd + - name: pidd run: > - ${{vars.CIDD}} - "${{secrets.CIDD_SSH_KEY}}" - "${{vars.CIDD_SSH_HOSTS}}" + ${{vars.PIDD}} + "${{secrets.PIDD_SSH_KEY}}" + "${{vars.PIDD_SSH_HOSTS}}" - - run: cidd-list-environment - - run: cidd-clone-branch - - run: cidd-build-project - - run: cidd-browse-workspace + - run: pidd-list-environment + - run: pidd-clone-branch + - run: pidd-build-project + - run: pidd-browse-workspace diff --git a/.forgejo/workflows/debian_bookworm.yaml b/.forgejo/workflows/debian_bookworm.yaml index 14e2fcd..4bc47bc 100644 --- a/.forgejo/workflows/debian_bookworm.yaml +++ b/.forgejo/workflows/debian_bookworm.yaml @@ -4,14 +4,14 @@ jobs: container: image: debian:bookworm steps: - - name: cidd + - name: pidd run: > - ${{vars.CIDD}} - "${{secrets.CIDD_SSH_KEY}}" - "${{vars.CIDD_SSH_HOSTS}}" + ${{vars.PIDD}} + "${{secrets.PIDD_SSH_KEY}}" + "${{vars.PIDD_SSH_HOSTS}}" - - run: cidd-list-environment - - run: cidd-clone-branch - - run: cidd-build-project - - run: cidd-browse-workspace - - run: cidd-synchronize + - run: pidd-list-environment + - run: pidd-clone-branch + - run: pidd-build-project + - run: pidd-browse-workspace + - run: pidd-synchronize diff --git a/.forgejo/workflows/debian_bullseye.yaml b/.forgejo/workflows/debian_bullseye.yaml index bae043d..8d5289e 100644 --- a/.forgejo/workflows/debian_bullseye.yaml +++ b/.forgejo/workflows/debian_bullseye.yaml @@ -4,13 +4,13 @@ jobs: container: image: debian:bullseye steps: - - name: cidd + - name: pidd run: > - ${{vars.CIDD}} - "${{secrets.CIDD_SSH_KEY}}" - "${{vars.CIDD_SSH_HOSTS}}" + ${{vars.PIDD}} + "${{secrets.PIDD_SSH_KEY}}" + "${{vars.PIDD_SSH_HOSTS}}" - - run: cidd-list-environment - - run: cidd-clone-branch - - run: cidd-build-project - - run: cidd-browse-workspace + - run: pidd-list-environment + - run: pidd-clone-branch + - run: pidd-build-project + - run: pidd-browse-workspace diff --git a/.forgejo/workflows/fedora_39.yaml b/.forgejo/workflows/fedora_39.yaml index da70bd7..9d55290 100644 --- a/.forgejo/workflows/fedora_39.yaml +++ b/.forgejo/workflows/fedora_39.yaml @@ -4,13 +4,13 @@ jobs: container: image: fedora:39 steps: - - name: cidd + - name: pidd run: > - ${{vars.CIDD}} - "${{secrets.CIDD_SSH_KEY}}" - "${{vars.CIDD_SSH_HOSTS}}" + ${{vars.PIDD}} + "${{secrets.PIDD_SSH_KEY}}" + "${{vars.PIDD_SSH_HOSTS}}" - - run: cidd-list-environment - - run: cidd-clone-branch - - run: cidd-build-project - - run: cidd-browse-workspace + - run: pidd-list-environment + - run: pidd-clone-branch + - run: pidd-build-project + - run: pidd-browse-workspace diff --git a/.forgejo/workflows/fedora_40.yaml b/.forgejo/workflows/fedora_40.yaml index a3229d8..5eda681 100644 --- a/.forgejo/workflows/fedora_40.yaml +++ b/.forgejo/workflows/fedora_40.yaml @@ -4,13 +4,13 @@ jobs: container: image: fedora:40 steps: - - name: cidd + - name: pidd run: > - ${{vars.CIDD}} - "${{secrets.CIDD_SSH_KEY}}" - "${{vars.CIDD_SSH_HOSTS}}" + ${{vars.PIDD}} + "${{secrets.PIDD_SSH_KEY}}" + "${{vars.PIDD_SSH_HOSTS}}" - - run: cidd-list-environment - - run: cidd-clone-branch - - run: cidd-build-project - - run: cidd-browse-workspace + - run: pidd-list-environment + - run: pidd-clone-branch + - run: pidd-build-project + - run: pidd-browse-workspace diff --git a/.forgejo/workflows/rockylinux_8.yaml b/.forgejo/workflows/rockylinux_8.yaml index a4ab180..7909b85 100644 --- a/.forgejo/workflows/rockylinux_8.yaml +++ b/.forgejo/workflows/rockylinux_8.yaml @@ -4,13 +4,13 @@ jobs: container: image: rockylinux:8 steps: - - name: cidd + - name: pidd run: > - ${{vars.CIDD}} - "${{secrets.CIDD_SSH_KEY}}" - "${{vars.CIDD_SSH_HOSTS}}" + ${{vars.PIDD}} + "${{secrets.PIDD_SSH_KEY}}" + "${{vars.PIDD_SSH_HOSTS}}" - - run: cidd-list-environment - - run: cidd-clone-branch - - run: cidd-build-project - - run: cidd-browse-workspace + - run: pidd-list-environment + - run: pidd-clone-branch + - run: pidd-build-project + - run: pidd-browse-workspace diff --git a/.forgejo/workflows/rockylinux_9.yaml b/.forgejo/workflows/rockylinux_9.yaml index ade91f1..201e082 100644 --- a/.forgejo/workflows/rockylinux_9.yaml +++ b/.forgejo/workflows/rockylinux_9.yaml @@ -4,13 +4,13 @@ jobs: container: image: rockylinux:9 steps: - - name: cidd + - name: pidd run: > - ${{vars.CIDD}} - "${{secrets.CIDD_SSH_KEY}}" - "${{vars.CIDD_SSH_HOSTS}}" + ${{vars.PIDD}} + "${{secrets.PIDD_SSH_KEY}}" + "${{vars.PIDD_SSH_HOSTS}}" - - run: cidd-list-environment - - run: cidd-clone-branch - - run: cidd-build-project - - run: cidd-browse-workspace + - run: pidd-list-environment + - run: pidd-clone-branch + - run: pidd-build-project + - run: pidd-browse-workspace diff --git a/.forgejo/workflows/ubuntu_jammy.yaml b/.forgejo/workflows/ubuntu_jammy.yaml index 35c94da..0b57630 100644 --- a/.forgejo/workflows/ubuntu_jammy.yaml +++ b/.forgejo/workflows/ubuntu_jammy.yaml @@ -4,13 +4,13 @@ jobs: container: image: ubuntu:jammy steps: - - name: cidd + - name: pidd run: > - ${{vars.CIDD}} - "${{secrets.CIDD_SSH_KEY}}" - "${{vars.CIDD_SSH_HOSTS}}" + ${{vars.PIDD}} + "${{secrets.PIDD_SSH_KEY}}" + "${{vars.PIDD_SSH_HOSTS}}" - - run: cidd-list-environment - - run: cidd-clone-branch - - run: cidd-build-project - - run: cidd-browse-workspace + - run: pidd-list-environment + - run: pidd-clone-branch + - run: pidd-build-project + - run: pidd-browse-workspace diff --git a/.forgejo/workflows/ubuntu_noble.yaml b/.forgejo/workflows/ubuntu_noble.yaml index fcee748..58950cc 100644 --- a/.forgejo/workflows/ubuntu_noble.yaml +++ b/.forgejo/workflows/ubuntu_noble.yaml @@ -4,13 +4,13 @@ jobs: container: image: ubuntu:noble steps: - - name: cidd + - name: pidd run: > - ${{vars.CIDD}} - "${{secrets.CIDD_SSH_KEY}}" - "${{vars.CIDD_SSH_HOSTS}}" + ${{vars.PIDD}} + "${{secrets.PIDD_SSH_KEY}}" + "${{vars.PIDD_SSH_HOSTS}}" - - run: cidd-list-environment - - run: cidd-clone-branch - - run: cidd-build-project - - run: cidd-browse-workspace + - run: pidd-list-environment + - run: pidd-clone-branch + - run: pidd-build-project + - run: pidd-browse-workspace diff --git a/.github/workflows/debian:bookworm.yaml b/.github/workflows/debian:bookworm.yaml index ae792ac..9790b19 100644 --- a/.github/workflows/debian:bookworm.yaml +++ b/.github/workflows/debian:bookworm.yaml @@ -5,14 +5,14 @@ jobs: container: image: debian:bookworm steps: - - name: cidd + - name: pidd run: > - echo '${{vars.CIDD}}' | tr -d '\r' | sh -s - "${{secrets.CIDD_SSH_KEY}}" - "${{vars.CIDD_SSH_HOSTS}}" + echo '${{vars.PIDD}}' | tr -d '\r' | sh -s + "${{secrets.PIDD_SSH_KEY}}" + "${{vars.PIDD_SSH_HOSTS}}" - - run: cidd-list-environment - - run: cidd-clone-branch - - run: cidd-build-project - - run: cidd-browse-workspace - - run: cidd-synchronize + - run: pidd-list-environment + - run: pidd-clone-branch + - run: pidd-build-project + - run: pidd-browse-workspace + - run: pidd-synchronize diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 012af4b..adab647 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,11 +2,11 @@ image: debian:bookworm job: script: - > - sh ${CIDD} - ${CIDD_SSH_KEY} - ${CIDD_SSH_HOSTS} + sh ${PIDD} + ${PIDD_SSH_KEY} + ${PIDD_SSH_HOSTS} - - cidd-list-environment - - cidd-clone-branch - - cidd-build-project - - cidd-browse-workspace + - pidd-list-environment + - pidd-clone-branch + - pidd-build-project + - pidd-browse-workspace diff --git a/pidd.sh b/pidd.sh index 111b73c..83d40b9 100644 --- a/pidd.sh +++ b/pidd.sh @@ -1,176 +1,176 @@ #! /usr/bin/env sh # defaults -[ -n "${CIDD_DNS}" ] || CIDD_DNS="\ +[ -n "${PIDD_DNS}" ] || PIDD_DNS="\ 9.9.9.9 \ " -[ -n "${CIDD_GIT_CHILD}" ] || CIDD_GIT_CHILD="cd" -[ -n "${CIDD_GIT_PARENT}" ] || CIDD_GIT_PARENT="rwx" +[ -n "${PIDD_GIT_CHILD}" ] || PIDD_GIT_CHILD="cd" +[ -n "${PIDD_GIT_PARENT}" ] || PIDD_GIT_PARENT="rwx" # main -cidd_main () { - cidd_set_environment_variables - cidd_set_packages_repositories - cidd_set_packages_configuration +pidd_main () { + pidd_set_environment_variables + pidd_set_packages_repositories + pidd_set_packages_configuration # - cidd_list_working_directory - cidd_set_https_verification_off - cidd_set_dns_resolving - cidd_update_packages_catalog - cidd_install_packages_tools - cidd_install_ca_certificates - cidd_write_ca_certificates - cidd_update_ca_certificates - cidd_set_https_verification_on - cidd_update_packages_catalog - cidd_upgrade_packages - cidd_install_git - cidd_install_python + pidd_list_working_directory + pidd_set_https_verification_off + pidd_set_dns_resolving + pidd_update_packages_catalog + pidd_install_packages_tools + pidd_install_ca_certificates + pidd_write_ca_certificates + pidd_update_ca_certificates + pidd_set_https_verification_on + pidd_update_packages_catalog + pidd_upgrade_packages + pidd_install_git + pidd_install_python # TODO move to Python - cidd_install_rsync + pidd_install_rsync # TODO move to Python - cidd_install_ssh - cidd_clean_packages_cache - cidd_install_python_modules - cidd_write_python_module - cidd_switch_to_python "${@}" + pidd_install_ssh + pidd_clean_packages_cache + pidd_install_python_modules + pidd_write_python_module + pidd_switch_to_python "${@}" } # steps -cidd_set_environment_variables () { - cidd_step "Set environment variables" +pidd_set_environment_variables () { + pidd_step "Set environment variables" # set path - CIDD_PATH="$(realpath "${0}")" - cidd_echo "CIDD_PATH" + PIDD_PATH="$(realpath "${0}")" + pidd_echo "PIDD_PATH" # set operating system id - CIDD_OS_ID="$(cidd_grep_os ID)" - case "${CIDD_OS_ID}" in - "almalinux") CIDD_OS_ID="${CIDD_OS_ALMA}" ;; - "alpine") CIDD_OS_ID="${CIDD_OS_ALPINE}" ;; - "arch") CIDD_OS_ID="${CIDD_OS_ARCH}" ;; - "debian") CIDD_OS_ID="${CIDD_OS_DEBIAN}" ;; - "fedora") CIDD_OS_ID="${CIDD_OS_FEDORA}" ;; - "rocky") CIDD_OS_ID="${CIDD_OS_ROCKY}" ;; - "ubuntu") CIDD_OS_ID="${CIDD_OS_UBUNTU}" ;; - *) cidd_error_os "CIDD_OS_ID" ;; + PIDD_OS_ID="$(pidd_grep_os ID)" + case "${PIDD_OS_ID}" in + "almalinux") PIDD_OS_ID="${PIDD_OS_ALMA}" ;; + "alpine") PIDD_OS_ID="${PIDD_OS_ALPINE}" ;; + "arch") PIDD_OS_ID="${PIDD_OS_ARCH}" ;; + "debian") PIDD_OS_ID="${PIDD_OS_DEBIAN}" ;; + "fedora") PIDD_OS_ID="${PIDD_OS_FEDORA}" ;; + "rocky") PIDD_OS_ID="${PIDD_OS_ROCKY}" ;; + "ubuntu") PIDD_OS_ID="${PIDD_OS_UBUNTU}" ;; + *) pidd_error_os "PIDD_OS_ID" ;; esac # set operating system version - case "${CIDD_OS_ID}" in - "${CIDD_OS_ALMA}"|"${CIDD_OS_ARCH}"|"${CIDD_OS_FEDORA}"|"${CIDD_OS_ROCKY}") - CIDD_OS_VERSION=$(cidd_grep_os VERSION_ID \ + case "${PIDD_OS_ID}" in + "${PIDD_OS_ALMA}"|"${PIDD_OS_ARCH}"|"${PIDD_OS_FEDORA}"|"${PIDD_OS_ROCKY}") + PIDD_OS_VERSION=$(pidd_grep_os VERSION_ID \ | sed "s|^\([0-9]\+\)\..*|\1|") ;; - "${CIDD_OS_ALPINE}") - CIDD_OS_VERSION=$(cidd_grep_os VERSION_ID \ + "${PIDD_OS_ALPINE}") + PIDD_OS_VERSION=$(pidd_grep_os VERSION_ID \ | sed "s|^\([0-9]\+\.[0-9]\+\)\..*|\1|") ;; - "${CIDD_OS_DEBIAN}"|"${CIDD_OS_UBUNTU}") - CIDD_OS_VERSION="$(cidd_grep_os VERSION_CODENAME)" + "${PIDD_OS_DEBIAN}"|"${PIDD_OS_UBUNTU}") + PIDD_OS_VERSION="$(pidd_grep_os VERSION_CODENAME)" ;; *) esac # check operating system version - case "${CIDD_OS_ID}" in - "${CIDD_OS_ALMA}"|"${CIDD_OS_ROCKY}") - case "${CIDD_OS_VERSION}" in + case "${PIDD_OS_ID}" in + "${PIDD_OS_ALMA}"|"${PIDD_OS_ROCKY}") + case "${PIDD_OS_VERSION}" in "8"|"9") ;; - *) cidd_error_os "CIDD_OS_VERSION" ;; + *) pidd_error_os "PIDD_OS_VERSION" ;; esac ;; - "${CIDD_OS_ALPINE}") - case "${CIDD_OS_VERSION}" in + "${PIDD_OS_ALPINE}") + case "${PIDD_OS_VERSION}" in "3.18"|"3.19") ;; - *) cidd_error_os "CIDD_OS_VERSION" ;; + *) pidd_error_os "PIDD_OS_VERSION" ;; esac ;; - "${CIDD_OS_ARCH}") - case "${CIDD_OS_VERSION}" in + "${PIDD_OS_ARCH}") + case "${PIDD_OS_VERSION}" in "20231112"|"20240101") ;; - *) cidd_error_os "CIDD_OS_VERSION" ;; + *) pidd_error_os "PIDD_OS_VERSION" ;; esac ;; - "${CIDD_OS_DEBIAN}") - case "${CIDD_OS_VERSION}" in + "${PIDD_OS_DEBIAN}") + case "${PIDD_OS_VERSION}" in "bookworm"|"bullseye") ;; - *) cidd_error_os "CIDD_OS_VERSION" ;; + *) pidd_error_os "PIDD_OS_VERSION" ;; esac ;; - "${CIDD_OS_FEDORA}") - case "${CIDD_OS_VERSION}" in + "${PIDD_OS_FEDORA}") + case "${PIDD_OS_VERSION}" in "39"|"40") ;; - *) cidd_error_os "CIDD_OS_VERSION" ;; + *) pidd_error_os "PIDD_OS_VERSION" ;; esac ;; - "${CIDD_OS_UBUNTU}") - case "${CIDD_OS_VERSION}" in + "${PIDD_OS_UBUNTU}") + case "${PIDD_OS_VERSION}" in "jammy"|"noble") ;; - *) cidd_error_os "CIDD_OS_VERSION" ;; + *) pidd_error_os "PIDD_OS_VERSION" ;; esac ;; *) esac - cidd_split - cidd_echo "CIDD_OS_ID" "CIDD_OS_VERSION" + pidd_split + pidd_echo "PIDD_OS_ID" "PIDD_OS_VERSION" # universal - CIDD_DNS_FILE="/etc/resolv.conf" - CIDD_PKG_CA="ca-certificates" - CIDD_PKG_GIT="git" + PIDD_DNS_FILE="/etc/resolv.conf" + PIDD_PKG_CA="ca-certificates" + PIDD_PKG_GIT="git" # TODO move to Python - CIDD_PKG_RSYNC="rsync" - CIDD_PYTHON_ALIAS="python3" - cidd_split - cidd_echo "CIDD_DNS_FILE" "CIDD_PKG_CA" "CIDD_PKG_GIT" "CIDD_PYTHON_ALIAS" + PIDD_PKG_RSYNC="rsync" + PIDD_PYTHON_ALIAS="python3" + pidd_split + pidd_echo "PIDD_DNS_FILE" "PIDD_PKG_CA" "PIDD_PKG_GIT" "PIDD_PYTHON_ALIAS" # set ca command & root - case "${CIDD_OS_ID}" in - "${CIDD_OS_ALMA}"|"${CIDD_OS_FEDORA}"|"${CIDD_OS_ROCKY}") - CIDD_CA_ROOT="/etc/pki/ca-trust/source/anchors" - CIDD_CMD_CA="update-ca-trust" + case "${PIDD_OS_ID}" in + "${PIDD_OS_ALMA}"|"${PIDD_OS_FEDORA}"|"${PIDD_OS_ROCKY}") + PIDD_CA_ROOT="/etc/pki/ca-trust/source/anchors" + PIDD_CMD_CA="update-ca-trust" ;; - "${CIDD_OS_ALPINE}") - CIDD_CA_ROOT="/usr/local/share/ca-certificates" - CIDD_CMD_CA="update-ca-certificates" + "${PIDD_OS_ALPINE}") + PIDD_CA_ROOT="/usr/local/share/ca-certificates" + PIDD_CMD_CA="update-ca-certificates" ;; - "${CIDD_OS_ARCH}") - CIDD_CA_ROOT="/etc/ca-certificates/trust-source/anchors" - CIDD_CMD_CA="update-ca-trust" + "${PIDD_OS_ARCH}") + PIDD_CA_ROOT="/etc/ca-certificates/trust-source/anchors" + PIDD_CMD_CA="update-ca-trust" ;; - "${CIDD_OS_DEBIAN}"|"${CIDD_OS_UBUNTU}") - CIDD_CA_ROOT="/usr/local/share/ca-certificates" - CIDD_CMD_CA="update-ca-certificates" + "${PIDD_OS_DEBIAN}"|"${PIDD_OS_UBUNTU}") + PIDD_CA_ROOT="/usr/local/share/ca-certificates" + PIDD_CMD_CA="update-ca-certificates" ;; *) esac - cidd_split - cidd_echo "CIDD_CA_ROOT" "CIDD_CMD_CA" + pidd_split + pidd_echo "PIDD_CA_ROOT" "PIDD_CMD_CA" # set package manager - case "${CIDD_OS_ID}" in - "${CIDD_OS_ALPINE}") - CIDD_PM="${CIDD_PM_APK}" + case "${PIDD_OS_ID}" in + "${PIDD_OS_ALPINE}") + PIDD_PM="${PIDD_PM_APK}" ;; - "${CIDD_OS_DEBIAN}"|"${CIDD_OS_UBUNTU}") - CIDD_PM="${CIDD_PM_APT}" + "${PIDD_OS_DEBIAN}"|"${PIDD_OS_UBUNTU}") + PIDD_PM="${PIDD_PM_APT}" ;; - "${CIDD_OS_ALMA}"|"${CIDD_OS_FEDORA}"|"${CIDD_OS_ROCKY}") - CIDD_PM="${CIDD_PM_DNF}" + "${PIDD_OS_ALMA}"|"${PIDD_OS_FEDORA}"|"${PIDD_OS_ROCKY}") + PIDD_PM="${PIDD_PM_DNF}" ;; - "${CIDD_OS_ARCH}") - CIDD_PM="${CIDD_PM_PACMAN}" + "${PIDD_OS_ARCH}") + PIDD_PM="${PIDD_PM_PACMAN}" ;; *) esac - cidd_split - cidd_echo "CIDD_PM" - case "${CIDD_PM}" in - "${CIDD_PM_DNF}") - CIDD_PM_CLEAN="dnf clean all" - CIDD_PM_INSTALL="dnf install --assumeyes" - CIDD_PM_QUERY="rpm --query" - CIDD_PM_UPDATE="dnf makecache" - CIDD_PM_UPGRADE="dnf upgrade --assumeyes" - CIDD_PKG_PKG="" - CIDD_PM_CONF_PATH="/etc/dnf/dnf.conf" - CIDD_PM_CONF_TEXT="\ + pidd_split + pidd_echo "PIDD_PM" + case "${PIDD_PM}" in + "${PIDD_PM_DNF}") + PIDD_PM_CLEAN="dnf clean all" + PIDD_PM_INSTALL="dnf install --assumeyes" + PIDD_PM_QUERY="rpm --query" + PIDD_PM_UPDATE="dnf makecache" + PIDD_PM_UPGRADE="dnf upgrade --assumeyes" + PIDD_PKG_PKG="" + PIDD_PM_CONF_PATH="/etc/dnf/dnf.conf" + PIDD_PM_CONF_TEXT="\ [main] best=True clean_requirements_on_remove=True @@ -178,302 +178,302 @@ gpgcheck=1 installonly_limit=3 skip_if_unavailable=False " - CIDD_PM_HTTPS_PATH="/etc/dnf/dnf.conf.d/https.conf" - CIDD_PM_HTTPS_TEXT="\ + PIDD_PM_HTTPS_PATH="/etc/dnf/dnf.conf.d/https.conf" + PIDD_PM_HTTPS_TEXT="\ sslverify=False " ;; - "${CIDD_PM_APK}") - CIDD_PM_CLEAN="apk cache purge" - CIDD_PM_INSTALL="apk add" - CIDD_PM_QUERY="apk info" - CIDD_PM_UPDATE="apk update" - CIDD_PM_UPGRADE="apk upgrade" - CIDD_PKG_PKG="" - CIDD_PM_CONF_PATH="" - CIDD_PM_CONF_TEXT="" - CIDD_PM_HTTPS_PATH="/etc/apk/repositories.d/https" - CIDD_PM_HTTPS_TEXT="\ + "${PIDD_PM_APK}") + PIDD_PM_CLEAN="apk cache purge" + PIDD_PM_INSTALL="apk add" + PIDD_PM_QUERY="apk info" + PIDD_PM_UPDATE="apk update" + PIDD_PM_UPGRADE="apk upgrade" + PIDD_PKG_PKG="" + PIDD_PM_CONF_PATH="" + PIDD_PM_CONF_TEXT="" + PIDD_PM_HTTPS_PATH="/etc/apk/repositories.d/https" + PIDD_PM_HTTPS_TEXT="\ --no-verify " ;; - "${CIDD_PM_PACMAN}") - CIDD_PM_CLEAN="pacman --sync --clean --noconfirm" - CIDD_PM_INSTALL="pacman --sync --noconfirm" - CIDD_PM_QUERY="pacman --query" - CIDD_PM_UPDATE="pacman --sync --refresh" - CIDD_PM_UPGRADE="pacman --sync --sysupgrade --noconfirm" - CIDD_PKG_PKG="" - CIDD_PM_CONF_PATH="" - CIDD_PM_CONF_TEXT="" - CIDD_PM_HTTPS_PATH="/etc/pacman.d/https.conf" - CIDD_PM_HTTPS_TEXT="\ + "${PIDD_PM_PACMAN}") + PIDD_PM_CLEAN="pacman --sync --clean --noconfirm" + PIDD_PM_INSTALL="pacman --sync --noconfirm" + PIDD_PM_QUERY="pacman --query" + PIDD_PM_UPDATE="pacman --sync --refresh" + PIDD_PM_UPGRADE="pacman --sync --sysupgrade --noconfirm" + PIDD_PKG_PKG="" + PIDD_PM_CONF_PATH="" + PIDD_PM_CONF_TEXT="" + PIDD_PM_HTTPS_PATH="/etc/pacman.d/https.conf" + PIDD_PM_HTTPS_TEXT="\ SSLVerify = No " ;; - "${CIDD_PM_APT}") - CIDD_PM_CLEAN="apt-get clean" - CIDD_PM_INSTALL="apt-get install --assume-yes" - CIDD_PM_QUERY="dpkg-query --show" - CIDD_PM_UPDATE="apt-get update" - CIDD_PM_UPGRADE="apt-get upgrade --assume-yes" - CIDD_PKG_PKG="apt-utils" - CIDD_PM_CONF_PATH="/etc/apt/apt.conf.d/apt.conf" - CIDD_PM_CONF_TEXT="\ + "${PIDD_PM_APT}") + PIDD_PM_CLEAN="apt-get clean" + PIDD_PM_INSTALL="apt-get install --assume-yes" + PIDD_PM_QUERY="dpkg-query --show" + PIDD_PM_UPDATE="apt-get update" + PIDD_PM_UPGRADE="apt-get upgrade --assume-yes" + PIDD_PKG_PKG="apt-utils" + PIDD_PM_CONF_PATH="/etc/apt/apt.conf.d/apt.conf" + PIDD_PM_CONF_TEXT="\ Acquire::Check-Valid-Until True; APT::Get::Show-Versions True; APT::Install-Recommends False; APT::Install-Suggests False; Dir::Etc::SourceParts \"\"; " - CIDD_PM_HTTPS_PATH="/etc/apt/apt.conf.d/https" - CIDD_PM_HTTPS_TEXT="\ + PIDD_PM_HTTPS_PATH="/etc/apt/apt.conf.d/https" + PIDD_PM_HTTPS_TEXT="\ Acquire::https::Verify-Peer False; " ;; *) esac - cidd_split - cidd_echo "CIDD_PM_CLEAN" \ - "CIDD_PM_INSTALL" "CIDD_PM_QUERY" "CIDD_PM_UPDATE" "CIDD_PM_UPGRADE" - cidd_split - cidd_echo "CIDD_PKG_PKG" "CIDD_PM_CONF_PATH" "CIDD_PM_HTTPS_PATH" + pidd_split + pidd_echo "PIDD_PM_CLEAN" \ + "PIDD_PM_INSTALL" "PIDD_PM_QUERY" "PIDD_PM_UPDATE" "PIDD_PM_UPGRADE" + pidd_split + pidd_echo "PIDD_PKG_PKG" "PIDD_PM_CONF_PATH" "PIDD_PM_HTTPS_PATH" # specific - case "${CIDD_OS_ID}" in - "${CIDD_OS_ALMA}") - CIDD_URL_DEFAULT="https://repo.almalinux.org/almalinux" + case "${PIDD_OS_ID}" in + "${PIDD_OS_ALMA}") + PIDD_URL_DEFAULT="https://repo.almalinux.org/almalinux" ;; - "${CIDD_OS_ALPINE}") - CIDD_URL_DEFAULT="https://dl-cdn.alpinelinux.org/alpine" + "${PIDD_OS_ALPINE}") + PIDD_URL_DEFAULT="https://dl-cdn.alpinelinux.org/alpine" ;; - "${CIDD_OS_ARCH}") - CIDD_URL_DEFAULT="https://geo.mirror.pkgbuild.com" + "${PIDD_OS_ARCH}") + PIDD_URL_DEFAULT="https://geo.mirror.pkgbuild.com" ;; - "${CIDD_OS_DEBIAN}") - CIDD_URL_DEFAULT="http://deb.debian.org/debian" + "${PIDD_OS_DEBIAN}") + PIDD_URL_DEFAULT="http://deb.debian.org/debian" ;; - "${CIDD_OS_FEDORA}") - CIDD_URL_DEFAULT="http://download.example/pub/fedora/linux/releases" + "${PIDD_OS_FEDORA}") + PIDD_URL_DEFAULT="http://download.example/pub/fedora/linux/releases" ;; - "${CIDD_OS_ROCKY}") - CIDD_URL_DEFAULT="http://dl.rockylinux.org/\$contentdir" + "${PIDD_OS_ROCKY}") + PIDD_URL_DEFAULT="http://dl.rockylinux.org/\$contentdir" ;; - "${CIDD_OS_UBUNTU}") - CIDD_URL_DEFAULT="http://archive.ubuntu.com/ubuntu" + "${PIDD_OS_UBUNTU}") + PIDD_URL_DEFAULT="http://archive.ubuntu.com/ubuntu" ;; *) esac - CIDD_URL_CHOSEN="${CIDD_URL_DEFAULT}" - case "${CIDD_OS_ID}" in - "${CIDD_OS_ALMA}") - [ -n "${CIDD_URL_ALMA}" ] && CIDD_URL_CHOSEN="${CIDD_URL_ALMA}" + PIDD_URL_CHOSEN="${PIDD_URL_DEFAULT}" + case "${PIDD_OS_ID}" in + "${PIDD_OS_ALMA}") + [ -n "${PIDD_URL_ALMA}" ] && PIDD_URL_CHOSEN="${PIDD_URL_ALMA}" ;; - "${CIDD_OS_ALPINE}") - [ -n "${CIDD_URL_ALPINE}" ] && CIDD_URL_CHOSEN="${CIDD_URL_ALPINE}" + "${PIDD_OS_ALPINE}") + [ -n "${PIDD_URL_ALPINE}" ] && PIDD_URL_CHOSEN="${PIDD_URL_ALPINE}" ;; - "${CIDD_OS_ARCH}") - [ -n "${CIDD_URL_ARCH}" ] && CIDD_URL_CHOSEN="${CIDD_URL_ARCH}" + "${PIDD_OS_ARCH}") + [ -n "${PIDD_URL_ARCH}" ] && PIDD_URL_CHOSEN="${PIDD_URL_ARCH}" ;; - "${CIDD_OS_DEBIAN}") - [ -n "${CIDD_URL_DEBIAN}" ] && CIDD_URL_CHOSEN="${CIDD_URL_DEBIAN}" \ - || CIDD_URL_CHOSEN="https://deb.debian.org/debian" + "${PIDD_OS_DEBIAN}") + [ -n "${PIDD_URL_DEBIAN}" ] && PIDD_URL_CHOSEN="${PIDD_URL_DEBIAN}" \ + || PIDD_URL_CHOSEN="https://deb.debian.org/debian" ;; - "${CIDD_OS_FEDORA}") - [ -n "${CIDD_URL_FEDORA}" ] && CIDD_URL_CHOSEN="${CIDD_URL_FEDORA}" \ - || CIDD_URL_CHOSEN="https://rpmfind.net/linux/fedora/linux/releases" + "${PIDD_OS_FEDORA}") + [ -n "${PIDD_URL_FEDORA}" ] && PIDD_URL_CHOSEN="${PIDD_URL_FEDORA}" \ + || PIDD_URL_CHOSEN="https://rpmfind.net/linux/fedora/linux/releases" ;; - "${CIDD_OS_ROCKY}") - [ -n "${CIDD_URL_ROCKY}" ] && CIDD_URL_CHOSEN="${CIDD_URL_ROCKY}" \ - || CIDD_URL_CHOSEN="https://dl.rockylinux.org/\$contentdir" + "${PIDD_OS_ROCKY}") + [ -n "${PIDD_URL_ROCKY}" ] && PIDD_URL_CHOSEN="${PIDD_URL_ROCKY}" \ + || PIDD_URL_CHOSEN="https://dl.rockylinux.org/\$contentdir" ;; - "${CIDD_OS_UBUNTU}") - [ -n "${CIDD_URL_UBUNTU}" ] && CIDD_URL_CHOSEN="${CIDD_URL_UBUNTU}" \ - || CIDD_URL_CHOSEN="https://ubuntu.mirrors.ovh.net/ubuntu" + "${PIDD_OS_UBUNTU}") + [ -n "${PIDD_URL_UBUNTU}" ] && PIDD_URL_CHOSEN="${PIDD_URL_UBUNTU}" \ + || PIDD_URL_CHOSEN="https://ubuntu.mirrors.ovh.net/ubuntu" ;; *) esac - cidd_split - cidd_echo "CIDD_URL_DEFAULT" "CIDD_URL_CHOSEN" + pidd_split + pidd_echo "PIDD_URL_DEFAULT" "PIDD_URL_CHOSEN" # set python command & package - case "${CIDD_OS_ID}" in - "${CIDD_OS_ALMA}"|"${CIDD_OS_ROCKY}") - CIDD_PYTHON_COMMAND="python3.11" - CIDD_PYTHON_PACKAGE="python3.11" + case "${PIDD_OS_ID}" in + "${PIDD_OS_ALMA}"|"${PIDD_OS_ROCKY}") + PIDD_PYTHON_COMMAND="python3.11" + PIDD_PYTHON_PACKAGE="python3.11" ;; - "${CIDD_OS_ALPINE}") - CIDD_PYTHON_COMMAND="python3.11" - CIDD_PYTHON_PACKAGE="python3" + "${PIDD_OS_ALPINE}") + PIDD_PYTHON_COMMAND="python3.11" + PIDD_PYTHON_PACKAGE="python3" ;; - "${CIDD_OS_ARCH}") - CIDD_PYTHON_COMMAND="python3.12" - CIDD_PYTHON_PACKAGE="python" + "${PIDD_OS_ARCH}") + PIDD_PYTHON_COMMAND="python3.12" + PIDD_PYTHON_PACKAGE="python" ;; - "${CIDD_OS_DEBIAN}") - case "${CIDD_OS_VERSION}" in - "bookworm") CIDD_PYTHON_COMMAND="python3.11" ;; - "bullseye") CIDD_PYTHON_COMMAND="python3.9" ;; + "${PIDD_OS_DEBIAN}") + case "${PIDD_OS_VERSION}" in + "bookworm") PIDD_PYTHON_COMMAND="python3.11" ;; + "bullseye") PIDD_PYTHON_COMMAND="python3.9" ;; *) esac - CIDD_PYTHON_PACKAGE="python3" + PIDD_PYTHON_PACKAGE="python3" ;; - "${CIDD_OS_FEDORA}") - CIDD_PYTHON_COMMAND="python3.12" - CIDD_PYTHON_PACKAGE="python3" + "${PIDD_OS_FEDORA}") + PIDD_PYTHON_COMMAND="python3.12" + PIDD_PYTHON_PACKAGE="python3" ;; - "${CIDD_OS_UBUNTU}") - case "${CIDD_OS_VERSION}" in - "noble") CIDD_PYTHON_COMMAND="python3.12" ;; - "jammy") CIDD_PYTHON_COMMAND="python3.10" ;; + "${PIDD_OS_UBUNTU}") + case "${PIDD_OS_VERSION}" in + "noble") PIDD_PYTHON_COMMAND="python3.12" ;; + "jammy") PIDD_PYTHON_COMMAND="python3.10" ;; *) esac - CIDD_PYTHON_PACKAGE="python3" + PIDD_PYTHON_PACKAGE="python3" ;; *) esac # set python packages - case "${CIDD_OS_ID}" in - "${CIDD_OS_ALMA}"|"${CIDD_OS_FEDORA}"|"${CIDD_OS_ROCKY}") - CIDD_PYTHON_PACKAGES="/usr/lib64/${CIDD_PYTHON_COMMAND}/site-packages" + case "${PIDD_OS_ID}" in + "${PIDD_OS_ALMA}"|"${PIDD_OS_FEDORA}"|"${PIDD_OS_ROCKY}") + PIDD_PYTHON_PACKAGES="/usr/lib64/${PIDD_PYTHON_COMMAND}/site-packages" ;; - "${CIDD_OS_ALPINE}"|"${CIDD_OS_ARCH}") - CIDD_PYTHON_PACKAGES="/usr/lib/${CIDD_PYTHON_COMMAND}/site-packages" + "${PIDD_OS_ALPINE}"|"${PIDD_OS_ARCH}") + PIDD_PYTHON_PACKAGES="/usr/lib/${PIDD_PYTHON_COMMAND}/site-packages" ;; - "${CIDD_OS_DEBIAN}"|"${CIDD_OS_UBUNTU}") - CIDD_PYTHON_PACKAGES="/usr/lib/${CIDD_PYTHON_ALIAS}/dist-packages" + "${PIDD_OS_DEBIAN}"|"${PIDD_OS_UBUNTU}") + PIDD_PYTHON_PACKAGES="/usr/lib/${PIDD_PYTHON_ALIAS}/dist-packages" ;; *) esac - cidd_split - cidd_echo "CIDD_PYTHON_COMMAND" "CIDD_PYTHON_PACKAGE" "CIDD_PYTHON_PACKAGES" + pidd_split + pidd_echo "PIDD_PYTHON_COMMAND" "PIDD_PYTHON_PACKAGE" "PIDD_PYTHON_PACKAGES" # variables - [ -n "${CIDD_CA_1}" ] && CIDD_CA=true + [ -n "${PIDD_CA_1}" ] && PIDD_CA=true # continuous integration platform if [ -n "${GITHUB_ACTIONS}" ] ; then # github → gitea → forgejo if [ -n "${GITHUB_SERVER_URL}" ] ; then - CIDD_SERVER_URL="${GITHUB_SERVER_URL}" + PIDD_SERVER_URL="${GITHUB_SERVER_URL}" else - cidd_error_ci "GITHUB_SERVER_URL" + pidd_error_ci "GITHUB_SERVER_URL" fi if [ -n "${GITHUB_REPOSITORY}" ] ; then - CIDD_PROJECTS_GROUP="$(dirname "${GITHUB_REPOSITORY}")" - CIDD_PROJECT_NAME="$(basename "${GITHUB_REPOSITORY}")" + PIDD_PROJECTS_GROUP="$(dirname "${GITHUB_REPOSITORY}")" + PIDD_PROJECT_NAME="$(basename "${GITHUB_REPOSITORY}")" else - cidd_error_ci "GITHUB_REPOSITORY" + pidd_error_ci "GITHUB_REPOSITORY" fi if [ -n "${GITHUB_REF_NAME}" ] ; then - CIDD_PROJECT_BRANCH="${GITHUB_REF_NAME}" + PIDD_PROJECT_BRANCH="${GITHUB_REF_NAME}" else - cidd_error_ci "GITHUB_REF_NAME" + pidd_error_ci "GITHUB_REF_NAME" fi elif [ -n "${GITLAB_CI}" ] ; then # gitlab if [ -n "${CI_SERVER_URL}" ] ; then - CIDD_SERVER_URL="${CI_SERVER_URL}" + PIDD_SERVER_URL="${CI_SERVER_URL}" else - cidd_error_ci "CI_SERVER_URL" + pidd_error_ci "CI_SERVER_URL" fi if [ -n "${CI_PROJECT_PATH}" ] ; then - CIDD_PROJECTS_GROUP="$(dirname "${CI_PROJECT_PATH}")" - CIDD_PROJECT_NAME="$(basename "${CI_PROJECT_PATH}")" + PIDD_PROJECTS_GROUP="$(dirname "${CI_PROJECT_PATH}")" + PIDD_PROJECT_NAME="$(basename "${CI_PROJECT_PATH}")" else - cidd_error_ci "CI_PROJECT_PATH" + pidd_error_ci "CI_PROJECT_PATH" fi if [ -n "${CI_COMMIT_BRANCH}" ] ; then - CIDD_PROJECT_BRANCH="${CI_COMMIT_BRANCH}" + PIDD_PROJECT_BRANCH="${CI_COMMIT_BRANCH}" else - cidd_error_ci "CI_COMMIT_BRANCH" + pidd_error_ci "CI_COMMIT_BRANCH" fi else # unsupported - cidd_error_ci "ø" + pidd_error_ci "ø" fi - [ -n "${CIDD_SERVER_URL}" ] || cidd_error_ci "CIDD_SERVER_URL" - [ -n "${CIDD_PROJECTS_GROUP}" ] || cidd_error_ci "CIDD_PROJECTS_GROUP" - [ -n "${CIDD_PROJECT_NAME}" ] || cidd_error_ci "CIDD_PROJECT_NAME" - [ -n "${CIDD_PROJECT_BRANCH}" ] || cidd_error_ci "CIDD_PROJECT_BRANCH" + [ -n "${PIDD_SERVER_URL}" ] || pidd_error_ci "PIDD_SERVER_URL" + [ -n "${PIDD_PROJECTS_GROUP}" ] || pidd_error_ci "PIDD_PROJECTS_GROUP" + [ -n "${PIDD_PROJECT_NAME}" ] || pidd_error_ci "PIDD_PROJECT_NAME" + [ -n "${PIDD_PROJECT_BRANCH}" ] || pidd_error_ci "PIDD_PROJECT_BRANCH" # - CIDD_PROJECTS_URL="${CIDD_SERVER_URL}/${CIDD_PROJECTS_GROUP}" + PIDD_PROJECTS_URL="${PIDD_SERVER_URL}/${PIDD_PROJECTS_GROUP}" # - cidd_split - cidd_echo "CIDD_CA" - cidd_split - cidd_echo "CIDD_SERVER_URL" \ - "CIDD_PROJECTS_GROUP" "CIDD_PROJECT_NAME" "CIDD_PROJECT_BRANCH" - cidd_split - cidd_echo "CIDD_PROJECTS_URL" + pidd_split + pidd_echo "PIDD_CA" + pidd_split + pidd_echo "PIDD_SERVER_URL" \ + "PIDD_PROJECTS_GROUP" "PIDD_PROJECT_NAME" "PIDD_PROJECT_BRANCH" + pidd_split + pidd_echo "PIDD_PROJECTS_URL" # TODO move to Python - case "${CIDD_PM}" in - "${CIDD_PM_APK}"|"${CIDD_PM_APT}") CIDD_PKG_SSH="openssh-client" ;; - "${CIDD_PM_DNF}") CIDD_PKG_SSH="openssh-clients" ;; - "${CIDD_PM_PACMAN}") CIDD_PKG_SSH="openssh" ;; + case "${PIDD_PM}" in + "${PIDD_PM_APK}"|"${PIDD_PM_APT}") PIDD_PKG_SSH="openssh-client" ;; + "${PIDD_PM_DNF}") PIDD_PKG_SSH="openssh-clients" ;; + "${PIDD_PM_PACMAN}") PIDD_PKG_SSH="openssh" ;; *) esac } -cidd_set_packages_repositories () { - cidd_step "Set packages repositories" - case "${CIDD_OS_ID}" in - "${CIDD_OS_ALMA}") - case "${CIDD_OS_VERSION}" in +pidd_set_packages_repositories () { + pidd_step "Set packages repositories" + case "${PIDD_OS_ID}" in + "${PIDD_OS_ALMA}") + case "${PIDD_OS_VERSION}" in "8") \ -cidd_set_packages_repositories__file="/etc/yum.repos.d/almalinux.repo" ;; +pidd_set_packages_repositories__file="/etc/yum.repos.d/almalinux.repo" ;; "9") \ -cidd_set_packages_repositories__file="/etc/yum.repos.d/almalinux-baseos.repo" ;; +pidd_set_packages_repositories__file="/etc/yum.repos.d/almalinux-baseos.repo" ;; *) esac - cidd_sed "${cidd_set_packages_repositories__file}" \ + pidd_sed "${pidd_set_packages_repositories__file}" \ "|^mirrorlist|# mirrorlist|" \ - "|${CIDD_URL_DEFAULT}|${CIDD_URL_CHOSEN}|" \ + "|${PIDD_URL_DEFAULT}|${PIDD_URL_CHOSEN}|" \ "|^# baseurl|baseurl|" ;; - "${CIDD_OS_ALPINE}") - cidd_set_packages_repositories__file="/etc/apk/repositories" - cidd_write "${cidd_set_packages_repositories__file}" "\ -${CIDD_URL_CHOSEN}/v${CIDD_OS_VERSION}/main -${CIDD_URL_CHOSEN}/v${CIDD_OS_VERSION}/community + "${PIDD_OS_ALPINE}") + pidd_set_packages_repositories__file="/etc/apk/repositories" + pidd_write "${pidd_set_packages_repositories__file}" "\ +${PIDD_URL_CHOSEN}/v${PIDD_OS_VERSION}/main +${PIDD_URL_CHOSEN}/v${PIDD_OS_VERSION}/community " ;; - "${CIDD_OS_DEBIAN}") - cidd_set_packages_repositories__file="/etc/apt/sources.list" - cidd_write "${cidd_set_packages_repositories__file}" "\ -deb ${CIDD_URL_CHOSEN} ${CIDD_OS_VERSION} main -deb ${CIDD_URL_CHOSEN} ${CIDD_OS_VERSION}-backports main -deb ${CIDD_URL_CHOSEN} ${CIDD_OS_VERSION}-updates main -deb ${CIDD_URL_CHOSEN}-security ${CIDD_OS_VERSION}-security main + "${PIDD_OS_DEBIAN}") + pidd_set_packages_repositories__file="/etc/apt/sources.list" + pidd_write "${pidd_set_packages_repositories__file}" "\ +deb ${PIDD_URL_CHOSEN} ${PIDD_OS_VERSION} main +deb ${PIDD_URL_CHOSEN} ${PIDD_OS_VERSION}-backports main +deb ${PIDD_URL_CHOSEN} ${PIDD_OS_VERSION}-updates main +deb ${PIDD_URL_CHOSEN}-security ${PIDD_OS_VERSION}-security main " ;; - "${CIDD_OS_ROCKY}") - case "${CIDD_OS_VERSION}" in + "${PIDD_OS_ROCKY}") + case "${PIDD_OS_VERSION}" in "8") \ -cidd_set_packages_repositories__file="/etc/yum.repos.d/Rocky-BaseOS.repo" ;; +pidd_set_packages_repositories__file="/etc/yum.repos.d/Rocky-BaseOS.repo" ;; "9") \ -cidd_set_packages_repositories__file="/etc/yum.repos.d/rocky.repo" ;; +pidd_set_packages_repositories__file="/etc/yum.repos.d/rocky.repo" ;; *) esac - cidd_sed "${cidd_set_packages_repositories__file}" \ + pidd_sed "${pidd_set_packages_repositories__file}" \ "|^mirrorlist|# mirrorlist|" \ - "|${CIDD_URL_DEFAULT}|${CIDD_URL_CHOSEN}|" \ + "|${PIDD_URL_DEFAULT}|${PIDD_URL_CHOSEN}|" \ "|^#baseurl|baseurl|" ;; - "${CIDD_OS_UBUNTU}") - cidd_set_packages_repositories__file="/etc/apt/sources.list" - cidd_write "${cidd_set_packages_repositories__file}" "\ -deb ${CIDD_URL_CHOSEN} ${CIDD_OS_VERSION} main -deb ${CIDD_URL_CHOSEN} ${CIDD_OS_VERSION}-backports main -deb ${CIDD_URL_CHOSEN} ${CIDD_OS_VERSION}-updates main -deb ${CIDD_URL_CHOSEN} ${CIDD_OS_VERSION}-security main + "${PIDD_OS_UBUNTU}") + pidd_set_packages_repositories__file="/etc/apt/sources.list" + pidd_write "${pidd_set_packages_repositories__file}" "\ +deb ${PIDD_URL_CHOSEN} ${PIDD_OS_VERSION} main +deb ${PIDD_URL_CHOSEN} ${PIDD_OS_VERSION}-backports main +deb ${PIDD_URL_CHOSEN} ${PIDD_OS_VERSION}-updates main +deb ${PIDD_URL_CHOSEN} ${PIDD_OS_VERSION}-security main " ;; *) esac } -cidd_set_packages_configuration () { - cidd_step "Set packages configuration" - cidd_write "${CIDD_PM_CONF_PATH}" "${CIDD_PM_CONF_TEXT}" - case "${CIDD_OS_ID}" in - "${CIDD_OS_DEBIAN}"|"${CIDD_OS_UBUNTU}") +pidd_set_packages_configuration () { + pidd_step "Set packages configuration" + pidd_write "${PIDD_PM_CONF_PATH}" "${PIDD_PM_CONF_TEXT}" + case "${PIDD_OS_ID}" in + "${PIDD_OS_DEBIAN}"|"${PIDD_OS_UBUNTU}") export DEBIAN_FRONTEND="noninteractive" ;; *) @@ -482,336 +482,336 @@ cidd_set_packages_configuration () { # agnostic steps -cidd_list_working_directory () { - cidd_step "List working directory" - cidd_list_working_directory__path="$(realpath .)" - cidd_ls "${cidd_list_working_directory__path}" +pidd_list_working_directory () { + pidd_step "List working directory" + pidd_list_working_directory__path="$(realpath .)" + pidd_ls "${pidd_list_working_directory__path}" } -cidd_set_https_verification_off () { - if [ -n "${CIDD_CA}" ] || [ "${CIDD_PM}" = "${CIDD_PM_APT}" ] ; then - cidd_step "Set HTTPS verification off" - cidd_mkdir "$(dirname "${CIDD_PM_HTTPS_PATH}")" - cidd_write "${CIDD_PM_HTTPS_PATH}" "${CIDD_PM_HTTPS_TEXT}" +pidd_set_https_verification_off () { + if [ -n "${PIDD_CA}" ] || [ "${PIDD_PM}" = "${PIDD_PM_APT}" ] ; then + pidd_step "Set HTTPS verification off" + pidd_mkdir "$(dirname "${PIDD_PM_HTTPS_PATH}")" + pidd_write "${PIDD_PM_HTTPS_PATH}" "${PIDD_PM_HTTPS_TEXT}" fi } -cidd_set_dns_resolving () { - cidd_step "Set DNS resolving" - for cidd_set_dns_resolving__server in ${CIDD_DNS} ; do - cidd_set_dns_resolving__text="${cidd_set_dns_resolving__text}\ -nameserver ${cidd_set_dns_resolving__server} +pidd_set_dns_resolving () { + pidd_step "Set DNS resolving" + for pidd_set_dns_resolving__server in ${PIDD_DNS} ; do + pidd_set_dns_resolving__text="${pidd_set_dns_resolving__text}\ +nameserver ${pidd_set_dns_resolving__server} " done - cidd_write "${CIDD_DNS_FILE}" "${cidd_set_dns_resolving__text}" + pidd_write "${PIDD_DNS_FILE}" "${pidd_set_dns_resolving__text}" } -cidd_update_packages_catalog () { - cidd_step "Update packages catalog" - ${CIDD_PM_UPDATE} || exit +pidd_update_packages_catalog () { + pidd_step "Update packages catalog" + ${PIDD_PM_UPDATE} || exit } -cidd_install_packages_tools () { - cidd_step "Install packages tools" - cidd_install_package "${CIDD_PKG_PKG}" +pidd_install_packages_tools () { + pidd_step "Install packages tools" + pidd_install_package "${PIDD_PKG_PKG}" } -cidd_install_ca_certificates () { - cidd_step "Install CA" - cidd_install_package "${CIDD_PKG_CA}" +pidd_install_ca_certificates () { + pidd_step "Install CA" + pidd_install_package "${PIDD_PKG_CA}" } -cidd_write_ca_certificates () { - cidd_step "Write CA certificates" - cidd_mkdir "${CIDD_CA_ROOT}" - cidd_write_ca_certificates__index=1 - eval "cidd_write_ca_certificates__text=\ -\"\${CIDD_CA_${cidd_write_ca_certificates__index}}\"" - while [ -n "${cidd_write_ca_certificates__text}" ] ; do - cidd_write_ca_certificates__path="\ -${CIDD_CA_ROOT}/${cidd_write_ca_certificates__index}.crt" - cidd_split - cidd_write \ - "${cidd_write_ca_certificates__path}" \ - "${cidd_write_ca_certificates__text}" - cidd_openssl "${cidd_write_ca_certificates__path}" - cidd_write_ca_certificates__index=$((cidd_write_ca_certificates__index+1)) - eval "cidd_write_ca_certificates__text=\ -\"\${CIDD_CA_${cidd_write_ca_certificates__index}}\"" +pidd_write_ca_certificates () { + pidd_step "Write CA certificates" + pidd_mkdir "${PIDD_CA_ROOT}" + pidd_write_ca_certificates__index=1 + eval "pidd_write_ca_certificates__text=\ +\"\${PIDD_CA_${pidd_write_ca_certificates__index}}\"" + while [ -n "${pidd_write_ca_certificates__text}" ] ; do + pidd_write_ca_certificates__path="\ +${PIDD_CA_ROOT}/${pidd_write_ca_certificates__index}.crt" + pidd_split + pidd_write \ + "${pidd_write_ca_certificates__path}" \ + "${pidd_write_ca_certificates__text}" + pidd_openssl "${pidd_write_ca_certificates__path}" + pidd_write_ca_certificates__index=$((pidd_write_ca_certificates__index+1)) + eval "pidd_write_ca_certificates__text=\ +\"\${PIDD_CA_${pidd_write_ca_certificates__index}}\"" done } -cidd_update_ca_certificates () { - cidd_step "Update CA certificates" - ${CIDD_CMD_CA} || exit +pidd_update_ca_certificates () { + pidd_step "Update CA certificates" + ${PIDD_CMD_CA} || exit } -cidd_set_https_verification_on () { - cidd_step "Set HTTPS verification on" - cidd_rm "${CIDD_PM_HTTPS_PATH}" +pidd_set_https_verification_on () { + pidd_step "Set HTTPS verification on" + pidd_rm "${PIDD_PM_HTTPS_PATH}" } -cidd_upgrade_packages () { - cidd_step "Upgrade packages" - ${CIDD_PM_UPGRADE} || exit +pidd_upgrade_packages () { + pidd_step "Upgrade packages" + ${PIDD_PM_UPGRADE} || exit } -cidd_install_git () { - cidd_step "Install Git" - cidd_install_package "${CIDD_PKG_GIT}" +pidd_install_git () { + pidd_step "Install Git" + pidd_install_package "${PIDD_PKG_GIT}" } -cidd_install_python () { - cidd_step "Install Python" - cidd_install_package "${CIDD_PYTHON_PACKAGE}" - cidd_split - cidd_ln_python "${CIDD_PYTHON_COMMAND}" +pidd_install_python () { + pidd_step "Install Python" + pidd_install_package "${PIDD_PYTHON_PACKAGE}" + pidd_split + pidd_ln_python "${PIDD_PYTHON_COMMAND}" } # TODO move to Python -cidd_install_rsync () { - cidd_step "Install Rsync" - cidd_install_package "${CIDD_PKG_RSYNC}" +pidd_install_rsync () { + pidd_step "Install Rsync" + pidd_install_package "${PIDD_PKG_RSYNC}" } # TODO move to Python -cidd_install_ssh () { - cidd_step "Install SSH" - cidd_install_package "${CIDD_PKG_SSH}" +pidd_install_ssh () { + pidd_step "Install SSH" + pidd_install_package "${PIDD_PKG_SSH}" } -cidd_clean_packages_cache () { - cidd_step "Clean packages cache" - ${CIDD_PM_CLEAN} || exit +pidd_clean_packages_cache () { + pidd_step "Clean packages cache" + ${PIDD_PM_CLEAN} || exit } -cidd_install_python_modules () { - cidd_step "Install Python modules" - cidd_install_python_modules__root="$(mktemp --directory)" || exit - echo "→ ${cidd_install_python_modules__root}" - for cidd_install_python_modules__repository \ - in "${CIDD_GIT_CHILD}" "${CIDD_GIT_PARENT}" ; do - cidd_split - cidd_install_python_modules__url="\ -${CIDD_PROJECTS_URL}/${cidd_install_python_modules__repository}" +pidd_install_python_modules () { + pidd_step "Install Python modules" + pidd_install_python_modules__root="$(mktemp --directory)" || exit + echo "→ ${pidd_install_python_modules__root}" + for pidd_install_python_modules__repository \ + in "${PIDD_GIT_CHILD}" "${PIDD_GIT_PARENT}" ; do + pidd_split + pidd_install_python_modules__url="\ +${PIDD_PROJECTS_URL}/${pidd_install_python_modules__repository}" echo "\ -${cidd_install_python_modules__url} +${pidd_install_python_modules__url} ↓" git clone \ - "${cidd_install_python_modules__url}" \ - "${cidd_install_python_modules__root}\ -/${cidd_install_python_modules__repository}" \ + "${pidd_install_python_modules__url}" \ + "${pidd_install_python_modules__root}\ +/${pidd_install_python_modules__repository}" \ || exit - cidd_install_python_modules__path="\ -${cidd_install_python_modules__root}\ -/${cidd_install_python_modules__repository}\ -/${cidd_install_python_modules__repository}" + pidd_install_python_modules__path="\ +${pidd_install_python_modules__root}\ +/${pidd_install_python_modules__repository}\ +/${pidd_install_python_modules__repository}" echo "\ -${cidd_install_python_modules__path} +${pidd_install_python_modules__path} ↓ -${CIDD_PYTHON_PACKAGES}" +${PIDD_PYTHON_PACKAGES}" cp --recursive \ - "${cidd_install_python_modules__path}" "${CIDD_PYTHON_PACKAGES}" \ + "${pidd_install_python_modules__path}" "${PIDD_PYTHON_PACKAGES}" \ || exit done - cidd_split - cidd_ls "${CIDD_PYTHON_PACKAGES}" - cidd_split - cidd_rm "${cidd_install_python_modules__root}" + pidd_split + pidd_ls "${PIDD_PYTHON_PACKAGES}" + pidd_split + pidd_rm "${pidd_install_python_modules__root}" } -cidd_write_python_module () { - cidd_step "Write Python module" - for cidd_write_python_module__variable \ +pidd_write_python_module () { + pidd_step "Write Python module" + for pidd_write_python_module__variable \ in OPEN DOWN VERT SPLT __UP SHUT OS_ID OS_VERSION ; do - cidd_write_python_module__value="\ -$(cidd_echo "CIDD_${cidd_write_python_module__variable}")" - cidd_write_python_module__text="${cidd_write_python_module__text}\ -${cidd_write_python_module__value} + pidd_write_python_module__value="\ +$(pidd_echo "PIDD_${pidd_write_python_module__variable}")" + pidd_write_python_module__text="${pidd_write_python_module__text}\ +${pidd_write_python_module__value} " done - cidd_write "${CIDD_PYTHON_PACKAGES}/env.py" "${cidd_write_python_module__text}\ -CIDD_STEP = $((CIDD_STEP+1)) + pidd_write "${PIDD_PYTHON_PACKAGES}/env.py" "${pidd_write_python_module__text}\ +PIDD_STEP = $((PIDD_STEP+1)) " } -cidd_switch_to_python () { - cidd_step "Switch to Python" +pidd_switch_to_python () { + pidd_step "Switch to Python" echo "\ -${CIDD_PATH} +${PIDD_PATH} ↓ -${CIDD_PYTHON_PACKAGES}/${CIDD_GIT_CHILD}" - "${CIDD_PYTHON_ALIAS}" -m "${CIDD_GIT_CHILD}" "${@}" +${PIDD_PYTHON_PACKAGES}/${PIDD_GIT_CHILD}" + "${PIDD_PYTHON_ALIAS}" -m "${PIDD_GIT_CHILD}" "${@}" } # functions -cidd_cat () { - cidd_cat__file="${1}" - if [ -n "${cidd_cat__file}" ] ; then - cidd_open "${cidd_cat__file}" - cat "${cidd_cat__file}" || exit - cidd_shut "${cidd_cat__file}" +pidd_cat () { + pidd_cat__file="${1}" + if [ -n "${pidd_cat__file}" ] ; then + pidd_open "${pidd_cat__file}" + cat "${pidd_cat__file}" || exit + pidd_shut "${pidd_cat__file}" fi } -cidd_echo () { +pidd_echo () { if [ -n "${1}" ] ; then - for cidd_echo__name in "${@}" ; do - eval "cidd_echo__text=\"\${${cidd_echo__name}}\"" - echo "${cidd_echo__name} = \"${cidd_echo__text}\"" + for pidd_echo__name in "${@}" ; do + eval "pidd_echo__text=\"\${${pidd_echo__name}}\"" + echo "${pidd_echo__name} = \"${pidd_echo__text}\"" done fi } -cidd_error_ci () { +pidd_error_ci () { echo "× CI: ${*}" - exit "${CIDD_ERROR_CI}" + exit "${PIDD_ERROR_CI}" } -cidd_error_os () { - cidd_error_os__variable="${1}" +pidd_error_os () { + pidd_error_os__variable="${1}" printf "× OS: " - cidd_echo "${cidd_error_os__variable}" - exit "${CIDD_ERROR_OS}" + pidd_echo "${pidd_error_os__variable}" + exit "${PIDD_ERROR_OS}" } -cidd_grep_os () { - cidd_grep_os__variable="${1}" - if [ -n "${cidd_grep_os__variable}" ] ; then - grep "^${cidd_grep_os__variable}=" "/etc/os-release" \ - | sed "s|^${cidd_grep_os__variable}=||" \ +pidd_grep_os () { + pidd_grep_os__variable="${1}" + if [ -n "${pidd_grep_os__variable}" ] ; then + grep "^${pidd_grep_os__variable}=" "/etc/os-release" \ + | sed "s|^${pidd_grep_os__variable}=||" \ | sed "s|^\"\(.*\)\"$|\1|" fi } -cidd_install_package () { - cidd_install_package__name="${1}" - if [ -n "${cidd_install_package__name}" ] ; then - ${CIDD_PM_INSTALL} "${cidd_install_package__name}" || exit +pidd_install_package () { + pidd_install_package__name="${1}" + if [ -n "${pidd_install_package__name}" ] ; then + ${PIDD_PM_INSTALL} "${pidd_install_package__name}" || exit fi } -cidd_ln_python () { - cidd_ln_python__command="${1}" - if [ -n "${cidd_ln_python__command}" ] ; then - echo "→ ${CIDD_PYTHON_ALIAS} → ${cidd_ln_python__command}" - ln -f -s "${cidd_ln_python__command}" "/usr/bin/${CIDD_PYTHON_ALIAS}" \ +pidd_ln_python () { + pidd_ln_python__command="${1}" + if [ -n "${pidd_ln_python__command}" ] ; then + echo "→ ${PIDD_PYTHON_ALIAS} → ${pidd_ln_python__command}" + ln -f -s "${pidd_ln_python__command}" "/usr/bin/${PIDD_PYTHON_ALIAS}" \ || exit fi } -cidd_ls () { - cidd_ls__path="${1}" - if [ -n "${cidd_ls__path}" ] ; then - cidd_open "${cidd_ls__path}" - ls -a -l "${cidd_ls__path}" || exit - cidd_shut "${cidd_ls__path}" +pidd_ls () { + pidd_ls__path="${1}" + if [ -n "${pidd_ls__path}" ] ; then + pidd_open "${pidd_ls__path}" + ls -a -l "${pidd_ls__path}" || exit + pidd_shut "${pidd_ls__path}" fi } -cidd_mkdir () { - cidd_mkdir__path="${1}" - if [ -n "${cidd_mkdir__path}" ] ; then - echo "→ ${cidd_mkdir__path}" - mkdir --parents "${cidd_mkdir__path}" || exit +pidd_mkdir () { + pidd_mkdir__path="${1}" + if [ -n "${pidd_mkdir__path}" ] ; then + echo "→ ${pidd_mkdir__path}" + mkdir --parents "${pidd_mkdir__path}" || exit fi } -cidd_open () { - echo "${CIDD_OPEN}${*}" +pidd_open () { + echo "${PIDD_OPEN}${*}" } -cidd_openssl () { - cidd_openssl__file="${1}" - if [ -f "${cidd_openssl__file}" ] ; then +pidd_openssl () { + pidd_openssl__file="${1}" + if [ -f "${pidd_openssl__file}" ] ; then openssl x509 \ - -in "${cidd_openssl__file}" \ + -in "${pidd_openssl__file}" \ -noout -text \ || exit fi } -cidd_rm () { - cidd_rm__path="${1}" - if [ -e "${cidd_rm__path}" ] ; then - echo "← ${cidd_rm__path}" - rm -r "${cidd_rm__path}" || exit +pidd_rm () { + pidd_rm__path="${1}" + if [ -e "${pidd_rm__path}" ] ; then + echo "← ${pidd_rm__path}" + rm -r "${pidd_rm__path}" || exit fi } -cidd_sed () { - cidd_sed__file="${1}" +pidd_sed () { + pidd_sed__file="${1}" shift - if [ -f "${cidd_sed__file}" ] ; then - cidd_cat "${cidd_sed__file}" - for cidd_sed__regex in "${@}" ; do - sed --in-place "s${cidd_sed__regex}g" "${cidd_sed__file}" \ - && cidd_cat "${cidd_sed__file}" \ + if [ -f "${pidd_sed__file}" ] ; then + pidd_cat "${pidd_sed__file}" + for pidd_sed__regex in "${@}" ; do + sed --in-place "s${pidd_sed__regex}g" "${pidd_sed__file}" \ + && pidd_cat "${pidd_sed__file}" \ || exit done fi } -cidd_shut () { - echo "${CIDD_SHUT}${*}" +pidd_shut () { + echo "${PIDD_SHUT}${*}" } -cidd_split () { - echo "${CIDD_SPLT}" +pidd_split () { + echo "${PIDD_SPLT}" } -cidd_step () { - CIDD_STEP=$((CIDD_STEP+1)) +pidd_step () { + PIDD_STEP=$((PIDD_STEP+1)) echo "\ -${CIDD_DOWN} -${CIDD_VERT} ${CIDD_STEP} ${*} -${CIDD___UP}" +${PIDD_DOWN} +${PIDD_VERT} ${PIDD_STEP} ${*} +${PIDD___UP}" } -cidd_write () { - cidd_write__file="${1}" - cidd_write__text="${2}" - if [ -n "${cidd_write__file}" ] ; then - [ -f "${cidd_write__file}" ] && cidd_cat "${cidd_write__file}" - echo "→ ${cidd_write__file}" - printf "%s" "${cidd_write__text}" > "${cidd_write__file}" || exit - cidd_cat "${cidd_write__file}" +pidd_write () { + pidd_write__file="${1}" + pidd_write__text="${2}" + if [ -n "${pidd_write__file}" ] ; then + [ -f "${pidd_write__file}" ] && pidd_cat "${pidd_write__file}" + echo "→ ${pidd_write__file}" + printf "%s" "${pidd_write__text}" > "${pidd_write__file}" || exit + pidd_cat "${pidd_write__file}" fi } # constants -CIDD_BOX_DOWN="╭" -CIDD_BOX_LEFT="╴" -CIDD_BOX_RIGHT="╶" -CIDD_BOX_UP="╰" -CIDD_BOX_VERTICAL="│" +PIDD_BOX_DOWN="╭" +PIDD_BOX_LEFT="╴" +PIDD_BOX_RIGHT="╶" +PIDD_BOX_UP="╰" +PIDD_BOX_VERTICAL="│" -CIDD_ERROR_CI=2 -CIDD_ERROR_OS=1 +PIDD_ERROR_CI=2 +PIDD_ERROR_OS=1 -CIDD_OS_ALMA="alma" -CIDD_OS_ALPINE="alpine" -CIDD_OS_ARCH="arch" -CIDD_OS_DEBIAN="debian" -CIDD_OS_FEDORA="fedora" -CIDD_OS_ROCKY="rocky" -CIDD_OS_UBUNTU="ubuntu" +PIDD_OS_ALMA="alma" +PIDD_OS_ALPINE="alpine" +PIDD_OS_ARCH="arch" +PIDD_OS_DEBIAN="debian" +PIDD_OS_FEDORA="fedora" +PIDD_OS_ROCKY="rocky" +PIDD_OS_UBUNTU="ubuntu" -CIDD_PM_APK="apk" -CIDD_PM_APT="apt" -CIDD_PM_DNF="dnf" -CIDD_PM_PACMAN="pacman" +PIDD_PM_APK="apk" +PIDD_PM_APT="apt" +PIDD_PM_DNF="dnf" +PIDD_PM_PACMAN="pacman" -CIDD_HORIZONTAL="────╌╌╌╌┄┄┄┄┈┈┈┈" +PIDD_HORIZONTAL="────╌╌╌╌┄┄┄┄┈┈┈┈" -CIDD_OPEN="${CIDD_BOX_DOWN}${CIDD_BOX_LEFT}" -CIDD_DOWN="${CIDD_BOX_DOWN}${CIDD_HORIZONTAL}" -CIDD_VERT="${CIDD_BOX_VERTICAL}" -CIDD_SPLT="${CIDD_BOX_RIGHT}${CIDD_HORIZONTAL}" -CIDD___UP="${CIDD_BOX_UP}${CIDD_HORIZONTAL}" -CIDD_SHUT="${CIDD_BOX_UP}${CIDD_BOX_LEFT}" +PIDD_OPEN="${PIDD_BOX_DOWN}${PIDD_BOX_LEFT}" +PIDD_DOWN="${PIDD_BOX_DOWN}${PIDD_HORIZONTAL}" +PIDD_VERT="${PIDD_BOX_VERTICAL}" +PIDD_SPLT="${PIDD_BOX_RIGHT}${PIDD_HORIZONTAL}" +PIDD___UP="${PIDD_BOX_UP}${PIDD_HORIZONTAL}" +PIDD_SHUT="${PIDD_BOX_UP}${PIDD_BOX_LEFT}" # run -cidd_main "${@}" +pidd_main "${@}" diff --git a/pidd/__init__.py b/pidd/__init__.py index b735c80..7ddf07f 100644 --- a/pidd/__init__.py +++ b/pidd/__init__.py @@ -10,21 +10,21 @@ import env from rwx import fs, ps from rwx.log import stream as log -import cidd -from cidd.project import Project -from cidd.projects import Projects +import pidd +from pidd.project import Project +from pidd.projects import Projects -COMMANDS_PREFIX = "cidd-" +COMMANDS_PREFIX = "pidd-" projects = Projects() project = Project(projects) -def cidd_browse_workspace() -> None: +def pidd_browse_workspace() -> None: browse(project.root) -def cidd_build_project() -> None: +def pidd_build_project() -> None: for extension in ["py", "sh"]: path = Path(project.root) / f"build.{extension}" if path.exists(): @@ -34,7 +34,7 @@ def cidd_build_project() -> None: pass -def cidd_clone_branch() -> None: +def pidd_clone_branch() -> None: log.info(projects) split() log.info(project) @@ -58,12 +58,12 @@ def cidd_clone_branch() -> None: ) -def cidd_list_environment() -> None: +def pidd_list_environment() -> None: for variable, value in sorted(projects.environment.items()): log.info(f"{variable} = {value}") -def cidd_synchronize() -> None: +def pidd_synchronize() -> None: host = "rwx.work" source = "out" user = "cd" @@ -119,10 +119,10 @@ def main() -> None: path, *arguments = sys.argv name = Path(path).name if name == "__main__.py": - cidd.set_ssh(*arguments) - cidd.install_commands(__file__) + pidd.set_ssh(*arguments) + pidd.install_commands(__file__) else: - function = getattr(cidd, name.replace("-", "_")) + function = getattr(pidd, name.replace("-", "_")) function(*arguments) @@ -154,19 +154,19 @@ def set_ssh(*arguments: str) -> None: def frame(text: str) -> None: - log.info(f"{env.CIDD_OPEN}{text}") + log.info(f"{env.PIDD_OPEN}{text}") def shut(text: str) -> None: - log.info(f"{env.CIDD_SHUT}{text}") + log.info(f"{env.PIDD_SHUT}{text}") def split() -> None: - log.info(env.CIDD_SPLT) + log.info(env.PIDD_SPLT) def step(text: str) -> None: - env.CIDD_STEP += 1 - log.info(env.CIDD_DOWN) - log.info(f"{env.CIDD_VERT} {env.CIDD_STEP} {text}") - log.info(env.CIDD___UP) + env.PIDD_STEP += 1 + log.info(env.PIDD_DOWN) + log.info(f"{env.PIDD_VERT} {env.PIDD_STEP} {text}") + log.info(env.PIDD___UP) diff --git a/pidd/__main__.py b/pidd/__main__.py index 2d29cea..db32c33 100755 --- a/pidd/__main__.py +++ b/pidd/__main__.py @@ -2,7 +2,7 @@ """Entry point.""" -import cidd +import pidd if __name__ == "__main__": - cidd.main(__file__) + pidd.main(__file__) diff --git a/pidd/project.py b/pidd/project.py index 787c97c..2bff2d8 100644 --- a/pidd/project.py +++ b/pidd/project.py @@ -7,7 +7,7 @@ from typing import TYPE_CHECKING from urllib.parse import urljoin if TYPE_CHECKING: - from cidd.projects import Projects + from pidd.projects import Projects BRANCH = [ "GITHUB_REF_NAME", diff --git a/pyproject.toml b/pyproject.toml index 994bfc7..8b9edb0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,7 +19,7 @@ description = "Continuous Integration, Delivery & Deployment" dynamic = ["version"] keywords = [] license-files = { paths = ["license.md"] } -name = "cidd" +name = "pidd" readme = "readme.md" requires-python = ">= 3.10" @@ -29,7 +29,7 @@ requires-python = ">= 3.10" [project.urls] [tool.hatch.version] -path = "cidd/__init__.py" +path = "pidd/__init__.py" [tool.ruff] line-length = 80 diff --git a/readme.md b/readme.md index d4d6730..69fb1b5 100644 --- a/readme.md +++ b/readme.md @@ -41,19 +41,19 @@ from various contexts of CA, CI and OCI / OS. | Variable | Description | Default | |:----------------|:------------------------|:--------------------------------| -| CIDD_CA_n | Numbered CA certificate | | -| CIDD_DNS | Space separated servers | 9.9.9.9 | -| CIDD_GIT_CHILD | Child Git repository | cidd | -| CIDD_GIT_PARENT | Parent Git repository | rwx | -| CIDD_SSH_HOSTS | domain.tld ssh-type pub | | -| CIDD_SSH_KEY | SSH private key | | -| CIDD_URL_ALMA | Alma repository URL | https://repo.almalinux.org | -| CIDD_URL_ALPINE | Alpine repository URL | https://dl-cdn.alpinelinux.org | -| CIDD_URL_ARCH | Arch repository URL | https://geo.mirror.pkgbuild.com | -| CIDD_URL_DEBIAN | Debian repository URL | https://deb.debian.org | -| CIDD_URL_FEDORA | Fedora repository URL | https://rpmfind.net | -| CIDD_URL_ROCKY | Rocky repository URL | https://dl.rockylinux.org | -| CIDD_URL_UBUNTU | Ubuntu repository URL | https://ubuntu.mirrors.ovh.net | +| PIDD_CA_n | Numbered CA certificate | | +| PIDD_DNS | Space separated servers | 9.9.9.9 | +| PIDD_GIT_CHILD | Child Git repository | pidd | +| PIDD_GIT_PARENT | Parent Git repository | rwx | +| PIDD_SSH_HOSTS | domain.tld ssh-type pub | | +| PIDD_SSH_KEY | SSH private key | | +| PIDD_URL_ALMA | Alma repository URL | https://repo.almalinux.org | +| PIDD_URL_ALPINE | Alpine repository URL | https://dl-cdn.alpinelinux.org | +| PIDD_URL_ARCH | Arch repository URL | https://geo.mirror.pkgbuild.com | +| PIDD_URL_DEBIAN | Debian repository URL | https://deb.debian.org | +| PIDD_URL_FEDORA | Fedora repository URL | https://rpmfind.net | +| PIDD_URL_ROCKY | Rocky repository URL | https://dl.rockylinux.org | +| PIDD_URL_UBUNTU | Ubuntu repository URL | https://ubuntu.mirrors.ovh.net | ## HTTPS & Python