summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Lock <joshua.g.lock@intel.com>2017-04-05 13:10:53 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-04-06 10:13:39 +0100
commit04cf8ad80e11f88257fb8278755c2710dde2c7e7 (patch)
tree917d7d33d4706fe29cebf7d89cc397af7b459227
parent3468b4d96cdaeddc4027514f22293c205d6619b7 (diff)
downloadpoky-04cf8ad80e11f88257fb8278755c2710dde2c7e7.tar.gz
oeqa/utils/buildproject: create a more unique tmp dir
Rather than hardcoding /tmp as the default tmpdir make a more unique tmpdir with tempfile.mkdtemp() when the caller doesn't specify a tmpdir value. (From OE-Core rev: 9425c2658fea0b45468a04574cd77bffc6668a8d) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oeqa/utils/buildproject.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/meta/lib/oeqa/utils/buildproject.py b/meta/lib/oeqa/utils/buildproject.py
index fc8879cfb8..487f08be49 100644
--- a/meta/lib/oeqa/utils/buildproject.py
+++ b/meta/lib/oeqa/utils/buildproject.py
@@ -8,14 +8,17 @@ import os
8import re 8import re
9import subprocess 9import subprocess
10import shutil 10import shutil
11import tempfile
11 12
12from abc import ABCMeta, abstractmethod 13from abc import ABCMeta, abstractmethod
13 14
14class BuildProject(metaclass=ABCMeta): 15class BuildProject(metaclass=ABCMeta):
15 def __init__(self, uri, foldername=None, tmpdir="/tmp/", dl_dir=None): 16 def __init__(self, uri, foldername=None, tmpdir=None, dl_dir=None):
16 self.uri = uri 17 self.uri = uri
17 self.archive = os.path.basename(uri) 18 self.archive = os.path.basename(uri)
18 self.localarchive = os.path.join(tmpdir,self.archive) 19 if not tmpdir:
20 tmpdir = tempfile.mkdtemp(prefix='buildproject')
21 self.localarchive = os.path.join(tmpdir, self.archive)
19 self.dl_dir = dl_dir 22 self.dl_dir = dl_dir
20 if foldername: 23 if foldername:
21 self.fname = foldername 24 self.fname = foldername