summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Francois Brousseau <jfb@cvs.openbsd.org>2004-08-12 20:09:59 +0000
committerJean-Francois Brousseau <jfb@cvs.openbsd.org>2004-08-12 20:09:59 +0000
commita22208a44f1090b1a49521cd1fc4e0a994442b49 (patch)
tree6893b023feaf07b19de4883c9ba0a23e617666a7
parent6b1a4d416f46a03b685b330c7f7084e1bb451a80 (diff)
Make `init' work in client mode
-rw-r--r--usr.bin/cvs/init.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/usr.bin/cvs/init.c b/usr.bin/cvs/init.c
index f36e7951a6b..c104b2f0cdd 100644
--- a/usr.bin/cvs/init.c
+++ b/usr.bin/cvs/init.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: init.c,v 1.5 2004/08/06 14:09:24 jfb Exp $ */
+/* $OpenBSD: init.c,v 1.6 2004/08/12 20:09:58 jfb Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -38,6 +38,7 @@
#include "cvs.h"
#include "rcs.h"
#include "log.h"
+#include "proto.h"
#define CFT_FILE 1
@@ -88,6 +89,16 @@ cvs_init(int argc, char **argv)
return (EX_USAGE);
root = cvsroot_get(".");
+ if (root->cr_method != CVS_METHOD_LOCAL) {
+ if (cvs_connect(root) < 0)
+ return (EX_DATAERR);
+
+ if (cvs_sendreq(root, CVS_REQ_INIT, root->cr_dir) < 0)
+ return (EX_DATAERR);
+
+ cvs_disconnect(root);
+ return (0);
+ }
for (i = 0; i < sizeof(cvsroot_files)/sizeof(cvsroot_files[i]); i++) {
snprintf(path, sizeof(path), "%s/%s", root->cr_dir,