]> sipb.mit.edu Git - ikiwiki.git/commitdiff
Pass along wrapper args to ikiwiki, then handle the "cvs add dir"
authorAmitai Schlair <schmonz@magnetic-babysitter.(none)>
Sat, 22 Aug 2009 05:25:41 +0000 (01:25 -0400)
committerAmitai Schlair <schmonz@magnetic-babysitter.(none)>
Sat, 22 Aug 2009 05:25:41 +0000 (01:25 -0400)
case with a getopt hook directly in my plugin. If the wrapper change
is safe, we won't need a wrapper wrapper.

IkiWiki/Plugin/cvs.pm
IkiWiki/Wrapper.pm

index c09e4f9aa7df4f5cd650aca94b8a419b05c89939..076af26f3b451f5627aa361012cc001ff8e36fd4 100644 (file)
@@ -6,6 +6,7 @@ use strict;
 use IkiWiki;
 
 sub import {
+       hook(type => "getopt", id => "cvs", call => \&getopt);
        hook(type => "checkconfig", id => "cvs", call => \&checkconfig);
        hook(type => "getsetup", id => "cvs", call => \&getsetup);
        hook(type => "rcs", id => "rcs_update", call => \&rcs_update);
@@ -20,6 +21,13 @@ sub import {
        hook(type => "rcs", id => "rcs_getctime", call => \&rcs_getctime);
 }
 
+sub getopt () {
+       # "cvs add dir" acts immediately on the repository.
+       # post-commit gets confused by this and doesn't need to act on it.
+       # If that's why we're here, terminate the process.
+       @ARGV == 3 && $ARGV[1] eq "NONE" && $ARGV[2] eq "NONE" && exit 0;
+}
+
 sub checkconfig () {
        if (! defined $config{cvspath}) {
                $config{cvspath}="ikiwiki";
index 6555fe625f8e542e786f3b6d7d05a72772ea207f..4d92716ff0d31a523e855b7fe86d76abb326709f 100644 (file)
@@ -139,7 +139,7 @@ $envsave
        }
 
 $pre_exec
-       execl("$this", "$this", NULL);
+       execv("$this", argv);
        perror("exec $this");
        exit(1);
 }