aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Wrapper.pm
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2009-09-10 14:04:46 -0400
committerJoey Hess <joey@gnu.kitenet.net>2009-09-10 14:04:46 -0400
commit3ebd4e0b45a8a6bd4c12604a3bb683dcb3a60eb8 (patch)
tree0f6ef27852b074284cffcbe009ce4eb0f0a0c13c /IkiWiki/Wrapper.pm
parent98ed7cb1d7f99790821b99b3779d6685114fa662 (diff)
downloadikiwiki-3ebd4e0b45a8a6bd4c12604a3bb683dcb3a60eb8.tar
ikiwiki-3ebd4e0b45a8a6bd4c12604a3bb683dcb3a60eb8.tar.gz
Add genwrapper hook, that can be used to add code into the C wrapper.
Diffstat (limited to 'IkiWiki/Wrapper.pm')
-rw-r--r--IkiWiki/Wrapper.pm8
1 files changed, 4 insertions, 4 deletions
diff --git a/IkiWiki/Wrapper.pm b/IkiWiki/Wrapper.pm
index 6555fe625..cf85738d6 100644
--- a/IkiWiki/Wrapper.pm
+++ b/IkiWiki/Wrapper.pm
@@ -38,11 +38,12 @@ sub gen_wrapper () {
EOF
}
- my $test_receive="";
if ($config{test_receive}) {
require IkiWiki::Receive;
- $test_receive=IkiWiki::Receive::gen_wrapper();
}
+
+ my @wrapper_hooks;
+ run_hooks(genwrapper => sub { push @wrapper_hooks, shift->() });
my $check_commit_hook="";
my $pre_exec="";
@@ -120,7 +121,7 @@ int main (int argc, char **argv) {
char *s;
$check_commit_hook
-$test_receive
+@wrapper_hooks
$envsave
newenviron[i++]="HOME=$ENV{HOME}";
newenviron[i++]="WRAPPED_OPTIONS=$configstring";
@@ -144,7 +145,6 @@ $pre_exec
exit(1);
}
EOF
- close OUT;
my $cc=exists $ENV{CC} ? possibly_foolish_untaint($ENV{CC}) : 'cc';
if (system($cc, "$wrapper.c", "-o", "$wrapper.new") != 0) {