OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 | 2 |
3 import os | 3 import os |
| 4 import common |
4 from autotest_lib.client.bin import utils | 5 from autotest_lib.client.bin import utils |
5 | 6 |
6 version = 3 | 7 version = 3 |
7 | 8 |
8 def setup(tarball, topdir): | 9 def setup(tarball, topdir): |
9 srcdir = os.path.join(topdir, 'src') | 10 srcdir = os.path.join(topdir, 'src') |
10 if not os.path.exists(tarball): | 11 if not os.path.exists(tarball): |
11 utils.get_file('http://mirror.x10.com/mirror/mysql/Downloads/MySQL-5.0/m
ysql-5.0.45.tar.gz', tarball) | 12 utils.get_file('http://mirror.x10.com/mirror/mysql/Downloads/MySQL-5.0/m
ysql-5.0.45.tar.gz', tarball) |
12 utils.extract_tarball_to_dir(tarball, 'src') | 13 utils.extract_tarball_to_dir(tarball, 'src') |
13 os.chdir(srcdir) | 14 os.chdir(srcdir) |
14 utils.configure('--prefix=%s/mysql --enable-thread-safe-client' \ | 15 utils.system ('./configure --prefix=%s/mysql --enable-thread-safe-client' \ |
15 % topdir) | 16 % topdir) |
16 utils.make('-j %d' % utils.count_cpus()) | 17 utils.system('make -j %d' % utils.count_cpus()) |
17 utils.make('install') | 18 utils.system('make install') |
18 | 19 |
19 # | 20 # |
20 # MySQL doesn't create this directory on it's own. | 21 # MySQL doesn't create this directory on it's own. |
21 # This is where database logs and files are created. | 22 # This is where database logs and files are created. |
22 # | 23 # |
23 try: | 24 try: |
24 os.mkdir(topdir + '/mysql/var') | 25 os.mkdir(topdir + '/mysql/var') |
25 except: | 26 except: |
26 pass | 27 pass |
27 # | 28 # |
28 # Initialize the database. | 29 # Initialize the database. |
29 # | 30 # |
30 utils.system('%s/mysql/bin/mysql_install_db' % topdir) | 31 utils.system('%s/mysql/bin/mysql_install_db' % topdir) |
31 | 32 |
32 os.chdir(topdir) | 33 os.chdir(topdir) |
33 | 34 |
34 pwd = os.getcwd() | 35 pwd = os.getcwd() |
35 tarball = os.path.join(pwd, 'mysql-5.0.45.tar.gz') | 36 tarball = os.path.join(pwd, 'mysql-5.0.45.tar.gz') |
36 utils.update_version(pwd+'/src', False, version, setup, tarball, pwd) | 37 utils.update_version(pwd+'/src', False, version, setup, tarball, pwd) |
OLD | NEW |