+%triggerpostun -- mysql < 5.7.0
+configs=""
+for config in $(awk -F= '!/^#/ && /=/{print $1}' /etc/%{name}/clusters.conf); do
+ if echo "$config" | grep -q '^/'; then
+ config_file="$config"
+ elif [ -f "/etc/%{name}/$config" ]; then
+ config_file=/etc/%{name}/$config
+ else
+ clusterdir=$(awk -F= "/^$config/{print \$2}" /etc/%{name}/clusters.conf)
+ if [ -z "$clusterdir" ]; then
+ echo >&2 "Can't find cluster dir for $config!"
+ echo >&2 "Please remove extra (leading) spaces from /etc/%{name}/clusters.conf"
+ exit 1
+ fi
+ config_file="$clusterdir/mysqld.conf"
+ fi
+
+ if [ ! -f "$config_file" ]; then
+ echo >&2 "ERROR: Can't find real config file for $config! Please report this (with above errors, if any) to http://bugs.pld-linux.org/"
+ continue
+ fi
+ configs="$configs $config_file"
+done
+
+(
+echo 'You should run MySQL upgrade script *after* restarting MySQL server for all MySQL clusters.'
+echo 'Thus, you should invoke:'
+for config in $configs; do
+ sed -i -e '
+ s/^log-warnings *=/log-error-verbosity =/
+ s/^myisam-recover$/myisam-recover-options/
+ s/^innodb_mirrored_log_groups.*//
+ ' $config
+
+ socket=$(awk -F= '!/^#/ && $1 ~ /socket/{print $2}' $config | xargs)
+ echo "# mysql_upgrade ${socket:+--socket=$socket}"
+done
+) | %banner -e %{name}-5.7
+