home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 3 / goldfish_volume_3.bin / files / dev / misc / hwgrcs / src / rcs.rcsfiles / rcsfreeze.sh,v < prev    next >
Encoding:
Text File  |  1995-06-25  |  3.8 KB  |  153 lines

  1. head    4.4;
  2. branch    4.4.1;
  3. access;
  4. symbols
  5.     HWGRCSP12F:4.4.1.1
  6.     HWGRCSP11F:4.4.1.1
  7.     HWGRCSP10F:4.4.1.1
  8.     HWGRCSP9:4.4.1.1
  9.     HWGRCSP8F:4.4.1.1
  10.     HWGRCSP7F:4.4.1.1
  11.     C_15:4.4.1.1
  12.     HWGRCSP6F:4.4.1.1
  13.     HWGRCSP5F:4.4.1.1
  14.     HWGRCSp4:4.4.1.1
  15.     HWGRCSp3:4.4.1
  16.     HWGRCS_Fish:4.4.1
  17.     HWGRCS:4.4.1;
  18. locks; strict;
  19. comment    @# @;
  20.  
  21.  
  22. 4.4
  23. date    91.04.21.11.58.24;    author eggert;    state Exp;
  24. branches
  25.     4.4.1.1;
  26. next    ;
  27.  
  28. 4.4.1.1
  29. date    93.01.18.14.40.23;    author heinz;    state Exp;
  30. branches;
  31. next    ;
  32.  
  33.  
  34. desc
  35. @Checked in with -k 16.jan.93 HWG
  36. @
  37.  
  38.  
  39. 4.4
  40. log
  41. @checked in with -k by heinz at 1993/01/17 01:55:49
  42. @
  43. text
  44. @#! /bin/sh
  45.  
  46. # rcsfreeze - assign a symbolic revision number to a configuration of RCS files
  47.  
  48. #    $Id: rcsfreeze.sh,v 4.4 1991/04/21 11:58:24 eggert Exp $
  49.  
  50. #       The idea is to run rcsfreeze each time a new version is checked
  51. #       in. A unique symbolic revision number (C_[number], where number
  52. #       is increased each time rcsfreeze is run) is then assigned to the most
  53. #       recent revision of each RCS file of the main trunk.
  54. #
  55. #       If the command is invoked with an argument, then this
  56. #       argument is used as the symbolic name to freeze a configuration.
  57. #       The unique identifier is still generated
  58. #       and is listed in the log file but it will not appear as
  59. #       part of the symbolic revision name in the actual RCS file.
  60. #
  61. #       A log message is requested from the user which is saved for future
  62. #       references.
  63. #
  64. #       The shell script works only on all RCS files at one time.
  65. #       It is important that all changed files are checked in (there are
  66. #       no precautions against any error in this respect).
  67. #       file names:
  68. #       {RCS/}.rcsfreeze.ver    version number
  69. #       {RCS/}.rscfreeze.log    log messages, most recent first
  70.  
  71. PATH=/usr/local/bin:/bin:/usr/bin:/usr/ucb:$PATH
  72. export PATH
  73.  
  74. DATE=`date` || exit
  75. # Check whether we have an RCS subdirectory, so we can have the right
  76. # prefix for our paths.
  77. if [ -d RCS ]
  78. then RCSDIR=RCS/
  79. else RCSDIR=
  80. fi
  81.  
  82. # Version number stuff, log message file
  83. VERSIONFILE=${RCSDIR}.rcsfreeze.ver
  84. LOGFILE=${RCSDIR}.rcsfreeze.log
  85. # Initialize, rcsfreeze never run before in the current directory
  86. [ -r $VERSIONFILE ] || { echo 0 >$VERSIONFILE && >>$LOGFILE; } || exit
  87.  
  88. # Get Version number, increase it, write back to file.
  89. VERSIONNUMBER=`cat $VERSIONFILE` &&
  90. VERSIONNUMBER=`expr $VERSIONNUMBER + 1` &&
  91. echo $VERSIONNUMBER >$VERSIONFILE || exit
  92.  
  93. # Symbolic Revision Number
  94. SYMREV=C_$VERSIONNUMBER
  95. # Allow the user to give a meaningful symbolic name to the revision.
  96. SYMREVNAME=${1-$SYMREV}
  97. echo >&2 "rcsfreeze: symbolic revision number computed: \"${SYMREV}\"
  98. rcsfreeze: symbolic revision number used:     \"${SYMREVNAME}\"
  99. rcsfreeze: the two differ only when rcsfreeze invoked with argument
  100. rcsfreeze: give log message, summarizing changes (end with EOF or single '.')" \
  101.     || exit
  102.  
  103. # Stamp the logfile. Because we order the logfile the most recent
  104. # first we will have to save everything right now in a temporary file.
  105. TMPLOG=/tmp/rcsfrz$$
  106. trap 'rm -f $TMPLOG; exit 1' 1 2 13 15
  107. # Now ask for a log message, continously add to the log file
  108. (
  109.     echo "Version: $SYMREVNAME($SYMREV), Date: $DATE
  110. -----------" || exit
  111.     while read MESS
  112.     do
  113.         case $MESS in
  114.         .) break
  115.         esac
  116.         echo "    $MESS" || exit
  117.     done
  118.     echo "-----------
  119. " &&
  120.     cat $LOGFILE
  121. ) >$TMPLOG &&
  122.  
  123. # combine old and new logfiles
  124. cp $TMPLOG $LOGFILE &&
  125. rm -f $TMPLOG || exit
  126. trap 1 2 13 15
  127.  
  128. # Now the real work begins by assigning a symbolic revision number
  129. # to each rcs file. Take the most recent version of the main trunk.
  130.  
  131. status=
  132.  
  133. for FILE in ${RCSDIR}*
  134. do
  135. #   get the revision number of the most recent revision
  136.     HEAD=`rlog -h $FILE` &&
  137.     REV=`echo "$HEAD" | sed -n 's/^head:[     ]*//p'` &&
  138. #   assign symbolic name to it.
  139.     echo >&2 "rcsfreeze: $REV $FILE" &&
  140.     rcs -q -n$SYMREVNAME:$REV $FILE || status=$?
  141. done
  142.  
  143. exit $status
  144. @
  145.  
  146.  
  147. 4.4.1.1
  148. log
  149. @Start of the AMIGA port of RCS 5.6. I call it HWGRCS now ;^)
  150. @
  151. text
  152. @@
  153.