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