packages: mysql/mysql.init - skip empty lines with db cluster finding - und...

glen glen at pld-linux.org
Wed Apr 21 10:51:22 CEST 2010


Author: glen                         Date: Wed Apr 21 08:51:22 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- skip empty lines with db cluster finding
- undos mysqld config

---- Files affected:
packages/mysql:
   mysql.init (1.142 -> 1.143) 

---- Diffs:

================================================================
Index: packages/mysql/mysql.init
diff -u packages/mysql/mysql.init:1.142 packages/mysql/mysql.init:1.143
--- packages/mysql/mysql.init:1.142	Thu Apr  8 22:34:46 2010
+++ packages/mysql/mysql.init	Wed Apr 21 10:51:17 2010
@@ -28,7 +28,7 @@
 fi
 
 if [ -f /etc/mysql/clusters.conf ]; then
-	MYSQL_DB_CLUSTERS=$(awk -F= '!/^#/{print $2}' /etc/mysql/clusters.conf)
+	MYSQL_DB_CLUSTERS=$(awk -F= '!/^#/ && /=/{print $2}' /etc/mysql/clusters.conf)
 	if [ -z "$MYSQL_DB_CLUSTERS"  ]; then
 		nls "Warning: there are no configured clusters."
 	fi
@@ -191,6 +191,15 @@
 	MYSQL_DATA_DIR= MYSQL_USER= MYSQL_PIDFILE= MYSQL_SOCKET= MYSQL_PORT= MYSQL_BIND_ADDRESS= MYSQL_SKIP_NETWORKING= MYSQL_LOG_ERROR=
 
 	eval `awk -F= '
+	{
+		# undos
+		gsub(/\r$/, "");
+
+		# trim spaces
+		gsub(/^[\t ]*|[\t ]*$/, "", $1);
+		gsub(/^[\t ]*|[\t ]*$/, "", $2);
+	}
+
 	# skip comments and empty lines
 	/^[;#]|^ *$/ { next }
 
@@ -198,12 +207,6 @@
 		match($0, /\[.*\]/);
 		section = substr($0, RSTART + 1, RSTART + RLENGTH - 3);
 		next;
-	}
-
-	# trim spaces
-	{
-		gsub(/^[\t ]*|[\t ]*$/, "", $1);
-		gsub(/^[\t ]*|[\t ]*$/, "", $2);
 	}
 
 	section == "mysqld" {
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/mysql/mysql.init?r1=1.142&r2=1.143&f=u



More information about the pld-cvs-commit mailing list