Skip to content
Snippets Groups Projects
Commit 93d6d917 authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

MAINT: disable configure; some fixes

parent f86cf205
No related branches found
No related tags found
No related merge requests found
...@@ -22,14 +22,21 @@ ...@@ -22,14 +22,21 @@
# ** end header # ** end header
# #
echo "CURRENTLY NOT SUPPORTET"
exit 1
if [ -z "$UTILSPATH" ]; then
UTILSPATH="$(realpath $(dirname $0)/utils)"
export UTILSPATH
fi
# defaults # defaults
source config.defaults source config.defaults
OPTIONS=$(sed -r '/^(#|\s*$)/d' config.defaults | sed -r 's/=.*$//g') OPTIONS=$(sed -r '/^(#|\s*$)/d' config.defaults | sed -r 's/=.*$//g')
# override with old config # override with old config
if [ -e .config ]; then if [ -e $MAINPATH/.config ]; then
source .config source $MAINPATH/.config
fi fi
# DEBUG - print all options: # DEBUG - print all options:
...@@ -77,12 +84,12 @@ fi ...@@ -77,12 +84,12 @@ fi
# DEBUG - print all options: # DEBUG - print all options:
# for opt in $OPTIONS; do echo $opt = ${!opt}; done # for opt in $OPTIONS; do echo $opt = ${!opt}; done
# write to .config # write to $MAINPATH/.config
rm -f .config rm -f $MAINPATH/.config
for opt in $OPTIONS; do for opt in $OPTIONS; do
esc_hash=${!opt//#/\\\#} esc_hash=${!opt//#/\\\#}
esc_dollar=${esc_hash//\$/'$$'} esc_dollar=${esc_hash//\$/'$$'}
esc_dq=${esc_dollar//\"/\\\"} esc_dq=${esc_dollar//\"/\\\"}
esc_sq=${esc_dq//\'/\\\'} esc_sq=${esc_dq//\'/\\\'}
echo "$opt=\"$esc_sq\"" >> .config echo "$opt=\"$esc_sq\"" >> $MAINPATH/.config
done done
...@@ -43,9 +43,6 @@ PATCHES="./patch*/patch.sh" ...@@ -43,9 +43,6 @@ PATCHES="./patch*/patch.sh"
for p in $PATCHES for p in $PATCHES
do do
echo "$p"
env | grep MYSQL | sort
export | grep MYSQL | sort
$p "$@" --patch=$p $p "$@" --patch=$p
done done
......
...@@ -27,8 +27,8 @@ ...@@ -27,8 +27,8 @@
# Dump a database with all procedures, permissions, structure and data # Dump a database with all procedures, permissions, structure and data
if [ -z "$UTILSPATH" ]; then if [ -z "$UTILSPATH" ]; then
UTILSPATH="$(realpath $(dirname $0))" UTILSPATH="$(realpath $(dirname $0))"
export UTILSPATH export UTILSPATH
fi fi
# The directory which the dump is to be stored to. Do not change it here. Use # The directory which the dump is to be stored to. Do not change it here. Use
...@@ -45,30 +45,15 @@ function backup() { ...@@ -45,30 +45,15 @@ function backup() {
database="$1" database="$1"
backupdir="$2" backupdir="$2"
<<<<<<< HEAD
# Assert backup dir # Assert backup dir
mkdir -p "$backupdir" mkdir -p "$backupdir"
datastring=$(date -u --rfc-3339=ns | sed 's/ /T/g') datastring=$(date -u --rfc-3339=ns | sed 's/ /T/g')
backupfile=${BACKUPDIR}/${DATABASE_NAME}.${datastring}.dump.sql backupfile=${BACKUPDIR}/${DATABASE_NAME}.${datastring}.dump.sql
=======
shift 2
# parameters: connection, database, outfile
if [ -e "$NARG_FILE" ]; then
failure "dumpfile already exists."
fi
echo "Dumping database $NARG_NAME to $NARG_FILE ... "
$MYSQLDUMP_CMD $(get_mysql_args_nodb) $* --opt --default-character-set=utf8 --routines \
"$NARG_NAME" > "$NARG_FILE"
>>>>>>> s-clean-up-stage
if [ -e "$backupfile" ]; then if [ -e "$backupfile" ]; then
failure "dumpfile already exists." failure "dumpfile already exists."
fi fi
<<<<<<< HEAD
=======
success
}
>>>>>>> s-clean-up-stage
echo "Dumping database $database to $backupfile ... " echo "Dumping database $database to $backupfile ... "
$MYSQLDUMP_CMD $(get_mysql_args_nodb) --opt --default-character-set=utf8\ $MYSQLDUMP_CMD $(get_mysql_args_nodb) --opt --default-character-set=utf8\
......
...@@ -34,7 +34,7 @@ if [ -z "$MAINPATH" ]; then ...@@ -34,7 +34,7 @@ if [ -z "$MAINPATH" ]; then
fi fi
# Make a backup of the important environment variables. # Make a backup of the important environment variables.
my_env=$(export -p | grep -E '(MYSQL|DATABASE)') my_env=$(export -p | grep -E '(MYSQL|DATABASE)' || true)
source "$MAINPATH/config.defaults" source "$MAINPATH/config.defaults"
......
...@@ -37,15 +37,15 @@ fi ...@@ -37,15 +37,15 @@ fi
# load useful functions ####################################################### # load useful functions #######################################################
. $UTILSPATH/helpers.sh . $UTILSPATH/helpers.sh
function get_logs { function get_logs {
echo 'select event_time, argument from mysql.general_log where command_type="Query";' | \ echo 'select event_time, argument from mysql.general_log where command_type="Query";' | \
$MYSQL_CMD $(get_db_args_nodb) --batch $MYSQL_CMD $(get_db_args_nodb) --batch
} }
function set_logging { function set_logging {
echo "Setting logging $1..." echo "Setting logging $1..."
echo "SET GLOBAL log_output = 'TABLE'; SET GLOBAL general_log = '$1';" | \ echo "SET GLOBAL log_output = 'TABLE'; SET GLOBAL general_log = '$1';" | \
$MYSQL_CMD $(get_db_args_nodb) --batch $MYSQL_CMD $(get_db_args_nodb) --batch
success success
} }
......
...@@ -127,7 +127,6 @@ function restore_db() { ...@@ -127,7 +127,6 @@ function restore_db() {
} }
function test-connection() { function test-connection() {
echo $MYSQL_CMD $(get_mysql_args_nodb) -e "select 0;"
$MYSQL_CMD $(get_mysql_args_nodb) -e "select 0;" $MYSQL_CMD $(get_mysql_args_nodb) -e "select 0;"
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment