@@ -135,10 +135,13 @@ set -u
135135# Any of the below steps could fail
136136trap save_failure_logs ERR
137137
138+ read -ra package_array <<< " $package_list"
139+
138140# Install previous release
139- echo " $package_list " | xargs sudo " $pkg_cmd " " $pkg_cmd_options " install ||
141+ if sudo " $pkg_cmd " " $pkg_cmd_options " install " ${package_array[@]} " ; then
140142 bb_log_err " installation of a previous release failed, see the output above"
141- # fi
143+ save_failure_logs
144+ fi
142145
143146# Start the server, check that it is working and create some structures
144147#
170173# //TEMP upgrade does not work without this but why? Can't we fix it?
171174if [[ $test_type == " major" ]]; then
172175 bb_log_info " remove old packages for major upgrade"
173- packages_to_remove= $( rpm -qa | grep ' MariaDB-' | awk -F' -' ' {print $1"-"$2}' )
174- echo " $packages_to_remove " | xargs sudo " $pkg_cmd " " $pkg_cmd_options " remove
176+ readarray -t package_array <<< " $(rpm -qa | grep 'MariaDB-' | awk -F'-' '{print $1" -" $2 }')"
177+ sudo " $pkg_cmd " " $pkg_cmd_options " remove " ${package_array[@]} "
175178 rpm -qa | grep -iE ' maria|mysql' || true
176179fi
177180
178181rpm_setup_bb_galera_artifacts_mirror
179182rpm_setup_bb_artifacts_mirror
180183if [[ $test_type == " major" ]]; then
181184 # major upgrade (remove then install)
182- echo " $package_list " | xargs sudo " $pkg_cmd " " $pkg_cmd_options " install
185+ sudo " $pkg_cmd " " $pkg_cmd_options " install " ${package_array[@]} "
183186else
184187 # minor upgrade (upgrade works)
185- echo " $package_list " | xargs sudo " $pkg_cmd " " $pkg_cmd_options " " $pkg_cmd_upgrade "
188+ sudo " $pkg_cmd " " $pkg_cmd_options " " $pkg_cmd_upgrade " " ${package_array[@]} "
186189fi
187190# set +e
188191
0 commit comments