mirror of
https://git.yoctoproject.org/poky
synced 2026-02-26 19:39:40 +01:00
Don't use bitbake references inside utils modules, in order todo that changes getVar calls for arguments in the __init__ method like dl_dir for all the classes and testlogdir, builddatetime in SDKBUildProject. Also don't export proxies inside _download_archive method, a good practice is to setup the proxies at init of the process instead of do it in this helper module. [YOCTO #10231] [YOCTO #10599] (From OE-Core rev: 581c34d1efe9839f50ef322761269b4e4d8a56a6) Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
34 lines
1.1 KiB
Python
34 lines
1.1 KiB
Python
# 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, tmpdir="/tmp",
|
|
dl_dir=dl_dir)
|
|
|
|
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]
|
|
|
|
|