~ubuntu-branches/ubuntu/trusty/mysql-5.6/trusty

« back to all changes in this revision

Viewing changes to mysql-test/suite/ndb/include/have_connectorj.inc

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-02-12 11:54:27 UTC
  • Revision ID: package-import@ubuntu.com-20140212115427-oq6tfsqxl1wuwehi
Tags: upstream-5.6.15
ImportĀ upstreamĀ versionĀ 5.6.15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--perl
 
2
use strict;
 
3
use IO::File;
 
4
use lib "lib/";
 
5
use My::Platform;
 
6
 
 
7
 
 
8
#
 
9
# Looks for MySQL Connector/J JAR file in MTR_CLASSPATH
 
10
#
 
11
 
 
12
my $ok = 0;
 
13
my $classpath = $ENV{'MTR_CLASSPATH'} || '';
 
14
my $vardir = $ENV{MYSQLTEST_VARDIR} or die "Need MYSQLTEST_VARDIR";
 
15
my $jar;
 
16
my $notfound;
 
17
my $sep = (IS_WINDOWS) ? ';' : ':';
 
18
 
 
19
 
 
20
# -- look for the Connctor/J jar file
 
21
foreach $jar (split $sep, $classpath) {
 
22
  if($jar =~ m/mysql-connector/  && -f $jar) {
 
23
    $ok = 2;
 
24
    last;
 
25
  }
 
26
  elsif($jar =~ m/mysql-connector/) {
 
27
    $ok = 1;
 
28
    $notfound = $jar;
 
29
  }
 
30
}
 
31
 
 
32
# -- write the result to the output file
 
33
my $F = IO::File->new("$vardir/tmp/have_connectorj_result.inc", "w") or die;
 
34
if($ok == 2) {
 
35
  print $F  "--echo Found Connector/J JAR in MTR_CLASSPATH\n";
 
36
}
 
37
elsif($ok == 1) {
 
38
  print $F  "--skip JAR file not found: \"$notfound\"\n";
 
39
 
40
else {
 
41
  print $F  "--skip Please specify Connector/J JAR file in MTR_CLASSPATH env variable\n";
 
42
}
 
43
 
 
44
$F->close();
 
45
 
 
46
EOF
 
47
 
 
48
--source $MYSQLTEST_VARDIR/tmp/have_connectorj_result.inc