home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume24 / rcs / part12 < prev    next >
Text File  |  1991-03-05  |  9KB  |  352 lines

  1. Subject:  v24i012:  RCS source control system, Part12/12
  2. Newsgroups: comp.sources.unix
  3. Approved: rsalz@uunet.UU.NET
  4. X-Checksum-Snefru: 195884d7 f8dcbc3a d888858f 67b6a8d5
  5.  
  6. Submitted-by: Adam Hammer <hammer@cs.purdue.edu>
  7. Posting-number: Volume 24, Issue 12
  8. Archive-name: rcs/part12
  9.  
  10. #! /bin/sh
  11. # This is a shell archive.  Remove anything before this line, then feed it
  12. # into a shell via "sh file" or similar.  To overwrite existing files,
  13. # type "sh file -c".
  14. # The tool that generated this appeared in the comp.sources.unix newsgroup;
  15. # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
  16. # Contents:  man/Makefile man/ident.1 man/rcsfreeze.1 src/rcsclean.sh
  17. # Wrapped by rsalz@litchi.bbn.com on Thu Feb 21 14:37:12 1991
  18. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  19. echo If this archive is complete, you will see the following message:
  20. echo '          "shar: End of archive 12 (of 12)."'
  21. if test -f 'man/Makefile' -a "${1}" != "-c" ; then 
  22.   echo shar: Will not clobber existing file \"'man/Makefile'\"
  23. else
  24.   echo shar: Extracting \"'man/Makefile'\" \(574 characters\)
  25.   sed "s/^X//" >'man/Makefile' <<'END_OF_FILE'
  26. X# Make RCS man pages.
  27. X
  28. X#    $Id: Makefile,v 5.1 1990/09/14 22:26:30 hammer Exp $
  29. X
  30. Xinstall = install -c -m 444
  31. X
  32. Xall clean ::
  33. X
  34. Xinstall ::
  35. X    ${install} ci.1 ${DESTDIR}/usr/man/man1
  36. X    ${install} co.1 ${DESTDIR}/usr/man/man1
  37. X    ${install} ident.1 ${DESTDIR}/usr/man/man1
  38. X    ${install} merge.1 ${DESTDIR}/usr/man/man1
  39. X    ${install} rcs.1 ${DESTDIR}/usr/man/man1
  40. X    ${install} rcsdiff.1 ${DESTDIR}/usr/man/man1
  41. X    ${install} rcsintro.1 ${DESTDIR}/usr/man/man1
  42. X    ${install} rcsmerge.1 ${DESTDIR}/usr/man/man1
  43. X    ${install} rlog.1 ${DESTDIR}/usr/man/man1
  44. X    ${install} rcsfile.5 ${DESTDIR}/usr/man/man5
  45. END_OF_FILE
  46.   if test 574 -ne `wc -c <'man/Makefile'`; then
  47.     echo shar: \"'man/Makefile'\" unpacked with wrong size!
  48.   fi
  49.   # end of 'man/Makefile'
  50. fi
  51. if test -f 'man/ident.1' -a "${1}" != "-c" ; then 
  52.   echo shar: Will not clobber existing file \"'man/ident.1'\"
  53. else
  54.   echo shar: Extracting \"'man/ident.1'\" \(1414 characters\)
  55.   sed "s/^X//" >'man/ident.1' <<'END_OF_FILE'
  56. X.de Id
  57. X.ds Rv \\$3
  58. X.ds Dt \\$4
  59. X.ds iD \\$3 \\$4 \\$5 \\$6 \\$7
  60. X..
  61. X.Id $Id: ident.1,v 5.0 1990/08/22 09:09:36 eggert Exp $
  62. X.ds r \s-1RCS\s0
  63. X.if n .ds - \%--
  64. X.if t .ds - \(em
  65. X.TH IDENT 1 \*(Dt GNU
  66. X.SH NAME
  67. Xident \- identify files
  68. X.SH SYNOPSIS
  69. X.B ident
  70. X[
  71. X.B \-q
  72. X] [
  73. X.I file
  74. X\&.\|.\|. ]
  75. X.SH DESCRIPTION
  76. X.B ident
  77. Xsearches for all occurrences of the pattern
  78. X.BI $ keyword : .\|.\|. $
  79. Xin the named files or, if no file name appears, the standard input.
  80. X.PP
  81. XThese patterns are normally inserted automatically by the \*r command
  82. X.BR co (1),
  83. Xbut can also be inserted manually.
  84. XThe option
  85. X.B \-q
  86. Xsuppresses
  87. Xthe warning given if there are no patterns in a file.
  88. X.PP
  89. X.B ident
  90. Xworks on text files as well as object files and dumps.
  91. XFor example, if the C program in
  92. X.B f.c
  93. Xcontains
  94. X.IP
  95. X\f3char rcsid[] = \&"$\&Id: f.c,v \*(iD $\&";\fP
  96. X.LP
  97. Xand
  98. X.B f.c
  99. Xis compiled into
  100. X.BR f.o ,
  101. Xthen the command
  102. X.IP
  103. X.B "ident  f.c  f.o"
  104. X.LP
  105. Xwill output
  106. X.nf
  107. X.IP
  108. X.ft 3
  109. Xf.c:
  110. X    $\&Id: f.c,v \*(iD $
  111. Xf.o:
  112. X    $\&Id: f.c,v \*(iD $
  113. X.ft
  114. X.fi
  115. X.SH IDENTIFICATION
  116. XAuthor: Walter F. Tichy.
  117. X.br
  118. XRevision Number: \*(Rv; Release Date: \*(Dt.
  119. X.br
  120. XCopyright \(co 1982, 1988, 1989 by Walter F. Tichy.
  121. X.br
  122. XCopyright \(co 1990 by Paul Eggert.
  123. X.SH "SEE ALSO"
  124. Xci(1), co(1), rcs(1), rcsdiff(1), rcsintro(1), rcsmerge(1), rlog(1),
  125. Xrcsfile(5)
  126. X.br
  127. XWalter F. Tichy,
  128. X\*r\*-A System for Version Control,
  129. X.I "Software\*-Practice & Experience"
  130. X.BR 15 ,
  131. X7 (July 1985), 637-654.
  132. END_OF_FILE
  133.   if test 1414 -ne `wc -c <'man/ident.1'`; then
  134.     echo shar: \"'man/ident.1'\" unpacked with wrong size!
  135.   fi
  136.   # end of 'man/ident.1'
  137. fi
  138. if test -f 'man/rcsfreeze.1' -a "${1}" != "-c" ; then 
  139.   echo shar: Will not clobber existing file \"'man/rcsfreeze.1'\"
  140. else
  141.   echo shar: Extracting \"'man/rcsfreeze.1'\" \(1723 characters\)
  142.   sed "s/^X//" >'man/rcsfreeze.1' <<'END_OF_FILE'
  143. X.de Id
  144. X.ds Rv \\$3
  145. X.ds Dt \\$4
  146. X..
  147. X.Id $Id: rcsfreeze.1,v 4.4 1990/11/13 15:43:42 hammer Exp $
  148. X.ds r \s-1RCS\s0
  149. X.TH RCSFREEZE 1 \*(Dt GNU
  150. X.SH NAME
  151. Xrcsfreeze \- freeze a configuration of sources checked in under RCS
  152. X.SH SYNOPSIS
  153. X.B rcsfreeze
  154. X.RI [ "name" ]
  155. X.SH DESCRIPTION
  156. X.B rcsfreeze
  157. Xassigns a symbolic revision
  158. Xnumber to a set of \*r files that form a valid configuration.
  159. X.PP
  160. XThe idea is to run
  161. X.B rcsfreeze
  162. Xeach time a new version is checked
  163. Xin.  A unique symbolic name (\c
  164. X.BI C_ number,
  165. Xwhere
  166. X.I number
  167. Xis increased each time
  168. X.B rcsfreeze
  169. Xis run) is then assigned to the most
  170. Xrecent revision of each \*r file of the main trunk.
  171. X.PP
  172. XAn optional
  173. X.I name
  174. Xargument to
  175. X.B rcsfreeze
  176. Xgives a symbolic name to the configuration.
  177. XThe unique identifier is still generated
  178. Xand is listed in the log file but it will not appear as
  179. Xpart of the symbolic revision name in the actual \*r files.
  180. X.PP
  181. XA log message is requested from the user for future reference.
  182. X.PP
  183. XThe shell script works only on all \*r files at one time.
  184. XAll changed files must be checked in already.
  185. XRun
  186. X.IR rcsclean (1)
  187. Xfirst and see whether any sources remain in the current directory.
  188. X.SH FILES
  189. X.TP
  190. X.B RCS/.rcsfreeze.ver
  191. Xversion number
  192. X.TP
  193. X.B RCS/.rcsfreeze.log
  194. Xlog messages, most recent first
  195. X.SH AUTHOR
  196. XStephan v. Bechtolsheim
  197. X.SH "SEE ALSO"
  198. Xco(1), rcs(1), rcsclean(1), rlog(1)
  199. X.SH BUGS
  200. X.B rcsfreeze
  201. Xdoes not check whether any sources are checked out and modified.
  202. X.PP
  203. XAlthough both source file names and RCS file names are accepted,
  204. Xthey are not paired as usual with RCS commands.
  205. X.PP
  206. XError checking is rudimentary.
  207. X.PP
  208. X.B rcsfreeze
  209. Xis just an optional example shell script, and should not be taken too seriously.
  210. XSee \s-1CVS\s0 for a more complete solution.
  211. END_OF_FILE
  212.   if test 1723 -ne `wc -c <'man/rcsfreeze.1'`; then
  213.     echo shar: \"'man/rcsfreeze.1'\" unpacked with wrong size!
  214.   fi
  215.   # end of 'man/rcsfreeze.1'
  216. fi
  217. if test -f 'src/rcsclean.sh' -a "${1}" != "-c" ; then 
  218.   echo shar: Will not clobber existing file \"'src/rcsclean.sh'\"
  219. else
  220.   echo shar: Extracting \"'src/rcsclean.sh'\" \(1966 characters\)
  221.   sed "s/^X//" >'src/rcsclean.sh' <<'END_OF_FILE'
  222. X#! /bin/sh
  223. X#
  224. X# rcsclean - remove working files that are copies of the latest RCS revision
  225. X
  226. X#    $Id: rcsclean.sh,v 1.7 1990/11/13 15:46:17 hammer Exp $
  227. X
  228. X# This program removes working files which are copies of the latest
  229. X# revision on the default branch of the corresponding RCS files.
  230. X# For each file given, rcsclean performs a co operation for the latest
  231. X# revision on the default branch, and compares
  232. X# the result with the working file. If the two are identical,
  233. X# the working file is deleted.
  234. X#
  235. X# A typical application in a Makefile would be:
  236. X# clean:;       rm *.o; rcsclean *.c *.o
  237. X#
  238. X# Limitation: This program doesn't work if given the name of
  239. X# an RCS file rather than the name of the working file.
  240. X
  241. XPATH=/usr/local/bin:/bin:/usr/bin:/usr/ucb:$PATH
  242. Xexport PATH
  243. X
  244. Xusage='rcsclean: usage: rcsclean file ...'
  245. X
  246. Xcase $1 in
  247. X0) echo >&2 "$usage"; exit 2
  248. Xesac
  249. X
  250. X_='
  251. X'
  252. XIFS=$_
  253. X
  254. Xrcs=rcs
  255. Xrcsdiff=rcsdiff
  256. X
  257. Xfor i
  258. Xdo
  259. X    case $i in
  260. X    -*)
  261. X        case $i in
  262. X        -[qr]*) rcs=$rcs$_$i
  263. X        esac
  264. X        rcsdiff=$rcsdiff$_$i
  265. X        shift;;
  266. X    *) break
  267. X    esac
  268. Xdone
  269. X
  270. Xcase $# in
  271. X0)
  272. X    files=
  273. X    for file in .* *
  274. X    do
  275. X        case $file in
  276. X        *,v | . | ..) ;;
  277. X        [-+]* | *$_*) echo >&2 "rcsclean: $file: strange file name"; exit 2;;
  278. X        *)
  279. X            case $file in
  280. X            '*' | '.*') [ -f "$file" ] || continue
  281. X            esac
  282. X            files=$files$_$file
  283. X        esac
  284. X    done
  285. X    case $files in
  286. X    ?*) set $files
  287. X    esac;;
  288. X*)
  289. X    case $* in
  290. X    *$_*) echo >&2 'rcsclean: newline in arguments'; exit 2
  291. X    esac
  292. Xesac
  293. X
  294. Xremove=
  295. Xstatus=0
  296. X
  297. Xfor i
  298. Xdo
  299. X    case $i in
  300. X    -*)
  301. X        case $i in
  302. X        -[qr]*) rcs=$rcs$_$i
  303. X        esac
  304. X        rcsdiff=$rcsdiff$_$i;;
  305. X    *,v)
  306. X        echo >&2 "rcsclean: $i: cannot handle RCS file name"; exit 2;;
  307. X    *)
  308. X        $rcsdiff -q $i >/dev/null 2>&1
  309. X        case $? in
  310. X        # Ignore rcsdiff trouble (usually files that are not under RCS).
  311. X        0) remove=$remove$_$i;;
  312. X        1)
  313. X            echo >&2 "rcsclean: $i: " || exit
  314. X            status=1
  315. X        esac
  316. X    esac
  317. Xdone
  318. X
  319. Xcase $remove in
  320. X?*)
  321. X    unlock=`rlog -L -R -l${LOGNAME-$USER} $remove` &&
  322. X    case $unlock in
  323. X    ?*) $rcs -u $unlock
  324. X    esac &&
  325. X    rm -f $remove || status=2
  326. Xesac
  327. X
  328. Xexit $status
  329. END_OF_FILE
  330.   if test 1966 -ne `wc -c <'src/rcsclean.sh'`; then
  331.     echo shar: \"'src/rcsclean.sh'\" unpacked with wrong size!
  332.   fi
  333.   # end of 'src/rcsclean.sh'
  334. fi
  335. echo shar: End of archive 12 \(of 12\).
  336. cp /dev/null ark12isdone
  337. MISSING=""
  338. for I in 1 2 3 4 5 6 7 8 9 10 11 12 ; do
  339.     if test ! -f ark${I}isdone ; then
  340.     MISSING="${MISSING} ${I}"
  341.     fi
  342. done
  343. if test "${MISSING}" = "" ; then
  344.     echo You have unpacked all 12 archives.
  345.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  346. else
  347.     echo You still must unpack the following archives:
  348.     echo "        " ${MISSING}
  349. fi
  350. exit 0
  351. exit 0 # Just in case...
  352.