1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
#! /bin/sh /usr/share/dpatch/dpatch-run
##
## repos-templates by <dwhedon@debian.org>
@DPATCH@
--- a/subversion/libsvn_repos/repos.c
+++ b/subversion/libsvn_repos/repos.c
@@ -266,7 +266,7 @@
#define PREWRITTEN_HOOKS_TEXT \
"# For more examples and pre-written hooks, see those in" NL \
- "# the Subversion repository at" NL \
+ "# /usr/share/subversion/hook-scripts, and in the repository at" NL \
"# http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/ and" NL \
"# http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/" NL
@@ -345,8 +345,11 @@
"REPOS=\"$1\"" NL
"USER=\"$2\"" NL
"" NL
-"commit-allower.pl --repository \"$REPOS\" --user \"$USER\" || exit 1" NL
-"special-auth-check.py --user \"$USER\" --auth-level 3 || exit 1" NL
+"# Exit on all errors." NL
+"set -e" NL
+"" NL
+"\"$REPOS\"/hooks/commit-allower.pl --repository \"$REPOS\" --user \"$USER\"" NL
+"\"$REPOS\"/hooks/special-auth-check.py --user \"$USER\" --auth-level 3" NL
"" NL
"# All checks passed, so allow the commit." NL
"exit 0" NL;
@@ -433,10 +436,13 @@
"$SVNLOOK log -t \"$TXN\" \"$REPOS\" | \\" NL
" grep \"[a-zA-Z0-9]\" > /dev/null || exit 1" NL
"" NL
+"# Exit on all errors." NL
+"set -e" NL
+"" NL
"# Check that the author of this commit has the rights to perform" NL
"# the commit on the files and directories being modified." NL
-"commit-access-control.pl \"$REPOS\" \"$TXN\" commit-access-control.cfg || exit 1"
- NL
+"\"$REPOS\"/hooks/commit-access-control.pl \"$REPOS\" $TXN \\" NL
+" \"$REPOS\"/hooks/commit-access-control.cfg" NL
"" NL
"# All checks passed, so allow the commit." NL
"exit 0" NL;
@@ -743,7 +749,7 @@
"REPOS=\"$1\"" NL
"REV=\"$2\"" NL
NL
-"mailer.py commit \"$REPOS\" \"$REV\" /path/to/mailer.conf" NL;
+"\"$REPOS\"/hooks/mailer.py commit \"$REPOS\" $REV \"$REPOS\"/mailer.conf" NL;
#undef SCRIPT_NAME
@@ -804,7 +810,8 @@
"USER=\"$2\"" NL
"" NL
"# Send email to interested parties, let them know a lock was created:" NL
-"mailer.py lock \"$REPOS\" \"$USER\" /path/to/mailer.conf" NL;
+"\"$REPOS\"/hooks/mailer.py lock \\" NL
+" \"$REPOS\" \"$USER\" \"$REPOS\"/hooks/mailer.conf" NL;
#undef SCRIPT_NAME
@@ -863,7 +870,8 @@
"USER=\"$2\"" NL
"" NL
"# Send email to interested parties, let them know a lock was removed:" NL
-"mailer.py unlock \"$REPOS\" \"$USER\" /path/to/mailer.conf" NL;
+"\"$REPOS\"/hooks/mailer.py unlock \\" NL
+" \"$REPOS\" \"$USER\" \"$REPOS\"/hooks/mailer.conf" NL;
#undef SCRIPT_NAME
@@ -928,8 +936,8 @@
"PROPNAME=\"$4\"" NL
"ACTION=\"$5\"" NL
"" NL
-"mailer.py propchange2 \"$REPOS\" \"$REV\" \"$USER\" \"$PROPNAME\" "
-"\"$ACTION\" /path/to/mailer.conf" NL;
+"\"$REPOS\"/hooks/mailer.py propchange2 \"$REPOS\" $REV \\" NL
+" \"$USER\" \"$PROPNAME\" \"$ACTION\" \"$REPOS\"/hooks/mailer.conf" NL;
#undef SCRIPT_NAME
|