Update OptionParser in all tools.

This commit is contained in:
Daniel Nichter
2011-08-12 09:05:46 -06:00
parent f23ca1af89
commit c7154acff1
24 changed files with 504 additions and 408 deletions

View File

@@ -148,6 +148,11 @@ sub get_specs {
$self->{DSNParser} = DSNParser->new(opts => \@dsn_opts); $self->{DSNParser} = DSNParser->new(opts => \@dsn_opts);
} }
if ( $contents =~ m/^(Percona Toolkit v.+)$/m ) {
$self->{version} = $1;
MKDEBUG && _d($self->{version});
}
return; return;
} }
@@ -472,9 +477,12 @@ sub get_opts {
) or $self->save_error('Error parsing options'); ) or $self->save_error('Error parsing options');
if ( exists $self->{opts}->{version} && $self->{opts}->{version}->{got} ) { if ( exists $self->{opts}->{version} && $self->{opts}->{version}->{got} ) {
printf("%s Ver %s Distrib %s Changeset %s\n", if ( $self->{version} ) {
$self->{program_name}, $main::VERSION, $main::DISTRIB, $main::SVN_REV) print $self->{version}, "\n";
or die "Cannot print: $OS_ERROR"; }
else {
print "Error parsing version. See the VERSION section of the tool's documentation.\n";
}
exit 0; exit 0;
} }
@@ -855,20 +863,6 @@ sub prompt_noecho {
return $response; return $response;
} }
if ( MKDEBUG ) {
print '# ', $^X, ' ', $], "\n";
my $uname = `uname -a`;
if ( $uname ) {
$uname =~ s/\s+/ /g;
print "# $uname\n";
}
printf("# %s Ver %s Distrib %s Changeset %s line %d\n",
$PROGRAM_NAME, ($main::VERSION || ''), ($main::DISTRIB || ''),
($main::SVN_REV || ''), __LINE__);
print('# Arguments: ',
join(' ', map { my $a = "_[$_]_"; $a =~ s/\n/\n# /g; $a; } @ARGV), "\n");
}
sub _read_config_file { sub _read_config_file {
my ( $self, $filename ) = @_; my ( $self, $filename ) = @_;
open my $fh, "<", $filename or die "Cannot open $filename: $OS_ERROR\n"; open my $fh, "<", $filename or die "Cannot open $filename: $OS_ERROR\n";
@@ -1023,6 +1017,16 @@ sub _d {
print STDERR "# $package:$line $PID ", join(' ', @_), "\n"; print STDERR "# $package:$line $PID ", join(' ', @_), "\n";
} }
if ( MKDEBUG ) {
print '# ', $^X, ' ', $], "\n";
if ( my $uname = `uname -a` ) {
$uname =~ s/\s+/ /g;
print "# $uname\n";
}
print '# Arguments: ',
join(' ', map { my $a = "_[$_]_"; $a =~ s/\n/\n# /g; $a; } @ARGV), "\n";
}
1; 1;
} }
# ########################################################################### # ###########################################################################

View File

@@ -148,6 +148,11 @@ sub get_specs {
$self->{DSNParser} = DSNParser->new(opts => \@dsn_opts); $self->{DSNParser} = DSNParser->new(opts => \@dsn_opts);
} }
if ( $contents =~ m/^(Percona Toolkit v.+)$/m ) {
$self->{version} = $1;
MKDEBUG && _d($self->{version});
}
return; return;
} }
@@ -472,9 +477,12 @@ sub get_opts {
) or $self->save_error('Error parsing options'); ) or $self->save_error('Error parsing options');
if ( exists $self->{opts}->{version} && $self->{opts}->{version}->{got} ) { if ( exists $self->{opts}->{version} && $self->{opts}->{version}->{got} ) {
printf("%s Ver %s Distrib %s Changeset %s\n", if ( $self->{version} ) {
$self->{program_name}, $main::VERSION, $main::DISTRIB, $main::SVN_REV) print $self->{version}, "\n";
or die "Cannot print: $OS_ERROR"; }
else {
print "Error parsing version. See the VERSION section of the tool's documentation.\n";
}
exit 0; exit 0;
} }
@@ -855,20 +863,6 @@ sub prompt_noecho {
return $response; return $response;
} }
if ( MKDEBUG ) {
print '# ', $^X, ' ', $], "\n";
my $uname = `uname -a`;
if ( $uname ) {
$uname =~ s/\s+/ /g;
print "# $uname\n";
}
printf("# %s Ver %s Distrib %s Changeset %s line %d\n",
$PROGRAM_NAME, ($main::VERSION || ''), ($main::DISTRIB || ''),
($main::SVN_REV || ''), __LINE__);
print('# Arguments: ',
join(' ', map { my $a = "_[$_]_"; $a =~ s/\n/\n# /g; $a; } @ARGV), "\n");
}
sub _read_config_file { sub _read_config_file {
my ( $self, $filename ) = @_; my ( $self, $filename ) = @_;
open my $fh, "<", $filename or die "Cannot open $filename: $OS_ERROR\n"; open my $fh, "<", $filename or die "Cannot open $filename: $OS_ERROR\n";
@@ -1023,6 +1017,16 @@ sub _d {
print STDERR "# $package:$line $PID ", join(' ', @_), "\n"; print STDERR "# $package:$line $PID ", join(' ', @_), "\n";
} }
if ( MKDEBUG ) {
print '# ', $^X, ' ', $], "\n";
if ( my $uname = `uname -a` ) {
$uname =~ s/\s+/ /g;
print "# $uname\n";
}
print '# Arguments: ',
join(' ', map { my $a = "_[$_]_"; $a =~ s/\n/\n# /g; $a; } @ARGV), "\n";
}
1; 1;
} }
# ########################################################################### # ###########################################################################

View File

@@ -148,6 +148,11 @@ sub get_specs {
$self->{DSNParser} = DSNParser->new(opts => \@dsn_opts); $self->{DSNParser} = DSNParser->new(opts => \@dsn_opts);
} }
if ( $contents =~ m/^(Percona Toolkit v.+)$/m ) {
$self->{version} = $1;
MKDEBUG && _d($self->{version});
}
return; return;
} }
@@ -472,9 +477,12 @@ sub get_opts {
) or $self->save_error('Error parsing options'); ) or $self->save_error('Error parsing options');
if ( exists $self->{opts}->{version} && $self->{opts}->{version}->{got} ) { if ( exists $self->{opts}->{version} && $self->{opts}->{version}->{got} ) {
printf("%s Ver %s Distrib %s Changeset %s\n", if ( $self->{version} ) {
$self->{program_name}, $main::VERSION, $main::DISTRIB, $main::SVN_REV) print $self->{version}, "\n";
or die "Cannot print: $OS_ERROR"; }
else {
print "Error parsing version. See the VERSION section of the tool's documentation.\n";
}
exit 0; exit 0;
} }
@@ -855,20 +863,6 @@ sub prompt_noecho {
return $response; return $response;
} }
if ( MKDEBUG ) {
print '# ', $^X, ' ', $], "\n";
my $uname = `uname -a`;
if ( $uname ) {
$uname =~ s/\s+/ /g;
print "# $uname\n";
}
printf("# %s Ver %s Distrib %s Changeset %s line %d\n",
$PROGRAM_NAME, ($main::VERSION || ''), ($main::DISTRIB || ''),
($main::SVN_REV || ''), __LINE__);
print('# Arguments: ',
join(' ', map { my $a = "_[$_]_"; $a =~ s/\n/\n# /g; $a; } @ARGV), "\n");
}
sub _read_config_file { sub _read_config_file {
my ( $self, $filename ) = @_; my ( $self, $filename ) = @_;
open my $fh, "<", $filename or die "Cannot open $filename: $OS_ERROR\n"; open my $fh, "<", $filename or die "Cannot open $filename: $OS_ERROR\n";
@@ -1023,6 +1017,16 @@ sub _d {
print STDERR "# $package:$line $PID ", join(' ', @_), "\n"; print STDERR "# $package:$line $PID ", join(' ', @_), "\n";
} }
if ( MKDEBUG ) {
print '# ', $^X, ' ', $], "\n";
if ( my $uname = `uname -a` ) {
$uname =~ s/\s+/ /g;
print "# $uname\n";
}
print '# Arguments: ',
join(' ', map { my $a = "_[$_]_"; $a =~ s/\n/\n# /g; $a; } @ARGV), "\n";
}
1; 1;
} }
# ########################################################################### # ###########################################################################

View File

@@ -1370,6 +1370,11 @@ sub get_specs {
$self->{DSNParser} = DSNParser->new(opts => \@dsn_opts); $self->{DSNParser} = DSNParser->new(opts => \@dsn_opts);
} }
if ( $contents =~ m/^(Percona Toolkit v.+)$/m ) {
$self->{version} = $1;
MKDEBUG && _d($self->{version});
}
return; return;
} }
@@ -1694,9 +1699,12 @@ sub get_opts {
) or $self->save_error('Error parsing options'); ) or $self->save_error('Error parsing options');
if ( exists $self->{opts}->{version} && $self->{opts}->{version}->{got} ) { if ( exists $self->{opts}->{version} && $self->{opts}->{version}->{got} ) {
printf("%s Ver %s Distrib %s Changeset %s\n", if ( $self->{version} ) {
$self->{program_name}, $main::VERSION, $main::DISTRIB, $main::SVN_REV) print $self->{version}, "\n";
or die "Cannot print: $OS_ERROR"; }
else {
print "Error parsing version. See the VERSION section of the tool's documentation.\n";
}
exit 0; exit 0;
} }
@@ -2077,20 +2085,6 @@ sub prompt_noecho {
return $response; return $response;
} }
if ( MKDEBUG ) {
print '# ', $^X, ' ', $], "\n";
my $uname = `uname -a`;
if ( $uname ) {
$uname =~ s/\s+/ /g;
print "# $uname\n";
}
printf("# %s Ver %s Distrib %s Changeset %s line %d\n",
$PROGRAM_NAME, ($main::VERSION || ''), ($main::DISTRIB || ''),
($main::SVN_REV || ''), __LINE__);
print('# Arguments: ',
join(' ', map { my $a = "_[$_]_"; $a =~ s/\n/\n# /g; $a; } @ARGV), "\n");
}
sub _read_config_file { sub _read_config_file {
my ( $self, $filename ) = @_; my ( $self, $filename ) = @_;
open my $fh, "<", $filename or die "Cannot open $filename: $OS_ERROR\n"; open my $fh, "<", $filename or die "Cannot open $filename: $OS_ERROR\n";
@@ -2245,6 +2239,16 @@ sub _d {
print STDERR "# $package:$line $PID ", join(' ', @_), "\n"; print STDERR "# $package:$line $PID ", join(' ', @_), "\n";
} }
if ( MKDEBUG ) {
print '# ', $^X, ' ', $], "\n";
if ( my $uname = `uname -a` ) {
$uname =~ s/\s+/ /g;
print "# $uname\n";
}
print '# Arguments: ',
join(' ', map { my $a = "_[$_]_"; $a =~ s/\n/\n# /g; $a; } @ARGV), "\n";
}
1; 1;
} }
# ########################################################################### # ###########################################################################

View File

@@ -148,6 +148,11 @@ sub get_specs {
$self->{DSNParser} = DSNParser->new(opts => \@dsn_opts); $self->{DSNParser} = DSNParser->new(opts => \@dsn_opts);
} }
if ( $contents =~ m/^(Percona Toolkit v.+)$/m ) {
$self->{version} = $1;
MKDEBUG && _d($self->{version});
}
return; return;
} }
@@ -472,9 +477,12 @@ sub get_opts {
) or $self->save_error('Error parsing options'); ) or $self->save_error('Error parsing options');
if ( exists $self->{opts}->{version} && $self->{opts}->{version}->{got} ) { if ( exists $self->{opts}->{version} && $self->{opts}->{version}->{got} ) {
printf("%s Ver %s Distrib %s Changeset %s\n", if ( $self->{version} ) {
$self->{program_name}, $main::VERSION, $main::DISTRIB, $main::SVN_REV) print $self->{version}, "\n";
or die "Cannot print: $OS_ERROR"; }
else {
print "Error parsing version. See the VERSION section of the tool's documentation.\n";
}
exit 0; exit 0;
} }
@@ -855,20 +863,6 @@ sub prompt_noecho {
return $response; return $response;
} }
if ( MKDEBUG ) {
print '# ', $^X, ' ', $], "\n";
my $uname = `uname -a`;
if ( $uname ) {
$uname =~ s/\s+/ /g;
print "# $uname\n";
}
printf("# %s Ver %s Distrib %s Changeset %s line %d\n",
$PROGRAM_NAME, ($main::VERSION || ''), ($main::DISTRIB || ''),
($main::SVN_REV || ''), __LINE__);
print('# Arguments: ',
join(' ', map { my $a = "_[$_]_"; $a =~ s/\n/\n# /g; $a; } @ARGV), "\n");
}
sub _read_config_file { sub _read_config_file {
my ( $self, $filename ) = @_; my ( $self, $filename ) = @_;
open my $fh, "<", $filename or die "Cannot open $filename: $OS_ERROR\n"; open my $fh, "<", $filename or die "Cannot open $filename: $OS_ERROR\n";
@@ -1023,6 +1017,16 @@ sub _d {
print STDERR "# $package:$line $PID ", join(' ', @_), "\n"; print STDERR "# $package:$line $PID ", join(' ', @_), "\n";
} }
if ( MKDEBUG ) {
print '# ', $^X, ' ', $], "\n";
if ( my $uname = `uname -a` ) {
$uname =~ s/\s+/ /g;
print "# $uname\n";
}
print '# Arguments: ',
join(' ', map { my $a = "_[$_]_"; $a =~ s/\n/\n# /g; $a; } @ARGV), "\n";
}
1; 1;
} }
# ########################################################################### # ###########################################################################

View File

@@ -504,6 +504,11 @@ sub get_specs {
$self->{DSNParser} = DSNParser->new(opts => \@dsn_opts); $self->{DSNParser} = DSNParser->new(opts => \@dsn_opts);
} }
if ( $contents =~ m/^(Percona Toolkit v.+)$/m ) {
$self->{version} = $1;
MKDEBUG && _d($self->{version});
}
return; return;
} }
@@ -828,9 +833,12 @@ sub get_opts {
) or $self->save_error('Error parsing options'); ) or $self->save_error('Error parsing options');
if ( exists $self->{opts}->{version} && $self->{opts}->{version}->{got} ) { if ( exists $self->{opts}->{version} && $self->{opts}->{version}->{got} ) {
printf("%s Ver %s Distrib %s Changeset %s\n", if ( $self->{version} ) {
$self->{program_name}, $main::VERSION, $main::DISTRIB, $main::SVN_REV) print $self->{version}, "\n";
or die "Cannot print: $OS_ERROR"; }
else {
print "Error parsing version. See the VERSION section of the tool's documentation.\n";
}
exit 0; exit 0;
} }
@@ -1211,20 +1219,6 @@ sub prompt_noecho {
return $response; return $response;
} }
if ( MKDEBUG ) {
print '# ', $^X, ' ', $], "\n";
my $uname = `uname -a`;
if ( $uname ) {
$uname =~ s/\s+/ /g;
print "# $uname\n";
}
printf("# %s Ver %s Distrib %s Changeset %s line %d\n",
$PROGRAM_NAME, ($main::VERSION || ''), ($main::DISTRIB || ''),
($main::SVN_REV || ''), __LINE__);
print('# Arguments: ',
join(' ', map { my $a = "_[$_]_"; $a =~ s/\n/\n# /g; $a; } @ARGV), "\n");
}
sub _read_config_file { sub _read_config_file {
my ( $self, $filename ) = @_; my ( $self, $filename ) = @_;
open my $fh, "<", $filename or die "Cannot open $filename: $OS_ERROR\n"; open my $fh, "<", $filename or die "Cannot open $filename: $OS_ERROR\n";
@@ -1379,6 +1373,16 @@ sub _d {
print STDERR "# $package:$line $PID ", join(' ', @_), "\n"; print STDERR "# $package:$line $PID ", join(' ', @_), "\n";
} }
if ( MKDEBUG ) {
print '# ', $^X, ' ', $], "\n";
if ( my $uname = `uname -a` ) {
$uname =~ s/\s+/ /g;
print "# $uname\n";
}
print '# Arguments: ',
join(' ', map { my $a = "_[$_]_"; $a =~ s/\n/\n# /g; $a; } @ARGV), "\n";
}
1; 1;
} }
# ########################################################################### # ###########################################################################

View File

@@ -148,6 +148,11 @@ sub get_specs {
$self->{DSNParser} = DSNParser->new(opts => \@dsn_opts); $self->{DSNParser} = DSNParser->new(opts => \@dsn_opts);
} }
if ( $contents =~ m/^(Percona Toolkit v.+)$/m ) {
$self->{version} = $1;
MKDEBUG && _d($self->{version});
}
return; return;
} }
@@ -472,9 +477,12 @@ sub get_opts {
) or $self->save_error('Error parsing options'); ) or $self->save_error('Error parsing options');
if ( exists $self->{opts}->{version} && $self->{opts}->{version}->{got} ) { if ( exists $self->{opts}->{version} && $self->{opts}->{version}->{got} ) {
printf("%s Ver %s Distrib %s Changeset %s\n", if ( $self->{version} ) {
$self->{program_name}, $main::VERSION, $main::DISTRIB, $main::SVN_REV) print $self->{version}, "\n";
or die "Cannot print: $OS_ERROR"; }
else {
print "Error parsing version. See the VERSION section of the tool's documentation.\n";
}
exit 0; exit 0;
} }
@@ -855,20 +863,6 @@ sub prompt_noecho {
return $response; return $response;
} }
if ( MKDEBUG ) {
print '# ', $^X, ' ', $], "\n";
my $uname = `uname -a`;
if ( $uname ) {
$uname =~ s/\s+/ /g;
print "# $uname\n";
}
printf("# %s Ver %s Distrib %s Changeset %s line %d\n",
$PROGRAM_NAME, ($main::VERSION || ''), ($main::DISTRIB || ''),
($main::SVN_REV || ''), __LINE__);
print('# Arguments: ',
join(' ', map { my $a = "_[$_]_"; $a =~ s/\n/\n# /g; $a; } @ARGV), "\n");
}
sub _read_config_file { sub _read_config_file {
my ( $self, $filename ) = @_; my ( $self, $filename ) = @_;
open my $fh, "<", $filename or die "Cannot open $filename: $OS_ERROR\n"; open my $fh, "<", $filename or die "Cannot open $filename: $OS_ERROR\n";
@@ -1023,6 +1017,16 @@ sub _d {
print STDERR "# $package:$line $PID ", join(' ', @_), "\n"; print STDERR "# $package:$line $PID ", join(' ', @_), "\n";
} }
if ( MKDEBUG ) {
print '# ', $^X, ' ', $], "\n";
if ( my $uname = `uname -a` ) {
$uname =~ s/\s+/ /g;
print "# $uname\n";
}
print '# Arguments: ',
join(' ', map { my $a = "_[$_]_"; $a =~ s/\n/\n# /g; $a; } @ARGV), "\n";
}
1; 1;
} }
# ########################################################################### # ###########################################################################

View File

@@ -761,6 +761,11 @@ sub get_specs {
$self->{DSNParser} = DSNParser->new(opts => \@dsn_opts); $self->{DSNParser} = DSNParser->new(opts => \@dsn_opts);
} }
if ( $contents =~ m/^(Percona Toolkit v.+)$/m ) {
$self->{version} = $1;
MKDEBUG && _d($self->{version});
}
return; return;
} }
@@ -1085,9 +1090,12 @@ sub get_opts {
) or $self->save_error('Error parsing options'); ) or $self->save_error('Error parsing options');
if ( exists $self->{opts}->{version} && $self->{opts}->{version}->{got} ) { if ( exists $self->{opts}->{version} && $self->{opts}->{version}->{got} ) {
printf("%s Ver %s Distrib %s Changeset %s\n", if ( $self->{version} ) {
$self->{program_name}, $main::VERSION, $main::DISTRIB, $main::SVN_REV) print $self->{version}, "\n";
or die "Cannot print: $OS_ERROR"; }
else {
print "Error parsing version. See the VERSION section of the tool's documentation.\n";
}
exit 0; exit 0;
} }
@@ -1468,20 +1476,6 @@ sub prompt_noecho {
return $response; return $response;
} }
if ( MKDEBUG ) {
print '# ', $^X, ' ', $], "\n";
my $uname = `uname -a`;
if ( $uname ) {
$uname =~ s/\s+/ /g;
print "# $uname\n";
}
printf("# %s Ver %s Distrib %s Changeset %s line %d\n",
$PROGRAM_NAME, ($main::VERSION || ''), ($main::DISTRIB || ''),
($main::SVN_REV || ''), __LINE__);
print('# Arguments: ',
join(' ', map { my $a = "_[$_]_"; $a =~ s/\n/\n# /g; $a; } @ARGV), "\n");
}
sub _read_config_file { sub _read_config_file {
my ( $self, $filename ) = @_; my ( $self, $filename ) = @_;
open my $fh, "<", $filename or die "Cannot open $filename: $OS_ERROR\n"; open my $fh, "<", $filename or die "Cannot open $filename: $OS_ERROR\n";
@@ -1636,6 +1630,16 @@ sub _d {
print STDERR "# $package:$line $PID ", join(' ', @_), "\n"; print STDERR "# $package:$line $PID ", join(' ', @_), "\n";
} }
if ( MKDEBUG ) {
print '# ', $^X, ' ', $], "\n";
if ( my $uname = `uname -a` ) {
$uname =~ s/\s+/ /g;
print "# $uname\n";
}
print '# Arguments: ',
join(' ', map { my $a = "_[$_]_"; $a =~ s/\n/\n# /g; $a; } @ARGV), "\n";
}
1; 1;
} }
# ########################################################################### # ###########################################################################

View File

@@ -581,6 +581,11 @@ sub get_specs {
$self->{DSNParser} = DSNParser->new(opts => \@dsn_opts); $self->{DSNParser} = DSNParser->new(opts => \@dsn_opts);
} }
if ( $contents =~ m/^(Percona Toolkit v.+)$/m ) {
$self->{version} = $1;
MKDEBUG && _d($self->{version});
}
return; return;
} }
@@ -905,9 +910,12 @@ sub get_opts {
) or $self->save_error('Error parsing options'); ) or $self->save_error('Error parsing options');
if ( exists $self->{opts}->{version} && $self->{opts}->{version}->{got} ) { if ( exists $self->{opts}->{version} && $self->{opts}->{version}->{got} ) {
printf("%s Ver %s Distrib %s Changeset %s\n", if ( $self->{version} ) {
$self->{program_name}, $main::VERSION, $main::DISTRIB, $main::SVN_REV) print $self->{version}, "\n";
or die "Cannot print: $OS_ERROR"; }
else {
print "Error parsing version. See the VERSION section of the tool's documentation.\n";
}
exit 0; exit 0;
} }
@@ -1288,20 +1296,6 @@ sub prompt_noecho {
return $response; return $response;
} }
if ( MKDEBUG ) {
print '# ', $^X, ' ', $], "\n";
my $uname = `uname -a`;
if ( $uname ) {
$uname =~ s/\s+/ /g;
print "# $uname\n";
}
printf("# %s Ver %s Distrib %s Changeset %s line %d\n",
$PROGRAM_NAME, ($main::VERSION || ''), ($main::DISTRIB || ''),
($main::SVN_REV || ''), __LINE__);
print('# Arguments: ',
join(' ', map { my $a = "_[$_]_"; $a =~ s/\n/\n# /g; $a; } @ARGV), "\n");
}
sub _read_config_file { sub _read_config_file {
my ( $self, $filename ) = @_; my ( $self, $filename ) = @_;
open my $fh, "<", $filename or die "Cannot open $filename: $OS_ERROR\n"; open my $fh, "<", $filename or die "Cannot open $filename: $OS_ERROR\n";
@@ -1456,6 +1450,16 @@ sub _d {
print STDERR "# $package:$line $PID ", join(' ', @_), "\n"; print STDERR "# $package:$line $PID ", join(' ', @_), "\n";
} }
if ( MKDEBUG ) {
print '# ', $^X, ' ', $], "\n";
if ( my $uname = `uname -a` ) {
$uname =~ s/\s+/ /g;
print "# $uname\n";
}
print '# Arguments: ',
join(' ', map { my $a = "_[$_]_"; $a =~ s/\n/\n# /g; $a; } @ARGV), "\n";
}
1; 1;
} }
# ########################################################################### # ###########################################################################

View File

@@ -148,6 +148,11 @@ sub get_specs {
$self->{DSNParser} = DSNParser->new(opts => \@dsn_opts); $self->{DSNParser} = DSNParser->new(opts => \@dsn_opts);
} }
if ( $contents =~ m/^(Percona Toolkit v.+)$/m ) {
$self->{version} = $1;
MKDEBUG && _d($self->{version});
}
return; return;
} }
@@ -472,9 +477,12 @@ sub get_opts {
) or $self->save_error('Error parsing options'); ) or $self->save_error('Error parsing options');
if ( exists $self->{opts}->{version} && $self->{opts}->{version}->{got} ) { if ( exists $self->{opts}->{version} && $self->{opts}->{version}->{got} ) {
printf("%s Ver %s Distrib %s Changeset %s\n", if ( $self->{version} ) {
$self->{program_name}, $main::VERSION, $main::DISTRIB, $main::SVN_REV) print $self->{version}, "\n";
or die "Cannot print: $OS_ERROR"; }
else {
print "Error parsing version. See the VERSION section of the tool's documentation.\n";
}
exit 0; exit 0;
} }
@@ -855,20 +863,6 @@ sub prompt_noecho {
return $response; return $response;
} }
if ( MKDEBUG ) {
print '# ', $^X, ' ', $], "\n";
my $uname = `uname -a`;
if ( $uname ) {
$uname =~ s/\s+/ /g;
print "# $uname\n";
}
printf("# %s Ver %s Distrib %s Changeset %s line %d\n",
$PROGRAM_NAME, ($main::VERSION || ''), ($main::DISTRIB || ''),
($main::SVN_REV || ''), __LINE__);
print('# Arguments: ',
join(' ', map { my $a = "_[$_]_"; $a =~ s/\n/\n# /g; $a; } @ARGV), "\n");
}
sub _read_config_file { sub _read_config_file {
my ( $self, $filename ) = @_; my ( $self, $filename ) = @_;
open my $fh, "<", $filename or die "Cannot open $filename: $OS_ERROR\n"; open my $fh, "<", $filename or die "Cannot open $filename: $OS_ERROR\n";
@@ -1023,6 +1017,16 @@ sub _d {
print STDERR "# $package:$line $PID ", join(' ', @_), "\n"; print STDERR "# $package:$line $PID ", join(' ', @_), "\n";
} }
if ( MKDEBUG ) {
print '# ', $^X, ' ', $], "\n";
if ( my $uname = `uname -a` ) {
$uname =~ s/\s+/ /g;
print "# $uname\n";
}
print '# Arguments: ',
join(' ', map { my $a = "_[$_]_"; $a =~ s/\n/\n# /g; $a; } @ARGV), "\n";
}
1; 1;
} }
# ########################################################################### # ###########################################################################

View File

@@ -148,6 +148,11 @@ sub get_specs {
$self->{DSNParser} = DSNParser->new(opts => \@dsn_opts); $self->{DSNParser} = DSNParser->new(opts => \@dsn_opts);
} }
if ( $contents =~ m/^(Percona Toolkit v.+)$/m ) {
$self->{version} = $1;
MKDEBUG && _d($self->{version});
}
return; return;
} }
@@ -472,9 +477,12 @@ sub get_opts {
) or $self->save_error('Error parsing options'); ) or $self->save_error('Error parsing options');
if ( exists $self->{opts}->{version} && $self->{opts}->{version}->{got} ) { if ( exists $self->{opts}->{version} && $self->{opts}->{version}->{got} ) {
printf("%s Ver %s Distrib %s Changeset %s\n", if ( $self->{version} ) {
$self->{program_name}, $main::VERSION, $main::DISTRIB, $main::SVN_REV) print $self->{version}, "\n";
or die "Cannot print: $OS_ERROR"; }
else {
print "Error parsing version. See the VERSION section of the tool's documentation.\n";
}
exit 0; exit 0;
} }
@@ -855,20 +863,6 @@ sub prompt_noecho {
return $response; return $response;
} }
if ( MKDEBUG ) {
print '# ', $^X, ' ', $], "\n";
my $uname = `uname -a`;
if ( $uname ) {
$uname =~ s/\s+/ /g;
print "# $uname\n";
}
printf("# %s Ver %s Distrib %s Changeset %s line %d\n",
$PROGRAM_NAME, ($main::VERSION || ''), ($main::DISTRIB || ''),
($main::SVN_REV || ''), __LINE__);
print('# Arguments: ',
join(' ', map { my $a = "_[$_]_"; $a =~ s/\n/\n# /g; $a; } @ARGV), "\n");
}
sub _read_config_file { sub _read_config_file {
my ( $self, $filename ) = @_; my ( $self, $filename ) = @_;
open my $fh, "<", $filename or die "Cannot open $filename: $OS_ERROR\n"; open my $fh, "<", $filename or die "Cannot open $filename: $OS_ERROR\n";
@@ -1023,6 +1017,16 @@ sub _d {
print STDERR "# $package:$line $PID ", join(' ', @_), "\n"; print STDERR "# $package:$line $PID ", join(' ', @_), "\n";
} }
if ( MKDEBUG ) {
print '# ', $^X, ' ', $], "\n";
if ( my $uname = `uname -a` ) {
$uname =~ s/\s+/ /g;
print "# $uname\n";
}
print '# Arguments: ',
join(' ', map { my $a = "_[$_]_"; $a =~ s/\n/\n# /g; $a; } @ARGV), "\n";
}
1; 1;
} }
# ########################################################################### # ###########################################################################

View File

@@ -148,6 +148,11 @@ sub get_specs {
$self->{DSNParser} = DSNParser->new(opts => \@dsn_opts); $self->{DSNParser} = DSNParser->new(opts => \@dsn_opts);
} }
if ( $contents =~ m/^(Percona Toolkit v.+)$/m ) {
$self->{version} = $1;
MKDEBUG && _d($self->{version});
}
return; return;
} }
@@ -472,9 +477,12 @@ sub get_opts {
) or $self->save_error('Error parsing options'); ) or $self->save_error('Error parsing options');
if ( exists $self->{opts}->{version} && $self->{opts}->{version}->{got} ) { if ( exists $self->{opts}->{version} && $self->{opts}->{version}->{got} ) {
printf("%s Ver %s Distrib %s Changeset %s\n", if ( $self->{version} ) {
$self->{program_name}, $main::VERSION, $main::DISTRIB, $main::SVN_REV) print $self->{version}, "\n";
or die "Cannot print: $OS_ERROR"; }
else {
print "Error parsing version. See the VERSION section of the tool's documentation.\n";
}
exit 0; exit 0;
} }
@@ -855,20 +863,6 @@ sub prompt_noecho {
return $response; return $response;
} }
if ( MKDEBUG ) {
print '# ', $^X, ' ', $], "\n";
my $uname = `uname -a`;
if ( $uname ) {
$uname =~ s/\s+/ /g;
print "# $uname\n";
}
printf("# %s Ver %s Distrib %s Changeset %s line %d\n",
$PROGRAM_NAME, ($main::VERSION || ''), ($main::DISTRIB || ''),
($main::SVN_REV || ''), __LINE__);
print('# Arguments: ',
join(' ', map { my $a = "_[$_]_"; $a =~ s/\n/\n# /g; $a; } @ARGV), "\n");
}
sub _read_config_file { sub _read_config_file {
my ( $self, $filename ) = @_; my ( $self, $filename ) = @_;
open my $fh, "<", $filename or die "Cannot open $filename: $OS_ERROR\n"; open my $fh, "<", $filename or die "Cannot open $filename: $OS_ERROR\n";
@@ -1023,6 +1017,16 @@ sub _d {
print STDERR "# $package:$line $PID ", join(' ', @_), "\n"; print STDERR "# $package:$line $PID ", join(' ', @_), "\n";
} }
if ( MKDEBUG ) {
print '# ', $^X, ' ', $], "\n";
if ( my $uname = `uname -a` ) {
$uname =~ s/\s+/ /g;
print "# $uname\n";
}
print '# Arguments: ',
join(' ', map { my $a = "_[$_]_"; $a =~ s/\n/\n# /g; $a; } @ARGV), "\n";
}
1; 1;
} }
# ########################################################################### # ###########################################################################

View File

@@ -504,6 +504,11 @@ sub get_specs {
$self->{DSNParser} = DSNParser->new(opts => \@dsn_opts); $self->{DSNParser} = DSNParser->new(opts => \@dsn_opts);
} }
if ( $contents =~ m/^(Percona Toolkit v.+)$/m ) {
$self->{version} = $1;
MKDEBUG && _d($self->{version});
}
return; return;
} }
@@ -828,9 +833,12 @@ sub get_opts {
) or $self->save_error('Error parsing options'); ) or $self->save_error('Error parsing options');
if ( exists $self->{opts}->{version} && $self->{opts}->{version}->{got} ) { if ( exists $self->{opts}->{version} && $self->{opts}->{version}->{got} ) {
printf("%s Ver %s Distrib %s Changeset %s\n", if ( $self->{version} ) {
$self->{program_name}, $main::VERSION, $main::DISTRIB, $main::SVN_REV) print $self->{version}, "\n";
or die "Cannot print: $OS_ERROR"; }
else {
print "Error parsing version. See the VERSION section of the tool's documentation.\n";
}
exit 0; exit 0;
} }
@@ -1211,20 +1219,6 @@ sub prompt_noecho {
return $response; return $response;
} }
if ( MKDEBUG ) {
print '# ', $^X, ' ', $], "\n";
my $uname = `uname -a`;
if ( $uname ) {
$uname =~ s/\s+/ /g;
print "# $uname\n";
}
printf("# %s Ver %s Distrib %s Changeset %s line %d\n",
$PROGRAM_NAME, ($main::VERSION || ''), ($main::DISTRIB || ''),
($main::SVN_REV || ''), __LINE__);
print('# Arguments: ',
join(' ', map { my $a = "_[$_]_"; $a =~ s/\n/\n# /g; $a; } @ARGV), "\n");
}
sub _read_config_file { sub _read_config_file {
my ( $self, $filename ) = @_; my ( $self, $filename ) = @_;
open my $fh, "<", $filename or die "Cannot open $filename: $OS_ERROR\n"; open my $fh, "<", $filename or die "Cannot open $filename: $OS_ERROR\n";
@@ -1379,6 +1373,16 @@ sub _d {
print STDERR "# $package:$line $PID ", join(' ', @_), "\n"; print STDERR "# $package:$line $PID ", join(' ', @_), "\n";
} }
if ( MKDEBUG ) {
print '# ', $^X, ' ', $], "\n";
if ( my $uname = `uname -a` ) {
$uname =~ s/\s+/ /g;
print "# $uname\n";
}
print '# Arguments: ',
join(' ', map { my $a = "_[$_]_"; $a =~ s/\n/\n# /g; $a; } @ARGV), "\n";
}
1; 1;
} }
# ########################################################################### # ###########################################################################

View File

@@ -581,6 +581,11 @@ sub get_specs {
$self->{DSNParser} = DSNParser->new(opts => \@dsn_opts); $self->{DSNParser} = DSNParser->new(opts => \@dsn_opts);
} }
if ( $contents =~ m/^(Percona Toolkit v.+)$/m ) {
$self->{version} = $1;
MKDEBUG && _d($self->{version});
}
return; return;
} }
@@ -905,9 +910,12 @@ sub get_opts {
) or $self->save_error('Error parsing options'); ) or $self->save_error('Error parsing options');
if ( exists $self->{opts}->{version} && $self->{opts}->{version}->{got} ) { if ( exists $self->{opts}->{version} && $self->{opts}->{version}->{got} ) {
printf("%s Ver %s Distrib %s Changeset %s\n", if ( $self->{version} ) {
$self->{program_name}, $main::VERSION, $main::DISTRIB, $main::SVN_REV) print $self->{version}, "\n";
or die "Cannot print: $OS_ERROR"; }
else {
print "Error parsing version. See the VERSION section of the tool's documentation.\n";
}
exit 0; exit 0;
} }
@@ -1288,20 +1296,6 @@ sub prompt_noecho {
return $response; return $response;
} }
if ( MKDEBUG ) {
print '# ', $^X, ' ', $], "\n";
my $uname = `uname -a`;
if ( $uname ) {
$uname =~ s/\s+/ /g;
print "# $uname\n";
}
printf("# %s Ver %s Distrib %s Changeset %s line %d\n",
$PROGRAM_NAME, ($main::VERSION || ''), ($main::DISTRIB || ''),
($main::SVN_REV || ''), __LINE__);
print('# Arguments: ',
join(' ', map { my $a = "_[$_]_"; $a =~ s/\n/\n# /g; $a; } @ARGV), "\n");
}
sub _read_config_file { sub _read_config_file {
my ( $self, $filename ) = @_; my ( $self, $filename ) = @_;
open my $fh, "<", $filename or die "Cannot open $filename: $OS_ERROR\n"; open my $fh, "<", $filename or die "Cannot open $filename: $OS_ERROR\n";
@@ -1456,6 +1450,16 @@ sub _d {
print STDERR "# $package:$line $PID ", join(' ', @_), "\n"; print STDERR "# $package:$line $PID ", join(' ', @_), "\n";
} }
if ( MKDEBUG ) {
print '# ', $^X, ' ', $], "\n";
if ( my $uname = `uname -a` ) {
$uname =~ s/\s+/ /g;
print "# $uname\n";
}
print '# Arguments: ',
join(' ', map { my $a = "_[$_]_"; $a =~ s/\n/\n# /g; $a; } @ARGV), "\n";
}
1; 1;
} }
# ########################################################################### # ###########################################################################

View File

@@ -148,6 +148,11 @@ sub get_specs {
$self->{DSNParser} = DSNParser->new(opts => \@dsn_opts); $self->{DSNParser} = DSNParser->new(opts => \@dsn_opts);
} }
if ( $contents =~ m/^(Percona Toolkit v.+)$/m ) {
$self->{version} = $1;
MKDEBUG && _d($self->{version});
}
return; return;
} }
@@ -472,9 +477,12 @@ sub get_opts {
) or $self->save_error('Error parsing options'); ) or $self->save_error('Error parsing options');
if ( exists $self->{opts}->{version} && $self->{opts}->{version}->{got} ) { if ( exists $self->{opts}->{version} && $self->{opts}->{version}->{got} ) {
printf("%s Ver %s Distrib %s Changeset %s\n", if ( $self->{version} ) {
$self->{program_name}, $main::VERSION, $main::DISTRIB, $main::SVN_REV) print $self->{version}, "\n";
or die "Cannot print: $OS_ERROR"; }
else {
print "Error parsing version. See the VERSION section of the tool's documentation.\n";
}
exit 0; exit 0;
} }
@@ -855,20 +863,6 @@ sub prompt_noecho {
return $response; return $response;
} }
if ( MKDEBUG ) {
print '# ', $^X, ' ', $], "\n";
my $uname = `uname -a`;
if ( $uname ) {
$uname =~ s/\s+/ /g;
print "# $uname\n";
}
printf("# %s Ver %s Distrib %s Changeset %s line %d\n",
$PROGRAM_NAME, ($main::VERSION || ''), ($main::DISTRIB || ''),
($main::SVN_REV || ''), __LINE__);
print('# Arguments: ',
join(' ', map { my $a = "_[$_]_"; $a =~ s/\n/\n# /g; $a; } @ARGV), "\n");
}
sub _read_config_file { sub _read_config_file {
my ( $self, $filename ) = @_; my ( $self, $filename ) = @_;
open my $fh, "<", $filename or die "Cannot open $filename: $OS_ERROR\n"; open my $fh, "<", $filename or die "Cannot open $filename: $OS_ERROR\n";
@@ -1023,6 +1017,16 @@ sub _d {
print STDERR "# $package:$line $PID ", join(' ', @_), "\n"; print STDERR "# $package:$line $PID ", join(' ', @_), "\n";
} }
if ( MKDEBUG ) {
print '# ', $^X, ' ', $], "\n";
if ( my $uname = `uname -a` ) {
$uname =~ s/\s+/ /g;
print "# $uname\n";
}
print '# Arguments: ',
join(' ', map { my $a = "_[$_]_"; $a =~ s/\n/\n# /g; $a; } @ARGV), "\n";
}
1; 1;
} }
# ########################################################################### # ###########################################################################

View File

@@ -148,6 +148,11 @@ sub get_specs {
$self->{DSNParser} = DSNParser->new(opts => \@dsn_opts); $self->{DSNParser} = DSNParser->new(opts => \@dsn_opts);
} }
if ( $contents =~ m/^(Percona Toolkit v.+)$/m ) {
$self->{version} = $1;
MKDEBUG && _d($self->{version});
}
return; return;
} }
@@ -472,9 +477,12 @@ sub get_opts {
) or $self->save_error('Error parsing options'); ) or $self->save_error('Error parsing options');
if ( exists $self->{opts}->{version} && $self->{opts}->{version}->{got} ) { if ( exists $self->{opts}->{version} && $self->{opts}->{version}->{got} ) {
printf("%s Ver %s Distrib %s Changeset %s\n", if ( $self->{version} ) {
$self->{program_name}, $main::VERSION, $main::DISTRIB, $main::SVN_REV) print $self->{version}, "\n";
or die "Cannot print: $OS_ERROR"; }
else {
print "Error parsing version. See the VERSION section of the tool's documentation.\n";
}
exit 0; exit 0;
} }
@@ -855,20 +863,6 @@ sub prompt_noecho {
return $response; return $response;
} }
if ( MKDEBUG ) {
print '# ', $^X, ' ', $], "\n";
my $uname = `uname -a`;
if ( $uname ) {
$uname =~ s/\s+/ /g;
print "# $uname\n";
}
printf("# %s Ver %s Distrib %s Changeset %s line %d\n",
$PROGRAM_NAME, ($main::VERSION || ''), ($main::DISTRIB || ''),
($main::SVN_REV || ''), __LINE__);
print('# Arguments: ',
join(' ', map { my $a = "_[$_]_"; $a =~ s/\n/\n# /g; $a; } @ARGV), "\n");
}
sub _read_config_file { sub _read_config_file {
my ( $self, $filename ) = @_; my ( $self, $filename ) = @_;
open my $fh, "<", $filename or die "Cannot open $filename: $OS_ERROR\n"; open my $fh, "<", $filename or die "Cannot open $filename: $OS_ERROR\n";
@@ -1023,6 +1017,16 @@ sub _d {
print STDERR "# $package:$line $PID ", join(' ', @_), "\n"; print STDERR "# $package:$line $PID ", join(' ', @_), "\n";
} }
if ( MKDEBUG ) {
print '# ', $^X, ' ', $], "\n";
if ( my $uname = `uname -a` ) {
$uname =~ s/\s+/ /g;
print "# $uname\n";
}
print '# Arguments: ',
join(' ', map { my $a = "_[$_]_"; $a =~ s/\n/\n# /g; $a; } @ARGV), "\n";
}
1; 1;
} }
# ########################################################################### # ###########################################################################

View File

@@ -148,6 +148,11 @@ sub get_specs {
$self->{DSNParser} = DSNParser->new(opts => \@dsn_opts); $self->{DSNParser} = DSNParser->new(opts => \@dsn_opts);
} }
if ( $contents =~ m/^(Percona Toolkit v.+)$/m ) {
$self->{version} = $1;
MKDEBUG && _d($self->{version});
}
return; return;
} }
@@ -472,9 +477,12 @@ sub get_opts {
) or $self->save_error('Error parsing options'); ) or $self->save_error('Error parsing options');
if ( exists $self->{opts}->{version} && $self->{opts}->{version}->{got} ) { if ( exists $self->{opts}->{version} && $self->{opts}->{version}->{got} ) {
printf("%s Ver %s Distrib %s Changeset %s\n", if ( $self->{version} ) {
$self->{program_name}, $main::VERSION, $main::DISTRIB, $main::SVN_REV) print $self->{version}, "\n";
or die "Cannot print: $OS_ERROR"; }
else {
print "Error parsing version. See the VERSION section of the tool's documentation.\n";
}
exit 0; exit 0;
} }
@@ -855,20 +863,6 @@ sub prompt_noecho {
return $response; return $response;
} }
if ( MKDEBUG ) {
print '# ', $^X, ' ', $], "\n";
my $uname = `uname -a`;
if ( $uname ) {
$uname =~ s/\s+/ /g;
print "# $uname\n";
}
printf("# %s Ver %s Distrib %s Changeset %s line %d\n",
$PROGRAM_NAME, ($main::VERSION || ''), ($main::DISTRIB || ''),
($main::SVN_REV || ''), __LINE__);
print('# Arguments: ',
join(' ', map { my $a = "_[$_]_"; $a =~ s/\n/\n# /g; $a; } @ARGV), "\n");
}
sub _read_config_file { sub _read_config_file {
my ( $self, $filename ) = @_; my ( $self, $filename ) = @_;
open my $fh, "<", $filename or die "Cannot open $filename: $OS_ERROR\n"; open my $fh, "<", $filename or die "Cannot open $filename: $OS_ERROR\n";
@@ -1023,6 +1017,16 @@ sub _d {
print STDERR "# $package:$line $PID ", join(' ', @_), "\n"; print STDERR "# $package:$line $PID ", join(' ', @_), "\n";
} }
if ( MKDEBUG ) {
print '# ', $^X, ' ', $], "\n";
if ( my $uname = `uname -a` ) {
$uname =~ s/\s+/ /g;
print "# $uname\n";
}
print '# Arguments: ',
join(' ', map { my $a = "_[$_]_"; $a =~ s/\n/\n# /g; $a; } @ARGV), "\n";
}
1; 1;
} }
# ########################################################################### # ###########################################################################

View File

@@ -225,6 +225,11 @@ sub get_specs {
$self->{DSNParser} = DSNParser->new(opts => \@dsn_opts); $self->{DSNParser} = DSNParser->new(opts => \@dsn_opts);
} }
if ( $contents =~ m/^(Percona Toolkit v.+)$/m ) {
$self->{version} = $1;
MKDEBUG && _d($self->{version});
}
return; return;
} }
@@ -549,9 +554,12 @@ sub get_opts {
) or $self->save_error('Error parsing options'); ) or $self->save_error('Error parsing options');
if ( exists $self->{opts}->{version} && $self->{opts}->{version}->{got} ) { if ( exists $self->{opts}->{version} && $self->{opts}->{version}->{got} ) {
printf("%s Ver %s Distrib %s Changeset %s\n", if ( $self->{version} ) {
$self->{program_name}, $main::VERSION, $main::DISTRIB, $main::SVN_REV) print $self->{version}, "\n";
or die "Cannot print: $OS_ERROR"; }
else {
print "Error parsing version. See the VERSION section of the tool's documentation.\n";
}
exit 0; exit 0;
} }
@@ -932,20 +940,6 @@ sub prompt_noecho {
return $response; return $response;
} }
if ( MKDEBUG ) {
print '# ', $^X, ' ', $], "\n";
my $uname = `uname -a`;
if ( $uname ) {
$uname =~ s/\s+/ /g;
print "# $uname\n";
}
printf("# %s Ver %s Distrib %s Changeset %s line %d\n",
$PROGRAM_NAME, ($main::VERSION || ''), ($main::DISTRIB || ''),
($main::SVN_REV || ''), __LINE__);
print('# Arguments: ',
join(' ', map { my $a = "_[$_]_"; $a =~ s/\n/\n# /g; $a; } @ARGV), "\n");
}
sub _read_config_file { sub _read_config_file {
my ( $self, $filename ) = @_; my ( $self, $filename ) = @_;
open my $fh, "<", $filename or die "Cannot open $filename: $OS_ERROR\n"; open my $fh, "<", $filename or die "Cannot open $filename: $OS_ERROR\n";
@@ -1100,6 +1094,16 @@ sub _d {
print STDERR "# $package:$line $PID ", join(' ', @_), "\n"; print STDERR "# $package:$line $PID ", join(' ', @_), "\n";
} }
if ( MKDEBUG ) {
print '# ', $^X, ' ', $], "\n";
if ( my $uname = `uname -a` ) {
$uname =~ s/\s+/ /g;
print "# $uname\n";
}
print '# Arguments: ',
join(' ', map { my $a = "_[$_]_"; $a =~ s/\n/\n# /g; $a; } @ARGV), "\n";
}
1; 1;
} }
# ########################################################################### # ###########################################################################

View File

@@ -932,6 +932,11 @@ sub get_specs {
$self->{DSNParser} = DSNParser->new(opts => \@dsn_opts); $self->{DSNParser} = DSNParser->new(opts => \@dsn_opts);
} }
if ( $contents =~ m/^(Percona Toolkit v.+)$/m ) {
$self->{version} = $1;
MKDEBUG && _d($self->{version});
}
return; return;
} }
@@ -1256,9 +1261,12 @@ sub get_opts {
) or $self->save_error('Error parsing options'); ) or $self->save_error('Error parsing options');
if ( exists $self->{opts}->{version} && $self->{opts}->{version}->{got} ) { if ( exists $self->{opts}->{version} && $self->{opts}->{version}->{got} ) {
printf("%s Ver %s Distrib %s Changeset %s\n", if ( $self->{version} ) {
$self->{program_name}, $main::VERSION, $main::DISTRIB, $main::SVN_REV) print $self->{version}, "\n";
or die "Cannot print: $OS_ERROR"; }
else {
print "Error parsing version. See the VERSION section of the tool's documentation.\n";
}
exit 0; exit 0;
} }
@@ -1639,20 +1647,6 @@ sub prompt_noecho {
return $response; return $response;
} }
if ( MKDEBUG ) {
print '# ', $^X, ' ', $], "\n";
my $uname = `uname -a`;
if ( $uname ) {
$uname =~ s/\s+/ /g;
print "# $uname\n";
}
printf("# %s Ver %s Distrib %s Changeset %s line %d\n",
$PROGRAM_NAME, ($main::VERSION || ''), ($main::DISTRIB || ''),
($main::SVN_REV || ''), __LINE__);
print('# Arguments: ',
join(' ', map { my $a = "_[$_]_"; $a =~ s/\n/\n# /g; $a; } @ARGV), "\n");
}
sub _read_config_file { sub _read_config_file {
my ( $self, $filename ) = @_; my ( $self, $filename ) = @_;
open my $fh, "<", $filename or die "Cannot open $filename: $OS_ERROR\n"; open my $fh, "<", $filename or die "Cannot open $filename: $OS_ERROR\n";
@@ -1807,6 +1801,16 @@ sub _d {
print STDERR "# $package:$line $PID ", join(' ', @_), "\n"; print STDERR "# $package:$line $PID ", join(' ', @_), "\n";
} }
if ( MKDEBUG ) {
print '# ', $^X, ' ', $], "\n";
if ( my $uname = `uname -a` ) {
$uname =~ s/\s+/ /g;
print "# $uname\n";
}
print '# Arguments: ',
join(' ', map { my $a = "_[$_]_"; $a =~ s/\n/\n# /g; $a; } @ARGV), "\n";
}
1; 1;
} }
# ########################################################################### # ###########################################################################

View File

@@ -148,6 +148,11 @@ sub get_specs {
$self->{DSNParser} = DSNParser->new(opts => \@dsn_opts); $self->{DSNParser} = DSNParser->new(opts => \@dsn_opts);
} }
if ( $contents =~ m/^(Percona Toolkit v.+)$/m ) {
$self->{version} = $1;
MKDEBUG && _d($self->{version});
}
return; return;
} }
@@ -472,9 +477,12 @@ sub get_opts {
) or $self->save_error('Error parsing options'); ) or $self->save_error('Error parsing options');
if ( exists $self->{opts}->{version} && $self->{opts}->{version}->{got} ) { if ( exists $self->{opts}->{version} && $self->{opts}->{version}->{got} ) {
printf("%s Ver %s Distrib %s Changeset %s\n", if ( $self->{version} ) {
$self->{program_name}, $main::VERSION, $main::DISTRIB, $main::SVN_REV) print $self->{version}, "\n";
or die "Cannot print: $OS_ERROR"; }
else {
print "Error parsing version. See the VERSION section of the tool's documentation.\n";
}
exit 0; exit 0;
} }
@@ -855,20 +863,6 @@ sub prompt_noecho {
return $response; return $response;
} }
if ( MKDEBUG ) {
print '# ', $^X, ' ', $], "\n";
my $uname = `uname -a`;
if ( $uname ) {
$uname =~ s/\s+/ /g;
print "# $uname\n";
}
printf("# %s Ver %s Distrib %s Changeset %s line %d\n",
$PROGRAM_NAME, ($main::VERSION || ''), ($main::DISTRIB || ''),
($main::SVN_REV || ''), __LINE__);
print('# Arguments: ',
join(' ', map { my $a = "_[$_]_"; $a =~ s/\n/\n# /g; $a; } @ARGV), "\n");
}
sub _read_config_file { sub _read_config_file {
my ( $self, $filename ) = @_; my ( $self, $filename ) = @_;
open my $fh, "<", $filename or die "Cannot open $filename: $OS_ERROR\n"; open my $fh, "<", $filename or die "Cannot open $filename: $OS_ERROR\n";
@@ -1023,6 +1017,16 @@ sub _d {
print STDERR "# $package:$line $PID ", join(' ', @_), "\n"; print STDERR "# $package:$line $PID ", join(' ', @_), "\n";
} }
if ( MKDEBUG ) {
print '# ', $^X, ' ', $], "\n";
if ( my $uname = `uname -a` ) {
$uname =~ s/\s+/ /g;
print "# $uname\n";
}
print '# Arguments: ',
join(' ', map { my $a = "_[$_]_"; $a =~ s/\n/\n# /g; $a; } @ARGV), "\n";
}
1; 1;
} }
# ########################################################################### # ###########################################################################

View File

@@ -148,6 +148,11 @@ sub get_specs {
$self->{DSNParser} = DSNParser->new(opts => \@dsn_opts); $self->{DSNParser} = DSNParser->new(opts => \@dsn_opts);
} }
if ( $contents =~ m/^(Percona Toolkit v.+)$/m ) {
$self->{version} = $1;
MKDEBUG && _d($self->{version});
}
return; return;
} }
@@ -472,9 +477,12 @@ sub get_opts {
) or $self->save_error('Error parsing options'); ) or $self->save_error('Error parsing options');
if ( exists $self->{opts}->{version} && $self->{opts}->{version}->{got} ) { if ( exists $self->{opts}->{version} && $self->{opts}->{version}->{got} ) {
printf("%s Ver %s Distrib %s Changeset %s\n", if ( $self->{version} ) {
$self->{program_name}, $main::VERSION, $main::DISTRIB, $main::SVN_REV) print $self->{version}, "\n";
or die "Cannot print: $OS_ERROR"; }
else {
print "Error parsing version. See the VERSION section of the tool's documentation.\n";
}
exit 0; exit 0;
} }
@@ -855,20 +863,6 @@ sub prompt_noecho {
return $response; return $response;
} }
if ( MKDEBUG ) {
print '# ', $^X, ' ', $], "\n";
my $uname = `uname -a`;
if ( $uname ) {
$uname =~ s/\s+/ /g;
print "# $uname\n";
}
printf("# %s Ver %s Distrib %s Changeset %s line %d\n",
$PROGRAM_NAME, ($main::VERSION || ''), ($main::DISTRIB || ''),
($main::SVN_REV || ''), __LINE__);
print('# Arguments: ',
join(' ', map { my $a = "_[$_]_"; $a =~ s/\n/\n# /g; $a; } @ARGV), "\n");
}
sub _read_config_file { sub _read_config_file {
my ( $self, $filename ) = @_; my ( $self, $filename ) = @_;
open my $fh, "<", $filename or die "Cannot open $filename: $OS_ERROR\n"; open my $fh, "<", $filename or die "Cannot open $filename: $OS_ERROR\n";
@@ -1023,6 +1017,16 @@ sub _d {
print STDERR "# $package:$line $PID ", join(' ', @_), "\n"; print STDERR "# $package:$line $PID ", join(' ', @_), "\n";
} }
if ( MKDEBUG ) {
print '# ', $^X, ' ', $], "\n";
if ( my $uname = `uname -a` ) {
$uname =~ s/\s+/ /g;
print "# $uname\n";
}
print '# Arguments: ',
join(' ', map { my $a = "_[$_]_"; $a =~ s/\n/\n# /g; $a; } @ARGV), "\n";
}
1; 1;
} }
# ########################################################################### # ###########################################################################

View File

@@ -148,6 +148,11 @@ sub get_specs {
$self->{DSNParser} = DSNParser->new(opts => \@dsn_opts); $self->{DSNParser} = DSNParser->new(opts => \@dsn_opts);
} }
if ( $contents =~ m/^(Percona Toolkit v.+)$/m ) {
$self->{version} = $1;
MKDEBUG && _d($self->{version});
}
return; return;
} }
@@ -472,9 +477,12 @@ sub get_opts {
) or $self->save_error('Error parsing options'); ) or $self->save_error('Error parsing options');
if ( exists $self->{opts}->{version} && $self->{opts}->{version}->{got} ) { if ( exists $self->{opts}->{version} && $self->{opts}->{version}->{got} ) {
printf("%s Ver %s Distrib %s Changeset %s\n", if ( $self->{version} ) {
$self->{program_name}, $main::VERSION, $main::DISTRIB, $main::SVN_REV) print $self->{version}, "\n";
or die "Cannot print: $OS_ERROR"; }
else {
print "Error parsing version. See the VERSION section of the tool's documentation.\n";
}
exit 0; exit 0;
} }
@@ -855,20 +863,6 @@ sub prompt_noecho {
return $response; return $response;
} }
if ( MKDEBUG ) {
print '# ', $^X, ' ', $], "\n";
my $uname = `uname -a`;
if ( $uname ) {
$uname =~ s/\s+/ /g;
print "# $uname\n";
}
printf("# %s Ver %s Distrib %s Changeset %s line %d\n",
$PROGRAM_NAME, ($main::VERSION || ''), ($main::DISTRIB || ''),
($main::SVN_REV || ''), __LINE__);
print('# Arguments: ',
join(' ', map { my $a = "_[$_]_"; $a =~ s/\n/\n# /g; $a; } @ARGV), "\n");
}
sub _read_config_file { sub _read_config_file {
my ( $self, $filename ) = @_; my ( $self, $filename ) = @_;
open my $fh, "<", $filename or die "Cannot open $filename: $OS_ERROR\n"; open my $fh, "<", $filename or die "Cannot open $filename: $OS_ERROR\n";
@@ -1023,6 +1017,16 @@ sub _d {
print STDERR "# $package:$line $PID ", join(' ', @_), "\n"; print STDERR "# $package:$line $PID ", join(' ', @_), "\n";
} }
if ( MKDEBUG ) {
print '# ', $^X, ' ', $], "\n";
if ( my $uname = `uname -a` ) {
$uname =~ s/\s+/ /g;
print "# $uname\n";
}
print '# Arguments: ',
join(' ', map { my $a = "_[$_]_"; $a =~ s/\n/\n# /g; $a; } @ARGV), "\n";
}
1; 1;
} }
# ########################################################################### # ###########################################################################

View File

@@ -1287,6 +1287,11 @@ sub get_specs {
$self->{DSNParser} = DSNParser->new(opts => \@dsn_opts); $self->{DSNParser} = DSNParser->new(opts => \@dsn_opts);
} }
if ( $contents =~ m/^(Percona Toolkit v.+)$/m ) {
$self->{version} = $1;
MKDEBUG && _d($self->{version});
}
return; return;
} }
@@ -1611,9 +1616,12 @@ sub get_opts {
) or $self->save_error('Error parsing options'); ) or $self->save_error('Error parsing options');
if ( exists $self->{opts}->{version} && $self->{opts}->{version}->{got} ) { if ( exists $self->{opts}->{version} && $self->{opts}->{version}->{got} ) {
printf("%s Ver %s Distrib %s Changeset %s\n", if ( $self->{version} ) {
$self->{program_name}, $main::VERSION, $main::DISTRIB, $main::SVN_REV) print $self->{version}, "\n";
or die "Cannot print: $OS_ERROR"; }
else {
print "Error parsing version. See the VERSION section of the tool's documentation.\n";
}
exit 0; exit 0;
} }
@@ -1994,20 +2002,6 @@ sub prompt_noecho {
return $response; return $response;
} }
if ( MKDEBUG ) {
print '# ', $^X, ' ', $], "\n";
my $uname = `uname -a`;
if ( $uname ) {
$uname =~ s/\s+/ /g;
print "# $uname\n";
}
printf("# %s Ver %s Distrib %s Changeset %s line %d\n",
$PROGRAM_NAME, ($main::VERSION || ''), ($main::DISTRIB || ''),
($main::SVN_REV || ''), __LINE__);
print('# Arguments: ',
join(' ', map { my $a = "_[$_]_"; $a =~ s/\n/\n# /g; $a; } @ARGV), "\n");
}
sub _read_config_file { sub _read_config_file {
my ( $self, $filename ) = @_; my ( $self, $filename ) = @_;
open my $fh, "<", $filename or die "Cannot open $filename: $OS_ERROR\n"; open my $fh, "<", $filename or die "Cannot open $filename: $OS_ERROR\n";
@@ -2162,6 +2156,16 @@ sub _d {
print STDERR "# $package:$line $PID ", join(' ', @_), "\n"; print STDERR "# $package:$line $PID ", join(' ', @_), "\n";
} }
if ( MKDEBUG ) {
print '# ', $^X, ' ', $], "\n";
if ( my $uname = `uname -a` ) {
$uname =~ s/\s+/ /g;
print "# $uname\n";
}
print '# Arguments: ',
join(' ', map { my $a = "_[$_]_"; $a =~ s/\n/\n# /g; $a; } @ARGV), "\n";
}
1; 1;
} }
# ########################################################################### # ###########################################################################

View File

@@ -148,6 +148,11 @@ sub get_specs {
$self->{DSNParser} = DSNParser->new(opts => \@dsn_opts); $self->{DSNParser} = DSNParser->new(opts => \@dsn_opts);
} }
if ( $contents =~ m/^(Percona Toolkit v.+)$/m ) {
$self->{version} = $1;
MKDEBUG && _d($self->{version});
}
return; return;
} }
@@ -472,9 +477,12 @@ sub get_opts {
) or $self->save_error('Error parsing options'); ) or $self->save_error('Error parsing options');
if ( exists $self->{opts}->{version} && $self->{opts}->{version}->{got} ) { if ( exists $self->{opts}->{version} && $self->{opts}->{version}->{got} ) {
printf("%s Ver %s Distrib %s Changeset %s\n", if ( $self->{version} ) {
$self->{program_name}, $main::VERSION, $main::DISTRIB, $main::SVN_REV) print $self->{version}, "\n";
or die "Cannot print: $OS_ERROR"; }
else {
print "Error parsing version. See the VERSION section of the tool's documentation.\n";
}
exit 0; exit 0;
} }
@@ -855,20 +863,6 @@ sub prompt_noecho {
return $response; return $response;
} }
if ( MKDEBUG ) {
print '# ', $^X, ' ', $], "\n";
my $uname = `uname -a`;
if ( $uname ) {
$uname =~ s/\s+/ /g;
print "# $uname\n";
}
printf("# %s Ver %s Distrib %s Changeset %s line %d\n",
$PROGRAM_NAME, ($main::VERSION || ''), ($main::DISTRIB || ''),
($main::SVN_REV || ''), __LINE__);
print('# Arguments: ',
join(' ', map { my $a = "_[$_]_"; $a =~ s/\n/\n# /g; $a; } @ARGV), "\n");
}
sub _read_config_file { sub _read_config_file {
my ( $self, $filename ) = @_; my ( $self, $filename ) = @_;
open my $fh, "<", $filename or die "Cannot open $filename: $OS_ERROR\n"; open my $fh, "<", $filename or die "Cannot open $filename: $OS_ERROR\n";
@@ -1023,6 +1017,16 @@ sub _d {
print STDERR "# $package:$line $PID ", join(' ', @_), "\n"; print STDERR "# $package:$line $PID ", join(' ', @_), "\n";
} }
if ( MKDEBUG ) {
print '# ', $^X, ' ', $], "\n";
if ( my $uname = `uname -a` ) {
$uname =~ s/\s+/ /g;
print "# $uname\n";
}
print '# Arguments: ',
join(' ', map { my $a = "_[$_]_"; $a =~ s/\n/\n# /g; $a; } @ARGV), "\n";
}
1; 1;
} }
# ########################################################################### # ###########################################################################