1998-11-27 11:42:49 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# need a Posix shell, so we simply use bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
uid=`id -u`
|
|
|
|
date=`date`
|
|
|
|
name=$(awk -F: "\$3==$uid { print \$5 }" /etc/passwd )
|
|
|
|
addr="<`id -un`@`hostname -d`>"
|
|
|
|
|
|
|
|
for i in `find . -name Changes -print`; do
|
|
|
|
dir=`dirname $i`
|
|
|
|
if [ -s $dir/Changes ]; then
|
1999-10-26 12:14:37 +00:00
|
|
|
awk '
|
|
|
|
state == 0 && /^[ \t]*$/ { next }
|
|
|
|
state == 0 { state = 1 }
|
|
|
|
/^[ \t]*$/ { empty++; next }
|
|
|
|
{ while ( empty > 0 ) { print ""; empty--; }; print }
|
|
|
|
' < $dir/Changes > $dir/Changes.tmp
|
|
|
|
if [ -s $dir/Changes.tmp ]; then
|
|
|
|
lines=`wc -l <$dir/Changes.tmp`
|
|
|
|
echo "$date $name $addr" >$dir/ChangeLog.new
|
|
|
|
echo >>$dir/ChangeLog.new
|
|
|
|
cat $dir/Changes.tmp >>$dir/ChangeLog.new
|
|
|
|
echo >>$dir/ChangeLog.new
|
|
|
|
[ -f $dir/ChangeLog ] && cat $dir/ChangeLog >>$dir/ChangeLog.new
|
|
|
|
echo -n > $dir/Changes
|
|
|
|
[ -f $dir/ChangeLog ] && rm $dir/ChangeLog
|
|
|
|
mv $dir/ChangeLog.new $dir/ChangeLog
|
|
|
|
echo "$lines new lines in $dir/ChangeLog"
|
|
|
|
fi
|
|
|
|
rm $dir/Changes.tmp || true
|
1998-11-27 11:42:49 +00:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
1999-01-16 08:29:29 +00:00
|
|
|
# Execute canned cvs remove commands
|
|
|
|
for i in `find . -name cvs-remove -print`; do
|
|
|
|
dir=`dirname $i`
|
|
|
|
if [ -s $dir/cvs-remove ]; then
|
|
|
|
here=`pwd`
|
|
|
|
cd $dir
|
|
|
|
if cvs remove -f `cat cvs-remove`; then
|
|
|
|
rm cvs-remove
|
|
|
|
fi
|
|
|
|
cd $here
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# Execute canned cvs add commands
|
|
|
|
for i in `find . -name cvs-add -print`; do
|
|
|
|
dir=`dirname $i`
|
|
|
|
if [ -s $dir/cvs-add ]; then
|
|
|
|
here=`pwd`
|
|
|
|
cd $dir
|
|
|
|
if cvs add `cat cvs-add`; then
|
|
|
|
rm cvs-add
|
|
|
|
fi
|
|
|
|
cd $here
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
1999-12-31 11:44:29 +00:00
|
|
|
cvs -z3 commit -m "See ChangeLog: $date $name" $*
|
1998-11-27 11:42:49 +00:00
|
|
|
|