forked from Percona-QA/percona-qa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pquery-clean-known.sh
executable file
·64 lines (55 loc) · 2.18 KB
/
pquery-clean-known.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
# Created by Roel Van de Paar, Percona LLC
# This script deletes all known found bugs from a pquery work directory. Execute from within the pquery workdir.
# Internal variables
SCRIPT_PWD=$(cd `dirname $0` && pwd)
# Check if this an automated (pquery-reach.sh) run
if [ "$1" == "reach" ]; then
REACH=1 # Minimal output, and no 2x enter required
else
REACH=0 # Normal output
fi
# Check if this is a pxc run
if [ "$1" == "pxc" ]; then
PXC=1
else
PXC=0
fi
# Current location checks
if [ `ls ./*/*.sql 2>/dev/null | wc -l` -eq 0 ]; then
echo "Something is wrong: no pquery trials (with logging - i.e. ./*/*.sql) were found in this directory"
exit 1
fi
if [ ${PXC} -eq 1 ]; then
while read line; do
STRING="`echo "$line" | sed 's|[ \t]*##.*$||'`"
if [ "`echo "$STRING" | sed 's|^[ \t]*$||' | grep -v '^[ \t]*#'`" != "" ]; then
if [ `ls reducer* 2>/dev/null | wc -l` -gt 0 ]; then
grep -li "${STRING}" reducer* | sed 's/[^0-9.]*\([0-9.]*\).*/\1/' | xargs -I_ $SCRIPT_PWD/pquery-del-trial.sh _
fi
fi
#sync; sleep 0.02 # Making sure that next line in file does not trigger same deletions
done < ${SCRIPT_PWD}/known_bugs_pxc.strings
fi
while read line; do
STRING="`echo "$line" | sed 's|[ \t]*##.*$||'`"
if [ "`echo "$STRING" | sed 's|^[ \t]*$||' | grep -v '^[ \t]*#'`" != "" ]; then
if [ `ls reducer* 2>/dev/null | wc -l` -gt 0 ]; then
if [ ${PXC} -eq 1 ]; then
grep -li "${STRING}" reducer* | sed 's/[^0-9.]*\([0-9.]*\).*/\1/' | xargs -I_ $SCRIPT_PWD/pquery-del-trial.sh _
else
grep -li "${STRING}" reducer* | sed 's/[^0-9]//g' | xargs -I_ $SCRIPT_PWD/pquery-del-trial.sh _
fi
fi
fi
#sync; sleep 0.02 # Making sure that next line in file does not trigger same deletions
done < ${SCRIPT_PWD}/known_bugs.strings
# Other cleanups
grep "CT NAME_CONST('a', -(1 [ANDOR]\+ 2)) [ANDOR]\+ 1" */log/master.err | sed 's|/.*||' | xargs -I{} ~/percona-qa/pquery-del-trial.sh {} #http://bugs.mysql.com/bug.php?id=81407
if [ ${REACH} -eq 0 ]; then # Avoid normal output if this is an automated run (REACH=1)
if [ -d ./bundles ]; then
echo "Done! Any trials in ./bundles were not touched."
else
echo "Done!"
fi
fi