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
1=== modified file 'bin/pt-mext'
2--- bin/pt-mext 2014-07-04 17:16:08 +0000
3+++ bin/pt-mext 2014-07-29 18:09:51 +0000
4@@ -127,9 +127,10 @@
5
6 usage_or_errors() {
7 local file="$1"
8+ local version=""
9
10 if [ "$OPT_VERSION" ]; then
11- local version=$(grep '^pt-[^ ]\+ [0-9]' "$file")
12+ version=$(grep '^pt-[^ ]\+ [0-9]' "$file")
13 echo "$version"
14 return 1
15 fi
16
17=== modified file 'bin/pt-mysql-summary'
18--- bin/pt-mysql-summary 2014-07-04 17:16:08 +0000
19+++ bin/pt-mysql-summary 2014-07-29 18:09:51 +0000
20@@ -88,9 +88,10 @@
21
22 usage_or_errors() {
23 local file="$1"
24+ local version=""
25
26 if [ "$OPT_VERSION" ]; then
27- local version=$(grep '^pt-[^ ]\+ [0-9]' "$file")
28+ version=$(grep '^pt-[^ ]\+ [0-9]' "$file")
29 echo "$version"
30 return 1
31 fi
32
33=== modified file 'bin/pt-summary'
34--- bin/pt-summary 2014-07-04 17:16:08 +0000
35+++ bin/pt-summary 2014-07-29 18:09:51 +0000
36@@ -95,9 +95,10 @@
37
38 usage_or_errors() {
39 local file="$1"
40+ local version=""
41
42 if [ "$OPT_VERSION" ]; then
43- local version=$(grep '^pt-[^ ]\+ [0-9]' "$file")
44+ version=$(grep '^pt-[^ ]\+ [0-9]' "$file")
45 echo "$version"
46 return 1
47 fi
48
49=== modified file 'lib/bash/parse_options.sh'
50--- lib/bash/parse_options.sh 2013-08-09 21:21:55 +0000
51+++ lib/bash/parse_options.sh 2014-07-29 18:09:51 +0000
52@@ -76,9 +76,10 @@
53
54 usage_or_errors() {
55 local file="$1"
56+ local version=""
57
58 if [ "$OPT_VERSION" ]; then
59- local version=$(grep '^pt-[^ ]\+ [0-9]' "$file")
60+ version=$(grep '^pt-[^ ]\+ [0-9]' "$file")
61 echo "$version"
62 return 1
63 fi

Subscribers

People subscribed via source and target branches

to all changes: