All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Robert P. J. Day" <rpjday@crashcourse.ca>
To: Paul Eggleton <paul.eggleton@linux.intel.com>
Cc: openembedded-devel@lists.openembedded.org
Subject: Re: overriding tasks with EXPORT_FUNCTIONS
Date: Mon, 14 Jul 2014 08:20:59 -0400 (EDT)	[thread overview]
Message-ID: <alpine.LFD.2.11.1407140804360.29952@localhost> (raw)
In-Reply-To: <3072899.OS8yJTfGtp@peggleto-mobl5.ger.corp.intel.com>

On Mon, 14 Jul 2014, Paul Eggleton wrote:

> Hi Robert,
>
> On Sunday 13 July 2014 10:19:08 Robert P. J. Day wrote:
> >   followup to last post -- all of the methods for "overriding" task
> > definitions in the last post can be used without predeclaring that
> > you're about to do that; you just go ahead and do it in either a class
> > file or a recipe file. on the other hand, EXPORT_FUNCTIONS allows you
> > to retain the base definition of a task (or non-task function, as i
> > read it), then define a more general enhanced version.
> >
> >   (side note: i don't see a single mention of "EXPORT_FUNCTIONS" in
> > any of the numerous yocto docs -- i think this feature needs some
> > explanation *somewhere*. :-)
>
> Did you try the new BitBake manual?
>
> http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#flexible-inheritance-for-class-functions
>
> Let me know if that doesn't answer your questions.

  i think that section could be extended a bit to offer more
information, so i might take a shot at it. first, i think it should
emphasize that it's primarily(?) used for enhancing the default
implementation of "base" functions. just using "foo" and "bar" here is
maddeningly vague. throwing in an (admittedly OE-related) example like
this from cmake.bbclass:

  cmake_do_compile()  {
        cd ${B}
        base_do_compile
  }

  cmake_do_install() {
        cd ${B}
        autotools_do_install
  }

would, i think, clarify the general power of this feature.

  and a question about a particular example. richard purdie replied to
my post a while back about package.bbclass and debian.bbclass, but i'm
still a bit confused. here's a snippet from package.bbclass:

  python package_package_name_hook() {
      """
      A package_name_hook function can be used to rewrite the package names by
      changing PKG.  For an example, see debian.bbclass.
      """
      pass
  }
  EXPORT_FUNCTIONS package_name_hook

so as i read it, the above defines the function
"package_package_name_hook" which doesn't do a whole lot, but is now
available to other classes that inherit this one, particularly
debian.bbclass that's specifically mentioned.

  but if one goes to debian.bbclass, one finds:

  python debian_package_name_hook () {
      import glob, copy, stat, errno, re
      ... snip ...
  }

  EXPORT_FUNCTIONS package_name_hook

but, as far as i can tell, that is the only class that requires a
package name hook, and it simply defines its own implementation -- it
does nothing with package.bbclass and makes no reference to the
exported function package_package_name_hook(). so am i just
misunderstanding something? what was the point of defining and
exporting that function in package.bbclass if no other class takes
advantage of it?

rday

-- 

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

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



  parent reply	other threads:[~2014-07-14 12:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-13 14:19 overriding tasks with EXPORT_FUNCTIONS Robert P. J. Day
2014-07-14  9:24 ` Paul Eggleton
2014-07-14 10:18   ` Robert P. J. Day
2014-07-14 10:22     ` Paul Eggleton
2014-07-14 12:20   ` Robert P. J. Day [this message]
2014-07-14 12:26     ` Paul Eggleton
2014-07-22 13:19       ` Trevor Woerner
2014-07-22 13:22         ` Robert P. J. Day
2014-07-22 13:42           ` Trevor Woerner
2014-07-22 13:40         ` Paul Eggleton
2014-07-14 12:30     ` Burton, Ross
2014-07-14 13:33       ` Robert P. J. Day
2014-07-14 15:19         ` Paul Eggleton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.2.11.1407140804360.29952@localhost \
    --to=rpjday@crashcourse.ca \
    --cc=openembedded-devel@lists.openembedded.org \
    --cc=paul.eggleton@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.