Merge lp:~percona-toolkit-dev/percona-toolkit/quote-tr-arguments into lp:percona-toolkit/2.1

Proposed by Brian Fraser
Status: Merged
Approved by: Daniel Nichter
Approved revision: 355
Merged at revision: 377
Proposed branch: lp:~percona-toolkit-dev/percona-toolkit/quote-tr-arguments
Merge into: lp:percona-toolkit/2.1
Diff against target: 221 lines (+22/-22)
6 files modified
bin/pt-ioprofile (+4/-4)
bin/pt-mysql-summary (+4/-4)
bin/pt-stalk (+6/-6)
bin/pt-summary (+4/-4)
lib/bash/log_warn_die.sh (+1/-1)
lib/bash/parse_options.sh (+3/-3)
To merge this branch: bzr merge lp:~percona-toolkit-dev/percona-toolkit/quote-tr-arguments
Reviewer Review Type Date Requested Status
Daniel Nichter Needs Information
Review via email: mp+120929@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Daniel Nichter (daniel-nichter) :
review: Approve
Revision history for this message
Daniel Nichter (daniel-nichter) wrote :

Create and link to a bug before merging please.

review: Needs Information

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bin/pt-ioprofile'
--- bin/pt-ioprofile 2012-08-03 18:41:41 +0000
+++ bin/pt-ioprofile 2012-08-23 06:40:56 +0000
@@ -21,7 +21,7 @@
21EXIT_STATUS=021EXIT_STATUS=0
2222
23log() {23log() {
24 TS=$(date +%F-%T | tr :- _);24 TS=$(date +%F-%T | tr ':-' '_');
25 echo "$TS $*"25 echo "$TS $*"
26}26}
2727
@@ -120,7 +120,7 @@
120 echo "Options and values after processing arguments:"120 echo "Options and values after processing arguments:"
121 echo121 echo
122 for opt in $(ls "$PO_DIR"); do122 for opt in $(ls "$PO_DIR"); do
123 local varname="OPT_$(echo "$opt" | tr a-z- A-Z_)"123 local varname="OPT_$(echo "$opt" | tr 'a-z-' 'A-Z_')"
124 local varvalue="${!varname}"124 local varvalue="${!varname}"
125 if ! grep -q "type:" "$PO_DIR/$opt" >/dev/null; then125 if ! grep -q "type:" "$PO_DIR/$opt" >/dev/null; then
126 if [ "$varvalue" -a "$varvalue" = "yes" ];126 if [ "$varvalue" -a "$varvalue" = "yes" ];
@@ -238,7 +238,7 @@
238 while read key val; do238 while read key val; do
239 case "$key" in239 case "$key" in
240 long)240 long)
241 opt=$(echo $val | sed 's/-/_/g' | tr [:lower:] [:upper:])241 opt=$(echo $val | sed 's/-/_/g' | tr '[:lower:]' '[:upper:]')
242 ;;242 ;;
243 default)243 default)
244 default_val="$val"244 default_val="$val"
@@ -404,7 +404,7 @@
404 fi404 fi
405405
406 if [ "$opt_is_ok" ]; then406 if [ "$opt_is_ok" ]; then
407 opt=$(cat "$spec" | grep '^long:' | cut -d':' -f2 | sed 's/-/_/g' | tr [:lower:] [:upper:])407 opt=$(cat "$spec" | grep '^long:' | cut -d':' -f2 | sed 's/-/_/g' | tr '[:lower:]' '[:upper:]')
408408
409 if grep "^type:size" "$spec" >/dev/null; then409 if grep "^type:size" "$spec" >/dev/null; then
410 val=$(size_to_bytes $val)410 val=$(size_to_bytes $val)
411411
=== modified file 'bin/pt-mysql-summary'
--- bin/pt-mysql-summary 2012-08-03 18:41:41 +0000
+++ bin/pt-mysql-summary 2012-08-23 06:40:56 +0000
@@ -23,7 +23,7 @@
23EXIT_STATUS=023EXIT_STATUS=0
2424
25log() {25log() {
26 TS=$(date +%F-%T | tr :- _);26 TS=$(date +%F-%T | tr ':-' '_');
27 echo "$TS $*"27 echo "$TS $*"
28}28}
2929
@@ -122,7 +122,7 @@
122 echo "Options and values after processing arguments:"122 echo "Options and values after processing arguments:"
123 echo123 echo
124 for opt in $(ls "$PO_DIR"); do124 for opt in $(ls "$PO_DIR"); do
125 local varname="OPT_$(echo "$opt" | tr a-z- A-Z_)"125 local varname="OPT_$(echo "$opt" | tr 'a-z-' 'A-Z_')"
126 local varvalue="${!varname}"126 local varvalue="${!varname}"
127 if ! grep -q "type:" "$PO_DIR/$opt" >/dev/null; then127 if ! grep -q "type:" "$PO_DIR/$opt" >/dev/null; then
128 if [ "$varvalue" -a "$varvalue" = "yes" ];128 if [ "$varvalue" -a "$varvalue" = "yes" ];
@@ -240,7 +240,7 @@
240 while read key val; do240 while read key val; do
241 case "$key" in241 case "$key" in
242 long)242 long)
243 opt=$(echo $val | sed 's/-/_/g' | tr [:lower:] [:upper:])243 opt=$(echo $val | sed 's/-/_/g' | tr '[:lower:]' '[:upper:]')
244 ;;244 ;;
245 default)245 default)
246 default_val="$val"246 default_val="$val"
@@ -406,7 +406,7 @@
406 fi406 fi
407407
408 if [ "$opt_is_ok" ]; then408 if [ "$opt_is_ok" ]; then
409 opt=$(cat "$spec" | grep '^long:' | cut -d':' -f2 | sed 's/-/_/g' | tr [:lower:] [:upper:])409 opt=$(cat "$spec" | grep '^long:' | cut -d':' -f2 | sed 's/-/_/g' | tr '[:lower:]' '[:upper:]')
410410
411 if grep "^type:size" "$spec" >/dev/null; then411 if grep "^type:size" "$spec" >/dev/null; then
412 val=$(size_to_bytes $val)412 val=$(size_to_bytes $val)
413413
=== modified file 'bin/pt-stalk'
--- bin/pt-stalk 2012-08-14 15:11:41 +0000
+++ bin/pt-stalk 2012-08-23 06:40:56 +0000
@@ -23,7 +23,7 @@
23EXIT_STATUS=023EXIT_STATUS=0
2424
25log() {25log() {
26 TS=$(date +%F-%T | tr :- _);26 TS=$(date +%F-%T | tr ':-' '_');
27 echo "$TS $*"27 echo "$TS $*"
28}28}
2929
@@ -122,7 +122,7 @@
122 echo "Options and values after processing arguments:"122 echo "Options and values after processing arguments:"
123 echo123 echo
124 for opt in $(ls "$PO_DIR"); do124 for opt in $(ls "$PO_DIR"); do
125 local varname="OPT_$(echo "$opt" | tr a-z- A-Z_)"125 local varname="OPT_$(echo "$opt" | tr 'a-z-' 'A-Z_')"
126 local varvalue="${!varname}"126 local varvalue="${!varname}"
127 if ! grep -q "type:" "$PO_DIR/$opt" >/dev/null; then127 if ! grep -q "type:" "$PO_DIR/$opt" >/dev/null; then
128 if [ "$varvalue" -a "$varvalue" = "yes" ];128 if [ "$varvalue" -a "$varvalue" = "yes" ];
@@ -240,7 +240,7 @@
240 while read key val; do240 while read key val; do
241 case "$key" in241 case "$key" in
242 long)242 long)
243 opt=$(echo $val | sed 's/-/_/g' | tr [:lower:] [:upper:])243 opt=$(echo $val | sed 's/-/_/g' | tr '[:lower:]' '[:upper:]')
244 ;;244 ;;
245 default)245 default)
246 default_val="$val"246 default_val="$val"
@@ -406,7 +406,7 @@
406 fi406 fi
407407
408 if [ "$opt_is_ok" ]; then408 if [ "$opt_is_ok" ]; then
409 opt=$(cat "$spec" | grep '^long:' | cut -d':' -f2 | sed 's/-/_/g' | tr [:lower:] [:upper:])409 opt=$(cat "$spec" | grep '^long:' | cut -d':' -f2 | sed 's/-/_/g' | tr '[:lower:]' '[:upper:]')
410410
411 if grep "^type:size" "$spec" >/dev/null; then411 if grep "^type:size" "$spec" >/dev/null; then
412 val=$(size_to_bytes $val)412 val=$(size_to_bytes $val)
@@ -976,7 +976,7 @@
976 return 0 # success976 return 0 # success
977 else977 else
978 # Trigger function is name of a built-in function.978 # Trigger function is name of a built-in function.
979 func=$(echo "$func" | tr [:upper:] [:lower:])979 func=$(echo "$func" | tr '[:upper:]' '[:lower:]')
980 if [ "$func" = "status" -o "$func" = "processlist" ]; then980 if [ "$func" = "status" -o "$func" = "processlist" ]; then
981 TRIGGER_FUNCTION="trg_$func"981 TRIGGER_FUNCTION="trg_$func"
982 return 0 # success982 return 0 # success
@@ -1103,7 +1103,7 @@
1103 fi1103 fi
11041104
1105 if [ "$OPT_COLLECT" ]; then1105 if [ "$OPT_COLLECT" ]; then
1106 local prefix="${OPT_PREFIX:-$(date +%F-%T | tr :- _)}"1106 local prefix="${OPT_PREFIX:-$(date +%F-%T | tr ':-' '_')}"
11071107
1108 # Check if we'll have enough disk space to collect. Disk space1108 # Check if we'll have enough disk space to collect. Disk space
1109 # is also checked every interval while collecting.1109 # is also checked every interval while collecting.
11101110
=== modified file 'bin/pt-summary'
--- bin/pt-summary 2012-08-03 18:41:41 +0000
+++ bin/pt-summary 2012-08-23 06:40:56 +0000
@@ -30,7 +30,7 @@
30EXIT_STATUS=030EXIT_STATUS=0
3131
32log() {32log() {
33 TS=$(date +%F-%T | tr :- _);33 TS=$(date +%F-%T | tr ':-' '_');
34 echo "$TS $*"34 echo "$TS $*"
35}35}
3636
@@ -129,7 +129,7 @@
129 echo "Options and values after processing arguments:"129 echo "Options and values after processing arguments:"
130 echo130 echo
131 for opt in $(ls "$PO_DIR"); do131 for opt in $(ls "$PO_DIR"); do
132 local varname="OPT_$(echo "$opt" | tr a-z- A-Z_)"132 local varname="OPT_$(echo "$opt" | tr 'a-z-' 'A-Z_')"
133 local varvalue="${!varname}"133 local varvalue="${!varname}"
134 if ! grep -q "type:" "$PO_DIR/$opt" >/dev/null; then134 if ! grep -q "type:" "$PO_DIR/$opt" >/dev/null; then
135 if [ "$varvalue" -a "$varvalue" = "yes" ];135 if [ "$varvalue" -a "$varvalue" = "yes" ];
@@ -247,7 +247,7 @@
247 while read key val; do247 while read key val; do
248 case "$key" in248 case "$key" in
249 long)249 long)
250 opt=$(echo $val | sed 's/-/_/g' | tr [:lower:] [:upper:])250 opt=$(echo $val | sed 's/-/_/g' | tr '[:lower:]' '[:upper:]')
251 ;;251 ;;
252 default)252 default)
253 default_val="$val"253 default_val="$val"
@@ -413,7 +413,7 @@
413 fi413 fi
414414
415 if [ "$opt_is_ok" ]; then415 if [ "$opt_is_ok" ]; then
416 opt=$(cat "$spec" | grep '^long:' | cut -d':' -f2 | sed 's/-/_/g' | tr [:lower:] [:upper:])416 opt=$(cat "$spec" | grep '^long:' | cut -d':' -f2 | sed 's/-/_/g' | tr '[:lower:]' '[:upper:]')
417417
418 if grep "^type:size" "$spec" >/dev/null; then418 if grep "^type:size" "$spec" >/dev/null; then
419 val=$(size_to_bytes $val)419 val=$(size_to_bytes $val)
420420
=== modified file 'lib/bash/log_warn_die.sh'
--- lib/bash/log_warn_die.sh 2012-03-24 17:20:09 +0000
+++ lib/bash/log_warn_die.sh 2012-08-23 06:40:56 +0000
@@ -29,7 +29,7 @@
29EXIT_STATUS=029EXIT_STATUS=0
3030
31log() {31log() {
32 TS=$(date +%F-%T | tr :- _);32 TS=$(date +%F-%T | tr ':-' '_');
33 echo "$TS $*"33 echo "$TS $*"
34}34}
3535
3636
=== modified file 'lib/bash/parse_options.sh'
--- lib/bash/parse_options.sh 2012-07-21 17:57:53 +0000
+++ lib/bash/parse_options.sh 2012-08-23 06:40:56 +0000
@@ -119,7 +119,7 @@
119 echo "Options and values after processing arguments:"119 echo "Options and values after processing arguments:"
120 echo120 echo
121 for opt in $(ls "$PO_DIR"); do121 for opt in $(ls "$PO_DIR"); do
122 local varname="OPT_$(echo "$opt" | tr a-z- A-Z_)"122 local varname="OPT_$(echo "$opt" | tr 'a-z-' 'A-Z_')"
123 local varvalue="${!varname}"123 local varvalue="${!varname}"
124 if ! grep -q "type:" "$PO_DIR/$opt" >/dev/null; then124 if ! grep -q "type:" "$PO_DIR/$opt" >/dev/null; then
125 # Typeless option, like --version, so it's given/TRUE125 # Typeless option, like --version, so it's given/TRUE
@@ -271,7 +271,7 @@
271 while read key val; do271 while read key val; do
272 case "$key" in272 case "$key" in
273 long)273 long)
274 opt=$(echo $val | sed 's/-/_/g' | tr [:lower:] [:upper:])274 opt=$(echo $val | sed 's/-/_/g' | tr '[:lower:]' '[:upper:]')
275 ;;275 ;;
276 default)276 default)
277 default_val="$val"277 default_val="$val"
@@ -482,7 +482,7 @@
482482
483 if [ "$opt_is_ok" ]; then483 if [ "$opt_is_ok" ]; then
484 # Get and transform the opt's long form. E.g.: -q == --quiet == QUIET.484 # Get and transform the opt's long form. E.g.: -q == --quiet == QUIET.
485 opt=$(cat "$spec" | grep '^long:' | cut -d':' -f2 | sed 's/-/_/g' | tr [:lower:] [:upper:])485 opt=$(cat "$spec" | grep '^long:' | cut -d':' -f2 | sed 's/-/_/g' | tr '[:lower:]' '[:upper:]')
486486
487 # Convert sizes.487 # Convert sizes.
488 if grep "^type:size" "$spec" >/dev/null; then488 if grep "^type:size" "$spec" >/dev/null; then

Subscribers

People subscribed via source and target branches