claws-mail/commitHelper

124 lines
3.4 KiB
Text
Raw Normal View History

#!/bin/bash
if [ "$1" == "--syncgtk2" ]; then
shift
echo -n "sync with EXTRA_VERSION ? [xx] "
read newmicro
cat configure.ac | sed "s/^EXTRA_VERSION=.*/EXTRA_VERSION=$newmicro/" > configure.ac.new \
&& mv configure.ac.new configure.ac ;
cat configure.ac | sed "s/^EXTRA_GTK2_VERSION=.*/EXTRA_GTK2_VERSION=.0/" > configure.ac.new \
&& mv configure.ac.new configure.ac ;
fi;
2004-08-07 18:52:36 +02:00
args=`echo $@`
2004-07-10 12:52:07 +02:00
head -16 configure.ac | grep VERSION= > /tmp/commitTool.tmp
source /tmp/commitTool.tmp
2004-07-10 12:52:07 +02:00
if [ -z "$EXTRA_GTK2_VERSION" ]; then
EXTRA_VERSION=`echo $EXTRA_VERSION | awk -F'.' '{for (i=1;i<NF;i++){printf $i"."};printf $NF+1}'`
nextsversion="${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}cvs${EXTRA_VERSION}"
2004-08-06 17:57:10 +02:00
nextextra="$EXTRA_VERSION"
nextextratype="head"
2004-07-10 12:52:07 +02:00
else
EXTRA_GTK2_VERSION=`echo $EXTRA_GTK2_VERSION | awk -F'.' '{for (i=1;i<NF;i++){printf $i"."};printf $NF+1}'`
nextsversion="${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}cvs${EXTRA_VERSION}${EXTRA_GTK2_VERSION}"
2004-08-06 17:57:10 +02:00
nextextra="$EXTRA_GTK2_VERSION"
nextextratype="gtk2"
2004-07-10 12:52:07 +02:00
fi
rm /tmp/commitTool.tmp
IFS='
'
2004-08-07 14:35:24 +02:00
filelist=`cvs status $@ configure.ac 2>/dev/null |grep ^File`
for file in $filelist; do
merge=`echo $file | grep Merge`
modif=`echo $file | grep Locally`
if [ "$merge" != "" ]; then
echo $merge
echo You have to update first
exit
fi;
if [ "$modif" != "" ]; then
echo $modif
fi;
done;
patchset="("
log=""
2004-08-07 14:35:24 +02:00
files=`cvs diff -uN $@ 2>/dev/null |grep ^Index`
2004-07-09 11:07:30 +02:00
name=`whoami`
#change if your login isn't your name
if [ "$name" == "claws" ]; then
name="paul";
fi;
2004-07-22 14:34:57 +02:00
if [ "$name" == "reboot" ]; then
name="christoph";
fi;
2004-07-09 11:07:30 +02:00
log="`date +%Y-%m-%d` [$name]\t$nextsversion\n\n"
for line in $files; do
file=`echo $line | cut -d' ' -f2`
dir=`dirname $file`
filename=`basename $file`
cvsfile="$dir/CVS/Entries"
2004-07-09 11:07:30 +02:00
version=`grep "\/$filename\/" $cvsfile | cut -d'/' -f3`
nextversion=`echo $version | awk -F'.' '{for (i=1;i<NF;i++){printf $i"."};printf $NF+1}'`
2004-07-09 11:07:30 +02:00
log="$log\t* $file\n"
patchset="$patchset cvs diff -u -r $version -r $nextversion $file;\
"
done;
patchset="$patchset ) > $nextsversion.patchset"
if [ "$EDITOR" == "" ]; then
EDITOR=vi
fi;
2004-08-07 14:35:24 +02:00
if [ -n "/tmp/logentry" ]; then
echo -e "\n#please type in the changelog entry" > /tmp/logentry
fi;
$EDITOR /tmp/logentry
2004-08-07 14:35:24 +02:00
echo "--8<----------"
echo -e -n $log
grep -v "^#" /tmp/logentry |grep -v "^$" | sed "s/^/ /" > /tmp/log.tmp.$$ \
&& mv /tmp/log.tmp.$$ /tmp/logentry
echo >> /tmp/logentry
cat /tmp/logentry
echo "--8<----------"
if [ -f ChangeLog-gtk2.claws ]; then
chlog="ChangeLog-gtk2.claws"
2004-07-22 14:23:26 +02:00
elif [ -f ChangeLog.claws ]; then
chlog="ChangeLog.claws"
2004-07-22 14:23:26 +02:00
else
chlog="ChangeLog"
fi
2004-08-06 17:57:10 +02:00
echo -n "Is it ok (write to $chlog and update configure.ac) [y/N]?"
read ans
if [ "$ans" == "y" ]; then
mv $chlog $chlog.old
echo -e -n $log > $chlog
cat /tmp/logentry >> $chlog
cat $chlog.old >> $chlog
rm $chlog.old
2004-08-06 17:57:10 +02:00
if [ "$nextextratype" == "head" ]; then
cat configure.ac | sed "s/^EXTRA_VERSION=.*/EXTRA_VERSION=$nextextra/" > configure.ac.new \
&& mv configure.ac.new configure.ac ;
else
cat configure.ac | sed "s/^EXTRA_GTK2_VERSION=.*/EXTRA_GTK2_VERSION=$nextextra/" > configure.ac.new \
&& mv configure.ac.new configure.ac ;
fi;
echo "$patchset" >> PATCHSETS
2004-08-07 18:52:36 +02:00
if [ "$args" != "" ]; then
echo commiting $@ PATCHSETS $chlog configure.ac
cvs commit -m "`cat /tmp/logentry`" $@ PATCHSETS $chlog configure.ac
2004-07-28 09:56:28 +02:00
else
echo commiting recursively
cvs commit -m "`cat /tmp/logentry` "
2004-07-28 09:56:28 +02:00
fi;
2004-08-07 14:35:24 +02:00
rm -f /tmp/logentry
fi