Last change
on this file since 10188 was 10091, checked in by rick, 13 years ago |
Working copies at server, now with new python stuff.
|
-
Property svn:executable
set to
*
-
Property svn:keywords
set to
Id
|
File size:
1.0 KB
|
Rev | Line | |
---|
[7300] | 1 | #!/bin/sh
|
---|
| 2 | #
|
---|
| 3 | # Check for valid genesis syntax
|
---|
| 4 | # Rick van der Zwet, 2009
|
---|
| 5 | REPOS="$1"
|
---|
| 6 | TXN="$2"
|
---|
| 7 |
|
---|
| 8 | TMPDIR=`mktemp -d -t $(basename $0 .sh)`
|
---|
[10091] | 9 |
|
---|
| 10 | # Clean up
|
---|
| 11 | trap "rm -R $TMPDIR; exit 0" 0
|
---|
| 12 | trap "rm -R $TMPDIR; exit 1" 1 2 15
|
---|
| 13 |
|
---|
[7300] | 14 | # External definition used for debugging
|
---|
| 15 | SVNLOOK="${SVNLOOK:-/usr/local/bin/svnlook --transaction $TXN}"
|
---|
[10091] | 16 | GENESISDIR='node-config/genesis'
|
---|
[7300] | 17 |
|
---|
| 18 | # Check whether we need to check something first
|
---|
| 19 | $SVNLOOK changed $REPOS | grep -q $GENESISDIR
|
---|
| 20 | if [ $? -eq 1 ]; then
|
---|
| 21 | exit 0
|
---|
| 22 | fi
|
---|
| 23 |
|
---|
| 24 | echo "Checking genesis config, please hold your horses..." 1>&2
|
---|
| 25 | for ENTRY in `$SVNLOOK tree --full-paths $REPOS $GENESISDIR`; do
|
---|
[10091] | 26 | echo $ENTRY | grep -q 'retired' && continue
|
---|
| 27 |
|
---|
[7300] | 28 | echo $ENTRY | grep -q '/$'
|
---|
| 29 | if [ $? -eq 0 ]; then
|
---|
| 30 | mkdir -p $TMPDIR/$ENTRY
|
---|
| 31 | else
|
---|
| 32 | $SVNLOOK cat $REPOS $ENTRY > $TMPDIR/$ENTRY
|
---|
| 33 | fi
|
---|
| 34 | done
|
---|
| 35 |
|
---|
| 36 | # Do actual checking
|
---|
[10091] | 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
|
---|
[7300] | 39 | RETVAL=$?
|
---|
| 40 |
|
---|
[7306] | 41 | sed "s+$TMPDIR/node-config/genesis/nodes/++g" $TMPDIR/log.txt 1>&2
|
---|
[7300] | 42 |
|
---|
| 43 | exit $RETVAL
|
---|
Note:
See
TracBrowser
for help on using the repository browser.