OLD | NEW |
1 # Copyright (c) 2011 Google Inc. All rights reserved. | 1 # Copyright (c) 2011 Google Inc. All rights reserved. |
2 # Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org) | 2 # Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org) |
3 # | 3 # |
4 # Redistribution and use in source and binary forms, with or without | 4 # Redistribution and use in source and binary forms, with or without |
5 # modification, are permitted provided that the following conditions are | 5 # modification, are permitted provided that the following conditions are |
6 # met: | 6 # met: |
7 # | 7 # |
8 # * Redistributions of source code must retain the above copyright | 8 # * Redistributions of source code must retain the above copyright |
9 # notice, this list of conditions and the following disclaimer. | 9 # notice, this list of conditions and the following disclaimer. |
10 # * Redistributions in binary form must reproduce the above | 10 # * Redistributions in binary form must reproduce the above |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 script_dir = up(up(up(os.path.abspath(__file__)))) | 46 script_dir = up(up(up(os.path.abspath(__file__)))) |
47 env = os.environ | 47 env = os.environ |
48 if 'PYTHONPATH' in env: | 48 if 'PYTHONPATH' in env: |
49 if script_dir not in env['PYTHONPATH']: | 49 if script_dir not in env['PYTHONPATH']: |
50 env['PYTHONPATH'] = env['PYTHONPATH'] + os.pathsep + script_dir | 50 env['PYTHONPATH'] = env['PYTHONPATH'] + os.pathsep + script_dir |
51 else: | 51 else: |
52 env['PYTHONPATH'] = script_dir | 52 env['PYTHONPATH'] = script_dir |
53 module_path = os.path.join(script_dir, *parts) | 53 module_path = os.path.join(script_dir, *parts) |
54 cmd = [sys.executable, module_path] + sys.argv[1:] | 54 cmd = [sys.executable, module_path] + sys.argv[1:] |
55 | 55 |
56 # Wrap processes in the jhbuild environment so DRT or WKTR | |
57 # doesn't need to do it and their process id as reported by | |
58 # subprocess.Popen is not jhbuild's. | |
59 if '--gtk' in sys.argv[1:] and os.path.exists(os.path.join(script_dir, '..',
'..', 'WebKitBuild', 'Dependencies')): | |
60 prefix = [os.path.join(script_dir, '..', 'jhbuild', 'jhbuild-wrapper'),
'--gtk', 'run'] | |
61 cmd = prefix + cmd | |
62 | |
63 proc = subprocess.Popen(cmd, env=env) | 56 proc = subprocess.Popen(cmd, env=env) |
64 try: | 57 try: |
65 proc.wait() | 58 proc.wait() |
66 except KeyboardInterrupt: | 59 except KeyboardInterrupt: |
67 # We need a second wait in order to make sure the subprocess exits fully
. | 60 # We need a second wait in order to make sure the subprocess exits fully
. |
68 # FIXME: It would be nice if we could put a timeout on this. | 61 # FIXME: It would be nice if we could put a timeout on this. |
69 proc.wait() | 62 proc.wait() |
70 sys.exit(proc.returncode) | 63 sys.exit(proc.returncode) |
OLD | NEW |