Deleted Added
full compact
rcsfreeze.sh (9) rcsfreeze.sh (11891)
1#! /bin/sh
2
3# rcsfreeze - assign a symbolic revision number to a configuration of RCS files
4
1#! /bin/sh
2
3# rcsfreeze - assign a symbolic revision number to a configuration of RCS files
4
5# $Id: rcsfreeze.sh,v 4.4 1991/04/21 11:58:24 eggert Exp $
5# $Id: rcsfreeze.sh,v 4.6 1993/11/03 17:42:27 eggert Exp $
6
7# The idea is to run rcsfreeze each time a new version is checked
8# in. A unique symbolic revision number (C_[number], where number
9# is increased each time rcsfreeze is run) is then assigned to the most
10# recent revision of each RCS file of the main trunk.
11#
12# If the command is invoked with an argument, then this
13# argument is used as the symbolic name to freeze a configuration.

--- 6 unchanged lines hidden (view full) ---

20#
21# The shell script works only on all RCS files at one time.
22# It is important that all changed files are checked in (there are
23# no precautions against any error in this respect).
24# file names:
25# {RCS/}.rcsfreeze.ver version number
26# {RCS/}.rscfreeze.log log messages, most recent first
27
6
7# The idea is to run rcsfreeze each time a new version is checked
8# in. A unique symbolic revision number (C_[number], where number
9# is increased each time rcsfreeze is run) is then assigned to the most
10# recent revision of each RCS file of the main trunk.
11#
12# If the command is invoked with an argument, then this
13# argument is used as the symbolic name to freeze a configuration.

--- 6 unchanged lines hidden (view full) ---

20#
21# The shell script works only on all RCS files at one time.
22# It is important that all changed files are checked in (there are
23# no precautions against any error in this respect).
24# file names:
25# {RCS/}.rcsfreeze.ver version number
26# {RCS/}.rscfreeze.log log messages, most recent first
27
28PATH=/usr/gnu/bin:/usr/local/bin:/bin:/usr/bin:/usr/ucb:$PATH
28PATH=/usr/local/bin:/bin:/usr/bin:/usr/ucb:$PATH
29export PATH
30
31DATE=`date` || exit
32# Check whether we have an RCS subdirectory, so we can have the right
33# prefix for our paths.
29export PATH
30
31DATE=`date` || exit
32# Check whether we have an RCS subdirectory, so we can have the right
33# prefix for our paths.
34if [ -d RCS ]
35then RCSDIR=RCS/
36else RCSDIR=
34if test -d RCS
35then RCSDIR=RCS/ EXT=
36else RCSDIR= EXT=,v
37fi
38
39# Version number stuff, log message file
40VERSIONFILE=${RCSDIR}.rcsfreeze.ver
41LOGFILE=${RCSDIR}.rcsfreeze.log
42# Initialize, rcsfreeze never run before in the current directory
37fi
38
39# Version number stuff, log message file
40VERSIONFILE=${RCSDIR}.rcsfreeze.ver
41LOGFILE=${RCSDIR}.rcsfreeze.log
42# Initialize, rcsfreeze never run before in the current directory
43[ -r $VERSIONFILE ] || { echo 0 >$VERSIONFILE && >>$LOGFILE; } || exit
43test -r $VERSIONFILE || { echo 0 >$VERSIONFILE && >>$LOGFILE; } || exit
44
45# Get Version number, increase it, write back to file.
46VERSIONNUMBER=`cat $VERSIONFILE` &&
47VERSIONNUMBER=`expr $VERSIONNUMBER + 1` &&
48echo $VERSIONNUMBER >$VERSIONFILE || exit
49
50# Symbolic Revision Number
51SYMREV=C_$VERSIONNUMBER

--- 22 unchanged lines hidden (view full) ---

74 done
75 echo "-----------
76" &&
77 cat $LOGFILE
78) >$TMPLOG &&
79
80# combine old and new logfiles
81cp $TMPLOG $LOGFILE &&
44
45# Get Version number, increase it, write back to file.
46VERSIONNUMBER=`cat $VERSIONFILE` &&
47VERSIONNUMBER=`expr $VERSIONNUMBER + 1` &&
48echo $VERSIONNUMBER >$VERSIONFILE || exit
49
50# Symbolic Revision Number
51SYMREV=C_$VERSIONNUMBER

--- 22 unchanged lines hidden (view full) ---

74 done
75 echo "-----------
76" &&
77 cat $LOGFILE
78) >$TMPLOG &&
79
80# combine old and new logfiles
81cp $TMPLOG $LOGFILE &&
82rm -f $TMPLOG || exit
83trap 1 2 13 15
82rm -f $TMPLOG &&
84
85# Now the real work begins by assigning a symbolic revision number
83
84# 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.
85# to each rcs file. Take the most recent version on the default branch.
87
86
88status=
89
90for FILE in ${RCSDIR}*
87# If there are any .*,v files, throw them in too.
88# But ignore RCS/.* files that do not end in ,v.
89DOTFILES=
90for DOTFILE in ${RCSDIR}.*,v
91do
91do
92# get the revision number of the most recent revision
93 HEAD=`rlog -h $FILE` &&
94 REV=`echo "$HEAD" | sed -n 's/^head:[ ]*//p'` &&
95# assign symbolic name to it.
96 echo >&2 "rcsfreeze: $REV $FILE" &&
97 rcs -q -n$SYMREVNAME:$REV $FILE || status=$?
92 if test -f "$DOTFILE"
93 then
94 DOTFILES="${RCSDIR}.*,v"
95 break
96 fi
98done
99
97done
98
100exit $status
99exec rcs -q -n$SYMREVNAME: ${RCSDIR}*$EXT $DOTFILES