]> git.pld-linux.org Git - packages/cvs.git/blame - cvs-debian-parseopts.patch
rel 20; rediff patches
[packages/cvs.git] / cvs-debian-parseopts.patch
CommitLineData
3a862a5e
AM
1diff -ruN cvs-1.12.13-old/src/cvs.h cvs-1.12.13/src/cvs.h
2--- cvs-1.12.13-old/src/cvs.h 2006-08-19 00:05:38.000000000 +0100
3+++ cvs-1.12.13/src/cvs.h 2006-08-19 00:05:41.000000000 +0100
4@@ -177,6 +177,7 @@
5 #define CVSROOTADM_LOGINFO "loginfo"
6 #define CVSROOTADM_MODULES "modules"
7 #define CVSROOTADM_NOTIFY "notify"
8+#define CVSROOTADM_OPTIONS "options"
9 #define CVSROOTADM_PASSWD "passwd"
10 #define CVSROOTADM_POSTADMIN "postadmin"
11 #define CVSROOTADM_POSTPROXY "postproxy"
12@@ -506,6 +507,7 @@
13 char *strcat_filename_onto_homedir (const char *, const char *);
14 char *cvs_temp_name (void);
15 FILE *cvs_temp_file (char **filename);
16+void parseopts (const char *root);
17
18 int ls (int argc, char *argv[]);
19 int unlink_file (const char *f);
20diff -ruN cvs-1.12.13-old/src/main.c cvs-1.12.13/src/main.c
21--- cvs-1.12.13-old/src/main.c 2006-08-19 00:05:38.000000000 +0100
22+++ cvs-1.12.13/src/main.c 2006-08-19 00:08:14.000000000 +0100
23@@ -1108,6 +1108,8 @@
24 CVSROOT/config file to fix the broken one! */
25 if (config) free_config (config);
26 config = parse_config (current_parsed_root->directory, NULL);
27+ /* Now is a convenient time to read CVSROOT/options */
28+ parseopts(current_parsed_root->directory);
29
30 /* Can set TMPDIR in the environment if necessary now, since
31 * if it was set in config, we now know it.
32@@ -1482,5 +1484,63 @@
33 exit (EXIT_FAILURE);
34 }
35
36+void
37+parseopts(root)
38+ const char *root;
39+{
40+ char path[PATH_MAX];
41+ int save_errno;
42+ char buf[1024];
43+ const char *p;
44+ char *q;
45+ FILE *fp;
46+
47+ if (root == NULL) {
48+ printf("no CVSROOT in parseopts\n");
49+ return;
50+ }
51+ p = strchr (root, ':');
52+ if (p)
53+ p++;
54+ else
55+ p = root;
56+ if (p == NULL) {
57+ printf("mangled CVSROOT in parseopts\n");
58+ return;
59+ }
60+ (void) sprintf (path, "%s/%s/%s", p, CVSROOTADM, CVSROOTADM_OPTIONS);
61+ if ((fp = fopen(path, "r")) != NULL) {
62+ while (fgets(buf, sizeof buf, fp) != NULL) {
63+ if (buf[0] == '#')
64+ continue;
65+ q = strrchr(buf, '\n');
66+ if (q)
67+ *q = '\0';
68+
69+ if (!strncmp(buf, "tag=", 4)) {
70+ char *what;
71+ char *rcs_localid;
72+
73+ rcs_localid = buf + 4;
74+ RCS_setlocalid(path, 0, &config->keywords, rcs_localid);
75+ }
76+ if (!strncmp(buf, "tagexpand=", 10)) {
77+ char *what;
78+ char *rcs_incexc;
79+
80+ rcs_incexc = buf + 10;
81+ RCS_setincexc(&config->keywords, rcs_incexc);
82+ }
83+ /*
84+ * OpenBSD has a "umask=" and "dlimit=" command, we silently
85+ * ignore them here since they are not much use to us. cvsumask
86+ * defaults to 002 already, and the dlimit (data size limit)
87+ * should really be handled elsewhere (eg: login.conf).
88+ */
89+ }
90+ fclose(fp);
91+ }
92+}
93+
94 /* vim:tabstop=8:shiftwidth=4
95 */
96diff -ruN cvs-1.12.13-old/src/server.c cvs-1.12.13/src/server.c
97--- cvs-1.12.13-old/src/server.c 2006-08-19 00:05:38.000000000 +0100
98+++ cvs-1.12.13/src/server.c 2006-08-19 00:05:41.000000000 +0100
99@@ -985,6 +985,9 @@
100 config->MaxCompressionLevel);
101 }
102
103+ /* Now is a good time to read CVSROOT/options too. */
104+ parseopts(current_parsed_root->directory);
105+
106 path = xmalloc (strlen (current_parsed_root->directory)
107 + sizeof (CVSROOTADM)
108 + 2);
This page took 0.097082 seconds and 4 git commands to generate.