mirror of
git://git.yoctoproject.org/poky
synced 2026-08-12 01:19:30 +00:00
oeqa: don't litter /tmp with temporary directories
If we need to create a temporary directory in targetbuild or buildproject use tempfile.TemporaryDirectory so that when the test case is finished, the directory is deleted. Also synchronise the logic and don't possibly store the temporary directory in self.tmpdir as nothing uses that. (From OE-Core rev: db0e658097130d146752785d0d45f46a3e0bad71) (From OE-Core rev: 6e2c6668791a80ee0ffe44c756cc0caceebea0e2) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
c7ff99ab44
commit
29361d7aeb
@ -17,7 +17,8 @@ class BuildProject(metaclass=ABCMeta):
|
||||
self.uri = uri
|
||||
self.archive = os.path.basename(uri)
|
||||
if not tmpdir:
|
||||
tmpdir = tempfile.mkdtemp(prefix='buildproject')
|
||||
self.tempdirobj = tempfile.TemporaryDirectory(prefix='buildproject-')
|
||||
tmpdir = self.tempdirobj.name
|
||||
self.localarchive = os.path.join(tmpdir, self.archive)
|
||||
self.dl_dir = dl_dir
|
||||
if foldername:
|
||||
|
||||
@ -20,8 +20,9 @@ class BuildProject(metaclass=ABCMeta):
|
||||
if not tmpdir:
|
||||
tmpdir = self.d.getVar('WORKDIR')
|
||||
if not tmpdir:
|
||||
tmpdir = tempfile.mkdtemp(prefix='buildproject')
|
||||
self.localarchive = os.path.join(tmpdir,self.archive)
|
||||
self.tempdirobj = tempfile.TemporaryDirectory(prefix='buildproject-')
|
||||
tmpdir = self.tempdirobj.name
|
||||
self.localarchive = os.path.join(tmpdir, self.archive)
|
||||
if foldername:
|
||||
self.fname = foldername
|
||||
else:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user