Openembedded Core Discussions
 help / color / mirror / Atom feed
* i guess there's no way to *conditionally* add tasks?
@ 2014-08-05 10:42 Robert P. J. Day
  2014-08-05 11:28 ` Enrico Scholz
  0 siblings, 1 reply; 3+ messages in thread
From: Robert P. J. Day @ 2014-08-05 10:42 UTC (permalink / raw)
  To: OE Core mailing list


  digging into ptest stuff, and i notice this in ptest.bbclass:

addtask configure_ptest_base after do_configure before do_compile
addtask compile_ptest_base   after do_compile   before do_install
addtask install_ptest_base   after do_install   before do_package do_populate_sysroot

python () {
    if not bb.data.inherits_class('native', d) and not bb.data.inherits_class('cross', d):
        d.setVarFlag('do_install_ptest_base', 'fakeroot', 1)

    # Remove all '*ptest_base' tasks when ptest is not enabled
    if not(d.getVar('PTEST_ENABLED', True) == "1"):
        for i in ['do_configure_ptest_base', 'do_compile_ptest_base', 'do_install_ptest_base']:
            bb.build.deltask(i, d)
}

  so i'm guessing there's no way to conditionally add task(s) to avoid
adding them, only to turn around and delete them, yes?

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================



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

* Re: i guess there's no way to *conditionally* add tasks?
  2014-08-05 10:42 i guess there's no way to *conditionally* add tasks? Robert P. J. Day
@ 2014-08-05 11:28 ` Enrico Scholz
  2014-08-05 12:06   ` Paul Eggleton
  0 siblings, 1 reply; 3+ messages in thread
From: Enrico Scholz @ 2014-08-05 11:28 UTC (permalink / raw)
  To: openembedded-core

"Robert P. J. Day" <rpjday-L09J2beyid0N/H6P543EQg@public.gmane.org>
writes:

> addtask configure_ptest_base after do_configure before do_compile
> addtask compile_ptest_base   after do_compile   before do_install
> addtask install_ptest_base   after do_install   before do_package do_populate_sysroot
> ...
>     # Remove all '*ptest_base' tasks when ptest is not enabled
>     if not(d.getVar('PTEST_ENABLED', True) == "1"):
>         for i in ['do_configure_ptest_base', 'do_compile_ptest_base', 'do_install_ptest_base']:
>             bb.build.deltask(i, d)
>
>   so i'm guessing there's no way to conditionally add task(s) to avoid
> adding them, only to turn around and delete them, yes?

I solved similar issues by including files conditionally; e.g. above
would be

---
ptest_inc = "${@['noop', 'ptest'][d.getVar('PTEST_ENABLED', True) == '1']}"
include ptest-${ptest_inc}.inc

--- ptest-ptest.inc ---
addtask configure_ptest_base after do_configure before do_compile
addtask compile_ptest_base   after do_compile   before do_install
addtask install_ptest_base   after do_install   before do_package
do_populate_sysroot



Enrico


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

* Re: i guess there's no way to *conditionally* add tasks?
  2014-08-05 11:28 ` Enrico Scholz
@ 2014-08-05 12:06   ` Paul Eggleton
  0 siblings, 0 replies; 3+ messages in thread
From: Paul Eggleton @ 2014-08-05 12:06 UTC (permalink / raw)
  To: Enrico Scholz; +Cc: openembedded-core

On Tuesday 05 August 2014 13:28:45 Enrico Scholz wrote:
> "Robert P. J. Day" <rpjday-L09J2beyid0N/H6P543EQg@public.gmane.org>
> 
> writes:
> > addtask configure_ptest_base after do_configure before do_compile
> > addtask compile_ptest_base   after do_compile   before do_install
> > addtask install_ptest_base   after do_install   before do_package
> > do_populate_sysroot ...
> > 
> >     # Remove all '*ptest_base' tasks when ptest is not enabled
> >     
> >     if not(d.getVar('PTEST_ENABLED', True) == "1"):
> >         for i in ['do_configure_ptest_base', 'do_compile_ptest_base', 
'do_install_ptest_base']:
> >             bb.build.deltask(i, d)
> >   
> >   so i'm guessing there's no way to conditionally add task(s) to avoid
> > 
> > adding them, only to turn around and delete them, yes?
> 
> I solved similar issues by including files conditionally; e.g. above
> would be
> 
> ---
> ptest_inc = "${@['noop', 'ptest'][d.getVar('PTEST_ENABLED', True) == '1']}"
> include ptest-${ptest_inc}.inc
> 
> --- ptest-ptest.inc ---
> addtask configure_ptest_base after do_configure before do_compile
> addtask compile_ptest_base   after do_compile   before do_install
> addtask install_ptest_base   after do_install   before do_package
> do_populate_sysroot

The point is most of the time you shouldn't need to do this kind of thing 
anymore since the introduction of addtask/deltask python functions.

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre


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

end of thread, other threads:[~2014-08-05 12:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-05 10:42 i guess there's no way to *conditionally* add tasks? Robert P. J. Day
2014-08-05 11:28 ` Enrico Scholz
2014-08-05 12:06   ` Paul Eggleton

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