/[svnadmin]/localhost/svnadmin/hooks/post-commit
ViewVC logotype

Contents of /localhost/svnadmin/hooks/post-commit

Parent Directory Parent Directory | Revision Log Revision Log


Revision 16 - (show annotations) (download)
Mon Oct 30 12:32:51 2017 UTC (3 weeks, 1 day ago) by zsolt
File size: 948 byte(s)
Remove unneeded echo's.

1 #!/bin/sh
2
3 # Checkouted repository
4 REPO_CO=/home/zsolt/svn/svnadmin/
5 REPO="${1}"
6
7 SVNLOOK=/usr/bin/svnlitelook
8
9 CHANGED=`${SVNLOOK} changed ${REPO} | awk '/^[^D]/ {print $2}'`
10 DELETED=`${SVNLOOK} changed ${REPO} | awk '/^D/ {print $2}'`
11
12 # $1: server name
13 get_svn_root() {
14 case "$1" in
15 localhost)
16 echo "/home/storage/svn/"
17 ;;
18 svn.uzsolt.hu)
19 echo "/usr/local/subversion/"
20 ;;
21 esac
22 }
23
24 # $1: function to run
25 # $*: the values
26 for_all() {
27 FUNC=$1
28 shift
29 for i in $*; do
30 DESTURL=`echo ${i} | sed "s@/.*@@"`
31 FILE=${i} #`echo ${i} | sed "s@^[^/]*/@@"`
32 SERVERDIR="${DESTURL}:`get_svn_root ${DESTURL}`"
33 ${FUNC} "${SERVERDIR}" "${FILE}"
34 done
35 }
36
37 # $1: desturl, "server:directory" format
38 # $2: file with path relative to svn repository's root
39 func_scp() {
40 scp "${REPO_CO}/${2}" "${1}/${2#*/}"
41 }
42
43 func_rm() {
44 ssh "${1%:*}" rm "${1#*:}/${2}"
45 }
46
47 for_all func_scp ${CHANGED}
48 for_all func_rm ${DELETED}
49

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26