Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids. Most
[dragonfly.git] / usr.sbin / ctm / README
1 # ----------------------------------------------------------------------------
2 # "THE BEER-WARE LICENSE" (Revision 42):
3 # <phk@login.dknet.dk> 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.   Poul-Henning Kamp
6 # ----------------------------------------------------------------------------
7 #
8 # $FreeBSD: src/usr.sbin/ctm/README,v 1.9 1999/11/29 17:58:58 markm Exp $
9 # $DragonFly: src/usr.sbin/ctm/Attic/README,v 1.2 2003/06/17 04:29:53 dillon Exp $
10 #
11
12 What will I not find in this file ?
13 -----------------------------------
14 Instructions on how to obtain FreeBSD via CTM.
15 Contact <CTM@FreeBSD.org> for that.
16
17 What is CTM ?
18 -------------
19 CTM was originally "CVS Through eMail", but has since changed scope to be
20 much more general.
21 CTM is now meant to be the definitive way to make and apply a delta between
22 two versions of a directory tree.
23 There are two parts to this, making the delta and applying it.  These are two
24 entirely different things.  CTM concentrates the computation-burden on the
25 generation of the deltas, as a delta very often is applied more times than
26 it is made.  Second CTM tries to make the minimal size delta.
27
28 Why not use diff/patch ?
29 ------------------------
30 Good question.  Primarily because diff and patch doesn't do their job very 
31 well.  They don't deal with binary files (in this case files with '\0' or 
32 '\0377' characters in them or files that doesn't end in '\n') which isn't
33 a big surprise:  they were made to deal with text-files only.  As a second
34 gripe, with patch you send the entire file to delete it.  Not particular
35 efficient.
36
37 So what does CTM do exactly ?
38 -----------------------------
39 CTM will produce a file, (a delta) containing the instructions and data needed
40 to take another copy of the tree from the old to the new status.  CTM means to
41 do this in the exact sense, and therefore the delta contains MD5 checksums to
42 verify that the tree it is applied to is indeed in the state CTM expects.
43
44 This means that if you have modified the tree locally, CTM might not be able
45 to upgrade your copy.
46
47 How do I make a CTM-delta ?
48 ---------------------------
49
50 Read the source, and be prepared to have 2 copies of the tree; One is
51 the reference ("From") tree, and the other is the delta ("To") tree.
52 The mkCTM script will create the CTM diff of the differences between
53 the reference tree and the delta tree. A lot of scratch space is
54 required, and your machine will work hard.
55
56 How do I apply a CTM-delta ?
57 ----------------------------
58 You pass it to the 'ctm' command.  You can pass a CTM-delta on stdin, or
59 you can give the filename as an argument.  If you do the latter, you make
60 life a lot easier for your self, since the program can accept gzip'ed files
61 and since it will not have to make a temporary copy of your file.  You can
62 specify multiple deltas at one time, they will be processed one at a time.
63
64 The ctm command runs in a number of passes.  It will process the entire
65 input file in each pass, before commencing with the next pass.
66
67 Pass 1 will validate that the input file is OK.  The syntax, the data and 
68 the global MD5 checksum will be checked.  If any of these fail, ctm will
69 never be able to do anything with the file, so it will simply reject it.
70
71 Pass 2 will validate that the directory tree is in the state expected by
72 the CTM-delta.  This is done by looking for files and directories which
73 should/should not exists and by checking the MD5 checksums of files.  
74
75 Pass 3 will actually apply the delta.
76
77 Should I delete the delta when I have applied it ?
78 --------------------------------------------------
79 No.  You might want to selectively reconstruct a file latter on.
80
81 Why is CTM not being maintained?
82 --------------------------------
83 Because CVSUP has improved on the concept quite a bit, and is now
84 the method of choice.
85
86 Poul-Henning