From 525fd2a5cda00890e921b63f7f608a10bc024d73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= Date: Wed, 2 Nov 2016 13:04:28 -0600 Subject: oeqa/utils: Move targetbuild to buildproject module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The new buildproject module will contain only BuildProject class a helper class for build source code. The remaining classes TargetBuildProject and SDKBuildProject was move to runtime and sdk respectively. [YOCTO #10599] Signed-off-by: Aníbal Limón Signed-off-by: Mariano Lopez --- meta/lib/oeqa/runtime/utils/targetbuildproject.py | 33 +++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 meta/lib/oeqa/runtime/utils/targetbuildproject.py (limited to 'meta/lib/oeqa/runtime/utils/targetbuildproject.py') diff --git a/meta/lib/oeqa/runtime/utils/targetbuildproject.py b/meta/lib/oeqa/runtime/utils/targetbuildproject.py new file mode 100644 index 0000000000..138b5ef041 --- /dev/null +++ b/meta/lib/oeqa/runtime/utils/targetbuildproject.py @@ -0,0 +1,33 @@ +# Copyright (C) 2016 Intel Corporation +# Released under the MIT license (see COPYING.MIT) + +from oeqa.utils.buildproject import BuildProject + +class TargetBuildProject(BuildProject): + + def __init__(self, target, d, uri, foldername=None): + self.target = target + self.targetdir = "~/" + BuildProject.__init__(self, d, uri, foldername, tmpdir="/tmp") + + def download_archive(self): + + self._download_archive() + + (status, output) = self.target.copy_to(self.localarchive, self.targetdir) + if status != 0: + raise Exception("Failed to copy archive to target, output: %s" % output) + + (status, output) = self.target.run('tar xf %s%s -C %s' % (self.targetdir, self.archive, self.targetdir)) + if status != 0: + raise Exception("Failed to extract archive, output: %s" % output) + + #Change targetdir to project folder + self.targetdir = self.targetdir + self.fname + + # The timeout parameter of target.run is set to 0 to make the ssh command + # run with no timeout. + def _run(self, cmd): + return self.target.run(cmd, 0)[0] + + -- cgit v1.2.3