diff options
author | Xavier Santolaria <xsa@cvs.openbsd.org> | 2006-11-14 15:39:43 +0000 |
---|---|---|
committer | Xavier Santolaria <xsa@cvs.openbsd.org> | 2006-11-14 15:39:43 +0000 |
commit | 870dc971b476c4d695304baaaacc7560ea9dcdc3 (patch) | |
tree | 5b8b89b16b84dc9dd33a8a12f5456ba8ecd14d24 /usr.bin/cvs | |
parent | 735ff64164a35c86efb3b29ad72ba796e78f36a7 (diff) |
Add support for the "Set" request.
Diffstat (limited to 'usr.bin/cvs')
-rw-r--r-- | usr.bin/cvs/client.c | 9 | ||||
-rw-r--r-- | usr.bin/cvs/cvs.c | 4 | ||||
-rw-r--r-- | usr.bin/cvs/cvs.h | 4 | ||||
-rw-r--r-- | usr.bin/cvs/remote.h | 3 | ||||
-rw-r--r-- | usr.bin/cvs/server.c | 16 |
5 files changed, 28 insertions, 8 deletions
diff --git a/usr.bin/cvs/client.c b/usr.bin/cvs/client.c index 753de315d22..0ecfa85ed51 100644 --- a/usr.bin/cvs/client.c +++ b/usr.bin/cvs/client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: client.c,v 1.25 2006/11/14 10:10:19 xsa Exp $ */ +/* $OpenBSD: client.c,v 1.26 2006/11/14 15:39:41 xsa Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -36,6 +36,7 @@ struct cvs_req cvs_requests[] = { { "Argument", 0, cvs_server_argument, REQ_NEEDED }, { "Argumentx", 0, cvs_server_argumentx, REQ_NEEDED }, { "Global_option", 0, cvs_server_globalopt, REQ_NEEDED }, + { "Set", 0, cvs_server_set, REQ_NEEDED }, /* * used to tell the server what is going on in our @@ -56,7 +57,6 @@ struct cvs_req cvs_requests[] = { { "Kerberos-encrypt", 0, NULL, 0 }, { "Gssapi-encrypt", 0, NULL, 0 }, { "Gssapi-authenticate", 0, NULL, 0 }, - { "Set", 0, NULL, 0 }, { "expand-modules", 0, NULL, 0 }, /* commands that might be supported */ @@ -170,6 +170,7 @@ client_check_directory(char *data) void cvs_client_connect_to_server(void) { + struct cvs_var *vp; char *cmd, *argv[9], *resp; int ifd[2], ofd[2], argc; @@ -271,6 +272,10 @@ cvs_client_connect_to_server(void) cvs_client_send_request("Global_option -V"); cvs_client_send_request("UseUnchanged"); + + /* XXX: If 'Set' is supported? */ + TAILQ_FOREACH(vp, &cvs_variables, cv_link) + cvs_client_send_request("Set %s=%s", vp->cv_name, vp->cv_val); } void diff --git a/usr.bin/cvs/cvs.c b/usr.bin/cvs/cvs.c index b02d1e69e91..647ec69d11f 100644 --- a/usr.bin/cvs/cvs.c +++ b/usr.bin/cvs/cvs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cvs.c,v 1.108 2006/11/14 15:23:50 xsa Exp $ */ +/* $OpenBSD: cvs.c,v 1.109 2006/11/14 15:39:41 xsa Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> @@ -63,8 +63,6 @@ char *cvs_tmpdir = CVS_TMPDIR_DEFAULT; struct cvsroot *current_cvsroot = NULL; -static TAILQ_HEAD(, cvs_var) cvs_variables; - int cvs_getopt(int, char **); void usage(void); static void cvs_read_rcfile(void); diff --git a/usr.bin/cvs/cvs.h b/usr.bin/cvs/cvs.h index 84006b46133..14b8241437c 100644 --- a/usr.bin/cvs/cvs.h +++ b/usr.bin/cvs/cvs.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cvs.h,v 1.121 2006/11/14 09:49:52 xsa Exp $ */ +/* $OpenBSD: cvs.h,v 1.122 2006/11/14 15:39:41 xsa Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -175,6 +175,8 @@ struct cvs_var { TAILQ_ENTRY(cvs_var) cv_link; }; +TAILQ_HEAD(, cvs_var) cvs_variables; + #define CVS_ROOT_CONNECTED 0x01 struct cvsroot { diff --git a/usr.bin/cvs/remote.h b/usr.bin/cvs/remote.h index aaa1fb89e1d..eb89213fe4c 100644 --- a/usr.bin/cvs/remote.h +++ b/usr.bin/cvs/remote.h @@ -1,4 +1,4 @@ -/* $OpenBSD: remote.h,v 1.7 2006/11/14 09:59:54 xsa Exp $ */ +/* $OpenBSD: remote.h,v 1.8 2006/11/14 15:39:42 xsa Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -71,6 +71,7 @@ void cvs_server_unchanged(char *); void cvs_server_questionable(char *); void cvs_server_argument(char *); void cvs_server_argumentx(char *); +void cvs_server_set(char *); void cvs_server_add(char *); void cvs_server_admin(char *); diff --git a/usr.bin/cvs/server.c b/usr.bin/cvs/server.c index 3f31d88d776..d04fd5681d3 100644 --- a/usr.bin/cvs/server.c +++ b/usr.bin/cvs/server.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server.c,v 1.38 2006/11/14 14:45:31 xsa Exp $ */ +/* $OpenBSD: server.c,v 1.39 2006/11/14 15:39:42 xsa Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -239,6 +239,20 @@ cvs_server_globalopt(char *data) } void +cvs_server_set(char *data) +{ + char *ep; + + ep = strchr(data, '='); + if (ep == NULL) + fatal("no = in variable assignment"); + + *(ep++) = '\0'; + if (cvs_var_set(data, ep) < 0) + fatal("cvs_server_set: cvs_var_set failed"); +} + +void cvs_server_directory(char *data) { int l; |