summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ctm/ctm/ctm.5
blob: 0829de39bc5ba85543def5497beda56f7e11b7b1 (plain)
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
.\"----------------------------------------------------------------------------
.\""THE BEER-WARE LICENSE" (Revision 42): 
.\"<joerg@freebsd.org> wrote this file.  As long as you retain this notice you
.\"can do whatever you want with this stuff. If we meet some day, and you think
.\"this stuff is worth it, you can buy me a beer in return.       Joerg Wunsch
.\"----------------------------------------------------------------------------
.\"
.\" This manual page is partially obtained from Poul-Hennings CTM README
.\" file.
.\"
.\" CTM and ctm(1) by <phk@login.dknet.dk>
.\"
.\" $Id: ctm.5,v 1.2 1995/03/26 20:09:48 phk Exp $
.\"
.Dd March 25, 1995
.Os
.Dt CTM 5
.Sh NAME
.Nm ctm
.Nd source code mirror system

.Sh DESCRIPTION
The
.Nm ctm
transfers data in a specific file format, called a CTM delta.

CTM deltas consist of control lines and data chunks.  Each control
line starts with the letters
.Dq CTM ,
followed by a CTM statement and control data, and ends with a '\en'
character.

Data chunks always belong to the preceeding control line, and the
last field on that control line is the number of bytes in the data
chunk.
A trailing newline '\en' character follows each data chunk, this
newline is not part of the chunk and isn't included in the count.

The CTM statements are as follows.
.Bl -tag -width indent

.It _BEGIN Ar version name number timestamp prefix

This is the overall begin of a CTM delta file.  The
.Ar version
field must match the program version
.Pq currently 2.0 .
.Ar Name
is the name and
.Ar number
the sequence number of the CTM service, it is matched against the file
.Pa .ctm_status
to see if the delta has already been applied.
.Ar Timestamp
contains the year, month, day, hour, minute, and second of the
time of delta creation for reference
.Po
followed by the letter
.Sq Z
meaning this is a UTC timestamp
.Pc .
The
.Ar prefix
This field is currently not implemented.

.It _END Ar md5

This statement ends the CTM delta, the global
.Ar md5
checksum is matched against the MD5 checksum of the entire delta, up to 
and including the space (0x20) character following ``_END''.

.It \&FM Ar name uid gid mode md5 count

Make the file
.Ar name ,
the original file had the uid
.Ar uid
.Pq numerical, decimal ,
the gid
.Ar gid
.Pq numerical, decimal ,
mode
.Ar mode
.Pq numerical, octal ,
and the MD5 checksum
.Ar md5 .

The following
.Ar count
bytes data are the contents of the new file.

.It \&FS Ar name uid gid mode md5before md5after count

Substitute the contents of file
.Ar name ,
the original file had the new uid
.Ar uid
.Pq numerical, decimal ,
the new gid
.Ar gid
.Pq numerical, decimal ,
new mode
.Ar mode
.Pq numerical, octal ,
the old MD5 checksum
.Ar md5before ,
and the new MD5 checksum
.Ar md5after .

The following
.Ar count
bytes data are the contents of the new file.

File substitution is used if the commands to edit a file would exceed
the total file length, so substituting it is more efficient.

.It \&FN Ar name uid gid mode md5before md5after count

Edit the file
.Ar name .
The arguments are as above, but the data sections contains an
.Xr diff 1
-n script which should be applied to the file in question.

.It \&FR Ar name md5

Remove the file
.Ar name ,
which must match the MD5 checksum
.Ar md5 .

.It \&AS Ar name uid gid mode

The original file
.Ar name
changed its owner to
.Ar uid ,
its group to
.Ar gid ,
and/or its mode to
.Ar mode .

.It \&DM Ar name uid gid mode

The directory
.Ar name
is to be created, it had originally the owner
.Ar uid ,
group
.Ar gid ,
and mode
.Ar mode .

.It \&DR name

The directory
.Ar name
is to be removed.

.El

.Sh EXAMPLES

In the following example, long lines have been folded to make them
printable
.Pq marked by backslashes .

.Bd -literal

CTM_BEGIN 2.0 cvs-cur 485 19950324214652Z .
CTMFR src/sys/gnu/i386/isa/scd.c,v 5225f13aa3c7e458f9dd0d4bb637b18d
CTMFR src/sys/gnu/i386/isa/scdreg.h,v e5af42b8a06f2c8030b93a7d71afb223
CTMDM src/sys/gnu/i386/isa/Attic 0 552 775
CTMFS .ctm_status 545 552 664 d9ccd2a84a9dbb8db56ba85663adebf0 \\
e2a10c6f66428981782a0a18a789ee2e 12
cvs-cur 485

CTMFN CVSROOT/commitlogs/gnu 545 552 664 \\
5d7bc3549140d860bd9641b5782c002d 7fb04ed84b48160c9b8eea84b4c0b6e3 394
a6936 21
ache        95/03/24 09:59:50

  Modified:    gnu/lib/libdialog kernel.c prgbox.c
  Log:
[...]
CTM_END 74ddd298d76215ae45a077a4b6a74e9c

.Ed

.Sh SEE ALSO

.Xr ctm 1 ,
.Xr ctm_rmail 1 ,
.Xr ed 1 .

.Sh HISTORY

Initial trials ran during the FreeBSD 1.1.5, and many bugs and 
methods were hashed out.
The CTM system has been made publically available in FreeBSD 2.1.

.Sh AUTHORS

The CTM system has been designed and implemented by
Poul-Henning Kamp
.Aq phk@FreeBSD.org .

Joerg Wunsch wrote this man-page.
.Aq joerg@FreeBSD.org .
OpenPOWER on IntegriCloud