3 [ -d patches ] && cd patches
5 if [ ! -f verify-patches ]; then
6 echo "Please run this script from the root of the rsync dir"
7 echo "or from inside the patches subdir."
11 root=`cat ../CVS/Root`
12 tmpdir=,tmp-for-patch-tests
14 [ -d $tmpdir ] || mkdir $tmpdir
17 [ -d workdir ] || mkdir workdir
18 echo "Using CVS to update the $tmpdir/cvsdir copy of the source."
19 cvs -d "$root" co -d cvsdir rsync
29 *gzip-rsyncable.diff) continue ;;
30 patches/*) xx=`echo $xx | sed 's:patches:../..:'` ;;
32 *.diff) xx=../../$xx ;;
37 echo -e "\n----------- $xx ------------"
38 if [ $apply = y ]; then
39 rsync -a --delete ../cvsdir/ .
40 patch -p0 <$xx | tee ,patch.output
42 for nn in `sed -n 's/^patching file //p' ,patch.output`; do
43 [ -f ../cvsdir/$nn ] || new="$new $nn"
45 if grep "^Hunk #[0-9]* FAILED" ,patch.output >/dev/null; then
47 elif grep "^Hunk #[0-9]* succeeded" ,patch.output >/dev/null; then
54 echo -e "\nFix rejects, Edit both diffs, Update patch,"
55 echo -n "Apply patch again, Next, Quit: [$default] "
57 [ -z "$ans" ] && ans=$default
60 [ ! -z "$new" ] && cvs add $new
62 rm -f *.rej *.orig */*.rej */*.orig
63 sed '/^--- /,$ d' $xx >,new.patch
64 cvs diff -N | egrep -v '^(diff -|===============|RCS file: |retrieving revision |Index: )' >>,new.patch
69 vim `sed -ne 's/.* saving rejects to file //p' ,patch.output`
73 if [ -f ,new.patch ]; then
75 echo -e "\nCopied ,new.patch to $xx"
78 echo -e "\n*** Edit the diffs first. ***"