From 4bb5f49662398b2c716ed1737fb2ad4ca436335d Mon Sep 17 00:00:00 2001 From: ru Date: Wed, 27 Dec 2000 15:30:30 +0000 Subject: Prepare for mdoc(7)NG. --- usr.sbin/ctm/ctm/ctm.1 | 71 ++++++++++---------------------------- usr.sbin/ctm/ctm/ctm.5 | 45 ++++-------------------- usr.sbin/ctm/ctm_rmail/ctm_rmail.1 | 3 +- 3 files changed, 27 insertions(+), 92 deletions(-) (limited to 'usr.sbin/ctm') diff --git a/usr.sbin/ctm/ctm/ctm.1 b/usr.sbin/ctm/ctm/ctm.1 index dcfadb5..69539ca 100644 --- a/usr.sbin/ctm/ctm/ctm.1 +++ b/usr.sbin/ctm/ctm/ctm.1 @@ -35,16 +35,14 @@ was originally .Dq Cvs Through eMail , but now instead it seems more fitting to call it .Dq Current Through eMail . - +.Pp .Nm Ctm 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. - .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 @@ -53,12 +51,12 @@ easier for your self, 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 processed one at a time. Deltas that are already applied will be ignored. - +.Pp The .Nm command runs in a number of passes. It will process the entire input file in each pass, before commencing with the next pass. - +.Pp Before working on a file .Ar name .Nm @@ -67,16 +65,16 @@ first checks for the existence of the file If this file exists, .Nm works on it instead. - +.Pp Pass 1 will verify 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 simply reject the input file. - +.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 If a .Ar backup-file had been specified using the @@ -88,9 +86,9 @@ to this file using the archiver command specified by the .Fl t option. The default archiver command is .Nm "tar -rf %s -T -" . - +.Pp Pass 3 will actually apply the delta. - +.Pp The list of files that would be modified by .Nm is subject to filtering regular expressions specified @@ -107,24 +105,20 @@ options are applied in order of appearance on the command line. The last filter that matched a given file name determines whether the file would be operated on or left alone by .Nm . - +.Pp .Nm Ctm will extract the file hierarchy below its working directory. Absolute filenames or filenames containing references through -.Sq \&. +.Sq Pa .\& and -.Sq \&.\&. +.Sq Pa ..\& are explicitly prohibited as a security measure. - .Ss Options - -.Bl -tag -width indent -compact - +.Bl -tag -width indent .It Fl b Ar basedir Prepend the path .Ar basedir to every filename. - .It Fl B Ar backup-file Backup all files that would be modified by this CTM run to .Ar backup-file . @@ -134,10 +128,8 @@ and .Fl x options, then the final set of files backed up are those that would be modified by CTM after the filters are applied. - .It Fl c Check it out, don't do anything. - .It Fl e Ar regular_expression Match each name in the CTM file against .Ar regular_expression , @@ -149,20 +141,17 @@ sequence number checks. For example, the expression for example, will select the .Nm usr.sbin/ctm source directory and all pathnames under it. - +.Pp Pathnames can be disabled from being considered by CTM using the .Fl x option. - .It Fl F Force. - .It Fl k Keep files and directories and don't remove them even if the CTM file specifies they are to be removed. If the .Fl B option is specified, these files and directories will not be backed up. - .It Fl l List files that would be modified by this invocation of CTM and the actions that would be performed on them. Use of the @@ -177,11 +166,8 @@ and .Fl x options to determine which files would be modified by the given set of command line options. - - .It Fl q Tell us less. - .It Fl t Ar tar-command Use .Ar tar-command @@ -191,24 +177,18 @@ This option takes effect only if a backup file had been specified using the .Fl B option. A %s in the tar command will be replaced by the name of the backup file. - - .It Fl T Ar tmpdir Put temporary files under .Ar tmpdir . - .It Fl u Set modification time of created and modified files to the CTM delta creation time. - .It Fl v Tell us more. - .It Fl V Ar level Tell us more. .Ar Level is the level of verbosity. - .It Fl x Ar regular_expression Match each name in the CTM file against .Ar regular_expression @@ -216,11 +196,10 @@ and if it matches, leave the file alone. There may be any number of these options. Use of this option disables the .Pa .ctm_status sequence number checks. - +.Pp Pathnames can be selected for CTM's consideration using the .Fl e option. - .El .Pp .Sh SECURITY @@ -264,14 +243,12 @@ 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 . - +.Pp Using the .Fl e and @@ -279,23 +256,18 @@ and options can update a partial subset of the source tree and causes sources to be in an inconsistent state. It is assumed that you know what you are doing when you use these options. - .Sh EXAMPLES - .Bd -literal - cd ~cvs /usr/sbin/ctm ~ctm/cvs-* - .Ed - +.Pp To extract and patch all sources under `lib' .Bd -literal cd ~/lib-srcs /usr/sbin/ctm -e '^lib' ~ctm/src-cur* .Ed .Sh DIAGNOSTICS - Numerous messages, hopefully self-explanatory. The .Dq noise level can be adjusted with the @@ -304,29 +276,24 @@ can be adjusted with the and .Fl V options. - .Sh SEE ALSO .Xr ctm_rmail 1 , .Xr ctm 5 - .Sh HISTORY - Initial trials were run during the work on .Fx 1.1.5 , and many bugs and methods were hashed out. - +.Pp The .Nm command appeared in .Fx 2.1 . - .Sh AUTHORS - The CTM system has been designed and implemented by .An Poul-Henning Kamp .Aq phk@FreeBSD.org . - +.Pp .An Joerg Wunsch .Aq joerg@FreeBSD.org wrote this man-page. diff --git a/usr.sbin/ctm/ctm/ctm.5 b/usr.sbin/ctm/ctm/ctm.5 index f79e738..ac67d4f 100644 --- a/usr.sbin/ctm/ctm/ctm.5 +++ b/usr.sbin/ctm/ctm/ctm.5 @@ -18,29 +18,26 @@ .Sh NAME .Nm ctm .Nd source code mirror system - .Sh DESCRIPTION The .Nm transfers data in a specific file format, called a CTM delta. - +.Pp 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. - +.Pp Data chunks always belong to the preceding 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. - +.Pp 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 @@ -62,16 +59,12 @@ meaning this is a UTC timestamp The .Ar prefix 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 @@ -85,13 +78,11 @@ mode .Pq numerical, octal , and the MD5 checksum .Ar md5 . - +.Pp 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 @@ -107,31 +98,25 @@ the old MD5 checksum .Ar md5before , and the new MD5 checksum .Ar md5after . - +.Pp The following .Ar count bytes data are the contents of the new file. - +.Pp 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 @@ -140,9 +125,7 @@ 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 @@ -151,23 +134,16 @@ group .Ar gid , and mode .Ar mode . - .It \&DR Ar 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 @@ -185,30 +161,23 @@ ache 95/03/24 09:59:50 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 .Fx 1.1.5 , and many bugs and methods were hashed out. The CTM system has been made publicly available in .Fx 2.1 . - .Sh AUTHORS - The CTM system has been designed and implemented by .An Poul-Henning Kamp .Aq phk@FreeBSD.org . - +.Pp .An Joerg Wunsch .Aq joerg@FreeBSD.org wrote this man-page. diff --git a/usr.sbin/ctm/ctm_rmail/ctm_rmail.1 b/usr.sbin/ctm/ctm_rmail/ctm_rmail.1 index a873c50..678e44c 100644 --- a/usr.sbin/ctm/ctm_rmail/ctm_rmail.1 +++ b/usr.sbin/ctm/ctm_rmail/ctm_rmail.1 @@ -417,8 +417,7 @@ Completed deltas. .It Pa BASEDIR/.ctm_status File containing the name and number of the next delta to be applied to this source tree. -.\" This next request is for sections 1, 6, 7 & 8 only -.\" (command return values (to shell) and fprintf/stderr type diagnostics) +.El .Sh DIAGNOSTICS .Nm ctm_smail , .Nm ctm_dequeue -- cgit v1.1