mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-08 12:44:23 +01:00
54 lines
1.1 KiB
Bash
Executable File
54 lines
1.1 KiB
Bash
Executable File
#!/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
|
|
lines=`wc -l <$dir/Changes`
|
|
echo "$date $name $addr" >$dir/ChangeLog.new
|
|
echo >>$dir/ChangeLog.new
|
|
cat $dir/Changes >>$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
|
|
done
|
|
|
|
# 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
|
|
|
|
cvs commit -m "See ChangeLog: $date $name" $*
|
|
|