summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-11-28 09:23:02 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-11-28 09:23:02 (GMT)
commitbafe5e6d6386f40f254b5da752545b5f9f41d316 (patch)
tree50b83577bb920dbde22529515954c8f1ad29cdd3 /3rdParty
parenta1c0b927525a7f70a8c60363100a9968d0f3ae04 (diff)
downloadswift-bafe5e6d6386f40f254b5da752545b5f9f41d316.zip
swift-bafe5e6d6386f40f254b5da752545b5f9f41d316.tar.bz2
Prettify install commands.
Diffstat (limited to '3rdParty')
-rw-r--r--3rdParty/SCons/scons-local/SCons/Tool/install.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/3rdParty/SCons/scons-local/SCons/Tool/install.py b/3rdParty/SCons/scons-local/SCons/Tool/install.py
index 3680b53..9596db1 100644
--- a/3rdParty/SCons/scons-local/SCons/Tool/install.py
+++ b/3rdParty/SCons/scons-local/SCons/Tool/install.py
@@ -41,97 +41,97 @@ from SCons.Util import make_path_relative
#
# We keep track of *all* installed files.
_INSTALLED_FILES = []
_UNIQUE_INSTALLED_FILES = None
#
# Functions doing the actual work of the Install Builder.
#
def copyFunc(dest, source, env):
"""Install a source file or directory into a destination by copying,
(including copying permission/mode bits)."""
if os.path.isdir(source):
if os.path.exists(dest):
if not os.path.isdir(dest):
raise SCons.Errors.UserError, "cannot overwrite non-directory `%s' with a directory `%s'" % (str(dest), str(source))
else:
parent = os.path.split(dest)[0]
if not os.path.exists(parent):
os.makedirs(parent)
shutil.copytree(source, dest)
else:
shutil.copy2(source, dest)
st = os.stat(source)
os.chmod(dest, stat.S_IMODE(st[stat.ST_MODE]) | stat.S_IWRITE)
return 0
def installFunc(target, source, env):
"""Install a source file into a target using the function specified
as the INSTALL construction variable."""
try:
install = env['INSTALL']
except KeyError:
raise SCons.Errors.UserError('Missing INSTALL construction variable.')
assert len(target)==len(source), \
"Installing source %s into target %s: target and source lists must have same length."%(map(str, source), map(str, target))
for t,s in zip(target,source):
if install(t.get_path(),s.get_path(),env):
return 1
return 0
def stringFunc(target, source, env):
installstr = env.get('INSTALLSTR')
if installstr:
- return env.subst_target_source(installstr, 0, target, source)
+ return env.subst_target_source(installstr, 1, target, source)
target = str(target[0])
source = str(source[0])
if os.path.isdir(source):
type = 'directory'
else:
type = 'file'
return 'Install %s: "%s" as "%s"' % (type, source, target)
#
# Emitter functions
#
def add_targets_to_INSTALLED_FILES(target, source, env):
""" an emitter that adds all target files to the list stored in the
_INSTALLED_FILES global variable. This way all installed files of one
scons call will be collected.
"""
global _INSTALLED_FILES, _UNIQUE_INSTALLED_FILES
_INSTALLED_FILES.extend(target)
_UNIQUE_INSTALLED_FILES = None
return (target, source)
class DESTDIR_factory:
""" a node factory, where all files will be relative to the dir supplied
in the constructor.
"""
def __init__(self, env, dir):
self.env = env
self.dir = env.arg2nodes( dir, env.fs.Dir )[0]
def Entry(self, name):
name = make_path_relative(name)
return self.dir.Entry(name)
def Dir(self, name):
name = make_path_relative(name)
return self.dir.Dir(name)
#
# The Builder Definition
#
install_action = SCons.Action.Action(installFunc, stringFunc)
installas_action = SCons.Action.Action(installFunc, stringFunc)
BaseInstallBuilder = None
def InstallBuilderWrapper(env, target=None, source=None, dir=None, **kw):
if target and dir:
import SCons.Errors