From 5a1dd90b9237c53858c70b9e9796f2bdd479c2f3 Mon Sep 17 00:00:00 2001 From: Joe Rayhawk Date: Thu, 8 Dec 2011 22:48:42 -0800 Subject: Piny::Repo: Adding support for a global ikiwiki overrides file in /etc/ikiwiki/piny.setup.pl --- libpiny/lib/Piny/Repo.pm | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'libpiny') 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 $@; -- cgit v1.2.3