Girocco/Validator.pm: sanctify non-default Config.pm
commit5f9a86dd452ee2d9d9c3695c53acb756f05422fe
authorKyle J. McKay <mackyle@gmail.com>
Mon, 15 Feb 2021 19:18:59 +0000 (15 12:18 -0700)
committerKyle J. McKay <mackyle@gmail.com>
Mon, 15 Feb 2021 19:18:59 +0000 (15 12:18 -0700)
treee5a715021efb7fa0dbea90a3101a1254280f8d2e
parent46b15d42c6d9d587e257737848fc196b98eddfcd
Girocco/Validator.pm: sanctify non-default Config.pm

When a non-default Config.pm is used via the GIROCCO_CONF mechanism,
the global $INC{'Girocco/Config.pm'} element never gets set.

If the install process then attempts to use some utility that
directly "use"s Girocco::Config the default config will be included
at that point and overwrite the custom settings pointed at by
GIROCCO_CONF.

Since the only time it's okay to not explicitly use Girocco::Validator
after $GIROCCO_CONF is once the config has been frozen (it's always
frozen under the Girocco::Config name), make Validator.pm sanctify
the use of a non-default Config.pm by magically setting the missing
$INC{'Girocco/Config.pm'} when it does its thing.  It does, after
all, actually contain a `package Girocco::Config` line; it's not
unreasonable to think it might set $INC{'Girocco/Config.pm'}.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
Girocco/Validator.pm