Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH v3] base.bbclass wipe ${S} before unpacking source
@ 2016-03-22 16:47 Markus Lehtonen
  2016-05-10  7:56 ` Markus Lehtonen
  0 siblings, 1 reply; 5+ messages in thread
From: Markus Lehtonen @ 2016-03-22 16:47 UTC (permalink / raw)
  To: openembedded-core

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

[YOCTO #9064]

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
---
 meta/classes/base.bbclass | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index e066dc9..2acb2b6 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -133,23 +133,15 @@ python base_do_fetch() {
 
 addtask unpack after do_fetch
 do_unpack[dirs] = "${WORKDIR}"
+do_unpack[cleandirs] = "${@d.getVar('S', True) if d.getVar('S', True) != d.getVar('WORKDIR', True) else os.path.join(d.getVar('S', True), 'patches')}"
 python base_do_unpack() {
     src_uri = (d.getVar('SRC_URI', True) or "").split()
     if len(src_uri) == 0:
         return
 
-    rootdir = d.getVar('WORKDIR', True)
-
-    # Ensure that we cleanup ${S}/patches
-    # TODO: Investigate if we can remove
-    # the entire ${S} in this case.
-    s_dir = d.getVar('S', True)
-    p_dir = os.path.join(s_dir, 'patches')
-    bb.utils.remove(p_dir, True)
-
     try:
         fetcher = bb.fetch2.Fetch(src_uri, d)
-        fetcher.unpack(rootdir)
+        fetcher.unpack(d.getVar('WORKDIR', True))
     except bb.fetch2.BBFetchException as e:
         raise bb.build.FuncFailed(e)
 }
-- 
2.6.2



^ permalink raw reply related	[flat|nested] 5+ messages in thread
* [PATCH v3] Add ${S} to do_unpack[cleandirs]
@ 2016-08-03  7:28 Markus Lehtonen
  2016-08-03  7:28 ` [PATCH v3] base.bbclass wipe ${S} before unpacking source Markus Lehtonen
  0 siblings, 1 reply; 5+ messages in thread
From: Markus Lehtonen @ 2016-08-03  7:28 UTC (permalink / raw)
  To: openembedded-core

The second version of this patch broke usage of externalsrc. The resason was
that while externalsrc.bbclass mangles do_unpack[cleandirs] flag in order to
make sure that the source directory is never wiped, it was not able to cope
with the complicated Python expression used in the flag value in v2 of this
patch. Version 3 of the patch fixes the issue by moving Python code outside the
value assignment.

Markus Lehtonen (1):
  base.bbclass wipe ${S} before unpacking source

 meta/classes/base.bbclass | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

-- 
2.6.6



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-08-03  7:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-22 16:47 [PATCH v3] base.bbclass wipe ${S} before unpacking source Markus Lehtonen
2016-05-10  7:56 ` Markus Lehtonen
2016-05-11  4:34   ` Petter Mabäcker
2016-06-22 10:11     ` Markus Lehtonen
  -- strict thread matches above, loose matches on Subject: below --
2016-08-03  7:28 [PATCH v3] Add ${S} to do_unpack[cleandirs] Markus Lehtonen
2016-08-03  7:28 ` [PATCH v3] base.bbclass wipe ${S} before unpacking source Markus Lehtonen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox