64459f3
#!/bin/sh
64459f3
64459f3
# Generate a patch that brings the most recent snapshot up-to-date
64459f3
64459f3
#branch=HEAD
64459f3
date='-D 2004-06-07-gmt'
64459f3
dir=`echo "cvs${branch}${date}" | tr ' ' '-'`
64459f3
patch=gdb-`sed -n -e 's/^Version:[	 ]*\(.*\)$/\1/p' gdb.spec`
64459f3
64459f3
if test ! -d ${dir}/src
64459f3
then
64459f3
  ( mkdir -p ${dir} && cd ${dir} && cvs \
64459f3
	-d :pserver:anoncvs@sources.redhat.com:/cvs/src \
64459f3
	checkout ${branch} ${date} gdb )
64459f3
fi
64459f3
64459f3
( cd ${dir}/src && cvs diff -Nu -r BASE -D `date -u +"%Y-%m-%d-gmt"` ./gdb ) | sed -e '
64459f3
/^Index: .*\/version\.in$/,/^Index/ d
64459f3
/^Index:/d
64459f3
/^====/d
64459f3
/^RCS/d
64459f3
/^retrieving/d
64459f3
/^diff/d
64459f3
/^--- /N
64459f3
/^---.* \/dev\/null/ {
64459f3
  p
64459f3
  d
64459f3
}
dcaf10b
/^--- \.\// {
64459f3
  s/^--- \([-a-zA-Z\/\.0-9\+]*\)/--- \1.1/
64459f3
  p
64459f3
  d
64459f3
}
64459f3
' | tee $patch-sync-`date -u +%Y%m%d`
64459f3
64459f3
exit
64459f3
64459f3
# s/^--- \([-a-zA-Z\/\.0-9\+]*\)/--- \1.1/
64459f3
# s/^[\+][\+][\+] \([-a-zA-Z\/\.0-9\+]*\)/+++ \1/
64459f3