]> sipb.mit.edu Git - ikiwiki.git/commitdiff
Catch up to the new genwrapper hook.
authorAmitai Schlair <schmonz@magnetic-babysitter.(none)>
Thu, 10 Sep 2009 19:12:45 +0000 (15:12 -0400)
committerAmitai Schlair <schmonz@magnetic-babysitter.(none)>
Thu, 10 Sep 2009 19:12:45 +0000 (15:12 -0400)
IkiWiki/Plugin/cvs.pm
IkiWiki/Wrapper.pm

index e926425f292cca2554ff1944d35b0ddf8b2b124f..3ce22203bcdc55bc9ca608dabd15ea9587f7c3c0 100644 (file)
@@ -8,7 +8,7 @@ use IkiWiki;
 use File::chdir;
 
 sub import {
 use File::chdir;
 
 sub import {
-       hook(type => "wrapperargcheck", id => "cvs", call => \&wrapperargcheck);
+       hook(type => "genwrapper", id => "cvs", call => \&genwrapper);
        hook(type => "checkconfig", id => "cvs", call => \&checkconfig);
        hook(type => "getsetup", id => "cvs", call => \&getsetup);
        hook(type => "rcs", id => "rcs_update", call => \&rcs_update);
        hook(type => "checkconfig", id => "cvs", call => \&checkconfig);
        hook(type => "getsetup", id => "cvs", call => \&getsetup);
        hook(type => "rcs", id => "rcs_update", call => \&rcs_update);
@@ -23,13 +23,14 @@ sub import {
        hook(type => "rcs", id => "rcs_getctime", call => \&rcs_getctime);
 }
 
        hook(type => "rcs", id => "rcs_getctime", call => \&rcs_getctime);
 }
 
-sub wrapperargcheck () {
+sub genwrapper () {
        my $check_args=<<"EOF";
        my $check_args=<<"EOF";
-       int j;
-       for (j = 1; j < argc; j++)
-               if (strstr(argv[j], "New directory") != NULL)
-                       return 0;
-       return 1;
+       {
+               int j;
+               for (j = 1; j < argc; j++)
+                       if (strstr(argv[j], "New directory") != NULL)
+                               exit(0);
+       }
 EOF
        return $check_args;
 }
 EOF
        return $check_args;
 }
index 57896e262fbef9cd08b74dc76ef0a26a9cb7ffdb..cf85738d68163763e8ac2bb1c7fc2ab04ef69187 100644 (file)
@@ -45,9 +45,6 @@ EOF
        my @wrapper_hooks;
        run_hooks(genwrapper => sub { push @wrapper_hooks, shift->() });
 
        my @wrapper_hooks;
        run_hooks(genwrapper => sub { push @wrapper_hooks, shift->() });
 
-       my $check_args="        return 0;";
-       run_hooks(wrapperargcheck => sub { $check_args = shift->(); });
-
        my $check_commit_hook="";
        my $pre_exec="";
        if ($config{post_commit}) {
        my $check_commit_hook="";
        my $pre_exec="";
        if ($config{post_commit}) {
@@ -120,16 +117,9 @@ addenv(char *var, char *val) {
        newenviron[i++]=s;
 }
 
        newenviron[i++]=s;
 }
 
-int checkargs(int argc, char **argv) {
-$check_args
-}
-
 int main (int argc, char **argv) {
        char *s;
 
 int main (int argc, char **argv) {
        char *s;
 
-       if (!checkargs(argc, argv))
-               exit(0);
-
 $check_commit_hook
 @wrapper_hooks
 $envsave
 $check_commit_hook
 @wrapper_hooks
 $envsave