Skip to contentSkip to conversation

license: fix LICENSE_CREATE_PACKAGE to stay disabled by default

PATCH Superseded Martin Jansa 3 participants 8 messages Jan 29, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 license: fix LICENSE_CREATE_PACKAGE to stay disabled by default

* 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)

---
 meta/classes/license.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/license.bbclass +1 -1
index d4ebb26..9f38221 100644
@@ -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
Signature · 1 line
1.8.1.2
#1 lore raw
Quoted 15 lines · Martin Jansa

* 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)

---
 meta/classes/license.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/license.bbclass +0 -0
index d4ebb26..9f38221 100644

meta/classes/license.bbclass python do_populate_lic() { · line 107

Quoted 6 lines
meta/classes/license.bbclass +1 -1
@@ -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?

Quoted 9 lines
meta/classes/license.bbclass +0 -1
         # 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
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

--
Otavio Salvador O.S. Systems
E-mail: [email protected] http://www.ossystems.com.br
Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br

#2 lore raw

PATCH v2 1/1 license: fix LICENSE_CREATE_PACKAGE to stay disabled by default

In reply to Martin Jansa

* 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)

---
 meta/classes/license.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/license.bbclass +1 -1
index d4ebb26..229f755 100644
@@ -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
Signature · 1 line
1.8.1.2
#3 lore raw
Quoted 23 lines · Martin Jansa

* 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)

---
 meta/classes/license.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/license.bbclass +0 -0
index d4ebb26..229f755 100644
@@ -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)

meta/classes/license.bbclass +1 -1
-    if d.getVar('CLASSOVERRIDE', True) == 'class-target' and enabled:
+    if d.getVar('CLASSOVERRIDE', True) == 'class-target' and enabled ==
Quoted 1 line

"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.

Signature · 1 line
Christopher Larson
#4 lore raw

Ah, good to know, sending v3.

Quoted 50 lines · Chris Larson
Quoted 23 lines · Martin Jansa

* 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)

---
 meta/classes/license.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/license.bbclass +0 -0
index d4ebb26..229f755 100644
@@ -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)

meta/classes/license.bbclass +1 -1
-    if d.getVar('CLASSOVERRIDE', True) == 'class-target' and enabled:
+    if d.getVar('CLASSOVERRIDE', True) == 'class-target' and enabled ==
Quoted 1 line

"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

#5 lore raw
In reply to Chris Larson
Quoted 31 lines · Chris Larson
Quoted 23 lines · Martin Jansa

* 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)

---
 meta/classes/license.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/license.bbclass +0 -0
index d4ebb26..229f755 100644
@@ -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)

meta/classes/license.bbclass +1 -1
-    if d.getVar('CLASSOVERRIDE', True) == 'class-target' and enabled:
+    if d.getVar('CLASSOVERRIDE', True) == 'class-target' and enabled ==
Quoted 1 line

"1":

We do have an existing mechanism for handling boolean variables in a sane way, as an FYI.

Quoted 6 lines

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,

Quoted 10 lines

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.

Signature · 1 line
Christopher Larson
Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#6 lore raw
Quoted 10 lines · Martin Jansa
Quoted 9 lines

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

Quoted 5 lines

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 :)

Signature · 1 line
Christopher Larson
#7 lore raw

PATCH v3 1/1 license: fix LICENSE_CREATE_PACKAGE to stay disabled by default

In reply to Martin Jansa

* 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)

---
 meta/classes/license.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/classes/license.bbclass +2 -1
index d4ebb26..170bdd9 100644
@@ -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)
 
Signature · 1 line
1.8.1.2