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

Side by Side Diff: client/virt/virt_installer.py

Issue 6883246: Merge autotest upstream from @5318 ~ @5336 (Closed) Base URL: ssh://gitrw.chromium.org:9222/autotest.git@master
Patch Set: patch Created 9 years, 7 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/virt/virt_env_process.py ('k') | client/virt/virt_scheduler.py » ('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 import os, shutil, logging
2 from autotest_lib.client.bin import utils
3
4
5 def check_configure_options(script_path):
6 """
7 Return the list of available options (flags) of a GNU autoconf like
8 configure build script.
9
10 @param script: Path to the configure script
11 """
12 abspath = os.path.abspath(script_path)
13 help_raw = utils.system_output('%s --help' % abspath, ignore_status=True)
14 help_output = help_raw.split("\n")
15 option_list = []
16 for line in help_output:
17 cleaned_line = line.lstrip()
18 if cleaned_line.startswith("--"):
19 option = cleaned_line.split()[0]
20 option = option.split("=")[0]
21 option_list.append(option)
22
23 return option_list
24
25
26 def cpu_vendor():
27 vendor = "intel"
28 if os.system("grep vmx /proc/cpuinfo 1>/dev/null") != 0:
29 vendor = "amd"
30 logging.debug("Detected CPU vendor as '%s'", vendor)
31 return vendor
32
33
34 def save_build(build_dir, dest_dir):
35 logging.debug('Saving the result of the build on %s', dest_dir)
36 base_name = os.path.basename(build_dir)
37 tarball_name = base_name + '.tar.bz2'
38 os.chdir(os.path.dirname(build_dir))
39 utils.system('tar -cjf %s %s' % (tarball_name, base_name))
40 shutil.move(tarball_name, os.path.join(dest_dir, tarball_name))
OLDNEW
« no previous file with comments | « client/virt/virt_env_process.py ('k') | client/virt/virt_scheduler.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698