Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(543)

Unified Diff: scripts/tools/runit.py

Issue 17635005: Make blink_trybot recipe work on windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Fix presubmit + move polyfill (retry) Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« scripts/slave/recipe_modules/gclient/api.py ('K') | « scripts/tools/run_recipe.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/tools/runit.py
diff --git a/scripts/tools/runit.py b/scripts/tools/runit.py
new file mode 100644
index 0000000000000000000000000000000000000000..062cf3618c86852683a33646755045ecc2330b95
--- /dev/null
+++ b/scripts/tools/runit.py
@@ -0,0 +1,39 @@
+# Copyright (c) 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import sys
+import os
+import subprocess
+
+SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__))
+BUILD = os.path.abspath(os.path.join(SCRIPT_DIR, '..', '..'))
+
+def main(argv):
+ path = os.environ.get('PYTHONPATH', '')
+ path = path.split(':')
+ def add(new_path):
+ if new_path not in path:
+ path.append(new_path)
+
+ third_party = os.path.join(BUILD, 'third_party')
+ for d in os.listdir(third_party):
+ full = os.path.join(third_party, d)
+ if os.path.isdir(full):
+ add(full)
+ add(os.path.join(BUILD, 'scripts'))
+ add(third_party)
+ add(os.path.join(BUILD, 'site_config'))
+ add(os.path.join(BUILD, '..', 'build_internal', 'site_config'))
+ add('.')
+ os.environ['PYTHONPATH'] = os.pathsep.join(path)
+ print 'Set PYTHONPATH: %s' % os.environ['PYTHONPATH']
+
+ # Use subprocess instead of execv because otherwise windows destroys quoting.
+ p = subprocess.Popen(argv[1:])
+ p.wait()
+ return p.returncode
+
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv))
« scripts/slave/recipe_modules/gclient/api.py ('K') | « scripts/tools/run_recipe.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698