Skip to contentSkip to conversation

networkmanager: Fix many typos in DISTRO_FEATURES PACKAGECONFIG decodes

PATCH In review Armin Kuster 2 participants 3 messages Mar 31, 2018 – Apr 14, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 networkmanager: Fix many typos in DISTRO_FEATURES PACKAGECONFIG decodes

fixes issues found with yocto-check-layer

File "/home/akuster/oss/maint/openembedded-core/bitbake/lib/bb/data_smart.py", line 436, in DataSmart.expand(s="nss ifupdown netconfig dhclient dnsmasq ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'consolekit', '', d)} ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', '${BLUEZ}', '', d)} ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', '', d)} ", varname='PACKAGECONFIG'):
def expand(self, s, varname = None):
> return self.expandWithRefs(s, varname).value

File "/home/akuster/oss/maint/openembedded-core/bitbake/lib/bb/data_smart.py", line 426, in DataSmart.expandWithRefs(s="nss ifupdown netconfig dhclient dnsmasq ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'consolekit', '', d)} ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez5', '', d)} ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', '', d)} ", varname='PACKAGECONFIG'):
except Exception as exc:
> raise ExpansionError(varname, s, exc) from exc

bb.data_smart.ExpansionError: Failure expanding variable PACKAGECONFIG, expression was nss ifupdown netconfig dhclient dnsmasq ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'consolekit', '', d)} ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez5', '', d)} ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', '', d)} which triggered exception TypeError: contains() missing 1 required positional argument: 'd'

---
 .../recipes-connectivity/networkmanager/networkmanager_1.10.6.bb   | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
meta-networking/recipes-connectivity/networkmanager/networkmanager_1.10.6.bb +4 -3
index f201a75..d90b782 100644
@@ -59,11 +59,12 @@ do_compile_prepend() {
 }
 
 PACKAGECONFIG ??= "nss ifupdown netconfig dhclient dnsmasq \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'consolekit', '', d), d)} \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'consolekit', '', d)} \
     ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', '${BLUEZ}', '', d)} \
-    ${@bb.utils.filter('DISTRO_FEATURES', 'wifi', d)} \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'wifi', '', d)} \
 "
+
 PACKAGECONFIG[systemd] = " \
     --with-systemdsystemunitdir=${systemd_unitdir}/system --with-session-tracking=systemd --enable-polkit, \
     --without-systemdsystemunitdir, \
Signature · 1 line
2.7.4
#1 lore raw
Quoted 22 lines · Armin Kuster

fixes issues found with yocto-check-layer

File "/home/akuster/oss/maint/openembedded-core/bitbake/lib/bb/data_smart.py", line 436, in DataSmart.expand(s="nss ifupdown netconfig dhclient dnsmasq ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'consolekit', '', d)} ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', '${BLUEZ}', '', d)} ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', '', d)} ", varname='PACKAGECONFIG'):
def expand(self, s, varname = None):
> return self.expandWithRefs(s, varname).value

File "/home/akuster/oss/maint/openembedded-core/bitbake/lib/bb/data_smart.py", line 426, in DataSmart.expandWithRefs(s="nss ifupdown netconfig dhclient dnsmasq ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'consolekit', '', d)} ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez5', '', d)} ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', '', d)} ", varname='PACKAGECONFIG'):
except Exception as exc:
> raise ExpansionError(varname, s, exc) from exc

bb.data_smart.ExpansionError: Failure expanding variable PACKAGECONFIG, expression was nss ifupdown netconfig dhclient dnsmasq ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'consolekit', '', d)} ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez5', '', d)} ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', '', d)} which triggered exception TypeError: contains() missing 1 required positional argument: 'd'

---
 .../recipes-connectivity/networkmanager/networkmanager_1.10.6.bb   | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
meta-networking/recipes-connectivity/networkmanager/networkmanager_1.10.6.bb +0 -0
index f201a75..d90b782 100644

meta-networking/recipes-connectivity/networkmanager/networkmanager_1.10.6.bb do_compile_prepend() { · line 63

Quoted 7 lines
meta-networking/recipes-connectivity/networkmanager/networkmanager_1.10.6.bb +2 -2
@@ -59,11 +59,12 @@ do_compile_prepend() {
 }
 
 PACKAGECONFIG ??= "nss ifupdown netconfig dhclient dnsmasq \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'consolekit', '', d), d)} \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'consolekit', '', d)} \

^ Whatever magic scripts wants to tell us: I think this was OK before.

The patch turns the logic. Intended is:

For systemd in DISTRO_FEATURES: PACKAGAGECONFIG +=systemd For systemd NOT in DISTRO_FEATURES *AND* x11 in DISTRO_FEATURES:
PACKAGAGECONFIG +=consolekit

By the way I did the similar mistake (+broke parsing really) in V1 of gobject-introspection-patch. Checking logs I found

commit b55738ef8d30d6aa92e2e644a50f4b06ec541204

Author: Jackie Huang <[email protected]>
Date:   Mon Nov 13 16:04:18 2017 +0800

networkmanager: add consolekit only when x11 is enabled

consolekit depends on virtual/libx11 then it requires x11 distro feature, so add consolekit option only when x11 is in DISTRO_FEATURES.

That helped me to remember what was intended.

To avoid this in the future I suggest to have systemd/consolekit in one line. That should make it more clear.

Shall I send a patch on top of master-next?

Andreas

author
#2 lore raw
Quoted 55 lines · Andreas Müller
Quoted 22 lines · Armin Kuster

fixes issues found with yocto-check-layer

File "/home/akuster/oss/maint/openembedded-core/bitbake/lib/bb/data_smart.py", line 436, in DataSmart.expand(s="nss ifupdown netconfig dhclient dnsmasq ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'consolekit', '', d)} ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', '${BLUEZ}', '', d)} ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', '', d)} ", varname='PACKAGECONFIG'):
def expand(self, s, varname = None):
> return self.expandWithRefs(s, varname).value

File "/home/akuster/oss/maint/openembedded-core/bitbake/lib/bb/data_smart.py", line 426, in DataSmart.expandWithRefs(s="nss ifupdown netconfig dhclient dnsmasq ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'consolekit', '', d)} ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez5', '', d)} ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', '', d)} ", varname='PACKAGECONFIG'):
except Exception as exc:
> raise ExpansionError(varname, s, exc) from exc

bb.data_smart.ExpansionError: Failure expanding variable PACKAGECONFIG, expression was nss ifupdown netconfig dhclient dnsmasq ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'consolekit', '', d)} ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez5', '', d)} ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', '', d)} which triggered exception TypeError: contains() missing 1 required positional argument: 'd'

---
 .../recipes-connectivity/networkmanager/networkmanager_1.10.6.bb   | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
meta-networking/recipes-connectivity/networkmanager/networkmanager_1.10.6.bb +0 -0
index f201a75..d90b782 100644

meta-networking/recipes-connectivity/networkmanager/networkmanager_1.10.6.bb do_compile_prepend() { · line 63

Quoted 7 lines
meta-networking/recipes-connectivity/networkmanager/networkmanager_1.10.6.bb +2 -2
@@ -59,11 +59,12 @@ do_compile_prepend() {
 }
 
 PACKAGECONFIG ??= "nss ifupdown netconfig dhclient dnsmasq \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'consolekit', '', d), d)} \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'consolekit', '', d)} \

^ Whatever magic scripts wants to tell us: I think this was OK before.

The patch turns the logic. Intended is:

For systemd in DISTRO_FEATURES: PACKAGAGECONFIG +=systemd For systemd NOT in DISTRO_FEATURES *AND* x11 in DISTRO_FEATURES:
PACKAGAGECONFIG +=consolekit

By the way I did the similar mistake (+broke parsing really) in V1 of gobject-introspection-patch. Checking logs I found

commit b55738ef8d30d6aa92e2e644a50f4b06ec541204

Author: Jackie Huang <[email protected]>
Date:   Mon Nov 13 16:04:18 2017 +0800

networkmanager: add consolekit only when x11 is enabled

consolekit depends on virtual/libx11 then it requires x11 distro feature, so add consolekit option only when x11 is in DISTRO_FEATURES.

Quoted 6 lines

That helped me to remember what was intended.

To avoid this in the future I suggest to have systemd/consolekit in one line. That should make it more clear.

Shall I send a patch on top of master-next?

yes please.

- armin

Quoted 2 lines

Andreas