From a175314c3e5827eb193872241446f2f8f5c9d33c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 4 May 2024 20:07:14 +0200 Subject: Adding upstream version 1:10.5.12. Signed-off-by: Daniel Baumann --- support-files/rpm/server-prein.sh | 67 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 support-files/rpm/server-prein.sh (limited to 'support-files/rpm/server-prein.sh') diff --git a/support-files/rpm/server-prein.sh b/support-files/rpm/server-prein.sh new file mode 100644 index 00000000..9f8d1229 --- /dev/null +++ b/support-files/rpm/server-prein.sh @@ -0,0 +1,67 @@ +# Check if we can safely upgrade. An upgrade is only safe if it's from one +# of our RPMs in the same version family. + +installed=`rpm -q --whatprovides mysql-server 2> /dev/null` +if [ $? -eq 0 -a -n "$installed" ]; then + installed=`echo "$installed"|sed -n 1p` + vendor=`rpm -q --queryformat='%{VENDOR}' "$installed" 2>&1 | sed 's/Monty Program AB/MariaDB Foundation/'` + version=`rpm -q --queryformat='%{VERSION}' "$installed" 2>&1` + myvendor='%{mysql_vendor}' + myversion='%{mysqlversion}' + + old_family=`echo $version | sed -n -e 's,^\([1-9][0-9]*\.[0-9][0-9]*\)\..*$,\1,p'` + new_family=`echo $myversion | sed -n -e 's,^\([1-9][0-9]*\.[0-9][0-9]*\)\..*$,\1,p'` + + [ -z "$vendor" ] && vendor='' + [ -z "$old_family" ] && old_family="" + [ -z "$new_family" ] && new_family="" + + error_text= + if [ "$vendor" != "$myvendor" ]; then + error_text="$error_text +The current MariaDB server package is provided by a different +vendor ($vendor) than $myvendor. Some files may be installed +to different locations, including log files and the service +startup script in %{_sysconfdir}/init.d/. +" + fi + + if [ "$old_family" != "$new_family" ]; then + error_text="$error_text +Upgrading directly from MySQL $old_family to MariaDB $new_family may not +be safe in all cases. A manual dump and restore using mysqldump is +recommended. It is important to review the MariaDB manual's Upgrading +section for version-specific incompatibilities. +" + fi + + if [ -n "$error_text" ]; then + cat <&2 + +****************************************************************** +A MySQL or MariaDB server package ($installed) is installed. +$error_text +A manual upgrade is required. + +- Ensure that you have a complete, working backup of your data and my.cnf + files +- Shut down the MySQL server cleanly +- Remove the existing MySQL packages. Usually this command will + list the packages you should remove: + rpm -qa | grep -i '^mysql-' + + You may choose to use 'rpm --nodeps -ev ' to remove + the package which contains the mysqlclient shared library. The + library will be reinstalled by the MariaDB-shared package. +- Install the new MariaDB packages supplied by $myvendor +- Ensure that the MariaDB server is started +- Run the 'mysql_upgrade' program + +This is a brief description of the upgrade process. Important details +can be found in the MariaDB manual, in the Upgrading section. +****************************************************************** +HERE + exit 1 + fi +fi + -- cgit v1.2.3