File: check_dir_settings.inc

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (78 lines) | stat: -rw-r--r-- 2,083 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# MTR "subroutine" which checks the output from mysqld --help
# --verbose to check if the deduced values for --basedir,
# --lc-messages-dir, --character-sets-dir and --plugin-dir have
# "reasonable" values. By reasonable is meant that the path exists and
# contains some key file/directory which is expected to be there.
#
# Note that the deduced value for --character-sets-dir and
# --plugin-dir is currently wrong when running from a sandbox build
# dir, so we just print the ok string anyway in this case
#
# Usage: Assign the MTR variable HELP_VERBOSE_OUTPUT to a file which contains
# the help output, then source this file.

--echo # Checking HELP_VERBOSE_OUTPUT
--perl
  use strict;
  #use Dumpvalue;
  #my $dumper = Dumpvalue->new;

  #$dumper->dumpValue(\%ENV);
  $_= $ENV{'MYSQLD'};
  my $in_cbd= m!/sql/! || m!/runtime_output_directory/!;
  #print "# DBG: \$in_cbd: $in_cbd\n";

  my $mysqld_out= $ENV{'HELP_VERBOSE_OUTPUT'};

  open(MYSQLD_OUT, $mysqld_out);
  while(<MYSQLD_OUT>)
  {
    if (/^basedir\s+(\S+)$/)
    {
      my $bd= $1;
      if (-d "$bd/share") {
        print "# basedir looks ok\n";
        next;
      }
      print "# ERROR: No share directory in basedir $bd\n";
      next;
    }

    if (/^character-sets-dir\s+(\S+)$/)
    {
      my $csd= $1;
      if (-f "$csd/ascii.xml" || $in_cbd) {
        print "# character-sets-dir is as expected\n";
        next;
      }
      print "# ERROR: No ascii.xml in character-sets-dir $csd\n";
      next;
    }

    if (/^lc-messages-dir\s+(\S+)$/)
    {
      my $lmd= $1;
      if (-d "$lmd/english") {
        print "# lc-messages-dir looks ok\n";
        next;
      }
      print "# ERROR: No english directory in lc-messages-dir $lmd\n";
      next;
    }

    if (/^plugin-dir\s+(\S+)$/)
    {
      my $pd= $1;
      if (-B "$pd/auth.so" || -B "$pd/auth.dll" || $in_cbd) {
        print "# plugin-dir is as expected\n";
        next;
      }
      print "# ERROR: No auth dll in plugin-dir $pd\n";
      next;
    }
  }
  close(MYSQLD_OUT);
EOF

--echo # HELP_VERBOSE_OUTPUT check finished
--echo #