From 22823e7edfcb019b91a81271c31d7eebb036366a Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 27 Aug 2024 19:51:11 +0200 Subject: [PATCH 01/10] defaults --- spcd/bootstrap.sh | 75 +++++++++++++++++++++++------------------------ 1 file changed, 37 insertions(+), 38 deletions(-) diff --git a/spcd/bootstrap.sh b/spcd/bootstrap.sh index 10482e6..2f88598 100644 --- a/spcd/bootstrap.sh +++ b/spcd/bootstrap.sh @@ -1,43 +1,5 @@ #! /usr/bin/env sh -# ╭──────────╮ -# │ defaults │ -# ╰──────────╯ - -[ -n "${SPCD_CMD_SUM}" ] || SPCD_CMD_SUM="sha512sum" - -[ -n "${SPCD_DNS_1}" ] || SPCD_DNS_1="9.9.9.9" - -[ -n "${SPCD_GIT_MAIN}" ] || SPCD_GIT_MAIN="spcd" -[ -n "${SPCD_GIT_ROOT}" ] || SPCD_GIT_ROOT="rwx" - -[ -n "${SPCD_GIT_SHUNIT}" ] || SPCD_GIT_SHUNIT="shunit2" - -[ -n "${SPCD_REF_FEATURE}" ] || SPCD_REF_FEATURE="f" -[ -n "${SPCD_REF_RELEASE}" ] || SPCD_REF_RELEASE="main" -[ -n "${SPCD_REF_STAGING}" ] || SPCD_REF_STAGING="dev" - -[ -n "${SPCD_URL_ALMA}" ] || - SPCD_URL_ALMA="https://repo.almalinux.org" -[ -n "${SPCD_URL_ALPINE}" ] || - SPCD_URL_ALPINE="https://dl-cdn.alpinelinux.org/alpine" -[ -n "${SPCD_URL_ARCH}" ] || - SPCD_URL_ARCH="https://geo.mirror.pkgbuild.com/\$repo/os/\$arch" -[ -n "${SPCD_URL_DEBIAN}" ] || - SPCD_URL_DEBIAN="https://deb.debian.org/debian" -[ -n "${SPCD_URL_EPEL}" ] || - SPCD_URL_EPEL="https://dl.fedoraproject.org" -[ -n "${SPCD_URL_FEDORA}" ] || - SPCD_URL_FEDORA="https://rpmfind.net/linux/fedora/linux" -[ -n "${SPCD_URL_OPENSUSE}" ] || - SPCD_URL_OPENSUSE="https://download.opensuse.org" -[ -n "${SPCD_URL_PYTHON}" ] || - SPCD_URL_PYTHON="https://pypi.org/simple" -[ -n "${SPCD_URL_ROCKY}" ] || - SPCD_URL_ROCKY="https://dl.rockylinux.org" -[ -n "${SPCD_URL_UBUNTU}" ] || - SPCD_URL_UBUNTU="https://ubuntu.mirrors.ovh.net/ubuntu" - # ╭───╮ # │ _ │ # ╰───╯ @@ -643,6 +605,42 @@ ${SPCD_PYTHON_VENV}/lib/${SPCD_PYTHON_COMMAND}/site-packages" spcd_os_printenv "SPCD_DL" } +spcd_step__environment_defaults() { + [ -n "${SPCD_CMD_SUM}" ] || SPCD_CMD_SUM="sha512sum" + + [ -n "${SPCD_DNS_1}" ] || SPCD_DNS_1="9.9.9.9" + + [ -n "${SPCD_GIT_MAIN}" ] || SPCD_GIT_MAIN="spcd" + [ -n "${SPCD_GIT_ROOT}" ] || SPCD_GIT_ROOT="rwx" + + [ -n "${SPCD_GIT_SHUNIT}" ] || SPCD_GIT_SHUNIT="shunit2" + + [ -n "${SPCD_REF_FEATURE}" ] || SPCD_REF_FEATURE="f" + [ -n "${SPCD_REF_RELEASE}" ] || SPCD_REF_RELEASE="main" + [ -n "${SPCD_REF_STAGING}" ] || SPCD_REF_STAGING="dev" + + [ -n "${SPCD_URL_ALMA}" ] || + SPCD_URL_ALMA="https://repo.almalinux.org" + [ -n "${SPCD_URL_ALPINE}" ] || + SPCD_URL_ALPINE="https://dl-cdn.alpinelinux.org/alpine" + [ -n "${SPCD_URL_ARCH}" ] || + SPCD_URL_ARCH="https://geo.mirror.pkgbuild.com/\$repo/os/\$arch" + [ -n "${SPCD_URL_DEBIAN}" ] || + SPCD_URL_DEBIAN="https://deb.debian.org/debian" + [ -n "${SPCD_URL_EPEL}" ] || + SPCD_URL_EPEL="https://dl.fedoraproject.org" + [ -n "${SPCD_URL_FEDORA}" ] || + SPCD_URL_FEDORA="https://rpmfind.net/linux/fedora/linux" + [ -n "${SPCD_URL_OPENSUSE}" ] || + SPCD_URL_OPENSUSE="https://download.opensuse.org" + [ -n "${SPCD_URL_PYTHON}" ] || + SPCD_URL_PYTHON="https://pypi.org/simple" + [ -n "${SPCD_URL_ROCKY}" ] || + SPCD_URL_ROCKY="https://dl.rockylinux.org" + [ -n "${SPCD_URL_UBUNTU}" ] || + SPCD_URL_UBUNTU="https://ubuntu.mirrors.ovh.net/ubuntu" +} + spcd_step__environment_list_workspace() { spcd_step "List workspace" spcd_lwd__path="$(realpath .)" @@ -1221,6 +1219,7 @@ spcd_main() { # environment spcd_step_in "Environment" spcd_step__environment_set_variables + spcd_step__environment_defaults spcd_step__environment_list_workspace spcd_step_out # dns From f6f17ade210213cd36160de1250458071c4acc20 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 27 Aug 2024 19:52:37 +0200 Subject: [PATCH 02/10] arch --- spcd/bootstrap.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spcd/bootstrap.sh b/spcd/bootstrap.sh index 2f88598..a9708b5 100644 --- a/spcd/bootstrap.sh +++ b/spcd/bootstrap.sh @@ -624,7 +624,7 @@ spcd_step__environment_defaults() { [ -n "${SPCD_URL_ALPINE}" ] || SPCD_URL_ALPINE="https://dl-cdn.alpinelinux.org/alpine" [ -n "${SPCD_URL_ARCH}" ] || - SPCD_URL_ARCH="https://geo.mirror.pkgbuild.com/\$repo/os/\$arch" + SPCD_URL_ARCH="https://geo.mirror.pkgbuild.com" [ -n "${SPCD_URL_DEBIAN}" ] || SPCD_URL_DEBIAN="https://deb.debian.org/debian" [ -n "${SPCD_URL_EPEL}" ] || @@ -805,7 +805,7 @@ ${SPCD_URL_ALPINE}/v${SPCD_OS_VERSION}/community ;; "${SPCD_OS_ARCH}") spcd_os_write "/etc/pacman.d/mirrorlist" "\ -Server = ${SPCD_URL_ARCH} +Server = ${SPCD_URL_ARCH}/\$repo/os/\$arch " ;; "${SPCD_OS_DEBIAN}") From 0d62aab505170f571bcc06c872fd1defb5c97eba Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 27 Aug 2024 21:33:03 +0200 Subject: [PATCH 03/10] url/rh --- spcd/bootstrap.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spcd/bootstrap.sh b/spcd/bootstrap.sh index a9708b5..e9f6c6b 100644 --- a/spcd/bootstrap.sh +++ b/spcd/bootstrap.sh @@ -620,6 +620,8 @@ spcd_step__environment_defaults() { [ -n "${SPCD_REF_STAGING}" ] || SPCD_REF_STAGING="dev" [ -n "${SPCD_URL_ALMA}" ] || + # /almalinux/$releasever/… + # /vault/$releasever/… SPCD_URL_ALMA="https://repo.almalinux.org" [ -n "${SPCD_URL_ALPINE}" ] || SPCD_URL_ALPINE="https://dl-cdn.alpinelinux.org/alpine" @@ -630,12 +632,16 @@ spcd_step__environment_defaults() { [ -n "${SPCD_URL_EPEL}" ] || SPCD_URL_EPEL="https://dl.fedoraproject.org" [ -n "${SPCD_URL_FEDORA}" ] || + # /releases/$releasever/Everything/… + # /updates/$releasever/Everything/… + # /updates/testing/$releasever/Everything/… SPCD_URL_FEDORA="https://rpmfind.net/linux/fedora/linux" [ -n "${SPCD_URL_OPENSUSE}" ] || SPCD_URL_OPENSUSE="https://download.opensuse.org" [ -n "${SPCD_URL_PYTHON}" ] || SPCD_URL_PYTHON="https://pypi.org/simple" [ -n "${SPCD_URL_ROCKY}" ] || + # /$contentdir/$releasever/… SPCD_URL_ROCKY="https://dl.rockylinux.org" [ -n "${SPCD_URL_UBUNTU}" ] || SPCD_URL_UBUNTU="https://ubuntu.mirrors.ovh.net/ubuntu" @@ -852,6 +858,7 @@ deb ${SPCD_URL_DEBIAN}-security ${SPCD_OS_VERSION}-security main "rocky-extras" ;; "8") + # not Rocky-Media set -- \ "Rocky-AppStream" \ "Rocky-BaseOS" \ From 01688a562bd56df58b468e747068d9b752bee898 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 27 Aug 2024 21:48:56 +0200 Subject: [PATCH 04/10] url/opensuse --- spcd/bootstrap.sh | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/spcd/bootstrap.sh b/spcd/bootstrap.sh index e9f6c6b..084ad0c 100644 --- a/spcd/bootstrap.sh +++ b/spcd/bootstrap.sh @@ -637,6 +637,10 @@ spcd_step__environment_defaults() { # /updates/testing/$releasever/Everything/… SPCD_URL_FEDORA="https://rpmfind.net/linux/fedora/linux" [ -n "${SPCD_URL_OPENSUSE}" ] || + # /debug/… + # /distribution/… + # /source/… + # /update/… SPCD_URL_OPENSUSE="https://download.opensuse.org" [ -n "${SPCD_URL_PYTHON}" ] || SPCD_URL_PYTHON="https://pypi.org/simple" @@ -836,17 +840,26 @@ deb ${SPCD_URL_DEBIAN}-security ${SPCD_OS_VERSION}-security main "|^enabled=1|# enabled=0|" ;; "${SPCD_OS_OPENSUSE}") - for spcd_spr__file in \ + set -- \ + "backports-debug-update" \ "backports-update" \ + "debug-non-oss" \ + "debug-update-non-oss" \ + "debug-update" \ + "debug" \ "non-oss" \ "oss" \ + "sle-debug-update" \ "sle-update" \ + "source" \ "update-non-oss" \ - "update" \ - "openh264"; do + "update" + for spcd_spr__file in "${@}"; do spcd_os_sed "/etc/zypp/repos.d/repo-${spcd_spr__file}.repo" \ "|http://download.opensuse.org|${SPCD_URL_OPENSUSE}|" done + spcd_os_sed "/etc/zypp/repos.d/repo-openh264.repo" \ + "|^enabled=1|# enabled=0|" ;; "${SPCD_OS_ROCKY}") case "${SPCD_OS_VERSION}" in From 6f57231f9cfe14fefe1e3b328b59cb1e67c4b7af Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 27 Aug 2024 21:59:01 +0200 Subject: [PATCH 05/10] repos/fixes --- spcd/bootstrap.sh | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/spcd/bootstrap.sh b/spcd/bootstrap.sh index 084ad0c..6f6aab0 100644 --- a/spcd/bootstrap.sh +++ b/spcd/bootstrap.sh @@ -788,7 +788,6 @@ spcd_step__packages_set_repositories() { ;; "8") set -- \ - "" \ "-ha" \ "-nfv" \ "-plus" \ @@ -796,13 +795,14 @@ spcd_step__packages_set_repositories() { "-resilientstorage" \ "-rt" \ "-sap" \ - "-saphana" + "-saphana" \ + "" ;; *) ;; esac for spcd_spr__file in "${@}"; do spcd_os_sed "/etc/yum.repos.d/almalinux${spcd_spr__file}.repo" \ - "|^mirrorlist|# mirrorlist|" \ + "|^mirrorlist|#mirrorlist|" \ "|https://repo.almalinux.org|${SPCD_URL_ALMA}|" \ "|^# baseurl|baseurl|" done @@ -827,17 +827,18 @@ deb ${SPCD_URL_DEBIAN}-security ${SPCD_OS_VERSION}-security main " ;; "${SPCD_OS_FEDORA}") - for spcd_spr__file in \ - "fedora" \ - "fedora-updates" \ - "fedora-updates-testing"; do - spcd_os_sed "/etc/yum.repos.d/${spcd_spr__file}.repo" \ - "|^metalink|# metalink|" "\ + set -- \ + "-updates-testing" \ + "-updates" \ + "" + for spcd_spr__file in "${@}"; do + spcd_os_sed "/etc/yum.repos.d/fedora${spcd_spr__file}.repo" \ + "|^metalink|#metalink|" "\ |http://download.example/pub/fedora/linux|${SPCD_URL_FEDORA}|" \ "|^#baseurl|baseurl|" done spcd_os_sed "/etc/yum.repos.d/fedora-cisco-openh264.repo" \ - "|^enabled=1|# enabled=0|" + "|^enabled=1|#enabled=0|" ;; "${SPCD_OS_OPENSUSE}") set -- \ @@ -859,16 +860,16 @@ deb ${SPCD_URL_DEBIAN}-security ${SPCD_OS_VERSION}-security main "|http://download.opensuse.org|${SPCD_URL_OPENSUSE}|" done spcd_os_sed "/etc/zypp/repos.d/repo-openh264.repo" \ - "|^enabled=1|# enabled=0|" + "|^enabled=1|#enabled=0|" ;; "${SPCD_OS_ROCKY}") case "${SPCD_OS_VERSION}" in "9") set -- \ - "rocky" \ "rocky-addons" \ "rocky-devel" \ - "rocky-extras" + "rocky-extras" \ + "rocky" ;; "8") # not Rocky-Media @@ -890,7 +891,7 @@ deb ${SPCD_URL_DEBIAN}-security ${SPCD_OS_VERSION}-security main esac for spcd_spr__file in "${@}"; do spcd_os_sed "/etc/yum.repos.d/${spcd_spr__file}.repo" \ - "|^mirrorlist|# mirrorlist|" \ + "|^mirrorlist|#mirrorlist|" \ "|http://dl.rockylinux.org|${SPCD_URL_ROCKY}|" \ "|^#baseurl|baseurl|" done @@ -1150,7 +1151,7 @@ spcd_step__install_packages() { [ -n "${SPCD_URL_EPEL}" ] && spcd_ip__epel="${SPCD_URL_EPEL}" || spcd_ip__epel="https://dl.fedoraproject.org" spcd_os_sed "/etc/yum.repos.d/epel.repo" \ - "|^metalink|# metalink|" \ + "|^metalink|#metalink|" \ "|https://download.example|${spcd_ip__epel}|" \ "|^#baseurl|baseurl|" ;; From 048a84c0fb052a036f2b7d45d6ace348d934b44f Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 27 Aug 2024 22:05:37 +0200 Subject: [PATCH 06/10] url/alpine,arch --- spcd/bootstrap.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spcd/bootstrap.sh b/spcd/bootstrap.sh index 6f6aab0..6fcce99 100644 --- a/spcd/bootstrap.sh +++ b/spcd/bootstrap.sh @@ -624,8 +624,11 @@ spcd_step__environment_defaults() { # /vault/$releasever/… SPCD_URL_ALMA="https://repo.almalinux.org" [ -n "${SPCD_URL_ALPINE}" ] || + # /v?.??/community + # /v?.??/main SPCD_URL_ALPINE="https://dl-cdn.alpinelinux.org/alpine" [ -n "${SPCD_URL_ARCH}" ] || + # /$repo/os/$arch SPCD_URL_ARCH="https://geo.mirror.pkgbuild.com" [ -n "${SPCD_URL_DEBIAN}" ] || SPCD_URL_DEBIAN="https://deb.debian.org/debian" From 1b0c934fee0c20bbc3fd3c6392a95f107ed293fa Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 27 Aug 2024 22:26:50 +0200 Subject: [PATCH 07/10] wip/epel --- spcd/bootstrap.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spcd/bootstrap.sh b/spcd/bootstrap.sh index 6fcce99..96f21a8 100644 --- a/spcd/bootstrap.sh +++ b/spcd/bootstrap.sh @@ -633,7 +633,9 @@ spcd_step__environment_defaults() { [ -n "${SPCD_URL_DEBIAN}" ] || SPCD_URL_DEBIAN="https://deb.debian.org/debian" [ -n "${SPCD_URL_EPEL}" ] || - SPCD_URL_EPEL="https://dl.fedoraproject.org" + # /$releasever/Everything/… + # /testing/$releasever/Everything/… + SPCD_URL_EPEL="https://dl.fedoraproject.org/pub/epel" [ -n "${SPCD_URL_FEDORA}" ] || # /releases/$releasever/Everything/… # /updates/$releasever/Everything/… @@ -1151,11 +1153,9 @@ spcd_step__install_packages() { case "${SPCD_OS_ID}" in "${SPCD_OS_ALMA}" | "${SPCD_OS_ROCKY}") spcd_install_package "epel-release" - [ -n "${SPCD_URL_EPEL}" ] && spcd_ip__epel="${SPCD_URL_EPEL}" || - spcd_ip__epel="https://dl.fedoraproject.org" spcd_os_sed "/etc/yum.repos.d/epel.repo" \ "|^metalink|#metalink|" \ - "|https://download.example|${spcd_ip__epel}|" \ + "|https://download.example/pub/epel|${SPCD_URL_EPEL}|" \ "|^#baseurl|baseurl|" ;; *) ;; From 9623c7f48394912e74b9899c43ba0e16e537dbc6 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 27 Aug 2024 22:44:57 +0200 Subject: [PATCH 08/10] epel --- spcd/bootstrap.sh | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/spcd/bootstrap.sh b/spcd/bootstrap.sh index 96f21a8..682714c 100644 --- a/spcd/bootstrap.sh +++ b/spcd/bootstrap.sh @@ -1153,10 +1153,29 @@ spcd_step__install_packages() { case "${SPCD_OS_ID}" in "${SPCD_OS_ALMA}" | "${SPCD_OS_ROCKY}") spcd_install_package "epel-release" - spcd_os_sed "/etc/yum.repos.d/epel.repo" \ - "|^metalink|#metalink|" \ - "|https://download.example/pub/epel|${SPCD_URL_EPEL}|" \ - "|^#baseurl|baseurl|" + case "${SPCD_OS_VERSION}" in + "9") + set -- \ + "-testing" + "" + ;; + "8") + set -- \ + "-modular" \ + "-testing-modular" \ + "-testing" \ + "" + ;; + *) ;; + esac + for spcd_spr__file in "${@}"; do + spcd_os_sed "/etc/yum.repos.d/epel${spcd_spr__file}.repo" \ + "|^metalink|#metalink|" \ + "|https://download.example/pub/epel|${SPCD_URL_EPEL}|" \ + "|^#baseurl|baseurl|" + done + spcd_spr__file="/etc/yum.repos.d/epel-cisco-openh264.repo" + "|^enabled=1|#enabled=0|" ;; *) ;; esac From 896b766f38faa26c6117efa959e066428df502a0 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 27 Aug 2024 22:49:38 +0200 Subject: [PATCH 09/10] fixes --- spcd/bootstrap.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/spcd/bootstrap.sh b/spcd/bootstrap.sh index 682714c..783b153 100644 --- a/spcd/bootstrap.sh +++ b/spcd/bootstrap.sh @@ -1156,7 +1156,7 @@ spcd_step__install_packages() { case "${SPCD_OS_VERSION}" in "9") set -- \ - "-testing" + "-testing" \ "" ;; "8") @@ -1175,7 +1175,9 @@ spcd_step__install_packages() { "|^#baseurl|baseurl|" done spcd_spr__file="/etc/yum.repos.d/epel-cisco-openh264.repo" - "|^enabled=1|#enabled=0|" + if [ -f "${spcd_spr__file}" ]; then + spcd_os_sed "${spcd_spr__file}" \ + "|^enabled=1|#enabled=0|" ;; *) ;; esac From bb1a7d27cb4615030a6bb534aacac695db78fbc8 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 27 Aug 2024 22:50:36 +0200 Subject: [PATCH 10/10] fix --- spcd/bootstrap.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/spcd/bootstrap.sh b/spcd/bootstrap.sh index 783b153..ca516b2 100644 --- a/spcd/bootstrap.sh +++ b/spcd/bootstrap.sh @@ -1178,6 +1178,7 @@ spcd_step__install_packages() { if [ -f "${spcd_spr__file}" ]; then spcd_os_sed "${spcd_spr__file}" \ "|^enabled=1|#enabled=0|" + fi ;; *) ;; esac