[Haven't taken too much of a look at this. Doesn't look like the changes from vanilla 1.9.26 are all that large. -kingdon] To: bug-cvs@gnu.org Subject: Rhapsody patches, take II Date: Fri, 10 Apr 98 16:41:58 -0700 From: Wilfredo Sanchez I finally got around to upgrading my sources to 1.9.26. Here are my diffs again, based on that version. This is what I've done to get CVS to build on Rhapsody using kerberos5's kerberos4 compatibility libraries. Using kerberos5 API's is probably a better thing to do, but I'm not that clueful. Also pulled in Bill Bumgarner's wrapper code, which I did alot of cleanup on. It's not perfect, but it's a significant improvement on the current wrapper functionality when using client/server, and the hope is that we can iron out what's left over time. -Fred Apple Computer Rhapsody Core OS wsanchez@apple.com ---------------- Index: CoreOS/Versioning/cvs/cvs/ChangeLog diff -u CoreOS/Versioning/cvs/cvs/ChangeLog:1.1.1.6 CoreOS/Versioning/cvs/cvs/ChangeLog:1.7 --- CoreOS/Versioning/cvs/cvs/ChangeLog:1.1.1.6 Mon Apr 6 22:02:57 1998 +++ CoreOS/Versioning/cvs/cvs/ChangeLog Mon Apr 6 23:25:35 1998 @@ -14,6 +14,21 @@ * TODO (190): Remove "failed to check out" from commit.c from lists of error messages suppressed by -q; it no longer is. +Wed Feb 11 23:32:45 PST 1998 Wilfredo Sanchez + + * INSTALL: Add Apple Rhapsody to platforms list. + + * Makefile.in: Change bindir, etc. to get values from configure + (eg. @bindir@) instead of figure it out inthe Makefile. + + * configure.in: Change autoconf prereq to 2.10. + + * configure.in: Add path check for patch and tar. + + * configure.in: Modify kerberos checks for possible locations in + Rhapsody. Make krb5's krb4 compatibility libs work in place of krb4. + Fix --with-encryption usage message to say --enable-encryption. + 4 Feb 1998 Jim Kingdon * cvsnt.mak: The usual "because Visual C++ feels like it" Index: CoreOS/Versioning/cvs/cvs/INSTALL diff -u CoreOS/Versioning/cvs/cvs/INSTALL:1.1.1.6 CoreOS/Versioning/cvs/cvs/INSTALL:1.6 --- CoreOS/Versioning/cvs/cvs/INSTALL:1.1.1.6 Mon Apr 6 22:02:52 1998 +++ CoreOS/Versioning/cvs/cvs/INSTALL Tue Apr 7 00:13:29 1998 @@ -132,6 +132,8 @@ BSDI 2.0 (1.4.93) (footnote 5) FreeBSD 2.1.5-stable (1.8.87) NextSTEP 3.3 (1.7) + OpenStep 4.2 (1.8.1) + Apple Rhapsody 5.1 (1.9.26) SCO Unix 3.2.4.2, gcc 2.7.2 (1.8.87) (footnote 4) SCO OpenServer 5 (1.8.86) Sequent Dynix/PTX 4.1.4 (1.9.20 or so + patches) @@ -162,6 +164,7 @@ SGI running Irix-6.2 (1.9.8) Siemens-Nixdorf RM600 running SINIX-Y (1.6) PowerPC or RS/6000: + Apple Rhapsody 5.1 (1.9.26) IBM RS/6000 running AIX 3.1 using gcc and cc (1.6.86) IBM RS/6000 running AIX 3.2.5 (1.8) IBM RS/6000 running AIX 4.1 using gcc and cc (about 1.4A2) (footnote 1) Index: CoreOS/Versioning/cvs/cvs/Makefile.in diff -u CoreOS/Versioning/cvs/cvs/Makefile.in:1.1.1.4 CoreOS/Versioning/cvs/cvs/Makefile.in:1.7 --- CoreOS/Versioning/cvs/cvs/Makefile.in:1.1.1.4 Mon Apr 6 22:03:03 1998 +++ CoreOS/Versioning/cvs/cvs/Makefile.in Mon Apr 6 23:24:05 1998 @@ -50,16 +50,16 @@ exec_prefix = @exec_prefix@ # Where to install the executables. -bindir = $(exec_prefix)/bin +bindir = @bindir@ # Where to put the system-wide .cvsrc file -libdir = $(prefix)/lib +libdir = @libdir@ # Where to put the Info files -infodir = $(prefix)/info +infodir = @infodir@ # Where to put the manual pages. -mandir = $(prefix)/man +mandir = @mandir@ #### End of system configuration section. #### @@ -104,7 +104,7 @@ # Set default target. all: -.PHONY: all install uninstall installdirs +.PHONY: all install install-strip uninstall installdirs all install uninstall installdirs: config.h Makefile all-local @for subdir in $(SUBDIRS); do \ echo "making $@ in $$subdir"; \ @@ -113,13 +113,16 @@ installdirs: installdirs-local -install: all install-local install-info +install: all install-local install-info #install-html +install-strip: + $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install + .PHONY: all-local all-local: -.PHONY: info dvi clean-info install-info -info dvi clean-info install-info: +.PHONY: info dvi clean-info install-info install-html +info dvi clean-info install-info install-html: cd doc && $(MAKE) $(FLAGS_TO_PASS) $@ || exit 1 .PHONY: install-local Index: CoreOS/Versioning/cvs/cvs/configure.in diff -u CoreOS/Versioning/cvs/cvs/configure.in:1.1.1.5 CoreOS/Versioning/cvs/cvs/configure.in:1.7 --- CoreOS/Versioning/cvs/cvs/configure.in:1.1.1.5 Mon Apr 6 22:03:00 1998 +++ CoreOS/Versioning/cvs/cvs/configure.in Tue Apr 7 00:13:30 1998 @@ -1,17 +1,10 @@ dnl configure.in for cvs AC_INIT(src/cvs.h) dnl -AC_PREREQ(2.4)dnl Required Autoconf version. +AC_PREREQ(2.10)dnl Required Autoconf version. dnl Do not use autoconf 2.12; it produces a configure script which produces dnl a "internal 2K buffer" error on HPUX when run with /bin/sh. dnl autoconf 2.10 seems like a good choice. -dnl -dnl It is possible that we should just change the above required version -dnl to 2.10; it seems like everyone is using 2.10 anyway, and there is -dnl at least some sentiment that we should be using a version which has -dnl --bindir (and correspondingly, using @bindir@ and friends in our -dnl Makefile.in files. Rumor has it that autoconf 2.7 -dnl introduced --bindir but the point is that 2.10 has it. AC_CONFIG_HEADER(config.h src/options.h) AC_PROG_CC @@ -41,6 +34,12 @@ AC_PATH_PROG(perl_path, perl, no) AC_PATH_PROG(csh_path, csh, no) +AC_PATH_PROG(patch, patch, patch) +AC_DEFINE_UNQUOTED(PATCH_PROGRAM, "${patch}") + +AC_PATH_PROGS(tar, gnutar gtar tar, tar) +AC_DEFINE_UNQUOTED(TAR_PROGRAM, "${tar}") + AC_SYS_INTERPRETER if test X"$ac_cv_sys_interpreter" != X"yes" ; then # silly trick to avoid problems in AC macros... @@ -187,6 +186,8 @@ dnl override the system -lkrb. dnl KRB4=/usr/kerberos +KRB4INCLUDE=$KRB4/include +KRB4LIB=$KRB4/lib define(WITH_KRB4,[ AC_ARG_WITH([krb4], [ --with-krb4=value set default \$(KRB4) from value], @@ -200,12 +201,12 @@ AC_MSG_CHECKING([for krb.h]) if test "$cross_compiling" != yes && test -r $KRB4/include/krb.h; then hold_cflags=$CFLAGS - CFLAGS="$CFLAGS -I$KRB4/include" + CFLAGS="$CFLAGS -I$KRB4INCLUDE" AC_TRY_LINK([#include ],[int i;], - [krb_h=yes krb_incdir=$KRB4/include], - [CFLAGS=$hold_cflags - AC_TRY_LINK([#include ],[int i;], - [krb_h=yes krb_incdir=])]) + [krb_h=yes krb_incdir=$KRB4INCLUDE], + [CFLAGS=$hold_cflags + AC_TRY_LINK([#include ],[int i;], + [krb_h=yes krb_incdir=])) CFLAGS=$hold_cflags else AC_TRY_LINK([#include ],[int i;], @@ -214,48 +215,79 @@ if test -z "$krb_h"; then AC_TRY_LINK([#include ],[int i;], [krb_h=yes krb_incdir=], - [if test "$cross_compiling" != yes && test -r $KRB4/include/kerberosIV/krb.h; then + [if test "$cross_compiling" != yes && test -r $KRB4INCLUDE/kerberosIV/krb.h; then hold_cflags=$CFLAGS - CFLAGS="$CFLAGS -I$KRB4/include/kerberosIV" + CFLAGS="$CFLAGS -I$KRB4INCLUDE/kerberosIV -I$KRB4INCLUDE/kerberosIV/.." AC_TRY_LINK([#include ],[int i;], - [krb_h=yes krb_incdir=$KRB4/include/kerberosIV]) + [krb_h=yes krb_incdir=$KRB4INCLUDE/kerberosIV]) CFLAGS=$hold_cflags fi]) fi +dnl For Apple Rhapsody... +for LIBROOT in Local Network System; do + if test -z "$krb_h"; then + KRBFRAMEWORK=/$LIBROOT/Library/Frameworks/Kerberos.framework + AC_TRY_LINK([#include ],[int i;], + [krb_h=yes krb_incdir=], + [if test "$cross_compiling" != yes && test -r $KRBFRAMEWORK/Headers/kerberosIV/krb.h; then + hold_cflags=$CFLAGS + CFLAGS="$CFLAGS -I$KRBFRAMEWORK/Headers/kerberosIV -I$KRBFRAMEWORK/Headers/kerberosIV/.." + AC_TRY_LINK([#include ],[int i;], + [krb_h=yes krb_incdir=$KRBFRAMEWORK/Headers/kerberosIV]) + CFLAGS=$hold_cflags + fi]) + fi +done AC_MSG_RESULT($krb_h) includeopt= AC_SUBST(includeopt) if test -n "$krb_h"; then krb_lib= - if test "$cross_compiling" != yes && test -r $KRB4/lib/libkrb.a; then + if test "$cross_compiling" != yes && test -r $KRB4LIB/libkrb.a; then + hold_ldflags=$LDFLAGS + LDFLAGS="-L${KRB4LIB} $LDFLAGS" + AC_CHECK_LIB(krb,printf,[krb_lib=krb krb_libdir=${KRB4}/lib], + [LDFLAGS=$hold_ldflags + # Using open here instead of printf so we don't + # get confused by the cached value for printf from above. + AC_CHECK_LIB(krb,open,[krb_lib=krb krb_libdir=])]) + LDFLAGS=$hold_ldflags + elif test "$cross_compiling" != yes && test -r $KRB4LIB/libkrb4.a; then hold_ldflags=$LDFLAGS - LDFLAGS="-L${KRB4}/lib $LDFLAGS" - AC_CHECK_LIB(krb,printf,[krb_lib=yes krb_libdir=${KRB4}/lib], + LDFLAGS="-L${KRB4LIB} $LDFLAGS" + AC_CHECK_LIB(krb4,printf,[krb_lib=krb4 krb_libdir=${KRB4}/lib], [LDFLAGS=$hold_ldflags # Using open here instead of printf so we don't # get confused by the cached value for printf from above. - AC_CHECK_LIB(krb,open,[krb_lib=yes krb_libdir=])]) + AC_CHECK_LIB(krb4,open,[krb_lib=krb4 krb_libdir=])]) LDFLAGS=$hold_ldflags else - AC_CHECK_LIB(krb,printf,[krb_lib=yes krb_libdir=]) + AC_CHECK_LIB(krb,printf,[krb_lib=krb krb_libdir=], + AC_CHECK_LIB(krb4,printf,[krb_lib=krb4 krb_libdir=])) fi if test -n "$krb_lib"; then AC_DEFINE(HAVE_KERBEROS) test -n "${krb_libdir}" && LIBS="${LIBS} -L${krb_libdir}" - LIBS="${LIBS} -lkrb" + LIBS="${LIBS} -l${krb_lib}" # Put -L${krb_libdir} in LDFLAGS temporarily so that it appears before # -ldes in the command line. Don't do it permanently so that we honor # the user's setting for LDFLAGS hold_ldflags=$LDFLAGS test -n "${krb_libdir}" && LDFLAGS="$LDFLAGS -L${krb_libdir}" AC_CHECK_LIB(des,printf,[LIBS="${LIBS} -ldes"]) + AC_CHECK_LIB(des425,printf,[LIBS="${LIBS} -ldes425"]) + AC_CHECK_LIB(com_err,printf,[LIBS="${LIBS} -lkrb524"]) + AC_CHECK_LIB(krb5,printf,[LIBS="${LIBS} -lkrb5"]) + AC_CHECK_LIB(crypto,printf,[LIBS="${LIBS} -lcrypto"]) + AC_CHECK_LIB(com_err,printf,[LIBS="${LIBS} -lcom_err"]) LDFLAGS=$hold_ldflags if test -n "$krb_incdir"; then - includeopt="${includeopt} -I$krb_incdir" + includeopt="${includeopt} -I$krb_incdir -I$krb_incdir/.." fi fi fi + AC_CHECK_FUNCS(krb_get_err_text) dnl @@ -284,7 +316,7 @@ CPPFLAGS=$hold_cppflags dnl -dnl Use --with-encryption to turn on encryption support +dnl Use --enable-encryption to turn on encryption support dnl AC_ARG_ENABLE(encryption, [ --enable-encryption enable encryption support], Index: CoreOS/Versioning/cvs/cvs/doc/ChangeLog diff -u CoreOS/Versioning/cvs/cvs/doc/ChangeLog:1.1.1.6 CoreOS/Versioning/cvs/cvs/doc/ChangeLog:1.7 --- CoreOS/Versioning/cvs/cvs/doc/ChangeLog:1.1.1.6 Mon Apr 6 22:04:41 1998 +++ CoreOS/Versioning/cvs/cvs/doc/ChangeLog Mon Apr 6 23:25:37 1998 @@ -16,6 +16,12 @@ * cvs.texinfo (user-defined logging): Add taginfo example. +Wed Feb 11 23:32:45 PST 1998 Wilfredo Sanchez + + * Makefile.in: Set infodir to get value from configure (@infodir@). + + * Makefile.in: Add html target using texi2html. + 1998-02-04 Tim Pierce * cvs.texinfo (config): PreservePermissions variable. Index: CoreOS/Versioning/cvs/cvs/doc/Makefile.in diff -u CoreOS/Versioning/cvs/cvs/doc/Makefile.in:1.1.1.3 CoreOS/Versioning/cvs/cvs/doc/Makefile.in:1.8 --- CoreOS/Versioning/cvs/cvs/doc/Makefile.in:1.1.1.3 Wed Nov 19 18:51:47 1997 +++ CoreOS/Versioning/cvs/cvs/doc/Makefile.in Tue Apr 7 00:13:33 1998 @@ -21,8 +21,11 @@ prefix = @prefix@ exec_prefix = @exec_prefix@ -infodir = $(prefix)/info +infodir = @infodir@ +htmldir = $(prefix)/share/html/cvs +TEXI2HTML = $(srcdir)/texi2html + INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -68,6 +71,8 @@ info: cvs.info cvsclient.info +html: cvs.html cvsclient.html + cvs.info: cvs.texinfo CVSvn.texi if [ ! -f ./CVSvn.texi ]; then \ ln -s $(srcdir)/CVSvn.texi . || \ @@ -82,6 +87,12 @@ cp $(srcdir)/CVSvn.texi . ; else true; fi $(MAKEINFO) $(srcdir)/cvsclient.texi -o cvsclient.info +cvs.html: cvs.texinfo + $(TEXI2HTML) -menu -number -split_node cvs.texinfo + +cvsclient.html: cvsclient.texi + $(TEXI2HTML) -menu -number -split_node cvsclient.texi + # Version of the protocol suitable for emailing cvsclient.txt: cvsclient.texi CVSvn.texi if [ ! -f ./CVSvn.texi ]; then \ @@ -96,15 +107,19 @@ # in the build dir. # (Note: don't solve this problem with "cd"; INSTALL_DATA might be a # relative path to install-sh). -install-info: info installdirs +install-info: info + $(SHELL) $(top_srcdir)/mkinstalldirs $(infodir) if test -f cvs.info ; then docdir=.; else docdir=$(srcdir);fi; \ for i in $$docdir/*.info* ; do \ $(INSTALL_DATA) $$i $(infodir)/`basename $$i` ; \ done -installdirs: - $(SHELL) $(top_srcdir)/mkinstalldirs $(infodir) -.PHONY: installdirs +install-html: html + $(SHELL) $(top_srcdir)/mkinstalldirs $(htmldir) + if test -f cvs_1.html ; then docdir=.; else docdir=$(srcdir);fi; \ + for i in $$docdir/*.html ; do \ + $(INSTALL_DATA) $$i $(htmldir)/`basename $$i` ; \ + done dvi: cvs.dvi cvsclient.dvi Index: CoreOS/Versioning/cvs/cvs/src/ChangeLog diff -u CoreOS/Versioning/cvs/cvs/src/ChangeLog:1.1.1.6 CoreOS/Versioning/cvs/cvs/src/ChangeLog:1.7 --- CoreOS/Versioning/cvs/cvs/src/ChangeLog:1.1.1.6 Mon Apr 6 22:03:28 1998 +++ CoreOS/Versioning/cvs/cvs/src/ChangeLog Tue Apr 7 00:13:38 1998 @@ -364,6 +364,47 @@ * server.c (cvs_output_binary): Use OPEN_BINARY not _O_BINARY. +Wed Feb 11 23:32:45 PST 1998 Wilfredo Sanchez + + * Makefile.in: Change bindir, etc. to get values from configure + (eg. @bindir@) instead of figure it out inthe Makefile. + + * Makefile.in: Add TAR = @tar@ + + * Makefile.in: Change $(INSTALL) to $(INSTALL_PROGRAM) in install: + target to get proper mode bits. + + * client.c: Added b.bum's client/server wrapper code, and then + did come cleanup on it. The code is not 100% there yet, but it's a + good start, and I think we're not doing anything bogus like hardcoding + paths, etc. Note that in the actual transfer code, it's wrapped with + noexec=0 (and reverts afterwards) so that the tar to allow cvs -nq update + to pass the tar file back and forth for comparison. I think some minor + tweaking can get this functionality to be happy for once. + + * cvs.h: add define for CVSWRAPPERTMP. + + * options.h.in: add #define WRAPPERS_USE_TAR_FOR_TRANSFER + + * options.h.in: add define for TAR_PROGRAM. + + * rcs.c: variable "lockfile" was being referenced after being free'd. Bad. + Moved the free() call down. + + * server.c: Added b.bum's client/server wrapper code, and then did come + cleanup as above with client.c. + + * server.h: Moved server_active outside of #ifdef SERVER_SUPPORT because + it is used outside of SERVER_SUPPORT in server.c. + + * update.c: Added patch from "unofficial patches" which fixes a bug whereby + after adding a new file to a branch, commits go to the main branch, not the + branch you added to. Patch was slightly modified to deal with change in + ParseTag(). + + * wrapper.c: Added b.bum's client/server wrapper code, and then did come + cleanup as above with client.c. + Mon Feb 9 18:34:39 1998 Jim Kingdon Tweaks to Ian's checkin: Index: CoreOS/Versioning/cvs/cvs/src/Makefile.in diff -u CoreOS/Versioning/cvs/cvs/src/Makefile.in:1.1.1.4 CoreOS/Versioning/cvs/cvs/src/Makefile.in:1.6 --- CoreOS/Versioning/cvs/cvs/src/Makefile.in:1.1.1.4 Mon Apr 6 22:03:26 1998 +++ CoreOS/Versioning/cvs/cvs/src/Makefile.in Mon Apr 6 23:24:16 1998 @@ -22,19 +22,22 @@ exec_prefix = @exec_prefix@ # Where to install the executables. -bindir = $(exec_prefix)/bin +bindir = @bindir@ # Where to put the system-wide .cvsrc file -libdir = $(prefix)/lib +libdir = @libdir@ # Where to put the manual pages. -mandir = $(prefix)/man +mandir = @mandir # Use cp if you don't have install. INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ +# Path to tar +TAR = @tar@ + LIBS = @LIBS@ SOURCES = add.c admin.c buffer.c checkin.c checkout.c classify.c client.c \ @@ -88,7 +91,7 @@ install: installdirs @for prog in $(PROGS); do \ echo Installing $$prog in $(bindir); \ - $(INSTALL) $$prog $(bindir)/$$prog ; \ + $(INSTALL_PROGRAM) $$prog $(bindir)/$$prog ; \ done installdirs: Index: CoreOS/Versioning/cvs/cvs/src/client.c diff -u CoreOS/Versioning/cvs/cvs/src/client.c:1.1.1.6 CoreOS/Versioning/cvs/cvs/src/client.c:1.7 --- CoreOS/Versioning/cvs/cvs/src/client.c:1.1.1.6 Mon Apr 6 22:03:52 1998 +++ CoreOS/Versioning/cvs/cvs/src/client.c Tue Apr 7 00:13:40 1998 @@ -1458,6 +1458,10 @@ char *scratch_entries = NULL; int bin; +#ifdef WRAPPERS_USE_TAR_FOR_TRANSFER + int tarred = 0; +#endif /* WRAPPERS_USE_TAR_FOR_TRANSFER */ + #ifdef UTIME_EXPECTS_WRITABLE int change_it_back = 0; #endif @@ -1515,12 +1519,24 @@ read_line (&mode_string); +read_line: read_line (&size_string); if (size_string[0] == 'z') { use_gzip = 1; size = atoi (size_string+1); } +#ifdef WRAPPERS_USE_TAR_FOR_TRANSFER + else if (size_string[0] == 'E') { + goto read_line; + } + else if (size_string[0] == 'T') + { + use_gzip = 0; + tarred = 1; + size = atoi (size_string+1); + } +#endif /* WRAPPERS_USE_TAR_FOR_TRANSFER */ else { use_gzip = 0; @@ -1712,7 +1728,49 @@ if (data->contents == UPDATE_ENTRIES_UPDATE) { +#ifdef WRAPPERS_USE_TAR_FOR_TRANSFER + if (tarred) { + char *tardir = CVSWRAPPERTMP; + char untarred_file[PATH_MAX]; + int retcode; + + int global_noexec = noexec; + + /* This is a hack to work around the fact that noexec is used + in places that I can't override. (eg. make_directory). When + the -n global flag is used in cvs, this stuff still needs to + happen, so let's override the flag temporarily. */ + noexec = 0; + + if (isdir(tardir)) + unlink_file_dir(tardir); + + make_directory(tardir); + + run_setup (TAR_PROGRAM); + run_arg ("-xf"); + run_arg (temp_filename); + run_arg ("-C"); + run_arg (tardir); + retcode = run_exec (DEVNULL, RUN_TTY, RUN_TTY, RUN_REALLY); + + strcpy(untarred_file, tardir); + strcat(untarred_file, "/"); + strcat(untarred_file, filename); + + unlink_file_dir(filename); /* remove existing directory */ + rename_file(untarred_file, filename); + unlink_file_dir(temp_filename); /* get rid of tarfile */ + unlink_file_dir(tardir); /* ... and output file */ + + /* Return to status quo. */ + noexec = global_noexec; + } else { +#endif /* WRAPPERS_USE_TAR_FOR_TRANSFER */ rename_file (temp_filename, filename); +#ifdef WRAPPERS_USE_TAR_FOR_TRANSFER + } +#endif /* WRAPPERS_USE_TAR_FOR_TRANSFER */ } else if (data->contents == UPDATE_ENTRIES_PATCH) { @@ -1944,6 +2002,21 @@ change_mode (filename, stored_mode, 1); stored_mode_valid = 0; +#ifdef WRAPPERS_USE_TAR_FOR_TRANSFER +#warning This is bogus. +/* 1) this variable will not be set unless the 'if (data->contents == + * UPDATE_ENTRIES_UPDATE || data->contents == UPDATE_ENTRIES_PATCH || + * data->contents == UPDATE_ENTRIES_RCS_DIFF)' evaluate to true and + * executes... + * + * 2) if tarred is set, then utime() is never executed... how does + * this affect the operation of cvs? + * + * 3) what else does this break? + */ + + if (!tarred) { +#endif if (stored_modtime_valid) { struct utimbuf t; @@ -1974,6 +2047,9 @@ stored_modtime_valid = 0; } +#ifdef WRAPPERS_USE_TAR_FOR_TRANSFER + } +#endif /* * Process the entries line. Do this after we've written the file, @@ -4585,6 +4661,76 @@ error (1, errno, "reading %s", short_pathname); mode_string = mode_to_string (sb.st_mode); + +#ifdef WRAPPERS_USE_TAR_FOR_TRANSFER + if ((sb.st_mode & S_IFMT) & S_IFDIR) { + /* file is a directory; send it over as a tarfile... */ + char *tarfile = CVSWRAPPERTMP; + struct stat tarfile_sb; + int retcode; + int newsize; + char *bufp; + int len; + char tmp[80]; + + int global_noexec = noexec; + + /* This is a hack to work around the fact that noexec is used + in places that I can't override. (eg. make_directory). When + the -n global flag is used in cvs, this stuff still needs to + happen, so let's override the flag temporarily. */ + noexec = 0; + + if (isfile(tarfile)) + unlink_file(tarfile); + + run_setup (TAR_PROGRAM); + run_arg ("-cf"); + run_arg (tarfile); + run_arg (file); + retcode = run_exec (DEVNULL, RUN_TTY, RUN_TTY, RUN_REALLY); + + if (stat(tarfile, &tarfile_sb) < 0) { + error(1, errno, "stat failed for %s", tarfile); + } + bufsize = tarfile_sb.st_size; + buf = xmalloc (bufsize); + + fd = open (tarfile, (O_RDONLY | OPEN_BINARY) ); + if (fd < 0) + error (1, errno, "openning %s", tarfile); + + bufp = buf; + while ((len = read (fd, bufp, (buf + bufsize) - bufp)) > 0) + bufp += len; + + if (len < 0) + error (1, errno, "reading %s", tarfile); + + newsize = bufp - buf; + (void)close(fd); + unlink_file(tarfile); + + send_to_server ("Modified ", 0); + send_to_server (file, 0); + send_to_server ("\012", 1); + send_to_server (mode_string, 0); + send_to_server ("\012T", 2); /* 'T' flag indicates a tarfile */ + sprintf (tmp, "%lu\012", (unsigned long) newsize); + send_to_server (tmp, 0); + + if (newsize > 0) + send_to_server (buf, newsize); + + free (buf); + free (mode_string); + + /* Return to status quo. */ + noexec = global_noexec; + + return; + } +#endif /* WRAPPERS_USE_TAR_FOR_TRANSFER */ /* Beware: on systems using CRLF line termination conventions, the read and write functions will convert CRLF to LF, so the Index: CoreOS/Versioning/cvs/cvs/src/commit.c diff -u CoreOS/Versioning/cvs/cvs/src/commit.c:1.1.1.5 CoreOS/Versioning/cvs/cvs/src/commit.c:1.5 --- CoreOS/Versioning/cvs/cvs/src/commit.c:1.1.1.5 Mon Apr 6 22:03:54 1998 +++ CoreOS/Versioning/cvs/cvs/src/commit.c Mon Apr 6 23:24:20 1998 @@ -440,6 +440,8 @@ message[n] = '\0'; } + wrap_setup (); + #ifdef CLIENT_SUPPORT if (client_active) { @@ -616,8 +618,6 @@ /* XXX - this is not the perfect check for this */ if (argc <= 0) write_dirtag = tag; - - wrap_setup (); lock_tree_for_write (argc, argv, local, aflag); Index: CoreOS/Versioning/cvs/cvs/src/cvs.h diff -u CoreOS/Versioning/cvs/cvs/src/cvs.h:1.1.1.6 CoreOS/Versioning/cvs/cvs/src/cvs.h:1.3 --- CoreOS/Versioning/cvs/cvs/src/cvs.h:1.1.1.6 Mon Apr 6 22:03:36 1998 +++ CoreOS/Versioning/cvs/cvs/src/cvs.h Mon Apr 6 23:24:21 1998 @@ -207,6 +207,9 @@ #define CVSPREFIX ",," #define CVSDOTIGNORE ".cvsignore" #define CVSDOTWRAPPER ".cvswrappers" +#ifdef WRAPPERS_USE_TAR_FOR_TRANSFER +#define CVSWRAPPERTMP "#cvs.wrap-tmp" +#endif /* Command attributes -- see function lookup_command_attribute(). */ #define CVS_CMD_IGNORE_ADMROOT 1 Index: CoreOS/Versioning/cvs/cvs/src/options.h.in diff -u CoreOS/Versioning/cvs/cvs/src/options.h.in:1.1.1.4 CoreOS/Versioning/cvs/cvs/src/options.h.in:1.4 --- CoreOS/Versioning/cvs/cvs/src/options.h.in:1.1.1.4 Tue Jan 6 10:16:44 1998 +++ CoreOS/Versioning/cvs/cvs/src/options.h.in Thu Jan 8 19:26:49 1998 @@ -191,6 +191,21 @@ #define SERVER_HI_WATER (2 * 1024 * 1024) #define SERVER_LO_WATER (1 * 1024 * 1024) +/* When defined, the client/server code will use tar to wrap and transfer + * any directory that is marked as needing to be wrapped ('.nib' files, + * for example). + */ +#define WRAPPERS_USE_TAR_FOR_TRANSFER + +/* + * The "tar" program to run when using the CVS server and accepting + * tar files across the network. Specify a full pathname if your site + * wants to use a particular tar. + */ +#ifndef TAR_PROGRAM +#define TAR_PROGRAM "tar" +#endif + /* End of CVS configuration section */ /* Index: CoreOS/Versioning/cvs/cvs/src/rcs.c diff -u CoreOS/Versioning/cvs/cvs/src/rcs.c:1.1.1.5 CoreOS/Versioning/cvs/cvs/src/rcs.c:1.3 --- CoreOS/Versioning/cvs/cvs/src/rcs.c:1.1.1.5 Mon Apr 6 22:04:19 1998 +++ CoreOS/Versioning/cvs/cvs/src/rcs.c Mon Apr 6 23:24:24 1998 @@ -7524,8 +7524,6 @@ error (1, errno, "could not open lock file `%s'", lockfile); } - free (lockfile); - /* Force the file permissions, and return a stream object. */ /* Because we change the modes later, we don't worry about this in the non-HAVE_FCHMOD case. */ @@ -7536,6 +7534,9 @@ fp = fdopen (fd, FOPEN_BINARY_WRITE); if (fp == NULL) error (1, errno, "cannot fdopen %s", lockfile); + + free (lockfile); + return fp; } Index: CoreOS/Versioning/cvs/cvs/src/server.c diff -u CoreOS/Versioning/cvs/cvs/src/server.c:1.1.1.6 CoreOS/Versioning/cvs/cvs/src/server.c:1.6 --- CoreOS/Versioning/cvs/cvs/src/server.c:1.1.1.6 Mon Apr 6 22:04:27 1998 +++ CoreOS/Versioning/cvs/cvs/src/server.c Mon Apr 6 23:24:27 1998 @@ -1101,6 +1101,9 @@ char *mode_text; int gzipped = 0; +#ifdef WRAPPERS_USE_TAR_FOR_TRANSFER + int tarred = 0; +#endif /* WRAPPERS_USE_TAR_FOR_TRANSFER */ /* * This used to return immediately if error_pending () was true. @@ -1167,6 +1170,13 @@ gzipped = 1; size = atoi (size_text + 1); } +#ifdef WRAPPERS_USE_TAR_FOR_TRANSFER + else if (size_text[0] == 'T') + { + tarred = 1; + size = atoi (size_text + 1); + } +#endif /* WRAPPERS_USE_TAR_FOR_TRANSFER */ else size = atoi (size_text); free (size_text); @@ -1189,8 +1199,52 @@ if (size >= 0) { +#ifdef WRAPPERS_USE_TAR_FOR_TRANSFER + if (tarred) { + char *tardir = CVSWRAPPERTMP; + char *tarfile = "data"; + char untarred_file[PATH_MAX]; + char *filename = arg; + int retcode; + + int global_noexec = noexec; + + /* This is a hack to work around the fact that noexec is used + in places that I can't override. (eg. make_directory). When + the -n global flag is used in cvs, this stuff still needs to + happen, so let's override the flag temporarily. */ + noexec = 0; + + receive_file (size, tarfile, 0); + if (error_pending ()) return; + + make_directory(tardir); + + run_setup (TAR_PROGRAM); + run_arg ("-xf"); + run_arg (tarfile); + run_arg ("-C"); + run_arg (tardir); + retcode = run_exec (DEVNULL, RUN_TTY, RUN_TTY, RUN_REALLY); + + strcpy(untarred_file, tardir); + strcat(untarred_file, "/"); + strcat(untarred_file, filename); + + unlink_file_dir(filename); /* remove existing directory */ + rename_file(untarred_file, filename); + unlink_file_dir(tarfile); /* get rid of tarfile */ + unlink_file_dir(tardir); /* ... and output file */ + + /* Return to status quo. */ + noexec = global_noexec; + } else { +#endif /* WRAPPERS_USE_TAR_FOR_TRANSFER */ receive_file (size, arg, gzipped); if (error_pending ()) return; +#ifdef WRAPPERS_USE_TAR_FOR_TRANSFER + } +#endif /* WRAPPERS_USE_TAR_FOR_TRANSFER */ } { @@ -3544,6 +3598,55 @@ { long status; +#ifdef WRAPPERS_USE_TAR_FOR_TRANSFER + if ((mode & S_IFMT) & S_IFDIR) { + /* file is a directory; send it over as a tarfile... */ + char *tarfile = CVSWRAPPERTMP; + struct stat tarfile_sb; + int retcode; + + int global_noexec = noexec; + + /* This is a hack to work around the fact that noexec is used + in places that I can't override. (eg. make_directory). When + the -n global flag is used in cvs, this stuff still needs to + happen, so let's override the flag temporarily. */ + noexec = 0; + + if (isfile(tarfile)) + unlink_file(tarfile); + + run_setup (TAR_PROGRAM); + run_arg ("-cf"); + run_arg (tarfile); + run_arg (finfo->file); + retcode = run_exec (DEVNULL, RUN_TTY, RUN_TTY, RUN_REALLY); + + if (stat(tarfile, &tarfile_sb) < 0) { + error(1, errno, "stat failed for %s", tarfile); + } + + size = tarfile_sb.st_size; + + f = fopen (tarfile, "r"); + if (f == NULL) + error (1, errno, "reading %s", tarfile); + status = buf_read_file (f, size, &list, &last); + if (status == -2) + (*protocol->memory_error) (&protocol); + else if (status != 0) + error (1, ferror (f) ? errno : 0, "reading %s", + tarfile); + if (fclose (f) == EOF) + error (1, errno, "reading %s", tarfile); + unlink_file(tarfile); + /* prepend size message with "T" flag for tarfile */ + buf_output0 (protocol, "T"); + + /* Return to status quo. */ + noexec = global_noexec; + } else { +#endif /* WRAPPERS_USE_TAR_FOR_TRANSFER */ f = CVS_FOPEN (finfo->file, "rb"); if (f == NULL) error (1, errno, "reading %s", finfo->fullname); @@ -3555,6 +3658,9 @@ finfo->fullname); if (fclose (f) == EOF) error (1, errno, "reading %s", finfo->fullname); +#ifdef WRAPPERS_USE_TAR_FOR_TRANSFER + } +#endif /* WRAPPERS_USE_TAR_FOR_TRANSFER */ } } @@ -4333,7 +4439,7 @@ (void) buf_shutdown (buf_to_net); } -int server_active = 0; +int server_active = 0; int server_expanding = 0; int Index: CoreOS/Versioning/cvs/cvs/src/server.h diff -u CoreOS/Versioning/cvs/cvs/src/server.h:1.1.1.4 CoreOS/Versioning/cvs/cvs/src/server.h:1.4 --- CoreOS/Versioning/cvs/cvs/src/server.h:1.1.1.4 Mon Apr 6 22:03:40 1998 +++ CoreOS/Versioning/cvs/cvs/src/server.h Tue Apr 7 00:13:41 1998 @@ -7,13 +7,13 @@ #define STDERR_FILENO 2 #endif +extern int server_active; #ifdef SERVER_SUPPORT /* * Nonzero if we are using the server. Used by various places to call * server-specific functions. */ -extern int server_active; extern int server_expanding; /* Server functions exported to the rest of CVS. */ Index: CoreOS/Versioning/cvs/cvs/src/wrapper.c diff -u CoreOS/Versioning/cvs/cvs/src/wrapper.c:1.1.1.5 CoreOS/Versioning/cvs/cvs/src/wrapper.c:1.6 --- CoreOS/Versioning/cvs/cvs/src/wrapper.c:1.1.1.5 Mon Apr 6 22:04:33 1998 +++ CoreOS/Versioning/cvs/cvs/src/wrapper.c Tue Apr 7 00:13:42 1998 @@ -14,6 +14,7 @@ /* Original Author: athan@morgan.com 2/1/94 Modified By: vdemarco@bou.shl.com + bbum@friday.com This package was written to support the NEXTSTEP concept of "wrappers." These are essentially directories that are to be @@ -90,6 +91,10 @@ static int wrap_setup_already_done = 0; char *homedir; +#ifdef WRAPPERS_USE_TAR_FOR_TRANSFER + char *wfile; +#endif /* WRAPPERS_USE_TAR_FOR_TRANSFER */ + if (wrap_setup_already_done != 0) return; else @@ -131,6 +136,12 @@ free (file); } +#ifdef WRAPPERS_USE_TAR_FOR_TRANSFER + if (wfile = getenv("CVS_CLIENT_WRAPPER_FILE")) { + wrap_add_file(wfile, 0); + } +#endif /* WRAPPERS_USE_TAR_FOR_TRANSFER */ + /* FIXME: calling wrap_add() below implies that the CVSWRAPPERS * environment variable contains exactly one "wrapper" -- a line * of the form @@ -162,25 +173,35 @@ for (i = 0; i < wrap_count + wrap_tempcount; ++i) { - if (wrap_list[i]->tocvsFilter != NULL - || wrap_list[i]->fromcvsFilter != NULL) - /* For greater studliness we would print the offending option - and (more importantly) where we found it. */ - error (0, 0, "\ --t and -f wrapper options are not supported remotely; ignored"); + send_to_server ("Argument -W\012Argument ", 0); + send_to_server (wrap_list[i]->wildCard, 0); + + if (wrap_list[i]->tocvsFilter != NULL) + { + send_to_server (" -t '", 0); + send_to_server (wrap_list[i]->tocvsFilter, 0); + send_to_server ("' ", 0); + } + + if (wrap_list[i]->fromcvsFilter != NULL) + { + send_to_server (" -f '", 0); + send_to_server (wrap_list[i]->fromcvsFilter, 0); + send_to_server ("' ", 0); + } + if (wrap_list[i]->mergeMethod == WRAP_COPY) - /* For greater studliness we would print the offending option - and (more importantly) where we found it. */ - error (0, 0, "\ --m wrapper option is not supported remotely; ignored"); + { + send_to_server (" -m 'COPY' ", 0); + } + if (wrap_list[i]->rcsOption != NULL) { - send_to_server ("Argument -W\012Argument ", 0); - send_to_server (wrap_list[i]->wildCard, 0); send_to_server (" -k '", 0); send_to_server (wrap_list[i]->rcsOption, 0); - send_to_server ("'\012", 0); + send_to_server ("' ", 0); } + send_to_server ("\012", 0); } } #endif /* CLIENT_SUPPORT */ Index: CoreOS/Versioning/cvs/cvs/windows-NT/options.h diff -u CoreOS/Versioning/cvs/cvs/windows-NT/options.h:1.1.1.4 CoreOS/Versioning/cvs/cvs/windows-NT/options.h:1.4 --- CoreOS/Versioning/cvs/cvs/windows-NT/options.h:1.1.1.4 Mon Apr 6 22:04:59 1998 +++ CoreOS/Versioning/cvs/cvs/windows-NT/options.h Mon Apr 6 23:24:34 1998 @@ -156,6 +156,9 @@ */ #define AUTH_CLIENT_SUPPORT 1 +#define WRAPPERS_USE_TAR_FOR_TRANSFER +#define WRAPPERS_SUPPORT_RCS_OPTIONS + /* End of CVS configuration section */ /* Index: CoreOS/Versioning/cvs/cvs/zlib/ChangeLog diff -u CoreOS/Versioning/cvs/cvs/zlib/ChangeLog:1.1.1.2 CoreOS/Versioning/cvs/cvs/zlib/ChangeLog:1.3 --- CoreOS/Versioning/cvs/cvs/zlib/ChangeLog:1.1.1.2 Wed Sep 3 14:14:39 1997 +++ CoreOS/Versioning/cvs/cvs/zlib/ChangeLog Thu Feb 19 17:17:20 1998 @@ -1,3 +1,8 @@ +Wed Feb 11 23:32:45 PST 1998 Wilfredo Sanchez + + * Makefile.in: Change bindir, etc. to get values from configure + (eg. @bindir@) instead of figure it out inthe Makefile. + Tue Mar 18 13:05:37 1997 Jim Meyering * Makefile.in (DISTFILES): Change glob pattern so that it doesn't Index: CoreOS/Versioning/cvs/cvs/zlib/Makefile.in diff -u CoreOS/Versioning/cvs/cvs/zlib/Makefile.in:1.1.1.2 CoreOS/Versioning/cvs/cvs/zlib/Makefile.in:1.2 --- CoreOS/Versioning/cvs/cvs/zlib/Makefile.in:1.1.1.2 Wed Sep 3 14:14:44 1997 +++ CoreOS/Versioning/cvs/cvs/zlib/Makefile.in Thu Oct 9 17:10:25 1997 @@ -35,7 +35,7 @@ TAR=tar prefix=@prefix@ -exec_prefix = $(prefix) +exec_prefix = @exec_prefix@ OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \ zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o