diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-11-09 12:48:39 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-02-25 22:13:06 +0000 |
commit | dab22dc58eabaeb421afa3c7de1cc08c5ec34c61 (patch) | |
tree | eee0fe544b3c1fb009826b342eace996a4a199b1 | |
parent | 1207949c986cc9f6b3940a99e87bc4d8cfb86d5b (diff) | |
download | openembedded-core-dab22dc58eabaeb421afa3c7de1cc08c5ec34c61.tar.gz |
oeqa/utils/buildproject: Only clean files if we've done something
We should only be wiping out things on target if the tests have
actually run.
(From OE-Core rev: d38c3eac0a5a1a9b0eb98385832e92f48145655e)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r-- | meta/lib/oeqa/utils/buildproject.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/meta/lib/oeqa/utils/buildproject.py b/meta/lib/oeqa/utils/buildproject.py index 88e7b7fe27..01a803ab61 100644 --- a/meta/lib/oeqa/utils/buildproject.py +++ b/meta/lib/oeqa/utils/buildproject.py @@ -25,9 +25,12 @@ class BuildProject(metaclass=ABCMeta): self.fname = foldername else: self.fname = re.sub(r'\.tar\.bz2$|\.tar\.gz$|\.tar\.xz$', '', self.archive) + self.needclean = False # Download self.archive to self.localarchive def _download_archive(self): + + self.needclean = True if self.dl_dir and os.path.exists(os.path.join(self.dl_dir, self.archive)): shutil.copyfile(os.path.join(self.dl_dir, self.archive), self.localarchive) return @@ -52,5 +55,7 @@ class BuildProject(metaclass=ABCMeta): return self._run('cd %s; make install %s' % (self.targetdir, install_args)) def clean(self): + if not self.needclean: + return self._run('rm -rf %s' % self.targetdir) subprocess.check_call('rm -f %s' % self.localarchive, shell=True) |