Fixed a bug so that a delta#0 can be applied.

Fixed a typo in the generation of temp filenames.
"Blame" Joerg for the man-pages (and clarify a couple of minor points).
Most appreceiated Joerg!
This commit is contained in:
Poul-Henning Kamp 1995-03-26 20:09:52 +00:00
parent d030a0729f
commit 37c1d2607b
4 changed files with 33 additions and 24 deletions

View File

@ -2,7 +2,7 @@
.\""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. Poul-Henning Kamp
.\"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
@ -10,7 +10,7 @@
.\"
.\" CTM and ctm(1) by <phk@login.dknet.dk>
.\"
.\" $Id$
.\" $Id: ctm.1,v 1.1 1995/03/25 18:14:24 joerg Exp $
.\"
.Dd Mar 25, 1995
.Os
@ -27,7 +27,8 @@
.Nm Ctm
was originally
.Dq Cvs Through eMail ,
but has since changed scope to be much more general.
but now instead it seems more fitting to call it
.Dq Current Through eMail .
.Nm Ctm
is now meant to be the definitive way to make and apply a delta between
@ -134,6 +135,9 @@ options.
.Sh HISTORY
Initial trials ran during the FreeBSD 1.1.5, and many bugs and
methods were hashed out.
The
.Nm ctm
command appeared in FreeBSD 2.1.
@ -144,3 +148,5 @@ 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 .

View File

@ -2,7 +2,7 @@
.\""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. Poul-Henning Kamp
.\"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
@ -10,7 +10,7 @@
.\"
.\" CTM and ctm(1) by <phk@login.dknet.dk>
.\"
.\" $Id$
.\" $Id: ctm.5,v 1.1 1995/03/25 18:14:26 joerg Exp $
.\"
.Dd March 25, 1995
.Os
@ -22,16 +22,21 @@
.Sh DESCRIPTION
The
.Nm ctm
system uses a specific file format, called a CTM delta.
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 continues up to
the end of line.
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
@ -56,15 +61,14 @@ meaning this is a UTC timestamp
.Pc .
The
.Ar prefix
field is currently always
.Sq \&. .
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 entire delta to ensure it has been
transfered correctly.
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
@ -111,14 +115,13 @@ 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 ed 1
like script to edit the file contents.
.Xr diff 1
-n script which should be applied to the file in question.
.It \&FR Ar name md5
@ -127,7 +130,6 @@ Remove the file
which must match the MD5 checksum
.Ar md5 .
.It \&AS Ar name uid gid mode
The original file
@ -139,7 +141,6 @@ its group to
and/or its mode to
.Ar mode .
.It \&DM Ar name uid gid mode
The directory
@ -151,14 +152,12 @@ group
and mode
.Ar mode .
.It \&DR name
The directory
.Ar name
is to be removed.
.El
.Sh EXAMPLES
@ -196,6 +195,8 @@ CTM_END 74ddd298d76215ae45a077a4b6a74e9c
.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
@ -204,3 +205,5 @@ 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 .

View File

@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
* $Id: ctm.c,v 1.8 1995/03/04 20:36:45 phk Exp $
* $Id: ctm.c,v 1.9 1995/03/19 13:42:54 joerg Exp $
*
* This is the client program of 'CTM'. It will apply a CTM-patch to a
* collection of files.
@ -141,7 +141,7 @@ Proc(char *filename, unsigned applied)
/* If we cannot seek, we're doomed, so copy to a tmp-file in that case */
if(!p && -1 == fseek(f,0,SEEK_END)) {
char *fn = tempnam(TmpDir,"CMTclient");
char *fn = tempnam(TmpDir,"CTMclient");
FILE *f2 = fopen(fn,"w+");
int i;

View File

@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
* $Id: ctm_pass1.c,v 1.7 1995/02/25 05:02:18 phk Exp $
* $Id: ctm_pass1.c,v 1.8 1995/03/04 20:36:46 phk Exp $
*
*/
@ -54,7 +54,7 @@ Pass1(FILE *fd, unsigned applied)
GETFIELDCOPY(Prefix,'\n'); /* <Prefix> */
sscanf(Nbr, "%u", &current);
if(current <= applied) {
if(current && current <= applied) {
if(Verbose)
fprintf(stderr,"Delta number %u is already applied; ignoring.\n",
current);