summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Rayhawk <jrayhawk@omgwallhack.org>2011-12-08 22:48:42 -0800
committerJoe Rayhawk <jrayhawk@omgwallhack.org>2011-12-08 22:48:42 -0800
commit5a1dd90b9237c53858c70b9e9796f2bdd479c2f3 (patch)
tree94ca40d8cc709f038e286edfbf5c138c3080f3c4
parent495fb118be30b662cafc1715cdf235a5e0210079 (diff)
downloadpiny-code-5a1dd90b9237c53858c70b9e9796f2bdd479c2f3.tar.gz
piny-code-5a1dd90b9237c53858c70b9e9796f2bdd479c2f3.zip
Piny::Repo: Adding support for a global ikiwiki overrides file in /etc/ikiwiki/piny.setup.pl
-rw-r--r--libpiny/lib/Piny/Repo.pm13
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 $@;