fixes pt-mysql-summary-fails-to-parse-wsrep_provider_options-1264580

This commit is contained in:
Frank Cizmich
2014-09-03 13:25:38 -03:00
parent f0a0a8f737
commit 58006a38db
2 changed files with 14 additions and 21 deletions

View File

@@ -1353,26 +1353,19 @@ pretty_print_cnf_file () {
[ -e "$file" ] || return
awk '
BEGIN {
FS="="
}
/^[ \t]*[a-zA-Z[]/ {
if (length($2)) {
gsub(/^[ \t]*/, "", $1);
gsub(/^[ \t]*/, "", $2);
gsub(/[ \t]*$/, "", $1);
gsub(/[ \t]*$/, "", $2);
printf("%-35s = %s\n", $1, $2);
}
else if ( $0 ~ /\[/ ) {
print "";
print $1;
}
else {
print $1;
}
}' "$file"
perl -n -l -e '
my $line = $_;
if ( $line =~ /^[ \t]*[a-zA-Z[]/ ) {
if ( $line=~/\s*(.*?)\s*=\s*(.*)\s*$/ ) {
printf("%-35s = %s\n", $1, $2)
}
elsif ( $line =~ /\s*\[/ ) {
print "\n$line"
} else {
print $line
}
}' "$file"
}
find_checkpoint_age() {