]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Wrapper.pm
inline: Use caching of inlined pages to speed up builds of inlines that include feeds.
[git.ikiwiki.info.git] / IkiWiki / Wrapper.pm
index 6555fe625f8e542e786f3b6d7d05a72772ea207f..5427a5c80b1f0762775231eadb9663b6f8841d2f 100644 (file)
@@ -37,12 +37,9 @@ sub gen_wrapper () {
                addenv("$var", s);
 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 +117,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,10 +141,10 @@ $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) {
+       my @cc=exists $ENV{CC} ? possibly_foolish_untaint($ENV{CC}) : 'cc';
+       push @cc, possibly_foolish_untaint($ENV{CFLAGS}) if exists $ENV{CFLAGS};
+       if (system(@cc, "$wrapper.c", "-o", "$wrapper.new") != 0) {
                #translators: The parameter is a C filename.
                error(sprintf(gettext("failed to compile %s"), "$wrapper.c"));
        }