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

* Re: [PATCH v3] base.bbclass wipe ${S} before unpacking source
  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
  0 siblings, 1 reply; 5+ messages in thread
From: Markus Lehtonen @ 2016-05-10  7:56 UTC (permalink / raw)
  To: openembedded-core

Ping,

Any comments on this one?

Discussion on v2 of the patch:
http://lists.openembedded.org/pipermail/openembedded-core/2016-March/119295.html

Cheers,
  Markus



On 22/03/16 18:47, "Markus Lehtonen" <openembedded-core-bounces@lists.openembedded.org on behalf of markus.lehtonen@linux.intel.com> wrote:

>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
>
>-- 
>_______________________________________________
>Openembedded-core mailing list
>Openembedded-core@lists.openembedded.org
>http://lists.openembedded.org/mailman/listinfo/openembedded-core



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

* Re: [PATCH v3] base.bbclass wipe ${S} before unpacking source
  2016-05-10  7:56 ` Markus Lehtonen
@ 2016-05-11  4:34   ` Petter Mabäcker
  2016-06-22 10:11     ` Markus Lehtonen
  0 siblings, 1 reply; 5+ messages in thread
From: Petter Mabäcker @ 2016-05-11  4:34 UTC (permalink / raw)
  To: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 2226 bytes --]

 

Hi Markus, 

From my point of view it looks good, and all feedback
from v2 of the patch seems to have been handled as well. 

BR
Petter

Petter Mabäcker

Technux
<petter@technux.se>
www.technux.se

2016-05-10 09:56 skrev Markus
Lehtonen: 

> Ping,
> 
> Any comments on this one?
> 
> Discussion on v2
of the patch:
>
http://lists.openembedded.org/pipermail/openembedded-core/2016-March/119295.html
[2]
> 
> Cheers,
> Markus
> 
> On 22/03/16 18:47, "Markus Lehtonen"
<openembedded-core-bounces@lists.openembedded.org on behalf of
markus.lehtonen@linux.intel.com> wrote:
> 
>> 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
-- _______________________________________________ Openembedded-core
mailing list Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core [1]



Links:
------
[1]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
[2]
http://lists.openembedded.org/pipermail/openembedded-core/2016-March/119295.html

[-- Attachment #2: Type: text/html, Size: 2972 bytes --]

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

* Re: [PATCH v3] base.bbclass wipe ${S} before unpacking source
  2016-05-11  4:34   ` Petter Mabäcker
@ 2016-06-22 10:11     ` Markus Lehtonen
  0 siblings, 0 replies; 5+ messages in thread
From: Markus Lehtonen @ 2016-06-22 10:11 UTC (permalink / raw)
  To: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 2556 bytes --]

Ping! This hasn't been merged, yet I haven't seen any further comments.
  - Markus
On Wed, 2016-05-11 at 06:34 +0200, Petter Mabäcker wrote:
> Hi Markus, 
> 
> From my point of view it looks good, and all feedback from v2 of the
> patch seems to have been handled as well. 
> 
> BR Petter
> 
> Petter Mabäcker
> 
> Technux <petter@technux.se>
> www.technux.se
> 2016-05-10 09:56 skrev Markus Lehtonen:
> > Ping,
> > 
> > Any comments on this one?
> > 
> > Discussion on v2 of the patch:
> > http://lists.openembedded.org/pipermail/openembedded-core/2016-Marc
> > h/119295.html
> > 
> > Cheers,
> >   Markus
> > 
> > 
> > 
> > On 22/03/16 18:47, "Markus Lehtonen" <
> > openembedded-core-bounces@lists.openembedded.org on behalf of 
> > markus.lehtonen@linux.intel.com> wrote:
> > > Make sure that we have a pristine source tree after do_unpack.
> > > [YOCTO #9064] Signed-off-by: Markus Lehtonen
> > >  --- 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 --
> > > _______________________________________________ Openembedded-core
> > > mailing list Openembedded-core@lists.openembedded.org 
> > > http://lists.openembedded.org/mailman/listinfo/openembedded-core 
> -- 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core

[-- Attachment #2: Type: text/html, Size: 3471 bytes --]

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

* [PATCH v3] base.bbclass wipe ${S} before unpacking source
  2016-08-03  7:28 [PATCH v3] Add ${S} to do_unpack[cleandirs] Markus Lehtonen
@ 2016-08-03  7:28 ` Markus Lehtonen
  0 siblings, 0 replies; 5+ messages in thread
From: Markus Lehtonen @ 2016-08-03  7:28 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 | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 5d8e8d6..39acd1e 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -136,23 +136,22 @@ python base_do_fetch() {
 
 addtask unpack after do_fetch
 do_unpack[dirs] = "${WORKDIR}"
+
+python () {
+    if d.getVar('S', True) != d.getVar('WORKDIR', True):
+        d.setVarFlag('do_unpack', 'cleandirs', '${S}')
+    else:
+        d.setVarFlag('do_unpack', 'cleandirs', os.path.join('${S}', '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.6



^ permalink raw reply related	[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