Index: Mk/Uses/mysql.mk =================================================================== --- Mk/Uses/mysql.mk +++ Mk/Uses/mysql.mk @@ -48,7 +48,10 @@ .endif # !empty(mysql_ARGS) .if defined(DEFAULT_MYSQL_VER) -WARNING+= "DEFAULT_MYSQL_VER is defined, consider using DEFAULT_VERSIONS=mysql=${DEFAULT_MYSQL_VER} instead" +WARNING+= "DEFAULT_MYSQL_VER is defined, consider using DEFAULT_VERSIONS+=mysql=${DEFAULT_MYSQL_VER} instead. Support for DEFAULT_MYSQL_VER will be removed on 2016-08-01" +.endif +.if defined(WITH_MYSQL_VER) +WARNING+= "WITH_MYSQL_VER is defined, consider using DEFAULT_VERSIONS+=mysql=${WITH_MYSQL_VER} instead. Support for WITH_MYSQL_VER will be removed on 2016-08-01" .endif DEFAULT_MYSQL_VER?= ${MYSQL_DEFAULT:S/.//} @@ -66,23 +69,34 @@ MYSQL101m_LIBVER= 18 # Setting/finding MySQL version we want. +# Check installed mysql client version and flavour/fork .if exists(${LOCALBASE}/bin/mysql) _MYSQL!= ${LOCALBASE}/bin/mysql --version | ${SED} -e 's/.*Distrib \([0-9]\{1,2\}\)\.\([0-9]*\).*/\1\2/' _PERCONA!= ${LOCALBASE}/bin/mysql --version | ${GREP} Percona | wc -l _MARIADB!= ${LOCALBASE}/bin/mysql --version | ${GREP} MariaDB | wc -l .if ${_PERCONA} == 1 +_MYSQL_FLAVOUR= percona _MYSQL_VER= ${_MYSQL}p .elif ${_MARIADB} == 1 +_MYSQL_FLAVOUR= mariadb _MYSQL_VER= ${_MYSQL}m .else +_MYSQL_FLAVOUR= mysql _MYSQL_VER= ${_MYSQL} .endif .endif .if defined(_WANT_MYSQL_VER) .if defined(WITH_MYSQL_VER) && ${WITH_MYSQL_VER} != ${_WANT_MYSQL_VER} -IGNORE= cannot install: the port wants mysql${_WANT_MYSQL_VER}-client and you try to install mysql${WITH_MYSQL_VER}-client +.if (${WITH_MYSQL_VER:C/[0-9]*//} == "m") +_WITH_MYSQL_FLAVOUR= mariadb +.elif (${WITH_MYSQL_VER:C/[0-9]*//} == "p") +_WITH_MYSQL_FLAVOUR= percona +.else +_WITH_MYSQL_FLAVOUR= mysql +.endif +IGNORE= cannot install: the port wants ${_MYSQL_FLAVOUR}${_WANT_MYSQL_VER:S/[mp]//}-client and you try to install ${_WITH_MYSQL_FLAVOUR}${WITH_MYSQL_VER:S/[mp]//}-client .endif MYSQL_VER= ${_WANT_MYSQL_VER} .elif defined(WITH_MYSQL_VER) @@ -97,7 +111,14 @@ .if defined(_MYSQL_VER) .if ${_MYSQL_VER} != ${MYSQL_VER} -IGNORE= cannot install: MySQL versions mismatch: mysql${_MYSQL_VER}-client is installed and wanted version is mysql${MYSQL_VER}-client +.if (${MYSQL_VER:C/[0-9]*//} == "m") +_WANT_MYSQL_FLAVOUR= mariadb +.elif (${MYSQL_VER:C/[0-9]*//} == "p") +_WANT_MYSQL_FLAVOUR= percona +.else +_WANT_MYSQL_FLAVOUR= mysql +.endif +IGNORE= cannot install: MySQL versions mismatch: ${_MYSQL_FLAVOUR}${_MYSQL_VER:C/[mp]//}-client is installed and wanted version is ${_WANT_MYSQL_FLAVOUR}${MYSQL_VER:C/[mp]//}-client .endif .endif