summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ctm/ctm/ctm.1
blob: a67cd064135735a2e6a4753fcbdaa2ada3e2a629 (plain) (blame)
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
.\"----------------------------------------------------------------------------
.\""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.1,v 1.6 1999/06/05 22:16:36 aaron Exp $
.\"
.Dd Mar 25, 1995
.Os
.Dt CTM 1
.Sh NAME
.Nm ctm
.Nd source code mirror program
.Sh SYNOPSIS
.Nm ctm
.Op Fl cFpPquv
.Op Fl b Ar basedir
.Op Fl T Ar tmpdir
.Op Fl V Ar level
.Ar file Op Ar ...
.Sh DESCRIPTION
.Nm
was originally
.Dq Cvs Through eMail ,
but now it seems more fitting to call it
.Dq Current Through eMail .
.Pp
.Nm
is now meant to be the definitive way to make and apply a delta between
two versions of a directory tree.
.Pp
There are two parts to this: making the delta and applying it.  These are two
entirely different things. The
.Nm
command is only used to apply deltas.
.Pp
.Ss Usage
To apply a CTM delta, you pass it to the
.Nm
command.  You can pass a CTM delta on stdin, or you can give the
filename as an argument.  If you do the latter, you make life a lot
easier for yourself, since the program can accept gzip'ed files and
since it will not have to make a temporary copy of your file.  You can
specify multiple deltas at one time, they will be proccessed one at a
time.  Deltas that have already been applied will be ignored.
.Pp
The
.Nm
command runs in three passes.  It will process the entire
input file in each pass, before commencing with the next pass.
.Pp
Before working on the file
.Ar file ,
.Nm
first checks for the existence of the file
.Ar file.ctm .
If this file exists,
.Nm
works on it instead.
.Pp
Pass 1 will validate that the input file is OK.  The syntax, the data
and the global MD5 checksum will be checked.  If any of these fail,
.Nm
will never be able to do anything with the file, so it will simply
reject it.
.Pp
Pass 2 will validate that the directory tree is in the state expected by
the CTM delta.  This is done by looking for files and directories which
should/should not exist and by checking the MD5 checksums of files.
.Pp
Pass 3 will actually apply the delta.
.Pp
.Nm
will extract the file hierarchy below its working directory.  Absolute
filenames or filenames containing references through
.Dq \&.
or
.Dq \&.\&.
are explicitly prohibited as a security measure.
.Pp
.Ss Options
.Bl -tag -width indent
.It Fl b Ar basedir
Prepend the path
.Ar basedir
on every filename.
.It Fl c
Check it out, don't do anything.
.It Fl F
Force.
.It Fl p
Less paranoid.
.It Fl P
Paranoid.
.It Fl q
Tell us less.
.It Fl T Ar tmpdir
Put temporary files under
.Ar tmpdir .
.It Fl u
Set the modification time of created and modified files to the CTM delta's
creation time.
.It Fl v
Tell us more.
.It Fl V Ar level
Tell us more.
.Ar level
is the level of verbosity.
.El
.Sh ENVIRONMENT
.Ev TMPDIR,
if set to a pathname, will cause
.Nm
to use that pathname
as the location of temporary file.
See
.Xr tempnam 3
for more details on this.
The same effect may be achieved with the
.Fl T
flag.
.Sh FILES
.Pa .ctm_status
contains the sequence number of the last CTM delta applied; changing
or removing this file will greatly confuse
.Nm ctm .
.Sh EXAMPLES
.Bd -literal
cd ~cvs
/usr/sbin/ctm ~ctm/cvs-*
.Ed
.Sh DIAGNOSTICS
Numerous messages, hopefully self-explanatory.  The
.Dq noise level
can be adjusted with the
.Fl q
and
.Fl v
options.
.Sh SEE ALSO
.Xr ctm_rmail 1 ,
.Xr ctm 5
.Sh HISTORY
Initial trials ran during FreeBSD 1.1.5, and many bugs and
methods were hashed out.
The
.Nm
command appeared in FreeBSD 2.1.
.Sh AUTHORS
The CTM system has been designed and implemented by
Poul-Henning Kamp
.Aq phk@FreeBSD.org .
Joerg Wunsch
.Aq joerg@FreeBSD.org
wrote this man page.