[Bug 689563] Re: packages: mysql/mysql.init, mysql/mysql.spec - allow spaces and tabs after ...
Caleb Maclennan
689563 at bugs.launchpad.net
Tue Dec 14 11:02:28 CET 2010
>>> ...pff, make temp var "key" there
>> you have write access.
> no, fix yourself,
Hey guys don't forget we're on the same team here.
I tried making this change myself, but either my smattering of awk
knowledge is not enough or something else is going on here. I made up
a variable and striped the spaces from it and used that for the tests,
but it gives the same error we started with. Then I realized that the
original variable was already being stripped (see line 199)! The ~
comparison must be doing something other than just stripping spaces as
per the regex.
Anybody know what else is going on there? Here is my attempted patch.
Index: mysql.init
===================================================================
RCS file: /cvsroot/packages/mysql/mysql.init,v
retrieving revision 1.144
diff -u -r1.144 mysql.init
--- mysql.init 13 Dec 2010 15:09:11 -0000 1.144
+++ mysql.init 14 Dec 2010 09:24:43 -0000
@@ -209,22 +209,25 @@
next;
}
+ key = $1;
+ gsub(/[ \t]*/, "", $key);
+
section == "mysqld" {
- if ($1 ~ /^datadir[ \t]*$/) {
+ if ($key == "datadir") {
printf("MYSQL_DATA_DIR=%s;", $2);
- } else if ($1 ~ /^user[ \t]*$/) {
+ } else if ($key == "user") {
printf("MYSQL_USER=%s;", $2);
- } else if ($1 ~ /^pid-file[ \t]*$/) {
+ } else if ($key == "pid-file") {
printf("MYSQL_PIDFILE=%s;", $2);
- } else if ($1 ~ /^socket[ \t]*$/) {
+ } else if ($key == "socket") {
printf("MYSQL_SOCKET=%s;", $2);
- } else if ($1 ~ /^port[ \t]*$/) {
+ } else if ($key == "port") {
printf("MYSQL_PORT=%s;", $2);
- } else if ($1 ~ /^bind-address[ \t]*$/) {
+ } else if ($key == "bind-address") {
printf("MYSQL_BIND_ADDRESS=%s;", $2);
- } else if ($1 ~ /^skip-networking[ \t]*$/) {
+ } else if ($key == "skip-networking") {
printf("MYSQL_SKIP_NETWORKING=1;");
- } else if ($1 ~ /^log-error[ \t]*$/) {
+ } else if ($key == "log-error") {
printf("MYSQL_LOG_ERROR=%s;", $2);
}
}
--
You received this bug notification because you are subscribed to PLD
Linux.
https://bugs.launchpad.net/bugs/689563
Title:
Mawk and mysql conflict
Status in PLD Linux Distribution:
Fix Released
Bug description:
[root at pld-laptop ~]# service mysql restart
Error: datadir specified in /var/lib/mysql/mysqld.conf should be
/var/lib/mysql/mysqldb/db MySQL can't be run.
[root at pld-laptop ~]# grep -v "^#" /etc/mysql/clusters.conf
mysqld.conf=/var/lib/mysql
[root at pld-laptop ~]# rpm -qv mysql
mysql-5.1.52-1.i686
[root at pld-laptop ~]# rpm -qv mawk
mawk-1.3.4-0.20100625.1.i686
mawk build on carme, but some time ago there were in th-foo (I don't
know, in which th-*), and --upgrade-dist didn't "downgrade" mawk.
More information about the pld-bugs
mailing list