Merge lp:~percona-toolkit-dev/percona-toolkit/some-shell-tools-output-error-when-queried-for--version-1340364 into lp:~percona-toolkit-dev/percona-toolkit/release-2.2.10

Proposed by Frank Cizmich
Status: Merged
Approved by: Daniel Nichter
Approved revision: 621
Merged at revision: 612
Proposed branch: lp:~percona-toolkit-dev/percona-toolkit/some-shell-tools-output-error-when-queried-for--version-1340364
Merge into: lp:~percona-toolkit-dev/percona-toolkit/release-2.2.10
Diff against target: 63 lines (+8/-4)
4 files modified
bin/pt-mext (+2/-1)
bin/pt-mysql-summary (+2/-1)
bin/pt-summary (+2/-1)
lib/bash/parse_options.sh (+2/-1)
To merge this branch: bzr merge lp:~percona-toolkit-dev/percona-toolkit/some-shell-tools-output-error-when-queried-for--version-1340364
Reviewer Review Type Date Requested Status
Daniel Nichter Approve
Review via email: mp+228739@code.launchpad.net

Description of the change

Fixed compatibility of shell code: dash vs bash

resulted in error code output when --version option used

To post a comment you must log in.
Revision history for this message
Daniel Nichter (daniel-nichter) wrote :

Code looks good, so if you tried before (got error) and after (was successful) then good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bin/pt-mext'
--- bin/pt-mext 2014-07-04 17:16:08 +0000
+++ bin/pt-mext 2014-07-29 18:09:51 +0000
@@ -127,9 +127,10 @@
127127
128usage_or_errors() {128usage_or_errors() {
129 local file="$1"129 local file="$1"
130 local version=""
130131
131 if [ "$OPT_VERSION" ]; then132 if [ "$OPT_VERSION" ]; then
132 local version=$(grep '^pt-[^ ]\+ [0-9]' "$file")133 version=$(grep '^pt-[^ ]\+ [0-9]' "$file")
133 echo "$version"134 echo "$version"
134 return 1135 return 1
135 fi136 fi
136137
=== modified file 'bin/pt-mysql-summary'
--- bin/pt-mysql-summary 2014-07-04 17:16:08 +0000
+++ bin/pt-mysql-summary 2014-07-29 18:09:51 +0000
@@ -88,9 +88,10 @@
8888
89usage_or_errors() {89usage_or_errors() {
90 local file="$1"90 local file="$1"
91 local version=""
9192
92 if [ "$OPT_VERSION" ]; then93 if [ "$OPT_VERSION" ]; then
93 local version=$(grep '^pt-[^ ]\+ [0-9]' "$file")94 version=$(grep '^pt-[^ ]\+ [0-9]' "$file")
94 echo "$version"95 echo "$version"
95 return 196 return 1
96 fi97 fi
9798
=== modified file 'bin/pt-summary'
--- bin/pt-summary 2014-07-04 17:16:08 +0000
+++ bin/pt-summary 2014-07-29 18:09:51 +0000
@@ -95,9 +95,10 @@
9595
96usage_or_errors() {96usage_or_errors() {
97 local file="$1"97 local file="$1"
98 local version=""
9899
99 if [ "$OPT_VERSION" ]; then100 if [ "$OPT_VERSION" ]; then
100 local version=$(grep '^pt-[^ ]\+ [0-9]' "$file")101 version=$(grep '^pt-[^ ]\+ [0-9]' "$file")
101 echo "$version"102 echo "$version"
102 return 1103 return 1
103 fi104 fi
104105
=== modified file 'lib/bash/parse_options.sh'
--- lib/bash/parse_options.sh 2013-08-09 21:21:55 +0000
+++ lib/bash/parse_options.sh 2014-07-29 18:09:51 +0000
@@ -76,9 +76,10 @@
7676
77usage_or_errors() {77usage_or_errors() {
78 local file="$1"78 local file="$1"
79 local version=""
7980
80 if [ "$OPT_VERSION" ]; then81 if [ "$OPT_VERSION" ]; then
81 local version=$(grep '^pt-[^ ]\+ [0-9]' "$file")82 version=$(grep '^pt-[^ ]\+ [0-9]' "$file")
82 echo "$version"83 echo "$version"
83 return 184 return 1
84 fi85 fi

Subscribers

People subscribed via source and target branches

to all changes: