#!/bin/sh -e dir=`echo $1|sed -e's%/.*%%'` if [ ! -f $dir/CVS/Tag ]; then echo "Not a CVS working tree" exit 1 fi tag=`cat $dir/CVS/Tag | sed -e 's/^T//'` basetag=`echo $tag | sed -e 's/-local.*$//'` root=`cat $dir/CVS/Root` repository=`cat $dir/CVS/Repository` module=`echo $repository | sed -e "s!^$root/*!!"` names=""; for arg; do name=`echo $arg | sed -e 's!^[^/]*/*!!'` names="$names${names:+ }$module/$name" done if [ -f $dir/include/version.h ]; then version=$module-`grep 'VERSION.*"' $dir/include/version.h | cut '-d"' -f2 | sed -e 's/-CVS$//'` else version=`echo $basetag | tr "_" "."` fi if cvs diff $*; then : else echo echo -n "Commit those changes? (ctrl-c to quit)" read ans case "$ans" in y*|Y*) cvs commit $* ;; esac fi if [ -x .cleanpatch.$module ]; then cleanpatch=./.cleanpatch.$module else cleanpatch=cat fi cvs rdiff -kk -u -r $tag-lastpatch -r $tag $names | $cleanpatch >$version.patch if [ ! -s "$version.patch" ]; then echo "No changes!" rm "$version.patch" exit 1 fi if [ -d "$root" ]; then if [ ! -f $root/$repository/$tag.changelog-lastpatch ]; then touch $root/$repository/$tag.changelog-lastpatch fi set +e diff -e $root/$repository/$tag.changelog-lastpatch $root/$repository/$tag.changelog | egrep -v '^0a$|^\.$' >$version.patch.$$ set -e cat $version.patch >>$version.patch.$$ mv $version.patch.$$ $version.patch fi vi $version.patch echo -n "Name:" read name if [ -z "$name" ]; then echo "ABORTED!" rm $version.patch exit 1 fi patch="$version.`echo $name| sed -e 's/ /_/g'`.patch" mv $version.patch $patch ed -s <<- EOS $patch 0 a * $patch * . w EOS if [ -d "$root" ] && [ "$name" != "junk" ]; then ed -s <<- EOS $root/$repository/$tag.changelog 0 a * $patch * . w EOS fi if [ -d "$root" ]; then ln -f $root/$repository/$tag.changelog $root/$repository/$tag.changelog-lastpatch fi cvs -d$root rtag -r$tag -F $tag-lastpatch `awk '/^Index:/ { print $2 }' < $patch`