|
|
c48a49a |
Some hard-coded paths make problems when package is built into chroot like
|
|
|
c48a49a |
Software Collections. Removing these hard-coded paths should fix it.
|
|
|
c48a49a |
|
|
|
c48a49a |
Upstream report: https://mariadb.atlassian.net/browse/MDEV-6485
|
|
|
c48a49a |
|
|
|
c48a49a |
|
|
Jakub Dorňák |
bf0a83b |
diff -up --recursive mysql-5.7.8.orig/client/mysql_plugin.c mysql-5.7.8/client/mysql_plugin.c
|
|
Jakub Dorňák |
bf0a83b |
--- mysql-5.7.8.orig/client/mysql_plugin.c 2015-07-20 14:25:08.000000000 +0200
|
|
Jakub Dorňák |
bf0a83b |
+++ mysql-5.7.8/client/mysql_plugin.c 2015-09-23 13:32:57.711495542 +0200
|
|
Jakub Dorňák |
bf0a83b |
@@ -94,6 +94,7 @@ static int find_plugin(char *tp_path);
|
|
|
c48a49a |
static int build_bootstrap_file(char *operation, char *bootstrap);
|
|
|
c48a49a |
static int dump_bootstrap_file(char *bootstrap_file);
|
|
|
c48a49a |
static int bootstrap_server(char *server_path, char *bootstrap_file);
|
|
|
3ff9598 |
+static int find_file_in_path(const char *name, char *to);
|
|
|
c48a49a |
|
|
|
c48a49a |
|
|
|
c48a49a |
int main(int argc,char *argv[])
|
|
Jakub Dorňák |
bf0a83b |
@@ -125,7 +126,7 @@ int main(int argc,char *argv[])
|
|
|
c48a49a |
*/
|
|
|
c48a49a |
if ((error= process_options(argc, argv, operation)) ||
|
|
|
c48a49a |
(error= check_access()) ||
|
|
|
c48a49a |
- (error= find_tool("mysqld" FN_EXEEXT, server_path)) ||
|
|
|
c48a49a |
+ (error= find_file_in_path("mysqld" FN_EXEEXT, server_path)) ||
|
|
|
c48a49a |
(error= find_plugin(tp_path)) ||
|
|
|
c48a49a |
(error= build_bootstrap_file(operation, bootstrap)))
|
|
|
c48a49a |
goto exit;
|
|
Jakub Dorňák |
bf0a83b |
@@ -331,7 +332,7 @@ static int get_default_values()
|
|
|
c48a49a |
FILE *file= 0;
|
|
|
c48a49a |
|
|
|
c48a49a |
memset(tool_path, 0, FN_REFLEN);
|
|
|
c48a49a |
- if ((error= find_tool("my_print_defaults" FN_EXEEXT, tool_path)))
|
|
|
c48a49a |
+ if ((error= find_file_in_path("my_print_defaults" FN_EXEEXT, tool_path)))
|
|
|
c48a49a |
goto exit;
|
|
|
c48a49a |
else
|
|
|
c48a49a |
{
|
|
Jakub Dorňák |
bf0a83b |
@@ -1014,6 +1015,55 @@ exit:
|
|
|
c48a49a |
}
|
|
|
c48a49a |
|
|
|
c48a49a |
|
|
|
c48a49a |
+#if defined(__WIN__)
|
|
|
c48a49a |
+#define F_OK 0
|
|
|
c48a49a |
+#define PATH_SEP ';'
|
|
|
c48a49a |
+#define PROGRAM_EXTENSION ".exe"
|
|
|
c48a49a |
+#else
|
|
|
c48a49a |
+#define PATH_SEP ':'
|
|
|
c48a49a |
+#endif
|
|
|
c48a49a |
+
|
|
|
3ff9598 |
+static int find_file_in_path(const char *name, char *to)
|
|
|
c48a49a |
+{
|
|
|
c48a49a |
+ char *path,*pos,dir[2];
|
|
|
c48a49a |
+ const char *ext="";
|
|
|
c48a49a |
+
|
|
|
c48a49a |
+ if (!(path=getenv("PATH")))
|
|
|
c48a49a |
+ goto notfound;
|
|
|
c48a49a |
+ dir[0]=FN_LIBCHAR; dir[1]=0;
|
|
|
c48a49a |
+#ifdef PROGRAM_EXTENSION
|
|
|
c48a49a |
+ if (!fn_ext(name)[0])
|
|
|
c48a49a |
+ ext=PROGRAM_EXTENSION;
|
|
|
c48a49a |
+#endif
|
|
|
c48a49a |
+
|
|
|
c48a49a |
+ for (pos=path ; (pos=strchr(pos,PATH_SEP)) ; path= ++pos)
|
|
|
c48a49a |
+ {
|
|
|
c48a49a |
+ if (path != pos)
|
|
|
c48a49a |
+ {
|
|
Jakub Dorňák |
bf0a83b |
+ strxmov(my_stpnmov(to,path,(uint) (pos-path)),dir,name,ext,NullS);
|
|
|
c48a49a |
+ if (!access(to,F_OK))
|
|
|
c48a49a |
+ {
|
|
|
c48a49a |
+ if (opt_verbose)
|
|
|
c48a49a |
+ printf("# Found tool '%s' as '%s'.\n", name, to);
|
|
|
c48a49a |
+ return 0;
|
|
|
c48a49a |
+ }
|
|
|
c48a49a |
+ }
|
|
|
c48a49a |
+ }
|
|
|
c48a49a |
+#ifdef __WIN__
|
|
|
c48a49a |
+ to[0]=FN_CURLIB;
|
|
|
c48a49a |
+ strxmov(to+1,dir,name,ext,NullS);
|
|
|
c48a49a |
+ if (!access(to,F_OK)) /* Test in current dir */
|
|
|
c48a49a |
+ {
|
|
|
c48a49a |
+ if (opt_verbose)
|
|
|
c48a49a |
+ printf("# Found tool '%s' as '%s'.\n", name, to);
|
|
|
c48a49a |
+ return 0;
|
|
|
c48a49a |
+ }
|
|
|
c48a49a |
+#endif
|
|
|
c48a49a |
+notfound:
|
|
|
c48a49a |
+ fprintf(stderr, "WARNING: Cannot find %s.\n", name);
|
|
|
c48a49a |
+ return 1; /* File not found */
|
|
|
c48a49a |
+}
|
|
|
c48a49a |
+
|
|
|
c48a49a |
/**
|
|
|
c48a49a |
Locate the tool and form tool path.
|
|
|
c48a49a |
|
|
Jakub Dorňák |
bf0a83b |
diff -up --recursive mysql-5.7.8.orig/cmake/install_layout.cmake mysql-5.7.8/cmake/install_layout.cmake
|
|
Jakub Dorňák |
bf0a83b |
--- mysql-5.7.8.orig/cmake/install_layout.cmake 2015-07-20 14:25:07.000000000 +0200
|
|
Jakub Dorňák |
bf0a83b |
+++ mysql-5.7.8/cmake/install_layout.cmake 2015-09-23 13:32:57.711495542 +0200
|
|
Jakub Dorňák |
bf0a83b |
@@ -107,7 +107,7 @@ IF(UNIX)
|
|
|
d90e5b1 |
" Choose between ${VALID_INSTALL_LAYOUTS}" )
|
|
|
d90e5b1 |
ENDIF()
|
|
|
d90e5b1 |
|
|
|
d90e5b1 |
- SET(SYSCONFDIR "${CMAKE_INSTALL_PREFIX}/etc"
|
|
|
d90e5b1 |
+ SET(SYSCONFDIR "/etc"
|
|
|
d90e5b1 |
CACHE PATH "config directory (for my.cnf)")
|
|
|
d90e5b1 |
MARK_AS_ADVANCED(SYSCONFDIR)
|
|
|
d90e5b1 |
ENDIF()
|
|
Jakub Dorňák |
bf0a83b |
@@ -321,6 +321,7 @@ SET(INSTALL_SECURE_FILE_PRIV_EMBEDDEDDIR
|
|
|
d90e5b1 |
SET(INSTALL_BINDIR_RPM "bin")
|
|
|
d90e5b1 |
SET(INSTALL_SBINDIR_RPM "sbin")
|
|
|
d90e5b1 |
SET(INSTALL_SCRIPTDIR_RPM "bin")
|
|
|
d90e5b1 |
+SET(INSTALL_SYSCONFDIR_RPM "/etc")
|
|
|
d90e5b1 |
#
|
|
|
d90e5b1 |
IF(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
|
|
|
d90e5b1 |
SET(INSTALL_LIBDIR_RPM "lib64")
|
|
Jakub Dorňák |
bf0a83b |
diff -up --recursive mysql-5.7.8.orig/mysys_ssl/my_default.cc mysql-5.7.8/mysys_ssl/my_default.cc
|
|
Jakub Dorňák |
bf0a83b |
--- mysql-5.7.8.orig/mysys_ssl/my_default.cc 2015-07-20 14:25:08.000000000 +0200
|
|
Jakub Dorňák |
bf0a83b |
+++ mysql-5.7.8/mysys_ssl/my_default.cc 2015-09-23 13:32:57.712495541 +0200
|
|
Jakub Dorňák |
bf0a83b |
@@ -1404,12 +1404,12 @@ static const char **init_default_directo
|
|
|
c48a49a |
|
|
|
c48a49a |
#else
|
|
|
c48a49a |
|
|
|
c48a49a |
- errors += add_directory(alloc, "/etc/", dirs);
|
|
|
c48a49a |
- errors += add_directory(alloc, "/etc/mysql/", dirs);
|
|
|
c48a49a |
-
|
|
|
c48a49a |
#if defined(DEFAULT_SYSCONFDIR)
|
|
|
c48a49a |
if (DEFAULT_SYSCONFDIR[0])
|
|
|
c48a49a |
+ {
|
|
|
c48a49a |
errors += add_directory(alloc, DEFAULT_SYSCONFDIR, dirs);
|
|
|
c48a49a |
+ errors += add_directory(alloc, DEFAULT_SYSCONFDIR "/mysql", dirs);
|
|
|
c48a49a |
+ }
|
|
|
c48a49a |
#endif /* DEFAULT_SYSCONFDIR */
|
|
|
c48a49a |
|
|
|
c48a49a |
#endif
|
|
Jakub Dorňák |
bf0a83b |
diff -up --recursive mysql-5.7.8.orig/scripts/CMakeLists.txt mysql-5.7.8/scripts/CMakeLists.txt
|
|
Jakub Dorňák |
bf0a83b |
--- mysql-5.7.8.orig/scripts/CMakeLists.txt 2015-07-20 14:25:08.000000000 +0200
|
|
Jakub Dorňák |
bf0a83b |
+++ mysql-5.7.8/scripts/CMakeLists.txt 2015-09-23 13:43:47.463665346 +0200
|
|
Jakub Dorňák |
bf0a83b |
@@ -295,7 +295,7 @@ ELSE()
|
|
Jakub Dorňák |
bf0a83b |
ENDIF()
|
|
|
d90e5b1 |
|
|
|
d90e5b1 |
SET(prefix "${CMAKE_INSTALL_PREFIX}")
|
|
|
d90e5b1 |
-SET(sysconfdir ${prefix})
|
|
|
d90e5b1 |
+SET(sysconfdir ${SYSCONFDIR})
|
|
|
d90e5b1 |
SET(bindir ${prefix}/${INSTALL_BINDIR})
|
|
|
d90e5b1 |
SET(libexecdir ${prefix}/${INSTALL_SBINDIR})
|
|
|
d90e5b1 |
SET(scriptdir ${prefix}/${INSTALL_BINDIR})
|
|
Jakub Dorňák |
bf0a83b |
diff -up --recursive mysql-5.7.8.orig/scripts/mysqld_multi.sh mysql-5.7.8/scripts/mysqld_multi.sh
|
|
Jakub Dorňák |
bf0a83b |
--- mysql-5.7.8.orig/scripts/mysqld_multi.sh 2015-07-20 14:25:08.000000000 +0200
|
|
Jakub Dorňák |
bf0a83b |
+++ mysql-5.7.8/scripts/mysqld_multi.sh 2015-09-23 13:32:57.712495541 +0200
|
|
|
c48a49a |
@@ -573,9 +573,7 @@ sub list_defaults_files
|
|
|
c48a49a |
|
|
|
c48a49a |
my %seen; # Don't list the same file more than once
|
|
|
c48a49a |
return grep { defined $_ and not $seen{$_}++ and -f $_ and -r $_ }
|
|
|
c48a49a |
- ('/etc/my.cnf',
|
|
|
c48a49a |
- '/etc/mysql/my.cnf',
|
|
|
c48a49a |
- '@sysconfdir@/my.cnf',
|
|
|
c48a49a |
+ ('@sysconfdir@/my.cnf',
|
|
|
c48a49a |
($ENV{MYSQL_HOME} ? "$ENV{MYSQL_HOME}/my.cnf" : undef),
|
|
|
c48a49a |
$opt{'extra-file'},
|
|
|
c48a49a |
($ENV{HOME} ? "$ENV{HOME}/.my.cnf" : undef));
|