- New updatechecker.sh

- Fix up updateheads.sh and reviewfromrelease.sh
This commit is contained in:
zzz
2011-02-05 14:53:30 +00:00
parent 8f796922a4
commit 9b8866efab
4 changed files with 98 additions and 6 deletions

View File

@ -3,10 +3,13 @@
# this includes local changes not checked in
# zzz 2008-10
#
PREF=0.7
LAST=7
REL=$PREF$LAST
REL=`grep 'public final static String VERSION' core/java/src/net/i2p/CoreVersion.java | cut -d '"' -f2`
if [ -z "$REL" ]
then
echo "Cannot find current version"
exit 1
fi
echo "Diffing from $REL"
mtn diff -r t:i2p-$REL > 7$LAST.diff
$EDITOR 7$LAST.diff
mtn diff -r t:i2p-$REL > $REL.diff
$EDITOR $REL.diff

85
update/updatechecker.sh Executable file
View File

@ -0,0 +1,85 @@
#
# Check to see if all update hosts have the latest
# sud and su2 files by checking the first 56 bytes of each.
#
# Must be run from source directory to get the current version
# $I2P must be set
# Returns nonzero on failure
#
# zzz 2/2011 public domain
#
EEPPROXY='127.0.0.1:4444'
REL=`grep 'public final static String VERSION' core/java/src/net/i2p/CoreVersion.java | cut -d '"' -f2`
if [ -z "$REL" ]
then
echo "Cannot find current version"
exit 1
fi
CHARCOUNT=`echo -n $REL | wc -c`
#SOURCES=`cat updatesources.txt`
#if [ -z "$SOURCES" ]
#then
# echo "No sources to check"
# exit 1
#fi
# I guess we could also grep these out of the source but that's too hard
SOURCES=" \
http://echelon.i2p/i2p/i2pupdate.sud \
http://echelon.i2p/i2p/i2pupdate.su2 \
http://www.i2p2.i2p/_static/i2pupdate.sud \
http://www.i2p2.i2p/_static/i2pupdate.su2 \
http://update.postman.i2p/i2pupdate.sud \
http://update.postman.i2p/i2pupdate.su2 \
http://stats.i2p/i2p/i2pupdate.sud \
http://stats.i2p/i2p/i2pupdate.su2 \
"
if [ -z "$I2P" ]
then
echo '$I2P must be set'
exit 1
fi
TMPDIR=/tmp/updatecheck$$
mkdir $TMPDIR || exit 1
cd $TMPDIR
for i in $SOURCES
do
echo "checking $i for version $REL ..."
F=`basename $i`
java -cp $I2P/lib/i2p.jar net.i2p.util.PartialEepGet -p $EEPPROXY $i
if [ $? -eq 0 ]
then
if [ -s $F ]
then
HISREL=`tail -c +41 $F | head -c $CHARCOUNT`
if [ "$HISREL" = "$REL" ]
then
echo "*** passed, found version '$HISREL' at $i"
else
FAIL=1
echo "*** failed, found version '$HISREL' at $i"
fi
else
FAIL=1
echo "*** failed to fetch $i"
fi
else
FAIL=1
echo "*** failed to fetch $i"
fi
rm -f $F
done
cd /tmp
rm -rf $TMPDIR
if [ "$FAIL" != "" ]
then
echo '******** At least one source failed check *********'
else
echo '*** All sources passed'
fi
exit $FAIL

View File

@ -1,7 +1,7 @@
#
# check to see if all update hosts have the latest
#
for i in `cat updatesources.txt``
for i in `cat updatesources.txt`
do
echo $i
eephead $i

View File

@ -1,4 +1,8 @@
http://echelon.i2p/i2p/i2pupdate.sud
http://echelon.i2p/i2p/i2pupdate.su2
http://www.i2p2.i2p/_static/i2pupdate.sud
http://www.i2p2.i2p/_static/i2pupdate.su2
http://update.postman.i2p/i2pupdate.sud
http://update.postman.i2p/i2pupdate.su2
http://stats.i2p/i2p/i2pupdate.sud
http://stats.i2p/i2p/i2pupdate.su2