devserver: start using payload scripts bundled with devserver
This follows CL's which move payload generators to devutils, and
removes the dependency on these scripts in src/scripts.
Following this, the autogeneration of payloads by the devserver
installed in chroot should work.
BUG=chromium-os:5246
TEST=cros_au_test_harness
Change-Id: Id3be5e140e93ee1813849f6ede6bbac53c60dde4
Review URL: http://codereview.chromium.org/6542009
diff --git a/buildutil.py b/buildutil.py
index 2447b2c..29b89f9 100644
--- a/buildutil.py
+++ b/buildutil.py
@@ -2,20 +2,23 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import os, sys
+
class BuildObject(object):
"""
Common base class that defines key paths in the source tree.
"""
def __init__(self, root_dir, static_dir):
- self.app_id = "87efface-864d-49a5-9bb3-4b050a7c227a"
+ self.app_id = '87efface-864d-49a5-9bb3-4b050a7c227a'
self.root_dir = root_dir
- self.scripts_dir = "%s/scripts" % self.root_dir
+ self.scripts_dir = '%s/src/scripts' % os.environ['CROS_WORKON_SRCROOT']
+ self.devserver_dir = os.path.dirname(os.path.abspath(sys.argv[0]))
self.static_dir = static_dir
- self.x86_pkg_dir = "%s/build/x86/local_packages" % self.root_dir
+ self.x86_pkg_dir = '%s/build/x86/local_packages' % self.root_dir
- def AssertSystemCallSuccess(self, err, cmd="unknown"):
+ def AssertSystemCallSuccess(self, err, cmd='unknown'):
"""
TODO(rtc): This code should probably live somewhere else.
"""
if err != 0:
- raise Exception("%s failed to execute" % cmd)
+ raise Exception('%s failed to execute' % cmd)