Return-Path: doug@sonosphere.com X-Sender: doug@light.lightlink.com In-Reply-To: <199704180355.XAA27623@harvey.cyclic.com> References: <01BC4B6F.6B38F840@pc.ice.com> (message from Tim Endres on Thu, 17 Apr 1997 20:39:16 -0400) Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Fri, 18 Apr 1997 08:11:42 -0400 To: Jim Kingdon , info-cvs@prep.ai.mit.edu From: Doug Wyatt Subject: Re: CVS unix server and MAC client? At 23:55 -0400 4/17/97, Jim Kingdon wrote: > > 1) CVS command line client with Apple's MPW > > Is there such a thing? I haven't heard about it. The CVS 1.9 Mac > client is driven by AppleEvents (it also has a mode where it puts up a > window, you type in a cvs command, and then the program exits, but > without having tried it I would imagine that is probably useful mostly > for debugging). Matthias Neeracher, author of GUSI (a sockets interface for Mac), wrote an MPW tool version of CVS in December. It's in his FTP space ... a web search for GUSI will probably lead you there. It wasn't really clear to me how to use the MacCVS AppleEvent interface so I ended up hacking a tiny stupid shell so I could have environment variables. And use the same command-line interface that the manual uses. I also fixed a handful of bugs: 1) "release" with the '-d' option would fail. This is because GUSI's readdir() does not tolerate the file being deleted while the directory is being walked through; files get skipped and not deleted. I am a Unix neophyte so I don't know whether this is a reasonable solution or a horrible kludge, but a call to rewwinddir() at the end of the while() loop in deep_remove_dir solved it. 2) In rcmd(), in rcmd.c, the value of errno after connect() was being being destroyed by a call to close(). This would cause intermittent failures when connecting (more often than not, in my case .... how did it ever work? :) ) sin.sin_len = sizeof(struct sockaddr_in); sin.sin_family = hp->h_addrtype; sin.sin_port = rport; bcopy(hp->h_addr_list[0], &sin.sin_addr, hp->h_length); if (connect(s, (struct sockaddr *)&sin, sizeof(sin)) >= 0) break; { int oerrno = errno; // dsw added 4/97 (void)close(s); errno = oerrno; // dsw added 4/97 } if (errno == EADDRINUSE) { lport--; continue; } if (errno == ECONNREFUSED && timo <= 16) { ... 3) Another failure in "release" with the -d option was because macos_fixpath was unprepared to handle "..", which the "release" code and possibly other parts of the program pass to chdir(). char * macos_fixpath (const char *path) { char *sepCh; strcpy( scratchPath, ":" ); if( (*path == '.') && (*(path+1) == '/') ) strcat( scratchPath, path+2 ); else if (*path == '.' && path[1] == '.') { // dsw added handling of ".." 4/97 strcat( scratchPath, "::"); // so now it's ":::" // stupid, but later the code skips the // first ':' if (path[2] == '/') strcat(scratchPath, path + 3); } else if( strcmp(path, ".") != 0 ) strcat( scratchPath, path ); while( (sepCh = strchr(scratchPath, '/')) != NULL ) *sepCh = ':'; 4) The console output will be *much* *much* faster with the addition of the following lines in MacOS_Initialize(): //SIOUXSettings.showstatusline = TRUE; remove this line dsw 4/97 setvbuf(stdout, NULL, _IOLBF, 512); // line-mode buffering setvbuf(stderr, NULL, _IOLBF, 512); For some reason Matthias couldn't remember, GUSI sets the console to unbuffered output. Oops, sorry about all the C++ - style comments. Unfortunately, until my colleague John Cooper gets the NT CVS client working right with our server, we're still using RCS. It's weird, NT CVS works fine here where the only real difference is that my TCP connection is via Ethernet/ISDN instead of RAS. But maybe we'll just use jCVS once the Apple 1.1 Java VM comes out... Doug -- Doug Wyatt software development, Opcode Systems Inc. work: doug@opcode.com http://www.opcode.com/ personal: doug@sonosphere.com http://www.sonosphere.com/doug/ "Chaotic action is preferable to orderly inaction." - John Geirland