summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2019-02-07 13:59:31 +0100
committerOleksandr Byelkin <sanja@mariadb.com>2019-02-07 13:59:31 +0100
commit65c5ef9b495bac078ad2a502a75801c7cfe5b95a (patch)
tree266859fc4e22dcd18112a25e8a3e4f9d93a043a0 /scripts
parent7293ce0ee81f05b1ec3ac9ddcc88bfbee4030e55 (diff)
parent625994b7cc4ebd0bc2652ae80b93386aa4b766ac (diff)
downloadmariadb-git-65c5ef9b495bac078ad2a502a75801c7cfe5b95a.tar.gz
dirty merge
Diffstat (limited to 'scripts')
-rw-r--r--scripts/mysql_install_db.sh21
-rw-r--r--scripts/wsrep_sst_mariabackup.sh6
-rw-r--r--scripts/wsrep_sst_rsync.sh2
3 files changed, 20 insertions, 9 deletions
diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh
index fb3b32251ed..8052eb994f5 100644
--- a/scripts/mysql_install_db.sh
+++ b/scripts/mysql_install_db.sh
@@ -41,6 +41,9 @@ auth_root_authentication_method=normal
auth_root_socket_user='root'
skip_test_db=0
+dirname0=`dirname $0 2>/dev/null`
+dirname0=`dirname $dirname0 2>/dev/null`
+
usage()
{
cat <<EOF
@@ -242,11 +245,6 @@ cannot_find_file()
echo "If you don't want to do a full install, you can use the --srcdir"
echo "option to only install the mysql database and privilege tables"
echo
- echo "If you compiled from source, you need to either run 'make install' to"
- echo "copy the software into the correct location ready for operation."
- echo "If you don't want to do a full install, you can use the --srcdir"
- echo "option to only install the mysql database and privilege tables"
- echo
echo "If you are using a binary release, you must either be at the top"
echo "level of the extracted archive, or pass the --basedir option"
echo "pointing to that location."
@@ -287,6 +285,9 @@ 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
@@ -342,6 +343,16 @@ then
exit 1
fi
plugindir=`find_in_dirs --dir auth_socket.so $basedir/lib*/plugin $basedir/lib*/mysql/plugin`
+# 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"
+ srcpkgdatadir="$basedir/@INSTALL_MYSQLSHAREDIR@"
+ buildpkgdatadir="$basedir/@INSTALL_MYSQLSHAREDIR@"
+ plugindir="$basedir/@INSTALL_PLUGINDIR@"
else
basedir="@prefix@"
bindir="@bindir@"
diff --git a/scripts/wsrep_sst_mariabackup.sh b/scripts/wsrep_sst_mariabackup.sh
index 5362389a59d..f4ec0d59a29 100644
--- a/scripts/wsrep_sst_mariabackup.sh
+++ b/scripts/wsrep_sst_mariabackup.sh
@@ -516,7 +516,7 @@ kill_xtrabackup()
setup_ports()
{
if [[ "$WSREP_SST_OPT_ROLE" == "donor" ]];then
- if [[ ${WSREP_SST_OPT_ADDR:0:1} == '[' ]];then
+ if [ "${WSREP_SST_OPT_ADDR#\[}" != "$WSREP_SST_OPT_ADDR" ]; then
remain=$(echo $WSREP_SST_OPT_ADDR | awk -F '\\][:/]' '{ print $2 }')
REMOTEIP=$(echo $WSREP_SST_OPT_ADDR | awk -F '\\]:' '{ print $1 }')"]"
SST_PORT=$(echo $remain | awk -F '[:/]' '{ print $1 }')
@@ -529,7 +529,7 @@ setup_ports()
sst_ver=$(echo $WSREP_SST_OPT_ADDR | awk -F '[:/]' '{ print $5 }')
fi
else
- if [[ ${WSREP_SST_OPT_ADDR:0:1} == '[' ]];then
+ if [ "${WSREP_SST_OPT_ADDR#\[}" != "$WSREP_SST_OPT_ADDR" ]; then
SST_PORT=$(echo ${WSREP_SST_OPT_ADDR} | awk -F '\\]:' '{ print $2 }')
else
SST_PORT=$(echo ${WSREP_SST_OPT_ADDR} | awk -F ':' '{ print $2 }')
@@ -972,7 +972,7 @@ then
if [ -z "${SST_PORT}" ]
then
SST_PORT=4444
- if [[ ${ADDR:0:1} == '[' ]];then
+ if [ "${ADDR#\[}" != "$ADDR" ]; then
ADDR="$(echo ${WSREP_SST_OPT_ADDR} | awk -F '\\]:' '{ print $1 }')]:${SST_PORT}"
else
ADDR="$(echo ${WSREP_SST_OPT_ADDR} | awk -F ':' '{ print $1 }'):${SST_PORT}"
diff --git a/scripts/wsrep_sst_rsync.sh b/scripts/wsrep_sst_rsync.sh
index a425d335868..c1d6660f9d2 100644
--- a/scripts/wsrep_sst_rsync.sh
+++ b/scripts/wsrep_sst_rsync.sh
@@ -398,7 +398,7 @@ then
rm -rf "$RSYNC_PID"
ADDR=$WSREP_SST_OPT_ADDR
- if [[ ${ADDR:0:1} == '[' ]]; then
+ if [ "${ADDR#\[}" != "$ADDR" ]; then
RSYNC_PORT=$(echo $ADDR | awk -F '\\]:' '{ print $2 }')
RSYNC_ADDR=$(echo $ADDR | awk -F '\\]:' '{ print $1 }')"]"
else