diff options
author | Sachin Setiya <sachinsetia1001@gmail.com> | 2017-11-03 12:34:05 +0530 |
---|---|---|
committer | Sachin Setiya <sachinsetia1001@gmail.com> | 2017-11-03 12:34:05 +0530 |
commit | 3cecb1bab381c256e43f0f095a7a02b115dfc7bc (patch) | |
tree | a0793f42f4e1d9269dba2d08acb5a4a917470ab9 /scripts | |
parent | 53b4185e5823d784c9f358ac01ec18c5bab7e208 (diff) | |
parent | c3592ca7b8864a2492d98db4d45a7684e979301d (diff) | |
download | mariadb-git-bb-10.0-sachin-galera.tar.gz |
Merge tag 'mariadb-10.0.33' into bb-10.0-galerabb-10.0-sachin-galera
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/CMakeLists.txt | 5 | ||||
-rw-r--r-- | scripts/mysql_install_db.sh | 48 |
2 files changed, 30 insertions, 23 deletions
diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index a24e3c642c5..58a3d21aac0 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -200,6 +200,11 @@ ELSE() SET(localstatedir ${MYSQL_DATADIR}) ENDIF() +SET(resolveip_locations "$basedir/${INSTALL_BINDIR} $basedir/bin") +SET(mysqld_locations "$basedir/${INSTALL_SBINDIR} $basedir/libexec $basedir/sbin $basedir/bin") +SET(errmsg_locations "$basedir/${INSTALL_MYSQLSHAREDIR}/english $basedir/share/english $basedir/share/mysql/english") +SET(pkgdata_locations "$basedir/${INSTALL_MYSQLSHAREDIR} $basedir/share $basedir/share/mysql") + IF(UNIX) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql_install_db.sh ${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db ESCAPE_QUOTES @ONLY) diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index c0a6675be58..be8a0479aa0 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -159,7 +159,7 @@ parse_arguments() # Try to find a specific file within --basedir which can either be a binary # release or installed source directory and return the path. -find_in_basedir() +find_in_dirs() { case "$1" in --dir) @@ -171,13 +171,13 @@ find_in_basedir() for dir in "$@" do - if test -f "$basedir/$dir/$file" + if test -f "$dir/$file" then if test -n "$return_dir" then - echo "$basedir/$dir" + echo "$dir" else - echo "$basedir/$dir/$file" + echo "$dir/$file" fi break fi @@ -241,7 +241,7 @@ then print_defaults="$builddir/extra/my_print_defaults" elif test -n "$basedir" then - print_defaults=`find_in_basedir my_print_defaults bin extra` + print_defaults=`find_in_dirs my_print_defaults $basedir/bin $basedir/extra` if test -z "$print_defaults" then cannot_find_file my_print_defaults $basedir/bin $basedir/extra @@ -267,41 +267,43 @@ if test -n "$srcdir" then basedir="$builddir" bindir="$basedir/client" - extra_bindir="$basedir/extra" + resolveip="$basedir/extra/resolveip" mysqld="$basedir/sql/mysqld" langdir="$basedir/sql/share/english" pkgdatadir="$srcdir/scripts" - scriptdir="$srcdir/scripts" elif test -n "$basedir" then - bindir="$basedir/bin" - extra_bindir="$bindir" - mysqld=`find_in_basedir mysqld libexec sbin bin` + bindir="$basedir/bin" # only used in the help text + resolveip=`find_in_dirs resolveip @resolveip_locations@` + if test -z "$resolveip" + then + cannot_find_file resolveip @resolveip_locations@ + exit 1 + fi + mysqld=`find_in_dirs mysqld @mysqld_locations@` if test -z "$mysqld" then - cannot_find_file mysqld $basedir/libexec $basedir/sbin $basedir/bin + cannot_find_file mysqld @mysqld_locations@ exit 1 fi - langdir=`find_in_basedir --dir errmsg.sys share/english share/mysql/english` + langdir=`find_in_dirs --dir errmsg.sys @errmsg_locations@` if test -z "$langdir" then - cannot_find_file errmsg.sys $basedir/share/english $basedir/share/mysql/english + cannot_find_file errmsg.sys @errmsg_locations@ exit 1 fi - pkgdatadir=`find_in_basedir --dir fill_help_tables.sql share share/mysql` + pkgdatadir=`find_in_dirs --dir fill_help_tables.sql @pkgdata_locations@` if test -z "$pkgdatadir" then - cannot_find_file fill_help_tables.sql $basedir/share $basedir/share/mysql + cannot_find_file fill_help_tables.sql @pkgdata_locations@ exit 1 fi - scriptdir="$basedir/scripts" else basedir="@prefix@" bindir="@bindir@" - extra_bindir="$bindir" + resolveip="$bindir/resolveip" mysqld="@libexecdir@/mysqld" pkgdatadir="@pkgdatadir@" - scriptdir="@scriptdir@" fi # Set up paths to SQL scripts required for bootstrap @@ -344,14 +346,14 @@ hostname=`@HOSTNAME@` # Check if hostname is valid if test "$cross_bootstrap" -eq 0 -a "$in_rpm" -eq 0 -a "$force" -eq 0 then - resolved=`"$extra_bindir/resolveip" $hostname 2>&1` + resolved=`"$resolveip" $hostname 2>&1` if test $? -ne 0 then - resolved=`"$extra_bindir/resolveip" localhost 2>&1` + resolved=`"$resolveip" localhost 2>&1` if test $? -ne 0 then echo "Neither host '$hostname' nor 'localhost' could be looked up with" - echo "'$extra_bindir/resolveip'" + echo "'$resolveip'" echo "Please configure the 'hostname' command to return a correct" echo "hostname." echo "If you want to solve this at a later stage, restart this script" @@ -359,7 +361,7 @@ then link_to_help exit 1 fi - echo "WARNING: The host '$hostname' could not be looked up with resolveip." + echo "WARNING: The host '$hostname' could not be looked up with $resolveip." echo "This probably means that your libc libraries are not 100 % compatible" echo "with this binary MariaDB version. The MariaDB daemon, mysqld, should work" echo "normally with the exception that host name resolving will not work." @@ -437,7 +439,7 @@ else echo "The problem could be conflicting information in an external" echo "my.cnf files. You can ignore these by doing:" echo - echo " shell> $scriptdir/scripts/mysql_install_db --defaults-file=~/.my.cnf" + echo " shell> $0 --defaults-file=~/.my.cnf" echo echo "You can also try to start the mysqld daemon with:" echo |