diff --git a/build-release.sh b/build-release.sh index 1e9f713..72707a0 100755 --- a/build-release.sh +++ b/build-release.sh @@ -35,6 +35,11 @@ YELLOW='' readonly ALL_OFF BOLD BLUE GREEN RED YELLOW ARCH_INSTALLS="${ARCH_INSTALLS:-win32 win64 linux}" +if not command -v cmake >/dev/null 2>&1; then + print_error "No cmake found - please, install" + exit 1 +fi + for _mingw in ${ARCH_INSTALLS}; do case ${_mingw} in @@ -83,7 +88,7 @@ for _mingw in ${ARCH_INSTALLS}; do ( if [ -z ${_msystem} ]; then - [ -f lib2inpx-${_arch}.xz ] && rm lib2inpx-${_arch}.xz + [ -f lib2inpx-${_arch}-glibc_${_glibc}.tar.xz ] && rm lib2inpx-${_arch}-glibc_${_glibc}.tar.xz tar --directory ${_dist} --create --xz --file lib2inpx-${_arch}-glibc_${_glibc}.tar.xz . else diff --git a/get-maria.sh b/get-maria.sh index f61920b..6dc8502 100755 --- a/get-maria.sh +++ b/get-maria.sh @@ -3,6 +3,8 @@ ver_major=10.1 ver_minor=24 +declare -A checkmap + from_url="https://downloads.mariadb.org/interstitial" ARCH_INSTALLS="${ARCH_INSTALLS:-win32 win64 linux}" @@ -14,18 +16,21 @@ for _mingw in ${ARCH_INSTALLS}; do file=mariadb-${ver_major}.${ver_minor}-${arch}.zip prefix=i686 packagedir=${arch}-packages + checkmap[${arch}]="3f28aaece4cb00d57fb643873ca4a4b29546cf5852d956094517b36ba8eafba3" ;; win64) arch=winx64 file=mariadb-${ver_major}.${ver_minor}-${arch}.zip prefix=x86_64 packagedir=${arch}-packages + checkmap[${arch}]="cca8b38e640508cd8fa3ba28c872ccc79497d6a74164a1ae9cdd04aaef9ef6cd" ;; linux) arch=$(uname -m) file=mariadb-${ver_major}.${ver_minor}-linux-glibc_214-${arch}.tar.gz prefix= packagedir=bintar-linux-glibc_214-${arch} + checkmap[${arch}]="04491b686a83ba994122f5609adb9f86cb5af6275f87bfa4ee6010e2e28db465" ;; *) echo "Unsupported environment!" @@ -39,6 +44,11 @@ for _mingw in ${ARCH_INSTALLS}; do else echo "Have ${file} locally." fi + sum=`sha256sum ${file} | awk '{ print $1; }'` + if [ ${checkmap[${arch}]} != ${sum} ]; then + echo "Bad checksum for ${file}: ${checkmap[${arch}]} != ${sum}" + exit 1 + fi if [ x"${_mingw}" == x"linux" ]; then [ -d mariadb-${ver_major}.${ver_minor}-linux-glibc_214-${arch} ] && rm -rf mariadb-${ver_major}.${ver_minor}-linux-glibc_214-${arch} @@ -53,7 +63,7 @@ for _mingw in ${ARCH_INSTALLS}; do cd mariadb-${ver_major}.${ver_minor}-${arch} cd lib for dll in *.dll; do - echo "Creating MINGW import library for ${dll}" + echo "Creating Windows export library for ${dll}" gendef -a ${dll} dlltool -d ${dll%.*}.def -l ${dll}.a -k rm ${dll%.*}.def diff --git a/lib2inpx/lib2inpx.cpp b/lib2inpx/lib2inpx.cpp index 1cc81ee..4e9c8b9 100644 --- a/lib2inpx/lib2inpx.cpp +++ b/lib2inpx/lib2inpx.cpp @@ -4,6 +4,7 @@ #include #else #include +#include #endif #include #include @@ -69,6 +70,8 @@ static bool g_ignore_dump_date = false; static bool g_clean_when_done = false; static bool g_verbose = false; +static bool g_mysql_cfg_created = false; + enum checking_type { eFileExt = 0, eFileType, eIgnore }; static checking_type g_strict = eFileExt; @@ -131,10 +134,10 @@ static const char* dummy = "dummy:" "\r\n"; #ifdef MARIADB_BASE_VERSION -static const char* options_pattern[] = {"%s", "--defaults-file=%sdata/mysql.ini", "--language=%s/language", "--datadir=%sdata", "--skip-grant-tables", "--innodb_data_home_dir=%sdata/dbtmp_%s", +static const char* options_pattern[] = {"%s", "--defaults-file=%sdata/mysql.cfg", "--language=%s/language", "--datadir=%sdata", "--skip-grant-tables", "--innodb_data_home_dir=%sdata/dbtmp_%s", "--innodb_log_group_home_dir=%sdata/dbtmp_%s", "--innodb_tmpdir=%sdata/dbtmp_%s", "--log_warnings=2", NULL}; #else -static const char* options_pattern[] = {"%s", "--defaults-file=%sdata/mysql.ini", "--language=%s/language", "--datadir=%sdata", "--skip-grant-tables", "--innodb_data_home_dir=%s/data/dbtmp_%s", +static const char* options_pattern[] = {"%s", "--defaults-file=%sdata/mysql.cfg", "--language=%s/language", "--datadir=%sdata", "--skip-grant-tables", "--innodb_data_home_dir=%s/data/dbtmp_%s", "--innodb_log_group_home_dir=%sdata/dbtmp_%s", "--innodb_tmpdir=%sdata/dbtmp_%s", "--log_syslog=0", NULL}; #endif @@ -305,7 +308,7 @@ void prepare_mysql(const char* path, const string& dbname) fs::create_directories(config.c_str()); } - config = string(path) + "/data/mysql.ini"; + config = string(path) + "/data/mysql.cfg"; if (0 != access(config.c_str(), 6)) { ofstream out(config.c_str()); @@ -316,7 +319,14 @@ void prepare_mysql(const char* path, const string& dbname) } else { throw runtime_error(tmp_str("Unable to open file \"%s\"", config.c_str())); } + g_mysql_cfg_created = true; + } + + #ifndef _WIN32 + if (g_mysql_cfg_created) { + chmod(config.c_str(), S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); } +#endif config = string(path) + "/data/dbtmp_" + dbname; if (0 != access(config.c_str(), 6)) { @@ -1699,8 +1709,10 @@ int main(int argc, char* argv[]) string file_to_del = data_dir + "/auto.cnf"; fs::remove(file_to_del); - file_to_del.assign(data_dir + "/mysql.ini"); - fs::remove(file_to_del); + if (g_mysql_cfg_created) { + file_to_del.assign(data_dir + "/mysql.cfg"); + fs::remove(file_to_del); + } #ifdef MARIADB_BASE_VERSION file_to_del.assign(data_dir + "/aria_log.00000001");