From 6edd65ca79da21d4b44f8b05aeca71212b9a5457 Mon Sep 17 00:00:00 2001 From: Louis Abel Date: Sat, 2 Sep 2023 20:37:29 -0700 Subject: [PATCH] common_10 --- sync/common_10 | 183 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 183 insertions(+) create mode 100644 sync/common_10 diff --git a/sync/common_10 b/sync/common_10 new file mode 100644 index 0000000..5d34766 --- /dev/null +++ b/sync/common_10 @@ -0,0 +1,183 @@ +# To be sourced by scripts to use + +# Revision must always start with a major number +case "${RLREL}" in + stable) + REVISION=10.0 + APPEND_TO_DIR="-RC1" + ;; + beta) + REVISION=10.0 + APPEND_TO_DIR="-beta" + COMPOSE_APPEND="-beta" + ;; + lh) + REVISION=10.0 + APPEND_TO_DIR="-lookahead" + COMPOSE_APPEND="-lookahead" + ;; + *) + echo "option no recognized" + ;; +esac + +MAJOR="${REVISION%.*}" +MINOR="${REVISION#*.}" +ARCHES=(x86_64 aarch64 ppc64le s390x) +STAGING_ROOT="/mnt/repos-staging" +PRODUCTION_ROOT="/mnt/repos-production" + +# relative to ${ENV}_ROOT +CATEGORY_STUB="mirror/pub/rocky" +RELEASE_DIR="${CATEGORY_STUB}/${REVISION}${APPEND_TO_DIR}" +RELEASE_COMPOSE_ROOT="${COMPOSE_ROOT}/${MAJOR}/latest-${SHORT}-${MAJOR}${COMPOSE_APPEND}" + +# Set all repos that have no comps/groups associated with them. This is even in +# cases where repos will not be available by normal means. It's just for +# consistency. +NONMODS_REPOS=( + extras + Devel + plus +) + +# These repos were originally separate from the main compose and need symlinks +declare -A LINK_REPOS +LINK_REPOS=( + [NFV]="nfv" +) + +# These repos have comps/groups, except for debuginfo and sources +MODS_REPOS=( + BaseOS + AppStream + HighAvailability + ResilientStorage + CRB + RT + NFV + SAP + SAPHANA +) + +ALL_REPOS=( + "${NONMODS_REPOS[@]}" + "${MODS_REPOS[@]}" +) + +NONSIG_COMPOSE=( + Rocky +) + +declare -A SIG_COMPOSE +SIG_COMPOSE=( + [kernel]="kernel/kernel" + [kmod]="kernel/kmod" +) + +# These repos have modules +MODS=( + AppStream + PowerTools +) + +# functions +# Note, EL8 and EL9 may not be the same, do not put in 'common' +function treeinfoSaver() { + BaseOSArch="${1}" + TREEINFO_VAR="${STAGING_ROOT}/${RELEASE_DIR}/BaseOS/${BaseOSArch}/os/.treeinfo" + PRISTINE_TREE="${STAGING_ROOT}/${RELEASE_DIR}/BaseOS/${BaseOSArch}/os/.treeinfo-pristine" + /bin/cp "${TREEINFO_VAR}" "${PRISTINE_TREE}" +} + +function treeinfoFixer() { + BaseOSArch="${1}" + TREEINFO_VAR="${STAGING_ROOT}/${RELEASE_DIR}/BaseOS/${BaseOSArch}/os/.treeinfo" + PRISTINE_TREE="${STAGING_ROOT}/${RELEASE_DIR}/BaseOS/${BaseOSArch}/os/.treeinfo-pristine" + test -f "${PRISTINE_TREE}" + pris_retval=$? + if [ "$pris_retval" -eq 0 ]; then + /bin/cp "${PRISTINE_TREE}" "${TREEINFO_VAR}" + else + echo "WARNING: We do not have a pristine treeinfo to copy from" + fi +} + +# Note, EL8 and EL9 may not be the same, do not put in 'common' +function treeinfoModder() { + BaseOSArch="${1}" + TREEINFO_VAR="${STAGING_ROOT}/${RELEASE_DIR}/BaseOS/${BaseOSArch}/os/.treeinfo" + PRISTINE_TREE="${STAGING_ROOT}/${RELEASE_DIR}/BaseOS/${BaseOSArch}/os/.treeinfo-pristine" + test -f "${TREEINFO_VAR}" + treeinfo_retval=$? + test -x /usr/bin/python3 + python_retval=$? + # There is an awk way to do this, but it was easier to implement python and + # cat heredoc together. It felt cleaner. This was a trick I had used in a + # previous life when I had to admin Solaris systems, and I needed a way to + # add a solaris 10 system into FreeIPA (it was not fun, let me tell you). But + # the take away is I learned something kind of on the fly and well, it worked. + # Emails should have stamps. + if [ "$treeinfo_retval" -eq 0 ] && [ "$python_retval" -eq 0 ]; then + cat <