diff options
author | Philip M. Gollucci <pgollucci@FreeBSD.org> | 2008-12-25 14:57:06 +0000 |
---|---|---|
committer | Philip M. Gollucci <pgollucci@FreeBSD.org> | 2008-12-25 14:57:06 +0000 |
commit | 42e34427392ec4b3637366af84f9dfc0e287af56 (patch) | |
tree | 2bacf644840025f19f383db381020570f8501765 /devel/scons | |
parent | 506e1e158a5c3e9a39441df3bcf2ff6af3806cc8 (diff) | |
download | ports-42e34427392ec4b3637366af84f9dfc0e287af56.tar.gz ports-42e34427392ec4b3637366af84f9dfc0e287af56.zip |
Notes
Diffstat (limited to 'devel/scons')
-rw-r--r-- | devel/scons/Makefile | 1 | ||||
-rw-r--r-- | devel/scons/files/patch-engine-SCons-compat-__init__.py | 29 | ||||
-rw-r--r-- | devel/scons/files/patch-engine-SCons-compat-_scons_subprocess.py | 33 |
3 files changed, 63 insertions, 0 deletions
diff --git a/devel/scons/Makefile b/devel/scons/Makefile index 49eac104cf48..ea267cbb9adc 100644 --- a/devel/scons/Makefile +++ b/devel/scons/Makefile @@ -7,6 +7,7 @@ PORTNAME= scons PORTVERSION= 1.2.0 +PORTREVISION= 1 CATEGORIES= devel python MASTER_SITES= SF diff --git a/devel/scons/files/patch-engine-SCons-compat-__init__.py b/devel/scons/files/patch-engine-SCons-compat-__init__.py new file mode 100644 index 000000000000..647570112d25 --- /dev/null +++ b/devel/scons/files/patch-engine-SCons-compat-__init__.py @@ -0,0 +1,29 @@ +Index: engine/SCons/compat/__init__.py +=================================================================== +--- engine/SCons/compat/__init__.py (revision 2695) ++++ engine/SCons/compat/__init__.py (working copy) +@@ -167,11 +167,17 @@ + del shlex + import_as('_scons_shlex', 'shlex') + +-try: +- import subprocess +-except ImportError: +- # Pre-2.4 Python has no subprocess module. +- import_as('_scons_subprocess', 'subprocess') ++#try: ++# import subprocess ++#except ImportError: ++# # Pre-2.4 Python has no subprocess module. ++# import_as('_scons_subprocess', 'subprocess') ++ ++# Import subprocess unconditionally to avoid possible race conditions in ++# the official subprocess API. If there are API versions without known ++# problems, we can version-check and use the original subprocess module ++# in these cases. ++import_as('_scons_subprocess', 'subprocess') + + import sys + try: + + diff --git a/devel/scons/files/patch-engine-SCons-compat-_scons_subprocess.py b/devel/scons/files/patch-engine-SCons-compat-_scons_subprocess.py new file mode 100644 index 000000000000..1e60040700ee --- /dev/null +++ b/devel/scons/files/patch-engine-SCons-compat-_scons_subprocess.py @@ -0,0 +1,33 @@ +Index: engine/SCons/compat/_scons_subprocess.py +=================================================================== +--- engine/SCons/compat/_scons_subprocess.py (revision 2695) ++++ engine/SCons/compat/_scons_subprocess.py (working copy) +@@ -581,13 +581,19 @@ + class object: + pass + ++import thread ++lock = thread.allocate_lock() ++ + class Popen(object): + def __init__(self, args, bufsize=0, executable=None, + stdin=None, stdout=None, stderr=None, + preexec_fn=None, close_fds=False, shell=False, + cwd=None, env=None, universal_newlines=False, + startupinfo=None, creationflags=0): +- """Create new Popen instance.""" ++ """Create new Popen instance. ++ Popen is not thread-safe and is therefore protected with a lock. ++ """ ++ lock.acquire() + _cleanup() + + self._child_created = False +@@ -655,6 +661,7 @@ + self.stderr = os.fdopen(errread, 'rU', bufsize) + else: + self.stderr = os.fdopen(errread, 'rb', bufsize) ++ lock.release() + + + def _translate_newlines(self, data): |