From 6af12937af1b10c5f833de3fb35a2f0b81991ddb Mon Sep 17 00:00:00 2001 From: nazunalika Date: Mon, 12 Jul 2021 00:50:40 -0700 Subject: [PATCH] additional fixes --- sync/common_8 | 56 +++++++++++++++++++++++++++ sync/minor-release-sync-to-staging.sh | 5 +++ sync/prep-staging-8.sh | 56 +-------------------------- 3 files changed, 62 insertions(+), 55 deletions(-) diff --git a/sync/common_8 b/sync/common_8 index 5ea6a66..9108ef9 100644 --- a/sync/common_8 +++ b/sync/common_8 @@ -59,3 +59,59 @@ MODS=( AppStream PowerTools ) + +# functions +# Note, EL8 and EL9 may not be the same, do not put in 'common' +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 <