home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume19 / shape / part11 < prev    next >
Text File  |  1989-05-31  |  52KB  |  1,468 lines

  1. Subject:  v19i024:  A software configuration management system, Part11/33
  2. Newsgroups: comp.sources.unix
  3. Sender: sources
  4. Approved: rsalz@uunet.UU.NET
  5.  
  6. Submitted-by: Axel Mahler <unido!coma!axel>
  7. Posting-number: Volume 19, Issue 24
  8. Archive-name: shape/part11
  9.  
  10.  
  11.  
  12. #! /bin/sh
  13. # This is a shell archive.  Remove anything before this line, then unpack
  14. # it by saving it into a file and typing "sh file".  To overwrite existing
  15. # files, type "sh file -c".  You can also feed this as standard input via
  16. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  17. # will see the following message at the end:
  18. #        "End of archive 11 (of 33)."
  19. # Contents:  man/man1/retrv.1 man/man1/vcat.1 src/afs/afstore.c
  20. #   src/inc/afsys.h src/vc/Makefile
  21. # Wrapped by rsalz@papaya.bbn.com on Thu Jun  1 19:27:00 1989
  22. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  23. if test -f 'man/man1/retrv.1' -a "${1}" != "-c" ; then 
  24.   echo shar: Will not clobber existing file \"'man/man1/retrv.1'\"
  25. else
  26. echo shar: Extracting \"'man/man1/retrv.1'\" \(9516 characters\)
  27. sed "s/^X//" >'man/man1/retrv.1' <<'END_OF_FILE'
  28. X...
  29. X... Copyright (C) 1989, 1990 W. Koch, A. Lampen, A. Mahler, W. Obst,
  30. X...  and U. Pralle
  31. X... 
  32. X... This software is published on an as-is basis. There is ABSOLUTELY NO
  33. X... WARRANTY for any part of this software to work correctly or as described
  34. X... in the manuals. We do not accept any liability for any kind of damage
  35. X... caused by use of this software, such as loss of data, time, money, or 
  36. X... effort.
  37. X... 
  38. X... Permission is granted to use, copy, modify, or distribute any part of
  39. X... this software as long as this is done without asking for charge, and
  40. X... provided that this copyright notice is retained as part of the source
  41. X... files. You may charge a distribution fee for the physical act of
  42. X... transferring a copy, and you may at your option offer warranty
  43. X... protection in exchange for a fee.
  44. X... 
  45. X... Direct questions to: Tech. Univ. Berlin
  46. X...              Wilfried Koch
  47. X...              Sekr. FR 5-6 
  48. X...              Franklinstr. 28/29
  49. X...              D-1000 Berlin 10, West Germany
  50. X... 
  51. X...              Tel: +49-30-314-22972
  52. X...              E-mail: shape@coma.uucp or shape@db0tui62.bitnet
  53. X... 
  54. X...
  55. X... $Header: retrv.1[3.2] Thu Feb 23 18:13:43 1989 axel@coma published $
  56. X... 
  57. X... Log for /u/shape/dist-tape/src/vc/retrv.1[3.0]
  58. X...     Thu Feb 23 18:13:43 1989 axel@coma published $
  59. X...  --- empty log message ---
  60. X...  retrv.1[3.1] Thu Feb 23 18:13:43 1989 axel@coma published $
  61. X...  --- empty log message ---
  62. X...  retrv.1[3.2] Thu Feb 23 18:13:43 1989 axel@coma published $
  63. X...  --- empty log message ---
  64. X...
  65. X.TH RETRV 1 retrv \n(dy.\n(mo.\n(yr
  66. X.SH NAME
  67. Xretrv \- retrieve a revision of a file
  68. X.SH SYNOPSIS
  69. X.IP \fBretrv\fR\ [\ \fIoptions\fR\ ]\fR\ files\ \.\|. 0.5i
  70. X.IP \fBvcat\fR\ [\ \fIoptions\fR\ ]\fR\ files\ \.\|.
  71. X.IP \fIOptions:\fR \w'\fIOptions:++\fR'u
  72. X[\ \fB\-fhlmqt\fR\ ] [\ \fB\-V\ \fI<version>\ \fR] [\ \fB\-a\ \fIafile\fR\ ]
  73. X[\ \fB\-date\ \fI<date>\ \fR] [\ \fB\-dest\fI\ path\fR\ ]
  74. X.br
  75. X[\ \fB\-g\ \fIgeneration\ \fR] 
  76. X[\ \fB\-n\ \fIauthor\fR\ ] [\ \fB\-p\ \fIprojectname\fR\ ] 
  77. X[\ \fB\-s\ \fIstate\fR\ ]
  78. X.SH DESCRIPTION
  79. X.PP
  80. X\fBRetrv\fR retrieves a specified, previously saved version of a file from
  81. Xthe version object base.
  82. XUnless otherwise
  83. Xspecified by the project context (\fB\-p\fR), the archive is expected to
  84. Xreside in the AFS subdirectory. The retrieved version will be created
  85. Xin the current directory. Retrieve tries to be careful if an
  86. Xattempt is made to overwrite an existing busy-version: unless \fB\-f\fR
  87. Xis specified, \fBretrv\fR will ask the caller for permission.
  88. XIf no busy version exists, one is created with the same modes as the
  89. Xformerly saved version. If a busy version exists, its modes are preserved
  90. Xunless
  91. X\fB\-m\fR is given.
  92. X.PP
  93. X\fIVersion attributes\fR that are cited within the text of a stored revision
  94. Xare expanded by default. Attribute citation expressions are left unchanged
  95. Xif a revision is retrieved with the \fB\-lock\fR option.
  96. X.PP
  97. XIf the program is invoked as \fBvcat\fR, the specified version(s)
  98. Xwill be printed on standard output. No status change of the
  99. Xobject base will 
  100. Xoccur in this case. The \fB\-t\fR switch of the \fBretrv\fR command
  101. Xcorresponds to \fBvcat\fR.
  102. X.PP
  103. XThere's a number of ways to specify which version shall be retrieved.
  104. XWith \fB\-V\fR an explicit version can be selected. 
  105. XAnother kind of argument to \fB\-V\fR
  106. Xcould be a symbolic name that was assigned to
  107. Xthe desired version by use of the \-n option of \fBsave\fR. 
  108. XObject names may also be given in \fIbound version notation\fR,
  109. Xi.e. a notation that identifies a particular version of an object (e.g.
  110. X\fCmkattr.c[2.4]\fR). It is also possible to use a previously assigned
  111. X\fIsymbolic name\fR rather than a numerical 
  112. Xversion identification (e.g. \fCmkattr.c[tools-V4R3]\fR). Make sure
  113. Xto escape the bracket-symbols as these usually have meaning to the
  114. Xshell.
  115. X.PP
  116. XAlternatively, 
  117. Xversions
  118. Xcan be selected by supplying certain attribute values to \fBretrv\fR, such as
  119. Xthe name of the author, the version state, a generation number or a 
  120. Xset of user defined attributes, possibly describing a variant. In case
  121. Xthat more than one version has the desired attributes, the newest
  122. Xof them is selected.
  123. XThis behaviour can be turned off by setting the \fB\-x\fR switch (exact!) which
  124. Xindicates that the supplied version specification should match exactly
  125. Xone version. \fB\-V\fR implies \fB\-x\fR.
  126. X.PP
  127. XAny combination of the selection options implies a conjunctive 
  128. Xsearch expression.
  129. X.LP
  130. XIn complete detail, \fBretrv\fR can be invoked with the following options:
  131. X.IP \fB\-f\fR \w'\fB\-V\ \fI<version>\fR'u
  132. Xforces the reinstallation of the specified version as busy version without
  133. Xasking the user, even if a writable (possibly unsaved) busy version
  134. Xexists. This option should be used together with \fB\-x\fR.
  135. X.IP "\fB\-h\fR"
  136. Xprints brief instructions about using this program.
  137. X.IP \fB\-lock\fR
  138. Xtries to reserve the privilege to add a new version to an object
  139. Xhistory, thus preventing multiple programmers working upon the same 
  140. Xobject base from interfering with each other by saving concurrent updates.
  141. XThis simple mechanism is for use in small development projects, that do
  142. X\fInot\fR employ the scheme of private, experimental archives for each 
  143. Xparticipating programmer, and one centralized \fIproject library\fR where
  144. Xindividual work results are collected. 
  145. XWhen setting a new lock on an object history, the requesting user
  146. Xis prompted for an optional description of the planned changes.
  147. X.IP \fB\-m\fR
  148. Xreinstalls the new busy version with the file modes that were in effect
  149. Xwhen the specified version was saved.
  150. X.IP \fB\-q\fR
  151. Xquiet operation. No messages are printed on standard output. 
  152. XIf a current busy version exists, it will not be overwritten by 
  153. Xthe specified version unless \fB\-f\fR is set. This option is useful for
  154. Xbatch operation.
  155. X.IP \fB\-t\fR
  156. Xprint the contents of the specified version on standard output.
  157. XThe current busy version is not affected. See also \fBvcat\fR.
  158. X.IP \fB\-version\fR
  159. Xprint version identification for this program.
  160. X.IP \fB\-x\fR
  161. Xrequire an exact match of the version specification. In case that a
  162. Xversion specification matches more than one version in the archive
  163. X(e.g. if no options are supplied at all), \fBretrv\fR by default selects the 
  164. X\fInewest\fR of them. With \fB\-x\fR set, the retrieve operation \fIfails\fR
  165. Xif more than one version matches the given version specification.
  166. X.IP \fB\-V\ \fI<version>\fR
  167. Xexplicitly select the version determined by \fIversion\fR. \fIVersion\fR
  168. Xcan be of the form \fIgeneration\.revision\fR (e.g. 9.4) or it
  169. Xcan be a unique symbolic name that was previously assigned to a version
  170. Xby use of the \-n option of \fBsave\fR (e.g. \fCrelease4\fR).
  171. X.IP \fB\-a\ \fIafile\fR
  172. Xselect versions that conform to the attribute specification in \fIafile\fR.
  173. XAttributes must be given in the form \fIname=value\fR
  174. Xwith one attribute specification per line and no white-space.
  175. XThe attribute value is optional, however, the \fIequal\fR symbol must
  176. Xbe present. If the \fB\-a\fR option is omitted, \fBretrv\fR searches
  177. Xthe environment for a variable \fIRETRATTRS\fR. If this variable
  178. Xis absent, no user defined attributes will be used to determine the
  179. Xversion to be selected.
  180. X.IP \fB\-date\ \fI<date>\fR
  181. X.IP \fB\-d\ \fI<date>\fR
  182. Xselects the newest version that was saved \fIbefore\fR the date given
  183. Xby \fIdate\fR. The date specification has the form \fIYY/MM/DD[/HH:MM]\fR.
  184. XThe brackets indicate that the daytime specification is optional.
  185. XThe option \fB\-d\fR is shorthand for \fB\-date\fR.
  186. X.IP \fB\-dest\fI\ path\fR
  187. Xretrieves the specified version from the object base and installs 
  188. Xa \fIcopy\fR it in the directory denoted by \fIpath\fR. As this 
  189. Xdirectory may be a long way apart from the directory containing
  190. Xthe AFS archives, this copy of the retrieved version is separated
  191. Xfrom its history and subsequently \fIunrelated\fR to the object
  192. Xhistory it came from. Proper object histories require a constant
  193. Xspatial relationship of any busy versions and the corresponding
  194. Xarchives. This relationship requires the archives to reside
  195. Xin a subdirectory 
  196. Xnamed \fIAFS\fR.
  197. X.IP \fB\-g\ \fIgeneration\fR
  198. Xselects the newest version that was saved during generation \fIgeneration\fR.
  199. X.IP \fB\-n\ \fIauthor\fR
  200. Xselects the newest version that was saved by the user \fIauthor\fR.
  201. X.IP \fB\-p\ \fIprojectname\fR
  202. Xestablishes a \fIproject context\fR for the retrieve operation.
  203. XThe project context defines the extent of the search space to be
  204. Xconsidered by \fIretrv\fR, the permissions of the user issuing
  205. Xthe command and a number of other parameters. 
  206. X.br
  207. XProject support is not implemented in the current version and so
  208. Xthis option has no effect yet.
  209. X.IP \fB\-s\ \fIstate\fR
  210. Xselects the newest version that has the given \fIstate. State\fR may
  211. Xbe either of \fIbusy, saved, proposed, published, accessed, \fRor\fI
  212. Xfrozen\fR.
  213. X.SH FILES
  214. XAll revisions of documents are retrieved from archive files located
  215. Xin the subdirectory
  216. XAFS. 
  217. X.SH SEE ALSO
  218. Xsave(1), rsrv(1), sbmt(1), shape(1), vadm(1), vl(1), 
  219. Xaf_intro(3), af_archive(5)
  220. X.SH BUGS
  221. XProject support is yet unimplemented.
  222. X.PP
  223. XSupport of user-defined attributes is rudimentary. Specification of such
  224. Xattributes must be syntactically correct.
  225. X.PP
  226. X\fBretrv\fR neither reads the \fIShapefile\fR nor the \fIMakefile\fR and
  227. Xconsequently sticks with the 'individual document level' rather than to
  228. Xsupport handling of entire systems or subsystems (higer level targets
  229. Xin \fI{Shape,Make}file\fRs).
  230. X.SH AUTHOR
  231. XAxel Mahler
  232. X.br
  233. XTechnical University Berlin
  234. X.sp
  235. X\fIUUCP:\fR        axel@coma.uucp (unido!coma!axel)
  236. X.br
  237. X\fIBITNET:\fR    axel@db0tui62
  238. END_OF_FILE
  239. if test 9516 -ne `wc -c <'man/man1/retrv.1'`; then
  240.     echo shar: \"'man/man1/retrv.1'\" unpacked with wrong size!
  241. fi
  242. # end of 'man/man1/retrv.1'
  243. fi
  244. if test -f 'man/man1/vcat.1' -a "${1}" != "-c" ; then 
  245.   echo shar: Will not clobber existing file \"'man/man1/vcat.1'\"
  246. else
  247. echo shar: Extracting \"'man/man1/vcat.1'\" \(9516 characters\)
  248. sed "s/^X//" >'man/man1/vcat.1' <<'END_OF_FILE'
  249. X...
  250. X... Copyright (C) 1989, 1990 W. Koch, A. Lampen, A. Mahler, W. Obst,
  251. X...  and U. Pralle
  252. X... 
  253. X... This software is published on an as-is basis. There is ABSOLUTELY NO
  254. X... WARRANTY for any part of this software to work correctly or as described
  255. X... in the manuals. We do not accept any liability for any kind of damage
  256. X... caused by use of this software, such as loss of data, time, money, or 
  257. X... effort.
  258. X... 
  259. X... Permission is granted to use, copy, modify, or distribute any part of
  260. X... this software as long as this is done without asking for charge, and
  261. X... provided that this copyright notice is retained as part of the source
  262. X... files. You may charge a distribution fee for the physical act of
  263. X... transferring a copy, and you may at your option offer warranty
  264. X... protection in exchange for a fee.
  265. X... 
  266. X... Direct questions to: Tech. Univ. Berlin
  267. X...              Wilfried Koch
  268. X...              Sekr. FR 5-6 
  269. X...              Franklinstr. 28/29
  270. X...              D-1000 Berlin 10, West Germany
  271. X... 
  272. X...              Tel: +49-30-314-22972
  273. X...              E-mail: shape@coma.uucp or shape@db0tui62.bitnet
  274. X... 
  275. X...
  276. X... $Header: retrv.1[3.2] Thu Feb 23 18:13:43 1989 axel@coma published $
  277. X... 
  278. X... Log for /u/shape/dist-tape/src/vc/retrv.1[3.0]
  279. X...     Thu Feb 23 18:13:43 1989 axel@coma published $
  280. X...  --- empty log message ---
  281. X...  retrv.1[3.1] Thu Feb 23 18:13:43 1989 axel@coma published $
  282. X...  --- empty log message ---
  283. X...  retrv.1[3.2] Thu Feb 23 18:13:43 1989 axel@coma published $
  284. X...  --- empty log message ---
  285. X...
  286. X.TH RETRV 1 retrv \n(dy.\n(mo.\n(yr
  287. X.SH NAME
  288. Xretrv \- retrieve a revision of a file
  289. X.SH SYNOPSIS
  290. X.IP \fBretrv\fR\ [\ \fIoptions\fR\ ]\fR\ files\ \.\|. 0.5i
  291. X.IP \fBvcat\fR\ [\ \fIoptions\fR\ ]\fR\ files\ \.\|.
  292. X.IP \fIOptions:\fR \w'\fIOptions:++\fR'u
  293. X[\ \fB\-fhlmqt\fR\ ] [\ \fB\-V\ \fI<version>\ \fR] [\ \fB\-a\ \fIafile\fR\ ]
  294. X[\ \fB\-date\ \fI<date>\ \fR] [\ \fB\-dest\fI\ path\fR\ ]
  295. X.br
  296. X[\ \fB\-g\ \fIgeneration\ \fR] 
  297. X[\ \fB\-n\ \fIauthor\fR\ ] [\ \fB\-p\ \fIprojectname\fR\ ] 
  298. X[\ \fB\-s\ \fIstate\fR\ ]
  299. X.SH DESCRIPTION
  300. X.PP
  301. X\fBRetrv\fR retrieves a specified, previously saved version of a file from
  302. Xthe version object base.
  303. XUnless otherwise
  304. Xspecified by the project context (\fB\-p\fR), the archive is expected to
  305. Xreside in the AFS subdirectory. The retrieved version will be created
  306. Xin the current directory. Retrieve tries to be careful if an
  307. Xattempt is made to overwrite an existing busy-version: unless \fB\-f\fR
  308. Xis specified, \fBretrv\fR will ask the caller for permission.
  309. XIf no busy version exists, one is created with the same modes as the
  310. Xformerly saved version. If a busy version exists, its modes are preserved
  311. Xunless
  312. X\fB\-m\fR is given.
  313. X.PP
  314. X\fIVersion attributes\fR that are cited within the text of a stored revision
  315. Xare expanded by default. Attribute citation expressions are left unchanged
  316. Xif a revision is retrieved with the \fB\-lock\fR option.
  317. X.PP
  318. XIf the program is invoked as \fBvcat\fR, the specified version(s)
  319. Xwill be printed on standard output. No status change of the
  320. Xobject base will 
  321. Xoccur in this case. The \fB\-t\fR switch of the \fBretrv\fR command
  322. Xcorresponds to \fBvcat\fR.
  323. X.PP
  324. XThere's a number of ways to specify which version shall be retrieved.
  325. XWith \fB\-V\fR an explicit version can be selected. 
  326. XAnother kind of argument to \fB\-V\fR
  327. Xcould be a symbolic name that was assigned to
  328. Xthe desired version by use of the \-n option of \fBsave\fR. 
  329. XObject names may also be given in \fIbound version notation\fR,
  330. Xi.e. a notation that identifies a particular version of an object (e.g.
  331. X\fCmkattr.c[2.4]\fR). It is also possible to use a previously assigned
  332. X\fIsymbolic name\fR rather than a numerical 
  333. Xversion identification (e.g. \fCmkattr.c[tools-V4R3]\fR). Make sure
  334. Xto escape the bracket-symbols as these usually have meaning to the
  335. Xshell.
  336. X.PP
  337. XAlternatively, 
  338. Xversions
  339. Xcan be selected by supplying certain attribute values to \fBretrv\fR, such as
  340. Xthe name of the author, the version state, a generation number or a 
  341. Xset of user defined attributes, possibly describing a variant. In case
  342. Xthat more than one version has the desired attributes, the newest
  343. Xof them is selected.
  344. XThis behaviour can be turned off by setting the \fB\-x\fR switch (exact!) which
  345. Xindicates that the supplied version specification should match exactly
  346. Xone version. \fB\-V\fR implies \fB\-x\fR.
  347. X.PP
  348. XAny combination of the selection options implies a conjunctive 
  349. Xsearch expression.
  350. X.LP
  351. XIn complete detail, \fBretrv\fR can be invoked with the following options:
  352. X.IP \fB\-f\fR \w'\fB\-V\ \fI<version>\fR'u
  353. Xforces the reinstallation of the specified version as busy version without
  354. Xasking the user, even if a writable (possibly unsaved) busy version
  355. Xexists. This option should be used together with \fB\-x\fR.
  356. X.IP "\fB\-h\fR"
  357. Xprints brief instructions about using this program.
  358. X.IP \fB\-lock\fR
  359. Xtries to reserve the privilege to add a new version to an object
  360. Xhistory, thus preventing multiple programmers working upon the same 
  361. Xobject base from interfering with each other by saving concurrent updates.
  362. XThis simple mechanism is for use in small development projects, that do
  363. X\fInot\fR employ the scheme of private, experimental archives for each 
  364. Xparticipating programmer, and one centralized \fIproject library\fR where
  365. Xindividual work results are collected. 
  366. XWhen setting a new lock on an object history, the requesting user
  367. Xis prompted for an optional description of the planned changes.
  368. X.IP \fB\-m\fR
  369. Xreinstalls the new busy version with the file modes that were in effect
  370. Xwhen the specified version was saved.
  371. X.IP \fB\-q\fR
  372. Xquiet operation. No messages are printed on standard output. 
  373. XIf a current busy version exists, it will not be overwritten by 
  374. Xthe specified version unless \fB\-f\fR is set. This option is useful for
  375. Xbatch operation.
  376. X.IP \fB\-t\fR
  377. Xprint the contents of the specified version on standard output.
  378. XThe current busy version is not affected. See also \fBvcat\fR.
  379. X.IP \fB\-version\fR
  380. Xprint version identification for this program.
  381. X.IP \fB\-x\fR
  382. Xrequire an exact match of the version specification. In case that a
  383. Xversion specification matches more than one version in the archive
  384. X(e.g. if no options are supplied at all), \fBretrv\fR by default selects the 
  385. X\fInewest\fR of them. With \fB\-x\fR set, the retrieve operation \fIfails\fR
  386. Xif more than one version matches the given version specification.
  387. X.IP \fB\-V\ \fI<version>\fR
  388. Xexplicitly select the version determined by \fIversion\fR. \fIVersion\fR
  389. Xcan be of the form \fIgeneration\.revision\fR (e.g. 9.4) or it
  390. Xcan be a unique symbolic name that was previously assigned to a version
  391. Xby use of the \-n option of \fBsave\fR (e.g. \fCrelease4\fR).
  392. X.IP \fB\-a\ \fIafile\fR
  393. Xselect versions that conform to the attribute specification in \fIafile\fR.
  394. XAttributes must be given in the form \fIname=value\fR
  395. Xwith one attribute specification per line and no white-space.
  396. XThe attribute value is optional, however, the \fIequal\fR symbol must
  397. Xbe present. If the \fB\-a\fR option is omitted, \fBretrv\fR searches
  398. Xthe environment for a variable \fIRETRATTRS\fR. If this variable
  399. Xis absent, no user defined attributes will be used to determine the
  400. Xversion to be selected.
  401. X.IP \fB\-date\ \fI<date>\fR
  402. X.IP \fB\-d\ \fI<date>\fR
  403. Xselects the newest version that was saved \fIbefore\fR the date given
  404. Xby \fIdate\fR. The date specification has the form \fIYY/MM/DD[/HH:MM]\fR.
  405. XThe brackets indicate that the daytime specification is optional.
  406. XThe option \fB\-d\fR is shorthand for \fB\-date\fR.
  407. X.IP \fB\-dest\fI\ path\fR
  408. Xretrieves the specified version from the object base and installs 
  409. Xa \fIcopy\fR it in the directory denoted by \fIpath\fR. As this 
  410. Xdirectory may be a long way apart from the directory containing
  411. Xthe AFS archives, this copy of the retrieved version is separated
  412. Xfrom its history and subsequently \fIunrelated\fR to the object
  413. Xhistory it came from. Proper object histories require a constant
  414. Xspatial relationship of any busy versions and the corresponding
  415. Xarchives. This relationship requires the archives to reside
  416. Xin a subdirectory 
  417. Xnamed \fIAFS\fR.
  418. X.IP \fB\-g\ \fIgeneration\fR
  419. Xselects the newest version that was saved during generation \fIgeneration\fR.
  420. X.IP \fB\-n\ \fIauthor\fR
  421. Xselects the newest version that was saved by the user \fIauthor\fR.
  422. X.IP \fB\-p\ \fIprojectname\fR
  423. Xestablishes a \fIproject context\fR for the retrieve operation.
  424. XThe project context defines the extent of the search space to be
  425. Xconsidered by \fIretrv\fR, the permissions of the user issuing
  426. Xthe command and a number of other parameters. 
  427. X.br
  428. XProject support is not implemented in the current version and so
  429. Xthis option has no effect yet.
  430. X.IP \fB\-s\ \fIstate\fR
  431. Xselects the newest version that has the given \fIstate. State\fR may
  432. Xbe either of \fIbusy, saved, proposed, published, accessed, \fRor\fI
  433. Xfrozen\fR.
  434. X.SH FILES
  435. XAll revisions of documents are retrieved from archive files located
  436. Xin the subdirectory
  437. XAFS. 
  438. X.SH SEE ALSO
  439. Xsave(1), rsrv(1), sbmt(1), shape(1), vadm(1), vl(1), 
  440. Xaf_intro(3), af_archive(5)
  441. X.SH BUGS
  442. XProject support is yet unimplemented.
  443. X.PP
  444. XSupport of user-defined attributes is rudimentary. Specification of such
  445. Xattributes must be syntactically correct.
  446. X.PP
  447. X\fBretrv\fR neither reads the \fIShapefile\fR nor the \fIMakefile\fR and
  448. Xconsequently sticks with the 'individual document level' rather than to
  449. Xsupport handling of entire systems or subsystems (higer level targets
  450. Xin \fI{Shape,Make}file\fRs).
  451. X.SH AUTHOR
  452. XAxel Mahler
  453. X.br
  454. XTechnical University Berlin
  455. X.sp
  456. X\fIUUCP:\fR        axel@coma.uucp (unido!coma!axel)
  457. X.br
  458. X\fIBITNET:\fR    axel@db0tui62
  459. END_OF_FILE
  460. if test 9516 -ne `wc -c <'man/man1/vcat.1'`; then
  461.     echo shar: \"'man/man1/vcat.1'\" unpacked with wrong size!
  462. fi
  463. # end of 'man/man1/vcat.1'
  464. fi
  465. if test -f 'src/afs/afstore.c' -a "${1}" != "-c" ; then 
  466.   echo shar: Will not clobber existing file \"'src/afs/afstore.c'\"
  467. else
  468. echo shar: Extracting \"'src/afs/afstore.c'\" \(9385 characters\)
  469. sed "s/^X//" >'src/afs/afstore.c' <<'END_OF_FILE'
  470. X/*
  471. X * Copyright (C) 1989, 1990 W. Koch, A. Lampen, A. Mahler, W. Obst,
  472. X *  and U. Pralle
  473. X * 
  474. X * This software is published on an as-is basis. There is ABSOLUTELY NO
  475. X * WARRANTY for any part of this software to work correctly or as described
  476. X * in the manuals. We do not accept any liability for any kind of damage
  477. X * caused by use of this software, such as loss of data, time, money, or 
  478. X * effort.
  479. X * 
  480. X * Permission is granted to use, copy, modify, or distribute any part of
  481. X * this software as long as this is done without asking for charge, and
  482. X * provided that this copyright notice is retained as part of the source
  483. X * files. You may charge a distribution fee for the physical act of
  484. X * transferring a copy, and you may at your option offer warranty
  485. X * protection in exchange for a fee.
  486. X * 
  487. X * Direct questions to: Tech. Univ. Berlin
  488. X *              Wilfried Koch
  489. X *              Sekr. FR 5-6 
  490. X *              Franklinstr. 28/29
  491. X *              D-1000 Berlin 10, West Germany
  492. X * 
  493. X *              Tel: +49-30-314-22972
  494. X *              E-mail: shape@coma.uucp or shape@db0tui62.bitnet
  495. X */
  496. X/*
  497. X *    Shape/AFS
  498. X *
  499. X *    afstore.c -- interface to archives and binary pools
  500. X *
  501. X *    Author: Andreas Lampen, TU-Berlin (andy@coma.UUCP)
  502. X *                      (andy@db0tui62.BITNET)
  503. X *
  504. X *    $Header: afstore.c[1.5] Wed Feb 22 16:28:15 1989 andy@coma published $
  505. X *
  506. X *    EXPORT:
  507. X *      af_bldfile -- build file containing data of version 
  508. X *      af_newvers -- get attribute buffer for new version
  509. X *      af_delvers -- delete version
  510. X *      af_addvers -- add version
  511. X *      af_updtvers -- update attribute buffer of version
  512. X *      af_detlist -- detach archive or binary pool
  513. X */
  514. X
  515. X#include <stdio.h>
  516. X#include <string.h>
  517. X#ifdef SUNOS_4_0
  518. X#include <strings.h>
  519. X#endif
  520. X#include <sys/time.h>
  521. X#include <sys/types.h>
  522. X#include <sys/stat.h>
  523. X
  524. X#include "typeconv.h"
  525. X#include "afsys.h"
  526. X#include "afs.h"
  527. X#include "afarchive.h"
  528. X
  529. X/*=========================================================================
  530. X * af_arlock -- lock archive
  531. X *
  532. X *=========================================================================*/
  533. X
  534. XLOCAL af_arlock (list)
  535. X     Af_revlist *list;
  536. X{
  537. X  struct stat ibuf;
  538. X  char lckfilename [MAXNAMLEN*4];
  539. X  FILE *lckfd;
  540. X
  541. X  if (stat (list->af_arfilename, &ibuf) == ERROR) /* no archive file present */
  542. X    {
  543. X      /* if there should be an archive file */
  544. X      if (list->af_lastmod != (time_t) 0)
  545. X    FAIL ("arlock", "archive file lost", AF_EINTERNAL, ERROR);
  546. X    }
  547. X  else
  548. X    {
  549. X      /* if archive has changed since last read */
  550. X      if (list->af_lastmod != (time_t) af_cvttime (ibuf.st_mtime))
  551. X    FAIL ("arlock", "", AF_EARCHANGED, ERROR);
  552. X    }
  553. X
  554. X  (void) strcpy (lckfilename, list->af_arfilename);
  555. X  lckfilename [strlen (lckfilename) - sizeof (char)] = AF_LCKEXT;
  556. X  if (stat (lckfilename, &ibuf) == ERROR) /* no lock file present */
  557. X    {
  558. X      /* create lockfile */
  559. X      if ((lckfd = fopen (lckfilename, "w")) == (FILE *)0)
  560. X    SFAIL ("arlock", "fopen (lockfile)", AF_ESYSERR, ERROR);
  561. X      (void) fclose (lckfd);
  562. X      af_reglckfile (lckfilename);
  563. X      return (AF_OK);
  564. X    }
  565. X
  566. X  sleep (AF_LOCKTIMEOUT);
  567. X  
  568. X  if (stat (lckfilename, &ibuf) == ERROR) /* no lock file present */
  569. X    {
  570. X      if ((lckfd = fopen (lckfilename, "w")) == (FILE *)0)
  571. X    SFAIL ("arlock", "fopen (lockfile)", AF_ESYSERR, ERROR);
  572. X      (void) fclose (lckfd);
  573. X      af_reglckfile (lckfilename);
  574. X      return (AF_OK);
  575. X    }
  576. X  else
  577. X    FAIL ("arlock", "", AF_EARLOCKED, ERROR);
  578. X}
  579. X
  580. X/*=========================================================================
  581. X * af_arunlock -- unlock archive
  582. X *
  583. X *=========================================================================*/
  584. X
  585. XLOCAL af_arunlock (list)
  586. X     Af_revlist *list;
  587. X{
  588. X  char lckfilename [MAXNAMLEN*4];
  589. X  struct stat ibuf;
  590. X
  591. X  (void) strcpy (lckfilename, list->af_arfilename);
  592. X  lckfilename [strlen (lckfilename) - sizeof (char)] = AF_LCKEXT;
  593. X
  594. X  /* update list descriptor */
  595. X  if (stat (list->af_arfilename, &ibuf) != ERROR)
  596. X    list->af_lastmod = (time_t) af_cvttime (ibuf.st_mtime);
  597. X
  598. X  if (af_unlink (lckfilename) == ERROR)
  599. X    FAIL ("af_arunlock", "lock file lost", AF_EINTERNAL, ERROR);
  600. X  return (AF_OK);
  601. X}
  602. X
  603. X/*=========================================================================
  604. X * af_bldfile
  605. X *
  606. X *=========================================================================*/
  607. X
  608. XEXPORT af_bldfile (key, name)
  609. X     Af_key *key;
  610. X     char   *name;
  611. X{
  612. X  struct timeval tvp[2];
  613. X
  614. X  if (key->af_ldes->af_extent & AF_BPOOL)
  615. X    {
  616. X      /* get file from binary pool */
  617. X      if (af_cpfile (af_bpfilename (CATTR(key).af_syspath, VATTR(key).af_hashname), VATTR(key).af_fsize, name) == ERROR)
  618. X    FAIL ("bldfile", "cpfile", AF_ESYSERR, ERROR);
  619. X      /*** set modification and access date ***/
  620. X      tvp[0].tv_sec = VATTR(key).af_atime;
  621. X      tvp[0].tv_usec = 0; 
  622. X      tvp[1].tv_sec = VATTR(key).af_mtime;
  623. X      tvp[1].tv_usec = 0;
  624. X      if (utimes (name, tvp) == ERROR)
  625. X    FAIL ("bldfile", "utimes", AF_ESYSERR, ERROR);
  626. X      (void) af_uchmod (name, (int) VATTR(key).af_mode);
  627. X    }
  628. X  else
  629. X    {
  630. X      /* get data from archive file */
  631. X      if (af_readdata (key->af_ldes) == ERROR)
  632. X    return (ERROR);
  633. X      
  634. X      if (af_undodelta (key, name) == ERROR)
  635. X    return (ERROR);
  636. X    }
  637. X  return (AF_OK);
  638. X}
  639. X
  640. X
  641. X/*=========================================================================
  642. X * af_newvers
  643. X *
  644. X *=========================================================================*/
  645. X
  646. XEXPORT af_newvers (list, key, mode)
  647. X     Af_revlist *list;
  648. X     Af_key     *key;
  649. X     int        mode;
  650. X{
  651. X  if (mode != AF_SOURCE)
  652. X    FAIL ("newvers", "invalid mode", AF_EINTERNAL, ERROR);
  653. X
  654. X  key->af_ldes = list;
  655. X  /* if revision list is full */
  656. X  if ((key->af_lpos = af_gfreepos (list)) == ERROR)
  657. X    FAIL ("newvers", "too many new revisions", AF_EINTERNAL, ERROR);
  658. X  
  659. X  /* get data from archive */
  660. X  if (af_readdata (list) == ERROR)
  661. X    return (ERROR);
  662. X
  663. X  return (AF_OK);
  664. X}
  665. X  
  666. X
  667. X
  668. X/*=========================================================================
  669. X * af_delvers -- delete version
  670. X *
  671. X *=========================================================================*/
  672. X
  673. XEXPORT af_delvers (key)
  674. X     Af_key *key;
  675. X{
  676. X  char *busyname;
  677. X
  678. X  /* if key points to a file in a binary pool */
  679. X  if (key->af_ldes->af_extent & AF_BPOOL)
  680. X    return (af_delbpentry (key));
  681. X
  682. X  /* if "key" points to a busy version */
  683. X  if (af_arlock (key->af_ldes) == ERROR)
  684. X    return (ERROR);
  685. X
  686. X  if (VATTR(key).af_state == AF_BUSY)
  687. X    {
  688. X      VATTR(key).af_predgen = AF_NOVNUM;
  689. X      VATTR(key).af_predrev = AF_NOVNUM;
  690. X      VATTR(key).af_lckname = (char *)0;
  691. X      VATTR(key).af_lckhost = (char *)0;
  692. X      VATTR(key).af_ltime = AF_NOTIME;
  693. X      /* remove busy file */
  694. X      busyname = af_gbusname (CATTR(key).af_syspath, VATTR(key).af_name, VATTR(key).af_type);
  695. X      (void) af_unlink (busyname);
  696. X      af_hashfree (&(VATTR(key).af_uhtab));
  697. X    }
  698. X  else
  699. X    /* remove delta */
  700. X    {
  701. X      /* read data section of archive */
  702. X      if (af_readdata (key->af_ldes) == ERROR)
  703. X    return (ERROR);
  704. X      
  705. X      key->af_ldes->af_datasize -= VATTR(key).af_notesize;
  706. X      if (VATTR(key).af_repr == AF_DELTA)
  707. X    key->af_ldes->af_datasize -= VATTR(key).af_dsize;
  708. X      else
  709. X    key->af_ldes->af_datasize -= VATTR(key).af_fsize;
  710. X
  711. X      (void) af_rmdelta (key);
  712. X    }
  713. X
  714. X  /* clear "valid" bit */
  715. X  VATTR(key).af_class &= ~AF_VALID;
  716. X
  717. X  key->af_ldes->af_nrevs--;
  718. X
  719. X  if (af_writearchive (key->af_ldes) == ERROR)
  720. X    {
  721. X      (void) af_arunlock (key->af_ldes);
  722. X      return (ERROR);
  723. X    }
  724. X  else
  725. X    return (af_arunlock (key->af_ldes));
  726. X}
  727. X
  728. X/*=========================================================================
  729. X * af_addvers -- add version
  730. X *
  731. X *=========================================================================*/
  732. X
  733. XEXPORT af_addvers (key)
  734. X     Af_key *key;
  735. X{
  736. X  /* this function should only be used for archives (not for bpools */
  737. X  /* I know, it is not very well-designed but ... */
  738. X  if (key->af_ldes->af_extent & AF_BPOOL)
  739. X    FAIL ("addvers", "cannot apply on binary pools", AF_EINTERNAL, ERROR);
  740. X  if (af_arlock (key->af_ldes) == ERROR)
  741. X    return (ERROR); 
  742. X  if (af_writearchive (key->af_ldes) == ERROR)
  743. X    {
  744. X      (void) af_arunlock (key->af_ldes);
  745. X      return (ERROR);
  746. X    }
  747. X  else
  748. X    return (af_arunlock (key->af_ldes));
  749. X}
  750. X
  751. X/*=========================================================================
  752. X * af_updtvers -- update attribute buffer of version
  753. X *
  754. X *=========================================================================*/
  755. X
  756. XEXPORT af_updtvers (key, mode)
  757. X     Af_key *key;
  758. X     int    mode;
  759. X{
  760. X  if (mode & (AF_ALLVERS | AF_CHANGE))
  761. X    {
  762. X      /* update time of last status change (ctime) for all versions */
  763. X      /* not yet implemented (update ctime) */
  764. X    }
  765. X  else 
  766. X    {
  767. X      if (mode & AF_CHANGE) /* update ctime only for this version */
  768. X    VATTR(key).af_ctime = (time_t) af_acttime ();
  769. X    }
  770. X
  771. X  if (key->af_ldes->af_extent & AF_BPOOL)
  772. X    return (af_rplbpentry (key, key, key));
  773. X  else
  774. X    {
  775. X      if (af_arlock (key->af_ldes) == ERROR)
  776. X    return (ERROR); 
  777. X      if (af_writearchive (key->af_ldes) == ERROR)
  778. X    {
  779. X      (void) af_arunlock (key->af_ldes);
  780. X      return (ERROR);
  781. X    }
  782. X      else
  783. X    return (af_arunlock (key->af_ldes));
  784. X    }
  785. X}
  786. X
  787. X/*=========================================================================
  788. X * af_detlist -- detach archive or binary pool
  789. X *
  790. X *=========================================================================*/
  791. X
  792. XEXPORT af_detlist (list)
  793. X     Af_revlist *list;
  794. X{
  795. X  if (list->af_extent & AF_BPOOL)
  796. X    return (af_detbpool (list));
  797. X  else
  798. X    return (af_detarchive (list));
  799. X}
  800. X
  801. END_OF_FILE
  802. if test 9385 -ne `wc -c <'src/afs/afstore.c'`; then
  803.     echo shar: \"'src/afs/afstore.c'\" unpacked with wrong size!
  804. fi
  805. # end of 'src/afs/afstore.c'
  806. fi
  807. if test -f 'src/inc/afsys.h' -a "${1}" != "-c" ; then 
  808.   echo shar: Will not clobber existing file \"'src/inc/afsys.h'\"
  809. else
  810. echo shar: Extracting \"'src/inc/afsys.h'\" \(9500 characters\)
  811. sed "s/^X//" >'src/inc/afsys.h' <<'END_OF_FILE'
  812. X/*
  813. X * Copyright (C) 1989, 1990 W. Koch, A. Lampen, A. Mahler, W. Obst,
  814. X *  and U. Pralle
  815. X * 
  816. X * This software is published on an as-is basis. There is ABSOLUTELY NO
  817. X * WARRANTY for any part of this software to work correctly or as described
  818. X * in the manuals. We do not accept any liability for any kind of damage
  819. X * caused by use of this software, such as loss of data, time, money, or 
  820. X * effort.
  821. X * 
  822. X * Permission is granted to use, copy, modify, or distribute any part of
  823. X * this software as long as this is done without asking for charge, and
  824. X * provided that this copyright notice is retained as part of the source
  825. X * files. You may charge a distribution fee for the physical act of
  826. X * transferring a copy, and you may at your option offer warranty
  827. X * protection in exchange for a fee.
  828. X * 
  829. X * Direct questions to: Tech. Univ. Berlin
  830. X *              Wilfried Koch
  831. X *              Sekr. FR 5-6 
  832. X *              Franklinstr. 28/29
  833. X *              D-1000 Berlin 10, West Germany
  834. X * 
  835. X *              Tel: +49-30-314-22972
  836. X *              E-mail: shape@coma.uucp or shape@db0tui62.bitnet
  837. X */
  838. X/*
  839. X *    Shape/AFS
  840. X *
  841. X *    afsys.h - Internal type and Constant-Definitions for the 
  842. X *          Attribute-Filesystem
  843. X *
  844. X *    Author:    Andreas Lampen (andy@coma.UUCP
  845. X *                andy@db0tui62.BITNET)
  846. X *
  847. X *    $Header: afsys.h[1.5] Wed Feb 22 16:29:46 1989 andy@coma published $
  848. X */
  849. X
  850. X#ifndef _AFSYS_
  851. X#define _AFSYS_
  852. X
  853. X/*=========================================================================
  854. X * Installation dependent constants 
  855. X *=========================================================================*/
  856. X
  857. X#include <stdio.h>
  858. X#include <sys/types.h>
  859. X#ifndef MAXNAMLEN
  860. X#include <sys/dir.h>
  861. X#endif
  862. X#include <sys/param.h>
  863. X
  864. X#ifndef _TYPECONV_
  865. X#  ifdef ULTRIX_2_0
  866. X#    define Uid_t int
  867. X#    define Gid_t int
  868. X#  else
  869. X#    define Uid_t uid_t
  870. X#    define Gid_t gid_t
  871. X#  endif
  872. X#endif
  873. X
  874. X#ifdef ULTRIX_2_0
  875. X#define MAXHOSTNAMELEN 64
  876. X#endif
  877. X
  878. X/*=========================================================================
  879. X * general constants 
  880. X *=========================================================================*/
  881. X
  882. X#ifndef TRUE
  883. X#define TRUE        1
  884. X#endif
  885. X#ifndef FALSE
  886. X#define FALSE        0
  887. X#endif
  888. X
  889. X#define ERROR        -1
  890. X#define LOCAL        static
  891. X#define EXPORT
  892. X#define bool        short
  893. X
  894. X/*=========================================================================
  895. X * Hash stuff
  896. X *=========================================================================*/
  897. X
  898. Xtypedef struct Af_hshent Af_hashent;
  899. X
  900. Xtypedef struct Af_hsh Af_hash;
  901. X
  902. Xstruct Af_hsh { int        hsize,       /* No. of slots in hashtable */
  903. X                   (*fhash)();  /* Pointer to hash-function */
  904. X        Af_hashent *hashtb;     /* Anchor of hashtable */
  905. X          };
  906. X
  907. X/*=========================================================================
  908. X * Internal Type Definitions
  909. X *=========================================================================*/
  910. X
  911. X/**** buffer for version-independent attributes ****/
  912. Xtypedef struct {
  913. X        char    *af_host;               /* hostname */  
  914. X        char    *af_syspath;        /* system path (incl. host) */
  915. X        char    *af_ownname;        /* name of owner */
  916. X        char    *af_ownhost;        /* host of owner */
  917. X           } Af_cattrs;
  918. X
  919. X/**** buffer for version-dependent attributes ****/
  920. Xtypedef struct {
  921. X        char    *af_name;            /* filename */
  922. X        char    *af_type;            /* filename extension (type) */
  923. X        int    af_gen;            /* generation number */
  924. X        int    af_rev;            /* revision number */
  925. X        char    *af_variant;            /* variant string */
  926. X        short    af_state;        /* version state (see below) */
  927. X        short   af_class;               /* file class */
  928. X        char     *af_auname;        /* name of author */
  929. X        char    *af_auhost;        /* host of author */
  930. X        u_short af_mode;        /* protection (from inode) */
  931. X        char    *af_lckname;            /* name of locker */
  932. X        char    *af_lckhost;            /* host of locker */
  933. X        time_t    af_mtime;        /* date of last modification */
  934. X        time_t    af_atime;        /* date of last access */
  935. X        time_t    af_ctime;        /* date of last status change*/
  936. X        time_t    af_stime;        /* save date */
  937. X        time_t    af_ltime;        /* date of last lock change */
  938. X        off_t    af_notesize;        /* size of note */
  939. X        char    *af_note;        /* modification note */
  940. X        int     af_udanum;              /* number of uda entries */
  941. X        Af_hash af_uhtab;               /* hash table for udefattrs */
  942. X        short    af_repr;        /* kind of representation */
  943. X        off_t    af_fsize;        /* size of file */
  944. X        off_t    af_dsize;        /* size of delta */
  945. X        char    *af_data;        /* ptr to chunk or delta */
  946. X        char    *af_hashname;           /* name of associated file */
  947. X        short   af_nlinks;              /* # of links to attrbuf */
  948. X        int    af_succgen,        /* physical       */
  949. X            af_succrev;        /*    successor */
  950. X        int    af_predgen,        /* physical         */
  951. X            af_predrev;        /*    predecessor */
  952. X           } Af_vattrs;
  953. X
  954. X/**** Descriptor for revision list ****/
  955. Xtypedef struct rvlist Af_revlist;
  956. X
  957. Xstruct rvlist {
  958. X                char      *af_arfilename;    /* filename of archive */
  959. X        time_t    af_lastmod;        /* last mod. of archive file */
  960. X        char      *af_busyfilename;  /* filename of busy version */
  961. X        short      af_nrevs;         /* number of revs in list */
  962. X        short      af_listlen;         /* total length of list */
  963. X        off_t      af_datasize;         /* size of data-segment */
  964. X        short      af_extent;         /* extent of revision list */
  965. X        Af_cattrs af_cattrs;         /* version-independent attrs */
  966. X        Af_vattrs *af_list;         /* pointer to revision list */
  967. X        int       af_refcount;       /* number of keys in use */
  968. X        char      *af_mem;           /* list of ptrs to alloc. mem. */
  969. X        Af_revlist *af_next;         /* index of next freelist entry */
  970. X          };
  971. X
  972. X/*=========================================================================
  973. X * More Hash stuff
  974. X *=========================================================================*/
  975. X
  976. Xstruct Af_hshent { char          *symbol;
  977. X           Af_revlist    *revlist;
  978. X           Af_hashent    *next;
  979. X         };
  980. X/*=========================================================================
  981. X * Internal Installation dependent constants
  982. X *=========================================================================*/
  983. X
  984. X#define AF_MAXSYMS    211       /* size of hashtable for symbols */
  985. X#define AF_MAXUDAS     61       /* size of hashtable for user defined attrs */
  986. X#define AF_SEGLEN      32       /* size of segment for (re-)allocation */
  987. X
  988. X/**** "syntactical sugar" for user defined attributes ****/
  989. X#define AF_UDANAMDEL    '='        /* Delimiter for UDA name in archive */
  990. X#define AF_UDAVALDEL    '\01'        /* Delimiter for UDA values in arch. */
  991. X
  992. X/**** UNIX Environment ****/
  993. X#define AF_TMPDIR    "/tmp"        /* location of archive files */
  994. X#define AF_SUBDIR    "AFS"        /* subdirectory for archives */
  995. X#define AF_ARCHEXT    'A'        /* extension for archive names */
  996. X#define AF_DATAEXT    'D'        /* extension for datafile names */
  997. X#define AF_LCKEXT    'L'        /* extension for lock files */
  998. X#define AF_ARCHTMP    'T'        /* extension for temp archive names */
  999. X#define AF_DATATMP    'U'        /* extension for temp datafile names */
  1000. X#define AF_ERRLOG    "/tmp/AFSerrlog" /* Error Log file */
  1001. X
  1002. X/**** file locking ****/
  1003. X#define AF_LOCKTIMEOUT  (unsigned) 1    /* wait 1 sec when archive is locked */
  1004. X
  1005. X/*=========================================================================
  1006. X * Internal Constant Definitions
  1007. X *=========================================================================*/
  1008. X
  1009. X/**** general ****/
  1010. X
  1011. X#define AF_READ         0
  1012. X#define AF_WRITE        1
  1013. X#define AF_RDWR         2
  1014. X
  1015. X/**** representation types ****/
  1016. X
  1017. X#define AF_CHUNK    0
  1018. X#define AF_DELTA    1
  1019. X#define AF_FILE         2 /* version resides in an own file (busy version) */
  1020. X
  1021. X/**** Version numbering ****/
  1022. X
  1023. X#define AF_INITGEN    1
  1024. X#define AF_INITREV    0
  1025. X
  1026. X/**** Modes for archive manipulation ****/
  1027. X
  1028. X#define AF_CHANGE      01
  1029. X#define AF_ALLVERS     02
  1030. X
  1031. X/**** Environment interaction ****/
  1032. X
  1033. X#define AF_ENVBPSIZE    "AFSBPSIZ" /* name of environment variable defining */
  1034. X                                   /* max. number of files in bin. pool */
  1035. X#define AF_MAXBPSIZE    64         /* max # of files in binary pool if no */
  1036. X                                   /* environment variable is present */
  1037. X
  1038. X/**** Permissions for checkperm ****/
  1039. X
  1040. X#define AF_OWNER        0001
  1041. X#define AF_AUTHOR       0002
  1042. X#define AF_LOCKHOLDER   0004
  1043. X#define AF_WORLD        0010
  1044. X
  1045. X#define AF_REMOTE       -2
  1046. X
  1047. X/*=========================================================================
  1048. X * Useful macros
  1049. X *=========================================================================*/
  1050. X
  1051. X#define CATTR(keyp)      keyp->af_ldes->af_cattrs
  1052. X#define VATTR(keyp)      keyp->af_ldes->af_list[keyp->af_lpos]
  1053. X
  1054. X/* compare filekeys -- returnes 0 if equal (like strcmp) */
  1055. X#define af_keycmp(key1,key2) (((key1)->af_ldes != (key2)->af_ldes) || ((key1)->af_lpos != (key2)->af_lpos))
  1056. X
  1057. X/* report error and return */
  1058. X#define FAIL(msg1,msg2,errcd,retcd) { af_err (msg1, msg2, errcd); return (retcd); }
  1059. X#define SFAIL(msg1,msg2,errcd,retcd) { af_serr (msg1, msg2, errcd); return (retcd); }
  1060. X
  1061. X/* convert nil pointer to empty string */
  1062. X#define NOTNIL(str) (str ? str : "")
  1063. X
  1064. X/*=========================================================================
  1065. X * Declarations
  1066. X *=========================================================================*/
  1067. X
  1068. Xchar *af_malloc(), *af_realloc(), *af_gtmpname(), *af_gethostname();
  1069. Xchar *af_entersym(), *af_replsym(), *af_garname(), *af_gbusname();
  1070. Xchar *af_bpfilename();
  1071. Xchar *af_rbphashname(), *af_unixname(), *af_gbpname(), *af_uniqpath();
  1072. Xchar *af_hashsym(), *af_symlookup(), *af_vallookup(), *af_enterhost();
  1073. Xvoid af_frmemlist(), af_serr(), af_err(), af_wng();
  1074. Xvoid af_free(), af_frmemlist(), af_regtmpfile(), af_unregtmpfile();
  1075. Xoff_t af_retfsize();
  1076. XUid_t af_getuid(), getuid();
  1077. XGid_t af_getgid();
  1078. X#endif
  1079. END_OF_FILE
  1080. if test 9500 -ne `wc -c <'src/inc/afsys.h'`; then
  1081.     echo shar: \"'src/inc/afsys.h'\" unpacked with wrong size!
  1082. fi
  1083. # end of 'src/inc/afsys.h'
  1084. fi
  1085. if test -f 'src/vc/Makefile' -a "${1}" != "-c" ; then 
  1086.   echo shar: Will not clobber existing file \"'src/vc/Makefile'\"
  1087. else
  1088. echo shar: Extracting \"'src/vc/Makefile'\" \(9367 characters\)
  1089. sed "s/^X//" >'src/vc/Makefile' <<'END_OF_FILE'
  1090. X#
  1091. X# Copyright (C) 1989, 1990 W. Koch, A. Lampen, A. Mahler, W. Obst,
  1092. X#  and U. Pralle
  1093. X# 
  1094. X# This software is published on an as-is basis. There is ABSOLUTELY NO
  1095. X# WARRANTY for any part of this software to work correctly or as described
  1096. X# in the manuals. We do not accept any liability for any kind of damage
  1097. X# caused by use of this software, such as loss of data, time, money, or effort.
  1098. X# 
  1099. X# Permission is granted to use, copy, modify, or distribute any part of
  1100. X# this software as long as this is done without asking for charge, and
  1101. X# provided that this copyright notice is retained as part of the source
  1102. X# files. You may charge a distribution fee for the physical act of
  1103. X# transferring a copy, and you may at your option offer warranty
  1104. X# protection in exchange for a fee.
  1105. X# 
  1106. X# Direct questions to: Tech. Univ. Berlin
  1107. X#              Wilfried Koch
  1108. X#              Sekr. FR 5-6 
  1109. X#              Franklinstr. 28/29
  1110. X#              D-1000 Berlin 10, West Germany
  1111. X# 
  1112. X#              Tel: +49-30-314-22972
  1113. X#              E-mail: shape@coma.uucp or shape@db0tui62.bitnet
  1114. X# 
  1115. X#
  1116. X# $Header: Makefile[1.2] Thu Feb 23 18:13:23 1989 axel@coma published $
  1117. X#
  1118. X# Log for /u/shape/dist-tape/src/vc/Makefile[1.0]
  1119. X#     Thu Feb 23 18:13:23 1989 axel@coma save $
  1120. X#  This Makefile is solely intended for the bootstrap installation
  1121. X#  of the SHAPE version-control system. It should be invoked by a 
  1122. X#  master Make 'install' process defining the macros BASE, SYSTEM, and
  1123. X#  possibly CONFIG from the commandline.
  1124. X#  
  1125. X#  Makefile[1.1] Thu Feb 23 18:13:23 1989 axel@coma published $
  1126. X#  added target 'depend:'. Works very nice.
  1127. X#  
  1128. X#  Makefile[1.2] Thu Feb 23 18:13:23 1989 axel@coma published $
  1129. X#  --- empty log message ---
  1130. X#
  1131. X#
  1132. X#  Makefile for Version Control System
  1133. X#  (used only for porting and installing)
  1134. X
  1135. X#
  1136. X#  general part
  1137. X
  1138. X# ---> define operating system
  1139. X# known systems are:   BSD_4_3   SUNOS_4_0   ULTRIX_2_0
  1140. XSYSTEM = BSD_4_3 
  1141. X
  1142. X# ---> define config
  1143. X# any combination of:
  1144. X#    -DSYSLOG  -- the syslog facility shall be used for protocoling errors
  1145. X#    -DOLDDBM  -- use "dbm" instead of "ndbm" (don't forget to set -ldbm)
  1146. X#define c libraries
  1147. X#    "CLIBS = -ldbm" is necessary when compiling with -DOLDDBM
  1148. XCONFIG =
  1149. XCLIBS =
  1150. X
  1151. X# ---> define locations of sources and executables
  1152. XBASE = /u/shape
  1153. XSRCDIR = $(BASE)/src/vc
  1154. XLIBDIR = $(BASE)/lib
  1155. XINCLUDEDIR = $(BASE)/src/inc
  1156. X
  1157. X# define anything you like here (e.g. /usr/local)
  1158. XINSTALDIR = $(BASE)/bin
  1159. XINSTALOWNER = shape
  1160. XINSTALGROUP = unib
  1161. X
  1162. XBUCKS = $$
  1163. X
  1164. XCC = cc -DCFFLGS='"$(BUCKS)Flags: <$<> $(CFLAGS) $$"'
  1165. X
  1166. XCFLAGS = -g -D$(SYSTEM) $(CONFIG) -I$(INCLUDEDIR)
  1167. XLDFLAGS = -g
  1168. X
  1169. X#
  1170. X#  Product definition part
  1171. X#
  1172. X
  1173. XCOMPONENTS = $(MANUALS) $(MODULES) $(DEFINES)
  1174. X
  1175. XMODULES = \
  1176. X    doretrv.c \
  1177. X    dosave.c \
  1178. X    mkattr.c \
  1179. X    project.c \
  1180. X    retrv.c \
  1181. X    save.c \
  1182. X    sighand.c \
  1183. X    util.c \
  1184. X    vl.c \
  1185. X    vldovl.c \
  1186. X    vlmisc.c \
  1187. X    vlopt.c \
  1188. X    vadm.c \
  1189. X    vadm_utils.c  \
  1190. X    vadm_note.c \
  1191. X    vadm_delete.c \
  1192. X    vadm_promote.c \
  1193. X    vadm_reserve.c \
  1194. X    vadm_symname.c \
  1195. X    vadm_gkeys.c \
  1196. X    vc_call.c \
  1197. X    vc_files.c \
  1198. X    vc_keyboardIo.c \
  1199. X    vc_lock.c 
  1200. X
  1201. XDEFINES = \
  1202. X    afsapp.h \
  1203. X    locks.h \
  1204. X    retrv.h \
  1205. X    save.h \
  1206. X    typeconv.h \
  1207. X    vl.h \
  1208. X    vadm.h \
  1209. X    vadmdefs.h \
  1210. X    vc_sysdep.h
  1211. X
  1212. XMANUALS = \
  1213. X    retrv.1 \
  1214. X    save.1 \
  1215. X    vadm.1 \
  1216. X    vcintro.1 \
  1217. X    vl.1 
  1218. X
  1219. XPRODUCT = vccommands
  1220. XSUBPRODUCTS = \
  1221. X    $(BASE)/lib/libafs \
  1222. X    $(BASE)/lib/libutil 
  1223. X
  1224. X
  1225. XAFSLIB = $(BASE)/lib/libafs.a
  1226. XUTLIB = $(BASE)/lib/libutil.a
  1227. X
  1228. XAFSINC = $(BASE)/src/inc
  1229. X
  1230. XPROGS = save retrv vl vadm
  1231. XVERSION = version
  1232. X
  1233. XSAVESRC  = save.c dosave.c vc_lock.c mkattr.c $(COMMONSRC)
  1234. XSAVEOBJS = save.o dosave.o vc_lock.o mkattr.o
  1235. XRETRSRC = retrv.c doretrv.c mkattr.c vc_lock.c  $(COMMONSRC)
  1236. XRETROBJS = retrv.o doretrv.o mkattr.o vc_lock.o
  1237. XVLSRC = vl.c vlmisc.c vldovl.c vlopt.c mkattr.c $(VERSION).c
  1238. XVLOBJS = vl.o vlmisc.o vldovl.o vlopt.o mkattr.o
  1239. XVLINC = vl.h afs_huda.h
  1240. XVADMOBJS = vadm.o vadm_utils.o vadm_note.o vadm_delete.o vadm_promote.o\
  1241. X       vadm_symname.o vadm_reserve.o vadm_gkeys.o vc_call.o vc_files.o\
  1242. X       vc_keyboardIo.o vc_lock.o util.o sighand.o mkattr.o
  1243. XVADMSRC = vadm.c vadm_utils.c vadm_note.c vadm_delete.c vadm_promote.c\
  1244. X       vadm_symname.c vadm_reserve.c vadm_gkeys.c vc_call.c vc_files.c\
  1245. X       vc_keyboardIo.c vc_lock.c util.c sighand.c mkattr.c $(COMMONSRC)
  1246. XVADMINC = vadm.h vadmdefs.h vc_sysdep.h
  1247. XCOMMON = project.o sighand.o util.o $(VERSION).o
  1248. XCOMMONSRC = project.c sighand.c util.c $(VERSION).c
  1249. XALLOBJS = $(SAVEOBJS) $(RETROBJS) $(VLOBJS) $(COMMON)
  1250. X
  1251. Xall: save retrv vl vadm
  1252. X
  1253. Xsave: $(SAVEOBJS) $(COMMON) $(AFSLIB) $(UTLIB)
  1254. X    cc $(LDFLAGS) -o $@ $(SAVEOBJS) $(COMMON) $(UTLIB) $(AFSLIB) $(CLIBS)
  1255. X
  1256. Xretrv: $(RETROBJS) $(COMMON) $(AFSLIB) $(UTLIB)
  1257. X    cc $(LDFLAGS) -o $@ $(RETROBJS) $(COMMON) $(UTLIB) $(AFSLIB) $(CLIBS)
  1258. X
  1259. Xvl: $(VLOBJS) $(AFSLIB) $(UTLIB)
  1260. X    cc $(LDFLAGS) -o $@ $(VLOBJS) $(VERSION).o $(UTLIB) $(AFSLIB) $(CLIBS)
  1261. X
  1262. Xvadm: $(VADMOBJS) $(AFSLIB) $(UTLIB)
  1263. X    cc $(LDFLAGS) -o $@ $(VADMOBJS) $(VERSION).o $(UTLIB) $(AFSLIB) \
  1264. X    $(CLIBS)
  1265. X
  1266. Xinstall: all
  1267. X    @echo -n installing version control system in $(INSTALDIR)...; \
  1268. X    (cd $(BASE)/bin; rm -f save retrv vadm vl sbmt vcat vlog) ; \
  1269. X    echo -n .; \
  1270. X    install -c -m 755 save $(INSTALDIR); \
  1271. X    echo -n .; \
  1272. X    install -c -m 755 retrv $(INSTALDIR); \
  1273. X    echo -n .; \
  1274. X    install -c -m 755 vadm $(INSTALDIR); \
  1275. X    echo -n .; \
  1276. X    install -c -m 755 vl $(INSTALDIR); \
  1277. X    echo -n .; \
  1278. X    ln save sbmt; \
  1279. X    echo -n .; \
  1280. X    ln retrv vcat; \
  1281. X    echo -n .; \
  1282. X    ln vl vlog; \
  1283. X    echo done
  1284. X
  1285. Xdepend:
  1286. X    $(CC) -M $(CFLAGS) $(MODULES) | \
  1287. X    sed -e '/\/usr\/include/d' -e 's.$(BASE).$$(BASE).g' | sort \
  1288. X    | uniq > makedep
  1289. X    echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep
  1290. X    echo '$$r makedep' >>eddep
  1291. X    echo 'w' >>eddep
  1292. X    cp Makefile Makefile.bak
  1293. X    ex - Makefile < eddep
  1294. X    rm makedep eddep
  1295. X
  1296. X
  1297. X# DO NOT DELETE THIS LINE
  1298. Xdoretrv.o: $(BASE)/src/inc/afs.h
  1299. Xdoretrv.o: $(BASE)/src/inc/afsys.h
  1300. Xdoretrv.o: ./afsapp.h
  1301. Xdoretrv.o: ./locks.h
  1302. Xdoretrv.o: ./project.h
  1303. Xdoretrv.o: ./retrv.h
  1304. Xdoretrv.o: ./typeconv.h
  1305. Xdoretrv.o: doretrv.c
  1306. Xdosave.o: $(BASE)/src/inc/afs.h
  1307. Xdosave.o: $(BASE)/src/inc/afsys.h
  1308. Xdosave.o: ./afsapp.h
  1309. Xdosave.o: ./locks.h
  1310. Xdosave.o: ./project.h
  1311. Xdosave.o: ./save.h
  1312. Xdosave.o: ./typeconv.h
  1313. Xdosave.o: dosave.c
  1314. Xmkattr.o: $(BASE)/src/inc/afs.h
  1315. Xmkattr.o: $(BASE)/src/inc/afsys.h
  1316. Xmkattr.o: ./afsapp.h
  1317. Xmkattr.o: ./retrv.h
  1318. Xmkattr.o: ./typeconv.h
  1319. Xmkattr.o: mkattr.c
  1320. Xproject.o: ./project.h
  1321. Xproject.o: project.c
  1322. Xretrv.o: $(BASE)/src/inc/ParseArgs.h
  1323. Xretrv.o: $(BASE)/src/inc/afs.h
  1324. Xretrv.o: $(BASE)/src/inc/afsys.h
  1325. Xretrv.o: ./afsapp.h
  1326. Xretrv.o: ./project.h
  1327. Xretrv.o: ./retrv.h
  1328. Xretrv.o: ./typeconv.h
  1329. Xretrv.o: retrv.c
  1330. Xsave.o: $(BASE)/src/inc/ParseArgs.h
  1331. Xsave.o: ./afsapp.h
  1332. Xsave.o: ./project.h
  1333. Xsave.o: ./save.h
  1334. Xsave.o: ./typeconv.h
  1335. Xsave.o: save.c
  1336. Xsighand.o: $(BASE)/src/inc/afs.h
  1337. Xsighand.o: $(BASE)/src/inc/afsys.h
  1338. Xsighand.o: ./afsapp.h
  1339. Xsighand.o: ./typeconv.h
  1340. Xsighand.o: sighand.c
  1341. Xutil.o: $(BASE)/src/inc/afs.h
  1342. Xutil.o: $(BASE)/src/inc/afsys.h
  1343. Xutil.o: ./afsapp.h
  1344. Xutil.o: ./locks.h
  1345. Xutil.o: ./project.h
  1346. Xutil.o: ./typeconv.h
  1347. Xutil.o: util.c
  1348. Xvadm.o: $(BASE)/src/inc/ParseArgs.h
  1349. Xvadm.o: $(BASE)/src/inc/afs.h
  1350. Xvadm.o: $(BASE)/src/inc/afsys.h
  1351. Xvadm.o: ./afsapp.h
  1352. Xvadm.o: ./typeconv.h
  1353. Xvadm.o: ./vadm.h
  1354. Xvadm.o: vadm.c
  1355. Xvadm_delete.o: $(BASE)/src/inc/afs.h
  1356. Xvadm_delete.o: $(BASE)/src/inc/afsys.h
  1357. Xvadm_delete.o: ./afsapp.h
  1358. Xvadm_delete.o: ./locks.h
  1359. Xvadm_delete.o: ./typeconv.h
  1360. Xvadm_delete.o: ./vadm.h
  1361. Xvadm_delete.o: vadm_delete.c
  1362. Xvadm_gkeys.o: $(BASE)/src/inc/afs.h
  1363. Xvadm_gkeys.o: $(BASE)/src/inc/afsys.h
  1364. Xvadm_gkeys.o: ./afsapp.h
  1365. Xvadm_gkeys.o: ./typeconv.h
  1366. Xvadm_gkeys.o: ./vadm.h
  1367. Xvadm_gkeys.o: vadm_gkeys.c
  1368. Xvadm_note.o: $(BASE)/src/inc/afs.h
  1369. Xvadm_note.o: $(BASE)/src/inc/afsys.h
  1370. Xvadm_note.o: ./afsapp.h
  1371. Xvadm_note.o: ./locks.h
  1372. Xvadm_note.o: ./typeconv.h
  1373. Xvadm_note.o: ./vadm.h
  1374. Xvadm_note.o: ./vc_sysdep.h
  1375. Xvadm_note.o: vadm_note.c
  1376. Xvadm_promote.o: $(BASE)/src/inc/afs.h
  1377. Xvadm_promote.o: $(BASE)/src/inc/afsys.h
  1378. Xvadm_promote.o: ./afsapp.h
  1379. Xvadm_promote.o: ./locks.h
  1380. Xvadm_promote.o: ./typeconv.h
  1381. Xvadm_promote.o: ./vadm.h
  1382. Xvadm_promote.o: vadm_promote.c
  1383. Xvadm_reserve.o: $(BASE)/src/inc/afs.h
  1384. Xvadm_reserve.o: $(BASE)/src/inc/afsys.h
  1385. Xvadm_reserve.o: ./afsapp.h
  1386. Xvadm_reserve.o: ./locks.h
  1387. Xvadm_reserve.o: ./typeconv.h
  1388. Xvadm_reserve.o: ./vadm.h
  1389. Xvadm_reserve.o: vadm_reserve.c
  1390. Xvadm_symname.o: $(BASE)/src/inc/afs.h
  1391. Xvadm_symname.o: $(BASE)/src/inc/afsys.h
  1392. Xvadm_symname.o: ./afsapp.h
  1393. Xvadm_symname.o: ./project.h
  1394. Xvadm_symname.o: ./typeconv.h
  1395. Xvadm_symname.o: ./vadm.h
  1396. Xvadm_symname.o: vadm_symname.c
  1397. Xvadm_utils.o: $(BASE)/src/inc/afs.h
  1398. Xvadm_utils.o: $(BASE)/src/inc/afsys.h
  1399. Xvadm_utils.o: ./afsapp.h
  1400. Xvadm_utils.o: ./typeconv.h
  1401. Xvadm_utils.o: ./vadm.h
  1402. Xvadm_utils.o: ./vadmdefs.h
  1403. Xvadm_utils.o: vadm_utils.c
  1404. Xvc_call.o: ./afsapp.h
  1405. Xvc_call.o: ./typeconv.h
  1406. Xvc_call.o: vc_call.c
  1407. Xvc_files.o: $(BASE)/src/inc/afs.h
  1408. Xvc_files.o: $(BASE)/src/inc/afsys.h
  1409. Xvc_files.o: ./afsapp.h
  1410. Xvc_files.o: ./locks.h
  1411. Xvc_files.o: ./typeconv.h
  1412. Xvc_files.o: ./vc_sysdep.h
  1413. Xvc_files.o: vc_files.c
  1414. Xvc_keyboardIo.o: ./afsapp.h
  1415. Xvc_keyboardIo.o: ./typeconv.h
  1416. Xvc_keyboardIo.o: vc_keyboardIo.c
  1417. Xvc_lock.o: $(BASE)/src/inc/afs.h
  1418. Xvc_lock.o: $(BASE)/src/inc/afsys.h
  1419. Xvc_lock.o: ./afsapp.h
  1420. Xvc_lock.o: ./typeconv.h
  1421. Xvc_lock.o: vc_lock.c
  1422. Xvl.o: $(BASE)/src/inc/ParseArgs.h
  1423. Xvl.o: ./afsapp.h
  1424. Xvl.o: ./typeconv.h
  1425. Xvl.o: ./vl.h
  1426. Xvl.o: vl.c
  1427. Xvldovl.o: $(BASE)/src/inc/afs.h
  1428. Xvldovl.o: $(BASE)/src/inc/afsys.h
  1429. Xvldovl.o: ./afsapp.h
  1430. Xvldovl.o: ./typeconv.h
  1431. Xvldovl.o: ./vl.h
  1432. Xvldovl.o: vldovl.c
  1433. Xvlmisc.o: $(BASE)/src/inc/afs.h
  1434. Xvlmisc.o: $(BASE)/src/inc/afsys.h
  1435. Xvlmisc.o: ./afsapp.h
  1436. Xvlmisc.o: ./typeconv.h
  1437. Xvlmisc.o: ./vl.h
  1438. Xvlmisc.o: vlmisc.c
  1439. Xvlopt.o: $(BASE)/src/inc/ParseArgs.h
  1440. Xvlopt.o: ./afsapp.h
  1441. Xvlopt.o: ./typeconv.h
  1442. Xvlopt.o: ./vl.h
  1443. Xvlopt.o: vlopt.c
  1444. END_OF_FILE
  1445. if test 9367 -ne `wc -c <'src/vc/Makefile'`; then
  1446.     echo shar: \"'src/vc/Makefile'\" unpacked with wrong size!
  1447. fi
  1448. # end of 'src/vc/Makefile'
  1449. fi
  1450. echo shar: End of archive 11 \(of 33\).
  1451. cp /dev/null ark11isdone
  1452. MISSING=""
  1453. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 ; do
  1454.     if test ! -f ark${I}isdone ; then
  1455.     MISSING="${MISSING} ${I}"
  1456.     fi
  1457. done
  1458. if test "${MISSING}" = "" ; then
  1459.     echo You have unpacked all 33 archives.
  1460.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1461. else
  1462.     echo You still need to unpack the following archives:
  1463.     echo "        " ${MISSING}
  1464. fi
  1465. ##  End of shell archive.
  1466. exit 0
  1467.