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

Side by Side Diff: client/bin/base_utils.py

Issue 6539001: Merge remote branch 'cros/upstream' into master. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/autotest.git@master
Patch Set: patch Created 9 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « client/bin/autotest ('k') | client/bin/harness.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 """ 1 """
2 DO NOT import this file directly - import client/bin/utils.py, 2 DO NOT import this file directly - import client/bin/utils.py,
3 which will mix this in 3 which will mix this in
4 4
5 Convenience functions for use by tests or whomever. 5 Convenience functions for use by tests or whomever.
6 6
7 Note that this file is mixed in by utils.py - note very carefully the 7 Note that this file is mixed in by utils.py - note very carefully the
8 precedence order defined there 8 precedence order defined there
9 """ 9 """
10 import os, shutil, sys, signal, commands, pickle, glob, statvfs 10 import os, shutil, sys, signal, commands, pickle, glob, statvfs
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 elif file_contains_pattern(issue, 'SUSE'): 238 elif file_contains_pattern(issue, 'SUSE'):
239 return 'SUSE' 239 return 'SUSE'
240 elif file_contains_pattern(issue, 'Ubuntu'): 240 elif file_contains_pattern(issue, 'Ubuntu'):
241 return 'Ubuntu' 241 return 'Ubuntu'
242 elif file_contains_pattern(issue, 'Debian'): 242 elif file_contains_pattern(issue, 'Debian'):
243 return 'Debian' 243 return 'Debian'
244 else: 244 else:
245 return 'Unknown' 245 return 'Unknown'
246 246
247 247
248 def get_cc():
249 try:
250 return os.environ['CC']
251 except KeyError:
252 return 'gcc'
253
254
248 def get_vmlinux(): 255 def get_vmlinux():
249 """Return the full path to vmlinux 256 """Return the full path to vmlinux
250 257
251 Ahem. This is crap. Pray harder. Bad Martin. 258 Ahem. This is crap. Pray harder. Bad Martin.
252 """ 259 """
253 vmlinux = '/boot/vmlinux-%s' % utils.system_output('uname -r') 260 vmlinux = '/boot/vmlinux-%s' % utils.system_output('uname -r')
254 if os.path.isfile(vmlinux): 261 if os.path.isfile(vmlinux):
255 return vmlinux 262 return vmlinux
256 vmlinux = '/lib/modules/%s/build/vmlinux' % utils.system_output('uname -r') 263 vmlinux = '/lib/modules/%s/build/vmlinux' % utils.system_output('uname -r')
257 if os.path.isfile(vmlinux): 264 if os.path.isfile(vmlinux):
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
734 """ 741 """
735 'pgrep name' misses all python processes and also long process names. 742 'pgrep name' misses all python processes and also long process names.
736 'pgrep -f name' gets all shell commands with name in args. 743 'pgrep -f name' gets all shell commands with name in args.
737 So look only for command whose initial pathname ends with name. 744 So look only for command whose initial pathname ends with name.
738 Name itself is an egrep pattern, so it can use | etc for variations. 745 Name itself is an egrep pattern, so it can use | etc for variations.
739 """ 746 """
740 return utils.system("pgrep -f '^([^ /]*/)*(%s)([ ]|$)'" % name_pattern, 747 return utils.system("pgrep -f '^([^ /]*/)*(%s)([ ]|$)'" % name_pattern,
741 ignore_status=True) == 0 748 ignore_status=True) == 0
742 749
743 750
OLDNEW
« no previous file with comments | « client/bin/autotest ('k') | client/bin/harness.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698