diff options
| author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-09-25 16:14:47 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-10-07 15:10:33 +0100 |
| commit | dd1f464f36e0c073f7d12a14536bc19dd154ac8a (patch) | |
| tree | c815dbeac964ee388f97410d2288bfb2f08a5580 /meta/lib/oeqa/utils/targetbuild.py | |
| parent | e22125b0c20b213364a8456df8f69a31e735ca61 (diff) | |
| download | poky-dd1f464f36e0c073f7d12a14536bc19dd154ac8a.tar.gz | |
oeqa/buildproject: Ensure temp directories are cleaned up
(From OE-Core rev: 15db91abd152aa3d22d24f951ba7663ab59ff7eb)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit d10aff865120a5feecc42c24726bd119364e0188)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/utils/targetbuild.py')
| -rw-r--r-- | meta/lib/oeqa/utils/targetbuild.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/meta/lib/oeqa/utils/targetbuild.py b/meta/lib/oeqa/utils/targetbuild.py index 1055810ca3..09738add1d 100644 --- a/meta/lib/oeqa/utils/targetbuild.py +++ b/meta/lib/oeqa/utils/targetbuild.py | |||
| @@ -19,6 +19,7 @@ class BuildProject(metaclass=ABCMeta): | |||
| 19 | self.d = d | 19 | self.d = d |
| 20 | self.uri = uri | 20 | self.uri = uri |
| 21 | self.archive = os.path.basename(uri) | 21 | self.archive = os.path.basename(uri) |
| 22 | self.tempdirobj = None | ||
| 22 | if not tmpdir: | 23 | if not tmpdir: |
| 23 | tmpdir = self.d.getVar('WORKDIR') | 24 | tmpdir = self.d.getVar('WORKDIR') |
| 24 | if not tmpdir: | 25 | if not tmpdir: |
| @@ -71,9 +72,10 @@ class BuildProject(metaclass=ABCMeta): | |||
| 71 | return self._run('cd %s; make install %s' % (self.targetdir, install_args)) | 72 | return self._run('cd %s; make install %s' % (self.targetdir, install_args)) |
| 72 | 73 | ||
| 73 | def clean(self): | 74 | def clean(self): |
| 75 | if self.tempdirobj: | ||
| 76 | self.tempdirobj.cleanup() | ||
| 74 | self._run('rm -rf %s' % self.targetdir) | 77 | self._run('rm -rf %s' % self.targetdir) |
| 75 | subprocess.check_call('rm -f %s' % self.localarchive, shell=True) | 78 | subprocess.check_call('rm -f %s' % self.localarchive, shell=True) |
| 76 | pass | ||
| 77 | 79 | ||
| 78 | class TargetBuildProject(BuildProject): | 80 | class TargetBuildProject(BuildProject): |
| 79 | 81 | ||
