12886Sphk# ---------------------------------------------------------------------------- 22886Sphk# "THE BEER-WARE LICENSE" (Revision 42): 393151Sphk# <phk@FreeBSD.org> wrote this file. As long as you retain this notice you 42886Sphk# can do whatever you want with this stuff. If we meet some day, and you think 52886Sphk# this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp 62886Sphk# ---------------------------------------------------------------------------- 72886Sphk# 850479Speter# $FreeBSD: releng/10.3/usr.sbin/ctm/README 93151 2002-03-25 14:12:49Z phk $ 92886Sphk# 102886Sphk 112886SphkWhat will I not find in this file ? 122886Sphk----------------------------------- 132886SphkInstructions on how to obtain FreeBSD via CTM. 1453887SmarkmContact <CTM@FreeBSD.org> for that. 152886Sphk 162886SphkWhat is CTM ? 172886Sphk------------- 1853887SmarkmCTM was originally "CVS Through eMail", but has since changed scope to be 192886Sphkmuch more general. 202886SphkCTM is now meant to be the definitive way to make and apply a delta between 212886Sphktwo versions of a directory tree. 222886SphkThere are two parts to this, making the delta and applying it. These are two 232886Sphkentirely different things. CTM concentrates the computation-burden on the 2435353Srnordiergeneration of the deltas, as a delta very often is applied more times than 252886Sphkit is made. Second CTM tries to make the minimal size delta. 262886Sphk 272886SphkWhy not use diff/patch ? 282886Sphk------------------------ 292886SphkGood question. Primarily because diff and patch doesn't do their job very 302886Sphkwell. They don't deal with binary files (in this case files with '\0' or 312886Sphk'\0377' characters in them or files that doesn't end in '\n') which isn't 322886Sphka big surprise: they were made to deal with text-files only. As a second 332886Sphkgripe, with patch you send the entire file to delete it. Not particular 342886Sphkefficient. 352886Sphk 362886SphkSo what does CTM do exactly ? 372886Sphk----------------------------- 382886SphkCTM will produce a file, (a delta) containing the instructions and data needed 392886Sphkto take another copy of the tree from the old to the new status. CTM means to 402886Sphkdo this in the exact sense, and therefore the delta contains MD5 checksums to 412886Sphkverify that the tree it is applied to is indeed in the state CTM expects. 422886Sphk 432886SphkThis means that if you have modified the tree locally, CTM might not be able 442886Sphkto upgrade your copy. 452886Sphk 462886SphkHow do I make a CTM-delta ? 472886Sphk--------------------------- 482886Sphk 4953887SmarkmRead the source, and be prepared to have 2 copies of the tree; One is 5053887Smarkmthe reference ("From") tree, and the other is the delta ("To") tree. 5153887SmarkmThe mkCTM script will create the CTM diff of the differences between 5253887Smarkmthe reference tree and the delta tree. A lot of scratch space is 5353887Smarkmrequired, and your machine will work hard. 5453887Smarkm 552886SphkHow do I apply a CTM-delta ? 562886Sphk---------------------------- 572886SphkYou pass it to the 'ctm' command. You can pass a CTM-delta on stdin, or 582886Sphkyou can give the filename as an argument. If you do the latter, you make 592886Sphklife a lot easier for your self, since the program can accept gzip'ed files 602886Sphkand since it will not have to make a temporary copy of your file. You can 6135353Srnordierspecify multiple deltas at one time, they will be processed one at a time. 622886Sphk 632886SphkThe ctm command runs in a number of passes. It will process the entire 642886Sphkinput file in each pass, before commencing with the next pass. 652886Sphk 662886SphkPass 1 will validate that the input file is OK. The syntax, the data and 672886Sphkthe global MD5 checksum will be checked. If any of these fail, ctm will 682886Sphknever be able to do anything with the file, so it will simply reject it. 692886Sphk 702886SphkPass 2 will validate that the directory tree is in the state expected by 712886Sphkthe CTM-delta. This is done by looking for files and directories which 722886Sphkshould/should not exists and by checking the MD5 checksums of files. 732886Sphk 742886SphkPass 3 will actually apply the delta. 752886Sphk 762886SphkShould I delete the delta when I have applied it ? 772886Sphk-------------------------------------------------- 782886SphkNo. You might want to selectively reconstruct a file latter on. 792886Sphk 8053887SmarkmWhy is CTM not being maintained? 8153887Smarkm-------------------------------- 8253887SmarkmBecause CVSUP has improved on the concept quite a bit, and is now 8353887Smarkmthe method of choice. 842886Sphk 852886SphkPoul-Henning 86