oracle / centos2ol

Script and documentation to switch CentOS/Rocky Linux to Oracle Linux
https://linux.oracle.com/switch/centos/
Universal Permissive License v1.0
344 stars 81 forks source link

all packages reinstall with -r on centos 7 has condition error #144

Closed trezqers closed 2 years ago

trezqers commented 2 years ago

migrating from centos 7 I have an issue with -r option, there is an error with validating condition in centos2ol.sh line 564.

List of packages looks ok, I thing problematic is second condition, which is checking count_elems > 0 is wrong, so changed it like this:

-    if [[ -n "${list_of_centos_rpms[*]}" ]] && [[ "${list_of_centos_rpms[*]}" -ne 0 ]]; then
+    if [[ -n "${list_of_centos_rpms[*]}" ]] && [[ "${#list_of_centos_rpms[@]}" -ne 0 ]]; then

so from "${list_of_centos_rpms[*]}" which i one arg list of values, to "${#list_of_centos_rpms[@]}" which is count of them

and it works as expectd :)

ChristianGfK commented 2 years ago

Simple enough fix, but I assume they need a pull request and a signed OCA...