@@ -139,10 +139,13 @@ set -u
139139# Any of the below steps could fail
140140trap save_failure_logs ERR
141141
142+ read -ra package_array <<< " $package_list"
143+
142144# Install previous release
143- echo " $package_list " | xargs sudo " $pkg_cmd " " $pkg_cmd_options " install ||
145+ if sudo " $pkg_cmd " " $pkg_cmd_options " install " ${package_array[@]} " ; then
144146 bb_log_err " installation of a previous release failed, see the output above"
145- # fi
147+ save_failure_logs
148+ fi
146149
147150# Start the server, check that it is working and create some structures
148151#
174177# //TEMP upgrade does not work without this but why? Can't we fix it?
175178if [[ $test_type == " major" ]]; then
176179 bb_log_info " remove old packages for major upgrade"
177- packages_to_remove= $( rpm -qa | grep ' MariaDB-' | awk -F' -' ' {print $1"-"$2}' )
178- echo " $packages_to_remove " | xargs sudo " $pkg_cmd " " $pkg_cmd_options " remove
180+ readarray -t package_array <<< " $(rpm -qa | grep 'MariaDB-' | awk -F'-' '{print $1" -" $2 }')"
181+ sudo " $pkg_cmd " " $pkg_cmd_options " remove " ${package_array[@]} "
179182 rpm -qa | grep -iE ' maria|mysql' || true
180183fi
181184
182185rpm_setup_bb_galera_artifacts_mirror
183186rpm_setup_bb_artifacts_mirror
184187if [[ $test_type == " major" ]]; then
185188 # major upgrade (remove then install)
186- echo " $package_list " | xargs sudo " $pkg_cmd " " $pkg_cmd_options " install
189+ sudo " $pkg_cmd " " $pkg_cmd_options " install " ${package_array[@]} "
187190else
188191 # minor upgrade (upgrade works)
189- echo " $package_list " | xargs sudo " $pkg_cmd " " $pkg_cmd_options " " $pkg_cmd_upgrade "
192+ sudo " $pkg_cmd " " $pkg_cmd_options " " $pkg_cmd_upgrade " " ${package_array[@]} "
190193fi
191194# set +e
192195
0 commit comments