File: file_contents.test

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 (91 lines) | stat: -rw-r--r-- 3,460 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
79
80
81
82
83
84
85
86
87
88
89
90
91

#
# Testing files that were built to be packaged, both for existence and for contents
#

#
# Bug #42969: Create MANIFEST files
#
# Use a Perl script to verify that files "docs/INFO_BIN" and "docs/INFO_SRC" do exist
# and have the expected contents.

--perl
print "\nChecking 'INFO_SRC' and 'INFO_BIN'\n";
$dir_bin = $ENV{'MYSQL_BINDIR'};
if ($dir_bin =~ m|^/usr/|) {
  # RPM package
  $dir_docs = $dir_bin;
  $dir_docs =~ s|/lib|/share/doc|;
  if(-d "$dir_docs/packages") {
    # SuSE: "packages/" in the documentation path
    # Skip the management-server directory in the documentation path for cluster release
    @dir_docs = grep { (! /management/) } glob "$dir_docs/packages/mysql-*-server*";
    $dir_docs = $dir_docs[0];
  } else {
    # RedHat: version number in directory name
    $dir_docs = glob "$dir_docs/MySQL-server*";
    if (! -d "$dir_docs") {
      # If not it might be ULN so try that
      # Skip the management-server directory in the documentation path for cluster release
      @dir_docs = grep { (! /management/) } glob "$dir_bin/share/doc/mysql-*-server*";
      $dir_docs = $dir_docs[0];
      if (! -f "$dir_docs/INFO_BIN") {
        # Debian/ Ubuntu
        $dir_docs = glob "$dir_bin/share/mysql-*/docs";
      }
    }
  }
} elsif ($dir_bin =~ m|/usr$|) {
  # RPM build during development
  $dir_docs = "$dir_bin/share/doc";
  if(-d "$dir_docs/packages") {
    # SuSE: "packages/" in the documentation path
    # Skip the management-server directory in the documentation path for cluster release
    @dir_docs = grep { (! /management/) } glob "$dir_docs/packages/mysql-*-server*";
    $dir_docs = $dir_docs[0];
  } else {
    # RedHat: version number in directory name
    $dir_docs = glob "$dir_docs/MySQL-server*";
    if (! -d "$dir_docs") {
      # If not it might be ULN so try that
      @dir_docs = grep { (! /management/) } glob "$dir_bin/share/doc/mysql-*-server*";
      $dir_docs = $dir_docs[0];
      if (! -f "$dir_docs/INFO_BIN") {
        # Debian/ Ubuntu
        $dir_docs = glob "$dir_bin/share/mysql-*/docs";
      }
    }
  }
} else {
  # tar.gz package, Windows, or developer work (in git)
  $dir_docs = $dir_bin;
  if(-d "$dir_docs/docs") {
    $dir_docs = "$dir_docs/docs"; # package
  } else {
    $dir_docs = "$dir_docs/Docs"; # development tree
  }
}
$found_version = "No line 'MySQL source #.#.#'";
$found_revision = "No line 'revision-id: .....'";
open(I_SRC,"<","$dir_docs/INFO_SRC") or print "Cannot open 'INFO_SRC' in '$dir_docs' (starting from bindir '$dir_bin')\n";
while(defined ($line = <I_SRC>)) {
  if ($line =~ m|^MySQL source \d\.\d\.\d+|) {$found_version = "Found MySQL version number";}
  if ($line =~ m|^commit: \w{40}$|) {$found_revision = "Found GIT revision id";}
}
close I_SRC;
print "INFO_SRC: $found_version / $found_revision\n";
$found_compiler = "No line about compiler information";
$found_features = "No line 'Feature flags'";
open(I_BIN,"<","$dir_docs/INFO_BIN") or print "Cannot open 'INFO_BIN' in '$dir_docs' (starting from bindir '$dir_bin')\n";
while(defined ($line = <I_BIN>)) {
  # "generator" on Windows, "flags" on Unix:
  if (($line =~ m| Compiler / generator used: |) ||
      ($line =~ m| Compiler flags used:|))   {$found_compiler = "Found 'Compiler ... used' line";}
  if  ($line =~ m| Feature flags used:|)     {$found_features = "Found 'Feature flags' line";}
}
close I_BIN;
print "INFO_BIN: $found_compiler / $found_features\n";
EOF

--echo
--echo End of tests