2 head -16 configure.ac | grep VERSION= > /tmp/commitTool.tmp
3 source /tmp/commitTool.tmp
4 if [ -z "$EXTRA_GTK2_VERSION" ]; then
5 EXTRA_VERSION=`echo $EXTRA_VERSION | awk -F'.' '{for (i=1;i<NF;i++){printf $i"."};printf $NF+1}'`
6 nextsversion="${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}cvs${EXTRA_VERSION}"
7 nextextra="$EXTRA_VERSION"
10 EXTRA_GTK2_VERSION=`echo $EXTRA_GTK2_VERSION | awk -F'.' '{for (i=1;i<NF;i++){printf $i"."};printf $NF+1}'`
11 nextsversion="${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}cvs${EXTRA_VERSION}${EXTRA_GTK2_VERSION}"
12 nextextra="$EXTRA_GTK2_VERSION"
15 rm /tmp/commitTool.tmp
19 filelist=`cvs status $@ 2>/dev/null |grep ^File`
21 for file in $filelist; do
22 merge=`echo $file | grep Merge`
23 modif=`echo $file | grep Locally`
25 if [ "$merge" != "" ]; then
27 echo You have to update first
30 if [ "$modif" != "" ]; then
36 files=`cvs diff -u $@ 2>/dev/null |grep ^Index`
39 #change if your login isn't your name
40 if [ "$name" == "claws" ]; then
43 if [ "$name" == "reboot" ]; then
47 log="`date +%Y-%m-%d` [$name]\t$nextsversion\n\n"
48 for line in $files; do
49 file=`echo $line | cut -d' ' -f2`
51 filename=`basename $file`
52 cvsfile="$dir/CVS/Entries"
53 version=`grep "\/$filename\/" $cvsfile | cut -d'/' -f3`
54 nextversion=`echo $version | awk -F'.' '{for (i=1;i<NF;i++){printf $i"."};printf $NF+1}'`
57 patchset="$patchset cvs diff -u -r $version -r $nextversion $file;\
60 patchset="$patchset ) > $nextsversion.patchset"
63 if [ "$EDITOR" == "" ]; then
67 echo -e "\n#please type in the changelog entry" > /tmp/logentry.$$
68 $EDITOR /tmp/logentry.$$
69 grep -v "^#" /tmp/logentry.$$ |grep -v "^$" | sed "s/^/ /" > /tmp/log.tmp.$$ \
70 && mv /tmp/log.tmp.$$ /tmp/logentry.$$
71 echo >> /tmp/logentry.$$
75 if [ -f ChangeLog-gtk2.claws ]; then
76 chlog="ChangeLog-gtk2.claws"
77 elif [ -f ChangeLog.claws ]; then
78 chlog="ChangeLog.claws"
82 echo -n "Is it ok (write to $chlog and update configure.ac) [y/N]?"
84 if [ "$ans" == "y" ]; then
86 echo -e -n $log > $chlog
87 cat /tmp/logentry.$$ >> $chlog
88 cat $chlog.old >> $chlog
91 if [ "$nextextratype" == "head" ]; then
92 cat configure.ac | sed "s/^EXTRA_VERSION=.*/EXTRA_VERSION=$nextextra/" > configure.ac.new \
93 && mv configure.ac.new configure.ac ;
95 cat configure.ac | sed "s/^EXTRA_GTK2_VERSION=.*/EXTRA_GTK2_VERSION=$nextextra/" > configure.ac.new \
96 && mv configure.ac.new configure.ac ;
99 echo "$patchset" >> PATCHSETS
101 if [ "$@" != "" ]; then
102 echo commiting $@ PATCHSETS $chlog configure.ac
103 cvs commit -m "`cat /tmp/logentry.$$`" $@ PATCHSETS $chlog configure.ac
105 echo commiting recursively
106 cvs commit -m "`cat /tmp/logentry.$$` "
109 rm -f /tmp/logentry.$$