* [PATCH] sanity.bbclass: Add sanity check that TUNE_PKGARCH appears in PACKAGE_ARCHS
@ 2011-07-29 0:07 Kumar Gala
2011-07-29 0:41 ` Saul Wold
2011-08-02 17:29 ` Saul Wold
0 siblings, 2 replies; 6+ messages in thread
From: Kumar Gala @ 2011-07-29 0:07 UTC (permalink / raw)
To: openembedded-core
Its possible we get duplications if we explicity add TUNE_PKGARCH to
PACKAGE_ARCHS so instead just add a sanity check to verify it.
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
meta/classes/sanity.bbclass | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
index b054146..999e15d 100644
--- a/meta/classes/sanity.bbclass
+++ b/meta/classes/sanity.bbclass
@@ -375,8 +375,10 @@ def check_sanity(e):
elif oeroot.find (' ') != -1:
messages = messages + "Error, you have a space in your COREBASE directory path. Please move the installation to a directory which doesn't include a space."
- # Check that we don't have duplicate entries in PACKAGE_ARCHS
+ # Check that we don't have duplicate entries in PACKAGE_ARCHS & that TUNE_PKGARCH is in PACKAGE_ARCHS
pkgarchs = data.getVar('PACKAGE_ARCHS', e.data, True)
+ tunepkg = data.getVar('TUNE_PKGARCH', e.data, True)
+ tunefound = False
seen = {}
dups = []
@@ -385,9 +387,15 @@ def check_sanity(e):
dups.append(pa)
else:
seen[pa] = 1
+ if pa == tunepkg:
+ tunefound = True
+
if len(dups):
messages = messages + "Error, the PACKAGE_ARCHS variable contains duplicates. The following archs are listed more than once: %s" % " ".join(dups)
+ if tunefound == False:
+ messages = messages + "Error, the PACKAGE_ARCHS variable does not contain TUNE_PKGARCH (%s)." % tunepkg
+
if messages != "":
raise_sanity_error(messages)
--
1.7.3.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] sanity.bbclass: Add sanity check that TUNE_PKGARCH appears in PACKAGE_ARCHS
2011-07-29 0:07 [PATCH] sanity.bbclass: Add sanity check that TUNE_PKGARCH appears in PACKAGE_ARCHS Kumar Gala
@ 2011-07-29 0:41 ` Saul Wold
2011-07-29 1:57 ` Kumar Gala
2011-08-02 17:29 ` Saul Wold
1 sibling, 1 reply; 6+ messages in thread
From: Saul Wold @ 2011-07-29 0:41 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
On 07/28/2011 05:07 PM, Kumar Gala wrote:
> Its possible we get duplications if we explicity add TUNE_PKGARCH to
> PACKAGE_ARCHS so instead just add a sanity check to verify it.
>
> Signed-off-by: Kumar Gala<galak@kernel.crashing.org>
> ---
> meta/classes/sanity.bbclass | 10 +++++++++-
> 1 files changed, 9 insertions(+), 1 deletions(-)
>
> diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
> index b054146..999e15d 100644
> --- a/meta/classes/sanity.bbclass
> +++ b/meta/classes/sanity.bbclass
> @@ -375,8 +375,10 @@ def check_sanity(e):
> elif oeroot.find (' ') != -1:
> messages = messages + "Error, you have a space in your COREBASE directory path. Please move the installation to a directory which doesn't include a space."
>
> - # Check that we don't have duplicate entries in PACKAGE_ARCHS
> + # Check that we don't have duplicate entries in PACKAGE_ARCHS& that TUNE_PKGARCH is in PACKAGE_ARCHS
> pkgarchs = data.getVar('PACKAGE_ARCHS', e.data, True)
> + tunepkg = data.getVar('TUNE_PKGARCH', e.data, True)
> + tunefound = False
> seen = {}
> dups = []
>
> @@ -385,9 +387,15 @@ def check_sanity(e):
> dups.append(pa)
> else:
> seen[pa] = 1
> + if pa == tunepkg:
> + tunefound = True
> +
> if len(dups):
> messages = messages + "Error, the PACKAGE_ARCHS variable contains duplicates. The following archs are listed more than once: %s" % " ".join(dups)
>
Kumar,
Thanks for the patch, some questions.
Is this correct, do you still want to report the error, if there is a dup?
Would it not just be better to just drop the dup if it is the TUNE_PKGARCH?
Sau!
> + if tunefound == False:
> + messages = messages + "Error, the PACKAGE_ARCHS variable does not contain TUNE_PKGARCH (%s)." % tunepkg
> +
> if messages != "":
> raise_sanity_error(messages)
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] sanity.bbclass: Add sanity check that TUNE_PKGARCH appears in PACKAGE_ARCHS
2011-07-29 0:41 ` Saul Wold
@ 2011-07-29 1:57 ` Kumar Gala
2011-07-29 3:07 ` Saul Wold
0 siblings, 1 reply; 6+ messages in thread
From: Kumar Gala @ 2011-07-29 1:57 UTC (permalink / raw)
To: Saul Wold; +Cc: Patches and discussions about the oe-core layer
On Jul 28, 2011, at 7:41 PM, Saul Wold wrote:
> On 07/28/2011 05:07 PM, Kumar Gala wrote:
>> Its possible we get duplications if we explicity add TUNE_PKGARCH to
>> PACKAGE_ARCHS so instead just add a sanity check to verify it.
>>
>> Signed-off-by: Kumar Gala<galak@kernel.crashing.org>
>> ---
>> meta/classes/sanity.bbclass | 10 +++++++++-
>> 1 files changed, 9 insertions(+), 1 deletions(-)
>>
>> diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
>> index b054146..999e15d 100644
>> --- a/meta/classes/sanity.bbclass
>> +++ b/meta/classes/sanity.bbclass
>> @@ -375,8 +375,10 @@ def check_sanity(e):
>> elif oeroot.find (' ') != -1:
>> messages = messages + "Error, you have a space in your COREBASE directory path. Please move the installation to a directory which doesn't include a space."
>>
>> - # Check that we don't have duplicate entries in PACKAGE_ARCHS
>> + # Check that we don't have duplicate entries in PACKAGE_ARCHS& that TUNE_PKGARCH is in PACKAGE_ARCHS
>> pkgarchs = data.getVar('PACKAGE_ARCHS', e.data, True)
>> + tunepkg = data.getVar('TUNE_PKGARCH', e.data, True)
>> + tunefound = False
>> seen = {}
>> dups = []
>>
>> @@ -385,9 +387,15 @@ def check_sanity(e):
>> dups.append(pa)
>> else:
>> seen[pa] = 1
>> + if pa == tunepkg:
>> + tunefound = True
>> +
>> if len(dups):
>> messages = messages + "Error, the PACKAGE_ARCHS variable contains duplicates. The following archs are listed more than once: %s" % " ".join(dups)
>>
> Kumar,
>
> Thanks for the patch, some questions.
>
> Is this correct, do you still want to report the error, if there is a dup?
>
> Would it not just be better to just drop the dup if it is the TUNE_PKGARCH?
I wasn't sure how to drop the dup. :)
If there is a way to uniq PACKAGE_ARCHS that would be fine
- k
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] sanity.bbclass: Add sanity check that TUNE_PKGARCH appears in PACKAGE_ARCHS
2011-07-29 1:57 ` Kumar Gala
@ 2011-07-29 3:07 ` Saul Wold
2011-07-29 12:54 ` Kumar Gala
0 siblings, 1 reply; 6+ messages in thread
From: Saul Wold @ 2011-07-29 3:07 UTC (permalink / raw)
To: Kumar Gala; +Cc: Patches and discussions about the oe-core layer
On 07/28/2011 06:57 PM, Kumar Gala wrote:
>
> On Jul 28, 2011, at 7:41 PM, Saul Wold wrote:
>
>> On 07/28/2011 05:07 PM, Kumar Gala wrote:
>>> Its possible we get duplications if we explicity add TUNE_PKGARCH to
>>> PACKAGE_ARCHS so instead just add a sanity check to verify it.
>>>
>>> Signed-off-by: Kumar Gala<galak@kernel.crashing.org>
>>> ---
>>> meta/classes/sanity.bbclass | 10 +++++++++-
>>> 1 files changed, 9 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
>>> index b054146..999e15d 100644
>>> --- a/meta/classes/sanity.bbclass
>>> +++ b/meta/classes/sanity.bbclass
>>> @@ -375,8 +375,10 @@ def check_sanity(e):
>>> elif oeroot.find (' ') != -1:
>>> messages = messages + "Error, you have a space in your COREBASE directory path. Please move the installation to a directory which doesn't include a space."
>>>
>>> - # Check that we don't have duplicate entries in PACKAGE_ARCHS
>>> + # Check that we don't have duplicate entries in PACKAGE_ARCHS& that TUNE_PKGARCH is in PACKAGE_ARCHS
>>> pkgarchs = data.getVar('PACKAGE_ARCHS', e.data, True)
>>> + tunepkg = data.getVar('TUNE_PKGARCH', e.data, True)
>>> + tunefound = False
>>> seen = {}
>>> dups = []
>>>
>>> @@ -385,9 +387,15 @@ def check_sanity(e):
>>> dups.append(pa)
>>> else:
>>> seen[pa] = 1
>>> + if pa == tunepkg:
>>> + tunefound = True
>>> +
>>> if len(dups):
>>> messages = messages + "Error, the PACKAGE_ARCHS variable contains duplicates. The following archs are listed more than once: %s" % " ".join(dups)
>>>
>> Kumar,
>>
>> Thanks for the patch, some questions.
>>
>> Is this correct, do you still want to report the error, if there is a dup?
>>
>> Would it not just be better to just drop the dup if it is the TUNE_PKGARCH?
>
> I wasn't sure how to drop the dup. :)
>
> If there is a way to uniq PACKAGE_ARCHS that would be fine
>
Would this be what your looking for, it "uniq"s only the tunepkg value.
- if seen.get(pa, 0) == 1:
+ if pa == tunepkg:
+ tunefound = True
+ if seen.get(pa, 0) == 1:
+ pkgarchs.remove(pa)
+ elif seen.get(pa, 0) == 1:
dups.append(pa)
else:
seen[pa] = 1
- if pa == tunepkg:
- tunefound = True
> - k
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] sanity.bbclass: Add sanity check that TUNE_PKGARCH appears in PACKAGE_ARCHS
2011-07-29 3:07 ` Saul Wold
@ 2011-07-29 12:54 ` Kumar Gala
0 siblings, 0 replies; 6+ messages in thread
From: Kumar Gala @ 2011-07-29 12:54 UTC (permalink / raw)
To: Saul Wold; +Cc: Patches and discussions about the oe-core layer
On Jul 28, 2011, at 10:07 PM, Saul Wold wrote:
> On 07/28/2011 06:57 PM, Kumar Gala wrote:
>>
>> On Jul 28, 2011, at 7:41 PM, Saul Wold wrote:
>>
>>> On 07/28/2011 05:07 PM, Kumar Gala wrote:
>>>> Its possible we get duplications if we explicity add TUNE_PKGARCH to
>>>> PACKAGE_ARCHS so instead just add a sanity check to verify it.
>>>>
>>>> Signed-off-by: Kumar Gala<galak@kernel.crashing.org>
>>>> ---
>>>> meta/classes/sanity.bbclass | 10 +++++++++-
>>>> 1 files changed, 9 insertions(+), 1 deletions(-)
>>>>
>>>> diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
>>>> index b054146..999e15d 100644
>>>> --- a/meta/classes/sanity.bbclass
>>>> +++ b/meta/classes/sanity.bbclass
>>>> @@ -375,8 +375,10 @@ def check_sanity(e):
>>>> elif oeroot.find (' ') != -1:
>>>> messages = messages + "Error, you have a space in your COREBASE directory path. Please move the installation to a directory which doesn't include a space."
>>>>
>>>> - # Check that we don't have duplicate entries in PACKAGE_ARCHS
>>>> + # Check that we don't have duplicate entries in PACKAGE_ARCHS& that TUNE_PKGARCH is in PACKAGE_ARCHS
>>>> pkgarchs = data.getVar('PACKAGE_ARCHS', e.data, True)
>>>> + tunepkg = data.getVar('TUNE_PKGARCH', e.data, True)
>>>> + tunefound = False
>>>> seen = {}
>>>> dups = []
>>>>
>>>> @@ -385,9 +387,15 @@ def check_sanity(e):
>>>> dups.append(pa)
>>>> else:
>>>> seen[pa] = 1
>>>> + if pa == tunepkg:
>>>> + tunefound = True
>>>> +
>>>> if len(dups):
>>>> messages = messages + "Error, the PACKAGE_ARCHS variable contains duplicates. The following archs are listed more than once: %s" % " ".join(dups)
>>>>
>>> Kumar,
>>>
>>> Thanks for the patch, some questions.
>>>
>>> Is this correct, do you still want to report the error, if there is a dup?
>>>
>>> Would it not just be better to just drop the dup if it is the TUNE_PKGARCH?
>>
>> I wasn't sure how to drop the dup. :)
>>
>> If there is a way to uniq PACKAGE_ARCHS that would be fine
>>
> Would this be what your looking for, it "uniq"s only the tunepkg value.
>
> - if seen.get(pa, 0) == 1:
> + if pa == tunepkg:
> + tunefound = True
> + if seen.get(pa, 0) == 1:
> + pkgarchs.remove(pa)
> + elif seen.get(pa, 0) == 1:
> dups.append(pa)
> else:
> seen[pa] = 1
> - if pa == tunepkg:
> - tunefound = True
No, I don't thing that's right. TUNE_PKGARCH is a singleton. The other check was to make sure that we didn't have ANY duplicates in PACKAGE_ARCHS. I think that is still valid as the code stands.
- k
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] sanity.bbclass: Add sanity check that TUNE_PKGARCH appears in PACKAGE_ARCHS
2011-07-29 0:07 [PATCH] sanity.bbclass: Add sanity check that TUNE_PKGARCH appears in PACKAGE_ARCHS Kumar Gala
2011-07-29 0:41 ` Saul Wold
@ 2011-08-02 17:29 ` Saul Wold
1 sibling, 0 replies; 6+ messages in thread
From: Saul Wold @ 2011-08-02 17:29 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
On 07/28/2011 05:07 PM, Kumar Gala wrote:
> Its possible we get duplications if we explicity add TUNE_PKGARCH to
> PACKAGE_ARCHS so instead just add a sanity check to verify it.
>
> Signed-off-by: Kumar Gala<galak@kernel.crashing.org>
> ---
> meta/classes/sanity.bbclass | 10 +++++++++-
> 1 files changed, 9 insertions(+), 1 deletions(-)
>
> diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
> index b054146..999e15d 100644
> --- a/meta/classes/sanity.bbclass
> +++ b/meta/classes/sanity.bbclass
> @@ -375,8 +375,10 @@ def check_sanity(e):
> elif oeroot.find (' ') != -1:
> messages = messages + "Error, you have a space in your COREBASE directory path. Please move the installation to a directory which doesn't include a space."
>
> - # Check that we don't have duplicate entries in PACKAGE_ARCHS
> + # Check that we don't have duplicate entries in PACKAGE_ARCHS& that TUNE_PKGARCH is in PACKAGE_ARCHS
> pkgarchs = data.getVar('PACKAGE_ARCHS', e.data, True)
> + tunepkg = data.getVar('TUNE_PKGARCH', e.data, True)
> + tunefound = False
> seen = {}
> dups = []
>
> @@ -385,9 +387,15 @@ def check_sanity(e):
> dups.append(pa)
> else:
> seen[pa] = 1
> + if pa == tunepkg:
> + tunefound = True
> +
> if len(dups):
> messages = messages + "Error, the PACKAGE_ARCHS variable contains duplicates. The following archs are listed more than once: %s" % " ".join(dups)
>
> + if tunefound == False:
> + messages = messages + "Error, the PACKAGE_ARCHS variable does not contain TUNE_PKGARCH (%s)." % tunepkg
> +
> if messages != "":
> raise_sanity_error(messages)
>
Merged as is into OE-Core, we still want to check for duplicates since
it means something else might be wrong.
Thanks
Sau!
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-08-02 17:33 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-29 0:07 [PATCH] sanity.bbclass: Add sanity check that TUNE_PKGARCH appears in PACKAGE_ARCHS Kumar Gala
2011-07-29 0:41 ` Saul Wold
2011-07-29 1:57 ` Kumar Gala
2011-07-29 3:07 ` Saul Wold
2011-07-29 12:54 ` Kumar Gala
2011-08-02 17:29 ` Saul Wold
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox