2 PATH
=/usr
/local
/bin
:/bin
:/usr
/bin
:/usr
/ucb
3 # 'rcsfreeze' has the purpose of assigning a symbolic revision
4 # number to a set of RCS files, which form a valid configuration.
6 # The idea is to run rcsfreeze each time a new version is checked
7 # in. A unique symbolic revision number (C_[number], where number
8 # is increased each time rcsfreeze is run) is then assigned to the most
9 # recent revision of each RCS file of the main trunk.
11 # If the command is invoked with an argument, then this
12 # argument is used as the symbolic name to freeze a configuration.
13 # The unique identifier is still generated
14 # and is listed in the log file but it will not appear as
15 # part of the symbolic revision name in the actual RCS file.
17 # A log message is requested from the user which is saved for future
20 # The shell script works only on all RCS files at one time.
21 # It is important that all changed files are checked in (there are
22 # no precautions against any error in this respect).
24 # {RCS/}rcsfreeze.version for the version number
25 # {RCS/}rscfreeze.log for the log messages, most recent
28 progname
=`basename $0`
30 # Check whether we have an RCS subdirectory, so we can have the right
31 # prefix for our paths.
38 # Version number stuff, log message file
39 VERSIONFILE
=$RCSDIR/.rcsfreeze.version
40 LOGFILE
=$RCSDIR/.rcsfreeze.log
41 if [ ! -r $VERSIONFILE ] ; then
42 # Initialize, rcsfreeze never run before in the current directory
43 cat << EOF > $VERSIONFILE
49 # Get Version number, increase it, write back to file.
50 VERSIONNUMBER
=`cat $VERSIONFILE`
51 VERSIONNUMBER
=`expr $VERSIONNUMBER + 1`
52 cat << EOF > $VERSIONFILE
56 # Symbolic Revision Number
57 SYMREV
=C_
$VERSIONNUMBER
58 # Allow the user to give a meaningful symbolic name to the revision.
59 SYMREVNAME
=${1-$SYMREV}
60 echo "$progname: symbolic revision number computed: \"$SYMREV\""
61 echo "$progname: symbolic revision number used: \"$SYMREVNAME\""
62 echo "$progname: the two differ only when $progname invoked with argument"
64 # Stamp the logfile. Because we order the logfile the most recent
65 # first we will have to save everything right now in a temporary file.
66 TMPLOG
=/tmp
/rcsfreeze.$$.log.tmp
67 echo "Version: $SYMREVNAME($SYMREV), Date: $DATE" > $TMPLOG
68 echo "-----------" >> $TMPLOG
69 # Now ask for a log message, continously add to the log file
70 echo "$progname: give log message, summarizing changes"
71 echo " (terminate with ^D or single '.')"
73 if [ "$MESS" = '.' ] ; then break ; fi
74 echo " $MESS" >> $TMPLOG
76 echo "-----------" >> $TMPLOG
79 # combine old and new logfiles
81 cat $TMPLOG $LOGFILE > $TMPLOG2
83 rm -f $TMPLOG $TMPLOG2
85 # Now the real work begins by assigning a symbolic revision number
86 # to each rcs file. Take the most recent version of the main trunk.
88 for FILE
in $RCSDIR/* ; do
89 # get the revision number of the most recent revision
90 REV
=`rlog -h -d"$DATE" $FILE | fgrep 'head:' | awk ' { print $2 } ' `
91 echo "$progname: file name: \"$FILE\", Revision Number: $REV"
92 # assign symbolic name to it.
93 rcs
-q -n$SYMREVNAME:$REV $FILE