[Bro-Dev] script loading changes
Jonathan Siwek
jsiwek at ncsa.illinois.edu
Wed Jul 13 10:17:15 PDT 2011
> What if we always try the literal version first, before trying the
> alternatives with dots replaced, .bro added, etc?
Ok, let me try again. So there's a file in BROPATH with the name
foo.bar/foo/bar.blub.something.bro
To load that in a script you do
@load foo.bar/foo/bar.blub.something
And then starting with the literal version it searches BROPATH for
1) foo.bar/foo/bar.blub.something
2) foo.bar/foo/bar.blub.something.bro
3) foo/bar/foo/bar/blub/something
4) foo/bar/foo/bar/blub/something.bro
We never make it past #2 because that's the right name.
But from a new user's perspective, it's not intuitive to try the
literal version because everywhere else, the convention is to reference
scripts in packages in the dotted format, which would be:
@load foo.bar.foo.bar.blub.something
and that would search BROPATH for
1) foo.bar.foo.bar.blub.something
2) foo.bar.foo.bar.blub.something.bro
3) foo/bar/foo/bar/blub/something
4) foo/bar/foo/bar/blub/something.bro
And none of those are right.
- Jon
More information about the bro-dev
mailing list