Updated serveral things:

- Removed RHEL Beta comparisons, until we figure out dual subscriptions on single box
- Revamped module comparison script, runs much faster now

-Skip G.
This commit is contained in:
Skip Grube 2023-05-13 22:05:34 -04:00
parent 5cd35cf672
commit ecefe454e0
No known key found for this signature in database
GPG Key ID: D391F8393BEA6D9C
2 changed files with 65 additions and 42 deletions

View File

@ -63,24 +63,46 @@ echo "
<tr> <th width=\"20%\">Module Name:Version</th> <th width=\"40%\">${REPOS1} Pkg Diffs (-)</th> <th width=\"40%\">${REPOS2} Pkg Diffs (+)</th> </tr>
"
# Grab module info (artifacts, streams, versions) from all modules, in the source repo and target repo
MODULE1=$(dnf --disablerepo '*' --enablerepo "${REPOS1}" module info "*" 2> /dev/null)
MODULE2=$(dnf --disablerepo '*' --enablerepo "${REPOS2}" module info "*" 2> /dev/null)
# Big loop where we go through every possible module/version combination:
for module in ${MODULE_LIST1}; do
# MODULE1 == complete module info from the 1st repos, while MODULE2 == complete module info from 2nd repos
# This includes all the different versions/releases, so we want to filter for the latest later
MODULE1=$(dnf --disablerepo '*' --enablerepo "${REPOS1}" module info "${module}" 2> /dev/null)
MODULE2=$(dnf --disablerepo '*' --enablerepo "${REPOS2}" module info "${module}" 2> /dev/null)
# isolate what stream ("version") of the module we want
mod_name=$(echo "${module}" | awk -F ':' '{print $1}')
mod_stream=$(echo "${module}" | awk -F ':' '{print $2}')
# Isolate the latest released version of each module, that's the only one we're intrested in (indicated by the "Version :" line in module info)
latest_version1=$(echo "${MODULE1}" | grep 'Version ' | awk '{print $3}' | sort -n | tail -1)
latest_version2=$(echo "${MODULE2}" | grep 'Version ' | awk '{print $3}' | sort -n | tail -1)
# Strategy:
# get the module name and 3 lines after,
# from that ensure the module stream is the one we want,
# from that isolate the "Version :" line,
# then isolate the version number only, sort, and grab the newest
latest_version1=$(echo "${MODULE1}" |
grep -A3 ": ${mod_name}$" |
grep -A2 ": ${mod_stream}" |
grep "^Version" |
awk '{print $3}' |
sort -n | tail -1)
latest_version2=$(echo "${MODULE2}" |
grep -A3 ": ${mod_name}$" |
grep -A2 ": ${mod_stream}" |
grep "^Version" |
awk '{print $3}' |
sort -n | tail -1)
# Isolate individual module artifacts and write them (sorted) to a text file
# order of operations: awk to find version string through blank line,
# order of operations:
# grep to find the module name, then grep to find the version, followed by 1000 lines of continued text
# sed to get this single module:stream:version, ending at the blank line (blank line separates all versions)
# awk to find "Requires :" line,
# sed to remove "Artifacts",
# awk to isolate module rpm artifact ($2),
@ -91,7 +113,9 @@ for module in ${MODULE_LIST1}; do
# remove any blank lines,
# and finally sort and write to text file
echo "${MODULE1}" |
awk "/${latest_version1}/ { show=1; next } show; /^$/ { show=0 }" |
grep -A1000 ": ${mod_name}$" |
grep -A1000 "${latest_version1}" |
sed -n '0,/^$/p' |
awk "/Requires / { show=1; next } show; /^$/ { show=0 }" |
sed 's/Artifacts //' |
awk '{print $2}' |
@ -104,7 +128,9 @@ for module in ${MODULE_LIST1}; do
# Do the same isolation of module rpms for module 2 and write that to a text file
echo "${MODULE2}" |
awk "/${latest_version2}/ { show=1; next } show; /^$/ { show=0 }" |
grep -A1000 ": ${mod_name}$" |
grep -A1000 "${latest_version2}" |
sed -n '0,/^$/p' |
awk "/Requires / { show=1; next } show; /^$/ { show=0 }" |
sed 's/Artifacts //' |
awk '{print $2}' |
@ -115,6 +141,7 @@ for module in ${MODULE_LIST1}; do
sort > "/tmp/module_compare/${module}_2"
# Get list of differences from source repo (the "-" in git diff)
diff1=$(git --no-pager diff "/tmp/module_compare/${module}_1" "/tmp/module_compare/${module}_2" | grep -A1000 '@@' | grep '^\-' | sort)

View File

@ -21,45 +21,41 @@ mkdir -p "${RESULTSDIR}"
for version in "8" "9"; do
for rockyStage in "" "_stg"; do
for rhelBeta in "" "_Beta"; do
for sourceFlag in "" "_Source"; do
for repo in "BaseOS" "AppStream" "CodeReady" "HighAvailability" "ResilientStorage"; do
>&2 echo "Now running compare for: ${RESULTSDIR}/RHEL${version}${rhelBeta}_Rocky${version}_${repo}${sourceFlag}${rockyStage}_${now}.html"
>&2 echo "Now running compare for: ${RESULTSDIR}/RHEL${version}_Rocky${version}_${repo}${sourceFlag}${rockyStage}_${now}.html"
"${SCRIPTSDIR}"/mkrepofile.sh
"${SCRIPTSDIR}"/repo_compare_html.sh "RHEL${version}${rhelBeta}_${repo}${sourceFlag}" "Rocky${version}_${repo}${sourceFlag}${rockyStage}" > "${RESULTSDIR}/RHEL${version}${rhelBeta}_Rocky${version}_${repo}${sourceFlag}${rockyStage}_${now}.html"
"${SCRIPTSDIR}"/repo_compare_html.sh "RHEL${version}_${repo}${sourceFlag}" "Rocky${version}_${repo}${sourceFlag}${rockyStage}" > "${RESULTSDIR}/RHEL${version}_Rocky${version}_${repo}${sourceFlag}${rockyStage}_${now}.html"
# Copy the timestamped html file to the "standard" one - removing the "_$now" timestamp at the end:
cp -f "${RESULTSDIR}/RHEL${version}${rhelBeta}_Rocky${version}_${repo}${sourceFlag}${rockyStage}_${now}.html" "${RESULTSDIR}/RHEL${version}${rhelBeta}_Rocky${version}_${repo}${sourceFlag}${rockyStage}.html"
cp -f "${RESULTSDIR}/RHEL${version}_Rocky${version}_${repo}${sourceFlag}${rockyStage}_${now}.html" "${RESULTSDIR}/RHEL${version}_Rocky${version}_${repo}${sourceFlag}${rockyStage}.html"
done
done
done
done
done
# Module Compare 1: RHEL 8 vs. Rocky 8 production:
"${SCRIPTSDIR}"/mkrepofile.sh
"${SCRIPTSDIR}"/module_compare_html.sh RHEL8_AppStream,RHEL8_CodeReady Rocky8_AppStream,Rocky8_PowerTools > "${RESULTSDIR}/RHEL8_Rocky8_Modules_${now}.html"
"${SCRIPTSDIR}"/module_compare_html.sh RHEL8_AppStream,RHEL8_CodeReady Rocky8_AppStream,Rocky8_CodeReady > "${RESULTSDIR}/RHEL8_Rocky8_Modules_${now}.html"
cp -f "${RESULTSDIR}/RHEL8_Rocky8_Modules_${now}.html" "${RESULTSDIR}/RHEL8_Rocky8_Modules.html"
# Module Compare 2: RHEL 8 vs. Rocky 8 staging:
"${SCRIPTSDIR}"/mkrepofile.sh
"${SCRIPTSDIR}"/module_compare_html.sh RHEL8_AppStream,RHEL8_CodeReady Rocky8_AppStream_stg,Rocky8_PowerTools_stg > "${RESULTSDIR}/RHEL8_Rocky8_Modules_stg_${now}.html"
"${SCRIPTSDIR}"/module_compare_html.sh RHEL8_AppStream,RHEL8_CodeReady Rocky8_AppStream_stg,Rocky8_CodeReady_stg > "${RESULTSDIR}/RHEL8_Rocky8_Modules_stg_${now}.html"
cp -f "${RESULTSDIR}/RHEL8_Rocky8_Modules_stg_${now}.html" "${RESULTSDIR}/RHEL8_Rocky8_Modules_stg.html"
# Module Compare 3: RHEL 8 Beta vs. Rocky 8 staging:
# Module Compare 3: RHEL 9 vs. Rocky 9 production:
"${SCRIPTSDIR}"/mkrepofile.sh
"${SCRIPTSDIR}"/module_compare_html.sh RHEL8_Beta_AppStream,RHEL8_Beta_CodeReady Rocky8_AppStream_stg,Rocky8_PowerTools_stg > "${RESULTSDIR}/RHEL8_Beta_Rocky8_Modules_stg_${now}.html"
cp -f "${RESULTSDIR}/RHEL8_Beta_Rocky8_Modules_stg_${now}.html" "${RESULTSDIR}/RHEL8_Beta_Rocky8_Modules_stg_${now}.html"
"${SCRIPTSDIR}"/module_compare_html.sh RHEL9_AppStream,RHEL9_CodeReady Rocky9_AppStream,Rocky9_CodeReady > "${RESULTSDIR}/RHEL9_Rocky9_Modules_${now}.html"
cp -f "${RESULTSDIR}/RHEL9_Rocky9_Modules_${now}.html" "${RESULTSDIR}/RHEL9_Rocky9_Modules.html"
# Module Compare: RHEL 9 vs. Rocky 9 staging:
# Module Compare 4: RHEL 9 vs. Rocky 9 staging:
"${SCRIPTSDIR}"/module_compare_html.sh RHEL9_AppStream,RHEL9_CodeReady Rocky9_AppStream_stg,Rocky9_CodeReady_stg > "${RESULTSDIR}/RHEL9_Rocky9_Modules_stg_${now}.html"
cp -f "${RESULTSDIR}/RHEL9_Rocky9_Modules_stg_${now}.html" "${RESULTSDIR}/RHEL9_Rocky9_Modules_stg.html"