* toad at freenetproject.org <toad at freenetproject.org> [2007-03-17 17:36:34]:

> Author: toad
> Date: 2007-03-17 17:36:33 +0000 (Sat, 17 Mar 2007)
> New Revision: 12195
> 
> Added:
>    trunk/scripts/.project
>    trunk/scripts/README
>    trunk/scripts/verify-patch.sh
> Log:
> Maintenance scripts directory.
> Add README file.
> Add whitespace-changes verification script.
> 
> Added: trunk/scripts/verify-patch.sh
> ===================================================================
> --- trunk/scripts/verify-patch.sh                             (rev 0)
> +++ trunk/scripts/verify-patch.sh     2007-03-17 17:36:33 UTC (rev 12195)
> @@ -0,0 +1,35 @@
> +#!/bin/bash
> +# The cvs at freenetproject.org list receives all commits, apart from huge 
> commits which are
> +# simply unpacking a tarfile. The objective is to make it easy to 
> reconstruct the history
> +# from human-readable patches.
> +
> +# This script verifies that a patch from the CVS list is in fact pure 
> whitespace, or shows
> +# the bits that are not whitespace.
> +WORKINGCOPY=/usr/src/cvs/eclipse-workspace/Freenet\ 0.7
> +echo -n "Please enter revision number after patch applied? "
> +read REVISION
> +OLDREVISION=$(($REVISION-1))
> +echo -n "Please enter location of patch from mailing list? "
> +read FILENAME
> +# Make a temporary directory
> +TEMPDIR=`mktemp -d ~/verify-patch-temp-XXXXXXXXXX`
> +echo Temporary directory: $TEMPDIR
> +OLDDIR=$TEMPDIR/old
> +NEWDIR=$TEMPDIR/new
> +mkdir $OLDDIR $NEWDIR
> +cp -a "$WORKINGCOPY" $OLDDIR/
> +cd $OLDDIR
> +DNAME=`ls`
> +mv */* */.[a-z0-9]* .
> +rm -R "$DNAME"
> +svn revert -R .
> +svn update -r $OLDREVISION
> +ant distclean
> +find -iname .svn | xargs rm -R
> +rm -R .[a-z0-9]*
> +cp -a $OLDDIR/* $NEWDIR
> +cd $NEWDIR
> +if ! patch -p2 < $FILENAME ; then exit Failed to apply patch ; else echo 
> Applied patch successfully. ; fi
> +diff -urw $OLDDIR $NEWDIR > $TEMPDIR/diff-uw
> +if [ -s $TEMPDIR/diff-uw ] ; then less $TEMPDIR/diff-uw ; mv 
> $TEMPDIR/diff-uw ~/${REVISION}.diff ; echo Saved diff in ~/${REVISION}.diff ; 
> else echo No differences found after compensating for whitespace; fi
> +rm -R $TEMPDIR

you shouldn't set WORKINGCOPY if it exists ;) nor use "find -iname .svn| xargs 
rm -R" but svn export.

Reply via email to