* [PATCH] license: fix LICENSE_CREATE_PACKAGE to stay disabled by default
@ 2013-01-29 12:37 Martin Jansa
2013-01-29 12:57 ` Otavio Salvador
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Martin Jansa @ 2013-01-29 12:37 UTC (permalink / raw)
To: openembedded-core
* as reported by Enrico on #oe
11:06:50 < ensc|w> JaMa: might this be caused by dc78ef91a2bf01efb8028c9afbe69e506e016265
which checks for 'd.getVar('LICENSE_CREATE_PACKAGE', True)' evaluating to 'True' for every
string (including the default 0)
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
meta/classes/license.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
index d4ebb26..9f38221 100644
--- a/meta/classes/license.bbclass
+++ b/meta/classes/license.bbclass
@@ -103,7 +103,7 @@ python do_populate_lic() {
# it would be better to copy them in do_install_append, but find_license_filesa is python
python perform_packagecopy_prepend () {
enabled = d.getVar('LICENSE_CREATE_PACKAGE', True)
- if d.getVar('CLASSOVERRIDE', True) == 'class-target' and enabled:
+ if d.getVar('CLASSOVERRIDE', True) == 'class-target' and enabled and enabled == "1":
lic_files_paths = find_license_files(d)
# LICENSE_FILES_DIRECTORY starts with '/' so os.path.join cannot be used to join D and LICENSE_FILES_DIRECTORY
--
1.8.1.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] license: fix LICENSE_CREATE_PACKAGE to stay disabled by default
2013-01-29 12:37 [PATCH] license: fix LICENSE_CREATE_PACKAGE to stay disabled by default Martin Jansa
@ 2013-01-29 12:57 ` Otavio Salvador
2013-01-29 13:04 ` [PATCHv2] " Martin Jansa
2013-01-29 21:17 ` [PATCHv3] " Martin Jansa
2 siblings, 0 replies; 8+ messages in thread
From: Otavio Salvador @ 2013-01-29 12:57 UTC (permalink / raw)
To: Martin Jansa; +Cc: Patches and discussions about the oe-core layer
On Tue, Jan 29, 2013 at 10:37 AM, Martin Jansa <martin.jansa@gmail.com> wrote:
> * as reported by Enrico on #oe
> 11:06:50 < ensc|w> JaMa: might this be caused by dc78ef91a2bf01efb8028c9afbe69e506e016265
> which checks for 'd.getVar('LICENSE_CREATE_PACKAGE', True)' evaluating to 'True' for every
> string (including the default 0)
>
> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
> ---
> meta/classes/license.bbclass | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
> index d4ebb26..9f38221 100644
> --- a/meta/classes/license.bbclass
> +++ b/meta/classes/license.bbclass
> @@ -103,7 +103,7 @@ python do_populate_lic() {
> # it would be better to copy them in do_install_append, but find_license_filesa is python
> python perform_packagecopy_prepend () {
> enabled = d.getVar('LICENSE_CREATE_PACKAGE', True)
> - if d.getVar('CLASSOVERRIDE', True) == 'class-target' and enabled:
> + if d.getVar('CLASSOVERRIDE', True) == 'class-target' and enabled and enabled == "1":
> lic_files_paths = find_license_files(d)
Uh?!? ... and enabled and enabled == "1"? You can drop the first no?
> # LICENSE_FILES_DIRECTORY starts with '/' so os.path.join cannot be used to join D and LICENSE_FILES_DIRECTORY
> --
> 1.8.1.2
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
--
Otavio Salvador O.S. Systems
E-mail: otavio@ossystems.com.br http://www.ossystems.com.br
Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCHv2] license: fix LICENSE_CREATE_PACKAGE to stay disabled by default
2013-01-29 12:37 [PATCH] license: fix LICENSE_CREATE_PACKAGE to stay disabled by default Martin Jansa
2013-01-29 12:57 ` Otavio Salvador
@ 2013-01-29 13:04 ` Martin Jansa
2013-01-29 14:29 ` Chris Larson
2013-01-29 21:17 ` [PATCHv3] " Martin Jansa
2 siblings, 1 reply; 8+ messages in thread
From: Martin Jansa @ 2013-01-29 13:04 UTC (permalink / raw)
To: openembedded-core
* as reported by Enrico on #oe
11:06:50 < ensc|w> JaMa: might this be caused by dc78ef91a2bf01efb8028c9afbe69e506e016265
which checks for 'd.getVar('LICENSE_CREATE_PACKAGE', True)' evaluating to 'True' for every
string (including the default 0)
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
meta/classes/license.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
index d4ebb26..229f755 100644
--- a/meta/classes/license.bbclass
+++ b/meta/classes/license.bbclass
@@ -103,7 +103,7 @@ python do_populate_lic() {
# it would be better to copy them in do_install_append, but find_license_filesa is python
python perform_packagecopy_prepend () {
enabled = d.getVar('LICENSE_CREATE_PACKAGE', True)
- if d.getVar('CLASSOVERRIDE', True) == 'class-target' and enabled:
+ if d.getVar('CLASSOVERRIDE', True) == 'class-target' and enabled == "1":
lic_files_paths = find_license_files(d)
# LICENSE_FILES_DIRECTORY starts with '/' so os.path.join cannot be used to join D and LICENSE_FILES_DIRECTORY
--
1.8.1.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCHv2] license: fix LICENSE_CREATE_PACKAGE to stay disabled by default
2013-01-29 13:04 ` [PATCHv2] " Martin Jansa
@ 2013-01-29 14:29 ` Chris Larson
2013-01-29 14:58 ` Martin Jansa
2013-01-29 15:59 ` Martin Jansa
0 siblings, 2 replies; 8+ messages in thread
From: Chris Larson @ 2013-01-29 14:29 UTC (permalink / raw)
To: Martin Jansa; +Cc: Patches and discussions about the oe-core layer
[-- Attachment #1: Type: text/plain, Size: 1876 bytes --]
On Tue, Jan 29, 2013 at 6:04 AM, Martin Jansa <martin.jansa@gmail.com>wrote:
> * as reported by Enrico on #oe
> 11:06:50 < ensc|w> JaMa: might this be caused by
> dc78ef91a2bf01efb8028c9afbe69e506e016265
> which checks for 'd.getVar('LICENSE_CREATE_PACKAGE', True)' evaluating
> to 'True' for every
> string (including the default 0)
>
> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
> ---
> meta/classes/license.bbclass | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
> index d4ebb26..229f755 100644
> --- a/meta/classes/license.bbclass
> +++ b/meta/classes/license.bbclass
> @@ -103,7 +103,7 @@ python do_populate_lic() {
> # it would be better to copy them in do_install_append, but
> find_license_filesa is python
> python perform_packagecopy_prepend () {
> enabled = d.getVar('LICENSE_CREATE_PACKAGE', True)
> - if d.getVar('CLASSOVERRIDE', True) == 'class-target' and enabled:
> + if d.getVar('CLASSOVERRIDE', True) == 'class-target' and enabled ==
> "1":
We do have an existing mechanism for handling boolean variables in a sane
way, as an FYI.
LICENSE_CREATE_PACKAGE[type] = "boolean"
LICENSE_CREATE_PACKAGE = "1"
oe.data.typed_value(d, 'LICENSE_CREATE_PACKAGE') == True
LICENSE_CREATE_PACKAGE = "0"
oe.data.typed_value(d, 'LICENSE_CREATE_PACKAGE') == False
Available types: boolean, integer (with support for different bases), float
(with support for hexadecimal floating point values), regex, choice (which
lets you only allow from a set of possible string values), list (which does
the (d.getVar() or "").split() crap for you).
You can also INHERIT += "type_check", and you'll know immediately at
ConfigParsed time if any of the values are invalid for their specified
types.
--
Christopher Larson
[-- Attachment #2: Type: text/html, Size: 2792 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCHv2] license: fix LICENSE_CREATE_PACKAGE to stay disabled by default
2013-01-29 14:29 ` Chris Larson
@ 2013-01-29 14:58 ` Martin Jansa
2013-01-29 15:59 ` Martin Jansa
1 sibling, 0 replies; 8+ messages in thread
From: Martin Jansa @ 2013-01-29 14:58 UTC (permalink / raw)
To: Chris Larson; +Cc: Patches and discussions about the oe-core layer
[-- Attachment #1: Type: text/plain, Size: 2059 bytes --]
Ah, good to know, sending v3.
On Tue, Jan 29, 2013 at 3:29 PM, Chris Larson <clarson@kergoth.com> wrote:
>
> On Tue, Jan 29, 2013 at 6:04 AM, Martin Jansa <martin.jansa@gmail.com>wrote:
>
>> * as reported by Enrico on #oe
>> 11:06:50 < ensc|w> JaMa: might this be caused by
>> dc78ef91a2bf01efb8028c9afbe69e506e016265
>> which checks for 'd.getVar('LICENSE_CREATE_PACKAGE', True)' evaluating
>> to 'True' for every
>> string (including the default 0)
>>
>> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
>> ---
>> meta/classes/license.bbclass | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
>> index d4ebb26..229f755 100644
>> --- a/meta/classes/license.bbclass
>> +++ b/meta/classes/license.bbclass
>> @@ -103,7 +103,7 @@ python do_populate_lic() {
>> # it would be better to copy them in do_install_append, but
>> find_license_filesa is python
>> python perform_packagecopy_prepend () {
>> enabled = d.getVar('LICENSE_CREATE_PACKAGE', True)
>> - if d.getVar('CLASSOVERRIDE', True) == 'class-target' and enabled:
>> + if d.getVar('CLASSOVERRIDE', True) == 'class-target' and enabled ==
>> "1":
>
>
> We do have an existing mechanism for handling boolean variables in a sane
> way, as an FYI.
>
> LICENSE_CREATE_PACKAGE[type] = "boolean"
>
> LICENSE_CREATE_PACKAGE = "1"
> oe.data.typed_value(d, 'LICENSE_CREATE_PACKAGE') == True
> LICENSE_CREATE_PACKAGE = "0"
> oe.data.typed_value(d, 'LICENSE_CREATE_PACKAGE') == False
>
> Available types: boolean, integer (with support for different bases),
> float (with support for hexadecimal floating point values), regex, choice
> (which lets you only allow from a set of possible string values), list
> (which does the (d.getVar() or "").split() crap for you).
>
> You can also INHERIT += "type_check", and you'll know immediately at
> ConfigParsed time if any of the values are invalid for their specified
> types.
> --
> Christopher Larson
>
[-- Attachment #2: Type: text/html, Size: 3260 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCHv2] license: fix LICENSE_CREATE_PACKAGE to stay disabled by default
2013-01-29 14:29 ` Chris Larson
2013-01-29 14:58 ` Martin Jansa
@ 2013-01-29 15:59 ` Martin Jansa
2013-01-29 17:30 ` Chris Larson
1 sibling, 1 reply; 8+ messages in thread
From: Martin Jansa @ 2013-01-29 15:59 UTC (permalink / raw)
To: Chris Larson; +Cc: Patches and discussions about the oe-core layer
[-- Attachment #1: Type: text/plain, Size: 2267 bytes --]
On Tue, Jan 29, 2013 at 07:29:55AM -0700, Chris Larson wrote:
> On Tue, Jan 29, 2013 at 6:04 AM, Martin Jansa <martin.jansa@gmail.com>wrote:
>
> > * as reported by Enrico on #oe
> > 11:06:50 < ensc|w> JaMa: might this be caused by
> > dc78ef91a2bf01efb8028c9afbe69e506e016265
> > which checks for 'd.getVar('LICENSE_CREATE_PACKAGE', True)' evaluating
> > to 'True' for every
> > string (including the default 0)
> >
> > Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
> > ---
> > meta/classes/license.bbclass | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
> > index d4ebb26..229f755 100644
> > --- a/meta/classes/license.bbclass
> > +++ b/meta/classes/license.bbclass
> > @@ -103,7 +103,7 @@ python do_populate_lic() {
> > # it would be better to copy them in do_install_append, but
> > find_license_filesa is python
> > python perform_packagecopy_prepend () {
> > enabled = d.getVar('LICENSE_CREATE_PACKAGE', True)
> > - if d.getVar('CLASSOVERRIDE', True) == 'class-target' and enabled:
> > + if d.getVar('CLASSOVERRIDE', True) == 'class-target' and enabled ==
> > "1":
>
>
> We do have an existing mechanism for handling boolean variables in a sane
> way, as an FYI.
>
> LICENSE_CREATE_PACKAGE[type] = "boolean"
>
> LICENSE_CREATE_PACKAGE = "1"
> oe.data.typed_value(d, 'LICENSE_CREATE_PACKAGE') == True
> LICENSE_CREATE_PACKAGE = "0"
> oe.data.typed_value(d, 'LICENSE_CREATE_PACKAGE') == False
I did the same and now it's failing with:
AttributeError: 'str' object has no attribute 'getVarFlag'
here is last version
http://bpaste.net/show/73667/
Cheers,
> Available types: boolean, integer (with support for different bases), float
> (with support for hexadecimal floating point values), regex, choice (which
> lets you only allow from a set of possible string values), list (which does
> the (d.getVar() or "").split() crap for you).
>
> You can also INHERIT += "type_check", and you'll know immediately at
> ConfigParsed time if any of the values are invalid for their specified
> types.
> --
> Christopher Larson
--
Martin 'JaMa' Jansa jabber: Martin.Jansa@gmail.com
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCHv2] license: fix LICENSE_CREATE_PACKAGE to stay disabled by default
2013-01-29 15:59 ` Martin Jansa
@ 2013-01-29 17:30 ` Chris Larson
0 siblings, 0 replies; 8+ messages in thread
From: Chris Larson @ 2013-01-29 17:30 UTC (permalink / raw)
To: Martin Jansa; +Cc: Patches and discussions about the oe-core layer
[-- Attachment #1: Type: text/plain, Size: 699 bytes --]
On Tue, Jan 29, 2013 at 8:59 AM, Martin Jansa <martin.jansa@gmail.com>wrote:
> > We do have an existing mechanism for handling boolean variables in a sane
> > way, as an FYI.
> >
> > LICENSE_CREATE_PACKAGE[type] = "boolean"
> >
> > LICENSE_CREATE_PACKAGE = "1"
> > oe.data.typed_value(d, 'LICENSE_CREATE_PACKAGE') == True
> > LICENSE_CREATE_PACKAGE = "0"
> > oe.data.typed_value(d, 'LICENSE_CREATE_PACKAGE') == False
>
> I did the same and now it's failing with:
> AttributeError: 'str' object has no attribute 'getVarFlag'
>
> here is last version
> http://bpaste.net/show/73667/
Ah, I probably remembered the argument order for typed_value wrong :)
--
Christopher Larson
[-- Attachment #2: Type: text/html, Size: 1236 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCHv3] license: fix LICENSE_CREATE_PACKAGE to stay disabled by default
2013-01-29 12:37 [PATCH] license: fix LICENSE_CREATE_PACKAGE to stay disabled by default Martin Jansa
2013-01-29 12:57 ` Otavio Salvador
2013-01-29 13:04 ` [PATCHv2] " Martin Jansa
@ 2013-01-29 21:17 ` Martin Jansa
2 siblings, 0 replies; 8+ messages in thread
From: Martin Jansa @ 2013-01-29 21:17 UTC (permalink / raw)
To: openembedded-core
* as reported by Enrico on #oe
11:06:50 < ensc|w> JaMa: might this be caused by dc78ef91a2bf01efb8028c9afbe69e506e016265
which checks for 'd.getVar('LICENSE_CREATE_PACKAGE', True)' evaluating to 'True' for every
string (including the default 0)
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
meta/classes/license.bbclass | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
index d4ebb26..170bdd9 100644
--- a/meta/classes/license.bbclass
+++ b/meta/classes/license.bbclass
@@ -7,6 +7,7 @@ LICENSE_DIRECTORY ??= "${DEPLOY_DIR}/licenses"
LICSSTATEDIR = "${WORKDIR}/license-destdir/"
# Create extra package with license texts and add it to RRECOMMENDS_${PN}
+LICENSE_CREATE_PACKAGE[type] = "boolean"
LICENSE_CREATE_PACKAGE ??= "0"
LICENSE_PACKAGE_SUFFIX ??= "-lic"
LICENSE_FILES_DIRECTORY ??= "${datadir}/licenses/"
@@ -102,7 +103,7 @@ python do_populate_lic() {
# it would be better to copy them in do_install_append, but find_license_filesa is python
python perform_packagecopy_prepend () {
- enabled = d.getVar('LICENSE_CREATE_PACKAGE', True)
+ enabled = oe.data.typed_value('LICENSE_CREATE_PACKAGE', d)
if d.getVar('CLASSOVERRIDE', True) == 'class-target' and enabled:
lic_files_paths = find_license_files(d)
--
1.8.1.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2013-01-29 21:33 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-29 12:37 [PATCH] license: fix LICENSE_CREATE_PACKAGE to stay disabled by default Martin Jansa
2013-01-29 12:57 ` Otavio Salvador
2013-01-29 13:04 ` [PATCHv2] " Martin Jansa
2013-01-29 14:29 ` Chris Larson
2013-01-29 14:58 ` Martin Jansa
2013-01-29 15:59 ` Martin Jansa
2013-01-29 17:30 ` Chris Larson
2013-01-29 21:17 ` [PATCHv3] " Martin Jansa
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox