[Bro-Dev] script loading changes

Jonathan Siwek jsiwek at ncsa.illinois.edu
Wed Jul 13 08:48:33 PDT 2011

> Apologies if I'm missing the point

Oops, I guess I should have described what the point of @add actually
was.  It's mainly so that it's easier for a script package to define
optional components that automatically get loaded when a dependency is

e.g. the protocols/http package has some scripts that depend on
frameworks/software, and those components should be optionally loaded
only when frameworks/software has been explicitly loaded instead of
a load of protocols/http always resulting in a load of frameworks/software.

> Rather than an "@add x when y", what about "@allows x" defined within
> y, where @allows was evaluated with the stipulations described above?

I think the problem with this is that if a user were developing their
own script package that had optional components that depend on e.g.
frameworks/software, they wouldn't be able to express that without
directly editing something in frameworks/software to @allow their
scripts.  And that's discouraged.
> Alternatively, @try x, then define a set of @require directives in x
> that must be met in order for x to be loaded (but that silently fail /
> throw a warning if they fail to load)?

We want the attempt to load 'x' to be postponed until after the normal
loading of @load'd scripts to avoid ordering issues.

- Jon

More information about the bro-dev mailing list