Build system: use lstrip with scons
This commit is contained in:
@@ -595,17 +595,13 @@ def my_winpybundle_print(target, source, env):
|
|||||||
|
|
||||||
def WinPyBundle(target=None, source=None, env=None):
|
def WinPyBundle(target=None, source=None, env=None):
|
||||||
import re
|
import re
|
||||||
py_tar= env.subst( env['LCGDIR'] )
|
py_tar = env.subst(env['LCGDIR']).lstrip("#")
|
||||||
if py_tar[0]=='#':
|
|
||||||
py_tar= py_tar[1:]
|
|
||||||
if env['BF_DEBUG']:
|
if env['BF_DEBUG']:
|
||||||
py_tar+= '/release/python' + env['BF_PYTHON_VERSION'].replace('.','') + '_d.tar.gz'
|
py_tar+= '/release/python' + env['BF_PYTHON_VERSION'].replace('.','') + '_d.tar.gz'
|
||||||
else:
|
else:
|
||||||
py_tar+= '/release/python' + env['BF_PYTHON_VERSION'].replace('.','') + '.tar.gz'
|
py_tar+= '/release/python' + env['BF_PYTHON_VERSION'].replace('.','') + '.tar.gz'
|
||||||
|
|
||||||
py_target = env.subst( env['BF_INSTALLDIR'] )
|
py_target = env.subst(env['BF_INSTALLDIR']).lstrip("#")
|
||||||
if py_target[0]=='#':
|
|
||||||
py_target=py_target[1:]
|
|
||||||
py_target = os.path.join(py_target, VERSION, 'python', 'lib')
|
py_target = os.path.join(py_target, VERSION, 'python', 'lib')
|
||||||
def printexception(func,path,ex):
|
def printexception(func,path,ex):
|
||||||
if os.path.exists(path): #do not report if path does not exist. eg on a fresh build.
|
if os.path.exists(path): #do not report if path does not exist. eg on a fresh build.
|
||||||
@@ -628,14 +624,10 @@ def WinPyBundle(target=None, source=None, env=None):
|
|||||||
|
|
||||||
# -------------
|
# -------------
|
||||||
# Extract Numpy
|
# Extract Numpy
|
||||||
py_tar = env.subst(env['LCGDIR'])
|
py_tar = env.subst(env['LCGDIR']).lstrip("#")
|
||||||
if py_tar[0] == '#':
|
|
||||||
py_tar = py_tar[1:]
|
|
||||||
py_tar += '/release/python' + env['BF_PYTHON_VERSION'].replace('.','') + '_numpy_1.8.tar.gz'
|
py_tar += '/release/python' + env['BF_PYTHON_VERSION'].replace('.','') + '_numpy_1.8.tar.gz'
|
||||||
|
|
||||||
py_target = env.subst(env['BF_INSTALLDIR'])
|
py_target = env.subst(env['BF_INSTALLDIR']).lstrip("#")
|
||||||
if py_target[0] == '#':
|
|
||||||
py_target = py_target[1:]
|
|
||||||
py_target = os.path.join(py_target, VERSION, 'python', 'lib', 'site-packages')
|
py_target = os.path.join(py_target, VERSION, 'python', 'lib', 'site-packages')
|
||||||
# rmtree handled above
|
# rmtree handled above
|
||||||
# files are cleaned up in their archive
|
# files are cleaned up in their archive
|
||||||
@@ -645,9 +637,7 @@ def WinPyBundle(target=None, source=None, env=None):
|
|||||||
|
|
||||||
# --------------------
|
# --------------------
|
||||||
# Copy 'site-packages'
|
# Copy 'site-packages'
|
||||||
py_dir = env.subst(env['LCGDIR'])
|
py_dir = env.subst(env['LCGDIR']).lstrip("#")
|
||||||
if py_dir[0] == '#':
|
|
||||||
py_dir = py_dir[1:]
|
|
||||||
py_dir += '/release/site-packages'
|
py_dir += '/release/site-packages'
|
||||||
# grr, we have to do one by one because the dir exists
|
# grr, we have to do one by one because the dir exists
|
||||||
for f in os.listdir(py_dir):
|
for f in os.listdir(py_dir):
|
||||||
|
Reference in New Issue
Block a user