~daniel-nichter/mysql-sandbox/any-package-support

« back to all changes in this revision

Viewing changes to bin/make_sandbox_from_installed

  • Committer: Giuseppe Maxia
  • Date: 2010-04-06 16:00:41 UTC
  • Revision ID: g.maxia@gmail.com-20100406160041-wpi1t580w2jqdfak
- added a check in the 'start' script to verify that mysqld_safe exists and does can run properly.
- Added an exit code to the 'start' script to alert when the server does not start
- added help to make_sandbox_from_installed. Added /usr/sbin as source directory
- added instructions to the 'clear' script to remove functions and plugins 

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
 
27
27
my $new_version = shift
28
28
    or die "version needed\n";
 
29
if ($new_version =~ /^(-h|--help)$/) {
 
30
    print MySQL::Sandbox::credits();
 
31
    print<<END_HELP;
 
32
 
 
33
This script tries to create a sandbox using already installed binaries.
 
34
Since these binaries can be in several different places, the script 
 
35
creates a container with symbolic links, where the binaries 
 
36
(their links, actually) are arranged as MySQL Sandbox expects them to be.
 
37
 
 
38
To use this version, change directory to a place where you want to 
 
39
store this symbolic links container, and invoke
 
40
 
 
41
  make_sandbox_from_installed X.X.XX [options]
 
42
 
 
43
    where X.X.XX is the version number. 
 
44
    You can then pass any options accepted by make_sandbox.
 
45
END_HELP
 
46
 
 
47
    exit(1);
 
48
 
 
49
}
 
50
 
29
51
$new_version =~ /^\d+\.\d+\.\d+$/ 
30
52
    or die "invalid version format (required #.#.##)\n";
31
53
 
42
64
    {files => 'mysql*',             from => 'lib64/',   to => 'lib', optional => 1},
43
65
    {files => 'mysql*',             from => 'lib/',     to => 'lib', optional => 1},
44
66
    {files => 'mysql*',             from => 'libexec/', to => 'bin', optional =>1},
 
67
    {files => 'mysql*',             from => 'sbin/',    to => 'bin', optional =>1},
45
68
    {files => 'mysql/',             from => 'share/',   to => 'share', optional =>1},
46
69
);
47
70
 
52
75
    '/usr/local/mysql',
53
76
);
54
77
 
55
 
my $found_mysqld =0;
56
 
my $found_install_db =0;
57
 
my $found_libraries =0;
 
78
my $found_mysqld        = 0;
 
79
my $found_install_db    = 0;
 
80
my $found_libraries     = 0;
58
81
 
59
82
for my $prefix (@prefixes) {
60
 
    if ((-x "$prefix/bin/mysqld") or (-x "$prefix/libexec/mysqld")) {
 
83
    if (
 
84
       (-x "$prefix/bin/mysqld") 
 
85
       or (-x "$prefix/libexec/mysqld")
 
86
       or (-x "$prefix/sbin/mysqld")
 
87
       ) 
 
88
    {
61
89
        $found_mysqld =1;
62
90
    }
63
 
    if ((-x "$prefix/bin/mysql_install_db") or (-x "$prefix/scripts/mysql_install_db")) {
 
91
    if (
 
92
        (-x "$prefix/bin/mysql_install_db") 
 
93
        or (-x "$prefix/scripts/mysql_install_db")
 
94
        ) 
 
95
    {
64
96
        $found_install_db =1;
65
97
    }
66
98
    if ( glob("$prefix/lib/mysql/libmysqlclient*")