Initial import from FreeBSD RELENG_4:
[dragonfly.git] / usr.sbin / ctm / ctm / ctm.5
1 .\"----------------------------------------------------------------------------
2 .\""THE BEER-WARE LICENSE" (Revision 42):
3 .\"<joerg@FreeBSD.org> wrote this file.  As long as you retain this notice you
4 .\"can do whatever you want with this stuff. If we meet some day, and you think
5 .\"this stuff is worth it, you can buy me a beer in return.       Joerg Wunsch
6 .\"----------------------------------------------------------------------------
7 .\"
8 .\" This manual page is partially obtained from Poul-Hennings CTM README
9 .\" file.
10 .\"
11 .\" CTM and ctm(1) by <phk@FreeBSD.org>
12 .\"
13 .\" $FreeBSD: src/usr.sbin/ctm/ctm/ctm.5,v 1.9.2.5 2003/03/12 22:08:14 trhodes Exp $
14 .\"
15 .Dd March 25, 1995
16 .Os
17 .Dt CTM 5
18 .Sh NAME
19 .Nm ctm
20 .Nd source code mirror system
21 .Sh DESCRIPTION
22 The
23 .Nm
24 transfers data in a specific file format, called a CTM delta.
25 .Pp
26 CTM deltas consist of control lines and data chunks.  Each control
27 line starts with the letters
28 .Dq CTM ,
29 followed by a CTM statement and control data, and ends with a '\en'
30 character.
31 .Pp
32 Data chunks always belong to the preceding control line, and the
33 last field on that control line is the number of bytes in the data
34 chunk.
35 A trailing newline '\en' character follows each data chunk, this
36 newline is not part of the chunk and isn't included in the count.
37 .Pp
38 The CTM statements are as follows.
39 .Bl -tag -width indent
40 .It _BEGIN Ar version name number timestamp prefix
41 This is the overall begin of a CTM delta file.  The
42 .Ar version
43 field must match the program version
44 (currently 2.0).
45 .Ar Name
46 is the name and
47 .Ar number
48 the sequence number of the CTM service, it is matched against the file
49 .Pa .ctm_status
50 to see if the delta has already been applied.
51 .Ar Timestamp
52 contains the year, month, day, hour, minute, and second of the
53 time of delta creation for reference
54 (followed by the letter
55 .Sq Z
56 meaning this is a UTC timestamp).
57 The
58 .Ar prefix
59 field is currently not implemented.
60 .It _END Ar md5
61 This statement ends the CTM delta, the global
62 .Ar md5
63 checksum is matched against the MD5 checksum of the entire delta, up to
64 and including the space (0x20) character following ``_END''.
65 .It \&FM Ar name uid gid mode md5 count
66 Make the file
67 .Ar name ,
68 the original file had the uid
69 .Ar uid
70 (numerical, decimal),
71 the gid
72 .Ar gid
73 (numerical, decimal),
74 mode
75 .Ar mode
76 (numerical, octal),
77 and the MD5 checksum
78 .Ar md5 .
79 .Pp
80 The following
81 .Ar count
82 bytes data are the contents of the new file.
83 .It \&FS Ar name uid gid mode md5before md5after count
84 Substitute the contents of file
85 .Ar name ,
86 the original file had the new uid
87 .Ar uid
88 (numerical, decimal),
89 the new gid
90 .Ar gid
91 (numerical, decimal),
92 new mode
93 .Ar mode
94 (numerical, octal),
95 the old MD5 checksum
96 .Ar md5before ,
97 and the new MD5 checksum
98 .Ar md5after .
99 .Pp
100 The following
101 .Ar count
102 bytes data are the contents of the new file.
103 .Pp
104 File substitution is used if the commands to edit a file would exceed
105 the total file length, so substituting it is more efficient.
106 .It \&FN Ar name uid gid mode md5before md5after count
107 Edit the file
108 .Ar name .
109 The arguments are as above, but the data sections contains an
110 .Xr diff 1
111 -n script which should be applied to the file in question.
112 .It \&FR Ar name md5
113 Remove the file
114 .Ar name ,
115 which must match the MD5 checksum
116 .Ar md5 .
117 .It \&AS Ar name uid gid mode
118 The original file
119 .Ar name
120 changed its owner to
121 .Ar uid ,
122 its group to
123 .Ar gid ,
124 and/or its mode to
125 .Ar mode .
126 .It \&DM Ar name uid gid mode
127 The directory
128 .Ar name
129 is to be created, it had originally the owner
130 .Ar uid ,
131 group
132 .Ar gid ,
133 and mode
134 .Ar mode .
135 .It \&DR Ar name
136 The directory
137 .Ar name
138 is to be removed.
139 .El
140 .Sh EXAMPLES
141 In the following example, long lines have been folded to make them
142 printable
143 (marked by backslashes).
144 .Bd -literal
145 CTM_BEGIN 2.0 cvs-cur 485 19950324214652Z .
146 CTMFR src/sys/gnu/i386/isa/scd.c,v 5225f13aa3c7e458f9dd0d4bb637b18d
147 CTMFR src/sys/gnu/i386/isa/scdreg.h,v e5af42b8a06f2c8030b93a7d71afb223
148 CTMDM src/sys/gnu/i386/isa/Attic 0 552 775
149 CTMFS .ctm_status 545 552 664 d9ccd2a84a9dbb8db56ba85663adebf0 \\
150 e2a10c6f66428981782a0a18a789ee2e 12
151 cvs-cur 485
152
153 CTMFN CVSROOT/commitlogs/gnu 545 552 664 \\
154 5d7bc3549140d860bd9641b5782c002d 7fb04ed84b48160c9b8eea84b4c0b6e3 394
155 a6936 21
156 ache        95/03/24 09:59:50
157
158   Modified:    gnu/lib/libdialog kernel.c prgbox.c
159   Log:
160 [...]
161 CTM_END 74ddd298d76215ae45a077a4b6a74e9c
162 .Ed
163 .Sh SEE ALSO
164 .Xr ctm 1 ,
165 .Xr ctm_rmail 1 ,
166 .Xr ed 1
167 .Sh HISTORY
168 Initial trials ran during the
169 .Fx 1.1.5 ,
170 and many bugs and
171 methods were hashed out.
172 The CTM system has been made publicly available in
173 .Fx 2.1 .
174 .Sh AUTHORS
175 The CTM system has been designed and implemented by
176 .An Poul-Henning Kamp
177 .Aq phk@FreeBSD.org .
178 .Pp
179 .An Joerg Wunsch
180 .Aq joerg@FreeBSD.org
181 wrote this man-page.