[OE-core] [PATCH] base.bbclass wipe ${S} before unpacking source

Markus Lehtonen markus.lehtonen at linux.intel.com
Tue Feb 23 11:36:23 UTC 2016


Make sure that we have a pristine source tree after do_unpack.

[YOCTO #9064]

Signed-off-by: Markus Lehtonen <markus.lehtonen at linux.intel.com>
---
 meta/classes/base.bbclass | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 1372f38..717a01e 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -140,12 +140,10 @@ python base_do_unpack() {
 
     rootdir = d.getVar('WORKDIR', True)
 
-    # Ensure that we cleanup ${S}/patches
-    # TODO: Investigate if we can remove
-    # the entire ${S} in this case.
+    # Cleanup ${S}
     s_dir = d.getVar('S', True)
-    p_dir = os.path.join(s_dir, 'patches')
-    bb.utils.remove(p_dir, True)
+    if s_dir != rootdir and not d.getVar("EXTERNALSRC", True):
+        bb.utils.remove(s_dir, True)
 
     try:
         fetcher = bb.fetch2.Fetch(src_uri, d)
-- 
2.6.2




More information about the Openembedded-core mailing list