svn commit: r354740 - in head: . databases/mariadb55-client databases/mariadb55-client/files databases/mariadb55-server databases/mariadb55-server/files
Michael Gmelin
grembo at FreeBSD.org
Wed May 21 10:37:53 UTC 2014
Author: grembo
Date: Wed May 21 10:37:51 2014
New Revision: 354740
URL: http://svnweb.freebsd.org/changeset/ports/354740
QAT: https://qat.redports.org/buildarchive/r354740/
Log:
Respect hier(7) for config files
PR: ports/182547
Reviewed by: flo
Approved by: flo
Added:
head/databases/mariadb55-client/files/pkg-message.in (contents, props changed)
head/databases/mariadb55-server/files/pkg-message.in (contents, props changed)
Deleted:
head/databases/mariadb55-server/pkg-message
Modified:
head/UPDATING
head/databases/mariadb55-client/Makefile
head/databases/mariadb55-client/files/patch-mysys_default.c
head/databases/mariadb55-server/Makefile
head/databases/mariadb55-server/files/mysql-server.in
head/databases/mariadb55-server/files/patch-mysys_default.c
Modified: head/UPDATING
==============================================================================
--- head/UPDATING Wed May 21 10:32:46 2014 (r354739)
+++ head/UPDATING Wed May 21 10:37:51 2014 (r354740)
@@ -5,6 +5,18 @@ they are unavoidable.
You should get into the habit of checking this file for changes each time
you update your ports collection, before attempting any port upgrades.
+20140521:
+ AFFECTS: users of databases/mariadb55*
+ AUTHOR: grembo at FreeBSD.org
+
+ The mariadb55-client and mariadb55-server port have been changed to
+ respect hier(7) and behave like the mysql ports. Therefore mysql-server
+ and mysql monitor will refuse to start if my.cnf exists in /etc or
+ /etc/mysql.
+
+ In case you're affected, please move /etc/my.cnf to /usr/local/etc and/or
+ /etc/mysql/my.cnf to /usr/local/etc/mysql.
+
20140520:
AFFECTS: users of security/dropbear
AUTHOR: ak at FreeBSD.org
Modified: head/databases/mariadb55-client/Makefile
==============================================================================
--- head/databases/mariadb55-client/Makefile Wed May 21 10:32:46 2014 (r354739)
+++ head/databases/mariadb55-client/Makefile Wed May 21 10:37:51 2014 (r354740)
@@ -1,14 +1,14 @@
# $FreeBSD$
PORTNAME= mariadb
-PORTREVISION= 0
+PORTREVISION= 1
PKGNAMESUFFIX= 55-client
COMMENT= Multithreaded SQL database (client)
MASTERDIR= ${.CURDIR}/../mariadb55-server
-PKGMESSAGE= mustnotexist
+FILESDIR= ${.CURDIR}/files
PATCHDIR= ${.CURDIR}/files
PLIST= ${.CURDIR}/pkg-plist
Modified: head/databases/mariadb55-client/files/patch-mysys_default.c
==============================================================================
--- head/databases/mariadb55-client/files/patch-mysys_default.c Wed May 21 10:32:46 2014 (r354739)
+++ head/databases/mariadb55-client/files/patch-mysys_default.c Wed May 21 10:37:51 2014 (r354740)
@@ -1,5 +1,5 @@
---- mysys/default.c.orig 2012-12-17 03:57:40.000000000 +0200
-+++ mysys/default.c 2012-12-17 04:00:28.000000000 +0200
+--- mysys/default.c.orig 2013-10-01 21:15:03.544135869 +0200
++++ mysys/default.c 2013-10-01 21:15:38.871375504 +0200
@@ -89,7 +89,7 @@
/* Which directories are searched for options (and in which order) */
@@ -18,11 +18,41 @@
/*
Ignore world-writable regular files.
This is mainly done to protect us to not read a file created by
-@@ -1229,6 +1229,7 @@
- #if defined(DEFAULT_SYSCONFDIR)
- if (DEFAULT_SYSCONFDIR[0])
- errors += add_directory(alloc, DEFAULT_SYSCONFDIR, dirs);
-+ errors += add_directory(alloc, DEFAULT_SYSCONFDIR "/mysql", dirs);
- #endif /* DEFAULT_SYSCONFDIR */
+@@ -803,6 +803,14 @@
+ if (!(fp= mysql_file_fopen(key_file_cnf, name, O_RDONLY, MYF(0))))
+ return 1; /* Ignore wrong files */
+
++ if (strstr(name, "/etc") == name)
++ {
++ fprintf(stderr,
++ "error: Config file %s in invalid location, please move to or merge with %%PREFIX%%%s\n",
++ name,name);
++ goto err;
++ }
++
+ while (mysql_file_fgets(buff, sizeof(buff) - 1, fp))
+ {
+ line++;
+@@ -1067,7 +1067,8 @@
+ if (name[0] == FN_HOMELIB) /* Add . to filenames in home */
+ *end++= '.';
+ strxmov(end, conf_file, *ext, " ", NullS);
+- fputs(name, stdout);
++ if (strstr(name, "/etc") != name)
++ fputs(name, stdout);
+ }
+ }
+ }
+@@ -1226,10 +1226,8 @@
+ errors += add_directory(alloc, "/etc/", dirs);
+ errors += add_directory(alloc, "/etc/mysql/", dirs);
+
+-#if defined(DEFAULT_SYSCONFDIR)
+- if (DEFAULT_SYSCONFDIR[0])
+- errors += add_directory(alloc, DEFAULT_SYSCONFDIR, dirs);
+-#endif /* DEFAULT_SYSCONFDIR */
++ errors += add_directory(alloc, "%%PREFIX%%/etc/", dirs);
++ errors += add_directory(alloc, "%%PREFIX%%/etc/mysql/", dirs);
#endif
+
Added: head/databases/mariadb55-client/files/pkg-message.in
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/databases/mariadb55-client/files/pkg-message.in Wed May 21 10:37:51 2014 (r354740)
@@ -0,0 +1,7 @@
+************************************************************************
+
+MariaDB respects hier(7) and doesn't check /etc and /etc/mysql for
+my.cnf. Please move existing my.cnf files from those paths to
+%%PREFIX%%/etc and %%PREFIX%%/etc/mysql.
+
+************************************************************************
Modified: head/databases/mariadb55-server/Makefile
==============================================================================
--- head/databases/mariadb55-server/Makefile Wed May 21 10:32:46 2014 (r354739)
+++ head/databases/mariadb55-server/Makefile Wed May 21 10:37:51 2014 (r354740)
@@ -2,7 +2,7 @@
PORTNAME?= mariadb
PORTVERSION= 5.5.35
-PORTREVISION?= 0
+PORTREVISION?= 1
CATEGORIES= databases ipv6
MASTER_SITES= http://ftp.osuosl.org/pub/mariadb/${PORTNAME}-${PORTVERSION}/kvm-tarbake-jaunty-x86/ \
http://mirrors.supportex.net/mariadb/${PORTNAME}-${PORTVERSION}/kvm-tarbake-jaunty-x86/ \
@@ -18,6 +18,9 @@ PKGNAMESUFFIX?= 55-server
MAINTAINER= never at nevermind.kiev.ua
COMMENT?= Multithreaded SQL database (server)
+SUB_FILES= pkg-message
+PKGMESSAGE= ${WRKDIR}/pkg-message
+
SLAVEDIRS= databases/mariadb55-client
USES= cmake gmake
NO_OPTIONS_SORT=yes
@@ -133,6 +136,7 @@ EXTRA_PATCHES+= ${FILESDIR}/extra-patch-
post-patch:
@${REINPLACE_CMD} 's/*.1/${MAN1}/' ${WRKSRC}/man/CMakeLists.txt
+ @${REINPLACE_CMD} 's|%%PREFIX%%|${PREFIX}|g' ${WRKSRC}/mysys/default.c
@${REINPLACE_CMD} 's|%%LOCALBASE%%|${LOCALBASE}|g' ${WRKSRC}/scripts/mysql_config.sh
.include <bsd.port.pre.mk>
Modified: head/databases/mariadb55-server/files/mysql-server.in
==============================================================================
--- head/databases/mariadb55-server/files/mysql-server.in Wed May 21 10:32:46 2014 (r354739)
+++ head/databases/mariadb55-server/files/mysql-server.in Wed May 21 10:37:51 2014 (r354740)
@@ -52,6 +52,13 @@ mysql_create_auth_tables()
mysql_prestart()
{
+ local dir
+ for dir in /etc /etc/mysql; do
+ if [ -f "${dir}/my.cnf" ]; then
+ echo "Please move existing my.cnf file from ${dir} to %%PREFIX%%${dir}"
+ return 1
+ fi
+ done
if [ ! -d "${mysql_dbdir}/mysql/." ]; then
mysql_create_auth_tables || return 1
fi
Modified: head/databases/mariadb55-server/files/patch-mysys_default.c
==============================================================================
--- head/databases/mariadb55-server/files/patch-mysys_default.c Wed May 21 10:32:46 2014 (r354739)
+++ head/databases/mariadb55-server/files/patch-mysys_default.c Wed May 21 10:37:51 2014 (r354740)
@@ -1,6 +1,6 @@
---- mysys/default.c.orig 2010-11-02 23:01:13.000000000 +0100
-+++ mysys/default.c 2010-11-10 16:39:51.000000000 +0100
-@@ -70,7 +70,7 @@
+--- mysys/default.c.orig 2013-10-01 21:15:03.544135869 +0200
++++ mysys/default.c 2013-10-01 21:15:38.871375504 +0200
+@@ -89,7 +89,7 @@
/* Which directories are searched for options (and in which order) */
@@ -9,7 +9,7 @@
#define DEFAULT_DIRS_SIZE (MAX_DEFAULT_DIRS + 1) /* Terminate with NULL */
static const char **default_directories = NULL;
-@@ -711,7 +711,7 @@
+@@ -785,7 +785,7 @@
{
MY_STAT stat_info;
if (!my_stat(name,&stat_info,MYF(0)))
@@ -18,14 +18,41 @@
/*
Ignore world-writable regular files.
This is mainly done to protect us to not read a file created by
-@@ -1153,7 +1153,10 @@
+@@ -803,6 +803,14 @@
+ if (!(fp= mysql_file_fopen(key_file_cnf, name, O_RDONLY, MYF(0))))
+ return 1; /* Ignore wrong files */
- #if defined(DEFAULT_SYSCONFDIR)
- if (DEFAULT_SYSCONFDIR[0])
++ if (strstr(name, "/etc") == name)
+ {
- errors += add_directory(alloc, DEFAULT_SYSCONFDIR, dirs);
-+ errors += add_directory(alloc, DEFAULT_SYSCONFDIR "/mysql", dirs);
++ fprintf(stderr,
++ "error: Config file %s in invalid location, please move to or merge with %%PREFIX%%%s\n",
++ name,name);
++ goto err;
+ }
- #endif /* DEFAULT_SYSCONFDIR */
++
+ while (mysql_file_fgets(buff, sizeof(buff) - 1, fp))
+ {
+ line++;
+@@ -1067,7 +1067,8 @@
+ if (name[0] == FN_HOMELIB) /* Add . to filenames in home */
+ *end++= '.';
+ strxmov(end, conf_file, *ext, " ", NullS);
+- fputs(name, stdout);
++ if (strstr(name, "/etc") != name)
++ fputs(name, stdout);
+ }
+ }
+ }
+@@ -1226,10 +1226,8 @@
+ errors += add_directory(alloc, "/etc/", dirs);
+ errors += add_directory(alloc, "/etc/mysql/", dirs);
+
+-#if defined(DEFAULT_SYSCONFDIR)
+- if (DEFAULT_SYSCONFDIR[0])
+- errors += add_directory(alloc, DEFAULT_SYSCONFDIR, dirs);
+-#endif /* DEFAULT_SYSCONFDIR */
++ errors += add_directory(alloc, "%%PREFIX%%/etc/", dirs);
++ errors += add_directory(alloc, "%%PREFIX%%/etc/mysql/", dirs);
#endif
+
Added: head/databases/mariadb55-server/files/pkg-message.in
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/databases/mariadb55-server/files/pkg-message.in Wed May 21 10:37:51 2014 (r354740)
@@ -0,0 +1,11 @@
+************************************************************************
+
+Remember to run mysql_upgrade (with the optional --datadir=<dbdir> flag)
+the first time you start the MySQL server after an upgrade from an
+earlier version.
+
+MariaDB respects hier(7) and doesn't check /etc and /etc/mysql for
+my.cnf. Please move existing my.cnf files from those paths to
+%%PREFIX%%/etc and %%PREFIX%%/etc/mysql.
+
+************************************************************************
More information about the svn-ports-head
mailing list