OLD | NEW |
---|---|
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 | 2 |
3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 import common, commands, os | 7 import common, commands, logging, os |
petkov
2010/02/26 21:59:44
Is common needed?
| |
8 from autotest_lib.client.bin import utils | 8 from autotest_lib.client.bin import utils |
9 | 9 |
10 version = 1 | 10 version = 1 |
11 | 11 |
12 def setup(top_dir): | 12 def setup(top_dir): |
13 root = commands.getoutput('echo $GCLIENT_ROOT') | 13 autox_bin = os.environ['SYSROOT'] + '/usr/bin/autox' |
14 | 14 [status, output] = commands.getstatusoutput( |
petkov
2010/02/26 21:59:44
Maybe use shutils.copytree instead?
| |
15 # Make the debian package first | 15 'cp %s %s' % (autox_bin, top_dir)) |
16 autox_dir = '%s/src/platform/autox' % root | 16 if status != 0: |
17 os.chdir(autox_dir) | 17 logging.error(output) |
18 utils.system('./make_pkg.sh') | |
19 os.chdir(top_dir) | |
20 | |
21 # TODO(sosa@chromium.org) - Find out a way to figure out whether to use | |
22 # arm vs. x86 | |
23 deb_dir = '%s/%s' % (root, 'src/build/x86/local_packages') | |
24 package_regexp = 'chromeos-autox*' | |
25 | |
26 # Get the latest chromeos-autox package | |
27 find_cmd = 'find %s -name %s | tail -n 1' % (deb_dir, package_regexp) | |
28 deb_pkg = commands.getoutput(find_cmd) | |
29 | |
30 if deb_pkg == '': | |
31 raise error.TestError('ChromeOS autox package not found') | |
32 | |
33 # The path of the dpkg script used to install debian packages | |
34 dpkg_script = '%s/src/scripts/dpkg_no_scripts.sh' % root | |
35 | |
36 utils.system('%s --root %s --unpack %s' % (dpkg_script, top_dir, deb_pkg)) | |
37 | 18 |
38 pwd = os.getcwd() | 19 pwd = os.getcwd() |
39 utils.update_version(pwd + '/src', False, version, setup, pwd) | 20 utils.update_version(pwd + '/src', False, version, setup, pwd) |
OLD | NEW |