View | Details | Raw Unified | Return to bug 159665 | Differences between
and this patch

Collapse All | Expand All

(-)ctm/ctm.1 (-1 / +4 lines)
Lines 52-59 Link Here
52
You can pass a CTM delta on stdin, or you can give the
52
You can pass a CTM delta on stdin, or you can give the
53
filename as an argument.
53
filename as an argument.
54
If you do the latter, you make life a lot
54
If you do the latter, you make life a lot
55
easier for your self, since the program can accept gzip'ed files and
55
easier for your self, since the program can accept gzip'ed,
56
bzip2'ed, or xz'ed files and
56
since it will not have to make a temporary copy of your file.
57
since it will not have to make a temporary copy of your file.
58
(If you pass it an xz'ed file, and xz is not part of your base system,
59
you will have to install xz from the ports.)
57
You can
60
You can
58
specify multiple deltas at one time, they will be processed one at a
61
specify multiple deltas at one time, they will be processed one at a
59
time.
62
time.
(-)ctm/ctm.c (+16 lines)
Lines 211-216 Link Here
211
	strcat(p,filename);
211
	strcat(p,filename);
212
	f = popen(p,"r");
212
	f = popen(p,"r");
213
	if(!f) { warn("%s", p); return Exit_Garbage; }
213
	if(!f) { warn("%s", p); return Exit_Garbage; }
214
    } else if(p && !strcmp(p,".bz2")) {
215
	p = alloca(20 + strlen(filename));
216
	strcpy(p,"bzcat < ");
217
	strcat(p,filename);
218
	f = popen(p,"r");
219
	if(!f) { warn("%s", p); return Exit_Garbage; }
220
    } else if(p && !strcmp(p,".xz")) {
221
	if (system("which -s xz") != 0) {
222
	    fprintf(stderr, "xz is not found in $PATH.  You can install it from ports, or adjust $PATH.\n");
223
	    return Exit_Garbage;
224
	}
225
	p = alloca(20 + strlen(filename));
226
	strcpy(p,"xz -dc < ");
227
	strcat(p,filename);
228
	f = popen(p,"r");
229
	if(!f) { warn("%s", p); return Exit_Garbage; }
214
    } else {
230
    } else {
215
	p = 0;
231
	p = 0;
216
	f = fopen(filename,"r");
232
	f = fopen(filename,"r");
(-)ctm/ctm.h (-1 / +9 lines)
Lines 24-29 Link Here
24
#include <sys/stat.h>
24
#include <sys/stat.h>
25
#include <sys/file.h>
25
#include <sys/file.h>
26
#include <sys/time.h>
26
#include <sys/time.h>
27
#include <stdint.h>
27
28
28
#define VERSION "2.0"
29
#define VERSION "2.0"
29
30
Lines 40-45 Link Here
40
#define CTM_F_MD5		0x05
41
#define CTM_F_MD5		0x05
41
#define CTM_F_Count		0x06
42
#define CTM_F_Count		0x06
42
#define CTM_F_Bytes		0x07
43
#define CTM_F_Bytes		0x07
44
#define CTM_F_Release		0x08
45
#define CTM_F_Forward		0x09
43
46
44
/* The qualifiers... */
47
/* The qualifiers... */
45
#define CTM_Q_MASK		0xff00
48
#define CTM_Q_MASK		0xff00
Lines 47-56 Link Here
47
#define CTM_Q_Name_Dir		0x0200
50
#define CTM_Q_Name_Dir		0x0200
48
#define CTM_Q_Name_New		0x0400
51
#define CTM_Q_Name_New		0x0400
49
#define CTM_Q_Name_Subst	0x0800
52
#define CTM_Q_Name_Subst	0x0800
53
#define CTM_Q_Name_Svnbase	0x1000
50
#define CTM_Q_MD5_After		0x0100
54
#define CTM_Q_MD5_After		0x0100
51
#define CTM_Q_MD5_Before	0x0200
55
#define CTM_Q_MD5_Before	0x0200
52
#define CTM_Q_MD5_Chunk		0x0400
56
#define CTM_Q_MD5_Chunk		0x0400
53
#define CTM_Q_MD5_Force		0x0800
57
#define CTM_Q_MD5_Force		0x0800
58
#define CTM_Q_Forward_Tar	0x0100
59
#define CTM_Q_Forward_SVN	0x0200
54
60
55
struct CTM_Syntax {
61
struct CTM_Syntax {
56
    char	*Key;		/* CTM key for operation */
62
    char	*Key;		/* CTM key for operation */
Lines 145-158 Link Here
145
u_char * Ffield(FILE *fd, MD5_CTX *ctx,u_char term);
151
u_char * Ffield(FILE *fd, MD5_CTX *ctx,u_char term);
146
u_char * Fname(FILE *fd, MD5_CTX *ctx,u_char term,int qual, int verbose);
152
u_char * Fname(FILE *fd, MD5_CTX *ctx,u_char term,int qual, int verbose);
147
153
148
int Fbytecnt(FILE *fd, MD5_CTX *ctx, u_char term);
154
intmax_t Fbytecnt(FILE *fd, MD5_CTX *ctx, u_char term);
149
155
150
u_char * Fdata(FILE *fd, int u_chars, MD5_CTX *ctx);
156
u_char * Fdata(FILE *fd, int u_chars, MD5_CTX *ctx);
157
int Fforward(FILE *fd, intmax_t u_chars, MD5_CTX *ctx, FILE *fd_to);
151
158
152
#define GETFIELD(p,q) if(!((p)=Ffield(fd,&ctx,(q)))) return BADREAD
159
#define GETFIELD(p,q) if(!((p)=Ffield(fd,&ctx,(q)))) return BADREAD
153
#define GETFIELDCOPY(p,q) if(!((p)=Ffield(fd,&ctx,(q)))) return BADREAD; else p=String(p)
160
#define GETFIELDCOPY(p,q) if(!((p)=Ffield(fd,&ctx,(q)))) return BADREAD; else p=String(p)
154
#define GETBYTECNT(p,q) if(0 >((p)= Fbytecnt(fd,&ctx,(q)))) return BADREAD
161
#define GETBYTECNT(p,q) if(0 >((p)= Fbytecnt(fd,&ctx,(q)))) return BADREAD
155
#define GETDATA(p,q) if(!((p) = Fdata(fd,(q),&ctx))) return BADREAD
162
#define GETDATA(p,q) if(!((p) = Fdata(fd,(q),&ctx))) return BADREAD
163
#define GETFORWARD(p,q) if(!Fforward(fd,(p),&ctx,q)) return BADREAD
156
#define GETNAMECOPY(p,q,r,v) if(!((p)=Fname(fd,&ctx,(q),(r),(v)))) return BADREAD; else p=String(p)
164
#define GETNAMECOPY(p,q,r,v) if(!((p)=Fname(fd,&ctx,(q),(r),(v)))) return BADREAD; else p=String(p)
157
165
158
int Pass1(FILE *fd, unsigned applied);
166
int Pass1(FILE *fd, unsigned applied);
(-)ctm/ctm_input.c (-2 / +38 lines)
Lines 61-71 Link Here
61
    return buf;
61
    return buf;
62
}
62
}
63
63
64
int
64
intmax_t
65
Fbytecnt(FILE *fd, MD5_CTX *ctx, u_char term)
65
Fbytecnt(FILE *fd, MD5_CTX *ctx, u_char term)
66
{
66
{
67
    u_char *p,*q;
67
    u_char *p,*q;
68
    int u_chars=0;
68
    intmax_t u_chars=0;
69
69
70
    p = Ffield(fd,ctx,term);
70
    p = Ffield(fd,ctx,term);
71
    if(!p) return -1;
71
    if(!p) return -1;
Lines 100-105 Link Here
100
    return p;
100
    return p;
101
}
101
}
102
102
103
int Fforward(FILE *fd, intmax_t u_chars, MD5_CTX *ctx, FILE *fd_to)
104
{
105
    u_char buf[BUFSIZ];
106
    intmax_t amount_read = 0;
107
    int amount_to_read;
108
109
    while (amount_read < u_chars) {
110
	if (u_chars - amount_read >= BUFSIZ)
111
	    amount_to_read = BUFSIZ;
112
	else
113
	    amount_to_read = u_chars - amount_read;
114
	if(amount_to_read != fread(buf, 1, amount_to_read, fd)) {
115
	    Fatal("Truncated patch.");
116
	    return 0;
117
	}
118
	MD5Update(ctx,buf,amount_to_read);
119
	if (fd_to != NULL) {
120
	    if (amount_to_read != fwrite(buf, 1, amount_to_read, fd_to)) {
121
		Fatal("Write error.");
122
		return 0;
123
	    }
124
	}
125
	amount_read += amount_to_read;
126
    }
127
128
    if(getc(fd) != '\n') {
129
	if(Verbose > 3)
130
	    printf("FileData wasn't followed by a newline.\n");
131
        Fatal("Corrupt patch.");
132
	return 0;
133
    }
134
    MD5Update(ctx,"\n",1);
135
    return 1;
136
}
137
138
103
/*---------------------------------------------------------------------------*/
139
/*---------------------------------------------------------------------------*/
104
/* get the filename in the next field, prepend BaseDir and give back the result
140
/* get the filename in the next field, prepend BaseDir and give back the result
105
   strings. The sustitute filename is return (the one with the suffix SUBSUFF) 
141
   strings. The sustitute filename is return (the one with the suffix SUBSUFF) 
(-)ctm/ctm_pass1.c (-2 / +14 lines)
Lines 22-28 Link Here
22
{
22
{
23
    u_char *p,*q;
23
    u_char *p,*q;
24
    MD5_CTX ctx;
24
    MD5_CTX ctx;
25
    int i,j,sep,cnt;
25
    int i,j,sep;
26
    intmax_t cnt, rel;
26
    u_char *md5=0,*name=0,*trash=0;
27
    u_char *md5=0,*name=0,*trash=0;
27
    struct CTM_Syntax *sp;
28
    struct CTM_Syntax *sp;
28
    int slashwarn=0, match=0, total_matches=0;
29
    int slashwarn=0, match=0, total_matches=0;
Lines 96-102 Link Here
96
	if(Verbose > 5)
97
	if(Verbose > 5)
97
	    fprintf(stderr,"%s ",sp->Key);
98
	    fprintf(stderr,"%s ",sp->Key);
98
	for(i=0;(j = sp->List[i]);i++) {
99
	for(i=0;(j = sp->List[i]);i++) {
99
	    if (sp->List[i+1] && (sp->List[i+1] & CTM_F_MASK) != CTM_F_Bytes)
100
	    if (sp->List[i+1] && (sp->List[i+1] & CTM_F_MASK) != CTM_F_Bytes && (sp->List[i+1] & CTM_F_MASK) != CTM_F_Forward)
100
		sep = ' ';
101
		sep = ' ';
101
	    else
102
	    else
102
		sep = '\n';
103
		sep = '\n';
Lines 209-214 Link Here
209
		    if(md5 && strcmp(md5,p)) {
210
		    if(md5 && strcmp(md5,p)) {
210
			Fatal("Internal MD5 failed.");
211
			Fatal("Internal MD5 failed.");
211
			return Exit_Garbage;
212
			return Exit_Garbage;
213
		case CTM_F_Release:
214
		    GETBYTECNT(rel,sep);
215
		    break;
216
		case CTM_F_Forward:
217
		    if(cnt < 0) WRONG
218
		    if ((j & CTM_Q_MASK) == CTM_Q_Forward_SVN && system("which -s svnadmin") != 0) {
219
			fprintf(stderr, "subversion is not installed.  You can install it from ports.\n");
220
			return Exit_Garbage;
221
		    }
222
		    GETFORWARD(cnt,NULL);
223
		    break;
212
		default:
224
		default:
213
			fprintf(stderr,"List = 0x%x\n",j);
225
			fprintf(stderr,"List = 0x%x\n",j);
214
			Fatal("List had garbage.");
226
			Fatal("List had garbage.");
(-)ctm/ctm_pass2.c (-3 / +59 lines)
Lines 22-28 Link Here
22
{
22
{
23
    u_char *p,*q,*md5=0;
23
    u_char *p,*q,*md5=0;
24
    MD5_CTX ctx;
24
    MD5_CTX ctx;
25
    int i,j,sep,cnt,fdesc;
25
    int i,j,sep,fdesc;
26
    intmax_t cnt, rel;
27
    int rel2;
28
    FILE *current;
29
    char *current_file_name = NULL;
26
    u_char *trash=0,*name=0;
30
    u_char *trash=0,*name=0;
27
    struct CTM_Syntax *sp;
31
    struct CTM_Syntax *sp;
28
    struct stat st;
32
    struct stat st;
Lines 30-36 Link Here
30
    int match = 0;
34
    int match = 0;
31
    char md5_1[33];
35
    char md5_1[33];
32
    struct CTM_Filter *filter;
36
    struct CTM_Filter *filter;
33
    FILE *ed = NULL;
37
    FILE *ed = NULL, *fd_to = NULL;
34
    static char *template = NULL;
38
    static char *template = NULL;
35
39
36
    if(Verbose>3)
40
    if(Verbose>3)
Lines 72-78 Link Here
72
	WRONG
76
	WRONG
73
    found:
77
    found:
74
	for(i=0;(j = sp->List[i]);i++) {
78
	for(i=0;(j = sp->List[i]);i++) {
75
	    if (sp->List[i+1] && (sp->List[i+1] & CTM_F_MASK) != CTM_F_Bytes)
79
	    if (sp->List[i+1] && (sp->List[i+1] & CTM_F_MASK) != CTM_F_Bytes && (sp->List[i+1] & CTM_F_MASK) != CTM_F_Forward)
76
		sep = ' ';
80
		sep = ' ';
77
	    else
81
	    else
78
		sep = '\n';
82
		sep = '\n';
Lines 128-133 Link Here
128
				sp->Key,name);
132
				sp->Key,name);
129
			    ret |= Exit_NotOK;
133
			    ret |= Exit_NotOK;
130
			}
134
			}
135
			if (j & CTM_Q_Name_Svnbase) {
136
			    current_file_name = alloca(strlen(name)+128);
137
			    strcpy(current_file_name,name);
138
			    strcat(current_file_name,"/db/current");
139
	 		    current = fopen(current_file_name,"r");
140
			    if (current==NULL) {
141
				fprintf(stderr,"Cannot open %s\n",current_file_name);
142
				WRONG
143
			    }
144
			    if (fscanf(current,"%d",&rel2) != 1) {
145
				fprintf(stderr,"Cannot find release number in %s\n",current_file_name);
146
				fclose(current);
147
				WRONG
148
			    }
149
			    fclose(current);
150
			}
131
			break;
151
			break;
132
		    }
152
		    }
133
		    if (j & CTM_Q_Name_File) {
153
		    if (j & CTM_Q_Name_File) {
Lines 284-289 Link Here
284
		    }
304
		    }
285
305
286
		    break;
306
		    break;
307
		case CTM_F_Release:
308
		    GETBYTECNT(rel,sep);
309
		    if(Verbose > 3)
310
			printf("Expecting release number %jd\n",rel);
311
		    if(Verbose > 3)
312
			printf("Actual release number %d\n",rel2);
313
		    if (rel != rel2) {
314
			fprintf(stderr,"Release number mismatch: found %d, need %jd\n",rel2,rel);
315
			WRONG
316
		    }
317
		    break;
318
		case CTM_F_Forward:
319
		    if ((j & CTM_Q_MASK) == CTM_Q_Forward_SVN) {
320
			if(Verbose>3)
321
			    printf("This is a svn dump file and there is no certainty that it will apply cleanly.\n");
322
			GETFORWARD(cnt,NULL);
323
		    }
324
		    else if ((j & CTM_Q_MASK) == CTM_Q_Forward_Tar) {
325
			if(Verbose>3) {
326
			    printf("This is a tar file and there is no certainty that it will apply cleanly even if it passes the following test.\n");
327
			    fd_to = popen("tar tvf -","w");
328
			} else
329
			    fd_to = popen("tar tf - >/dev/null 2>&1","w");
330
			if (fd_to == NULL) {
331
			    fprintf(stderr,"Cannot forward\n");
332
			    WRONG
333
			}
334
			GETFORWARD(cnt,fd_to);
335
			if (pclose(fd_to)) {
336
			    fprintf(stderr,"Tar failed to close properly\n");
337
			    WRONG
338
			} else
339
			    if (Verbose > 3)
340
				printf("Tar file test was good\n");
341
		    }
342
		    break;
287
		default: WRONG
343
		default: WRONG
288
	    }
344
	    }
289
        }
345
        }
(-)ctm/ctm_pass3.c (-41 / +90 lines)
Lines 33-42 Link Here
33
{
33
{
34
    u_char *p,*q,buf[BUFSIZ];
34
    u_char *p,*q,buf[BUFSIZ];
35
    MD5_CTX ctx;
35
    MD5_CTX ctx;
36
    int i,j,sep,cnt;
36
    int i,j,sep;
37
    intmax_t cnt,rel;
38
    char *svn_command = NULL;
37
    u_char *md5=0,*md5before=0,*trash=0,*name=0,*uid=0,*gid=0,*mode=0;
39
    u_char *md5=0,*md5before=0,*trash=0,*name=0,*uid=0,*gid=0,*mode=0;
38
    struct CTM_Syntax *sp;
40
    struct CTM_Syntax *sp;
39
    FILE *ed=0;
41
    FILE *ed=0, *fd_to;
40
    struct stat st;
42
    struct stat st;
41
    char md5_1[33];
43
    char md5_1[33];
42
    int match=0;
44
    int match=0;
Lines 129-135 Link Here
129
	WRONG
131
	WRONG
130
    found:
132
    found:
131
	for(i=0;(j = sp->List[i]);i++) {
133
	for(i=0;(j = sp->List[i]);i++) {
132
	    if (sp->List[i+1] && (sp->List[i+1] & CTM_F_MASK) != CTM_F_Bytes)
134
	    if (sp->List[i+1] && (sp->List[i+1] & CTM_F_MASK) != CTM_F_Bytes && (sp->List[i+1] & CTM_F_MASK) != CTM_F_Forward)
133
		sep = ' ';
135
		sep = ' ';
134
	    else
136
	    else
135
		sep = '\n';
137
		sep = '\n';
Lines 147-199 Link Here
147
		    break;
149
		    break;
148
		case CTM_F_Count: GETBYTECNT(cnt,sep); break;
150
		case CTM_F_Count: GETBYTECNT(cnt,sep); break;
149
		case CTM_F_Bytes: GETDATA(trash,cnt); break;
151
		case CTM_F_Bytes: GETDATA(trash,cnt); break;
152
		case CTM_F_Release: GETBYTECNT(rel,sep); break;
153
		case CTM_F_Forward:
154
		    if ((j & CTM_Q_MASK) == CTM_Q_Forward_Tar) {
155
			if (Verbose > 0)
156
			    fd_to = popen("tar xvf -","w");
157
			else
158
			    fd_to = popen("tar xvf - >/dev/null 2>&1","w");
159
		    } else if ((j & CTM_Q_MASK) == CTM_Q_Forward_SVN) {
160
			svn_command = alloca(strlen(name)+128);
161
			if (Verbose > 0)
162
			    snprintf(svn_command,strlen(name)+127,"svnadmin load %s\n", name);
163
			else
164
			    snprintf(svn_command,strlen(name)+127,"svnadmin load %s > /dev/null 2>&1\n", name);
165
			fd_to = popen(svn_command,"w");
166
		    } else WRONG
167
		    if (fd_to == NULL) {
168
			fprintf(stderr,"Cannot forward\n");
169
			WRONG
170
		    }
171
	    	    if (Verbose > 0) {
172
			if (!strcmp(sp->Key,"TR"))
173
			    fprintf(stderr,"> %s\n",sp->Key);
174
			else
175
	 		    fprintf(stderr,"> %s %s\n",sp->Key,name);
176
		    }
177
		    GETFORWARD(cnt,fd_to);
178
		    if (pclose(fd_to)) {
179
			if ((j & CTM_Q_MASK) == CTM_Q_Forward_Tar)
180
			    fprintf(stderr,"Tar failed to close properly\n");
181
			else if ((j & CTM_Q_MASK) == CTM_Q_Forward_SVN)
182
			    fprintf(stderr,"Svnadmin failed to close properly\n");
183
			WRONG
184
		    }
185
		    if ((j & CTM_Q_MASK) == CTM_Q_Forward_SVN) {
186
			snprintf(svn_command,strlen(name)+127,"svnadmin pack %s\n", name);
187
			if (system(svn_command)) {
188
			    fprintf(stderr,"\"%s\" didn't work.", svn_command);
189
			    WRONG
190
			}
191
		    }
192
		    break;
150
		default: WRONG
193
		default: WRONG
151
		}
194
		}
152
	    }
195
	    }
153
	/* XXX This should go away.  Disallow trailing '/' */
196
154
	j = strlen(name)-1;
197
	if (name) {
155
	if(name[j] == '/') name[j] = '\0';
198
	    /* XXX This should go away.  Disallow trailing '/' */
156
199
	    j = strlen(name)-1;
157
	/*
200
	    if(name[j] == '/') name[j] = '\0';
158
	 * If a filter list is specified, run thru the filter list and
201
159
	 * match `name' against filters.  If the name matches, set the
202
	    /*
160
	 * required action to that specified in the filter.
203
	     * If a filter list is specified, run thru the filter list and
161
	 * The default action if no filterlist is given is to match
204
	     * match `name' against filters.  If the name matches, set the
162
	 * everything.  
205
	     * required action to that specified in the filter.
163
	 */
206
	     * The default action if no filterlist is given is to match
164
207
	     * everything.  
165
	match = (FilterList ? !(FilterList->Action) : CTM_FILTER_ENABLE);
208
	     */
166
	for (filter = FilterList; filter; filter = filter->Next) {
209
167
	    if (0 == regexec(&filter->CompiledRegex, name,
210
	    match = (FilterList ? !(FilterList->Action) : CTM_FILTER_ENABLE);
168
		0, 0, 0)) {
211
	    for (filter = FilterList; filter; filter = filter->Next) {
169
		match = filter->Action;
212
		if (0 == regexec(&filter->CompiledRegex, name,
213
		    0, 0, 0)) {
214
		    match = filter->Action;
215
		}
170
	    }
216
	    }
171
	}
172
217
173
	if (CTM_FILTER_DISABLE == match) /* skip file if disabled */
218
	    if (CTM_FILTER_DISABLE == match) /* skip file if disabled */
174
		continue;
219
		    continue;
175
220
176
	if (Verbose > 0)
221
	    if (Verbose > 0 && strcmp(sp->Key,"SV") && strcmp(sp->Key,"TR"))
177
		fprintf(stderr,"> %s %s\n",sp->Key,name);
222
		fprintf(stderr,"> %s %s\n",sp->Key,name);
178
	if(!strcmp(sp->Key,"FM") || !strcmp(sp->Key, "FS")) {
223
	    if(!strcmp(sp->Key,"FM") || !strcmp(sp->Key, "FS")) {
179
	    i = open(name,O_WRONLY|O_CREAT|O_TRUNC,0666);
224
		i = open(name,O_WRONLY|O_CREAT|O_TRUNC,0666);
180
	    if(i < 0) {
225
		if(i < 0) {
181
		warn("%s", name);
226
		    warn("%s", name);
182
		WRONG
227
		    WRONG
183
	    }
228
		}
184
	    if(cnt != write(i,trash,cnt)) {
229
		if(cnt != write(i,trash,cnt)) {
185
		warn("%s", name);
230
		    warn("%s", name);
186
		WRONG
231
		    WRONG
187
	    }
232
		}
188
	    close(i);
233
		close(i);
189
	    if(strcmp(md5,MD5File(name,md5_1))) {
234
		if(strcmp(md5,MD5File(name,md5_1))) {
190
		fprintf(stderr,"  %s %s MD5 didn't come out right\n",
235
		    fprintf(stderr,"  %s %s MD5 didn't come out right\n",
191
		   sp->Key,name);
236
		       sp->Key,name);
192
		WRONG
237
		    WRONG
238
		}
239
		if (settime(name,times)) WRONG
240
		continue;
193
	    }
241
	    }
194
	    if (settime(name,times)) WRONG
195
	    continue;
196
	}
242
	}
243
197
	if(!strcmp(sp->Key,"FE")) {
244
	if(!strcmp(sp->Key,"FE")) {
198
	    ed = popen("ed","w");
245
	    ed = popen("ed","w");
199
	    if(!ed) {
246
	    if(!ed) {
Lines 276-281 Link Here
276
	    }
323
	    }
277
	    continue;
324
	    continue;
278
	}
325
	}
326
	if(!strcmp(sp->Key,"TR") || !strcmp(sp->Key,"SV"))
327
	    continue;
279
	WRONG
328
	WRONG
280
    }
329
    }
281
330
(-)ctm/ctm_syntax.c (+13 lines)
Lines 20-35 Link Here
20
#define MD5	CTM_F_MD5
20
#define MD5	CTM_F_MD5
21
#define Count	CTM_F_Count
21
#define Count	CTM_F_Count
22
#define Bytes	CTM_F_Bytes
22
#define Bytes	CTM_F_Bytes
23
#define Release	CTM_F_Release
24
#define Forward	CTM_F_Forward
23
25
24
/* The qualifiers... */
26
/* The qualifiers... */
25
#define File	CTM_Q_Name_File
27
#define File	CTM_Q_Name_File
26
#define Dir	CTM_Q_Name_Dir
28
#define Dir	CTM_Q_Name_Dir
29
#define Svnbase	CTM_Q_Name_Svnbase
27
#define New	CTM_Q_Name_New
30
#define New	CTM_Q_Name_New
28
#define Subst	CTM_Q_Name_Subst
31
#define Subst	CTM_Q_Name_Subst
29
#define After	CTM_Q_MD5_After
32
#define After	CTM_Q_MD5_After
30
#define Before	CTM_Q_MD5_Before
33
#define Before	CTM_Q_MD5_Before
31
#define Chunk	CTM_Q_MD5_Chunk
34
#define Chunk	CTM_Q_MD5_Chunk
32
#define Force	CTM_Q_MD5_Force
35
#define Force	CTM_Q_MD5_Force
36
#define Tar	CTM_Q_Forward_Tar
37
#define SVN	CTM_Q_Forward_SVN
33
38
34
static int ctmFM[] = /* File Make */
39
static int ctmFM[] = /* File Make */
35
    { Name|File|New|Subst, Uid, Gid, Mode,
40
    { Name|File|New|Subst, Uid, Gid, Mode,
Lines 55-60 Link Here
55
static int ctmDR[] = /* Directory Remove */
60
static int ctmDR[] = /* Directory Remove */
56
    { Name|Dir, 0 };
61
    { Name|Dir, 0 };
57
62
63
static int ctmTR[] = /* Forward to tar */
64
    { Count, Forward|Tar, 0 };
65
66
static int ctmSV[] = /* Forward to svnadmin load */
67
    { Name|Dir|Svnbase, Release, Count, Forward|SVN, 0 };
68
58
struct CTM_Syntax Syntax[] = {
69
struct CTM_Syntax Syntax[] = {
59
    { "FM",  	ctmFM },
70
    { "FM",  	ctmFM },
60
    { "FS",  	ctmFS },
71
    { "FS",  	ctmFS },
Lines 64-67 Link Here
64
    { "AS", 	ctmAS },
75
    { "AS", 	ctmAS },
65
    { "DM",  	ctmDM },
76
    { "DM",  	ctmDM },
66
    { "DR",  	ctmDR },
77
    { "DR",  	ctmDR },
78
    { "TR",  	ctmTR },
79
    { "SV",  	ctmSV },
67
    { 0,    	0} };
80
    { 0,    	0} };

Return to bug 159665