aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/commit
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>1999-10-26 12:14:37 +0000
committerWerner Koch <[email protected]>1999-10-26 12:14:37 +0000
commitcf70ca8d68eb836b952f2c234f064b1afc205962 (patch)
treeaa33afbc79efd1f8538e5286b13d900321a8f14b /scripts/commit
parentChanged the way it works - now needs an extra program to to most tasks. (diff)
downloadgnupg-cf70ca8d68eb836b952f2c234f064b1afc205962.tar.gz
gnupg-cf70ca8d68eb836b952f2c234f064b1afc205962.zip
See ChangeLog: Tue Oct 26 14:10:21 CEST 1999 Werner Koch
Diffstat (limited to 'scripts/commit')
-rwxr-xr-xscripts/commit28
1 files changed, 19 insertions, 9 deletions
diff --git a/scripts/commit b/scripts/commit
index 992f93c3d..18a9b4aa7 100755
--- a/scripts/commit
+++ b/scripts/commit
@@ -11,15 +11,25 @@ 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"
+ 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
fi
done