diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2017-10-03 06:25:00 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2017-10-03 06:25:00 +0200 |
commit | d4ed069896a9d49eb33966a0f871e39b5c24da8a (patch) | |
tree | 1c923e288e1641b8a08a71891e3ee5ea1e4dfde5 /engine/SCons/Tool/install.py | |
parent | 3765e33b76c51c81dd7bbbfacab0c4e76a1713cb (diff) | |
parent | 13e92f02338ad8d28d58fcd7c9f46d0d5e970e54 (diff) |
Merge branch 'release/3.0.0-1'3.0.0-1
Diffstat (limited to 'engine/SCons/Tool/install.py')
-rw-r--r-- | engine/SCons/Tool/install.py | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/engine/SCons/Tool/install.py b/engine/SCons/Tool/install.py index 4cebf5b..12dcf8f 100644 --- a/engine/SCons/Tool/install.py +++ b/engine/SCons/Tool/install.py @@ -8,7 +8,7 @@ selection method. """ # -# Copyright (c) 2001 - 2016 The SCons Foundation +# Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -29,8 +29,9 @@ selection method. # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # +from __future__ import print_function -__revision__ = "src/engine/SCons/Tool/install.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog" +__revision__ = "src/engine/SCons/Tool/install.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os import re @@ -48,7 +49,7 @@ _UNIQUE_INSTALLED_FILES = None class CopytreeError(EnvironmentError): pass - + # This is a patched version of shutil.copytree from python 2.5. It # doesn't fail if the dir exists, which regular copytree does # (annoyingly). Note the XXX comment in the docstring. @@ -83,21 +84,21 @@ def scons_copytree(src, dst, symlinks=False): else: shutil.copy2(srcname, dstname) # XXX What about devices, sockets etc.? - except (IOError, os.error), why: + except (IOError, os.error) as why: errors.append((srcname, dstname, str(why))) # catch the CopytreeError from the recursive copytree so that we can # continue with other files - except CopytreeError, err: + except CopytreeError as err: errors.extend(err.args[0]) try: shutil.copystat(src, dst) except SCons.Util.WinError: # can't copy file access times on Windows pass - except OSError, why: + except OSError as why: errors.extend((src, dst, str(why))) if errors: - raise CopytreeError, errors + raise CopytreeError(errors) # @@ -165,10 +166,9 @@ def listShlibLinksToInstall(dest, source, env): def installShlibLinks(dest, source, env): """If we are installing a versioned shared library create the required links.""" Verbose = False - symlinks = listShlibLinksToInstall(dest, source, env) if Verbose: - print 'installShlibLinks: symlinks=%r' % SCons.Tool.StringizeLibSymlinks(symlinks) + print('installShlibLinks: symlinks={:r}'.format(SCons.Tool.StringizeLibSymlinks(symlinks))) if symlinks: SCons.Tool.CreateLibSymlinks(env, symlinks) return @@ -244,12 +244,10 @@ def add_versioned_targets_to_INSTALLED_FILES(target, source, env): Verbose = False _INSTALLED_FILES.extend(target) if Verbose: - print "add_versioned_targets_to_INSTALLED_FILES: target=%r" % map(str, target) - + print("add_versioned_targets_to_INSTALLED_FILES: target={:r}".format(list(map(str, target)))) symlinks = listShlibLinksToInstall(target[0], source, env) if symlinks: SCons.Tool.EmitLibSymlinks(env, symlinks, target[0]) - _UNIQUE_INSTALLED_FILES = None return (target, source) @@ -307,6 +305,7 @@ def InstallBuilderWrapper(env, target=None, source=None, dir=None, **kw): tgt.extend(BaseInstallBuilder(env, target, src, **kw)) return tgt + def InstallAsBuilderWrapper(env, target=None, source=None, **kw): result = [] for src, tgt in map(lambda x, y: (x, y), source, target): @@ -315,6 +314,7 @@ def InstallAsBuilderWrapper(env, target=None, source=None, **kw): BaseVersionedInstallBuilder = None + def InstallVersionedBuilderWrapper(env, target=None, source=None, dir=None, **kw): if target and dir: import SCons.Errors @@ -346,6 +346,7 @@ def InstallVersionedBuilderWrapper(env, target=None, source=None, dir=None, **kw added = None + def generate(env): from SCons.Script import AddOption, GetOption |