* [PATCH v2] Add ${S} to do_unpack[cleandirs]
@ 2016-03-22 7:24 Markus Lehtonen
2016-03-22 7:24 ` [PATCH v2] base.bbclass wipe ${S} before unpacking source Markus Lehtonen
0 siblings, 1 reply; 4+ messages in thread
From: Markus Lehtonen @ 2016-03-22 7:24 UTC (permalink / raw)
To: openembedded-core, Ross Burton
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(-)
--
2.6.2
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2] base.bbclass wipe ${S} before unpacking source
2016-03-22 7:24 [PATCH v2] Add ${S} to do_unpack[cleandirs] Markus Lehtonen
@ 2016-03-22 7:24 ` Markus Lehtonen
2016-03-22 7:47 ` Richard Purdie
0 siblings, 1 reply; 4+ messages in thread
From: Markus Lehtonen @ 2016-03-22 7:24 UTC (permalink / raw)
To: openembedded-core, Ross Burton
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 1372f38..aa107d4 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 ''}"
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] 4+ messages in thread
* Re: [PATCH v2] base.bbclass wipe ${S} before unpacking source
2016-03-22 7:24 ` [PATCH v2] base.bbclass wipe ${S} before unpacking source Markus Lehtonen
@ 2016-03-22 7:47 ` Richard Purdie
2016-03-22 16:45 ` Markus Lehtonen
0 siblings, 1 reply; 4+ messages in thread
From: Richard Purdie @ 2016-03-22 7:47 UTC (permalink / raw)
To: Markus Lehtonen, openembedded-core, Ross Burton
On Tue, 2016-03-22 at 09:24 +0200, Markus Lehtonen 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 1372f38..aa107d4 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 ''}"
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] base.bbclass wipe ${S} before unpacking source
2016-03-22 7:47 ` Richard Purdie
@ 2016-03-22 16:45 ` Markus Lehtonen
0 siblings, 0 replies; 4+ messages in thread
From: Markus Lehtonen @ 2016-03-22 16:45 UTC (permalink / raw)
To: Richard Purdie, openembedded-core, Ross Burton
On 22/03/16 09:47, "Richard Purdie" <richard.purdie@linuxfoundation.org> wrote:
>On Tue, 2016-03-22 at 09:24 +0200, Markus Lehtonen 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 1372f38..aa107d4 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 ''}"
>
>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?
Yes, it should. Good catch, thank you Richard!
Cheers,
Markus
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-03-22 16:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-22 7:24 [PATCH v2] Add ${S} to do_unpack[cleandirs] Markus Lehtonen
2016-03-22 7:24 ` [PATCH v2] base.bbclass wipe ${S} before unpacking source Markus Lehtonen
2016-03-22 7:47 ` Richard Purdie
2016-03-22 16:45 ` Markus Lehtonen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox