diff options
author | Joe Rayhawk <jrayhawk@omgwallhack.org> | 2011-12-08 22:48:42 -0800 |
---|---|---|
committer | Joe Rayhawk <jrayhawk@omgwallhack.org> | 2011-12-08 22:48:42 -0800 |
commit | 5a1dd90b9237c53858c70b9e9796f2bdd479c2f3 (patch) | |
tree | 94ca40d8cc709f038e286edfbf5c138c3080f3c4 /libpiny/lib/Piny | |
parent | 495fb118be30b662cafc1715cdf235a5e0210079 (diff) | |
download | piny-code-5a1dd90b9237c53858c70b9e9796f2bdd479c2f3.tar.gz piny-code-5a1dd90b9237c53858c70b9e9796f2bdd479c2f3.zip |
Piny::Repo: Adding support for a global ikiwiki overrides file in /etc/ikiwiki/piny.setup.pl
Diffstat (limited to 'libpiny/lib/Piny')
-rw-r--r-- | libpiny/lib/Piny/Repo.pm | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libpiny/lib/Piny/Repo.pm b/libpiny/lib/Piny/Repo.pm index 9796d9f..774daf9 100644 --- a/libpiny/lib/Piny/Repo.pm +++ b/libpiny/lib/Piny/Repo.pm @@ -665,6 +665,19 @@ sub _build_ikiwiki_setup { ]; }; + if ( -e "/etc/ikiwiki/piny.setup.pl" ) { + system( "perl", "-C", "/etc/ikiwiki/piny.setup.pl" ) && die ( 'Failed to compile global ikiwiki overrides file!' ); + undef $@; + eval { + package TEMP; + use Piny; + $TEMP::repo = $s; + $TEMP::conf = $config; + no strict 'vars'; + do "/etc/ikiwiki/piny.setup.pl"; + }; + }; + if ( -e "/etc/ikiwiki/piny/" . $s->name . ".setup.pl" ) { system( "perl", "-C", "/etc/ikiwiki/piny/" . $s->name . ".setup.pl" ) && die ( 'Failed to compile ikiwiki overrides file!' ); undef $@; |