Merge lp:~akopytov/percona-xtrabackup/bug1223716-2.1 into lp:percona-xtrabackup/2.1

Proposed by Alexey Kopytov
Status: Merged
Approved by: George Ormond Lorch III
Approved revision: no longer in the source branch.
Merged at revision: 709
Proposed branch: lp:~akopytov/percona-xtrabackup/bug1223716-2.1
Merge into: lp:percona-xtrabackup/2.1
Diff against target: 79 lines (+27/-13)
3 files modified
innobackupex.pl (+12/-11)
test/t/bug1223716.sh (+14/-0)
test/t/distribution_message.sh (+1/-2)
To merge this branch: bzr merge lp:~akopytov/percona-xtrabackup/bug1223716-2.1
Reviewer Review Type Date Requested Status
George Ormond Lorch III (community) g2 Approve
Review via email: mp+200147@code.launchpad.net

Description of the change

    Bug #1223716: innobackupex --help and --version doesn't work if source
                  destination isn't specifed

    Fixed innobackupex to not fail with an error when --help or --version
    are specified on the command line and the target directory argument is
    missing.

http://jenkins.percona.com/view/PXB%202.1/job/percona-xtrabackup-2.1-param/506/

(centos6-64 was out of disk space)

To post a comment you must log in.
Revision history for this message
George Ormond Lorch III (gl-az) :
review: Approve (g2)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'innobackupex.pl'
2--- innobackupex.pl 2013-11-21 10:08:38 +0000
3+++ innobackupex.pl 2013-12-29 19:09:07 +0000
4@@ -1660,7 +1660,7 @@
5 #
6 sub usage {
7 my $msg = shift || '';
8- pod2usage({ -msg => $msg, -verbose => 1});
9+ pod2usage({ -msg => $msg, -verbose => 1, -exitval => "NOEXIT"});
10 return 0;
11 }
12
13@@ -3744,6 +3744,17 @@
14 \$option_force_non_empty_dirs
15 );
16
17+ if ($option_help) {
18+ # print help text and exit
19+ usage();
20+ exit(0);
21+ }
22+ if ($option_version) {
23+ # print program version and copyright
24+ print_version();
25+ exit(0);
26+ }
27+
28 if (@ARGV == 0) {
29 die "You must specify the backup directory.\n";
30 } elsif (@ARGV > 1) {
31@@ -3754,16 +3765,6 @@
32 # failed to read options
33 die "Bad command line arguments\n";
34 }
35- if ($option_help) {
36- # print help text and exit
37- usage();
38- exit(0);
39- }
40- if ($option_version) {
41- # print program version and copyright
42- print_version();
43- exit(0);
44- }
45
46 if ($option_defaults_file && $option_defaults_extra_file) {
47 die "--defaults-file and --defaults-extra-file " .
48
49=== added file 'test/t/bug1223716.sh'
50--- test/t/bug1223716.sh 1970-01-01 00:00:00 +0000
51+++ test/t/bug1223716.sh 2013-12-29 19:09:07 +0000
52@@ -0,0 +1,14 @@
53+########################################################################
54+# Bug #1223716: innobackupex --help and --version doesn't work if source
55+# destination isn't specifed
56+########################################################################
57+
58+innobackupex --help
59+
60+innobackupex --version
61+
62+# Check that specifying the directory argument still works
63+
64+innobackupex --help $topdir
65+
66+innobackupex --version $topdir
67
68=== modified file 'test/t/distribution_message.sh'
69--- test/t/distribution_message.sh 2013-11-15 11:01:25 +0000
70+++ test/t/distribution_message.sh 2013-12-29 19:09:07 +0000
71@@ -4,8 +4,7 @@
72
73 [ -z ${XB_DISTRIBUTION:-} ] && skip_test "Requires XB_DISTRIBUTION to be set"
74
75-# Remove the argument when bug #1223716 is fixed
76-innobackupex --version $topdir/backup
77+innobackupex --version
78
79 link="http://www.percona.com/xb/$XB_DISTRIBUTION"
80

Subscribers

People subscribed via source and target branches

to all changes: