~frank-cizmich/percona-toolkit/percona-toolkit

« back to all changes in this revision

Viewing changes to bin/pt-duplicate-key-checker

  • Committer: Daniel Nichter
  • Date: 2014-02-20 03:00:02 UTC
  • Revision ID: daniel@percona.com-20140220030002-gsj22qr101mb2fbp
Remove version check bin type.  Update all tools.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4651
4651
   perl_version        => \&get_perl_version,
4652
4652
   perl_module_version => \&get_perl_module_version,
4653
4653
   mysql_variable      => \&get_mysql_variable,
4654
 
   bin_version         => \&get_bin_version,
4655
4654
);
4656
4655
 
4657
4656
sub valid_item {
4834
4833
   return \%version_for;
4835
4834
}
4836
4835
 
4837
 
sub get_bin_version {
4838
 
   my (%args) = @_;
4839
 
   my $item = $args{item};
4840
 
   my $cmd  = $item->{item};
4841
 
   return unless $cmd;
4842
 
 
4843
 
   my $sanitized_command = File::Basename::basename($cmd);
4844
 
   PTDEBUG && _d('cmd:', $cmd, 'sanitized:', $sanitized_command);
4845
 
   return if $sanitized_command !~ /\A[a-zA-Z0-9_-]+\z/;
4846
 
 
4847
 
   my $output = `$sanitized_command --version 2>&1`;
4848
 
   PTDEBUG && _d('output:', $output);
4849
 
 
4850
 
   my ($version) = $output =~ /v?([0-9]+\.[0-9]+(?:\.[\w-]+)?)/;
4851
 
 
4852
 
   PTDEBUG && _d('Version for', $sanitized_command, '=', $version);
4853
 
   return $version;
4854
 
}
4855
 
 
4856
4836
sub _d {
4857
4837
   my ($package, undef, $line) = caller 0;
4858
4838
   @_ = map { (my $temp = $_) =~ s/\n/\n# /g; $temp; }