- cat > "$repository/CVSROOT/post-commit-wrapper" <<EOF
-#!/bin/sh
-
-IKIWIKI_POST_COMMIT_HOOK="$repository/CVSROOT/post-commit"
-
-exists_ikiwiki_post_commit_hook() {
- [ -x \$IKIWIKI_POST_COMMIT_HOOK ];
-}
-
-called_with_exactly_one_dir() {
- echo "\$@" | grep 'New directory' >/dev/null 2>&1
-}
-
-main() {
- exists_ikiwiki_post_commit_hook || exit 0
- called_with_exactly_one_dir "\$@" && exit 0
- # Return from commit and relinquish write lock. ikiwiki post-commit
- # wants to "cvs update", which wants to take a read lock.
- \$IKIWIKI_POST_COMMIT_HOOK &
- return 0
-}
-
-main "\$@"
-exit \$?
-EOF
- chmod +x "$repository/CVSROOT/post-commit-wrapper"