Patchwork [meta-oe] mysql: make it work after $libexec change - LP: #1068759

login
register
mail settings
Submitter Marcin Juszkiewicz
Date Nov. 19, 2012, 10:27 a.m.
Message ID <1353320857-14067-1-git-send-email-marcin.juszkiewicz@linaro.org>
Download mbox | patch
Permalink /patch/39231/
State Superseded
Headers show

Comments

Marcin Juszkiewicz - Nov. 19, 2012, 10:27 a.m.
Mysql start scripts assumed that mysqld is in /usr/libexec/ directory.
It was true until 406bd38b4232f9f399ef5ffe0b4fac72ed605a23 landed in
OE-Core.

This changeset fixes mysqld start and initial databases population
scripts.

More: https://bugs.launchpad.net/linaro-oe/+bug/1068759

Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
---
 .../mysql/mysql5/no-libexec-anymore.patch          | 56 ++++++++++++++++++++++
 meta-oe/recipes-support/mysql/mysql5_5.1.40.inc    |  5 +-
 2 files changed, 59 insertions(+), 2 deletions(-)
 create mode 100644 meta-oe/recipes-support/mysql/mysql5/no-libexec-anymore.patch
Koen Kooi - Nov. 21, 2012, 10:38 a.m.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Op 19-11-12 11:27, Marcin Juszkiewicz schreef:
> Mysql start scripts assumed that mysqld is in /usr/libexec/ directory. It
> was true until 406bd38b4232f9f399ef5ffe0b4fac72ed605a23 landed in 
> OE-Core.
> 
> This changeset fixes mysqld start and initial databases population 
> scripts.

This replaces one hardcode with another, which breaks DISTROs that keep
/usr/libexec. Can you sed it in do_install_append?

regards,

Koen
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)
Comment: GPGTools - http://gpgtools.org

iD8DBQFQrK8lMkyGM64RGpERAv1kAKCrIxpHbF8yzZMIufZjeZkxxAxipwCfUJtA
jb1oTnFXIvpqk/IQVYazAe8=
=tdxb
-----END PGP SIGNATURE-----

Patch

diff --git a/meta-oe/recipes-support/mysql/mysql5/no-libexec-anymore.patch b/meta-oe/recipes-support/mysql/mysql5/no-libexec-anymore.patch
new file mode 100644
index 0000000..6801308
--- /dev/null
+++ b/meta-oe/recipes-support/mysql/mysql5/no-libexec-anymore.patch
@@ -0,0 +1,56 @@ 
+---
+ scripts/mysql_install_db.sh |    4 ++--
+ scripts/mysqld_safe.sh      |    8 ++++----
+ 2 files changed, 6 insertions(+), 6 deletions(-)
+
+--- mysql-5.1.40.orig/scripts/mysql_install_db.sh
++++ mysql-5.1.40/scripts/mysql_install_db.sh
+@@ -256,14 +256,14 @@ then
+   scriptdir="$srcdir/scripts"
+ elif test -n "$basedir"
+ then
+   bindir="$basedir/bin"
+   extra_bindir="$bindir"
+-  mysqld=`find_in_basedir mysqld libexec sbin bin`
++  mysqld=`find_in_basedir mysqld lib/mysql5 sbin bin`
+   if test -z "$mysqld"
+   then
+-    cannot_find_file mysqld $basedir/libexec $basedir/sbin $basedir/bin
++    cannot_find_file mysqld $basedir/lib/mysql5 $basedir/sbin $basedir/bin
+     exit 1
+   fi
+   langdir=`find_in_basedir --dir errmsg.sys share/english share/mysql/english`
+   if test -z "$langdir"
+   then
+--- mysql-5.1.40.orig/scripts/mysqld_safe.sh
++++ mysql-5.1.40/scripts/mysqld_safe.sh
+@@ -219,25 +219,25 @@ MY_PWD=`pwd`
+ if test -n "$MY_BASEDIR_VERSION" -a -d "$MY_BASEDIR_VERSION"
+ then
+   # BASEDIR is already overridden on command line.  Do not re-set.
+ 
+   # Use BASEDIR to discover le.
+-  if test -x "$MY_BASEDIR_VERSION/libexec/mysqld"
++  if test -x "$MY_BASEDIR_VERSION/lib/mysql5/mysqld"
+   then
+-    ledir="$MY_BASEDIR_VERSION/libexec"
++    ledir="$MY_BASEDIR_VERSION/lib/mysql5"
+   else
+     ledir="$MY_BASEDIR_VERSION/bin"
+   fi
+ elif test -f "$relpkgdata"/english/errmsg.sys -a -x "$MY_PWD/bin/mysqld"
+ then
+   MY_BASEDIR_VERSION="$MY_PWD"		# Where bin, share and data are
+   ledir="$MY_PWD/bin"			# Where mysqld is
+ # Check for the directories we would expect from a source install
+-elif test -f "$relpkgdata"/english/errmsg.sys -a -x "$MY_PWD/libexec/mysqld"
++elif test -f "$relpkgdata"/english/errmsg.sys -a -x "$MY_PWD/lib/mysql5/mysqld"
+ then
+   MY_BASEDIR_VERSION="$MY_PWD"		# Where libexec, share and var are
+-  ledir="$MY_PWD/libexec"		# Where mysqld is
++  ledir="$MY_PWD/lib/mysql5"		# Where mysqld is
+ # Since we didn't find anything, used the compiled-in defaults
+ else
+   MY_BASEDIR_VERSION='@prefix@'
+   ledir='@libexecdir@'
+ fi
diff --git a/meta-oe/recipes-support/mysql/mysql5_5.1.40.inc b/meta-oe/recipes-support/mysql/mysql5_5.1.40.inc
index 3867a12..703aebc 100644
--- a/meta-oe/recipes-support/mysql/mysql5_5.1.40.inc
+++ b/meta-oe/recipes-support/mysql/mysql5_5.1.40.inc
@@ -5,7 +5,7 @@  LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=477ab0a4c8ca64b482b3f2a365d0fdfa"
 
 DEPENDS = "ncurses"
-PR = "r10"
+PR = "r11"
 
 SRC_URI = "http://downloads.mysql.com/archives/mysql-5.1/mysql-${PV}.tar.gz \
            file://configure.in.patch \
@@ -13,8 +13,9 @@  SRC_URI = "http://downloads.mysql.com/archives/mysql-5.1/mysql-${PV}.tar.gz \
            file://misc.m4.patch \
            file://Makefile.am.patch \
            file://fix_host_path.patch \
-	   file://configure-ps-cache-check.patch \
+           file://configure-ps-cache-check.patch \
            file://fix-abi-check-gcc45.patch \
+           file://no-libexec-anymore.patch \
            file://my.cnf \
            file://mysqld.sh"