[packages/mysql/MYSQL_5_0] init: add sharedir variable for /usr/share/foo

glen glen at pld-linux.org
Thu Sep 24 15:42:03 CEST 2015


commit 3fa1e6b0f223b8f733e8e8d0750a4f0bccdbf062
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Thu Sep 24 16:38:57 2015 +0300

    init: add sharedir variable for /usr/share/foo

 mysql.init | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/mysql.init b/mysql.init
index fbc7ab1..2141bdd 100755
--- a/mysql.init
+++ b/mysql.init
@@ -51,6 +51,8 @@ else
 	exit 0
 fi
 
+sharedir=/usr/share/mysql
+
 action="$1"
 
 # any db cluster as command line argument?
@@ -468,13 +470,13 @@ mysqlinit() {
 	chown mysql:mysql "$MYSQL_CLUSTER_DIR/mysqldb" "$MYSQL_DATA_DIR" > /dev/null 2>&1
 	chmod 751 "$MYSQL_CLUSTER_DIR" "$MYSQL_CLUSTER_DIR/mysqldb"
 
-	if [ -f /usr/share/mysql/mysqld.conf -a ! -f "$MYSQL_CLUSTER_DIR/mysqld.conf" ]; then
+	if [ -f $sharedir/mysqld.conf -a ! -f "$MYSQL_CLUSTER_DIR/mysqld.conf" ]; then
 	    sed -e "
 		s#\(datadir.*\)=.*#\1= $MYSQL_DATA_DIR#g;
 		s#\(pid-file.*\)=.*#\1= $MYSQL_PIDFILE#g;
 		s#\(socket.*\)=.*#\1= $MYSQL_SOCKET#g;
 		s#@clusterdir@#$MYSQL_CLUSTER_DIR#g;
-		" /usr/share/mysql/mysqld.conf > "$MYSQL_CLUSTER_DIR/mysqld.conf"
+		" $sharedir/mysqld.conf > "$MYSQL_CLUSTER_DIR/mysqld.conf"
 	    chown root:root "$MYSQL_CLUSTER_DIR/mysqld.conf"
 	    chmod 640 "$MYSQL_CLUSTER_DIR/mysqld.conf"
 	fi
@@ -487,8 +489,8 @@ mysqlinit() {
 	cat > $MYSQL_DATA_DIR/mysql-init.sql <<-EOF
 		CREATE DATABASE mysql;
 		use mysql;
-		$(cat /usr/share/mysql/mysql_system_tables.sql)
-		$(sed -e "/@current_hostname/d" /usr/share/mysql/mysql_system_tables_data.sql)
+		$(cat $sharedir/mysql_system_tables.sql)
+		$(sed -e "/@current_hostname/d" $sharedir/mysql_system_tables_data.sql)
 EOF
 
 	ok=0
@@ -529,7 +531,7 @@ mysqladmin section. See the manual for more instructions.
 END_OF_MSG
 		show "Filling help tables..."
 		ok=0
-		( echo "use mysql;"; cat /usr/share/mysql/fill_help_tables.sql ) | \
+		( echo "use mysql;"; cat $sharedir/fill_help_tables.sql ) | \
 			/usr/sbin/mysqld \
 			--defaults-file=$MYSQL_CLUSTER_DIR/mysqld.conf \
 			--bootstrap \
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/mysql.git/commitdiff/7d358ed1a3f3624b058df686e98f969b3cc2758b



More information about the pld-cvs-commit mailing list