View | Details | Raw Unified | Return to bug 182547 | Differences between
and this patch

Collapse All | Expand All

(-)databases/mariadb55-client/Makefile (-1 / +1 lines)
Lines 7-13 Link Here
7
7
8
MASTERDIR=	${.CURDIR}/../mariadb55-server
8
MASTERDIR=	${.CURDIR}/../mariadb55-server
9
9
10
PKGMESSAGE=	mustnotexist
10
FILESDIR=	${.CURDIR}/files
11
PATCHDIR=	${.CURDIR}/files
11
PATCHDIR=	${.CURDIR}/files
12
PLIST=		${.CURDIR}/pkg-plist
12
PLIST=		${.CURDIR}/pkg-plist
13
13
(-)databases/mariadb55-client/files/patch-mysys_default.c (-8 / +38 lines)
Lines 1-5 Link Here
1
--- mysys/default.c.orig	2012-12-17 03:57:40.000000000 +0200
1
--- mysys/default.c.orig	2013-10-01 21:15:03.544135869 +0200
2
+++ mysys/default.c	2012-12-17 04:00:28.000000000 +0200
2
+++ mysys/default.c	2013-10-01 21:15:38.871375504 +0200
3
@@ -89,7 +89,7 @@
3
@@ -89,7 +89,7 @@
4
 
4
 
5
 /* Which directories are searched for options (and in which order) */
5
 /* Which directories are searched for options (and in which order) */
Lines 18-28 Link Here
18
     /*
18
     /*
19
       Ignore world-writable regular files.
19
       Ignore world-writable regular files.
20
       This is mainly done to protect us to not read a file created by
20
       This is mainly done to protect us to not read a file created by
21
@@ -1229,6 +1229,7 @@
21
@@ -803,6 +803,14 @@
22
 #if defined(DEFAULT_SYSCONFDIR)
22
   if (!(fp= mysql_file_fopen(key_file_cnf, name, O_RDONLY, MYF(0))))
23
   if (DEFAULT_SYSCONFDIR[0])
23
     return 1;					/* Ignore wrong files */
24
     errors += add_directory(alloc, DEFAULT_SYSCONFDIR, dirs);
24
 
25
+    errors += add_directory(alloc, DEFAULT_SYSCONFDIR "/mysql", dirs);
25
+  if (strstr(name, "/etc") == name)
26
 #endif /* DEFAULT_SYSCONFDIR */
26
+  {
27
+    fprintf(stderr,
28
+	      "error: Config file %s in invalid location, please move to or merge with %%PREFIX%%%s\n",
29
+	      name,name);
30
+      goto err;
31
+  }
32
+
33
   while (mysql_file_fgets(buff, sizeof(buff) - 1, fp))
34
   {
35
     line++;
36
@@ -1067,7 +1067,8 @@
37
           if (name[0] == FN_HOMELIB)	/* Add . to filenames in home */
38
             *end++= '.';
39
           strxmov(end, conf_file, *ext, " ", NullS);
40
-          fputs(name, stdout);
41
+          if (strstr(name, "/etc") != name)
42
+            fputs(name, stdout);
43
         }
44
       }
45
     }
46
@@ -1226,10 +1226,8 @@
47
   errors += add_directory(alloc, "/etc/", dirs);
48
   errors += add_directory(alloc, "/etc/mysql/", dirs);
49
 
50
-#if defined(DEFAULT_SYSCONFDIR)
51
-  if (DEFAULT_SYSCONFDIR[0])
52
-    errors += add_directory(alloc, DEFAULT_SYSCONFDIR, dirs);
53
-#endif /* DEFAULT_SYSCONFDIR */
54
+  errors += add_directory(alloc, "%%PREFIX%%/etc/", dirs);
55
+  errors += add_directory(alloc, "%%PREFIX%%/etc/mysql/", dirs);
27
 
56
 
28
 #endif
57
 #endif
58
 
(-)databases/mariadb55-client/files/patch-scripts_mysql_config.sh (+14 lines)
Line 0 Link Here
1
--- scripts/mysql_config.sh.orig	2013-09-20 01:34:23.000000000 +0300
2
+++ scripts/mysql_config.sh	2013-10-15 21:23:34.000000000 +0300
3
@@ -108,8 +108,11 @@
4
 # We intentionally add a space to the beginning and end of lib strings, simplifies replace later
5
 libs=" $ldflags -L$pkglibdir -lmysqlclient @ZLIB_DEPS@ @NON_THREADED_LIBS@"
6
 libs="$libs @openssl_libs@ @STATIC_NSS_FLAGS@ "
7
+libs="$libs -L%%LOCALBASE%%/lib "
8
 libs_r=" $ldflags -L$pkglibdir -lmysqlclient_r @ZLIB_DEPS@ @CLIENT_LIBS@ @openssl_libs@ "
9
+libs_r="$libs_r -L%%LOCALBASE%%/lib "
10
 embedded_libs=" $ldflags -L$pkglibdir -lmysqld @LIBDL@ @ZLIB_DEPS@ @LIBS@ @WRAPLIBS@ @openssl_libs@ "
11
+embedded_libs="$embedded_libs -L%%LOCALBASE%%/lib "
12
 
13
 if [ -r "$pkglibdir/libmygcc.a" ]; then
14
   # When linking against the static library with a different version of GCC
(-)databases/mariadb55-client/files/pkg-message.in (+7 lines)
Line 0 Link Here
1
************************************************************************
2
3
MariaDB respects hier(7) and doesn't check /etc and /etc/mysql for
4
my.cnf. Please move existing my.cnf files from those paths to
5
%%PREFIX%%/etc and %%PREFIX%%/etc/mysql.
6
7
************************************************************************
(-)databases/mariadb55-server/Makefile (-1 / +6 lines)
Lines 2-8 Link Here
2
2
3
PORTNAME?=	mariadb
3
PORTNAME?=	mariadb
4
PORTVERSION=	5.5.33a
4
PORTVERSION=	5.5.33a
5
PORTREVISION?=	0
5
PORTREVISION?=	1
6
CATEGORIES=	databases ipv6
6
CATEGORIES=	databases ipv6
7
MASTER_SITES=	http://ftp.osuosl.org/pub/mariadb/${PORTNAME}-${PORTVERSION}/kvm-tarbake-jaunty-x86/ \
7
MASTER_SITES=	http://ftp.osuosl.org/pub/mariadb/${PORTNAME}-${PORTVERSION}/kvm-tarbake-jaunty-x86/ \
8
		http://mirrors.supportex.net/mariadb/${PORTNAME}-${PORTVERSION}/kvm-tarbake-jaunty-x86/ \
8
		http://mirrors.supportex.net/mariadb/${PORTNAME}-${PORTVERSION}/kvm-tarbake-jaunty-x86/ \
Lines 18-23 Link Here
18
MAINTAINER=	never@nevermind.kiev.ua
18
MAINTAINER=	never@nevermind.kiev.ua
19
COMMENT?=	Multithreaded SQL database (server)
19
COMMENT?=	Multithreaded SQL database (server)
20
20
21
SUB_FILES=	pkg-message
22
PKGMESSAGE=	${WRKDIR}/pkg-message
23
21
SLAVEDIRS=	databases/mariadb55-client
24
SLAVEDIRS=	databases/mariadb55-client
22
USES=		cmake gmake
25
USES=		cmake gmake
23
NO_OPTIONS_SORT=yes
26
NO_OPTIONS_SORT=yes
Lines 133-138 Link Here
133
136
134
post-patch:
137
post-patch:
135
	@${REINPLACE_CMD} 's/*.1/${MAN1}/' ${WRKSRC}/man/CMakeLists.txt
138
	@${REINPLACE_CMD} 's/*.1/${MAN1}/' ${WRKSRC}/man/CMakeLists.txt
139
	@${REINPLACE_CMD} 's|%%PREFIX%%|${PREFIX}|g' ${WRKSRC}/mysys/default.c
140
	@${REINPLACE_CMD} 's|%%LOCALBASE%%|${LOCALBASE}|g' ${WRKSRC}/scripts/mysql_config.sh
136
141
137
.include <bsd.port.pre.mk>
142
.include <bsd.port.pre.mk>
138
143
(-)databases/mariadb55-server/files/mysql-server.in (+7 lines)
Lines 52-57 Link Here
52
52
53
mysql_prestart()
53
mysql_prestart()
54
{
54
{
55
	local dir
56
	for dir in /etc /etc/mysql; do
57
		if [ -f "${dir}/my.cnf" ]; then
58
			echo "Please move existing my.cnf file from ${dir} to %%PREFIX%%${dir}"
59
			return 1
60
		fi
61
	done
55
	if [ ! -d "${mysql_dbdir}/mysql/." ]; then
62
	if [ ! -d "${mysql_dbdir}/mysql/." ]; then
56
		mysql_create_auth_tables || return 1
63
		mysql_create_auth_tables || return 1
57
	fi
64
	fi
(-)databases/mariadb55-server/files/patch-mysys_default.c (-10 / +37 lines)
Lines 1-6 Link Here
1
--- mysys/default.c.orig	2010-11-02 23:01:13.000000000 +0100
1
--- mysys/default.c.orig	2013-10-01 21:15:03.544135869 +0200
2
+++ mysys/default.c	2010-11-10 16:39:51.000000000 +0100
2
+++ mysys/default.c	2013-10-01 21:15:38.871375504 +0200
3
@@ -70,7 +70,7 @@
3
@@ -89,7 +89,7 @@
4
 
4
 
5
 /* Which directories are searched for options (and in which order) */
5
 /* Which directories are searched for options (and in which order) */
6
 
6
 
Lines 9-15 Link Here
9
 #define DEFAULT_DIRS_SIZE (MAX_DEFAULT_DIRS + 1)  /* Terminate with NULL */
9
 #define DEFAULT_DIRS_SIZE (MAX_DEFAULT_DIRS + 1)  /* Terminate with NULL */
10
 static const char **default_directories = NULL;
10
 static const char **default_directories = NULL;
11
 
11
 
12
@@ -711,7 +711,7 @@
12
@@ -785,7 +785,7 @@
13
   {
13
   {
14
     MY_STAT stat_info;
14
     MY_STAT stat_info;
15
     if (!my_stat(name,&stat_info,MYF(0)))
15
     if (!my_stat(name,&stat_info,MYF(0)))
Lines 18-31 Link Here
18
     /*
18
     /*
19
       Ignore world-writable regular files.
19
       Ignore world-writable regular files.
20
       This is mainly done to protect us to not read a file created by
20
       This is mainly done to protect us to not read a file created by
21
@@ -1153,7 +1153,10 @@
21
@@ -803,6 +803,14 @@
22
   if (!(fp= mysql_file_fopen(key_file_cnf, name, O_RDONLY, MYF(0))))
23
     return 1;					/* Ignore wrong files */
22
 
24
 
23
 #if defined(DEFAULT_SYSCONFDIR)
25
+  if (strstr(name, "/etc") == name)
24
   if (DEFAULT_SYSCONFDIR[0])
25
+  {
26
+  {
26
     errors += add_directory(alloc, DEFAULT_SYSCONFDIR, dirs);
27
+    fprintf(stderr,
27
+    errors += add_directory(alloc, DEFAULT_SYSCONFDIR "/mysql", dirs);
28
+	      "error: Config file %s in invalid location, please move to or merge with %%PREFIX%%%s\n",
29
+	      name,name);
30
+      goto err;
28
+  }
31
+  }
29
 #endif /* DEFAULT_SYSCONFDIR */
32
+
33
   while (mysql_file_fgets(buff, sizeof(buff) - 1, fp))
34
   {
35
     line++;
36
@@ -1067,7 +1067,8 @@
37
           if (name[0] == FN_HOMELIB)	/* Add . to filenames in home */
38
             *end++= '.';
39
           strxmov(end, conf_file, *ext, " ", NullS);
40
-          fputs(name, stdout);
41
+          if (strstr(name, "/etc") != name)
42
+            fputs(name, stdout);
43
         }
44
       }
45
     }
46
@@ -1226,10 +1226,8 @@
47
   errors += add_directory(alloc, "/etc/", dirs);
48
   errors += add_directory(alloc, "/etc/mysql/", dirs);
49
 
50
-#if defined(DEFAULT_SYSCONFDIR)
51
-  if (DEFAULT_SYSCONFDIR[0])
52
-    errors += add_directory(alloc, DEFAULT_SYSCONFDIR, dirs);
53
-#endif /* DEFAULT_SYSCONFDIR */
54
+  errors += add_directory(alloc, "%%PREFIX%%/etc/", dirs);
55
+  errors += add_directory(alloc, "%%PREFIX%%/etc/mysql/", dirs);
30
 
56
 
31
 #endif
57
 #endif
58
 
(-)databases/mariadb55-server/files/patch-scripts_mysql_config.sh (+14 lines)
Line 0 Link Here
1
--- scripts/mysql_config.sh.orig	2013-09-20 01:34:23.000000000 +0300
2
+++ scripts/mysql_config.sh	2013-10-15 21:23:34.000000000 +0300
3
@@ -108,8 +108,11 @@
4
 # We intentionally add a space to the beginning and end of lib strings, simplifies replace later
5
 libs=" $ldflags -L$pkglibdir -lmysqlclient @ZLIB_DEPS@ @NON_THREADED_LIBS@"
6
 libs="$libs @openssl_libs@ @STATIC_NSS_FLAGS@ "
7
+libs="$libs -L%%LOCALBASE%%/lib "
8
 libs_r=" $ldflags -L$pkglibdir -lmysqlclient_r @ZLIB_DEPS@ @CLIENT_LIBS@ @openssl_libs@ "
9
+libs_r="$libs_r -L%%LOCALBASE%%/lib "
10
 embedded_libs=" $ldflags -L$pkglibdir -lmysqld @LIBDL@ @ZLIB_DEPS@ @LIBS@ @WRAPLIBS@ @openssl_libs@ "
11
+embedded_libs="$embedded_libs -L%%LOCALBASE%%/lib "
12
 
13
 if [ -r "$pkglibdir/libmygcc.a" ]; then
14
   # When linking against the static library with a different version of GCC
(-)databases/mariadb55-server/files/pkg-message.in (+11 lines)
Line 0 Link Here
1
************************************************************************
2
3
Remember to run mysql_upgrade (with the optional --datadir=<dbdir> flag)
4
the first time you start the MySQL server after an upgrade from an
5
earlier version.
6
7
MariaDB respects hier(7) and doesn't check /etc and /etc/mysql for
8
my.cnf. Please move existing my.cnf files from those paths to
9
%%PREFIX%%/etc and %%PREFIX%%/etc/mysql.
10
11
************************************************************************
(-)databases/mariadb55-server/pkg-message (-7 lines)
Lines 1-7 Link Here
1
************************************************************************
2
3
Remember to run mysql_upgrade (with the optional --datadir=<dbdir> flag)
4
the first time you start the MySQL server after an upgrade from an
5
earlier version.
6
7
************************************************************************

Return to bug 182547