source: LMDZ5/branches/IPSLCM6.0.12/tools/fcm/templates/hook/post-revprop-change @ 5423

Last change on this file since 5423 was 1578, checked in by jghattas, 13 years ago
  • Add fcm in LMDZ5/tools directory

It is no longer needed to have fcm in your environement PATH variable.
Now makelmdz_fcm takes by default this fcm. It is still possible to use
another fcm, using -fcm_path argument in makelmdz_fcm.

  • Property svn:executable set to *
File size: 2.4 KB
Line 
1#!/bin/sh
2
3# POST-REVPROP-CHANGE HOOK
4#
5# The post-revprop-change hook is invoked after a revision property
6# has been added, modified or deleted.  Subversion runs this hook by
7# invoking a program (script, executable, binary, etc.) named
8# 'post-revprop-change' (for which this file is a template), with the
9# following ordered arguments:
10#
11#   [1] REPOS-PATH   (the path to this repository)
12#   [2] REV          (the revision that was tweaked)
13#   [3] USER         (the username of the person tweaking the property)
14#   [4] PROPNAME     (the property that was changed)
15#   [5] ACTION       (the property was 'A'dded, 'M'odified, or 'D'eleted)
16#
17#   [STDIN] PROPVAL  ** the old property value is passed via STDIN.
18#
19# Because the propchange has already completed and cannot be undone,
20# the exit code of the hook program is ignored.  The hook program
21# can use the 'svnlook' utility to help it examine the
22# new property value.
23#
24# On a Unix system, the normal procedure is to have 'post-revprop-change'
25# invoke other programs to do the real work, though it may do the
26# work itself too.
27#
28# Note that 'post-revprop-change' must be executable by the user(s) who will
29# invoke it (typically the user httpd runs as), and that user must
30# have filesystem-level permission to access the repository.
31#
32# On a Windows system, you should name the hook program
33# 'post-revprop-change.bat' or 'post-revprop-change.exe',
34# but the basic idea is the same.
35#
36# The hook program typically does not inherit the environment of
37# its parent process.  For example, a common problem is for the
38# PATH environment variable to not be set to its usual value, so
39# that subprograms fail to launch unless invoked via absolute path.
40# If you're having unexpected problems with a hook program, the
41# culprit may be unusual (or missing) environment variables.
42#
43# Here is an example hook script, for a Unix /bin/sh interpreter.
44# For more examples and pre-written hooks, see those in
45# the Subversion repository at
46# http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/ and
47# http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/
48
49REPOS="$1"
50REV="$2"
51USER="$3"
52PROPNAME="$4"
53ACTION="$5"
54
55REPOS_NAME=${REPOS##*/}
56LOG_DIR=~fcm/svn/revprop-change
57LOG_FILE=$LOG_DIR/${REPOS_NAME}.post.log
58CMD=${REPOS}/hooks/post-revprop-change.py
59
60$CMD "$@" <&0 1>$LOG_FILE 2>&1
61RC=$?
62
63if ((RC != 0)); then
64  /bin/mail -s "$CMD failed" my.name@somewhere.org <<EOF
65$(<$LOG_FILE)
66EOF
67fi
68
69exit $RC
Note: See TracBrowser for help on using the repository browser.