Skip to contentSkip to conversation

update-rc.d.bbclass: fix inhibit check

PATCH In review Kai Kang 3 participants 4 messages Feb 19, 2014 – Feb 20, 2014

lore
Share & tools
lore

Kai Kang

author
#0 lore raw

PATCH 1/1 update-rc.d.bbclass: fix inhibit check

In update-rc.d.bbclass it checks variable INITSCRIPT_PACKAGES to avoid inherit this class. But it is wrong logic to check INITSCRIPT_PACKAGES. When 'sysvinit' is in 'DISTRO_FEATURES', INITSCRIPT_PACKAGES will not be checked.

Replace 'or' with 'and' to fix it.

---
 meta/classes/update-rc.d.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/update-rc.d.bbclass +1 -1
index 4b92d8d..0ac2af7 100644
@@ -117,7 +117,7 @@ python populate_packages_updatercd () {
 
     # Check that this class isn't being inhibited (generally, by
     # systemd.bbclass) before doing any work.
-    if oe.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d) or \
+    if oe.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d) and \
        not d.getVar("INHIBIT_UPDATERCD_BBCLASS", True):
         pkgs = d.getVar('INITSCRIPT_PACKAGES', True)
         if pkgs == None:
Signature · 1 line
1.8.1.2
#1 lore raw
Quoted 4 lines · Kai Kang

In update-rc.d.bbclass it checks variable INITSCRIPT_PACKAGES to avoid inherit this class. But it is wrong logic to check INITSCRIPT_PACKAGES. When 'sysvinit' is in 'DISTRO_FEATURES', INITSCRIPT_PACKAGES will not be checked.

Er, really? From the code you quoted...

meta/classes/update-rc.d.bbclass python populate_packages_updatercd () { · line 123

Quoted 7 lines

# Check that this class isn't being inhibited (generally, by # systemd.bbclass) before doing any work.

meta/classes/update-rc.d.bbclass +1 -1
-    if oe.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d) or \
+    if oe.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d) and \
        not d.getVar("INHIBIT_UPDATERCD_BBCLASS", True):
         pkgs = d.getVar('INITSCRIPT_PACKAGES', True)
         if pkgs == None:

... it seems that if sysvinit is in DISTRO_FEATURES then the outer "if" will evaluate to true and it will indeed proceed to check INITSCRIPT_PACKAGES in the last quoted line. Can you clarify what exactly is wrong here?

p.

author
#2 lore raw
Quoted 14 lines · Phil Blundell
Quoted 4 lines · Kai Kang

In update-rc.d.bbclass it checks variable INITSCRIPT_PACKAGES to avoid inherit this class. But it is wrong logic to check INITSCRIPT_PACKAGES. When 'sysvinit' is in 'DISTRO_FEATURES', INITSCRIPT_PACKAGES will not be checked.

Er, really? From the code you quoted...

meta/classes/update-rc.d.bbclass python populate_packages_updatercd () { · line 123

Quoted 7 lines

# Check that this class isn't being inhibited (generally, by # systemd.bbclass) before doing any work.

meta/classes/update-rc.d.bbclass +1 -1
-    if oe.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d) or \
+    if oe.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d) and \
         not d.getVar("INHIBIT_UPDATERCD_BBCLASS", True):
          pkgs = d.getVar('INITSCRIPT_PACKAGES', True)
          if pkgs == None:
Quoted 4 lines

... it seems that if sysvinit is in DISTRO_FEATURES then the outer "if" will evaluate to true and it will indeed proceed to check INITSCRIPT_PACKAGES in the last quoted line. Can you clarify what exactly is wrong here?

Sorry, as laurentiu comments, it is INHIBIT_UPDATERCD_BBCLASS which variable will not be checked.

I'll update the comment with V2.

Regards,
Kai

Quoted 6 lines

p.

Signature · 2 lines
Regards,
Neil | Kai Kang
#3 lore raw
In reply to Kai Kang
Quoted 4 lines · Kai Kang

In update-rc.d.bbclass it checks variable INITSCRIPT_PACKAGES to avoid inherit this class. But it is wrong logic to check INITSCRIPT_PACKAGES. When 'sysvinit' is in 'DISTRO_FEATURES', INITSCRIPT_PACKAGES will not be checked.

s/INITSCRIPT_PACKAGES/INHIBIT_UPDATERCD_BBCLASS/ above will make more sense, I guess.

Because, as I see it, that 'if' will evaluate to True if 'sysvinit' is in DISTRO_FEATURES, irrespective of how INHIBIT_UPDATERCD_BBCLASS is set... which is a little bit wrong.

So, I think you just need to adjust the commit message.

laurentiu

Quoted 28 lines

Replace 'or' with 'and' to fix it.

---
 meta/classes/update-rc.d.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/update-rc.d.bbclass +1 -1
index 4b92d8d..0ac2af7 100644
@@ -117,7 +117,7 @@ python populate_packages_updatercd () {
 
     # Check that this class isn't being inhibited (generally, by
     # systemd.bbclass) before doing any work.
-    if oe.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d) or \
+    if oe.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d) and \
        not d.getVar("INHIBIT_UPDATERCD_BBCLASS", True):
         pkgs = d.getVar('INITSCRIPT_PACKAGES', True)
         if pkgs == None:
Signature · 6 lines
1.8.1.2

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core