summaryrefslogtreecommitdiff
path: root/support-files
diff options
context:
space:
mode:
authorBalasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com>2015-08-26 19:29:00 +0200
committerBalasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com>2015-08-26 19:29:00 +0200
commitb1895fb8c924e7152b73765cfd02b686362ca76c (patch)
tree3ba9f72fc6cd1efe02e69654fc84ceb2078b4610 /support-files
parente414cbffad0e095c545cf2aa3f646c8a36c9b398 (diff)
downloadmariadb-git-b1895fb8c924e7152b73765cfd02b686362ca76c.tar.gz
Bug#21527467 - RPM SCRIPTS FAIL WITH MULTIPLE DATADIR
Diffstat (limited to 'support-files')
-rw-r--r--support-files/mysql.spec.sh14
1 files changed, 7 insertions, 7 deletions
diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh
index aaeed444e2f..5af4783f919 100644
--- a/support-files/mysql.spec.sh
+++ b/support-files/mysql.spec.sh
@@ -635,7 +635,7 @@ install -m 644 "%{malloc_lib_source}" \
# Check local settings to support them.
if [ -x %{_bindir}/my_print_defaults ]
then
- mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p'`
+ mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | tail -1 | sed -n 's/--datadir=//p'`
PID_FILE_PATT=`%{_bindir}/my_print_defaults server mysqld | grep '^--pid-file=' | sed -n 's/--pid-file=//p'`
fi
if [ -z "$mysql_datadir" ]
@@ -740,7 +740,7 @@ esac
STATUS_FILE=$mysql_datadir/RPM_UPGRADE_MARKER
-if [ -f $STATUS_FILE ]; then
+if [ -f "$STATUS_FILE" ]; then
echo "Some previous upgrade was not finished:"
ls -ld $STATUS_FILE
echo "Please check its status, then do"
@@ -811,7 +811,7 @@ fi
# Check local settings to support them.
if [ -x %{_bindir}/my_print_defaults ]
then
- mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p'`
+ mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | tail -1 | sed -n 's/--datadir=//p'`
fi
if [ -z "$mysql_datadir" ]
then
@@ -824,8 +824,8 @@ STATUS_FILE=$mysql_datadir/RPM_UPGRADE_MARKER
# ----------------------------------------------------------------------
# Create data directory if needed, check whether upgrade or install
# ----------------------------------------------------------------------
-if [ ! -d $mysql_datadir ] ; then mkdir -m 755 $mysql_datadir; fi
-if [ -f $STATUS_FILE ] ; then
+if [ ! -d "$mysql_datadir" ] ; then mkdir -m 755 "$mysql_datadir" ; fi
+if [ -f "$STATUS_FILE" ] ; then
SERVER_TO_START=`grep '^SERVER_TO_START=' $STATUS_FILE | cut -c17-`
else
SERVER_TO_START=''
@@ -1003,7 +1003,7 @@ fi
# Check local settings to support them.
if [ -x %{_bindir}/my_print_defaults ]
then
- mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p'`
+ mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | tail -1 | sed -n 's/--datadir=//p'`
fi
if [ -z "$mysql_datadir" ]
then
@@ -1014,7 +1014,7 @@ NEW_VERSION=%{mysql_version}-%{release}
STATUS_FILE=$mysql_datadir/RPM_UPGRADE_MARKER-LAST # Note the difference!
STATUS_HISTORY=$mysql_datadir/RPM_UPGRADE_HISTORY
-if [ -f $STATUS_FILE ] ; then
+if [ -f "$STATUS_FILE" ] ; then
SERVER_TO_START=`grep '^SERVER_TO_START=' $STATUS_FILE | cut -c17-`
else
# This should never happen, but let's be prepared