ganapathi / rpms / mariadb

Forked from rpms/mariadb 4 years ago
Clone
Blob Blame History Raw
Revert upstream changes to make the mysql_install_dbrelocatable

Resolves: #1731062

Upstream intended to make the mysql_install_db script to be relocatable, which
is not a supported use case in RHEL. Because of different layout (mysqld in
/usr/libexec while all other binaries in /usr/bin) these changes broke
mysql_install_db if run without arguments (we use --rpm in the systemd so we
didn't meet this issue there). Reverting changes upstream did fixes the
standalone run of mysql_install_db again.

Original upstream issue: https://jira.mariadb.org/browse/MDEV-14580
Related fixes that broke the RHEL build:
https://github.com/MariaDB/server/commit/9c5be7d131f7eb7f27df722463faa2cd8135fd1b
https://github.com/MariaDB/server/commit/50e593386fcbaa1ca7bd2ed9fdfc51fd5102cdab

diff -up mariadb-5.5.65/scripts/mysql_install_db.sh.norellocatable mariadb-5.5.65/scripts/mysql_install_db.sh
--- mariadb-5.5.65/scripts/mysql_install_db.sh.norellocatable	2019-08-17 07:06:14.135318451 +0200
+++ mariadb-5.5.65/scripts/mysql_install_db.sh	2019-08-17 07:10:58.702473136 +0200
@@ -36,9 +36,6 @@ in_rpm=0
 ip_only=0
 cross_bootstrap=0
 
-dirname0=`dirname $0 2>/dev/null`
-dirname0=`dirname $dirname0 2>/dev/null`
-
 usage()
 {
   cat <<EOF
@@ -243,16 +238,9 @@ then
 fi
 if test -n "$srcdir"
 then
-  # In an out-of-source build, builddir is not srcdir. Try to guess where
-  # builddir is by looking for my_print_defaults.
   if test -z "$builddir"
   then
-    if test -x "$dirname0/extra/my_print_defaults"
-    then
-      builddir="$dirname0"
-    else
-      builddir="$srcdir"
-    fi
+    builddir="$srcdir"
   fi
   print_defaults="$builddir/extra/my_print_defaults"
 elif test -n "$basedir"
@@ -263,9 +251,6 @@ then
     cannot_find_file my_print_defaults $basedir/bin $basedir/extra
     exit 1
   fi
-elif test -n "$dirname0" -a -x "$dirname0/@bindir@/my_print_defaults"
-then
-  print_defaults="$dirname0/@bindir@/my_print_defaults"
 else
   print_defaults="@bindir@/my_print_defaults"
 fi
@@ -317,19 +302,11 @@ then
     cannot_find_file fill_help_tables.sql @pkgdata_locations@
     exit 1
   fi
-# relative from where the script was run for a relocatable install
-elif test -n "$dirname0" -a -x "$dirname0/@INSTALL_SBINDIR@/mysqld"
-then
-  basedir="$dirname0"
-  bindir="$basedir/@INSTALL_SBINDIR@"
-  resolveip="$bindir/resolveip"
-  mysqld="$basedir/@INSTALL_SBINDIR@/mysqld"
-  pkgdatadir="$basedir/@INSTALL_MYSQLSHAREDIR@"
 else
   basedir="@prefix@"
   bindir="@bindir@"
   resolveip="$bindir/resolveip"
-  mysqld="@sbindir@/mysqld"
+  mysqld="@libexecdir@/mysqld"
   pkgdatadir="@pkgdatadir@"
 fi