From adbeca7d48c4a894558f95f53a046baa44275c9b Mon Sep 17 00:00:00 2001 From: Thomas Goirand Date: Fri, 21 Oct 2016 09:36:34 +0200 Subject: [PATCH] correct options for mysql_install_db * Using the correct options for mysql_install_db so that it continues to work with MySQL 5.7.x. * Build-Depends on default-mysql-client and default-mysql-server instead of mysql-client & mysql-server (the later is kept as an alternative). Change-Id: I5532ad5d7afef7062a9cbb96ec3c03612b89485f --- debian/changelog | 9 +++++++++ debian/control | 4 ++-- debian/test.sh | 15 ++++++++++++++- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index e91ab99..5c6e1ac 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +migrate (0.10.0-6) unstable; urgency=medium + + * Using the correct options for mysql_install_db so that it continues to work + with MySQL 5.7.x. + * Build-Depends on default-mysql-client and default-mysql-server instead of + mysql-client & mysql-server (the later is kept as an alternative). + + -- Thomas Goirand Fri, 21 Oct 2016 09:33:40 +0200 + migrate (0.10.0-5) unstable; urgency=medium [ Thomas Goirand ] diff --git a/debian/control b/debian/control index 63f88eb..6e47d4a 100644 --- a/debian/control +++ b/debian/control @@ -14,8 +14,8 @@ Build-Depends: debhelper (>= 9), python3-all, python3-pbr (>= 1.8), python3-setuptools, -Build-Depends-Indep: mysql-client, - mysql-server, +Build-Depends-Indep: default-mysql-client | mysql-client, + default-mysql-server | mysql-server, python-coverage, python-decorator, python-feedparser, diff --git a/debian/test.sh b/debian/test.sh index 0cfd625..4201217 100755 --- a/debian/test.sh +++ b/debian/test.sh @@ -5,9 +5,22 @@ set -e MYTEMP_DIR=`mktemp -d` ME=`whoami` +MYSQL_VERSION=/usr/sbin/mysqld --version 2>/dev/null | grep Ver | awk '{print $3}' | cut -d- -f1 +MYSQL_VERSION_MAJ=$(echo $MYSQL_VERSION) | cut -d. -f1 +MYSQL_VERSION=/usr/sbin/mysqld --version 2>/dev/null | grep Ver | awk '{print $3}' | cut -d- -f1 +MYSQL_VERSION_MID=$(echo $MYSQL_VERSION) | cut -d. -f2 +MYSQL_VERSION=/usr/sbin/mysqld --version 2>/dev/null | grep Ver | awk '{print $3}' | cut -d- -f1 +MYSQL_VERSION_MIN=$(echo $MYSQL_VERSION) | cut -d. -f3 + +if [ "${MYSQL_VERSION_MAJ}" -le 5 ] && [ "${MYSQL_VERSION_MID}" -lt 7 ] ; then + MYSQL_INSTALL_DB_OPT="--force --skip-name-resolve" +else + MYSQL_INSTALL_DB_OPT="--basedir=/usr" +fi + # --force is needed because buildd's can't resolve their own hostnames to ips echo "===> Preparing MySQL temp folder" -mysql_install_db --no-defaults --datadir=${MYTEMP_DIR} --force --skip-name-resolve --user=${ME} +mysql_install_db --no-defaults --datadir=${MYTEMP_DIR} ${MYSQL_INSTALL_DB_OPT} --user=${ME} chown -R ${ME} ${MYTEMP_DIR} echo "===> Starting MySQL" /usr/sbin/mysqld --no-defaults --skip-grant-tables --user=${ME} --socket=${MYTEMP_DIR}/mysql.sock --datadir=${MYTEMP_DIR} --skip-networking &