Skip to contentSkip to conversation

Add ${S} to do_unpack[cleandirs]

PATCH Superseded Markus Lehtonen 2 participants 4 messages Mar 22, 2016

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Add ${S} to do_unpack[cleandirs]

Resending this second iteration of the patch.

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

 meta/classes/base.bbclass | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)
Signature · 1 line
2.6.2
#1 lore raw

PATCH v2 1/1 base.bbclass wipe ${S} before unpacking source

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

[YOCTO #9064]

---
 meta/classes/base.bbclass | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)
meta/classes/base.bbclass +2 -10
index 1372f38..aa107d4 100644
@@ -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 ''}"
 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)
 }
Signature · 1 line
2.6.2
#2 lore raw

Re: [PATCH v2] base.bbclass wipe ${S} before unpacking source

Quoted 18 lines · Markus Lehtonen

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

[YOCTO #9064]

---
 meta/classes/base.bbclass | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)
meta/classes/base.bbclass +1 -0
index 1372f38..aa107d4 100644
@@ -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',
Quoted 1 line

True) != d.getVar('WORKDIR', True) else ''}"

Should this be else '${S}/patches'?

If we don't do that, there might be a case where we don't clean up the patches directory when we could/should compared to the existing code?

Cheers,

Richard

#3 lore raw

Re: [PATCH v2] base.bbclass wipe ${S} before unpacking source

Quoted 23 lines · Richard Purdie
Quoted 18 lines · Markus Lehtonen

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

[YOCTO #9064]

---
 meta/classes/base.bbclass | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)
meta/classes/base.bbclass +1 -0
index 1372f38..aa107d4 100644
@@ -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',
Quoted 1 line

True) != d.getVar('WORKDIR', True) else ''}"

Should this be else '${S}/patches'?

Quoted 2 lines

If we don't do that, there might be a case where we don't clean up the patches directory when we could/should compared to the existing code?

Yes, it should. Good catch, thank you Richard!

Cheers,
Markus