diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2017-10-01 13:23:10 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2017-10-01 13:23:10 +0200 |
commit | 0414abd565dbdf12ea741930bef5268bc7fe6da3 (patch) | |
tree | aa7e983f81ffe2090fa31869b6670bf18bcc28a0 /engine/SCons/Tool/install.py | |
parent | 3765e33b76c51c81dd7bbbfacab0c4e76a1713cb (diff) | |
parent | 3bab2962eecc24c19366692e52ebca5eb835d117 (diff) |
Merge branch 'feature/upstream' into develop
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 |