Allow specifying git branch, when installing FreeTDS from source
This commit is contained in:
parent
a293ed4012
commit
08e030c8c7
|
@ -27,7 +27,7 @@ Fabric Library for FreeTDS
|
||||||
from rattail_fabric2 import apt, exists, mkdir
|
from rattail_fabric2 import apt, exists, mkdir
|
||||||
|
|
||||||
|
|
||||||
def install_from_source(c, user='rattail'):
|
def install_from_source(c, user='rattail', branch=None):
|
||||||
"""
|
"""
|
||||||
Install the FreeTDS library from source.
|
Install the FreeTDS library from source.
|
||||||
|
|
||||||
|
@ -43,9 +43,16 @@ def install_from_source(c, user='rattail'):
|
||||||
'pkg-config',
|
'pkg-config',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if c.run('which git', warn=True).failed:
|
||||||
|
apt.install(c, 'git')
|
||||||
|
|
||||||
if not exists(c, '/usr/local/src/freetds'):
|
if not exists(c, '/usr/local/src/freetds'):
|
||||||
mkdir(c, '/usr/local/src/freetds', owner=user, use_sudo=True)
|
mkdir(c, '/usr/local/src/freetds', owner=user, use_sudo=True)
|
||||||
c.sudo('git clone https://github.com/FreeTDS/freetds.git /usr/local/src/freetds', user=user)
|
c.sudo('git clone https://github.com/FreeTDS/freetds.git /usr/local/src/freetds',
|
||||||
|
user=user)
|
||||||
|
if branch:
|
||||||
|
c.sudo("bash -c 'cd /usr/local/src/freetds; git checkout {}'".format(branch),
|
||||||
|
user=user)
|
||||||
|
|
||||||
if not exists(c, '/usr/local/lib/libtdsodbc.so'):
|
if not exists(c, '/usr/local/lib/libtdsodbc.so'):
|
||||||
c.sudo("bash -c 'cd /usr/local/src/freetds; ./autogen.sh'", user=user)
|
c.sudo("bash -c 'cd /usr/local/src/freetds; ./autogen.sh'", user=user)
|
||||||
|
|
Loading…
Reference in a new issue