- Timestamp:
- Mar 10, 2012, 2:40:14 PM (13 years ago)
- Location:
- tools/svn-hook
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/svn-hook/genesis-check.sh
r7306 r10091 1 1 #!/bin/sh 2 2 # 3 # $Id$4 3 # Check for valid genesis syntax 5 4 # Rick van der Zwet, 2009 … … 8 7 9 8 TMPDIR=`mktemp -d -t $(basename $0 .sh)` 9 10 # Clean up 11 trap "rm -R $TMPDIR; exit 0" 0 12 trap "rm -R $TMPDIR; exit 1" 1 2 15 13 10 14 # External definition used for debugging 11 15 SVNLOOK="${SVNLOOK:-/usr/local/bin/svnlook --transaction $TXN}" 12 GENESISDIR='node-config/genesis /nodes'16 GENESISDIR='node-config/genesis' 13 17 14 18 # Check whether we need to check something first … … 20 24 echo "Checking genesis config, please hold your horses..." 1>&2 21 25 for ENTRY in `$SVNLOOK tree --full-paths $REPOS $GENESISDIR`; do 26 echo $ENTRY | grep -q 'retired' && continue 27 22 28 echo $ENTRY | grep -q '/$' 23 29 if [ $? -eq 0 ]; then … … 29 35 30 36 # Do actual checking 31 sh $TMPDIR/$GENESISDIR/before-commit.sh 2>> $TMPDIR/log.txt 1>>$TMPDIR/log.txt 37 echo $TMPDIR/$GENESISDIR/tools/before-commit.sh 1>&2 38 sh $TMPDIR/$GENESISDIR/tools/before-commit.sh 2>> $TMPDIR/log.txt 1>>$TMPDIR/log.txt 32 39 RETVAL=$? 33 40 34 41 sed "s+$TMPDIR/node-config/genesis/nodes/++g" $TMPDIR/log.txt 1>&2 35 42 36 # Clean up37 rm -R $TMPDIR38 39 43 exit $RETVAL -
tools/svn-hook/pre-commit
r7300 r10091 1 1 #!/bin/sh 2 # $Id$ 2 # 3 REPOS="$1" 4 TXN="$2" 3 5 BASEDIR=`dirname $0` 4 6 5 REPOS="$1" 6 TXN="$2"7 export PATH=$PATH:/usr/local/bin 8 export PYTHON_EGG_CACHE="/tmp/eggs" 7 9 8 $BASEDIR/genesis-check.sh $REPOS $TXN || exit 1 10 $BASEDIR/genesis-check.sh $REPOS $TXN 2>&1 11 exit $? 9 12 10 # All checks passed, so allow the commit.11 exit 0
Note:
See TracChangeset
for help on using the changeset viewer.