summaryrefslogtreecommitdiff
path: root/src/engine/SCons/Platform
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2016-04-10 18:15:03 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2016-04-10 18:15:03 +0200
commit301edd26f23e3d954dcea5cffc1ad13f969822ca (patch)
treeb0dd8f1b1da7c48da076ae45fc9529e748d082f0 /src/engine/SCons/Platform
parente20c9557371eacec533588d33b4bebd543ba178f (diff)
Imported Upstream version 2.5.0+repackupstream/2.5.0+repack
Diffstat (limited to 'src/engine/SCons/Platform')
-rw-r--r--src/engine/SCons/Platform/PlatformTests.py24
-rw-r--r--src/engine/SCons/Platform/__init__.py6
-rw-r--r--src/engine/SCons/Platform/__init__.xml2
-rw-r--r--src/engine/SCons/Platform/aix.py4
-rw-r--r--src/engine/SCons/Platform/cygwin.py4
-rw-r--r--src/engine/SCons/Platform/darwin.py4
-rw-r--r--src/engine/SCons/Platform/hpux.py4
-rw-r--r--src/engine/SCons/Platform/irix.py4
-rw-r--r--src/engine/SCons/Platform/os2.py4
-rw-r--r--src/engine/SCons/Platform/posix.py10
-rw-r--r--src/engine/SCons/Platform/posix.xml2
-rw-r--r--src/engine/SCons/Platform/sunos.py4
-rw-r--r--src/engine/SCons/Platform/sunos.xml2
-rw-r--r--src/engine/SCons/Platform/win32.py14
-rw-r--r--src/engine/SCons/Platform/win32.xml2
15 files changed, 54 insertions, 36 deletions
diff --git a/src/engine/SCons/Platform/PlatformTests.py b/src/engine/SCons/Platform/PlatformTests.py
index 417fad5..1a36f7a 100644
--- a/src/engine/SCons/Platform/PlatformTests.py
+++ b/src/engine/SCons/Platform/PlatformTests.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2015 The SCons Foundation
+# Copyright (c) 2001 - 2016 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -21,7 +21,7 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Platform/PlatformTests.py rel_2.4.1:3453:73fefd3ea0b0 2015/11/09 03:25:05 bdbaddog"
+__revision__ = "src/engine/SCons/Platform/PlatformTests.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
import SCons.compat
@@ -187,11 +187,29 @@ class TempFileMungeTestCase(unittest.TestCase):
assert cmd != defined_cmd, cmd
assert cmd == getattr(target[0].attributes, 'tempfile_cmdlist', None)
+class PlatformEscapeTestCase(unittest.TestCase):
+ def test_posix_escape(self):
+ """ Check that paths with parens are escaped properly
+ """
+ import SCons.Platform.posix
+
+ test_string = "/my (really) great code/main.cpp"
+ output = SCons.Platform.posix.escape(test_string)
+
+ # We expect the escape function to wrap the string
+ # in quotes, but not escape any internal characters
+ # in the test_string. (Parens doesn't require shell
+ # escaping if their quoted)
+ assert output[1:-1] == test_string
+
+
if __name__ == "__main__":
suite = unittest.TestSuite()
tclasses = [ PlatformTestCase,
- TempFileMungeTestCase ]
+ TempFileMungeTestCase,
+ PlatformEscapeTestCase,
+ ]
for tclass in tclasses:
names = unittest.getTestCaseNames(tclass, 'test_')
suite.addTests(list(map(tclass, names)))
diff --git a/src/engine/SCons/Platform/__init__.py b/src/engine/SCons/Platform/__init__.py
index d8be160..e3db28a 100644
--- a/src/engine/SCons/Platform/__init__.py
+++ b/src/engine/SCons/Platform/__init__.py
@@ -12,7 +12,7 @@ environment. Consequently, we'll examine both sys.platform and os.name
(and anything else that might come in to play) in order to return some
specification which is unique enough for our purposes.
-Note that because this subsysem just *selects* a callable that can
+Note that because this subsystem just *selects* a callable that can
modify a construction environment, it's possible for people to define
their own "platform specification" in an arbitrary callable function.
No one needs to use or tie in to this subsystem in order to roll
@@ -20,7 +20,7 @@ their own platform definition.
"""
#
-# Copyright (c) 2001 - 2015 The SCons Foundation
+# Copyright (c) 2001 - 2016 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -42,7 +42,7 @@ their own platform definition.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Platform/__init__.py rel_2.4.1:3453:73fefd3ea0b0 2015/11/09 03:25:05 bdbaddog"
+__revision__ = "src/engine/SCons/Platform/__init__.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
import SCons.compat
diff --git a/src/engine/SCons/Platform/__init__.xml b/src/engine/SCons/Platform/__init__.xml
index e6cecaf..35e56a7 100644
--- a/src/engine/SCons/Platform/__init__.xml
+++ b/src/engine/SCons/Platform/__init__.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2015 The SCons Foundation
+Copyright (c) 2001 - 2016 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Platform/aix.py b/src/engine/SCons/Platform/aix.py
index f36eab6..65ee701 100644
--- a/src/engine/SCons/Platform/aix.py
+++ b/src/engine/SCons/Platform/aix.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2015 The SCons Foundation
+# Copyright (c) 2001 - 2016 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Platform/aix.py rel_2.4.1:3453:73fefd3ea0b0 2015/11/09 03:25:05 bdbaddog"
+__revision__ = "src/engine/SCons/Platform/aix.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
import os
import subprocess
diff --git a/src/engine/SCons/Platform/cygwin.py b/src/engine/SCons/Platform/cygwin.py
index a901ac3..3f8fc17 100644
--- a/src/engine/SCons/Platform/cygwin.py
+++ b/src/engine/SCons/Platform/cygwin.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2015 The SCons Foundation
+# Copyright (c) 2001 - 2016 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Platform/cygwin.py rel_2.4.1:3453:73fefd3ea0b0 2015/11/09 03:25:05 bdbaddog"
+__revision__ = "src/engine/SCons/Platform/cygwin.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
import posix
from SCons.Platform import TempFileMunge
diff --git a/src/engine/SCons/Platform/darwin.py b/src/engine/SCons/Platform/darwin.py
index 73f140f..279cfc2 100644
--- a/src/engine/SCons/Platform/darwin.py
+++ b/src/engine/SCons/Platform/darwin.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2015 The SCons Foundation
+# Copyright (c) 2001 - 2016 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Platform/darwin.py rel_2.4.1:3453:73fefd3ea0b0 2015/11/09 03:25:05 bdbaddog"
+__revision__ = "src/engine/SCons/Platform/darwin.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
import posix
import os
diff --git a/src/engine/SCons/Platform/hpux.py b/src/engine/SCons/Platform/hpux.py
index 36e6764..d2de303 100644
--- a/src/engine/SCons/Platform/hpux.py
+++ b/src/engine/SCons/Platform/hpux.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2015 The SCons Foundation
+# Copyright (c) 2001 - 2016 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Platform/hpux.py rel_2.4.1:3453:73fefd3ea0b0 2015/11/09 03:25:05 bdbaddog"
+__revision__ = "src/engine/SCons/Platform/hpux.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
import posix
diff --git a/src/engine/SCons/Platform/irix.py b/src/engine/SCons/Platform/irix.py
index e947b54..c557131 100644
--- a/src/engine/SCons/Platform/irix.py
+++ b/src/engine/SCons/Platform/irix.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2015 The SCons Foundation
+# Copyright (c) 2001 - 2016 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Platform/irix.py rel_2.4.1:3453:73fefd3ea0b0 2015/11/09 03:25:05 bdbaddog"
+__revision__ = "src/engine/SCons/Platform/irix.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
import posix
diff --git a/src/engine/SCons/Platform/os2.py b/src/engine/SCons/Platform/os2.py
index 5f32844..7363636 100644
--- a/src/engine/SCons/Platform/os2.py
+++ b/src/engine/SCons/Platform/os2.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2015 The SCons Foundation
+# Copyright (c) 2001 - 2016 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Platform/os2.py rel_2.4.1:3453:73fefd3ea0b0 2015/11/09 03:25:05 bdbaddog"
+__revision__ = "src/engine/SCons/Platform/os2.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
import win32
def generate(env):
diff --git a/src/engine/SCons/Platform/posix.py b/src/engine/SCons/Platform/posix.py
index 78e80f3..6edfd78 100644
--- a/src/engine/SCons/Platform/posix.py
+++ b/src/engine/SCons/Platform/posix.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2015 The SCons Foundation
+# Copyright (c) 2001 - 2016 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Platform/posix.py rel_2.4.1:3453:73fefd3ea0b0 2015/11/09 03:25:05 bdbaddog"
+__revision__ = "src/engine/SCons/Platform/posix.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
import errno
import os
@@ -48,16 +48,18 @@ exitvalmap = {
}
def escape(arg):
- "escape shell special characters"
+ "escape shell special characters"
slash = '\\'
- special = '"$()'
+ special = '"$'
arg = arg.replace(slash, slash+slash)
for c in special:
arg = arg.replace(c, slash+c)
+ # print "ESCAPE RESULT: %s"%arg
return '"' + arg + '"'
+
def exec_subprocess(l, env):
proc = subprocess.Popen(l, env = env, close_fds = True)
return proc.wait()
diff --git a/src/engine/SCons/Platform/posix.xml b/src/engine/SCons/Platform/posix.xml
index 28e7232..f20ec64 100644
--- a/src/engine/SCons/Platform/posix.xml
+++ b/src/engine/SCons/Platform/posix.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2015 The SCons Foundation
+Copyright (c) 2001 - 2016 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Platform/sunos.py b/src/engine/SCons/Platform/sunos.py
index 7646eb7..d053e21 100644
--- a/src/engine/SCons/Platform/sunos.py
+++ b/src/engine/SCons/Platform/sunos.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2015 The SCons Foundation
+# Copyright (c) 2001 - 2016 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Platform/sunos.py rel_2.4.1:3453:73fefd3ea0b0 2015/11/09 03:25:05 bdbaddog"
+__revision__ = "src/engine/SCons/Platform/sunos.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
import posix
diff --git a/src/engine/SCons/Platform/sunos.xml b/src/engine/SCons/Platform/sunos.xml
index aecf3cf..2705c9f 100644
--- a/src/engine/SCons/Platform/sunos.xml
+++ b/src/engine/SCons/Platform/sunos.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2015 The SCons Foundation
+Copyright (c) 2001 - 2016 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Platform/win32.py b/src/engine/SCons/Platform/win32.py
index f5c787a..556c7d4 100644
--- a/src/engine/SCons/Platform/win32.py
+++ b/src/engine/SCons/Platform/win32.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2015 The SCons Foundation
+# Copyright (c) 2001 - 2016 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Platform/win32.py rel_2.4.1:3453:73fefd3ea0b0 2015/11/09 03:25:05 bdbaddog"
+__revision__ = "src/engine/SCons/Platform/win32.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
import os
import os.path
@@ -60,10 +60,8 @@ except AttributeError:
else:
parallel_msg = None
- import builtins
-
- _builtin_file = builtins.file
- _builtin_open = builtins.open
+ _builtin_file = file
+ _builtin_open = open
class _scons_file(_builtin_file):
def __init__(self, *args, **kw):
@@ -78,8 +76,8 @@ else:
0)
return fp
- builtins.file = _scons_file
- builtins.open = _scons_open
+ file = _scons_file
+ open = _scons_open
try:
import threading
diff --git a/src/engine/SCons/Platform/win32.xml b/src/engine/SCons/Platform/win32.xml
index feb7ce7..d085350 100644
--- a/src/engine/SCons/Platform/win32.xml
+++ b/src/engine/SCons/Platform/win32.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2015 The SCons Foundation
+Copyright (c) 2001 - 2016 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.