Merge commit 'schmonz/master' into cvs
commit
1365ebf12f
|
@ -8,7 +8,7 @@ use IkiWiki;
|
||||||
use File::chdir;
|
use File::chdir;
|
||||||
|
|
||||||
sub import {
|
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 => "checkconfig", id => "cvs", call => \&checkconfig);
|
||||||
hook(type => "getsetup", id => "cvs", call => \&getsetup);
|
hook(type => "getsetup", id => "cvs", call => \&getsetup);
|
||||||
hook(type => "rcs", id => "rcs_update", call => \&rcs_update);
|
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++)
|
int j;
|
||||||
if (strstr(argv[j], "New directory") != NULL)
|
for (j = 1; j < argc; j++)
|
||||||
return 0;
|
if (strstr(argv[j], "New directory") != NULL)
|
||||||
return 1;
|
exit(0);
|
||||||
|
}
|
||||||
EOF
|
EOF
|
||||||
return $check_args;
|
return $check_args;
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,9 +41,6 @@ EOF
|
||||||
my @wrapper_hooks;
|
my @wrapper_hooks;
|
||||||
run_hooks(genwrapper => sub { push @wrapper_hooks, shift->() });
|
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 $check_commit_hook="";
|
||||||
my $pre_exec="";
|
my $pre_exec="";
|
||||||
if ($config{post_commit}) {
|
if ($config{post_commit}) {
|
||||||
|
@ -116,16 +113,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) {
|
int main (int argc, char **argv) {
|
||||||
char *s;
|
char *s;
|
||||||
|
|
||||||
if (!checkargs(argc, argv))
|
|
||||||
exit(0);
|
|
||||||
|
|
||||||
$check_commit_hook
|
$check_commit_hook
|
||||||
@wrapper_hooks
|
@wrapper_hooks
|
||||||
$envsave
|
$envsave
|
||||||
|
|
Loading…
Reference in New Issue