Skip to content

Commit

Permalink
v3.1
Browse files Browse the repository at this point in the history
- Fixing multigraph bug for other archs when first target is not suitable
- Modifying multigraph channel type selection to be fully dynamic
- Homogenize output file names
  • Loading branch information
pamoedom committed Feb 7, 2021
1 parent 64a769a commit 3b80b8a
Show file tree
Hide file tree
Showing 10 changed files with 1,082 additions and 308 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
*v3.1
- Fixing multigraph bug for other archs when first target is not suitable
- Modifying multigraph channel type selection to be fully dynamic
- Homogenize output file names

*v3.0
- Multigraph mode '4.x.z-' (experimental)
- Re-enabling 'nounset' for BASH >= 5
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ $ ocp4upc 4.5.20
[INFO] Checking if '4.5.20' (amd64) is a valid release... [SUCC]
[INFO] Detected mode '4.x.z', targeting channels '4.6' for upgrade path generation.
[WARN] Skipping channel 'eus-4.6_amd64', version not found.
[INFO] Result exported as 'stable-4.6_4.5.20-amd64_20210207.svg'
[INFO] Result exported as 'fast-4.6_4.5.20-amd64_20210207.svg'
[INFO] Result exported as 'stable-4.6_4.5.20_amd64_20210208.svg'
[INFO] Result exported as 'fast-4.6_4.5.20_amd64_20210208.svg'
~~~
![fast-4.6](https://github.com/pamoedom/ocp4upc/blob/master/examples/fast-4.6_4.5.20-amd64_20210207.png)
![stable-4.6](https://github.com/pamoedom/ocp4upc/blob/master/examples/stable-4.6_4.5.20_amd64_20210208.png)

~~~
$ ocp4upc 4.2.26-4.6
Expand All @@ -60,9 +60,9 @@ $ ocp4upc 4.2.26-4.6
[INFO] Processing 'stable-4.5' edges...
[INFO] Processing 'stable-4.6' edges...
[WARN] Skipping file 'stable-4.6_4.5.30.gv', no upgrade paths available.
[INFO] Result exported as 'stable-multigraph_4.2.26-4.6_20210207.svg'
[INFO] Result exported as 'stable-multigraph_4.2.26-4.6_amd64_20210207.svg'
~~~
![stable-multigraph-4.6](https://github.com/pamoedom/ocp4upc/blob/master/examples/stable-multigraph_4.2.26-4.6_20210207.png)
![stable-multigraph-4.6](https://github.com/pamoedom/ocp4upc/blob/master/examples/stable-multigraph_4.2.26-4.6_amd64_20210208.png)

## Dependencies
- [`curl`](https://curl.haxx.se/)
Expand Down
Binary file removed examples/fast-4.6_4.5.20-amd64_20210207.png
Binary file not shown.
295 changes: 0 additions & 295 deletions examples/fast-4.6_4.5.20-amd64_20210207.svg

This file was deleted.

295 changes: 295 additions & 0 deletions examples/fast-4.6_4.5.20_amd64_20210208.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/stable-4.6_4.5.20_amd64_20210208.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
295 changes: 295 additions & 0 deletions examples/stable-4.6_4.5.20_amd64_20210208.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
465 changes: 465 additions & 0 deletions examples/stable-multigraph_4.2.26-4.6_amd64_20210208.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 17 additions & 8 deletions ocp4upc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -o pipefail
[[ $(echo $BASH_VERSION | cut -d. -f1) -ge "5" ]] && set -o nounset #https://github.com/pamoedom/ocp4upc/issues/3

#GLOBAL STUFF
VERSION="3.0"
VERSION="3.1"
[[ "${OSTYPE}" == "linux-gnu"* ]] && BIN="/usr/bin/" || BIN="" #https://github.com/pamoedom/ocp4upc/issues/5
CHANDEF=(stable fast eus) #Default list of channels, add/remove channels only here (if needed), the script will do the rest ;)

Expand Down Expand Up @@ -342,7 +342,9 @@ function colorize()

##abort if the provided release is not present within any of the channels
if [ ${#RES[@]} -eq 0 ];then
if [ "${MOD}" != "4.x.z-" ]; then
if [ "${MOD}" == "4.x.z-" ]; then
return 1
else
cout "ERRO" "Version '${VER}' not found (or not upgradable) within '${TRG}' channels. Aborting execution."
cout "HINT" "Run the script without parameters to see other available modes."
exit 1
Expand Down Expand Up @@ -391,24 +393,24 @@ function draw()
###Single path modes
"4.x.z" | "4.x.z.")
for chan in "${RES[@]}"; do
${BIN}dot -Tsvg ${PTH}/${chan}-${TRG}_${ver}.gv -o ${chan}-${TRG}_${ver}-${ARC}_${date}.svg
${BIN}dot -Tsvg ${PTH}/${chan}-${TRG}_${ver}.gv -o ${chan}-${TRG}_${ver}_${ARC}_${date}.svg
if [ $? -ne 0 ]; then
cout "ERRO" "Unable to export the results. Aborting execution."
exit 1
else
cout "INFO" "Result exported as '${chan}-${TRG}_${ver}-${ARC}_${date}.svg'"
cout "INFO" "Result exported as '${chan}-${TRG}_${ver}_${ARC}_${date}.svg'"
fi
done
;;
###Multigraph mode
"4.x.z-")
for chan in "${RES[@]}"; do
${BIN}dot -Tsvg ${PTH}/${chan}-multigraph.gv -o ${chan}-multigraph_${ver}-${TRG}_${date}.svg
${BIN}dot -Tsvg ${PTH}/${chan}-multigraph.gv -o ${chan}-multigraph_${ver}-${TRG}_${ARC}_${date}.svg
if [ $? -ne 0 ]; then
cout "ERRO" "Unable to export the results. Aborting execution."
exit 1
else
cout "INFO" "Result exported as '${chan}-multigraph_${ver}-${TRG}_${date}.svg'"
cout "INFO" "Result exported as '${chan}-multigraph_${ver}-${TRG}_${ARC}_${date}.svg'"
fi
done
;;
Expand All @@ -430,7 +432,7 @@ function main()
case "${MOD}" in
###Default channels
"4.x")
cout "INFO" "Detected mode '${MOD}', extracting default channels '${TRG}'."
cout "INFO" "Detected mode '${MOD}', extracting default '${TRG}' channels."
get_paths
json2gv
label
Expand Down Expand Up @@ -465,7 +467,9 @@ function main()
cout "INPT" "Select channel type from the list" "-n"
${BIN}echo -n " [$(${BIN}echo "${CHANDEF[@]}")]: "
read -t 20 chan
! [[ ${chan} =~ ^([s][t][a][b][l][e]|[f][a][s][t]|[e][u][s])$ ]] && cout "ERRO" "Invalid selection or timed out. Execution interrupted." && exit 1
local match="false" #make the channel selection dynamic
for opt in "${CHA[@]}"; do [[ "${opt}" != "${chan}" ]] && continue || match="true"; done
[[ "${match}" != "true" ]] && cout "ERRO" "Invalid selection or timed out. Execution interrupted." && exit 1
CHA=("${chan}")
local verI="${VER}" #save the initial version value for multigraph draw function
TRG="${TRGa[0]}"
Expand All @@ -475,6 +479,11 @@ function main()
capture_lts "2" #limited to the latest 2 targets to simplify the graph
json2gv "${i}"
colorize
if [ $? -eq 1 ]; then
cout "ERRO" "Version '${VER}' not found (or not upgradable) within '${TRG}' channel. Aborting execution."
cout "HINT" "Run the script without parameters to see other available modes."
exit 1
fi
label
${BIN}cat ${PTH}/${chan}-${TRG}_${VER}.gv >> ${PTH}/${chan}-multigraph.gv #always dump the first target
[ $? -ne 0 ] && cout "ERRO" "Unable to write in '${PTH}'. Aborting execution." && exit 1
Expand Down

0 comments on commit 3b80b8a

Please sign in to comment.