[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Eclipse-compatible :extssh: method...
From: |
Joseph P. Skudlarek |
Subject: |
Re: Eclipse-compatible :extssh: method... |
Date: |
Thu, 10 Nov 2005 07:49:25 -0800 |
User-agent: |
Mozilla Thunderbird 1.0.2 (X11/20050317) |
(1) Eclipse now offers improved interoperability -- one can specify
:ext: for the repository, and then via
Window->Preferences|>Team|>CVS|>Ext Connection
have Eclipse process CVS requests with an external program
(specifing CVS_RSH, parameters, and CVS_SERVER) or have :ext: in the
CVS file map to :extssh: processing withing Eclipse.
(2) For those who still have or use :extssh: with their files and want
to interoperate with command line CVS, attached is an update of the
earlier patch, now against cvs-1.11.17-8.RHEL4.src.rpm. It also
fixes a bug -- the mapping table from enums to names was not
expanded when extssh was introduced. No, this patch does not have
documentation or testcases, so I don't expect it to be committed.
/Jskud
--- cvs-1.11.17/src/client.c.orig 2004-04-26 07:57:53.000000000 -0700
+++ cvs-1.11.17/src/client.c 2005-11-07 03:54:06.000000000 -0800
@@ -3541,7 +3541,7 @@
}
#ifndef NO_EXT_METHOD
-static void start_rsh_server PROTO((cvsroot_t *, struct buffer **, struct
buffer **));
+static void start_rsh_server PROTO((cvsroot_t *, struct buffer **, struct
buffer **, char *));
#endif
int
@@ -4332,7 +4332,16 @@
error (0, 0, ":ext: method not supported by this port of CVS");
error (1, 0, "try :server: instead");
#else /* ! NO_EXT_METHOD */
- start_rsh_server (current_parsed_root, &to_server, &from_server);
+ start_rsh_server (current_parsed_root, &to_server, &from_server,
"rsh");
+#endif
+ break;
+
+ case extssh_method:
+#if defined (NO_EXT_METHOD)
+ error (0, 0, ":extssh: method not supported by this port of CVS");
+ error (1, 0, "try :server: instead");
+#else
+ start_rsh_server (current_parsed_root, &to_server, &from_server,
"ssh");
#endif /* NO_EXT_METHOD */
break;
@@ -4693,10 +4702,11 @@
up and running, and that's most important. */
static void
-start_rsh_server (root, to_server, from_server)
+start_rsh_server (root, to_server, from_server, cvs_rsh)
cvsroot_t *root;
struct buffer **to_server;
struct buffer **from_server;
+ char *cvs_rsh;
{
int pipes[2];
int child_pid;
@@ -4704,7 +4714,9 @@
/* If you're working through firewalls, you can set the
CVS_RSH environment variable to a script which uses rsh to
invoke another rsh on a proxy machine. */
- char *cvs_rsh = getenv ("CVS_RSH");
+
+ char *override = getenv (!strcmp(cvs_rsh, "ssh") ? "CVS_SSH" : "CVS_RSH");
+ if (override) cvs_rsh = override;
char *cvs_server = getenv ("CVS_SERVER");
int i = 0;
/* This needs to fit "rsh", "-b", "-l", "USER", "host",
@@ -4778,15 +4790,17 @@
# else /* ! START_RSH_WITH_POPEN_RW */
static void
-start_rsh_server (root, to_server, from_server)
+start_rsh_server (root, to_server, from_server, cvs_rsh)
cvsroot_t *root;
struct buffer **to_server;
struct buffer **from_server;
+ char *cvs_rsh;
{
/* If you're working through firewalls, you can set the
CVS_RSH environment variable to a script which uses rsh to
invoke another rsh on a proxy machine. */
- char *cvs_rsh = getenv ("CVS_RSH");
+ char *override = getenv (!strcmp(cvs_rsh, "ssh") ? "CVS_SSH" : "CVS_RSH");
+ if (override) cvs_rsh = override;
char *cvs_server = getenv ("CVS_SERVER");
char *command;
int tofd, fromfd;
--- cvs-1.11.17/src/root.c.orig 2004-04-07 13:21:20.000000000 -0700
+++ cvs-1.11.17/src/root.c 2005-11-07 04:06:10.000000000 -0800
@@ -14,11 +14,18 @@
#include "getline.h"
/* Printable names for things in the current_parsed_root->method enum variable.
- Watch out if the enum is changed in cvs.h! */
+ Watch out if the enum is changed in root.h! */
const char method_names[][16] = {
- "undefined", "local", "server (rsh)", "pserver",
- "kserver", "gserver", "ext", "fork"
+ "undefined",
+ "local",
+ "server (rsh)",
+ "pserver",
+ "kserver",
+ "gserver",
+ "ext",
+ "extssh",
+ "fork"
};
#ifndef DEBUG
@@ -439,6 +446,8 @@
newroot->method = server_method;
else if (strcmp (method, "ext") == 0)
newroot->method = ext_method;
+ else if (strcmp (method, "extssh") == 0)
+ newroot->method = extssh_method;
else if (strcmp (method, "fork") == 0)
newroot->method = fork_method;
else
@@ -671,6 +680,7 @@
# endif
case server_method:
case ext_method:
+ case extssh_method:
no_port = 1;
/* no_password already set */
check_hostname = 1;
--- cvs-1.11.17/src/root.h.orig 2004-04-06 13:20:55.000000000 -0700
+++ cvs-1.11.17/src/root.h 2005-11-07 03:54:06.000000000 -0800
@@ -18,6 +18,7 @@
kserver_method,
gserver_method,
ext_method,
+ extssh_method,
fork_method
} CVSmethod;
extern const char method_names[][16]; /* change this in root.c if you change