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