summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2018-11-09 12:48:39 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-11-14 11:14:39 +0000
commit8ec759a723db90519c50eec7f99f7b2c8f8c34d1 (patch)
treeb423912c91adeb889b79259fdc74f1dfec110ad8 /meta/lib
parent44ffe76f3724959e0f3bcaf5c059f20ec528b9b1 (diff)
downloadpoky-8ec759a723db90519c50eec7f99f7b2c8f8c34d1.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>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oeqa/utils/buildproject.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/meta/lib/oeqa/utils/buildproject.py b/meta/lib/oeqa/utils/buildproject.py
index 721f35d996..7e9b84955f 100644
--- a/meta/lib/oeqa/utils/buildproject.py
+++ b/meta/lib/oeqa/utils/buildproject.py
@@ -24,9 +24,12 @@ class BuildProject(metaclass=ABCMeta):
24 self.fname = foldername 24 self.fname = foldername
25 else: 25 else:
26 self.fname = re.sub(r'\.tar\.bz2$|\.tar\.gz$|\.tar\.xz$', '', self.archive) 26 self.fname = re.sub(r'\.tar\.bz2$|\.tar\.gz$|\.tar\.xz$', '', self.archive)
27 self.needclean = False
27 28
28 # Download self.archive to self.localarchive 29 # Download self.archive to self.localarchive
29 def _download_archive(self): 30 def _download_archive(self):
31
32 self.needclean = True
30 if self.dl_dir and os.path.exists(os.path.join(self.dl_dir, self.archive)): 33 if self.dl_dir and os.path.exists(os.path.join(self.dl_dir, self.archive)):
31 shutil.copyfile(os.path.join(self.dl_dir, self.archive), self.localarchive) 34 shutil.copyfile(os.path.join(self.dl_dir, self.archive), self.localarchive)
32 return 35 return
@@ -51,5 +54,7 @@ class BuildProject(metaclass=ABCMeta):
51 return self._run('cd %s; make install %s' % (self.targetdir, install_args)) 54 return self._run('cd %s; make install %s' % (self.targetdir, install_args))
52 55
53 def clean(self): 56 def clean(self):
57 if not self.needclean:
58 return
54 self._run('rm -rf %s' % self.targetdir) 59 self._run('rm -rf %s' % self.targetdir)
55 subprocess.check_call('rm -f %s' % self.localarchive, shell=True) 60 subprocess.check_call('rm -f %s' % self.localarchive, shell=True)