From eb8dc40360f0cfef56fb6947cc817a547d6d9bc6 Mon Sep 17 00:00:00 2001 From: Dave Cobbley Date: Tue, 14 Aug 2018 10:05:37 -0700 Subject: [Subtree] Removing import-layers directory As part of the move to subtrees, need to bring all the import layers content to the top level. Change-Id: I4a163d10898cbc6e11c27f776f60e1a470049d8f Signed-off-by: Dave Cobbley Signed-off-by: Brad Bishop --- .../lib/oeqa/runtime/utils/targetbuildproject.py | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 poky/meta/lib/oeqa/runtime/utils/targetbuildproject.py (limited to 'poky/meta/lib/oeqa/runtime/utils/targetbuildproject.py') diff --git a/poky/meta/lib/oeqa/runtime/utils/targetbuildproject.py b/poky/meta/lib/oeqa/runtime/utils/targetbuildproject.py new file mode 100644 index 000000000..5af55d736 --- /dev/null +++ b/poky/meta/lib/oeqa/runtime/utils/targetbuildproject.py @@ -0,0 +1,39 @@ +# 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, uri, foldername=None, dl_dir=None): + self.target = target + self.targetdir = "~/" + BuildProject.__init__(self, uri, foldername, dl_dir=dl_dir) + + def download_archive(self): + self._download_archive() + + status, output = self.target.copyTo(self.localarchive, self.targetdir) + if status: + raise Exception('Failed to copy archive to target, ' + 'output: %s' % output) + + cmd = 'tar xf %s%s -C %s' % (self.targetdir, + self.archive, + self.targetdir) + status, output = self.target.run(cmd) + if status: + 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): + ret = self.target.run(cmd, 0) + msg = "Command %s failed with exit code %s: %s" % (cmd, ret[0], ret[1]) + if ret[0] != 0: + raise Exception(msg) + return ret[0] -- cgit v1.2.3