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
Branches
Tags
No related merge requests found
......@@ -22,14 +22,21 @@
# ** end header
#
echo "CURRENTLY NOT SUPPORTET"
exit 1
if [ -z "$UTILSPATH" ]; then
UTILSPATH="$(realpath $(dirname $0)/utils)"
export UTILSPATH
fi
# defaults
source config.defaults
OPTIONS=$(sed -r '/^(#|\s*$)/d' config.defaults | sed -r 's/=.*$//g')
# override with old config
if [ -e .config ]; then
source .config
if [ -e $MAINPATH/.config ]; then
source $MAINPATH/.config
fi
# DEBUG - print all options:
......@@ -77,12 +84,12 @@ fi
# DEBUG - print all options:
# for opt in $OPTIONS; do echo $opt = ${!opt}; done
# write to .config
rm -f .config
# write to $MAINPATH/.config
rm -f $MAINPATH/.config
for opt in $OPTIONS; do
esc_hash=${!opt//#/\\\#}
esc_dollar=${esc_hash//\$/'$$'}
esc_dq=${esc_dollar//\"/\\\"}
esc_sq=${esc_dq//\'/\\\'}
echo "$opt=\"$esc_sq\"" >> .config
echo "$opt=\"$esc_sq\"" >> $MAINPATH/.config
done
......@@ -43,9 +43,6 @@ PATCHES="./patch*/patch.sh"
for p in $PATCHES
do
echo "$p"
env | grep MYSQL | sort
export | grep MYSQL | sort
$p "$@" --patch=$p
done
......
......@@ -27,8 +27,8 @@
# Dump a database with all procedures, permissions, structure and data
if [ -z "$UTILSPATH" ]; then
UTILSPATH="$(realpath $(dirname $0))"
export UTILSPATH
UTILSPATH="$(realpath $(dirname $0))"
export UTILSPATH
fi
# The directory which the dump is to be stored to. Do not change it here. Use
......@@ -45,30 +45,15 @@ function backup() {
database="$1"
backupdir="$2"
<<<<<<< HEAD
# Assert backup dir
mkdir -p "$backupdir"
datastring=$(date -u --rfc-3339=ns | sed 's/ /T/g')
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
failure "dumpfile already exists."
fi
<<<<<<< HEAD
=======
success
}
>>>>>>> s-clean-up-stage
echo "Dumping database $database to $backupfile ... "
$MYSQLDUMP_CMD $(get_mysql_args_nodb) --opt --default-character-set=utf8\
......
......@@ -34,7 +34,7 @@ if [ -z "$MAINPATH" ]; then
fi
# 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"
......
......@@ -37,15 +37,15 @@ fi
# load useful functions #######################################################
. $UTILSPATH/helpers.sh
function get_logs {
function get_logs {
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 "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
}
......
......@@ -127,7 +127,6 @@ function restore_db() {
}
function test-connection() {
echo $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