summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/lib/oeqa/utils/targetbuild.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/meta/lib/oeqa/utils/targetbuild.py b/meta/lib/oeqa/utils/targetbuild.py
index 6f237b56f3..9249fa2635 100644
--- a/meta/lib/oeqa/utils/targetbuild.py
+++ b/meta/lib/oeqa/utils/targetbuild.py
@@ -8,14 +8,19 @@ import os
8import re 8import re
9import bb.utils 9import bb.utils
10import subprocess 10import subprocess
11import tempfile
11from abc import ABCMeta, abstractmethod 12from abc import ABCMeta, abstractmethod
12 13
13class BuildProject(metaclass=ABCMeta): 14class BuildProject(metaclass=ABCMeta):
14 15
15 def __init__(self, d, uri, foldername=None, tmpdir="/tmp/"): 16 def __init__(self, d, uri, foldername=None, tmpdir=None):
16 self.d = d 17 self.d = d
17 self.uri = uri 18 self.uri = uri
18 self.archive = os.path.basename(uri) 19 self.archive = os.path.basename(uri)
20 if not tmpdir:
21 tmpdir = self.d.getVar('WORKDIR')
22 if not tmpdir:
23 tmpdir = tempfile.mkdtemp(prefix='buildproject')
19 self.localarchive = os.path.join(tmpdir,self.archive) 24 self.localarchive = os.path.join(tmpdir,self.archive)
20 if foldername: 25 if foldername:
21 self.fname = foldername 26 self.fname = foldername
@@ -24,7 +29,6 @@ class BuildProject(metaclass=ABCMeta):
24 29
25 # Download self.archive to self.localarchive 30 # Download self.archive to self.localarchive
26 def _download_archive(self): 31 def _download_archive(self):
27
28 dl_dir = self.d.getVar("DL_DIR") 32 dl_dir = self.d.getVar("DL_DIR")
29 if dl_dir and os.path.exists(os.path.join(dl_dir, self.archive)): 33 if dl_dir and os.path.exists(os.path.join(dl_dir, self.archive)):
30 bb.utils.copyfile(os.path.join(dl_dir, self.archive), self.localarchive) 34 bb.utils.copyfile(os.path.join(dl_dir, self.archive), self.localarchive)
@@ -73,7 +77,7 @@ class TargetBuildProject(BuildProject):
73 def __init__(self, target, d, uri, foldername=None): 77 def __init__(self, target, d, uri, foldername=None):
74 self.target = target 78 self.target = target
75 self.targetdir = "~/" 79 self.targetdir = "~/"
76 BuildProject.__init__(self, d, uri, foldername, tmpdir="/tmp") 80 BuildProject.__init__(self, d, uri, foldername)
77 81
78 def download_archive(self): 82 def download_archive(self):
79 83