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

Side by Side Diff: third_party/psutil/build.py

Issue 8774018: Add psutil build step to fix pyauto media issues. Upgrade psutil to 0.4.0. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Disable Mac builds. Created 9 years 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 unified diff | Download patch
« no previous file with comments | « third_party/psutil/README.chromium ('k') | third_party/psutil/docs/class_diagram.png » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 """Simple helper script for building psutil via GYP."""
7
8 import os
9 import shutil
10 import subprocess
11 import sys
12 import tempfile
13
Nirnimesh 2011/12/12 21:07:18 nit: leave another blank line here
14 def Main():
15 if len(sys.argv) <= 1:
16 print >> sys.stderr, 'Usage: build.py <output dir>'
Nirnimesh 2011/12/12 21:07:18 nit: remove space after >>
17 sys.exit(1)
18
19 # GYP may specify the output path as a relative path. Since we need cwd to be
20 # the source directory, we must convert the output path to an absolute path.
21 abs_out_path = os.path.abspath(sys.argv[1])
22 temp_path = tempfile.mkdtemp()
23 try:
24 ret_code = subprocess.call(
25 [sys.executable, 'setup.py', 'build', '--build-lib', abs_out_path,
26 '--build-temp', temp_path],
27 cwd=os.path.dirname(os.path.abspath(__file__)))
28
29 # Since setup just copies the Python files over, timestamps remain unchanged
30 # and GYP becomes confused about whether it has generated psutil or not. So
31 # touch# all the Python related outputs to put GYP's mind at ease.
32 python_outputs_path = os.path.join(abs_out_path, 'psutil')
33 for fn in os.listdir(python_outputs_path):
34 fn = os.path.join(python_outputs_path, fn)
35 with file(fn, 'a'):
36 os.utime(fn, None)
37
38 sys.exit(ret_code)
39 finally:
40 shutil.rmtree(temp_path)
41
42
43 if __name__ == '__main__':
44 Main()
OLDNEW
« no previous file with comments | « third_party/psutil/README.chromium ('k') | third_party/psutil/docs/class_diagram.png » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698