Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] update-rc.d.bbclass: fix inhibit check
@ 2014-02-19 10:59 Kai Kang
  2014-02-19 11:43 ` Phil Blundell
  2014-02-19 12:19 ` Laurentiu Palcu
  0 siblings, 2 replies; 6+ messages in thread
From: Kai Kang @ 2014-02-19 10:59 UTC (permalink / raw)
  To: openembedded-core

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.

Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
 meta/classes/update-rc.d.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/update-rc.d.bbclass b/meta/classes/update-rc.d.bbclass
index 4b92d8d..0ac2af7 100644
--- a/meta/classes/update-rc.d.bbclass
+++ b/meta/classes/update-rc.d.bbclass
@@ -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:
-- 
1.8.1.2



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] update-rc.d.bbclass: fix inhibit check
  2014-02-19 10:59 [PATCH] update-rc.d.bbclass: fix inhibit check Kai Kang
@ 2014-02-19 11:43 ` Phil Blundell
  2014-02-20  1:32   ` Kang Kai
  2014-02-19 12:19 ` Laurentiu Palcu
  1 sibling, 1 reply; 6+ messages in thread
From: Phil Blundell @ 2014-02-19 11:43 UTC (permalink / raw)
  To: Kai Kang; +Cc: openembedded-core

On Wed, 2014-02-19 at 18:59 +0800, Kai Kang wrote:
> 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...

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

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




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] update-rc.d.bbclass: fix inhibit check
  2014-02-19 10:59 [PATCH] update-rc.d.bbclass: fix inhibit check Kai Kang
  2014-02-19 11:43 ` Phil Blundell
@ 2014-02-19 12:19 ` Laurentiu Palcu
  1 sibling, 0 replies; 6+ messages in thread
From: Laurentiu Palcu @ 2014-02-19 12:19 UTC (permalink / raw)
  To: Kai Kang; +Cc: openembedded-core

On Wed, Feb 19, 2014 at 06:59:26PM +0800, Kai Kang wrote:
> 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

> 
> Replace 'or' with 'and' to fix it.
> 
> Signed-off-by: Kai Kang <kai.kang@windriver.com>
> ---
>  meta/classes/update-rc.d.bbclass | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meta/classes/update-rc.d.bbclass b/meta/classes/update-rc.d.bbclass
> index 4b92d8d..0ac2af7 100644
> --- a/meta/classes/update-rc.d.bbclass
> +++ b/meta/classes/update-rc.d.bbclass
> @@ -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:
> -- 
> 1.8.1.2
> 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] update-rc.d.bbclass: fix inhibit check
  2014-02-19 11:43 ` Phil Blundell
@ 2014-02-20  1:32   ` Kang Kai
  0 siblings, 0 replies; 6+ messages in thread
From: Kang Kai @ 2014-02-20  1:32 UTC (permalink / raw)
  To: Phil Blundell; +Cc: openembedded-core

On 2014年02月19日 19:43, Phil Blundell wrote:
> On Wed, 2014-02-19 at 18:59 +0800, Kai Kang wrote:
>> 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...
>
>>       # 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:
> ... 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

>
> p.
>
>
>
>


-- 
Regards,
Neil | Kai Kang



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] update-rc.d.bbclass: fix inhibit check
  2014-02-20  2:11 [PATCH] V2: " Kai Kang
@ 2014-02-20  2:11 ` Kai Kang
  2014-02-21 12:24   ` Burton, Ross
  0 siblings, 1 reply; 6+ messages in thread
From: Kai Kang @ 2014-02-20  2:11 UTC (permalink / raw)
  To: pb, laurentiu.palcu; +Cc: openembedded-core

In update-rc.d.bbclass it checks variable INHIBIT_UPDATERCD_BBCLASS to
inhibit from inheriting this class. But it is wrong logic that when
'sysvinit' is in 'DISTRO_FEATURES', INHIBIT_UPDATERCD_BBCLASS will not
be checked.

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

Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
 meta/classes/update-rc.d.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/update-rc.d.bbclass b/meta/classes/update-rc.d.bbclass
index 4b92d8d..0ac2af7 100644
--- a/meta/classes/update-rc.d.bbclass
+++ b/meta/classes/update-rc.d.bbclass
@@ -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:
-- 
1.8.1.2



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] update-rc.d.bbclass: fix inhibit check
  2014-02-20  2:11 ` [PATCH] " Kai Kang
@ 2014-02-21 12:24   ` Burton, Ross
  0 siblings, 0 replies; 6+ messages in thread
From: Burton, Ross @ 2014-02-21 12:24 UTC (permalink / raw)
  To: Kai Kang; +Cc: OE-core

On 20 February 2014 02:11, Kai Kang <kai.kang@windriver.com> wrote:
> In update-rc.d.bbclass it checks variable INHIBIT_UPDATERCD_BBCLASS to
> inhibit from inheriting this class. But it is wrong logic that when
> 'sysvinit' is in 'DISTRO_FEATURES', INHIBIT_UPDATERCD_BBCLASS will not
> be checked.

Not sure what I was thinking there, well spotted.

Reviewed-by: Ross Burton <ross.burton@intel.com>

Ross


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-02-21 12:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-19 10:59 [PATCH] update-rc.d.bbclass: fix inhibit check Kai Kang
2014-02-19 11:43 ` Phil Blundell
2014-02-20  1:32   ` Kang Kai
2014-02-19 12:19 ` Laurentiu Palcu
  -- strict thread matches above, loose matches on Subject: below --
2014-02-20  2:11 [PATCH] V2: " Kai Kang
2014-02-20  2:11 ` [PATCH] " Kai Kang
2014-02-21 12:24   ` Burton, Ross

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox