Callback registration mechanism (was: Re: [102932] trunk/base/src)

Clemens Lang cal at macports.org
Mon Feb 11 17:49:52 PST 2013


On Tue, Feb 12, 2013 at 12:28:08AM +0100, Rainer Müller wrote:
> I like the idea, but I also have some bad feelings with this. The
> callbacks are run after the Portfile is evaluated, so the end result
> cannot be influenced or overridden anymore.

Yes, I am aware of the issue. If a callback changes something that would
require another round of callbacks to be run, that doesn't work.
However, if everybody writing these callbacks is aware of this, it
shouldn't be a problem.

This is also the reason why I wouldn't declare this a public API.

> I think this could be integrated with the existing target_*
> infrastructure. The callbacks would be registered from global scope
> using a new proc target_callbacks into the ditem and then some helper
> proc targets_run_callbacks would be called from macports1.0.

What's the benefit of doing this? It seems a lot more complex to me than
what we currently have, but maybe I'm just not seeing the beauty of this
yet.

-- 
Clemens Lang



More information about the macports-dev mailing list