Diff of /setup_posix.py [fa8974] .. [0e37ee] Maximize Restore

  Switch to unified view

a/setup_posix.py b/setup_posix.py
...
...
12
    return "-%s" % f
12
    return "-%s" % f
13
13
14
def mysql_config(what):
14
def mysql_config(what):
15
    from os import popen
15
    from os import popen
16
    
16
    
17
    f = popen("mysql_config --%s" % what)
17
    f = popen("%s --%s" % (mysql_config.path, what))
18
    data = f.read().strip().split()
18
    data = f.read().strip().split()
19
    ret = f.close()
19
    ret = f.close()
20
    if ret:
20
    if ret:
21
        if ret/256:
21
        if ret/256:
22
            data = []
22
            data = []
23
        if ret/256 > 1:
23
        if ret/256 > 1:
24
            raise EnvironmentError, "mysql_config is not on your PATH"
24
            raise EnvironmentError, "%s not found" % mysql_config.path
25
    return data
25
    return data
26
mysql_config.path = "mysql_config"
26
27
27
def get_config():
28
def get_config():
28
    import os, sys
29
    import os, sys
29
    from setup_common import get_metadata_and_options, enabled, create_release_file
30
    from setup_common import get_metadata_and_options, enabled, create_release_file
30
31
31
    metadata, options = get_metadata_and_options()
32
    metadata, options = get_metadata_and_options()
32
33
34
    if 'mysql_config' in options:
35
        mysql_config.path = options['mysql_config']
36
        
33
    extra_objects = []
37
    extra_objects = []
34
    static = enabled(options, 'static')
38
    static = enabled(options, 'static')
35
    if enabled(options, 'embedded'):
39
    if enabled(options, 'embedded'):
36
        libs = mysql_config("libmysqld-libs")
40
        libs = mysql_config("libmysqld-libs")
37
        client = "mysqld"
41
        client = "mysqld"