summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorThorsten Lockert <tholo@cvs.openbsd.org>2001-09-28 22:45:44 +0000
committerThorsten Lockert <tholo@cvs.openbsd.org>2001-09-28 22:45:44 +0000
commitba1dc3b9e4f3402b435edad6e14f34a79f4748fa (patch)
tree8e10de858a180b8b10c3a0774229ddc53ac99b00 /gnu
parent79da6d2ec924cfdf612531607a5ae97264df2270 (diff)
Latest from Cyclic Software
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.bin/cvs/AUTHORS4
-rw-r--r--gnu/usr.bin/cvs/ChangeLog406
-rw-r--r--gnu/usr.bin/cvs/INSTALL38
-rw-r--r--gnu/usr.bin/cvs/Makefile.am66
-rw-r--r--gnu/usr.bin/cvs/NEWS42
-rw-r--r--gnu/usr.bin/cvs/TODO23
-rw-r--r--gnu/usr.bin/cvs/acconfig.h7
-rw-r--r--gnu/usr.bin/cvs/acinclude.m4231
-rw-r--r--gnu/usr.bin/cvs/aclocal.m4861
-rw-r--r--gnu/usr.bin/cvs/config.h.in47
-rw-r--r--gnu/usr.bin/cvs/contrib/.cvsignore1
-rw-r--r--gnu/usr.bin/cvs/contrib/ChangeLog57
-rw-r--r--gnu/usr.bin/cvs/contrib/Makefile.am108
-rw-r--r--gnu/usr.bin/cvs/contrib/clmerge.in152
-rw-r--r--gnu/usr.bin/cvs/contrib/cln_hist.in91
-rw-r--r--gnu/usr.bin/cvs/contrib/commit_prep.in215
-rw-r--r--gnu/usr.bin/cvs/contrib/cvs_acls.in141
-rw-r--r--gnu/usr.bin/cvs/contrib/debug_check_log.sh197
-rw-r--r--gnu/usr.bin/cvs/contrib/log.in208
-rw-r--r--gnu/usr.bin/cvs/contrib/log_accum.in576
-rw-r--r--gnu/usr.bin/cvs/contrib/mfpipe.in85
-rw-r--r--gnu/usr.bin/cvs/contrib/rcslock.in235
-rw-r--r--gnu/usr.bin/cvs/contrib/sccs2rcs.in281
-rw-r--r--gnu/usr.bin/cvs/cvs.spec232
-rw-r--r--gnu/usr.bin/cvs/cvs.spec.in213
-rw-r--r--gnu/usr.bin/cvs/cvsnt.dsp15
-rw-r--r--gnu/usr.bin/cvs/cvsnt.mak169
-rw-r--r--gnu/usr.bin/cvs/depcomp358
-rw-r--r--gnu/usr.bin/cvs/diff/ChangeLog67
-rw-r--r--gnu/usr.bin/cvs/diff/Makefile.am24
-rw-r--r--gnu/usr.bin/cvs/diff/analyze.c39
-rw-r--r--gnu/usr.bin/cvs/diff/diff.c2
-rw-r--r--gnu/usr.bin/cvs/diff/diff3.c67
-rw-r--r--gnu/usr.bin/cvs/diff/dir.c10
-rw-r--r--gnu/usr.bin/cvs/diff/system.h13
-rw-r--r--gnu/usr.bin/cvs/doc/.cvsignore4
-rw-r--r--gnu/usr.bin/cvs/doc/CVSvn.texi2
-rw-r--r--gnu/usr.bin/cvs/doc/CVSvn.texi.in1
-rw-r--r--gnu/usr.bin/cvs/doc/ChangeLog145
-rw-r--r--gnu/usr.bin/cvs/doc/Makefile.am157
-rw-r--r--gnu/usr.bin/cvs/doc/cvsclient.texi12
-rw-r--r--gnu/usr.bin/cvs/doc/texinfo.tex6200
-rw-r--r--gnu/usr.bin/cvs/emx/ChangeLog12
-rw-r--r--gnu/usr.bin/cvs/emx/Makefile.in54
-rw-r--r--gnu/usr.bin/cvs/install-sh22
-rw-r--r--gnu/usr.bin/cvs/lib/.cvsignore3
-rw-r--r--gnu/usr.bin/cvs/lib/ChangeLog66
-rw-r--r--gnu/usr.bin/cvs/lib/Makefile.am88
-rw-r--r--gnu/usr.bin/cvs/lib/rename.c4
-rw-r--r--gnu/usr.bin/cvs/lib/system.h43
-rw-r--r--gnu/usr.bin/cvs/lib/xgssapi.h30
-rw-r--r--gnu/usr.bin/cvs/lib/xselect.h21
-rw-r--r--gnu/usr.bin/cvs/lib/xtime.h57
-rw-r--r--gnu/usr.bin/cvs/man/ChangeLog17
-rw-r--r--gnu/usr.bin/cvs/man/Makefile.am22
-rw-r--r--gnu/usr.bin/cvs/man/Makefile.in370
-rw-r--r--gnu/usr.bin/cvs/missing265
-rw-r--r--gnu/usr.bin/cvs/mkinstalldirs21
-rw-r--r--gnu/usr.bin/cvs/os2/ChangeLog12
-rw-r--r--gnu/usr.bin/cvs/os2/Makefile.in59
-rw-r--r--gnu/usr.bin/cvs/src/.cvsignore2
-rw-r--r--gnu/usr.bin/cvs/src/ChangeLog1077
-rw-r--r--gnu/usr.bin/cvs/src/Makefile.am144
-rw-r--r--gnu/usr.bin/cvs/src/add.c54
-rw-r--r--gnu/usr.bin/cvs/src/annotate.c277
-rw-r--r--gnu/usr.bin/cvs/src/build_src.com7
-rw-r--r--gnu/usr.bin/cvs/src/classify.c245
-rw-r--r--gnu/usr.bin/cvs/src/create_adm.c15
-rw-r--r--gnu/usr.bin/cvs/src/cvsbug.in526
-rw-r--r--gnu/usr.bin/cvs/src/error.c18
-rw-r--r--gnu/usr.bin/cvs/src/error.h6
-rw-r--r--gnu/usr.bin/cvs/src/expand_path.c2
-rw-r--r--gnu/usr.bin/cvs/src/find_names.c18
-rw-r--r--gnu/usr.bin/cvs/src/rcs.h10
-rw-r--r--gnu/usr.bin/cvs/src/remove.c4
-rw-r--r--gnu/usr.bin/cvs/src/run.c12
-rw-r--r--gnu/usr.bin/cvs/src/sanity.sh6365
-rw-r--r--gnu/usr.bin/cvs/src/stamp-h2.in1
-rw-r--r--gnu/usr.bin/cvs/src/status.c4
-rw-r--r--gnu/usr.bin/cvs/src/tag.c557
-rw-r--r--gnu/usr.bin/cvs/src/update.h3
-rw-r--r--gnu/usr.bin/cvs/src/vers_ts.c4
-rw-r--r--gnu/usr.bin/cvs/src/version.c17
-rw-r--r--gnu/usr.bin/cvs/src/version.c.in86
-rw-r--r--gnu/usr.bin/cvs/src/watch.c6
-rw-r--r--gnu/usr.bin/cvs/stamp-h1.in1
-rw-r--r--gnu/usr.bin/cvs/tools/ChangeLog17
-rw-r--r--gnu/usr.bin/cvs/tools/Makefile.am21
-rw-r--r--gnu/usr.bin/cvs/tools/Makefile.in234
-rw-r--r--gnu/usr.bin/cvs/vms/ChangeLog49
-rw-r--r--gnu/usr.bin/cvs/vms/Makefile.am59
-rw-r--r--gnu/usr.bin/cvs/vms/Makefile.in247
-rw-r--r--gnu/usr.bin/cvs/vms/config.h26
-rw-r--r--gnu/usr.bin/cvs/vms/filesubr.c234
-rw-r--r--gnu/usr.bin/cvs/vms/ndir.c19
-rw-r--r--gnu/usr.bin/cvs/vms/ndir.h6
-rw-r--r--gnu/usr.bin/cvs/vms/pipe.c13
-rw-r--r--gnu/usr.bin/cvs/vms/pwd.c13
-rw-r--r--gnu/usr.bin/cvs/vms/pwd.h4
-rw-r--r--gnu/usr.bin/cvs/vms/rmdir.c13
-rw-r--r--gnu/usr.bin/cvs/vms/unlink.c8
-rw-r--r--gnu/usr.bin/cvs/vms/vms.h13
-rw-r--r--gnu/usr.bin/cvs/vms/waitpid.c13
-rw-r--r--gnu/usr.bin/cvs/windows-NT/ChangeLog40
-rw-r--r--gnu/usr.bin/cvs/windows-NT/Makefile.am43
-rw-r--r--gnu/usr.bin/cvs/windows-NT/Makefile.in418
-rw-r--r--gnu/usr.bin/cvs/windows-NT/SCC/ChangeLog17
-rw-r--r--gnu/usr.bin/cvs/windows-NT/SCC/Makefile.am31
-rw-r--r--gnu/usr.bin/cvs/windows-NT/SCC/Makefile.in250
-rw-r--r--gnu/usr.bin/cvs/windows-NT/config.h7
-rw-r--r--gnu/usr.bin/cvs/windows-NT/filesubr.c92
-rw-r--r--gnu/usr.bin/cvs/windows-NT/win32.c10
-rw-r--r--gnu/usr.bin/cvs/zlib/.cvsignore1
-rw-r--r--gnu/usr.bin/cvs/zlib/ChangeLog246
-rw-r--r--gnu/usr.bin/cvs/zlib/FAQ72
-rw-r--r--gnu/usr.bin/cvs/zlib/INDEX73
-rw-r--r--gnu/usr.bin/cvs/zlib/Make_vms.com8
-rw-r--r--gnu/usr.bin/cvs/zlib/Makefile.in183
-rw-r--r--gnu/usr.bin/cvs/zlib/Makefile.riscos145
-rw-r--r--gnu/usr.bin/cvs/zlib/README125
-rw-r--r--gnu/usr.bin/cvs/zlib/adler32.c6
-rw-r--r--gnu/usr.bin/cvs/zlib/algorithm.txt213
-rw-r--r--gnu/usr.bin/cvs/zlib/amiga/Makefile.pup66
-rw-r--r--gnu/usr.bin/cvs/zlib/amiga/Makefile.sas64
-rw-r--r--gnu/usr.bin/cvs/zlib/compress.c39
-rw-r--r--gnu/usr.bin/cvs/zlib/configure196
-rw-r--r--gnu/usr.bin/cvs/zlib/contrib/README.contrib34
-rw-r--r--gnu/usr.bin/cvs/zlib/contrib/asm386/gvmat32.asm559
-rw-r--r--gnu/usr.bin/cvs/zlib/contrib/asm386/gvmat32c.c200
-rw-r--r--gnu/usr.bin/cvs/zlib/contrib/asm386/mkgvmt32.bat1
-rw-r--r--gnu/usr.bin/cvs/zlib/contrib/asm386/zlibvc.def74
-rw-r--r--gnu/usr.bin/cvs/zlib/contrib/asm386/zlibvc.dsp651
-rw-r--r--gnu/usr.bin/cvs/zlib/contrib/asm386/zlibvc.dsw41
-rw-r--r--gnu/usr.bin/cvs/zlib/contrib/asm586/README.58643
-rw-r--r--gnu/usr.bin/cvs/zlib/contrib/asm586/match.S354
-rw-r--r--gnu/usr.bin/cvs/zlib/contrib/asm686/README.68634
-rw-r--r--gnu/usr.bin/cvs/zlib/contrib/asm686/match.S327
-rw-r--r--gnu/usr.bin/cvs/zlib/contrib/delphi/zlib.mak36
-rw-r--r--gnu/usr.bin/cvs/zlib/contrib/delphi/zlibdef.pas169
-rw-r--r--gnu/usr.bin/cvs/zlib/contrib/delphi2/d_zlib.bpr224
-rw-r--r--gnu/usr.bin/cvs/zlib/contrib/delphi2/d_zlib.cpp17
-rw-r--r--gnu/usr.bin/cvs/zlib/contrib/delphi2/readme.txt17
-rw-r--r--gnu/usr.bin/cvs/zlib/contrib/delphi2/zlib.bpg26
-rw-r--r--gnu/usr.bin/cvs/zlib/contrib/delphi2/zlib.bpr225
-rw-r--r--gnu/usr.bin/cvs/zlib/contrib/delphi2/zlib.cpp22
-rw-r--r--gnu/usr.bin/cvs/zlib/contrib/delphi2/zlib.pas534
-rw-r--r--gnu/usr.bin/cvs/zlib/contrib/delphi2/zlib32.bpr174
-rw-r--r--gnu/usr.bin/cvs/zlib/contrib/delphi2/zlib32.cpp42
-rw-r--r--gnu/usr.bin/cvs/zlib/contrib/iostream/test.cpp24
-rw-r--r--gnu/usr.bin/cvs/zlib/contrib/iostream/zfstream.cpp329
-rw-r--r--gnu/usr.bin/cvs/zlib/contrib/iostream/zfstream.h142
-rw-r--r--gnu/usr.bin/cvs/zlib/contrib/iostream2/zstream.h307
-rw-r--r--gnu/usr.bin/cvs/zlib/contrib/iostream2/zstream_test.cpp25
-rw-r--r--gnu/usr.bin/cvs/zlib/contrib/minizip/ChangeLogUnzip38
-rw-r--r--gnu/usr.bin/cvs/zlib/contrib/minizip/Makefile25
-rw-r--r--gnu/usr.bin/cvs/zlib/contrib/minizip/miniunz.c508
-rw-r--r--gnu/usr.bin/cvs/zlib/contrib/minizip/minizip.c302
-rw-r--r--gnu/usr.bin/cvs/zlib/contrib/minizip/readme.txt37
-rw-r--r--gnu/usr.bin/cvs/zlib/contrib/minizip/unzip.c1294
-rw-r--r--gnu/usr.bin/cvs/zlib/contrib/minizip/unzip.def15
-rw-r--r--gnu/usr.bin/cvs/zlib/contrib/minizip/unzip.h275
-rw-r--r--gnu/usr.bin/cvs/zlib/contrib/minizip/zip.c718
-rw-r--r--gnu/usr.bin/cvs/zlib/contrib/minizip/zip.def5
-rw-r--r--gnu/usr.bin/cvs/zlib/contrib/minizip/zip.h150
-rw-r--r--gnu/usr.bin/cvs/zlib/contrib/minizip/zlibvc.def74
-rw-r--r--gnu/usr.bin/cvs/zlib/contrib/minizip/zlibvc.dsp651
-rw-r--r--gnu/usr.bin/cvs/zlib/contrib/minizip/zlibvc.dsw41
-rw-r--r--gnu/usr.bin/cvs/zlib/contrib/untgz/Makefile14
-rw-r--r--gnu/usr.bin/cvs/zlib/contrib/untgz/makefile.w3263
-rw-r--r--gnu/usr.bin/cvs/zlib/contrib/untgz/untgz.c522
-rw-r--r--gnu/usr.bin/cvs/zlib/contrib/visual-basic.txt69
-rw-r--r--gnu/usr.bin/cvs/zlib/crc32.c14
-rw-r--r--gnu/usr.bin/cvs/zlib/deflate.c285
-rw-r--r--gnu/usr.bin/cvs/zlib/deflate.h53
-rw-r--r--gnu/usr.bin/cvs/zlib/example.c121
-rw-r--r--gnu/usr.bin/cvs/zlib/infblock.c98
-rw-r--r--gnu/usr.bin/cvs/zlib/infblock.h8
-rw-r--r--gnu/usr.bin/cvs/zlib/infcodes.c32
-rw-r--r--gnu/usr.bin/cvs/zlib/infcodes.h2
-rw-r--r--gnu/usr.bin/cvs/zlib/inffast.c14
-rw-r--r--gnu/usr.bin/cvs/zlib/inffast.h2
-rw-r--r--gnu/usr.bin/cvs/zlib/inffixed.h151
-rw-r--r--gnu/usr.bin/cvs/zlib/inflate.c81
-rw-r--r--gnu/usr.bin/cvs/zlib/inftrees.c223
-rw-r--r--gnu/usr.bin/cvs/zlib/inftrees.h35
-rw-r--r--gnu/usr.bin/cvs/zlib/infutil.c2
-rw-r--r--gnu/usr.bin/cvs/zlib/infutil.h5
-rw-r--r--gnu/usr.bin/cvs/zlib/maketree.c85
-rw-r--r--gnu/usr.bin/cvs/zlib/minigzip.c128
-rw-r--r--gnu/usr.bin/cvs/zlib/msdos/Makefile.b32104
-rw-r--r--gnu/usr.bin/cvs/zlib/msdos/Makefile.bor125
-rw-r--r--gnu/usr.bin/cvs/zlib/msdos/Makefile.dj2100
-rw-r--r--gnu/usr.bin/cvs/zlib/msdos/Makefile.emx69
-rw-r--r--gnu/usr.bin/cvs/zlib/msdos/Makefile.msc121
-rw-r--r--gnu/usr.bin/cvs/zlib/msdos/Makefile.tc108
-rw-r--r--gnu/usr.bin/cvs/zlib/msdos/Makefile.w3297
-rw-r--r--gnu/usr.bin/cvs/zlib/msdos/Makefile.wat103
-rw-r--r--gnu/usr.bin/cvs/zlib/msdos/zlib.def60
-rw-r--r--gnu/usr.bin/cvs/zlib/msdos/zlib.rc32
-rw-r--r--gnu/usr.bin/cvs/zlib/nt/Makefile.emx138
-rw-r--r--gnu/usr.bin/cvs/zlib/nt/Makefile.gcc87
-rw-r--r--gnu/usr.bin/cvs/zlib/nt/Makefile.nt88
-rw-r--r--gnu/usr.bin/cvs/zlib/nt/zlib.dnt47
-rw-r--r--gnu/usr.bin/cvs/zlib/os2/Makefile.os2136
-rw-r--r--gnu/usr.bin/cvs/zlib/os2/zlib.def51
-rw-r--r--gnu/usr.bin/cvs/zlib/trees.c205
-rw-r--r--gnu/usr.bin/cvs/zlib/trees.h128
-rw-r--r--gnu/usr.bin/cvs/zlib/uncompr.c8
-rw-r--r--gnu/usr.bin/cvs/zlib/zconf.h127
-rw-r--r--gnu/usr.bin/cvs/zlib/zlib.3107
-rw-r--r--gnu/usr.bin/cvs/zlib/zlib.h513
-rw-r--r--gnu/usr.bin/cvs/zlib/zutil.c32
-rw-r--r--gnu/usr.bin/cvs/zlib/zutil.h71
213 files changed, 35300 insertions, 3891 deletions
diff --git a/gnu/usr.bin/cvs/AUTHORS b/gnu/usr.bin/cvs/AUTHORS
new file mode 100644
index 00000000000..7184d29d177
--- /dev/null
+++ b/gnu/usr.bin/cvs/AUTHORS
@@ -0,0 +1,4 @@
+Authors of GNU CVS
+
+Um, yeah. There were lots of 'em. See the "Credits" section of the
+README file and the individual ChangeLog files for more.
diff --git a/gnu/usr.bin/cvs/ChangeLog b/gnu/usr.bin/cvs/ChangeLog
index eaa0aea155c..f22a7ba177d 100644
--- a/gnu/usr.bin/cvs/ChangeLog
+++ b/gnu/usr.bin/cvs/ChangeLog
@@ -1,3 +1,409 @@
+2001-04-26 Derek Price <dprice@collab.net>
+
+ * cvs.spec.in: Don't include %{_infodir}/dir.
+ (krb5): Remove krb5-config from dependencies.
+
+ * cvs.spec: Regenerated.
+
+2001-04-25 Derek Price <dprice@collab.net>
+
+ * configure.in: Update version to 1.11.1.
+
+ * Makefile.in: Regenerated with AM 1.4e as of today at 18:10 -0400
+ (EDT).
+ * aclocal.m4: Ditto.
+ * configure: Ditto.
+
+2001-04-25 Derek Price <dprice@collab.net>
+
+ * NEWS: Correct punctuation.
+
+2001-04-25 Larry Jones <larry.jones@sdr.com>
+
+ * depcomp (aix, sgi): Correct previous fixes.
+
+2001-04-24 Larry Jones <larry.jones@sdr.com>
+
+ * depcomp (sgi): Remove stray HP-UX code.
+
+2001-04-18 Derek Price <dprice@collab.net>
+
+ * noautoconf.sh: New shell script to touch Makefile.in files and
+ prevent unecessary AUtomake rebuilds after updates.
+ * NEWS: Note this new scipt.
+
+2001-04-16 Larry Jones <larry.jones@sdr.com>
+
+ * depcomp (aix): Remove stray HP-UX code.
+
+2001-04-12 Larry Jones <larry.jones@sdr.com>
+
+ * mkinstalldirs: Newer version from Automake.
+
+2001-04-12 Larry Jones <larry.jones@sdr.com>
+
+ * depcomp: Newer version from Automake.
+
+2001-04-04 Larry Jones <larry.jones@sdr.com>
+
+ * depcomp: Don't count on $? being set in then or else clauses.
+
+2001-03-30 Larry Jones <larry.jones@sdr.com>
+
+ * NEWS: Note new rlog and rannotate commands.
+
+2001-03-14 Derek Price <derek.price@openavenue.com>
+
+ * configure.in (AC_CHECK_FUNCS): Look for gettimeofday.
+
+ * config.h.in: Regenerated:
+ * configure: Ditto.
+ * stamp-h1.in: Ditto.
+
+2001-03-14 Derek Price <derek.price@openavenue.com>
+
+ New version of Automake (1.4e). With luck it works with the quirky BSD
+ Make.
+
+ * aclocal.m4: Regenerated.
+ * configure: Ditto.
+ * Makefile.in: Ditto.
+ * stamp-h1.in: Ditto.
+
+2001-02-28 Derek Price <derek.price@openavenue.com>
+
+ * acinclude.m4 (ACX_WITH_GSSAPI): Move the -L linker option back into
+ LIBS where it should be. LDFLAGS is a user variable.
+
+ * aclocal.m4: Regenerated.
+ * configure: Regenerated.
+
+2001-02-23 Derek Price <derek.price@openavenue.com>
+
+ * configure.in: Comment definition of PR_PROGRAM.
+
+ * configure: Regenerated.
+
+2001-02-22 Derek Price <derek.price@openavenue.com>
+ Pavel Roskin <proski@gnu.org>
+
+ * configure.in: Define PR_PROGRAM if `pr' has been found.
+
+ * config.h.in: Regenerated.
+ * configure: Regenerated.
+
+2001-02-20 Derek Price <derek.price@openavenue.com>
+
+ * acconfig.h (HAVE_GSSAPI): Removed. Entries in acconfig.h aren't
+ necesary when the full functionality of AC_DEFINE is used.
+ (HAVE_GSS_C_NT_HOSTBASED_SERVICE): Ditto.
+ * acinclude.m4 (ACX_WITH_GSSAPI): New file with GSSAPI configure code.
+ * configure.in: Use ACX_WITH_GSSAPI instead of writing GSSAPI code in
+ place.
+
+ * aclocal.m4: Regenerated.
+ * config.h.in: Regenerated.
+ * configure: Regenerated.
+
+2001-02-15 Derek Price <derek.price@openavenue.com>
+
+ * configure: Regenerated without beta automake macros.
+
+2001-02-14 Derek Price <derek.price@openavenue.com>
+
+ * configure.in (AC_CHECK_FUNCS): Alphebetize & reorganize. Add
+ cascading search for nanosleep, usleep, & select, in that order.
+ * config.h.in: Regenerated.
+ * configure: Regenerated.
+ * cvsnt.mak: List xtime.h & xselect.h dependancies.
+
+2001-02-14 Larry Jones <larry.jones@sdrc.com>
+
+ * cvsnt.dsp: Remove references to rtag.c & rtag.obj.
+ * cvsnt.mak: Ditto.
+
+2001-02-13 Derek Price <derek.price@openavenue.com>
+
+ * TODO: Add note about merging rdiff & diff.
+
+2001-02-13 Derek Price <derek.price@openavenue.com>
+
+ * TODO: Add note about cvs_temp_file.
+
+2001-02-07 Derek Price <derek.price@openavenue.com>
+
+ * cvs.spec.in (build): Remove the info 'dir' file so it doesn't get
+ installed accidentally.
+ (post): Install info files _into_ system dir file
+ (preun): uninstall info files from dir file
+ * cvs.spec: regenerated
+
+2001-01-31 Derek Price <derek.price@openavenue.com>
+
+ * TODO: Add a note about 'cvs add' w/o write access
+
+2001-01-29 Derek Price <derek.price@openavenue.com>
+
+ * NEWS: Rewrite the comment on the new ~/.cvspass functionality
+ * TODO: Add a note about testing login/logout
+
+2001-01-29 Derek Price <derek.price@openavenue.com>
+
+ * configure.in: Rewrite args to AC_TRY_COMMAND in a form that is
+ acceptable to both Autoconf 1.13 and the new 1.49 beta.
+
+ * configure: regenerated
+
+2001-01-29 Larry Jones <larry.jones@sdrc.com>
+
+ * configure.in: Check for syslog.h.
+ * configure, config.h.in: Regenerated.
+
+2001-01-17 Derek Price <derek.price@openavenue.com>
+
+ * configure.in: add machinery to check for the BSD VPATH bug
+ and check for texi2dvi.
+ * doc/Makefile.am: use the machinery
+ * diff/Makefile.in: changes to support 'make dist' from a build dir
+ * emx/Makefile.in: changes to support 'make dist' from a build dir
+ * os2/Makefile.in: changes to support 'make dist' from a build dir
+ * zlib/Makefile.in: changes to support 'make dist' from a build dir
+
+ * Makefile.in: regenerated
+ * aclocal.m4: regenerated
+ * configure: regenerated
+ * contrib/Makefile.in: regenerated
+ * doc/Makefile.in: regenerated
+ * lib/Makefile.in: regenerated
+ * man/Makefile.in: regenerated
+ * src/Makefile.in: regenerated
+ * tools/Makefile.in: regenerated
+ * vms/Makefile.in: regenerated
+ * windows-NT/Makefile.in: regenerated
+ * windows-NT/SCC/Makefile.in: regenerated
+
+2001-01-10 Derek Price <derek.price@openavenue.com>
+ Rex Jolliff <Rex_Jolliff@notes.ymp.gov>
+
+ * NEWS (new since 1.11): Add comment about VMS wildcards
+
+2001-01-05 Derek Price <derek.price@openavenue.com>
+
+ * configure.in (AC_OUTPUT): Move some script targets here
+ * contrib/Makefile.am (EXTRA_DIST, SUFFIXES, .pl:, .csh:): Move some
+ script targets to configure.in
+ * src/Makefile.am (cvsbug, cvsbug_EXTRA_DIST, EXTRA_DIST): move cvsbug
+ target to configure.in
+
+ * aclocal.m4: Regenerated due to change in Automake installation
+
+ * Makefile.in: Regenerated
+ * configure: ditto
+ * contrib/Makefile.in: ditto
+ * doc/Makefile.in: ditto
+ * lib/Makefile.in: ditto
+ * man/Makefile.in: ditto
+ * src/Makefile.in: ditto
+ * tools/Makefile.in: ditto
+ * vms/Makefile.in: ditto
+ * windows-NT/Makefile.in: ditto
+ * windows-NT/SCC/Makefile.in: ditto
+
+ * cvs.spec: updated timestamp
+ * stamp-h1.in: ditto
+ * doc/CVSvn.texi: ditto
+ * src/stamp-h2.in: ditto
+ * src/version.c: ditto
+
+ * contrib/clmerge.in: Rename from clmerge.pl
+ * contrib/cln_hist.in: Rename from cln_hist.pl
+ * contrib/commit_prep.in: Rename from commit_prep.pl
+ * contrib/cvs_acls.in: Rename from cvs_acls.pl
+ * contrib/log.in: Rename from log.pl
+ * contrib/log_accum.in: Rename from log_accum.pl
+ * contrib/mfpipe.in: Rename from mfpipe.pl
+ * contrib/rcslock.in: Rename from rcslock.pl
+ * contrib/sccs2rcs.in: Rename from scc2rcs.csh
+ * src/cvsbug.in: Rename from cvsbug.sh
+
+ * contrib/clmerge.pl: Rename to clmerge.in
+ * contrib/cln_hist.pl: Rename to cln_hist.in
+ * contrib/commit_prep.pl: Rename to commit_prep.in
+ * contrib/cvs_acls.pl: Rename to cvs_acls.in
+ * contrib/log.pl: Rename to log.in
+ * contrib/log_accum.pl: Rename to log_accum.in
+ * contrib/mfpipe.pl: Rename to mfpipe.in
+ * contrib/rcslock.pl: Rename to rcslock.in
+ * contrib/sccs2rcs.csh: Rename to sccs2rcs.in
+ * src/cvsbug.sh: Rename to cvsbug.in
+
+2001-01-03 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.am (remotecheck): depend on 'all'
+ * Makefile.in: regenerated
+
+2001-01-03 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.in (DEP_FILES): Regenerated with new version of Automake
+ (DEP_FILES_conditional patch for BSD make compatibility)
+ * contrib/Makefile.in: ditto
+ * doc/Makefile.in: ditto
+ * lib/Makefile.in: ditto
+ * man/Makefile.in: ditto
+ * src/Makefile.in: ditto
+ * tools/Makefile.in: ditto
+ * vms/Makefile.in: ditto
+ * windows-NT/Makefile.in: ditto
+ * windows-NT/SCC/Makefile.in: ditto
+
+2000-12-28 Derek Price <derek.price@openavenue.com>
+
+ * INSTALL (BUILDING FROM SOURCES): Added a couple more platforms to the
+ build and test list.
+ (Building ... under Unix): Added note about BSD make and
+ --disable-dependency-tracking
+ (Building ... under Windows ...): Added note about using MSVC++ 6.0
+ (Building [on] other platforms): Added note about wincvs.org and
+ cvsnt.org. Added more complete note about BSD make and
+ --disable-dependency-tracking than the above
+
+2000-12-27 Derek Price <derek.price@openavenue.com>
+
+ * NEWS: Fix comments about the changes to ~/.cvspass
+
+2000-12-26 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.am (EXTRA_DIST): Add cvs.spec.in
+ (cvs.spec): new target
+ * Makefile.in: Regenerated
+ * aclocal.m4: update timestamp
+ * configure: Regenerated
+ * configure.in (AC_OUTPUT): Remove cvs.spec, doc/CVSvn.texi,
+ & src/version.c
+ * stamp-h1.in: update timestamp
+ * contrib/Makefile.in: ditto
+ * lib/Makefile.in: ditto
+ * man/Makefile.in: ditto
+ * tools/Makefile.in: ditto
+ * vms/Makefile.in: ditto
+ * windows-NT/Makefile.in: ditto
+ * windows-NT/SCC/Makefile.in: ditto
+
+2000-12-22 Derek Price <derek.price@openavenue.com>
+
+ * configure.in (AC_OUTPUT): Stretched
+ * configure: Regenerated
+
+2000-12-22 Derek Price <derek.price@openavenue.com>
+
+ * aclocal.m4: Regenerated due to Automake update
+
+2000-12-22 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.in: Regenerated
+ * aclocal.m4: Regenerated due to a change to AM_PROG_ETAGS
+ * configure: Regenerated
+
+2000-12-21 Derek Price <derek.price@openavenue.com>
+
+ * .cvsignore: removed newly unused files, added new stamp file,
+ and alphabetized.
+ * AUTHORS: Added this file to please Automake. Apparently, its
+ presence is mandated by the GNU coding standards.
+ * Makefile.am: New file needed by Automake
+ * Makefile.in: Regenerated
+ * NEWS: Add a comment about the Automake conversion
+ * aclocal.m4: Added this file for Automake
+ * config.h.in: Regenerated
+ * configure: Regenerated
+ * configure.in: Some changes to support Automake and support for
+ missing roff & ps2pdf programs.
+ * cvs.spec: Regenerated
+ * cvs.spec.in: New file leveraging Automake support
+ * depcomp: New Automake file
+ * install-sh: Newer version from Automake
+ * missing: New Automake file
+ * mkinstalldirs: Newer version from Automake
+ * stamp-h.in: Remove unused file
+ * stamp-h1.in: New Automake generated stamp file
+
+2000-11-30 Derek Price <derek.price@openavenue.com>
+ Stephen Kennedy <Stephen.Kennedy@havok.com>
+
+ * cvs.spec (krb5): Require krb5-devel for a build of the krb5 target
+
+2000-11-29 Derek Price <derek.price@openavenue.com>
+ Stephen Kennedy <Stephen.Kennedy@havok.com>
+
+ * cvs.spec (build, post, preun): remove an old, commented out
+ line and replace hardcoded paths with _infodir and _bindir as
+ appropriate
+ (files): replace file list with more generic and succinct one
+
+2000-11-15 Derek Price <derek.price@openavenue.com>
+
+ * TODO (198): added note about deprecating cvs_temp_name
+ * configure.in (AC_CHECK_FUNCS): added mkstemp to support
+ new cvs_temp_file function.
+ * config.h.in: regenerated
+ * configure: regenerated
+
+2000-11-08 Larry Jones <larry.jones@sdrc.com>
+
+ * configure.in: Check for getgroups function.
+ * configure, config.h.in: Regenerated.
+
+2000-11-07 Larry Jones <larry.jones@sdrc.com>
+
+ * Makefile.in (FLAGS_TO_PASS): Add INSTALL, INSTALL_DATA, and
+ INSTALL_PROGRAM.
+ (Reported by Christian Brechbuehler <christian@arsdigita.com>.)
+
+2000-11-03 Derek Price <derek.price@openavenue.com>
+
+ * cvs.spec (build): pass in --without-gssapi when configuring the main
+ package so that the Kerberized version of CVS doesn't get built when
+ the user happens to have Kerberos installed in the default location.
+
+2000-10-31 Derek Price <derek.price@openavenue.com>
+
+ * NEWS: Mention zlib was updated to 1.1.3.
+
+2000-10-30 Derek Price <derek.price@openavenue.com>
+
+ * cvs.spec: Fixed trapping for gssapi so that the RPM can be built
+ on a machine without Kerberos. Should now build standard RPM on a
+ machine without Kerberos and the standard RPM + the Kerberos RPM on
+ a machine with the Kerberos devel libraries.
+
+2000-10-26 Larry Jones <larry.jones@sdrc.com>
+
+ * configure.in: Get path to pr for diff.
+ (Patch submitted by Urs Thuermann <urs@isnogud.escape.de>.)
+ * configure: Regenerated.
+
+2000-10-18 Derek Price <derek.price@openavenue.com>
+
+ * .cvsignore: Added .fname & .version, two temporary files used in spec
+ file creation.
+ * Makefile.in (distclean-local): clean .fname & .version
+ * cvs.spec: Replaced with a new version based on RedHat 6.2's spec file
+ for cvs 1.10.7. Edited heavily to include a krb5 subpackage for the
+ gssapi binary and fixed RedHat's info and man file placement.
+
+2000-10-17 Derek Price <derek.price@openavenue.com>
+
+ * NEWS: added a comment about the new CVSROOT format for pserver.
+
+2000-10-17 Derek Price <derek.price@openavenue.com>
+
+ * NEWS: added a comment about the new format of ~/.cvspass
+
+2000-10-09 Derek Price <derek.price@openavenue.com>
+
+ * cvsnt.mak: Some minor changes to allow CVS to compile correctly
+ under NT and Visual C++ 6.0.
+
2000-09-07 Larry Jones <larry.jones@sdrc.com>
* Makefile.in: Use @bindir@, @libdir@, @infodir@, and @mandir@
diff --git a/gnu/usr.bin/cvs/INSTALL b/gnu/usr.bin/cvs/INSTALL
index 1a1da8c99e6..589599ed1de 100644
--- a/gnu/usr.bin/cvs/INSTALL
+++ b/gnu/usr.bin/cvs/INSTALL
@@ -134,6 +134,8 @@ i386 family:
Linux (kernel 1.2.x) (1.8.86)
Linux (kernel 2.0.x, RedHat 4.2) (1.10)
Linux (kernel 2.0.x, RedHat 5.x) (1.10)
+ Linux (kernel 2.2.x, RedHat 6.x) (1.10.8)
+ Linux (kernel 2.2.x, RedHat 7.x) (1.11)
BSDI 4.0 (1.10.7)
FreeBSD 2.1.5-stable (1.8.87)
NextSTEP 3.3 (1.7)
@@ -146,6 +148,7 @@ i386 family:
Windows NT 3.51 service pack 4 (1.9)
Windows NT 3.51 service pack 5 (1.9) -- DOES NOT WORK (footnote 11)
Windows NT 4.0 (1.9 client and local)
+ Windows NT 4.0 (1.11 client and local - build & test, but no test suite)
Windows 95 (1.9 client and local)
QNX (1.9.1 + patches for strippath() and va_list)
OS/2 Version 3 using IBM C/C++ Tools 2.01 (1.8.86 + patches, client)
@@ -284,6 +287,14 @@ Building from source code under Unix:
the --enable-encryption option. This option is disabled by
default.
+ If you want to disable automatic dependency tracking in the makefiles,
+ use the '--disable-dependency-tracking' option:
+
+ $ ./configure --disable-dependency-tracking
+
+ This avoids problems on some platforms. See the note at the end of this
+ file on BSD.
+
Try './configure --help' for further information on its usage.
NOTE ON CVS's USE OF NDBM:
@@ -390,7 +401,7 @@ behaviour:
-------------------------------------------------------------------------------
-Building from source code under Windows NT/95:
+Building from source code under Windows NT/95/98/2000:
You may find interesting information in windows-NT/README.
@@ -401,6 +412,14 @@ You may find interesting information in windows-NT/README.
3) MSVC will place the executable file cvs.exe in WinRel, or whatever
your target directory is.
+* From the top level directory, with MSVC++ 6.0 installed, something like the
+following also works:
+
+ C:\> vcvars32
+ C:\> nmake /f cvsnt.mak CFG="cvsnt - Win32 Debug"
+
+* You might also try http://wincvs.org & http://www.cvsnt.org
+
-------------------------------------------------------------------------------
Building from source code under other platforms:
@@ -409,10 +428,25 @@ For OS/2, see os2/README and emx/README.
For VMS, see README.VMS
-For Macintosh, see macintosh/README.MacCVS
+For Macintosh, see macintosh/README.MacCVS, or, since that file isn't there
+anymore, you might try http://wincvs.org .
For a Java client, see jCVS (which is a separate package from CVS
itself, but which might be preferable to the Macintosh port mentioned
above, for example).
+ **** ****
+
+Builds are breaking on some systems (notably,
+BSD/OS thor.sdrc.com 4.0.1 BSDI BSD/OS 4.0.1 Kernel #3: Thu Mar 9 11:29:16 EST 2000
+) due to Automake's dependency tracking code. The work around for this is to
+comile without it by passing the '--disable-dependency-tracking' option to
+configure:
+
+ $ ./configure --disable-dependency-tracking
+
+This will allow a compile but make will no longer be tracking header
+dependencies. This means that if you make any changes to header files you may
+have to run 'make clean' before running a 'make' to get everything to compile.
+
-------------------------------------------------------------------------------
diff --git a/gnu/usr.bin/cvs/Makefile.am b/gnu/usr.bin/cvs/Makefile.am
new file mode 100644
index 00000000000..90b7324f761
--- /dev/null
+++ b/gnu/usr.bin/cvs/Makefile.am
@@ -0,0 +1,66 @@
+## Process this file with automake to produce Makefile.in
+# Master Makefile for the GNU Concurrent Versions System.
+# Copyright (C) 1986, 1988-1992, 1994, 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+AUTOMAKE_OPTIONS = 1.4a dist-bzip2
+
+## Subdirectories to run make in for the primary targets.
+# Unix source subdirs, where we'll want to run lint and etags:
+# This is a legacy variable from b4 Automake
+USOURCE_SUBDIRS = lib zlib diff src
+# All other subdirs:
+SUBDIRS = $(USOURCE_SUBDIRS) man doc contrib tools \
+ windows-NT os2 emx vms
+
+EXTRA_DIST = \
+ .cvsignore \
+ BUGS \
+ ChangeLog.zoo \
+ DEVEL-CVS \
+ FAQ \
+ HACKING \
+ MINOR-BUGS \
+ PROJECTS \
+ README.VMS \
+ TESTS \
+ build.com \
+ cvs-format.el \
+ cvs.spec \
+ cvs.spec.in \
+ cvsnt.dsp \
+ cvsnt.dsw \
+ cvsnt.mak
+
+.PHONY: remotecheck
+remotecheck: all
+ cd src && $(MAKE) $(AM_MAKEFLAGS) "$@"
+
+.PHONY: doc
+doc:
+ cd doc && $(MAKE) $(AM_MAKEFLAGS) "$@"
+
+## MAINTAINER Targets
+
+## cvs.spec ##
+# - cvs.spec needs to be updated only once, since it depends on
+# configure.in, not on the results of a 'configure' run.
+# - It is guaranteed (with GNU Make) that when the version in configure.in
+# is changed, acversion.m4 is built only after the new version number is
+# propagated to the Makefile. (Libtool uses the same guarantee.)
+cvs.spec: $(srcdir)/cvs.spec.in $(top_srcdir)/configure.in
+ sed 's,@VERSION\@,$(VERSION),g' $(srcdir)/cvs.spec.in >cvs.tspec
+ mv cvs.tspec $(srcdir)/cvs.spec
+
+# for backwards compatibility with the old makefiles
+.PHONY: realclean
+realclean: maintainer-clean
diff --git a/gnu/usr.bin/cvs/NEWS b/gnu/usr.bin/cvs/NEWS
index cd5ad8717ad..cf6d4d5fc8d 100644
--- a/gnu/usr.bin/cvs/NEWS
+++ b/gnu/usr.bin/cvs/NEWS
@@ -1,3 +1,45 @@
+Changes since 1.11.1:
+
+* Read only access was broken - now fixed.
+
+Changes since 1.11:
+
+* There was a bug in the diff code which caused conflicts to be flagged which shouldn't
+have been. This has been fixed.
+
+* New "cvs rlog" and "cvs rannotate" commands have been added to get log
+messages and annotations without having to have a checked-out copy.
+
+* The VMS client now accepts wildcards if you're running VMS 7.x.
+
+* ZLIB has been updated to version 1.1.3, the most current version. This
+includes mostly some optimizations and minor bug fixes.
+
+* The ~/.cvspass file has a slightly modified format. CVSROOTs are now
+stored in a new canonical form - hostnames are now case insensitive and port
+numbers are always stored in the new format. Until a new login for a
+particular CVSROOT is performed with the new version of CVS, new and old
+versions of CVS should interoperate invisibly. After that point, an extra login
+using the old version of CVS may be necessary to continue to allow the new and
+old versions of CVS to interoperate using the same ~/.cvspass file and CVSROOT.
+The exception to this rule occurs when the CVSROOTs used with the different
+versions use case insensitively different hostnames, for example, "empress",
+and "empress.2-wit.com".
+
+* A password and a port number may now be specified in CVSROOT for pserver
+connections. The new format is:
+
+ :pserver:[[user][:password]@]host[:[port]]/path
+
+Note that passwords specified in a checkout command will be saved in the clear
+in the CVS/Root file in each created directory, so this is not recommended,
+except perhaps when accessing anonymous repositories or the like.
+
+* The distribution has been converted to use Automake. This shouldn't affect
+most users except to ease some portability concerns, but if you are building
+from the repository and encounter problems with the makefiles, you might try
+running ./noautoconf.sh after a fresh update -AC.
+
Changes since 1.10:
* The new "cvs version" command gives a short version message. If
diff --git a/gnu/usr.bin/cvs/TODO b/gnu/usr.bin/cvs/TODO
index 06d1ebc1d10..1747b684cca 100644
--- a/gnu/usr.bin/cvs/TODO
+++ b/gnu/usr.bin/cvs/TODO
@@ -790,3 +790,26 @@ reduced to zero, and the client need not even contact the server.
196. Using a CVSROOT with a trailing slash will confuse CVS. I think
we need to add a call to strip_trailing_slashes in root.c
(parse_cvsroot), but I haven't considered all of the ramifications.
+
+197. Analyze the difference between CVS_UNLINK & unlink_file. As far as I
+can tell, unlink_file aborts in noexec mode and CVS_UNLINK does not. I'm not
+sure it would be possible to remove even the use of temp files in noexec mode,
+but most unlinks should probably be using unlink_file and not CVS_UNLINK.
+
+198. Remove references to deprecated cvs_temp_name function.
+
+199. Add test for login & logout functionality, including support for
+backwards compatibility with old CVSROOTs.
+
+200. Make a 'cvs add' without write access a non-fatal error so that the
+user's Entries file is updated and future 'cvs diffs' will work properly. This
+should ease patch submission.
+
+201. cvs_temp_file should be creating temporary files in a privately owned
+subdirectory of of temp due to security issues on some systems.
+
+**
+202. Merge most of the diff & rdiff code. Enable rdiff to accept most diff
+options. Make rdiff output look like diff's. Make diff garbage go to stderr
+and only standard diff output go to stdout.
+** In progress - DRP
diff --git a/gnu/usr.bin/cvs/acconfig.h b/gnu/usr.bin/cvs/acconfig.h
index 15589e8f7a3..de9d3792b74 100644
--- a/gnu/usr.bin/cvs/acconfig.h
+++ b/gnu/usr.bin/cvs/acconfig.h
@@ -1,13 +1,6 @@
/* Define if you have MIT Kerberos version 4 available. */
#undef HAVE_KERBEROS
-/* Define if you have GSSAPI with MIT Kerberos version 5 available. */
-#undef HAVE_GSSAPI
-
-/* Define if GSS_C_NT_HOSTBASED_SERVICE is defined in the gssapi.h
- header file. Only relevant when using GSSAPI. */
-#undef HAVE_GSS_C_NT_HOSTBASED_SERVICE
-
/* Define if you want CVS to be able to be a remote repository client. */
#undef CLIENT_SUPPORT
diff --git a/gnu/usr.bin/cvs/acinclude.m4 b/gnu/usr.bin/cvs/acinclude.m4
new file mode 100644
index 00000000000..9968adf4d67
--- /dev/null
+++ b/gnu/usr.bin/cvs/acinclude.m4
@@ -0,0 +1,231 @@
+/* This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details. */
+
+AC_DEFUN(ACX_WITH_GSSAPI,[
+#
+# Use --with-gssapi[=DIR] to enable GSSAPI support.
+#
+# defaults to enabled with DIR in default list below
+#
+# Search for /SUNHEA/ and read the comments about this default below.
+#
+AC_ARG_WITH([gssapi],
+ [ --with-gssapi=value GSSAPI directory],
+ [acx_gssapi_withgssapi=$withval], [acx_gssapi_withgssapi=yes])dnl
+
+dnl
+dnl FIXME - cache withval and obliterate later cache values when options change
+dnl
+#
+# Try to locate a GSSAPI installation if no location was specified, assuming
+# GSSAPI was enabled (the default).
+#
+if test -n "$acx_gssapi_cv_gssapi"; then
+ # Granted, this is a slightly ugly way to print this info, but the
+ # AC_CHECK_HEADER used in the search for a GSSAPI installation makes using
+ # AC_CACHE_CHECK worse
+ AC_MSG_CHECKING([for GSSAPI])
+else :; fi
+AC_CACHE_VAL([acx_gssapi_cv_gssapi], [
+if test x$acx_gssapi_withgssapi = xyes; then
+ # --with but no location specified
+ # assume a gssapi.h or gssapi/gssapi.h locates our install.
+ #
+ # This isn't always strictly true. For instance Solaris 7's SUNHEA (header)
+ # package installs gssapi.h whether or not the necessary libraries are
+ # installed. I'm still not sure whether to consider this a bug. The long
+ # way around is to not consider GSSPAI installed unless gss_import_name is
+ # found, but that brings up a lot of other hassles, like continuing to let
+ # gcc & ld generate the error messages when the user uses --with-gssapi=dir
+ # as a debugging aid. The short way around is to disable GSSAPI by default,
+ # but I think Sun users have been faced with this for awhile and I haven't
+ # heard many complaints.
+ acx_gssapi_save_CPPFLAGS=$CPPFLAGS
+ for acx_gssapi_cv_gssapi in yes /usr/kerberos /usr/cygnus/kerbnet no; do
+ if test x$acx_gssapi_cv_gssapi = xno; then
+ break
+ fi
+ if test x$acx_gssapi_cv_gssapi = xyes; then
+ AC_CHECKING([for GSSAPI])
+ else
+ CPPFLAGS="$acx_gssapi_save_CPPFLAGS -I$acx_gssapi_cv_gssapi/include"
+ AC_CHECKING([for GSSAPI in $acx_gssapi_cv_gssapi])
+ fi
+ unset ac_cv_header_gssapi_h
+ unset ac_cv_header_gssapi_gssapi_h
+ AC_CHECK_HEADERS([gssapi.h gssapi/gssapi.h])
+ if test "$ac_cv_header_gssapi_h" = "yes" ||
+ test "$ac_cv_header_gssapi_gssapi_h" = "yes"; then
+ break
+ fi
+ done
+ CPPFLAGS=$acx_gssapi_save_CPPFLAGS
+else
+ acx_gssapi_cv_gssapi=$acx_gssapi_withgssapi
+fi
+AC_MSG_CHECKING([for GSSAPI])
+])dnl
+AC_MSG_RESULT([$acx_gssapi_cv_gssapi])
+
+#
+# Set up GSSAPI includes for later use. We don't bother to check for
+# $acx_gssapi_cv_gssapi=no here since that will be caught later.
+#
+if test x$acx_gssapi_cv_gssapi = yes; then
+ # no special includes necessary
+ GSSAPI_INCLUDES=""
+else
+ # GSSAPI at $acx_gssapi_cv_gssapi (could be 'no')
+ GSSAPI_INCLUDES=" -I$acx_gssapi_cv_gssapi/include"
+fi
+
+#
+# Get the rest of the information CVS needs to compile with GSSAPI support
+#
+if test x$acx_gssapi_cv_gssapi != xno; then
+ # define HAVE_GSSAPI and set up the includes
+ AC_DEFINE([HAVE_GSSAPI],, [Define if you have GSSAPI with Kerberos version 5 available.])
+ includeopt=$includeopt$GSSAPI_INCLUDES
+
+ # locate any other headers
+ acx_gssapi_save_CPPFLAGS=$CPPFLAGS
+ CPPFLAGS=$CPPFLAGS$GSSAPI_INCLUDES
+ dnl We don't use HAVE_KRB5_H anywhere, but including it here might make it
+ dnl easier to spot errors by reading configure output
+ AC_CHECK_HEADERS([gssapi.h gssapi/gssapi.h gssapi/gssapi_generic.h krb5.h])
+ # And look through them for GSS_C_NT_HOSTBASED_SERVICE or its alternatives
+ AC_CACHE_CHECK([for GSS_C_NT_HOSTBASED_SERVICE], [acx_gssapi_cv_gss_c_nt_hostbased_service],
+ [acx_gssapi_cv_gss_c_nt_hostbased_service=no
+ if test "$ac_cv_header_gssapi_h" = "yes"; then
+ AC_EGREP_HEADER([GSS_C_NT_HOSTBASED_SERVICE], [gssapi.h],
+ [acx_gssapi_cv_gss_c_nt_hostbased_service=yes],
+ AC_EGREP_HEADER([gss_nt_service_name], [gssapi.h],
+ [acx_gssapi_cv_gss_c_nt_hostbased_service=gss_nt_service_name]))
+ fi
+ if test $acx_gssapi_cv_gss_c_nt_hostbased_service = no &&
+ test "$ac_cv_header_gssapi_gssapi_h" = "yes"; then
+ AC_EGREP_HEADER([GSS_C_NT_HOSTBASED_SERVICE], [gssapi/gssapi.h],
+ [acx_gssapi_cv_gss_c_nt_hostbased_service],
+ AC_EGREP_HEADER([gss_nt_service_name], [gssapi/gssapi.h],
+ [acx_gssapi_cv_gss_c_nt_hostbased_service=gss_nt_service_name]))
+ fi
+ if test $acx_gssapi_cv_gss_c_nt_hostbased_service = no &&
+ test "$ac_cv_header_gssapi_gssapi_generic_h" = "yes"; then
+ AC_EGREP_HEADER([GSS_C_NT_HOSTBASED_SERVICE], [gssapi/gssapi_generic.h],
+ [acx_gssapi_cv_gss_c_nt_hostbased_service],
+ AC_EGREP_HEADER([gss_nt_service_name], [gssapi/gssapi_generic.h],
+ [acx_gssapi_cv_gss_c_nt_hostbased_service=gss_nt_service_name]))
+ fi])
+ if test $acx_gssapi_cv_gss_c_nt_hostbased_service != yes &&
+ test $acx_gssapi_cv_gss_c_nt_hostbased_service != no; then
+ # don't define for yes since that means it already means something and
+ # don't define for no since we'd rather the compiler catch the error
+ AC_DEFINE_UNQUOTED([GSS_C_NT_HOSTBASED_SERVICE], [$acx_gssapi_cv_gss_c_nt_hostbased_service],
+[Define to an alternative value if GSS_C_NT_HOSTBASED_SERVICE isn't defined
+in the gssapi.h header file. MIT Kerberos 1.2.1 requires this. Only relevant
+when using GSSAPI.])
+ fi
+ CPPFLAGS=$acx_gssapi_save_CPPFLAGS
+
+ # Expect the libs to be installed parallel to the headers
+ #
+ # We could try once with and once without, but I'm not sure it's worth the
+ # trouble.
+ if test x$acx_gssapi_cv_gssapi != xyes; then
+ if test -z "$LIBS"; then
+ LIBS="-L$acx_gssapi_cv_gssapi/lib"
+ else
+ LIBS="-L$acx_gssapi_cv_gssapi/lib $LIBS"
+ fi
+ else :; fi
+
+ dnl What happens if we want to enable, say, krb5 and some other GSSAPI
+ dnl authentication method at the same time?
+ #
+ # Some of the order below is particular due to library dependencies
+ #
+
+ #
+ # des Heimdal K 0.3d, but Heimdal seems to be set up such
+ # that it could have been installed from elsewhere.
+ #
+ AC_SEARCH_LIBS([des_set_odd_parity], [des])
+
+ #
+ # com_err Heimdal K 0.3d
+ #
+ # com_err MIT K5 v1.2.2-beta1
+ #
+ AC_SEARCH_LIBS([com_err], [com_err])
+
+ #
+ # asn1 Heimdal K 0.3d -lcom_err
+ #
+ AC_SEARCH_LIBS([initialize_asn1_error_table_r], [asn1])
+
+ #
+ # resolv required, but not installed by Heimdal K 0.3d
+ #
+ # resolv MIT K5 1.2.2-beta1
+ # Linux 2.2.17
+ #
+ AC_SEARCH_LIBS([__dn_expand], [resolv])
+
+ #
+ # roken Heimdal K 0.3d -lresolv
+ #
+ AC_SEARCH_LIBS([roken_gethostbyaddr], [roken])
+
+ #
+ # k5crypto MIT K5 v1.2.2-beta1
+ #
+ AC_SEARCH_LIBS([valid_enctype], [k5crypto])
+
+ #
+ # gen ? ? ? Needed on Irix 5.3 with some
+ # Irix 5.3 version of Kerberos. I'm not
+ # sure which since Irix didn't
+ # get any testing this time
+ # around. Original comment:
+ #
+ # This is necessary on Irix 5.3, in order to link against libkrb5 --
+ # there, an_to_ln.o refers to things defined only in -lgen.
+ #
+ AC_SEARCH_LIBS([compile], [gen])
+
+ #
+ # krb5 ? ? ? -lgen -l???
+ # Irix 5.3
+ #
+ # krb5 MIT K5 v1.1.1
+ #
+ # krb5 MIT K5 v1.2.2-beta1 -lcrypto -lcom_err
+ # Linux 2.2.17
+ #
+ # krb5 MIT K5 v1.2.2-beta1 -lcrypto -lcom_err -lresolv
+ #
+ # krb5 Heimdal K 0.3d -lasn1 -lroken -ldes
+ #
+ AC_SEARCH_LIBS([krb5_free_context], [krb5])
+
+ #
+ # gssapi_krb5 Only lib needed with MIT K5 v1.2.1, so find it first in
+ # order to prefer MIT Kerberos. If both MIT & Heimdal
+ # Kerberos are installed and in the path, this will leave
+ # some of the libraries above in LIBS unnecessarily, but
+ # noone would ever do that, right?
+ #
+ # gssapi_krb5 MIT K5 v1.2.2-beta1 -lkrb5
+ #
+ # gssapi Heimdal K 0.3d -lkrb5
+ #
+ AC_SEARCH_LIBS([gss_import_name], [gssapi_krb5 gssapi])
+fi
+])dnl
diff --git a/gnu/usr.bin/cvs/aclocal.m4 b/gnu/usr.bin/cvs/aclocal.m4
new file mode 100644
index 00000000000..a9c5488653f
--- /dev/null
+++ b/gnu/usr.bin/cvs/aclocal.m4
@@ -0,0 +1,861 @@
+# aclocal.m4 generated automatically by aclocal 1.4e
+
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000
+# Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+/* This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details. */
+
+AC_DEFUN(ACX_WITH_GSSAPI,[
+#
+# Use --with-gssapi[=DIR] to enable GSSAPI support.
+#
+# defaults to enabled with DIR in default list below
+#
+# Search for /SUNHEA/ and read the comments about this default below.
+#
+AC_ARG_WITH([gssapi],
+ [ --with-gssapi=value GSSAPI directory],
+ [acx_gssapi_withgssapi=$withval], [acx_gssapi_withgssapi=yes])dnl
+
+dnl
+dnl FIXME - cache withval and obliterate later cache values when options change
+dnl
+#
+# Try to locate a GSSAPI installation if no location was specified, assuming
+# GSSAPI was enabled (the default).
+#
+if test -n "$acx_gssapi_cv_gssapi"; then
+ # Granted, this is a slightly ugly way to print this info, but the
+ # AC_CHECK_HEADER used in the search for a GSSAPI installation makes using
+ # AC_CACHE_CHECK worse
+ AC_MSG_CHECKING([for GSSAPI])
+else :; fi
+AC_CACHE_VAL([acx_gssapi_cv_gssapi], [
+if test x$acx_gssapi_withgssapi = xyes; then
+ # --with but no location specified
+ # assume a gssapi.h or gssapi/gssapi.h locates our install.
+ #
+ # This isn't always strictly true. For instance Solaris 7's SUNHEA (header)
+ # package installs gssapi.h whether or not the necessary libraries are
+ # installed. I'm still not sure whether to consider this a bug. The long
+ # way around is to not consider GSSPAI installed unless gss_import_name is
+ # found, but that brings up a lot of other hassles, like continuing to let
+ # gcc & ld generate the error messages when the user uses --with-gssapi=dir
+ # as a debugging aid. The short way around is to disable GSSAPI by default,
+ # but I think Sun users have been faced with this for awhile and I haven't
+ # heard many complaints.
+ acx_gssapi_save_CPPFLAGS=$CPPFLAGS
+ for acx_gssapi_cv_gssapi in yes /usr/kerberos /usr/cygnus/kerbnet no; do
+ if test x$acx_gssapi_cv_gssapi = xno; then
+ break
+ fi
+ if test x$acx_gssapi_cv_gssapi = xyes; then
+ AC_CHECKING([for GSSAPI])
+ else
+ CPPFLAGS="$acx_gssapi_save_CPPFLAGS -I$acx_gssapi_cv_gssapi/include"
+ AC_CHECKING([for GSSAPI in $acx_gssapi_cv_gssapi])
+ fi
+ unset ac_cv_header_gssapi_h
+ unset ac_cv_header_gssapi_gssapi_h
+ AC_CHECK_HEADERS([gssapi.h gssapi/gssapi.h])
+ if test "$ac_cv_header_gssapi_h" = "yes" ||
+ test "$ac_cv_header_gssapi_gssapi_h" = "yes"; then
+ break
+ fi
+ done
+ CPPFLAGS=$acx_gssapi_save_CPPFLAGS
+else
+ acx_gssapi_cv_gssapi=$acx_gssapi_withgssapi
+fi
+AC_MSG_CHECKING([for GSSAPI])
+])dnl
+AC_MSG_RESULT([$acx_gssapi_cv_gssapi])
+
+#
+# Set up GSSAPI includes for later use. We don't bother to check for
+# $acx_gssapi_cv_gssapi=no here since that will be caught later.
+#
+if test x$acx_gssapi_cv_gssapi = yes; then
+ # no special includes necessary
+ GSSAPI_INCLUDES=""
+else
+ # GSSAPI at $acx_gssapi_cv_gssapi (could be 'no')
+ GSSAPI_INCLUDES=" -I$acx_gssapi_cv_gssapi/include"
+fi
+
+#
+# Get the rest of the information CVS needs to compile with GSSAPI support
+#
+if test x$acx_gssapi_cv_gssapi != xno; then
+ # define HAVE_GSSAPI and set up the includes
+ AC_DEFINE([HAVE_GSSAPI],, [Define if you have GSSAPI with Kerberos version 5 available.])
+ includeopt=$includeopt$GSSAPI_INCLUDES
+
+ # locate any other headers
+ acx_gssapi_save_CPPFLAGS=$CPPFLAGS
+ CPPFLAGS=$CPPFLAGS$GSSAPI_INCLUDES
+ dnl We don't use HAVE_KRB5_H anywhere, but including it here might make it
+ dnl easier to spot errors by reading configure output
+ AC_CHECK_HEADERS([gssapi.h gssapi/gssapi.h gssapi/gssapi_generic.h krb5.h])
+ # And look through them for GSS_C_NT_HOSTBASED_SERVICE or its alternatives
+ AC_CACHE_CHECK([for GSS_C_NT_HOSTBASED_SERVICE], [acx_gssapi_cv_gss_c_nt_hostbased_service],
+ [acx_gssapi_cv_gss_c_nt_hostbased_service=no
+ if test "$ac_cv_header_gssapi_h" = "yes"; then
+ AC_EGREP_HEADER([GSS_C_NT_HOSTBASED_SERVICE], [gssapi.h],
+ [acx_gssapi_cv_gss_c_nt_hostbased_service=yes],
+ AC_EGREP_HEADER([gss_nt_service_name], [gssapi.h],
+ [acx_gssapi_cv_gss_c_nt_hostbased_service=gss_nt_service_name]))
+ fi
+ if test $acx_gssapi_cv_gss_c_nt_hostbased_service = no &&
+ test "$ac_cv_header_gssapi_gssapi_h" = "yes"; then
+ AC_EGREP_HEADER([GSS_C_NT_HOSTBASED_SERVICE], [gssapi/gssapi.h],
+ [acx_gssapi_cv_gss_c_nt_hostbased_service],
+ AC_EGREP_HEADER([gss_nt_service_name], [gssapi/gssapi.h],
+ [acx_gssapi_cv_gss_c_nt_hostbased_service=gss_nt_service_name]))
+ fi
+ if test $acx_gssapi_cv_gss_c_nt_hostbased_service = no &&
+ test "$ac_cv_header_gssapi_gssapi_generic_h" = "yes"; then
+ AC_EGREP_HEADER([GSS_C_NT_HOSTBASED_SERVICE], [gssapi/gssapi_generic.h],
+ [acx_gssapi_cv_gss_c_nt_hostbased_service],
+ AC_EGREP_HEADER([gss_nt_service_name], [gssapi/gssapi_generic.h],
+ [acx_gssapi_cv_gss_c_nt_hostbased_service=gss_nt_service_name]))
+ fi])
+ if test $acx_gssapi_cv_gss_c_nt_hostbased_service != yes &&
+ test $acx_gssapi_cv_gss_c_nt_hostbased_service != no; then
+ # don't define for yes since that means it already means something and
+ # don't define for no since we'd rather the compiler catch the error
+ AC_DEFINE_UNQUOTED([GSS_C_NT_HOSTBASED_SERVICE], [$acx_gssapi_cv_gss_c_nt_hostbased_service],
+[Define to an alternative value if GSS_C_NT_HOSTBASED_SERVICE isn't defined
+in the gssapi.h header file. MIT Kerberos 1.2.1 requires this. Only relevant
+when using GSSAPI.])
+ fi
+ CPPFLAGS=$acx_gssapi_save_CPPFLAGS
+
+ # Expect the libs to be installed parallel to the headers
+ #
+ # We could try once with and once without, but I'm not sure it's worth the
+ # trouble.
+ if test x$acx_gssapi_cv_gssapi != xyes; then
+ if test -z "$LIBS"; then
+ LIBS="-L$acx_gssapi_cv_gssapi/lib"
+ else
+ LIBS="-L$acx_gssapi_cv_gssapi/lib $LIBS"
+ fi
+ else :; fi
+
+ dnl What happens if we want to enable, say, krb5 and some other GSSAPI
+ dnl authentication method at the same time?
+ #
+ # Some of the order below is particular due to library dependencies
+ #
+
+ #
+ # des Heimdal K 0.3d, but Heimdal seems to be set up such
+ # that it could have been installed from elsewhere.
+ #
+ AC_SEARCH_LIBS([des_set_odd_parity], [des])
+
+ #
+ # com_err Heimdal K 0.3d
+ #
+ # com_err MIT K5 v1.2.2-beta1
+ #
+ AC_SEARCH_LIBS([com_err], [com_err])
+
+ #
+ # asn1 Heimdal K 0.3d -lcom_err
+ #
+ AC_SEARCH_LIBS([initialize_asn1_error_table_r], [asn1])
+
+ #
+ # resolv required, but not installed by Heimdal K 0.3d
+ #
+ # resolv MIT K5 1.2.2-beta1
+ # Linux 2.2.17
+ #
+ AC_SEARCH_LIBS([__dn_expand], [resolv])
+
+ #
+ # roken Heimdal K 0.3d -lresolv
+ #
+ AC_SEARCH_LIBS([roken_gethostbyaddr], [roken])
+
+ #
+ # k5crypto MIT K5 v1.2.2-beta1
+ #
+ AC_SEARCH_LIBS([valid_enctype], [k5crypto])
+
+ #
+ # gen ? ? ? Needed on Irix 5.3 with some
+ # Irix 5.3 version of Kerberos. I'm not
+ # sure which since Irix didn't
+ # get any testing this time
+ # around. Original comment:
+ #
+ # This is necessary on Irix 5.3, in order to link against libkrb5 --
+ # there, an_to_ln.o refers to things defined only in -lgen.
+ #
+ AC_SEARCH_LIBS([compile], [gen])
+
+ #
+ # krb5 ? ? ? -lgen -l???
+ # Irix 5.3
+ #
+ # krb5 MIT K5 v1.1.1
+ #
+ # krb5 MIT K5 v1.2.2-beta1 -lcrypto -lcom_err
+ # Linux 2.2.17
+ #
+ # krb5 MIT K5 v1.2.2-beta1 -lcrypto -lcom_err -lresolv
+ #
+ # krb5 Heimdal K 0.3d -lasn1 -lroken -ldes
+ #
+ AC_SEARCH_LIBS([krb5_free_context], [krb5])
+
+ #
+ # gssapi_krb5 Only lib needed with MIT K5 v1.2.1, so find it first in
+ # order to prefer MIT Kerberos. If both MIT & Heimdal
+ # Kerberos are installed and in the path, this will leave
+ # some of the libraries above in LIBS unnecessarily, but
+ # noone would ever do that, right?
+ #
+ # gssapi_krb5 MIT K5 v1.2.2-beta1 -lkrb5
+ #
+ # gssapi Heimdal K 0.3d -lkrb5
+ #
+ AC_SEARCH_LIBS([gss_import_name], [gssapi_krb5 gssapi])
+fi
+])dnl
+
+# Do all the work for Automake. This macro actually does too much --
+# some checks are only needed if your package does certain things.
+# But this isn't really a big deal.
+
+# serial 5
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery. Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# We require 2.13 because we rely on SHELL being computed by configure.
+AC_PREREQ([2.13])
+
+# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
+# -----------------------------------------------------------
+# If MACRO-NAME is provided do IF-PROVIDED, else IF-NOT-PROVIDED.
+# The purpose of this macro is to provide the user with a means to
+# check macros which are provided without letting her know how the
+# information is coded.
+# If this macro is not defined by Autoconf, define it here.
+ifdef([AC_PROVIDE_IFELSE],
+ [],
+ [define([AC_PROVIDE_IFELSE],
+ [ifdef([AC_PROVIDE_$1],
+ [$2], [$3])])])
+
+
+# AM_INIT_AUTOMAKE(PACKAGE,VERSION, [NO-DEFINE])
+# ----------------------------------------------
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_REQUIRE([AC_PROG_INSTALL])dnl
+# test to see if srcdir already configured
+if test "`CDPATH=:; cd $srcdir && pwd`" != "`pwd`" &&
+ test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run \"make distclean\" there first])
+fi
+
+# Define the identity of the package.
+PACKAGE=$1
+AC_SUBST(PACKAGE)dnl
+VERSION=$2
+AC_SUBST(VERSION)dnl
+ifelse([$3],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])
+
+# Autoconf 2.50 wants to disallow AM_ names. We explicitly allow
+# the ones we care about.
+ifdef([m4_pattern_allow],
+ [m4_pattern_allow([^AM_(C|CPP|CXX|OBJC|F|R|GCJ)FLAGS])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal)
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake)
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AM_MISSING_PROG(AMTAR, tar)
+AM_MISSING_INSTALL_SH
+AM_PROG_INSTALL_STRIP
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_PROG_ETAGS])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_PROVIDE_IFELSE([AC_PROG_][CC],
+ [AM_DEPENDENCIES(CC)],
+ [define([AC_PROG_][CC],
+ defn([AC_PROG_][CC])[AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_][CXX],
+ [AM_DEPENDENCIES(CXX)],
+ [define([AC_PROG_][CXX],
+ defn([AC_PROG_][CXX])[AM_DEPENDENCIES(CXX)])])dnl
+])
+
+#
+# Check to make sure that the build environment is sane.
+#
+
+# serial 3
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+ if test "$[*]" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftest.file`
+ fi
+ if test "$[*]" != "X $srcdir/configure conftest.file" \
+ && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+alias in your environment])
+ fi
+
+ test "$[2]" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+rm -f conftest*
+AC_MSG_RESULT(yes)])
+
+
+# serial 2
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+
+# AM_MISSING_INSTALL_SH
+# ---------------------
+# Like AM_MISSING_PROG, but only looks for install-sh.
+AC_DEFUN([AM_MISSING_INSTALL_SH],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+if test -z "$install_sh"; then
+ for install_sh in "$ac_aux_dir/install-sh" \
+ "$ac_aux_dir/install.sh" \
+ "${am_missing_run}${ac_auxdir}/install-sh";
+ do
+ test -f "$install_sh" && break
+ done
+ # FIXME: an evil hack: we remove the SHELL invocation from
+ # install_sh because automake adds it back in. Sigh.
+ install_sh=`echo $install_sh | sed -e 's/\${SHELL}//'`
+fi
+AC_SUBST(install_sh)])
+
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it supports --run.
+# If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[test x"${MISSING+set}" = xset ||
+ MISSING="\${SHELL} `CDPATH=:; cd $ac_aux_dir && pwd`/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ am_backtick='`'
+ AC_MSG_WARN([${am_backtick}missing' script is too old or missing])
+fi
+])
+
+# AM_AUX_DIR_EXPAND
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to ${srcdir}/foo. In other projects, it is set to `.'.
+# Of course, Automake must honor this variable whenever it call a tool
+# from the auxiliary directory. The problem is that $srcdir (hence
+# $ac_aux_dir) can be either an absolute path or a path relative to
+# $top_srcdir or absolute, this depends on how configure is run. This
+# is pretty anoying since it makes $ac_aux_dir quite unusable in
+# subdirectories: on the top source directory, any form will work
+# fine, but in subdirectories relative pat needs to be adapted.
+# - calling $top_srcidr/$ac_aux_dir/missing would success if $srcdir is
+# relative, but fail if $srcdir is absolute
+# - conversly, calling $ax_aux_dir/missing would fail if $srcdir is
+# absolute, and success on relative paths.
+#
+# Consequently, we define and use $am_aux_dir, the "always absolute"
+# version of $ac_aux_dir.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND], [
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`CDPATH=:; cd $ac_aux_dir && pwd`
+])
+
+# One issue with vendor `install' (even GNU) is that you can't
+# specify the program used to strip binaries. This is especially
+# annoying in cross=compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so if we ever
+# need to use a non standard strip, we just have to make sure we use
+# install-sh with the STRIPPROG variable set.
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_MISSING_INSTALL_SH])
+dnl Don't test for $cross_compiling = yes, it might be `maybe'...
+# We'd like to do this but we can't because it will unconditionally
+# require config.guess. One way would be if autoconf had the capability
+# to let us compile in this code only when config.guess was already
+# a possibility.
+#if test "$cross_compiling" != no; then
+# # since we are cross-compiling, we need to check for a suitable `strip'
+# AM_PROG_STRIP
+# if test -z "$STRIP"; then
+# AC_MSG_WARN([strip missing, install-strip will not strip binaries])
+# fi
+#fi
+
+# If $STRIP is defined (either by the user, or by AM_PROG_STRIP),
+# instruct install-strip to use install-sh and the given $STRIP program.
+# Otherwise, just use ${INSTALL}: the idea is to use the vendor install
+# as much as possible, because it's faster.
+if test -z "$STRIP"; then
+ # The top level make will set INSTALL_PROGRAM=$(INSTALL_STRIP_PROGRAM)
+ # and the double dolard below is there to make sure that ${INSTALL}
+ # is substitued in the sub-makes, not at the top-level; this is
+ # needed if ${INSTALL} is a relative path (ajusted in each subdirectory
+ # by config.status).
+ INSTALL_STRIP_PROGRAM='$${INSTALL} -s'
+ INSTALL_STRIP_PROGRAM_ENV=''
+else
+ _am_dirpart="`echo $install_sh | sed -e 's,//*[[^/]]*$,,'`"
+ INSTALL_STRIP_PROGRAM="\${SHELL} \`CDPATH=: && cd $_am_dirpart && pwd\`/install-sh -c -s"
+ INSTALL_STRIP_PROGRAM_ENV="STRIPPROG='\$(STRIP)'"
+fi
+AC_SUBST([STRIP])
+AC_SUBST([INSTALL_STRIP_PROGRAM])
+AC_SUBST([INSTALL_STRIP_PROGRAM_ENV])])
+
+#AC_DEFUN([AM_PROG_STRIP],
+#[# Check for `strip', unless the installer
+# has set the STRIP environment variable.
+# Note: don't explicitly check for -z "$STRIP" here because
+# that will cause problems if AC_CANONICAL_* is AC_REQUIREd after
+# this macro, and anyway it doesn't have an effect anyway.
+#AC_CHECK_TOOL([STRIP],[strip])
+#])
+
+#
+# Find some information about the etags program
+#
+# Sets
+# ETAGS = path to etags
+# ETAGS_INCLUDE_OPTION = option to pass to etags with arg for includes
+#
+
+AC_DEFUN([AM_PROG_ETAGS],
+[AC_BEFORE([$0], [AM_PROG_ETAGS_WORKS])dnl
+AC_CHECK_PROG(ETAGS, etags, etags)
+if test -z "$ETAGS"; then
+ AC_CHECK_PROG(ETAGS, ctags, ctags -e)
+fi
+if test -n "$ETAGS"; then
+ AM_PROG_ETAGS_WORKS
+ if test "$am_cv_prog_etags_works" = yes ; then
+ AM_PROG_ETAGS_INCLUDE_OPTION
+ else
+ AM_MISSING_PROG(ETAGS, etags)
+ fi
+else
+ AM_MISSING_PROG(ETAGS, etags)
+fi])
+
+
+AC_DEFUN([AM_PROG_ETAGS_WORKS],
+[AC_CACHE_CHECK([whether ${ETAGS-etags} works], [am_cv_prog_etags_works],
+[cat >conftest.c <<EOF
+int globalvar;
+EOF
+if AC_TRY_COMMAND([${ETAGS-etags} -f - conftest.c |egrep ^int\ globalvar\; >&2]); then
+ am_cv_prog_etags_works=yes
+else
+ am_cv_prog_etags_works=no
+fi
+rm -f conftest.c])])
+
+AC_DEFUN([AM_PROG_ETAGS_INCLUDE_OPTION],
+[AC_REQUIRE([AM_PROG_ETAGS_WORKS])dnl
+if test "$am_cv_prog_etags_works" = yes ; then
+ AC_CACHE_CHECK([for etags include option],
+ [am_cv_prog_etags_include_option],
+ [cat >conftest.c <<EOF
+int globalvar;
+EOF
+ if AC_TRY_COMMAND([${ETAGS-etags} --etags-include=TAGS.inc -f - conftest.c |egrep ^TAGS.inc,include\$ >&2]); then
+ am_cv_prog_etags_include_option=--etags-include=
+ elif AC_TRY_COMMAND([${ETAGS-etags} -i TAGS.inc -f - conftest.c |egrep ^TAGS.inc,include\$ >&2]); then
+ am_cv_prog_etags_include_option='"-i "'
+ else :
+ # AC_MSG_ERROR(unfamiliar etags implementation)
+ fi
+ rm -f conftest.c])
+else
+ :
+fi
+ETAGS_INCLUDE_OPTION="$am_cv_prog_etags_include_option"
+AC_SUBST(ETAGS_INCLUDE_OPTION)])
+
+# serial 3
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery. Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+# AM_DEPENDENCIES(NAME)
+# ---------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX" or "OBJC".
+# We try a few techniques and use that to set a single cache variable.
+AC_DEFUN([AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+ifelse([$1], CC,
+ [AC_REQUIRE([AC_PROG_][CC])dnl
+AC_REQUIRE([AC_PROG_][CPP])
+depcc="$CC"
+depcpp="$CPP"],
+ [$1], CXX, [AC_REQUIRE([AC_PROG_][CXX])dnl
+AC_REQUIRE([AC_PROG_][CXXCPP])
+depcc="$CXX"
+depcpp="$CXXCPP"],
+ [$1], OBJC, [am_cv_OBJC_dependencies_compiler_type=gcc],
+ [AC_REQUIRE([AC_PROG_][$1])dnl
+depcc="$$1"
+depcpp=""])
+
+AC_REQUIRE([AM_MAKE_INCLUDE])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+ [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir confdir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" confdir
+ cd confdir
+
+ am_cv_$1_dependencies_compiler_type=none
+ for depmode in `sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < "./depcomp"`; do
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ echo '#include "conftest.h"' > conftest.c
+ echo 'int i;' > conftest.h
+
+ case "$depmode" in
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ none) break ;;
+ esac
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this.
+ if depmode="$depmode" \
+ source=conftest.c object=conftest.o \
+ depfile=conftest.Po tmpdepfile=conftest.TPo \
+ $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
+ grep conftest.h conftest.Po > /dev/null 2>&1; then
+ am_cv_$1_dependencies_compiler_type="$depmode"
+ break
+ fi
+ done
+
+ cd ..
+ rm -rf confdir
+else
+ am_cv_$1_dependencies_compiler_type=none
+fi
+])
+$1DEPMODE="depmode=$am_cv_$1_dependencies_compiler_type"
+AC_SUBST([$1DEPMODE])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in AM_DEPENDENCIES
+AC_DEFUN([AM_SET_DEPDIR],
+[if test -d .deps || mkdir .deps 2> /dev/null || test -d .deps; then
+ DEPDIR=.deps
+ # We redirect because .deps might already exist and be populated.
+ # In this situation we don't want to see an error.
+ rmdir .deps > /dev/null 2>&1
+else
+ DEPDIR=_deps
+fi
+AC_SUBST(DEPDIR)
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE(dependency-tracking,
+[ --disable-dependency-tracking Speeds up one-time builds
+ --enable-dependency-tracking Do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+pushdef([subst], defn([AC_SUBST]))
+subst(AMDEPBACKSLASH)
+popdef([subst])
+])
+
+# Generate code to set up dependency tracking.
+# This macro should only be invoked once -- use via AC_REQUIRE.
+# Usage:
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+
+#
+# This code is only required when automatic dependency tracking
+# is enabled. FIXME. This creates each `.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],[
+AC_OUTPUT_COMMANDS([
+test x"$AMDEP" != x"" ||
+for mf in $CONFIG_FILES; do
+ case "$mf" in
+ Makefile) dirpart=.;;
+ */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;;
+ *) continue;;
+ esac
+ grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
+ # Extract the definition of DEP_FILES from the Makefile without
+ # running `make'.
+ DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n -e '/^U = / s///p' < "$mf"`
+ test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
+ # We invoke sed twice because it is the simplest approach to
+ # changing $(DEPDIR) to its actual value in the expansion.
+ for file in `sed -n -e '
+ /^DEP_FILES = .*\\\\$/ {
+ s/^DEP_FILES = //
+ :loop
+ s/\\\\$//
+ p
+ n
+ /\\\\$/ b loop
+ p
+ }
+ /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`echo "$file" | sed -e 's|/[^/]*$||'`
+ $ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+done
+], [AMDEP="$AMDEP"
+ac_aux_dir="$ac_aux_dir"])])
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+doit:
+ @echo done
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+_am_include='#'
+_am_quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+ _am_include=include
+ _am_quote=
+ _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$_am_include" = "#"; then
+ echo '.include "confinc"' > confmf
+ if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+ _am_include=.include
+ _am_quote='"'
+ _am_result=BSD
+ fi
+fi
+AC_SUBST(_am_include)
+AC_SUBST(_am_quote)
+AC_MSG_RESULT($_am_result)
+rm -f confinc confmf
+])
+
+# serial 3
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+#
+# FIXME: Once using 2.50, use this:
+# m4_match([$1], [^TRUE\|FALSE$], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_DEFUN([AM_CONDITIONAL],
+[ifelse([$1], [TRUE],
+ [errprint(__file__:__line__: [$0: invalid condition: $1
+])dnl
+m4exit(1)])dnl
+ifelse([$1], [FALSE],
+ [errprint(__file__:__line__: [$0: invalid condition: $1
+])dnl
+m4exit(1)])dnl
+AC_SUBST([$1_TRUE])
+AC_SUBST([$1_FALSE])
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+else
+ $1_TRUE='#'
+ $1_FALSE=
+fi])
+
+# Like AC_CONFIG_HEADER, but automatically create stamp file.
+
+# serial 3
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated. We must strip everything past the first ":",
+# and everything past the last "/".
+
+AC_PREREQ([2.12])
+
+AC_DEFUN([AM_CONFIG_HEADER],
+[ifdef([AC_FOREACH],dnl
+ [dnl init our file count if it isn't already
+ m4_ifndef([_AM_Config_Header_Index], m4_define([_AM_Config_Header_Index], [0]))
+ dnl prepare to store our destination file list for use in config.status
+ AC_FOREACH([_AM_File], [$1],
+ [m4_pushdef([_AM_Dest], m4_patsubst(_AM_File, [:.*]))
+ m4_define([_AM_Config_Header_Index], m4_incr(_AM_Config_Header_Index))
+ dnl and add it to the list of files AC keeps track of, along
+ dnl with our hook
+ AC_CONFIG_HEADERS(_AM_File,
+dnl COMMANDS, [, INIT-CMDS]
+[# update the timestamp
+echo timestamp >"AS_ESCAPE(_AM_DIRNAME(]_AM_Dest[))/stamp-h]_AM_Config_Header_Index["
+][$2]m4_ifval([$3], [, [$3]]))dnl AC_CONFIG_HEADERS
+ m4_popdef([_AM_Dest])])],dnl
+[AC_CONFIG_HEADER([$1])
+ AC_OUTPUT_COMMANDS(
+ ifelse(patsubst([$1], [[^ ]], []),
+ [],
+ [test -z "$CONFIG_HEADERS" || echo timestamp >dnl
+ patsubst([$1], [^\([^:]*/\)?.*], [\1])stamp-h]),dnl
+[am_indx=1
+for am_file in $1; do
+ case " \$CONFIG_HEADERS " in
+ *" \$am_file "*)
+ am_dir=\`echo \$am_file |sed 's%:.*%%;s%[^/]*\$%%'\`
+ if test -n "\$am_dir"; then
+ am_tmpdir=\`echo \$am_dir |sed 's%^\(/*\).*\$%\1%'\`
+ for am_subdir in \`echo \$am_dir |sed 's%/% %'\`; do
+ am_tmpdir=\$am_tmpdir\$am_subdir/
+ if test ! -d \$am_tmpdir; then
+ mkdir \$am_tmpdir
+ fi
+ done
+ fi
+ echo timestamp > "\$am_dir"stamp-h\$am_indx
+ ;;
+ esac
+ am_indx=\`expr \$am_indx + 1\`
+done])
+])]) # AM_CONFIG_HEADER
+
+# _AM_DIRNAME(PATH)
+# -----------------
+# Like AS_DIRNAME, only do it during macro expansion
+AC_DEFUN([_AM_DIRNAME],
+ [m4_if(m4_regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1,
+ m4_if(m4_regexp([$1], [^//\([^/]\|$\)]), -1,
+ m4_if(m4_regexp([$1], [^/.*]), -1,
+ [.],
+ m4_patsubst([$1], [^\(/\).*], [\1])),
+ m4_patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])),
+ m4_patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl
+]) # _AM_DIRNAME
+
diff --git a/gnu/usr.bin/cvs/config.h.in b/gnu/usr.bin/cvs/config.h.in
index 438b798d3dc..986998f0712 100644
--- a/gnu/usr.bin/cvs/config.h.in
+++ b/gnu/usr.bin/cvs/config.h.in
@@ -77,13 +77,6 @@
/* Define if you have MIT Kerberos version 4 available. */
#undef HAVE_KERBEROS
-/* Define if you have GSSAPI with MIT Kerberos version 5 available. */
-#undef HAVE_GSSAPI
-
-/* Define if GSS_C_NT_HOSTBASED_SERVICE is defined in the gssapi.h
- header file. Only relevant when using GSSAPI. */
-#undef HAVE_GSS_C_NT_HOSTBASED_SERVICE
-
/* Define if you want CVS to be able to be a remote repository client. */
#undef CLIENT_SUPPORT
@@ -147,12 +140,18 @@
/* Define if you have the ftruncate function. */
#undef HAVE_FTRUNCATE
+/* Define if you have the getgroups function. */
+#undef HAVE_GETGROUPS
+
/* Define if you have the getpagesize function. */
#undef HAVE_GETPAGESIZE
/* Define if you have the getpassphrase function. */
#undef HAVE_GETPASSPHRASE
+/* Define if you have the gettimeofday function. */
+#undef HAVE_GETTIMEOFDAY
+
/* Define if you have the initgroups function. */
#undef HAVE_INITGROUPS
@@ -168,9 +167,15 @@
/* Define if you have the mknod function. */
#undef HAVE_MKNOD
+/* Define if you have the mkstemp function. */
+#undef HAVE_MKSTEMP
+
/* Define if you have the mktemp function. */
#undef HAVE_MKTEMP
+/* Define if you have the nanosleep function. */
+#undef HAVE_NANOSLEEP
+
/* Define if you have the putenv function. */
#undef HAVE_PUTENV
@@ -180,6 +185,9 @@
/* Define if you have the rename function. */
#undef HAVE_RENAME
+/* Define if you have the select function. */
+#undef HAVE_SELECT
+
/* Define if you have the sigaction function. */
#undef HAVE_SIGACTION
@@ -213,6 +221,9 @@
/* Define if you have the tzset function. */
#undef HAVE_TZSET
+/* Define if you have the usleep function. */
+#undef HAVE_USLEEP
+
/* Define if you have the valloc function. */
#undef HAVE_VALLOC
@@ -294,11 +305,29 @@
/* Define if you have the <sys/timeb.h> header file. */
#undef HAVE_SYS_TIMEB_H
+/* Define if you have the <syslog.h> header file. */
+#undef HAVE_SYSLOG_H
+
/* Define if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define if you have the <utime.h> header file. */
#undef HAVE_UTIME_H
-/* Define if you have the gen library (-lgen). */
-#undef HAVE_LIBGEN
+/* Name of package */
+#undef PACKAGE
+
+/* Version number of package */
+#undef VERSION
+
+/* Path to the pr utility */
+#undef PR_PROGRAM
+
+/* Define if you have GSSAPI with Kerberos version 5 available. */
+#undef HAVE_GSSAPI
+
+/* Define to an alternative value if GSS_C_NT_HOSTBASED_SERVICE isn't defined
+in the gssapi.h header file. MIT Kerberos 1.2.1 requires this. Only relevant
+when using GSSAPI. */
+#undef GSS_C_NT_HOSTBASED_SERVICE
+
diff --git a/gnu/usr.bin/cvs/contrib/.cvsignore b/gnu/usr.bin/cvs/contrib/.cvsignore
index deb5efc5de7..e5e2b71d3ce 100644
--- a/gnu/usr.bin/cvs/contrib/.cvsignore
+++ b/gnu/usr.bin/cvs/contrib/.cvsignore
@@ -5,6 +5,7 @@ commit_prep
cvs2vendor
cvs_acls
cvscheck
+debug_check_log
log
log_accum
mfpipe
diff --git a/gnu/usr.bin/cvs/contrib/ChangeLog b/gnu/usr.bin/cvs/contrib/ChangeLog
index 6a2ee13d066..d1ae3319f63 100644
--- a/gnu/usr.bin/cvs/contrib/ChangeLog
+++ b/gnu/usr.bin/cvs/contrib/ChangeLog
@@ -1,3 +1,60 @@
+2001-04-25 Derek Price <dprice@collab.net>
+
+ * Makefile.in: Regenerated using AM 1.4e as of today at 18:10 -0400.
+
+2001-04-16 Derek Price <dprice@collab.net>
+
+ * log.pl: Accept new '-V' option for non-verbose status messages.
+
+2001-03-14 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.in: Regenerated
+
+2001-01-05 Derek Price <derek.price@openavenue.com>
+
+ * contrib/Makefile.am (EXTRA_DIST, SUFFIXES, .pl:, .csh:): Move some
+ script targets to configure.in - see ../ChangeLog for more
+
+ * contrib/clmerge.in: Rename from clmerge.pl
+ * contrib/cln_hist.in: Rename from cln_hist.pl
+ * contrib/commit_prep.in: Rename from commit_prep.pl
+ * contrib/cvs_acls.in: Rename from cvs_acls.pl
+ * contrib/log.in: Rename from log.pl
+ * contrib/log_accum.in: Rename from log_accum.pl
+ * contrib/mfpipe.in: Rename from mfpipe.pl
+ * contrib/rcslock.in: Rename from rcslock.pl
+ * contrib/sccs2rcs.in: Rename from scc2rcs.csh
+
+ * contrib/clmerge.pl: Rename to clmerge.in
+ * contrib/cln_hist.pl: Rename to cln_hist.in
+ * contrib/commit_prep.pl: Rename to commit_prep.in
+ * contrib/cvs_acls.pl: Rename to cvs_acls.in
+ * contrib/log.pl: Rename to log.in
+ * contrib/log_accum.pl: Rename to log_accum.in
+ * contrib/mfpipe.pl: Rename to mfpipe.in
+ * contrib/rcslock.pl: Rename to rcslock.in
+ * contrib/sccs2rcs.csh: Rename to sccs2rcs.in
+
+2000-12-22 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.in: Regenerated
+
+2000-12-21 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.am: New file needed by Automake
+ * Makefile.in: Regenerated
+
+2000-12-14 Derek Price <derek.price@openavenue.com>
+ Thomas Maeder <maeder@glue.ch>
+
+ * sccs2rcs.csh: unkludge a Y2k workaround
+
+2000-10-23 Derek Price <derek.price@openavenue.com>
+
+ * debug_check_log.sh: added this script for analyzing sanity.sh output
+ * Makefile.in: add above file to DISTFILES and CONTRIB_PROGS
+ * .cvsignore: add debug_check_log
+
2000-09-07 Larry Jones <larry.jones@sdrc.com>
* Makefile.in: Use @bindir@, @libdir@, @infodir@, and @mandir@
diff --git a/gnu/usr.bin/cvs/contrib/Makefile.am b/gnu/usr.bin/cvs/contrib/Makefile.am
new file mode 100644
index 00000000000..7bee1806b1f
--- /dev/null
+++ b/gnu/usr.bin/cvs/contrib/Makefile.am
@@ -0,0 +1,108 @@
+## Process this file with automake to produce Makefile.in
+# Makefile for GNU CVS contributed sources.
+# Do not use this makefile directly, but only from `../Makefile'.
+# Copyright (C) 1986, 1988-1990 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# DISTFILES = \
+# ChangeLog README .cvsignore intro.doc \
+# Makefile.in clmerge.pl cln_hist.pl commit_prep.pl cvs2vendor.sh \
+# cvs_acls.pl cvscheck.sh cvscheck.man cvshelp.man debug_check_log.sh \
+# descend.sh \
+# descend.man dirfns.shar log.pl log_accum.pl mfpipe.pl rcs-to-cvs.sh \
+# rcs2log.sh rcslock.pl sccs2rcs.csh rcs2sccs.sh
+
+# files installed in $(pkgdatadir)
+#
+# CONTRIB_FILES = README intro.doc cvscheck.man
+
+contribdir = $(pkgdatadir)/contrib
+
+contrib_SCRIPTS = \
+ clmerge \
+ cln_hist \
+ commit_prep \
+ cvs2vendor \
+ cvs_acls \
+ cvscheck \
+ debug_check_log \
+ log \
+ log_accum \
+ mfpipe \
+ rcs-to-cvs \
+ rcs2log \
+ rcslock \
+ sccs2rcs
+
+contrib_DATA = \
+ README \
+ intro.doc
+
+contrib_MANS = \
+ cvscheck.man
+
+bin_LINKS = \
+ rcs2log
+
+EXTRA_DIST = \
+ .cvsignore \
+ $(contrib_DATA) \
+ $(contrib_MANS) \
+ cvs2vendor.sh \
+ cvscheck.sh \
+ cvshelp.man \
+ debug_check_log.sh \
+ descend.sh \
+ descend.man \
+ dirfns.shar \
+ rcs-to-cvs.sh \
+ rcs2log.sh \
+ rcs2sccs.sh
+
+CLEANFILES = $(bin_SCRIPTS) $(contrib_SCRIPTS)
+
+# we'd rather have a link here rather than two copies of a script
+install-data-local:
+ # FIXME - this path should be determined dynamically from bindir
+ # & contribdir
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(DESTDIR)$(bindir)
+ @list='$(bin_LINKS)'; for p in $$list; do \
+ echo "test ! -e $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \
+ echo " && cd $(DESTDIR)$(bindir) && $(LN_S) ../share/$(PACKAGE)/contrib/`echo $$p|sed '$(transform)'` ."; \
+ (test ! -e $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'` \
+ && cd $(DESTDIR)$(bindir) && $(LN_S) ../share/$(PACKAGE)/contrib/`echo $$p|sed '$(transform)'` .) \
+ || (echo "Link creation failed" && if test -f $$p; then \
+ echo " $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \
+ $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
+ else if test -f $(srcdir)/$$p; then \
+ echo " $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \
+ $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
+ else :; fi; fi); \
+ done
+
+uninstall-local:
+ @$(NORMAL_UNINSTALL)
+ list='$(bin_LINKS)'; for p in $$list; do \
+ rm -f $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
+ done
+
+SUFFIXES = .sh
+
+.sh:
+ rm -f $@
+ cp $< $@
+ chmod +x $@
+
+# for backwards compatibility with the old makefiles
+realclean: maintainer-clean
+.PHONY: realclean
diff --git a/gnu/usr.bin/cvs/contrib/clmerge.in b/gnu/usr.bin/cvs/contrib/clmerge.in
new file mode 100644
index 00000000000..5e5251ac1b0
--- /dev/null
+++ b/gnu/usr.bin/cvs/contrib/clmerge.in
@@ -0,0 +1,152 @@
+#! @PERL@
+
+# Merge conflicted ChangeLogs
+# tromey Mon Aug 15 1994
+
+# Usage is:
+#
+# cl-merge [-i] file ...
+#
+# With -i, it works in place (backups put in a ~ file). Otherwise the
+# merged ChangeLog is printed to stdout.
+
+# Please report any bugs to me. I wrote this yesterday, so there are no
+# guarantees about its performance. I recommend checking its output
+# carefully. If you do send a bug report, please include the failing
+# ChangeLog, so I can include it in my test suite.
+#
+# Tom
+# ---
+# tromey@busco.lanl.gov Member, League for Programming Freedom
+# Sadism and farce are always inexplicably linked.
+# -- Alexander Theroux
+
+
+# Month->number mapping. Used for sorting.
+%months = ('Jan', 0,
+ 'Feb', 1,
+ 'Mar', 2,
+ 'Apr', 3,
+ 'May', 4,
+ 'Jun', 5,
+ 'Jul', 6,
+ 'Aug', 7,
+ 'Sep', 8,
+ 'Oct', 9,
+ 'Nov', 10,
+ 'Dec', 11);
+
+# If '-i' is given, do it in-place.
+if ($ARGV[0] eq '-i') {
+ shift (@ARGV);
+ $^I = '~';
+}
+
+$lastkey = '';
+$lastval = '';
+$conf = 0;
+%conflist = ();
+
+$tjd = 0;
+
+# Simple state machine. The states:
+#
+# 0 Not in conflict. Just copy input to output.
+# 1 Beginning an entry. Next non-blank line is key.
+# 2 In entry. Entry beginner transitions to state 1.
+while (<>) {
+ if (/^<<<</ || /^====/) {
+ # Start of a conflict.
+
+ # Copy last key into array.
+ if ($lastkey ne '') {
+ $conflist{$lastkey} = $lastval;
+
+ $lastkey = '';
+ $lastval = '';
+ }
+
+ $conf = 1;
+ } elsif (/^>>>>/) {
+ # End of conflict. Output.
+
+ # Copy last key into array.
+ if ($lastkey ne '') {
+ $conflist{$lastkey} = $lastval;
+
+ $lastkey = '';
+ $lastval = '';
+ }
+
+ foreach (reverse sort clcmp keys %conflist) {
+ print STDERR "doing $_" if $tjd;
+ print $_;
+ print $conflist{$_};
+ }
+
+ $lastkey = '';
+ $lastval = '';
+ $conf = 0;
+ %conflist = ();
+ } elsif ($conf == 1) {
+ # Beginning an entry. Skip empty lines. Error if not a real
+ # beginner.
+ if (/^$/) {
+ # Empty line; just skip at this point.
+ } elsif (/^[MTWFS]/) {
+ # Looks like the name of a day; assume opener and move to
+ # "in entry" state.
+ $lastkey = $_;
+ $conf = 2;
+ print STDERR "found $_" if $tjd;
+ } else {
+ die ("conflict crosses entry boundaries: $_");
+ }
+ } elsif ($conf == 2) {
+ # In entry. Copy into variable until we see beginner line.
+ if (/^[MTWFS]/) {
+ # Entry beginner line.
+
+ # Copy last key into array.
+ if ($lastkey ne '') {
+ $conflist{$lastkey} = $lastval;
+
+ $lastkey = '';
+ $lastval = '';
+ }
+
+ $lastkey = $_;
+ print STDERR "found $_" if $tjd;
+ $lastval = '';
+ } else {
+ $lastval .= $_;
+ }
+ } else {
+ # Just copy.
+ print;
+ }
+}
+
+# Compare ChangeLog time strings like <=>.
+#
+# 0 1 2 3
+# Thu Aug 11 13:22:42 1994 Tom Tromey (tromey@creche.colorado.edu)
+# 0123456789012345678901234567890
+#
+sub clcmp {
+ # First check year.
+ $r = substr ($a, 20, 4) <=> substr ($b, 20, 4);
+
+ # Now check month.
+ $r = $months{substr ($a, 4, 3)} <=> $months{substr ($b, 4, 3)} if !$r;
+
+ # Now check day.
+ $r = substr ($a, 8, 2) <=> substr ($b, 8, 2) if !$r;
+
+ # Now check time (3 parts).
+ $r = substr ($a, 11, 2) <=> substr ($b, 11, 2) if !$r;
+ $r = substr ($a, 14, 2) <=> substr ($b, 14, 2) if !$r;
+ $r = substr ($a, 17, 2) <=> substr ($b, 17, 2) if !$r;
+
+ $r;
+}
diff --git a/gnu/usr.bin/cvs/contrib/cln_hist.in b/gnu/usr.bin/cvs/contrib/cln_hist.in
new file mode 100644
index 00000000000..d9818471cf4
--- /dev/null
+++ b/gnu/usr.bin/cvs/contrib/cln_hist.in
@@ -0,0 +1,91 @@
+#! @PERL@
+# -*-Perl-*-
+#
+# Contributed by David G. Grubbs <dgg@ksr.com>
+#
+# Clean up the history file. 10 Record types: MAR OFT WUCG
+#
+# WUCG records are thrown out.
+# MAR records are retained.
+# T records: retain only last tag with same combined tag/module.
+#
+# Two passes: Walk through the first time and remember the
+# 1. Last Tag record with same "tag" and "module" names.
+# 2. Last O record with unique user/module/directory, unless followed
+# by a matching F record.
+#
+
+$r = $ENV{"CVSROOT"};
+$c = "$r/CVSROOT";
+$h = "$c/history";
+
+eval "print STDERR \$die='Unknown parameter $1\n' if !defined \$$1; \$$1=\$';"
+ while ($ARGV[0] =~ /^(\w+)=/ && shift(@ARGV));
+exit 255 if $die; # process any variable=value switches
+
+%tags = ();
+%outs = ();
+
+#
+# Move history file to safe place and re-initialize a new one.
+#
+rename($h, "$h.bak");
+open(XX, ">$h");
+close(XX);
+
+#
+# Pass1 -- remember last tag and checkout.
+#
+open(HIST, "$h.bak");
+while (<HIST>) {
+ next if /^[MARWUCG]/;
+
+ # Save whole line keyed by tag|module
+ if (/^T/) {
+ @tmp = split(/\|/, $_);
+ $tags{$tmp[4] . '|' . $tmp[5]} = $_;
+ }
+ # Save whole line
+ if (/^[OF]/) {
+ @tmp = split(/\|/, $_);
+ $outs{$tmp[1] . '|' . $tmp[2] . '|' . $tmp[5]} = $_;
+ }
+}
+
+#
+# Pass2 -- print out what we want to save.
+#
+open(SAVE, ">$h.work");
+open(HIST, "$h.bak");
+while (<HIST>) {
+ next if /^[FWUCG]/;
+
+ # If whole line matches saved (i.e. "last") one, print it.
+ if (/^T/) {
+ @tmp = split(/\|/, $_);
+ next if $tags{$tmp[4] . '|' . $tmp[5]} ne $_;
+ }
+ # Save whole line
+ if (/^O/) {
+ @tmp = split(/\|/, $_);
+ next if $outs{$tmp[1] . '|' . $tmp[2] . '|' . $tmp[5]} ne $_;
+ }
+
+ print SAVE $_;
+}
+
+#
+# Put back the saved stuff
+#
+system "cat $h >> $h.work";
+
+if (-s $h) {
+ rename ($h, "$h.interim");
+ print "history.interim has non-zero size.\n";
+} else {
+ unlink($h);
+}
+
+rename ("$h.work", $h);
+
+exit(0);
diff --git a/gnu/usr.bin/cvs/contrib/commit_prep.in b/gnu/usr.bin/cvs/contrib/commit_prep.in
new file mode 100644
index 00000000000..d46ffdfc474
--- /dev/null
+++ b/gnu/usr.bin/cvs/contrib/commit_prep.in
@@ -0,0 +1,215 @@
+#! @PERL@
+# -*-Perl-*-
+#
+#
+# Perl filter to handle pre-commit checking of files. This program
+# records the last directory where commits will be taking place for
+# use by the log_accum.pl script. For new files, it forces the
+# existence of a RCS "Id" keyword in the first ten lines of the file.
+# For existing files, it checks version number in the "Id" line to
+# prevent losing changes because an old version of a file was copied
+# into the direcory.
+#
+# Possible future enhancements:
+#
+# Check for cruft left by unresolved conflicts. Search for
+# "^<<<<<<<$", "^-------$", and "^>>>>>>>$".
+#
+# Look for a copyright and automagically update it to the
+# current year. [[ bad idea! -- woods ]]
+#
+#
+# Contributed by David Hampton <hampton@cisco.com>
+#
+# Hacked on lots by Greg A. Woods <woods@web.net>
+
+#
+# Configurable options
+#
+
+# Constants (remember to protect strings from RCS keyword substitution)
+#
+$LAST_FILE = "/tmp/#cvs.lastdir"; # must match name in log_accum.pl
+$ENTRIES = "CVS/Entries";
+
+# Patterns to find $Log keywords in files
+#
+$LogString1 = "\\\$\\Log: .* \\\$";
+$LogString2 = "\\\$\\Log\\\$";
+$NoLog = "%s - contains an RCS \$Log keyword. It must not!\n";
+
+# pattern to match an RCS Id keyword line with an existing ID
+#
+$IDstring = "\"@\\(#\\)[^:]*:.*\\\$\Id: .*\\\$\"";
+$NoId = "
+%s - Does not contain a properly formatted line with the keyword \"Id:\".
+ I.e. no lines match \"" . $IDstring . "\".
+ Please see the template files for an example.\n";
+
+# pattern to match an RCS Id keyword line for a new file (i.e. un-expanded)
+#
+$NewId = "\"@(#)[^:]*:.*\\$\Id\\$\"";
+
+$NoName = "
+%s - The ID line should contain only \"@(#)module/path:\$Name\$:\$\Id\$\"
+ for a newly created file.\n";
+
+$BadName = "
+%s - The file name '%s' in the ID line does not match
+ the actual filename.\n";
+
+$BadVersion = "
+%s - How dare you!!! You replaced your copy of the file '%s',
+ which was based upon version %s, with an %s version based
+ upon %s. Please move your '%s' out of the way, perform an
+ update to get the current version, and them merge your changes
+ into that file, then try the commit again.\n";
+
+#
+# Subroutines
+#
+
+sub write_line {
+ local($filename, $line) = @_;
+ open(FILE, ">$filename") || die("Cannot open $filename, stopped");
+ print(FILE $line, "\n");
+ close(FILE);
+}
+
+sub check_version {
+ local($i, $id, $rname, $version);
+ local($filename, $cvsversion) = @_;
+
+ open(FILE, "<$filename") || return(0);
+
+ @all_lines = ();
+ $idpos = -1;
+ $newidpos = -1;
+ for ($i = 0; <FILE>; $i++) {
+ chop;
+ push(@all_lines, $_);
+ if ($_ =~ /$IDstring/) {
+ $idpos = $i;
+ }
+ if ($_ =~ /$NewId/) {
+ $newidpos = $i;
+ }
+ }
+
+ if (grep(/$LogString1/, @all_lines) || grep(/$LogString2/, @all_lines)) {
+ print STDERR sprintf($NoLog, $filename);
+ return(1);
+ }
+
+ if ($debug != 0) {
+ print STDERR sprintf("file = %s, version = %d.\n", $filename, $cvsversion{$filename});
+ }
+
+ if ($cvsversion{$filename} == 0) {
+ if ($newidpos != -1 && $all_lines[$newidpos] !~ /$NewId/) {
+ print STDERR sprintf($NoName, $filename);
+ return(1);
+ }
+ return(0);
+ }
+
+ if ($idpos == -1) {
+ print STDERR sprintf($NoId, $filename);
+ return(1);
+ }
+
+ $line = $all_lines[$idpos];
+ $pos = index($line, "Id: ");
+ if ($debug != 0) {
+ print STDERR sprintf("%d in '%s'.\n", $pos, $line);
+ }
+ ($id, $rname, $version) = split(' ', substr($line, $pos));
+ if ($rname ne "$filename,v") {
+ print STDERR sprintf($BadName, $filename, substr($rname, 0, length($rname)-2));
+ return(1);
+ }
+ if ($cvsversion{$filename} < $version) {
+ print STDERR sprintf($BadVersion, $filename, $filename, $cvsversion{$filename},
+ "newer", $version, $filename);
+ return(1);
+ }
+ if ($cvsversion{$filename} > $version) {
+ print STDERR sprintf($BadVersion, $filename, $filename, $cvsversion{$filename},
+ "older", $version, $filename);
+ return(1);
+ }
+ return(0);
+}
+
+#
+# Main Body
+#
+
+$id = getpgrp(); # You *must* use a shell that does setpgrp()!
+
+# Check each file (except dot files) for an RCS "Id" keyword.
+#
+$check_id = 0;
+
+# Record the directory for later use by the log_accumulate stript.
+#
+$record_directory = 0;
+
+# parse command line arguments
+#
+while (@ARGV) {
+ $arg = shift @ARGV;
+
+ if ($arg eq '-d') {
+ $debug = 1;
+ print STDERR "Debug turned on...\n";
+ } elsif ($arg eq '-c') {
+ $check_id = 1;
+ } elsif ($arg eq '-r') {
+ $record_directory = 1;
+ } else {
+ push(@files, $arg);
+ }
+}
+
+$directory = shift @files;
+
+if ($debug != 0) {
+ print STDERR "dir - ", $directory, "\n";
+ print STDERR "files - ", join(":", @files), "\n";
+ print STDERR "id - ", $id, "\n";
+}
+
+# Suck in the CVS/Entries file
+#
+open(ENTRIES, $ENTRIES) || die("Cannot open $ENTRIES.\n");
+while (<ENTRIES>) {
+ local($filename, $version) = split('/', substr($_, 1));
+ $cvsversion{$filename} = $version;
+}
+
+# Now check each file name passed in, except for dot files. Dot files
+# are considered to be administrative files by this script.
+#
+if ($check_id != 0) {
+ $failed = 0;
+ foreach $arg (@files) {
+ if (index($arg, ".") == 0) {
+ next;
+ }
+ $failed += &check_version($arg);
+ }
+ if ($failed) {
+ print STDERR "\n";
+ exit(1);
+ }
+}
+
+# Record this directory as the last one checked. This will be used
+# by the log_accumulate script to determine when it is processing
+# the final directory of a multi-directory commit.
+#
+if ($record_directory != 0) {
+ &write_line("$LAST_FILE.$id", $directory);
+}
+exit(0);
diff --git a/gnu/usr.bin/cvs/contrib/cvs_acls.in b/gnu/usr.bin/cvs/contrib/cvs_acls.in
new file mode 100644
index 00000000000..7bd991840e6
--- /dev/null
+++ b/gnu/usr.bin/cvs/contrib/cvs_acls.in
@@ -0,0 +1,141 @@
+#! @PERL@
+# -*-Perl-*-
+#
+# Access control lists for CVS. dgg@ksr.com (David G. Grubbs)
+#
+# CVS "commitinfo" for matching repository names, running the program it finds
+# on the same line. More information is available in the CVS man pages.
+#
+# ==== INSTALLATION:
+#
+# To use this program as I intended, do the following four things:
+#
+# 0. Install PERL. :-)
+#
+# 1. Put one line, as the *only* non-comment line, in your commitinfo file:
+#
+# DEFAULT /usr/local/bin/cvs_acls
+#
+# 2. Install this file as /usr/local/bin/cvs_acls and make it executable.
+#
+# 3. Create a file named $CVSROOT/CVSROOT/avail.
+#
+# ==== FORMAT OF THE avail FILE:
+#
+# The avail file determines whether you may commit files. It contains lines
+# read from top to bottom, keeping track of a single "bit". The "bit"
+# defaults to "on". It can be turned "off" by "unavail" lines and "on" by
+# "avail" lines. ==> Last one counts.
+#
+# Any line not beginning with "avail" or "unavail" is ignored.
+#
+# Lines beginning with "avail" or "unavail" are assumed to be '|'-separated
+# triples: (All spaces and tabs are ignored in a line.)
+#
+# {avail.*,unavail.*} [| user,user,... [| repos,repos,...]]
+#
+# 1. String starting with "avail" or "unavail".
+# 2. Optional, comma-separated list of usernames.
+# 3. Optional, comma-separated list of repository pathnames.
+# These are pathnames relative to $CVSROOT. They can be directories or
+# filenames. A directory name allows access to all files and
+# directories below it.
+#
+# Example: (Text from the ';;' rightward may not appear in the file.)
+#
+# unavail ;; Make whole repository unavailable.
+# avail|dgg ;; Except for user "dgg".
+# avail|fred, john|bin/ls ;; Except when "fred" or "john" commit to
+# ;; the module whose repository is "bin/ls"
+#
+# PROGRAM LOGIC:
+#
+# CVS passes to @ARGV an absolute directory pathname (the repository
+# appended to your $CVSROOT variable), followed by a list of filenames
+# within that directory.
+#
+# We walk through the avail file looking for a line that matches both
+# the username and repository.
+#
+# A username match is simply the user's name appearing in the second
+# column of the avail line in a space-or-comma separate list.
+#
+# A repository match is either:
+# - One element of the third column matches $ARGV[0], or some
+# parent directory of $ARGV[0].
+# - Otherwise *all* file arguments ($ARGV[1..$#ARGV]) must be
+# in the file list in one avail line.
+# - In other words, using directory names in the third column of
+# the avail file allows committing of any file (or group of
+# files in a single commit) in the tree below that directory.
+# - If individual file names are used in the third column of
+# the avail file, then files must be committed individually or
+# all files specified in a single commit must all appear in
+# third column of a single avail line.
+#
+
+$debug = 0;
+$cvsroot = $ENV{'CVSROOT'};
+$availfile = $cvsroot . "/CVSROOT/avail";
+$myname = $ENV{"USER"} if !($myname = $ENV{"LOGNAME"});
+
+eval "print STDERR \$die='Unknown parameter $1\n' if !defined \$$1; \$$1=\$';"
+ while ($ARGV[0] =~ /^(\w+)=/ && shift(@ARGV));
+exit 255 if $die; # process any variable=value switches
+
+die "Must set CVSROOT\n" if !$cvsroot;
+($repos = shift) =~ s:^$cvsroot/::;
+grep($_ = $repos . '/' . $_, @ARGV);
+
+print "$$ Repos: $repos\n","$$ ==== ",join("\n$$ ==== ",@ARGV),"\n" if $debug;
+
+$exit_val = 0; # Good Exit value
+
+$universal_off = 0;
+open (AVAIL, $availfile) || exit(0); # It is ok for avail file not to exist
+while (<AVAIL>) {
+ chop;
+ next if /^\s*\#/;
+ next if /^\s*$/;
+ ($flagstr, $u, $m) = split(/[\s,]*\|[\s,]*/, $_);
+
+ # Skip anything not starting with "avail" or "unavail" and complain.
+ (print "Bad avail line: $_\n"), next
+ if ($flagstr !~ /^avail/ && $flagstr !~ /^unavail/);
+
+ # Set which bit we are playing with. ('0' is OK == Available).
+ $flag = (($& eq "avail") ? 0 : 1);
+
+ # If we find a "universal off" flag (i.e. a simple "unavail") remember it
+ $universal_off = 1 if ($flag && !$u && !$m);
+
+ # $myname considered "in user list" if actually in list or is NULL
+ $in_user = (!$u || grep ($_ eq $myname, split(/[\s,]+/,$u)));
+ print "$$ \$myname($myname) in user list: $_\n" if $debug && $in_user;
+
+ # Module matches if it is a NULL module list in the avail line. If module
+ # list is not null, we check every argument combination.
+ if (!($in_repo = !$m)) {
+ @tmp = split(/[\s,]+/,$m);
+ for $j (@tmp) {
+ # If the repos from avail is a parent(or equal) dir of $repos, OK
+ $in_repo = 1, last if ($repos eq $j || $repos =~ /^$j\//);
+ }
+ if (!$in_repo) {
+ $in_repo = 1;
+ for $j (@ARGV) {
+ last if !($in_repo = grep ($_ eq $j, @tmp));
+ }
+ }
+ }
+ print "$$ \$repos($repos) in repository list: $_\n" if $debug && $in_repo;
+
+ $exit_val = $flag if ($in_user && $in_repo);
+ print "$$ ==== \$exit_val = $exit_val\n$$ ==== \$flag = $flag\n" if $debug;
+}
+close(AVAIL);
+print "$$ ==== \$exit_val = $exit_val\n" if $debug;
+print "**** Access denied: Insufficient Karma ($myname|$repos)\n" if $exit_val;
+print "**** Access allowed: Personal Karma exceeds Environmental Karma.\n"
+ if $universal_off && !$exit_val;
+exit($exit_val);
diff --git a/gnu/usr.bin/cvs/contrib/debug_check_log.sh b/gnu/usr.bin/cvs/contrib/debug_check_log.sh
new file mode 100644
index 00000000000..f14b26d7f05
--- /dev/null
+++ b/gnu/usr.bin/cvs/contrib/debug_check_log.sh
@@ -0,0 +1,197 @@
+#!/bin/sh
+
+#
+# This program is intended to take a check.log file generated by a failed run of
+# sanity.sh as input and run expr line by line on it. It seems a much easier
+# way of spotting a single failed line in a 100 line test result.
+#
+
+#
+# This script falls under the GNU General Public License and is intended to
+# be distributed with CVS.
+#
+
+#
+# No warranties, express or implied.
+#
+
+#
+# Contributed by Derek R. Price <derek.price@openavenue.com>
+#
+
+
+
+usage ()
+{
+ echo "\
+usage: $0 [-afh] [file...]
+
+ -a process alternate pattern
+ -f process first pattern (default)
+ -h print this text
+
+ file files to process (default = check.log)"
+}
+
+# Do a line by line match with expr
+#
+# INPUTS
+# $1 = text file name
+# $2 = pattern file name
+expr_line_by_line ()
+{
+ dcl_line=0
+ dcl_wrong=
+ # We are assuming a newline at the end of the file. The way sanity.sh
+ # uses echo to create the log message guarantees this newline and since
+ # expr ignores the last newline when the anchor is present anyhow, no
+ # information is being lost in the transition
+ while test $dcl_line -lt `wc -l <$1` -a $dcl_line -lt `wc -l <$2`; do
+ dcl_line=`expr $dcl_line + 1`
+ if test `sed -ne${dcl_line}p <$1 |wc -c` -eq 1 \
+ -a `sed -ne${dcl_line}p <$2 |wc -c` -eq 1; then
+ # This is a workaround for what I am calling a bug in GNU
+ # expr - it won't match the empty string to the empty
+ # string. In this case the assumption is that a single
+ # character is always a newline. Since we already checked
+ # for the end of the file, we know sed will echo the
+ # newline.
+ :
+ elif expr "`sed -ne${dcl_line}p <$1`" : \
+ "`sed -ne${dcl_line}p <$2`\$" >/dev/null; then
+ :
+ else
+ echo "$dcl_line: `sed -ne${dcl_line}p <$1`"
+ echo "$dcl_line: `sed -ne${dcl_line}p <$2`\$"
+ dcl_wrong="$dcl_wrong $dcl_line"
+ fi
+ done
+ if test `wc -l <$1` -ne `wc -l <$2`; then
+ echo "output & pattern contain differing number of lines"
+ elif test -z "$dcl_wrong"; then
+ echo "no mismatched lines"
+ else
+ echo "mismatched lines: $dcl_wrong"
+ fi
+}
+
+# Process a single check.log file
+#
+# INPUTS
+# $1 = filename
+process_check_log ()
+{
+ # abort if we can't find any expressions
+ if grep '^\*\* got: $' <$1 >/dev/null; then
+ :
+ else
+ echo "WARNING: No expressions in file: $1" >&2
+ echo " Either not a check.log or sanity.sh exited for some other reason," >&2
+ echo " like bad exit status. Try tail." >&2
+ return
+ fi
+
+ dcl_exprfiles=""
+ if grep '^\*\* or: $' <$1 >/dev/null; then
+ # file contains a second regex
+ if test $dcl_dofirst -eq 1; then
+ # get the first pattern
+ sed -ne '/^\*\* expected: $/,/^\*\* or: $/p' <$1 >/tmp/dcle$$
+ dcl_exprfiles="$dcl_exprfiles /tmp/dcle$$"
+ fi
+ if test $dcl_doalternate -eq 1; then
+ # get the alternate pattern
+ sed -ne '/^\*\* or: $/,/^\*\* got: $/p' <$1 >/tmp/dclo$$
+ dcl_exprfiles="$dcl_exprfiles /tmp/dclo$$"
+ else
+ echo "WARNING: Ignoring alternate pattern in file: $1" >&2
+ fi
+ else
+ # file doesn't contain a second regex
+ if test $dcl_dofirst = 1; then
+ # get the only pattern
+ sed -ne '/^\*\* expected: $/,/^\*\* got: $/p' <$1 >/tmp/dcle$$
+ dcl_exprfiles="$dcl_exprfiles /tmp/dcle$$"
+ fi
+ if test $dcl_doalternate -eq 1; then
+ echo "WARNING: No alternate pattern in file: $1" >&2
+ fi
+ fi
+
+ # and get the actual output
+ sed -ne '/^\*\* got: $/,$p' <$1 >/tmp/dclg$$
+ sed -ne '1D
+$D
+p' </tmp/dclg$$ >/tmp/dclh$$
+ mv /tmp/dclh$$ /tmp/dclg$$
+
+ # compare the output against each pattern requested
+ for dcl_f in $dcl_exprfiles; do
+ sed -ne '1D
+$D
+p' <$dcl_f >/tmp/dclp$$
+ mv /tmp/dclp$$ $dcl_f
+
+ case $dcl_f in
+ /tmp/dcle*)
+ echo "********** $1 : Primary **********"
+ ;;
+ /tmp/dclo*)
+ echo "********** $1 : Alternate **********"
+ ;;
+ esac
+
+ expr_line_by_line /tmp/dclg$$ $dcl_f
+
+ rm $dcl_f
+ done
+
+ rm /tmp/dclg$$
+}
+
+###
+### MAIN
+###
+
+# set up defaults
+dcl_doalternate=0
+dcl_dofirst=0
+
+# process options
+while getopts afh arg; do
+ case $arg in
+ a)
+ dcl_doalternate=1
+ ;;
+ f)
+ dcl_dofirst=1
+ ;;
+ \?|h)
+ usage
+ exit 1
+ ;;
+ esac
+done
+
+# dispose of processed args
+shift `expr $OPTIND - 1`
+OPTIND=1
+
+# set the default mode
+if test $dcl_doalternate -eq 0; then
+ dcl_dofirst=1
+fi
+
+# set default arg
+if test $# -eq 0; then
+ dcl_argvar=dcl_default
+ dcl_default=check.log
+else
+ dcl_argvar=@
+fi
+
+eval for file in \"\$$dcl_argvar\"\; do \
+ process_check_log \$file\; \
+done
+
+exit 0
diff --git a/gnu/usr.bin/cvs/contrib/log.in b/gnu/usr.bin/cvs/contrib/log.in
new file mode 100644
index 00000000000..87f40b55b5b
--- /dev/null
+++ b/gnu/usr.bin/cvs/contrib/log.in
@@ -0,0 +1,208 @@
+#! @PERL@
+# -*-Perl-*-
+#
+# XXX: FIXME: handle multiple '-f logfile' arguments
+#
+# XXX -- I HATE Perl! This *will* be re-written in shell/awk/sed soon!
+#
+
+# Usage: log.pl [-u user] [[-m mailto] ...] [-s] [-V] -f logfile 'dirname file ...'
+#
+# -u user - $USER passed from loginfo
+# -m mailto - for each user to receive cvs log reports
+# (multiple -m's permitted)
+# -s - to prevent "cvs status -v" messages
+# -V - without '-s', don't pass '-v' to cvs status
+# -f logfile - for the logfile to append to (mandatory,
+# but only one logfile can be specified).
+
+# here is what the output looks like:
+#
+# From: woods@kuma.domain.top
+# Subject: CVS update: testmodule
+#
+# Date: Wednesday November 23, 1994 @ 14:15
+# Author: woods
+#
+# Update of /local/src-CVS/testmodule
+# In directory kuma:/home/kuma/woods/work.d/testmodule
+#
+# Modified Files:
+# test3
+# Added Files:
+# test6
+# Removed Files:
+# test4
+# Log Message:
+# - wow, what a test
+#
+# (and for each file the "cvs status -v" output is appended unless -s is used)
+#
+# ==================================================================
+# File: test3 Status: Up-to-date
+#
+# Working revision: 1.41 Wed Nov 23 14:15:59 1994
+# Repository revision: 1.41 /local/src-CVS/cvs/testmodule/test3,v
+# Sticky Options: -ko
+#
+# Existing Tags:
+# local-v2 (revision: 1.7)
+# local-v1 (revision: 1.1.1.2)
+# CVS-1_4A2 (revision: 1.1.1.2)
+# local-v0 (revision: 1.2)
+# CVS-1_4A1 (revision: 1.1.1.1)
+# CVS (branch: 1.1.1)
+
+use strict;
+use IO::File;
+
+my $cvsroot = $ENV{'CVSROOT'};
+
+# turn off setgid
+#
+$) = $(;
+
+my $dostatus = 1;
+my $verbosestatus = 1;
+my $users;
+my $login;
+my $donefiles;
+my $logfile;
+my @files;
+
+# parse command line arguments
+#
+while (@ARGV) {
+ my $arg = shift @ARGV;
+
+ if ($arg eq '-m') {
+ $users = "$users " . shift @ARGV;
+ } elsif ($arg eq '-u') {
+ $login = shift @ARGV;
+ } elsif ($arg eq '-f') {
+ ($logfile) && die "Too many '-f' args";
+ $logfile = shift @ARGV;
+ } elsif ($arg eq '-s') {
+ $dostatus = 0;
+ } elsif ($arg eq '-V') {
+ $verbosestatus = 0;
+ } else {
+ ($donefiles) && die "Too many arguments!\n";
+ $donefiles = 1;
+ @files = split(/ /, $arg);
+ }
+}
+
+# the first argument is the module location relative to $CVSROOT
+#
+my $modulepath = shift @files;
+
+my $mailcmd = "| Mail -s 'CVS update: $modulepath'";
+
+# Initialise some date and time arrays
+#
+my @mos = ('January','February','March','April','May','June','July',
+ 'August','September','October','November','December');
+my @days = ('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
+
+my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime;
+$year += 1900;
+
+# get a login name for the guy doing the commit....
+#
+if ($login eq '') {
+ $login = getlogin || (getpwuid($<))[0] || "nobody";
+}
+
+# open log file for appending
+#
+my $logfh = new IO::File ">>" . $logfile
+ or die "Could not open(" . $logfile . "): $!\n";
+
+# send mail, if there's anyone to send to!
+#
+my $mailfh;
+if ($users) {
+ $mailcmd = "$mailcmd $users";
+ $mailfh = new IO::File $mailcmd
+ or die "Could not Exec($mailcmd): $!\n";
+}
+
+# print out the log Header
+#
+$logfh->print ("\n");
+$logfh->print ("****************************************\n");
+$logfh->print ("Date:\t$days[$wday] $mos[$mon] $mday, $year @ $hour:" . sprintf("%02d", $min) . "\n");
+$logfh->print ("Author:\t$login\n\n");
+
+if ($mailfh) {
+ $mailfh->print ("\n");
+ $mailfh->print ("Date:\t$days[$wday] $mos[$mon] $mday, $year @ $hour:" . sprintf("%02d", $min) . "\n");
+ $mailfh->print ("Author:\t$login\n\n");
+}
+
+# print the stuff from logmsg that comes in on stdin to the logfile
+#
+my $infh = new IO::File "< -";
+foreach ($infh->getlines) {
+ $logfh->print;
+ if ($mailfh) {
+ $mailfh->print ($_);
+ }
+}
+undef $infh;
+
+$logfh->print ("\n");
+
+# after log information, do an 'cvs -Qq status -v' on each file in the arguments.
+#
+if ($dostatus != 0) {
+ while (@files) {
+ my $file = shift @files;
+ if ($file eq "-") {
+ $logfh->print ("[input file was '-']\n");
+ if ($mailfh) {
+ $mailfh->print ("[input file was '-']\n");
+ }
+ last;
+ }
+ my $rcsfh = new IO::File;
+ my $pid = $rcsfh->open ("-|");
+ if ( !defined $pid )
+ {
+ die "fork failed: $!";
+ }
+ if ($pid == 0)
+ {
+ my @command = ('cvs', '-nQq', 'status');
+ if ($verbosestatus)
+ {
+ push @command, '-v';
+ }
+ push @command, $file;
+ exec @command;
+ die "cvs exec failed: $!";
+ }
+ my $line;
+ while ($line = $rcsfh->getline) {
+ $logfh->print ($line);
+ if ($mailfh) {
+ $mailfh->print ($line);
+ }
+ }
+ undef $rcsfh;
+ }
+}
+
+$logfh->close()
+ or die "Write to $logfile failed: $!";
+
+if ($mailfh)
+{
+ $mailfh->close;
+ die "Pipe to $mailcmd failed" if $?;
+}
+
+## must exit cleanly
+##
+exit 0;
diff --git a/gnu/usr.bin/cvs/contrib/log_accum.in b/gnu/usr.bin/cvs/contrib/log_accum.in
new file mode 100644
index 00000000000..8591784cede
--- /dev/null
+++ b/gnu/usr.bin/cvs/contrib/log_accum.in
@@ -0,0 +1,576 @@
+#! @PERL@
+# -*-Perl-*-
+#
+# Perl filter to handle the log messages from the checkin of files in
+# a directory. This script will group the lists of files by log
+# message, and mail a single consolidated log message at the end of
+# the commit.
+#
+# This file assumes a pre-commit checking program that leaves the
+# names of the first and last commit directories in a temporary file.
+#
+# Contributed by David Hampton <hampton@cisco.com>
+#
+# hacked greatly by Greg A. Woods <woods@planix.com>
+
+# Usage: log_accum.pl [-d] [-s] [-w] [-M module] [-u user] [[-m mailto] ...] [[-R replyto] ...] [-f logfile]
+# -d - turn on debugging
+# -m mailto - send mail to "mailto" (multiple)
+# -R replyto - set the "Reply-To:" to "replyto" (multiple)
+# -M modulename - set module name to "modulename"
+# -f logfile - write commit messages to logfile too
+# -s - *don't* run "cvs status -v" for each file
+# -w - show working directory with log message
+# -u user - $USER passed from loginfo
+
+#
+# Configurable options
+#
+
+# set this to something that takes a whole message on stdin
+$MAILER = "/usr/lib/sendmail -t";
+
+#
+# End user configurable options.
+#
+
+# Constants (don't change these!)
+#
+$STATE_NONE = 0;
+$STATE_CHANGED = 1;
+$STATE_ADDED = 2;
+$STATE_REMOVED = 3;
+$STATE_LOG = 4;
+
+$LAST_FILE = "/tmp/#cvs.lastdir";
+
+$CHANGED_FILE = "/tmp/#cvs.files.changed";
+$ADDED_FILE = "/tmp/#cvs.files.added";
+$REMOVED_FILE = "/tmp/#cvs.files.removed";
+$LOG_FILE = "/tmp/#cvs.files.log";
+
+$FILE_PREFIX = "#cvs.files";
+
+#
+# Subroutines
+#
+
+sub cleanup_tmpfiles {
+ local($wd, @files);
+
+ $wd = `pwd`;
+ chdir("/tmp") || die("Can't chdir('/tmp')\n");
+ opendir(DIR, ".");
+ push(@files, grep(/^$FILE_PREFIX\..*\.$id$/, readdir(DIR)));
+ closedir(DIR);
+ foreach (@files) {
+ unlink $_;
+ }
+ unlink $LAST_FILE . "." . $id;
+
+ chdir($wd);
+}
+
+sub write_logfile {
+ local($filename, @lines) = @_;
+
+ open(FILE, ">$filename") || die("Cannot open log file $filename.\n");
+ print FILE join("\n", @lines), "\n";
+ close(FILE);
+}
+
+sub append_to_logfile {
+ local($filename, @lines) = @_;
+
+ open(FILE, ">$filename") || die("Cannot open log file $filename.\n");
+ print FILE join("\n", @lines), "\n";
+ close(FILE);
+}
+
+sub format_names {
+ local($dir, @files) = @_;
+ local(@lines);
+
+ $format = "\t%-" . sprintf("%d", length($dir)) . "s%s ";
+
+ $lines[0] = sprintf($format, $dir, ":");
+
+ if ($debug) {
+ print STDERR "format_names(): dir = ", $dir, "; files = ", join(":", @files), ".\n";
+ }
+ foreach $file (@files) {
+ if (length($lines[$#lines]) + length($file) > 65) {
+ $lines[++$#lines] = sprintf($format, " ", " ");
+ }
+ $lines[$#lines] .= $file . " ";
+ }
+
+ @lines;
+}
+
+sub format_lists {
+ local(@lines) = @_;
+ local(@text, @files, $lastdir);
+
+ if ($debug) {
+ print STDERR "format_lists(): ", join(":", @lines), "\n";
+ }
+ @text = ();
+ @files = ();
+ $lastdir = shift @lines; # first thing is always a directory
+ if ($lastdir !~ /.*\/$/) {
+ die("Damn, $lastdir doesn't look like a directory!\n");
+ }
+ foreach $line (@lines) {
+ if ($line =~ /.*\/$/) {
+ push(@text, &format_names($lastdir, @files));
+ $lastdir = $line;
+ @files = ();
+ } else {
+ push(@files, $line);
+ }
+ }
+ push(@text, &format_names($lastdir, @files));
+
+ @text;
+}
+
+sub append_names_to_file {
+ local($filename, $dir, @files) = @_;
+
+ if (@files) {
+ open(FILE, ">>$filename") || die("Cannot open file $filename.\n");
+ print FILE $dir, "\n";
+ print FILE join("\n", @files), "\n";
+ close(FILE);
+ }
+}
+
+sub read_line {
+ local($line);
+ local($filename) = @_;
+
+ open(FILE, "<$filename") || die("Cannot open file $filename.\n");
+ $line = <FILE>;
+ close(FILE);
+ chop($line);
+ $line;
+}
+
+sub read_logfile {
+ local(@text);
+ local($filename, $leader) = @_;
+
+ open(FILE, "<$filename");
+ while (<FILE>) {
+ chop;
+ push(@text, $leader.$_);
+ }
+ close(FILE);
+ @text;
+}
+
+sub build_header {
+ local($header);
+ local($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
+ $header = sprintf("CVSROOT:\t%s\nModule name:\t%s\nRepository:\t%s\nChanges by:\t%s@%s\t%02d/%02d/%02d %02d:%02d:%02d",
+ $cvsroot,
+ $modulename,
+ $dir,
+ $login, $hostdomain,
+ $year%100, $mon+1, $mday,
+ $hour, $min, $sec);
+}
+
+sub mail_notification {
+ local(@text) = @_;
+
+ # if only we had strftime()... stuff stolen from perl's ctime.pl:
+ local($[) = 0;
+
+ @DoW = ('Sun','Mon','Tue','Wed','Thu','Fri','Sat');
+ @MoY = ('Jan','Feb','Mar','Apr','May','Jun',
+ 'Jul','Aug','Sep','Oct','Nov','Dec');
+
+ # Determine what time zone is in effect.
+ # Use GMT if TZ is defined as null, local time if TZ undefined.
+ # There's no portable way to find the system default timezone.
+ #
+ $TZ = defined($ENV{'TZ'}) ? ( $ENV{'TZ'} ? $ENV{'TZ'} : 'GMT' ) : '';
+
+ # Hack to deal with 'PST8PDT' format of TZ
+ # Note that this can't deal with all the esoteric forms, but it
+ # does recognize the most common: [:]STDoff[DST[off][,rule]]
+ #
+ if ($TZ =~ /^([^:\d+\-,]{3,})([+-]?\d{1,2}(:\d{1,2}){0,2})([^\d+\-,]{3,})?/) {
+ $TZ = $isdst ? $4 : $1;
+ $tzoff = sprintf("%05d", -($2) * 100);
+ }
+
+ # perl-4.036 doesn't have the $zone or $gmtoff...
+ ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst, $zone, $gmtoff) =
+ ($TZ eq 'GMT') ? gmtime(time) : localtime(time);
+
+ $year += ($year < 70) ? 2000 : 1900;
+
+ if ($gmtoff != 0) {
+ $tzoff = sprintf("%05d", ($gmtoff / 60) * 100);
+ }
+ if ($zone ne '') {
+ $TZ = $zone;
+ }
+
+ # ok, let's try....
+ $rfc822date = sprintf("%s, %2d %s %4d %2d:%02d:%02d %s (%s)",
+ $DoW[$wday], $mday, $MoY[$mon], $year,
+ $hour, $min, $sec, $tzoff, $TZ);
+
+ open(MAIL, "| $MAILER");
+ print MAIL "Date: " . $rfc822date . "\n";
+ print MAIL "Subject: CVS Update: " . $modulename . "\n";
+ print MAIL "To: " . $mailto . "\n";
+ print MAIL "Reply-To: " . $replyto . "\n";
+ print MAIL "\n";
+ print MAIL join("\n", @text), "\n";
+ close(MAIL);
+}
+
+sub write_commitlog {
+ local($logfile, @text) = @_;
+
+ open(FILE, ">>$logfile");
+ print FILE join("\n", @text), "\n";
+ close(FILE);
+}
+
+#
+# Main Body
+#
+
+# Initialize basic variables
+#
+$debug = 0;
+$id = getpgrp(); # note, you *must* use a shell which does setpgrp()
+$state = $STATE_NONE;
+chop($hostname = `hostname`);
+chop($domainname = `domainname`);
+if ($domainname !~ '^\..*') {
+ $domainname = '.' . $domainname;
+}
+$hostdomain = $hostname . $domainname;
+$cvsroot = $ENV{'CVSROOT'};
+$do_status = 1; # moderately useful
+$show_wd = 0; # useless in client/server
+$modulename = "";
+
+# parse command line arguments (file list is seen as one arg)
+#
+while (@ARGV) {
+ $arg = shift @ARGV;
+
+ if ($arg eq '-d') {
+ $debug = 1;
+ print STDERR "Debug turned on...\n";
+ } elsif ($arg eq '-m') {
+ if ($mailto eq '') {
+ $mailto = shift @ARGV;
+ } else {
+ $mailto = $mailto . ", " . shift @ARGV;
+ }
+ } elsif ($arg eq '-R') {
+ if ($replyto eq '') {
+ $replyto = shift @ARGV;
+ } else {
+ $replyto = $replyto . ", " . shift @ARGV;
+ }
+ } elsif ($arg eq '-M') {
+ $modulename = shift @ARGV;
+ } elsif ($arg eq '-u') {
+ $login = shift @ARGV;
+ } elsif ($arg eq '-s') {
+ $do_status = 0;
+ } elsif ($arg eq '-w') {
+ $show_wd = 1;
+ } elsif ($arg eq '-f') {
+ ($commitlog) && die("Too many '-f' args\n");
+ $commitlog = shift @ARGV;
+ } else {
+ ($donefiles) && die("Too many arguments! Check usage.\n");
+ $donefiles = 1;
+ @files = split(/ /, $arg);
+ }
+}
+if ($login eq '') {
+ $login = getlogin || (getpwuid($<))[0] || "nobody";
+}
+($mailto) || die("No mail recipient specified (use -m)\n");
+if ($replyto eq '') {
+ $replyto = $login;
+}
+
+# for now, the first "file" is the repository directory being committed,
+# relative to the $CVSROOT location
+#
+@path = split('/', $files[0]);
+
+# XXX There are some ugly assumptions in here about module names and
+# XXX directories relative to the $CVSROOT location -- really should
+# XXX read $CVSROOT/CVSROOT/modules, but that's not so easy to do, since
+# XXX we have to parse it backwards.
+# XXX
+# XXX Fortunately it's relatively easy for the user to specify the
+# XXX module name as appropriate with a '-M' via the directory
+# XXX matching in loginfo.
+#
+if ($modulename eq "") {
+ $modulename = $path[0]; # I.e. the module name == top-level dir
+}
+if ($#path == 0) {
+ $dir = ".";
+} else {
+ $dir = join('/', @path);
+}
+$dir = $dir . "/";
+
+if ($debug) {
+ print STDERR "module - ", $modulename, "\n";
+ print STDERR "dir - ", $dir, "\n";
+ print STDERR "path - ", join(":", @path), "\n";
+ print STDERR "files - ", join(":", @files), "\n";
+ print STDERR "id - ", $id, "\n";
+}
+
+# Check for a new directory first. This appears with files set as follows:
+#
+# files[0] - "path/name/newdir"
+# files[1] - "-"
+# files[2] - "New"
+# files[3] - "directory"
+#
+if ($files[2] =~ /New/ && $files[3] =~ /directory/) {
+ local(@text);
+
+ @text = ();
+ push(@text, &build_header());
+ push(@text, "");
+ push(@text, $files[0]);
+ push(@text, "");
+
+ while (<STDIN>) {
+ chop; # Drop the newline
+ push(@text, $_);
+ }
+
+ &mail_notification($mailto, @text);
+
+ exit 0;
+}
+
+# Check for an import command. This appears with files set as follows:
+#
+# files[0] - "path/name"
+# files[1] - "-"
+# files[2] - "Imported"
+# files[3] - "sources"
+#
+if ($files[2] =~ /Imported/ && $files[3] =~ /sources/) {
+ local(@text);
+
+ @text = ();
+ push(@text, &build_header());
+ push(@text, "");
+ push(@text, $files[0]);
+ push(@text, "");
+
+ while (<STDIN>) {
+ chop; # Drop the newline
+ push(@text, $_);
+ }
+
+ &mail_notification(@text);
+
+ exit 0;
+}
+
+# Iterate over the body of the message collecting information.
+#
+while (<STDIN>) {
+ chop; # Drop the newline
+
+ if (/^In directory/) {
+ if ($show_wd) { # useless in client/server mode
+ push(@log_lines, $_);
+ push(@log_lines, "");
+ }
+ next;
+ }
+
+ if (/^Modified Files/) { $state = $STATE_CHANGED; next; }
+ if (/^Added Files/) { $state = $STATE_ADDED; next; }
+ if (/^Removed Files/) { $state = $STATE_REMOVED; next; }
+ if (/^Log Message/) { $state = $STATE_LOG; next; }
+
+ s/^[ \t\n]+//; # delete leading whitespace
+ s/[ \t\n]+$//; # delete trailing whitespace
+
+ if ($state == $STATE_CHANGED) { push(@changed_files, split); }
+ if ($state == $STATE_ADDED) { push(@added_files, split); }
+ if ($state == $STATE_REMOVED) { push(@removed_files, split); }
+ if ($state == $STATE_LOG) { push(@log_lines, $_); }
+}
+
+# Strip leading and trailing blank lines from the log message. Also
+# compress multiple blank lines in the body of the message down to a
+# single blank line.
+#
+while ($#log_lines > -1) {
+ last if ($log_lines[0] ne "");
+ shift(@log_lines);
+}
+while ($#log_lines > -1) {
+ last if ($log_lines[$#log_lines] ne "");
+ pop(@log_lines);
+}
+for ($i = $#log_lines; $i > 0; $i--) {
+ if (($log_lines[$i - 1] eq "") && ($log_lines[$i] eq "")) {
+ splice(@log_lines, $i, 1);
+ }
+}
+
+if ($debug) {
+ print STDERR "Searching for log file index...";
+}
+# Find an index to a log file that matches this log message
+#
+for ($i = 0; ; $i++) {
+ local(@text);
+
+ last if (! -e "$LOG_FILE.$i.$id"); # the next available one
+ @text = &read_logfile("$LOG_FILE.$i.$id", "");
+ last if ($#text == -1); # nothing in this file, use it
+ last if (join(" ", @log_lines) eq join(" ", @text)); # it's the same log message as another
+}
+if ($debug) {
+ print STDERR " found log file at $i.$id, now writing tmp files.\n";
+}
+
+# Spit out the information gathered in this pass.
+#
+&append_names_to_file("$CHANGED_FILE.$i.$id", $dir, @changed_files);
+&append_names_to_file("$ADDED_FILE.$i.$id", $dir, @added_files);
+&append_names_to_file("$REMOVED_FILE.$i.$id", $dir, @removed_files);
+&write_logfile("$LOG_FILE.$i.$id", @log_lines);
+
+# Check whether this is the last directory. If not, quit.
+#
+if ($debug) {
+ print STDERR "Checking current dir against last dir.\n";
+}
+$_ = &read_line("$LAST_FILE.$id");
+
+if ($_ ne $cvsroot . "/" . $files[0]) {
+ if ($debug) {
+ print STDERR sprintf("Current directory %s is not last directory %s.\n", $cvsroot . "/" .$files[0], $_);
+ }
+ exit 0;
+}
+if ($debug) {
+ print STDERR sprintf("Current directory %s is last directory %s -- all commits done.\n", $files[0], $_);
+}
+
+#
+# End Of Commits!
+#
+
+# This is it. The commits are all finished. Lump everything together
+# into a single message, fire a copy off to the mailing list, and drop
+# it on the end of the Changes file.
+#
+
+#
+# Produce the final compilation of the log messages
+#
+@text = ();
+@status_txt = ();
+push(@text, &build_header());
+push(@text, "");
+
+for ($i = 0; ; $i++) {
+ last if (! -e "$LOG_FILE.$i.$id"); # we're done them all!
+ @lines = &read_logfile("$CHANGED_FILE.$i.$id", "");
+ if ($#lines >= 0) {
+ push(@text, "Modified files:");
+ push(@text, &format_lists(@lines));
+ }
+ @lines = &read_logfile("$ADDED_FILE.$i.$id", "");
+ if ($#lines >= 0) {
+ push(@text, "Added files:");
+ push(@text, &format_lists(@lines));
+ }
+ @lines = &read_logfile("$REMOVED_FILE.$i.$id", "");
+ if ($#lines >= 0) {
+ push(@text, "Removed files:");
+ push(@text, &format_lists(@lines));
+ }
+ if ($#text >= 0) {
+ push(@text, "");
+ }
+ @lines = &read_logfile("$LOG_FILE.$i.$id", "\t");
+ if ($#lines >= 0) {
+ push(@text, "Log message:");
+ push(@text, @lines);
+ push(@text, "");
+ }
+ if ($do_status) {
+ local(@changed_files);
+
+ @changed_files = ();
+ push(@changed_files, &read_logfile("$CHANGED_FILE.$i.$id", ""));
+ push(@changed_files, &read_logfile("$ADDED_FILE.$i.$id", ""));
+ push(@changed_files, &read_logfile("$REMOVED_FILE.$i.$id", ""));
+
+ if ($debug) {
+ print STDERR "main: pre-sort changed_files = ", join(":", @changed_files), ".\n";
+ }
+ sort(@changed_files);
+ if ($debug) {
+ print STDERR "main: post-sort changed_files = ", join(":", @changed_files), ".\n";
+ }
+
+ foreach $dofile (@changed_files) {
+ if ($dofile =~ /\/$/) {
+ next; # ignore the silly "dir" entries
+ }
+ if ($debug) {
+ print STDERR "main(): doing 'cvs -nQq status -v $dofile'\n";
+ }
+ open(STATUS, "-|") || exec 'cvs', '-nQq', 'status', '-v', $dofile;
+ while (<STATUS>) {
+ chop;
+ push(@status_txt, $_);
+ }
+ }
+ }
+}
+
+# Write to the commitlog file
+#
+if ($commitlog) {
+ &write_commitlog($commitlog, @text);
+}
+
+if ($#status_txt >= 0) {
+ push(@text, @status_txt);
+}
+
+# Mailout the notification.
+#
+&mail_notification(@text);
+
+# cleanup
+#
+if (! $debug) {
+ &cleanup_tmpfiles();
+}
+
+exit 0;
diff --git a/gnu/usr.bin/cvs/contrib/mfpipe.in b/gnu/usr.bin/cvs/contrib/mfpipe.in
new file mode 100644
index 00000000000..1ecceb06901
--- /dev/null
+++ b/gnu/usr.bin/cvs/contrib/mfpipe.in
@@ -0,0 +1,85 @@
+#! @PERL@
+# -*-Perl-*-
+#
+# From: clyne@niwot.scd.ucar.EDU (John Clyne)
+# Date: Fri, 28 Feb 92 09:54:21 MST
+#
+# BTW, i wrote a perl script that is similar to 'nfpipe' except that in
+# addition to logging to a file it provides a command line option for mailing
+# change notices to a group of users. Obviously you probably wouldn't want
+# to mail every change. But there may be certain directories that are commonly
+# accessed by a group of users who would benefit from an email notice.
+# Especially if they regularly beat on the same directory. Anyway if you
+# think anyone would be interested here it is.
+#
+# File: mfpipe
+#
+# Author: John Clyne
+# National Center for Atmospheric Research
+# PO 3000, Boulder, Colorado
+#
+# Date: Wed Feb 26 18:34:53 MST 1992
+#
+# Description: Tee standard input to mail a list of users and to
+# a file. Used by CVS logging.
+#
+# Usage: mfpipe [-f file] [user@host...]
+#
+# Environment: CVSROOT
+# Path to CVS root.
+#
+# Files:
+#
+#
+# Options: -f file
+# Capture output to 'file'
+#
+
+$header = "Log Message:\n";
+
+$mailcmd = "| mail -s 'CVS update notice'";
+$whoami = `whoami`;
+chop $whoami;
+$date = `date`;
+chop $date;
+
+$cvsroot = $ENV{'CVSROOT'};
+
+while (@ARGV) {
+ $arg = shift @ARGV;
+
+ if ($arg eq '-f') {
+ $file = shift @ARGV;
+ }
+ else {
+ $users = "$users $arg";
+ }
+}
+
+if ($users) {
+ $mailcmd = "$mailcmd $users";
+ open(MAIL, $mailcmd) || die "Execing $mail: $!\n";
+}
+
+if ($file) {
+ $logfile = "$cvsroot/LOG/$file";
+ open(FILE, ">> $logfile") || die "Opening $logfile: $!\n";
+}
+
+print FILE "$whoami $date--------BEGIN LOG ENTRY-------------\n" if ($logfile);
+
+while (<>) {
+ print FILE $log if ($log && $logfile);
+
+ print FILE $_ if ($logfile);
+ print MAIL $_ if ($users);
+
+ $log = "log: " if ($_ eq $header);
+}
+
+close FILE;
+die "Write failed" if $?;
+close MAIL;
+die "Mail failed" if $?;
+
+exit 0;
diff --git a/gnu/usr.bin/cvs/contrib/rcslock.in b/gnu/usr.bin/cvs/contrib/rcslock.in
new file mode 100644
index 00000000000..e17356b9b1c
--- /dev/null
+++ b/gnu/usr.bin/cvs/contrib/rcslock.in
@@ -0,0 +1,235 @@
+#! @PERL@
+# -*-Perl-*-
+
+# Author: John Rouillard (rouilj@cs.umb.edu)
+# Supported: Yeah right. (Well what do you expect for 2 hours work?)
+# Blame-to: rouilj@cs.umb.edu
+# Complaints to: Anybody except Brian Berliner, he's blameless for
+# this script.
+# Acknowlegements: The base code for this script has been acquired
+# from the log.pl script.
+
+# rcslock.pl - A program to prevent commits when a file to be ckecked
+# in is locked in the repository.
+
+# There are times when you need exclusive access to a file. This
+# often occurs when binaries are checked into the repository, since
+# cvs's (actually rcs's) text based merging mechanism won't work. This
+# script allows you to use the rcs lock mechanism (rcs -l) to make
+# sure that no changes to a repository are able to be committed if
+# those changes would result in a locked file being changed.
+
+# WARNING:
+# This script will work only if locking is set to strict.
+#
+
+# Setup:
+# Add the following line to the commitinfo file:
+
+# ALL /local/location/for/script/lockcheck [options]
+
+# Where ALL is replaced by any suitable regular expression.
+# Options are -v for verbose info, or -d for debugging info.
+# The %s will provide the repository directory name and the names of
+# all changed files.
+
+# Use:
+# When a developer needs exclusive access to a version of a file, s/he
+# should use "rcs -l" in the repository tree to lock the version they
+# are working on. CVS will automagically release the lock when the
+# commit is performed.
+
+# Method:
+# An "rlog -h" is exec'ed to give info on all about to be
+# committed files. This (header) information is parsed to determine
+# if any locks are outstanding and what versions of the file are
+# locked. This filename, version number info is used to index an
+# associative array. All of the files to be committed are checked to
+# see if any locks are outstanding. If locks are outstanding, the
+# version number of the current file (taken from the CVS/Entries
+# subdirectory) is used in the key to determine if that version is
+# locked. If the file being checked in is locked by the person doing
+# the checkin, the commit is allowed, but if the lock is held on that
+# version of a file by another person, the commit is not allowed.
+
+$ext = ",v"; # The extension on your rcs files.
+
+$\="\n"; # I hate having to put \n's at the end of my print statements
+$,=' '; # Spaces should occur between arguments to print when printed
+
+# turn off setgid
+#
+$) = $(;
+
+#
+# parse command line arguments
+#
+require 'getopts.pl';
+
+&Getopts("vd"); # verbose or debugging
+
+# Verbose is useful when debugging
+$opt_v = $opt_d if defined $opt_d;
+
+# $files[0] is really the name of the subdirectory.
+# @files = split(/ /,$ARGV[0]);
+@files = @ARGV[0..$#ARGV];
+$cvsroot = $ENV{'CVSROOT'};
+
+#
+# get login name
+#
+$login = getlogin || (getpwuid($<))[0] || "nobody";
+
+#
+# save the current directory since we have to return here to parse the
+# CVS/Entries file if a lock is found.
+#
+$pwd = `/bin/pwd`;
+chop $pwd;
+
+print "Starting directory is $pwd" if defined $opt_d ;
+
+#
+# cd to the repository directory and check on the files.
+#
+print "Checking directory ", $files[0] if defined $opt_v ;
+
+if ( $files[0] =~ /^\// )
+{
+ print "Directory path is $files[0]" if defined $opt_d ;
+ chdir $files[0] || die "Can't change to repository directory $files[0]" ;
+}
+else
+{
+ print "Directory path is $cvsroot/$files[0]" if defined $opt_d ;
+ chdir ($cvsroot . "/" . $files[0]) ||
+ die "Can't change to repository directory $files[0] in $cvsroot" ;
+}
+
+
+# Open the rlog process and apss all of the file names to that one
+# process to cut down on exec overhead. This may backfire if there
+# are too many files for the system buffer to handle, but if there are
+# that many files, chances are that the cvs repository is not set up
+# cleanly.
+
+print "opening rlog -h @files[1..$#files] |" if defined $opt_d;
+
+open( RLOG, "rlog -h @files[1..$#files] |") || die "Can't run rlog command" ;
+
+# Create the locks associative array. The elements in the array are
+# of two types:
+#
+# The name of the RCS file with a value of the total number of locks found
+# for that file,
+# or
+#
+# The name of the rcs file concatenated with the version number of the lock.
+# The value of this element is the name of the locker.
+
+# The regular expressions used to split the rcs info may have to be changed.
+# The current ones work for rcs 5.6.
+
+$lock = 0;
+
+while (<RLOG>)
+{
+ chop;
+ next if /^$/; # ditch blank lines
+
+ if ( $_ =~ /^RCS file: (.*)$/ )
+ {
+ $curfile = $1;
+ next;
+ }
+
+ if ( $_ =~ /^locks: strict$/ )
+ {
+ $lock = 1 ;
+ next;
+ }
+
+ if ( $lock )
+ {
+ # access list: is the line immediately following the list of locks.
+ if ( /^access list:/ )
+ { # we are done getting lock info for this file.
+ $lock = 0;
+ }
+ else
+ { # We are accumulating lock info.
+
+ # increment the lock count
+ $locks{$curfile}++;
+ # save the info on the version that is locked. $2 is the
+ # version number $1 is the name of the locker.
+ $locks{"$curfile" . "$2"} = $1
+ if /[ ]*([a-zA-Z._]*): ([0-9.]*)$/;
+
+ print "lock by $1 found on $curfile version $2" if defined $opt_d;
+
+ }
+ }
+}
+
+# Lets go back to the starting directory and see if any locked files
+# are ones we are interested in.
+
+chdir $pwd;
+
+# fo all of the file names (remember $files[0] is the directory name
+foreach $i (@files[1..$#files])
+{
+ if ( defined $locks{$i . $ext} )
+ { # well the file has at least one lock outstanding
+
+ # find the base version number of our file
+ &parse_cvs_entry($i,*entry);
+
+ # is our version of this file locked?
+ if ( defined $locks{$i . $ext . $entry{"version"}} )
+ { # if so, it is by us?
+ if ( $login ne ($by = $locks{$i . $ext . $entry{"version"}}) )
+ {# crud somebody else has it locked.
+ $outstanding_lock++ ;
+ print "$by has file $i locked for version " , $entry{"version"};
+ }
+ else
+ { # yeah I have it locked.
+ print "You have a lock on file $i for version " , $entry{"version"}
+ if defined $opt_v;
+ }
+ }
+ }
+}
+
+exit $outstanding_lock;
+
+
+### End of main program
+
+sub parse_cvs_entry
+{ # a very simple minded hack at parsing an entries file.
+local ( $file, *entry ) = @_;
+local ( @pp );
+
+
+open(ENTRIES, "< CVS/Entries") || die "Can't open entries file";
+
+while (<ENTRIES>)
+ {
+ if ( $_ =~ /^\/$file\// )
+ {
+ @pp = split('/');
+
+ $entry{"name"} = $pp[1];
+ $entry{"version"} = $pp[2];
+ $entry{"dates"} = $pp[3];
+ $entry{"name"} = $pp[4];
+ $entry{"name"} = $pp[5];
+ $entry{"sticky"} = $pp[6];
+ return;
+ }
+ }
+}
diff --git a/gnu/usr.bin/cvs/contrib/sccs2rcs.in b/gnu/usr.bin/cvs/contrib/sccs2rcs.in
new file mode 100644
index 00000000000..018b4ff48c7
--- /dev/null
+++ b/gnu/usr.bin/cvs/contrib/sccs2rcs.in
@@ -0,0 +1,281 @@
+#! @CSH@ -f
+#
+# Sccs2rcs is a script to convert an existing SCCS
+# history into an RCS history without losing any of
+# the information contained therein.
+# It has been tested under the following OS's:
+# SunOS 3.5, 4.0.3, 4.1
+# Ultrix-32 2.0, 3.1
+#
+# Things to note:
+# + It will NOT delete or alter your ./SCCS history under any circumstances.
+#
+# + Run in a directory where ./SCCS exists and where you can
+# create ./RCS
+#
+# + /usr/local/bin is put in front of the default path.
+# (SCCS under Ultrix is set-uid sccs, bad bad bad, so
+# /usr/local/bin/sccs here fixes that)
+#
+# + Date, time, author, comments, branches, are all preserved.
+#
+# + If a command fails somewhere in the middle, it bombs with
+# a message -- remove what it's done so far and try again.
+# "rm -rf RCS; sccs unedit `sccs tell`; sccs clean"
+# There is no recovery and exit is far from graceful.
+# If a particular module is hanging you up, consider
+# doing it separately; move it from the current area so that
+# the next run will have a better chance or working.
+# Also (for the brave only) you might consider hacking
+# the s-file for simpler problems: I've successfully changed
+# the date of a delta to be in sync, then run "sccs admin -z"
+# on the thing.
+#
+# + After everything finishes, ./SCCS will be moved to ./old-SCCS.
+#
+# This file may be copied, processed, hacked, mutilated, and
+# even destroyed as long as you don't tell anyone you wrote it.
+#
+# Ken Cox
+# Viewlogic Systems, Inc.
+# kenstir@viewlogic.com
+# ...!harvard!cg-atla!viewlog!kenstir
+#
+# Various hacks made by Brian Berliner before inclusion in CVS contrib area.
+
+
+#we'll assume the user set up the path correctly
+# for the Pmax, /usr/ucb/sccs is suid sccs, what a pain
+# /usr/local/bin/sccs should override /usr/ucb/sccs there
+set path = (/usr/local/bin $path)
+
+
+############################################################
+# Error checking
+#
+if (! -w .) then
+ echo "Error: ./ not writeable by you."
+ exit 1
+endif
+if (! -d SCCS) then
+ echo "Error: ./SCCS directory not found."
+ exit 1
+endif
+set edits = (`sccs tell`)
+if ($#edits) then
+ echo "Error: $#edits file(s) out for edit...clean up before converting."
+ exit 1
+endif
+if (-d RCS) then
+ echo "Warning: RCS directory exists"
+ if (`ls -a RCS | wc -l` > 2) then
+ echo "Error: RCS directory not empty
+ exit 1
+ endif
+else
+ mkdir RCS
+endif
+
+sccs clean
+
+set logfile = /tmp/sccs2rcs_$$_log
+rm -f $logfile
+set tmpfile = /tmp/sccs2rcs_$$_tmp
+rm -f $tmpfile
+set emptyfile = /tmp/sccs2rcs_$$_empty
+echo -n "" > $emptyfile
+set initialfile = /tmp/sccs2rcs_$$_init
+echo "Initial revision" > $initialfile
+set sedfile = /tmp/sccs2rcs_$$_sed
+rm -f $sedfile
+set revfile = /tmp/sccs2rcs_$$_rev
+rm -f $revfile
+
+# the quotes surround the dollar signs to fool RCS when I check in this script
+set sccs_keywords = (\
+ '%W%[ ]*%G%'\
+ '%W%[ ]*%E%'\
+ '%W%'\
+ '%Z%%M%[ ]*%I%[ ]*%G%'\
+ '%Z%%M%[ ]*%I%[ ]*%E%'\
+ '%M%[ ]*%I%[ ]*%G%'\
+ '%M%[ ]*%I%[ ]*%E%'\
+ '%M%'\
+ '%I%'\
+ '%G%'\
+ '%E%'\
+ '%U%')
+set rcs_keywords = (\
+ '$'Id'$'\
+ '$'Id'$'\
+ '$'Id'$'\
+ '$'SunId'$'\
+ '$'SunId'$'\
+ '$'Id'$'\
+ '$'Id'$'\
+ '$'RCSfile'$'\
+ '$'Revision'$'\
+ '$'Date'$'\
+ '$'Date'$'\
+ '')
+
+
+############################################################
+# Get some answers from user
+#
+echo ""
+echo "Do you want to be prompted for a description of each"
+echo "file as it is checked in to RCS initially?"
+echo -n "(y=prompt for description, n=null description) [y] ?"
+set ans = $<
+if ((_$ans == _) || (_$ans == _y) || (_$ans == _Y)) then
+ set nodesc = 0
+else
+ set nodesc = 1
+endif
+echo ""
+echo "The default keyword substitutions are as follows and are"
+echo "applied in the order specified:"
+set i = 1
+while ($i <= $#sccs_keywords)
+# echo ' '\"$sccs_keywords[$i]\"' ==> '\"$rcs_keywords[$i]\"
+ echo " $sccs_keywords[$i] ==> $rcs_keywords[$i]"
+ @ i = $i + 1
+end
+echo ""
+echo -n "Do you want to change them [n] ?"
+set ans = $<
+if ((_$ans != _) && (_$ans != _n) && (_$ans != _N)) then
+ echo "You can't always get what you want."
+ echo "Edit this script file and change the variables:"
+ echo ' $sccs_keywords'
+ echo ' $rcs_keywords'
+else
+ echo "good idea."
+endif
+
+# create the sed script
+set i = 1
+while ($i <= $#sccs_keywords)
+ echo "s,$sccs_keywords[$i],$rcs_keywords[$i],g" >> $sedfile
+ @ i = $i + 1
+end
+
+onintr ERROR
+
+############################################################
+# Loop over every s-file in SCCS dir
+#
+foreach sfile (SCCS/s.*)
+ # get rid of the "s." at the beginning of the name
+ set file = `echo $sfile:t | sed -e "s/^..//"`
+
+ # work on each rev of that file in ascending order
+ set firsttime = 1
+ sccs prs $file | grep "^D " | awk '{print $2}' | sed -e 's/\./ /g' | sort -n -u +0 +1 +2 +3 +4 +5 +6 +7 +8 | sed -e 's/ /./g' > $revfile
+ foreach rev (`cat $revfile`)
+ if ($status != 0) goto ERROR
+
+ # get file into current dir and get stats
+ set year = `echo $date | cut -c3-4`
+ if ($year < 70) then
+ # Y2K Bug, change century to 20
+ set date = `sccs prs -r$rev $file | grep "^D " | awk '{printf("20%s %s", $3, $4); exit}'`
+ else
+ set date = `sccs prs -r$rev $file | grep "^D " | awk '{printf("19%s %s", $3, $4); exit}'`
+ endif
+ set author = `sccs prs -r$rev $file | grep "^D " | awk '{print $5; exit}'`
+ echo ""
+ echo "==> file $file, rev=$rev, date=$date, author=$author"
+ sccs edit -r$rev $file >>& $logfile
+ if ($status != 0) goto ERROR
+ echo checked out of SCCS
+
+ # add RCS keywords in place of SCCS keywords
+ sed -f $sedfile $file > $tmpfile
+ if ($status != 0) goto ERROR
+ echo performed keyword substitutions
+ cp $tmpfile $file
+
+ # check file into RCS
+ if ($firsttime) then
+ set firsttime = 0
+ if ($nodesc) then
+ echo about to do ci
+ echo ci -f -r$rev -d"$date" -w$author -t$emptyfile $file
+ ci -f -r$rev -d"$date" -w$author -t$emptyfile $file < $initialfile >>& $logfile
+ if ($status != 0) goto ERROR
+ echo initial rev checked into RCS without description
+ else
+ echo ""
+ echo Enter a brief description of the file $file \(end w/ Ctrl-D\):
+ cat > $tmpfile
+ ci -f -r$rev -d"$date" -w$author -t$tmpfile $file < $initialfile >>& $logfile
+ if ($status != 0) goto ERROR
+ echo initial rev checked into RCS
+ endif
+ else
+ # get RCS lock
+ set lckrev = `echo $rev | sed -e 's/\.[0-9]*$//'`
+ if ("$lckrev" =~ [0-9]*.*) then
+ # need to lock the brach -- it is OK if the lock fails
+ rcs -l$lckrev $file >>& $logfile
+ else
+ # need to lock the trunk -- must succeed
+ rcs -l $file >>& $logfile
+ if ($status != 0) goto ERROR
+ endif
+ echo got lock
+ sccs prs -r$rev $file | grep "." > $tmpfile
+ # it's OK if grep fails here and gives status == 1
+ # put the delta message in $tmpfile
+ ed $tmpfile >>& $logfile <<EOF
+/COMMENTS
+1,.d
+w
+q
+EOF
+ ci -f -r$rev -d"$date" -w$author $file < $tmpfile >>& $logfile
+ if ($status != 0) goto ERROR
+ echo checked into RCS
+ endif
+ sccs unedit $file >>& $logfile
+ if ($status != 0) goto ERROR
+ end
+ rm -f $file
+end
+
+
+############################################################
+# Clean up
+#
+echo cleaning up...
+mv SCCS old-SCCS
+rm -f $tmpfile $emptyfile $initialfile $sedfile
+echo ===================================================
+echo " Conversion Completed Successfully"
+echo ""
+echo " SCCS history now in old-SCCS/"
+echo ===================================================
+set exitval = 0
+goto cleanup
+
+ERROR:
+foreach f (`sccs tell`)
+ sccs unedit $f
+end
+echo ""
+echo ""
+echo Danger\! Danger\!
+echo Some command exited with a non-zero exit status.
+echo Log file exists in $logfile.
+echo ""
+echo Incomplete history in ./RCS -- remove it
+echo Original unchanged history in ./SCCS
+set exitval = 1
+
+cleanup:
+# leave log file
+rm -f $tmpfile $emptyfile $initialfile $sedfile $revfile
+
+exit $exitval
diff --git a/gnu/usr.bin/cvs/cvs.spec b/gnu/usr.bin/cvs/cvs.spec
index 80e8e7babf0..8b204cb2259 100644
--- a/gnu/usr.bin/cvs/cvs.spec
+++ b/gnu/usr.bin/cvs/cvs.spec
@@ -1,45 +1,213 @@
-Summary: Concurrent Versions System
+Summary: A version control system.
Name: cvs
-Version: @VERSION@
+Version: 1.11.1p1
Release: 1
Copyright: GPL
-Group: Development/Version Control
-Source: ftp://ftp.cvshome.org/pub/cvs-@VERSION@/cvs-@VERSION@.tar.gz
-Prefix: /usr
+Group: Development/Tools
+Source: ftp://ftp.cvshome.com/pub/cvs-%{version}/cvs-%{version}.tar.gz
+URL: http://CVSHome.org
+Prereq: /sbin/install-info
+Prefix: %{_prefix}
+Buildroot: %{_tmppath}/%{name}-root
%description
-CVS is a version control system, which allows you to keep old versions
-of files (usually source code), keep a log of who, when, and why
-changes occurred, etc., like RCS or SCCS. Unlike the simpler systems,
-CVS does not just operate on one file at a time or one directory at a
-time, but operates on hierarchical collections of directories
-consisting of version controlled files. CVS helps to manage releases
-and to control the concurrent editing of source files among multiple
-authors. CVS allows triggers to enable/log/control various
-operations and works well over a wide area network.
+CVS (Concurrent Version System) is a version control system which can
+record the history of your files (usually, but not always, source
+code). CVS only stores the differences between versions, instead of
+every version of every file you've ever created. CVS also keeps a log
+of who, when and why changes occurred.
+
+CVS is very helpful for managing releases and controlling the
+concurrent editing of source files among multiple authors. Instead of
+providing version control for a collection of files in a single
+directory, CVS provides version control for a hierarchical collection
+of directories consisting of revision controlled files. These
+directories and files can then be combined together to form a software
+release.
+
+Install the cvs package if you need to use a version control system.
+
+%define gssapi %(test -r /usr/kerberos/lib/libkrb5.a && echo 1 || echo 0)
+%if %gssapi
+%package krb5
+Summary: A version control system with Kerberos authentication.
+Group: Development/Tools
+Requires: cvs krb5-libs
+BuildRequires: krb5-devel
+
+%description krb5
+CVS (Concurrent Version System) is a version control system which can
+record the history of your files (usually, but not always, source
+code). CVS only stores the differences between versions, instead of
+every version of every file you've ever created. CVS also keeps a log
+of who, when and why changes occurred.
+
+CVS is very helpful for managing releases and controlling the
+concurrent editing of source files among multiple authors. Instead of
+providing version control for a collection of files in a single
+directory, CVS provides version control for a hierarchical collection
+of directories consisting of revision controlled files. These
+directories and files can then be combined together to form a software
+release.
+
+This package contains only a Kerberized version of the CVS binary. You should
+install the base cvs package to get the standard CVS distribution.
+
+Install the Kerberos version of the cvs package if you need to use a version
+control system with Kerberos authentication and encryption.
+
+%define _kerberosdir %{prefix}/kerberos
+%define _kerberosbindir %{_kerberosdir}/bin
+%endif
%prep
-%setup
+%setup -q
%build
-./configure --prefix=$RPM_BUILD_ROOT/usr
-make CFLAGS="$RPM_OPT_FLAGS -DRCSBIN_DFLT=\\\"/usr/bin\\\"" LDFLAGS=-s
+# The Kerberized binary
+%if %gssapi
+%configure --with-gssapi=/usr/kerberos --enable-encryption
+
+make LDFLAGS=-s
+mv src/cvs src/cvs.krb5
+
+rm config.cache
+%endif
+
+# The standard package
+%configure --without-gssapi
+
+make LDFLAGS=-s
+make -C doc info
%install
-make installdirs
-make install
-rm -f $RPM_BUILD_ROOT/usr/info/cvs*
-make install-info
-gzip -9nf $RPM_BUILD_ROOT/usr/info/cvs*
+rm -rf $RPM_BUILD_ROOT
+
+%makeinstall
+# The Kerberized binary
+%if %gssapi
+./install-sh src/cvs.krb5 $RPM_BUILD_ROOT%{_kerberosbindir}/cvs
+%endif
+
+rm -f $RPM_BUILD_ROOT${_infodir}/dir
+gzip -9nf $RPM_BUILD_ROOT%{_infodir}/cvs*
+strip $RPM_BUILD_ROOT%{_bindir}/cvs
+%if %gssapi
+strip $RPM_BUILD_ROOT%{_kerberosbindir}/cvs
+%endif
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post
+ /sbin/install-info --info-dir=%{_infodir} %{_infodir}/cvs.info.gz
+ /sbin/install-info --info-dir=%{_infodir} %{_infodir}/cvsclient.info.gz
+%preun
+if [ $1 = 0 ]; then
+ # uninstall the info reference in the dir file
+ /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/cvs.info.gz
+ /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/cvsclient.info.gz
+fi
%files
-%doc BUGS COPYING COPYING.LIB FAQ HACKING
-%doc INSTALL MINOR-BUGS NEWS PROJECTS README TESTS TODO
-/usr/bin/cvs
-/usr/bin/cvsbug
-/usr/bin/rcs2log
-/usr/man/man1/cvs.1
-/usr/man/man5/cvs.5
-/usr/man/man8/cvsbug.8
-/usr/info/cvs*
-/usr/lib/cvs
+%defattr(-,root,root)
+%doc BUGS FAQ MINOR-BUGS NEWS PROJECTS TODO README
+%doc doc/RCSFILES doc/*.ps
+%{_bindir}
+%{_infodir}/cvs*.gz
+%{_mandir}
+
+%if %gssapi
+%files krb5
+%defattr(-,root,root)
+%{_kerberosdir}
+%endif
+
+%changelog
+* Thu Apr 26 2001 Derek Price <dprice@collab.net>
+- avoid picking up %{_infodir}/dir.
+- remove krb5-configs from requirements since RedHat doesn't use it anymore.
+
+* Wed Nov 29 2000 Derek Price <dprice@openavenue.com>
+- Use _infodir consistently for info pages and _bindir for binaries.
+- use more succinct file list
+
+* Wed Oct 18 2000 Derek Price <dprice@openavenue.com>
+- Make the Kerberos binary a subpackage.
+- fix the info & man pages too
+
+* Wed Sep 27 2000 Derek Price <dprice@openavenue.com>
+- updated for cvs 1.11
+
+* Wed Mar 1 2000 Nalin Dahyabhai <nalin@redhat.com>
+- make kerberos support conditional at build-time
+
+* Wed Mar 1 2000 Bill Nottingham <notting@redhat.com>
+- integrate kerberos support into main tree
+
+* Mon Feb 14 2000 Nalin Dahyabhai <nalin@redhat.com>
+- build with gssapi auth (--with-gssapi, --with-encryption)
+- apply patch to update libs to krb5 1.1.1
+
+* Fri Feb 04 2000 Cristian Gafton <gafton@redhat.com>
+- fix the damn info pages too while we're at it.
+- fix description
+- man pages are compressed
+- make sure %post and %preun work okay
+
+* Sun Jan 9 2000 Jim Kingdon <http://bugzilla.redhat.com/bugzilla>
+- update to 1.10.7.
+
+* Wed Jul 14 1999 Jim Kingdon <http://developer.redhat.com>
+- add the patch to make 1.10.6 usable
+ (http://www.cyclic.com/cvs/dev-known.html).
+
+* Tue Jun 1 1999 Jeff Johnson <jbj@redhat.com>
+- update to 1.10.6.
+
+* Sun Mar 21 1999 Cristian Gafton <gafton@redhat.com>
+- auto rebuild in the new build environment (release 2)
+
+* Mon Feb 22 1999 Jeff Johnson <jbj@redhat.com>
+- updated text in spec file.
+
+* Mon Feb 22 1999 Jeff Johnson <jbj@redhat.com>
+- update to 1.10.5.
+
+* Tue Feb 2 1999 Jeff Johnson <jbj@redhat.com>
+- update to 1.10.4.
+
+* Tue Oct 20 1998 Jeff Johnson <jbj@redhat.com>
+- update to 1.10.3.
+
+* Mon Sep 28 1998 Jeff Johnson <jbj@redhat.com>
+- update to 1.10.2.
+
+* Wed Sep 23 1998 Jeff Johnson <jbj@redhat.com>
+- remove trailing characters from rcs2log mktemp args
+
+* Thu Sep 10 1998 Jeff Johnson <jbj@redhat.com>
+- update to 1.10.1
+
+* Mon Aug 31 1998 Jeff Johnson <jbj@redhat.com>
+- fix race conditions in cvsbug/rcs2log
+
+* Sun Aug 16 1998 Jeff Johnson <jbj@redhat.com>
+- update to 1.10.
+
+* Wed Aug 12 1998 Jeff Johnson <jbj@redhat.com>
+- update to 1.9.30.
+
+* Mon Jun 08 1998 Prospector System <bugs@redhat.com>
+- translations modified for de, fr
+
+* Mon Jun 8 1998 Jeff Johnson <jbj@redhat.com>
+- build root
+- update to 1.9.28
+
+* Mon Apr 27 1998 Prospector System <bugs@redhat.com>
+- translations modified for de, fr, tr
+
+* Wed Oct 29 1997 Otto Hammersmith <otto@redhat.com>
+- added install-info stuff
+- added changelog section
diff --git a/gnu/usr.bin/cvs/cvs.spec.in b/gnu/usr.bin/cvs/cvs.spec.in
new file mode 100644
index 00000000000..d8effb38f84
--- /dev/null
+++ b/gnu/usr.bin/cvs/cvs.spec.in
@@ -0,0 +1,213 @@
+Summary: A version control system.
+Name: cvs
+Version: @VERSION@
+Release: 1
+Copyright: GPL
+Group: Development/Tools
+Source: ftp://ftp.cvshome.com/pub/cvs-%{version}/cvs-%{version}.tar.gz
+URL: http://CVSHome.org
+Prereq: /sbin/install-info
+Prefix: %{_prefix}
+Buildroot: %{_tmppath}/%{name}-root
+
+%description
+CVS (Concurrent Version System) is a version control system which can
+record the history of your files (usually, but not always, source
+code). CVS only stores the differences between versions, instead of
+every version of every file you've ever created. CVS also keeps a log
+of who, when and why changes occurred.
+
+CVS is very helpful for managing releases and controlling the
+concurrent editing of source files among multiple authors. Instead of
+providing version control for a collection of files in a single
+directory, CVS provides version control for a hierarchical collection
+of directories consisting of revision controlled files. These
+directories and files can then be combined together to form a software
+release.
+
+Install the cvs package if you need to use a version control system.
+
+%define gssapi %(test -r /usr/kerberos/lib/libkrb5.a && echo 1 || echo 0)
+%if %gssapi
+%package krb5
+Summary: A version control system with Kerberos authentication.
+Group: Development/Tools
+Requires: cvs krb5-libs
+BuildRequires: krb5-devel
+
+%description krb5
+CVS (Concurrent Version System) is a version control system which can
+record the history of your files (usually, but not always, source
+code). CVS only stores the differences between versions, instead of
+every version of every file you've ever created. CVS also keeps a log
+of who, when and why changes occurred.
+
+CVS is very helpful for managing releases and controlling the
+concurrent editing of source files among multiple authors. Instead of
+providing version control for a collection of files in a single
+directory, CVS provides version control for a hierarchical collection
+of directories consisting of revision controlled files. These
+directories and files can then be combined together to form a software
+release.
+
+This package contains only a Kerberized version of the CVS binary. You should
+install the base cvs package to get the standard CVS distribution.
+
+Install the Kerberos version of the cvs package if you need to use a version
+control system with Kerberos authentication and encryption.
+
+%define _kerberosdir %{prefix}/kerberos
+%define _kerberosbindir %{_kerberosdir}/bin
+%endif
+
+%prep
+%setup -q
+
+%build
+# The Kerberized binary
+%if %gssapi
+%configure --with-gssapi=/usr/kerberos --enable-encryption
+
+make LDFLAGS=-s
+mv src/cvs src/cvs.krb5
+
+rm config.cache
+%endif
+
+# The standard package
+%configure --without-gssapi
+
+make LDFLAGS=-s
+make -C doc info
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%makeinstall
+# The Kerberized binary
+%if %gssapi
+./install-sh src/cvs.krb5 $RPM_BUILD_ROOT%{_kerberosbindir}/cvs
+%endif
+
+rm -f $RPM_BUILD_ROOT${_infodir}/dir
+gzip -9nf $RPM_BUILD_ROOT%{_infodir}/cvs*
+strip $RPM_BUILD_ROOT%{_bindir}/cvs
+%if %gssapi
+strip $RPM_BUILD_ROOT%{_kerberosbindir}/cvs
+%endif
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post
+ /sbin/install-info --info-dir=%{_infodir} %{_infodir}/cvs.info.gz
+ /sbin/install-info --info-dir=%{_infodir} %{_infodir}/cvsclient.info.gz
+%preun
+if [ $1 = 0 ]; then
+ # uninstall the info reference in the dir file
+ /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/cvs.info.gz
+ /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/cvsclient.info.gz
+fi
+
+%files
+%defattr(-,root,root)
+%doc BUGS FAQ MINOR-BUGS NEWS PROJECTS TODO README
+%doc doc/RCSFILES doc/*.ps
+%{_bindir}
+%{_infodir}/cvs*.gz
+%{_mandir}
+
+%if %gssapi
+%files krb5
+%defattr(-,root,root)
+%{_kerberosdir}
+%endif
+
+%changelog
+* Thu Apr 26 2001 Derek Price <dprice@collab.net>
+- avoid picking up %{_infodir}/dir.
+- remove krb5-configs from requirements since RedHat doesn't use it anymore.
+
+* Wed Nov 29 2000 Derek Price <dprice@openavenue.com>
+- Use _infodir consistently for info pages and _bindir for binaries.
+- use more succinct file list
+
+* Wed Oct 18 2000 Derek Price <dprice@openavenue.com>
+- Make the Kerberos binary a subpackage.
+- fix the info & man pages too
+
+* Wed Sep 27 2000 Derek Price <dprice@openavenue.com>
+- updated for cvs 1.11
+
+* Wed Mar 1 2000 Nalin Dahyabhai <nalin@redhat.com>
+- make kerberos support conditional at build-time
+
+* Wed Mar 1 2000 Bill Nottingham <notting@redhat.com>
+- integrate kerberos support into main tree
+
+* Mon Feb 14 2000 Nalin Dahyabhai <nalin@redhat.com>
+- build with gssapi auth (--with-gssapi, --with-encryption)
+- apply patch to update libs to krb5 1.1.1
+
+* Fri Feb 04 2000 Cristian Gafton <gafton@redhat.com>
+- fix the damn info pages too while we're at it.
+- fix description
+- man pages are compressed
+- make sure %post and %preun work okay
+
+* Sun Jan 9 2000 Jim Kingdon <http://bugzilla.redhat.com/bugzilla>
+- update to 1.10.7.
+
+* Wed Jul 14 1999 Jim Kingdon <http://developer.redhat.com>
+- add the patch to make 1.10.6 usable
+ (http://www.cyclic.com/cvs/dev-known.html).
+
+* Tue Jun 1 1999 Jeff Johnson <jbj@redhat.com>
+- update to 1.10.6.
+
+* Sun Mar 21 1999 Cristian Gafton <gafton@redhat.com>
+- auto rebuild in the new build environment (release 2)
+
+* Mon Feb 22 1999 Jeff Johnson <jbj@redhat.com>
+- updated text in spec file.
+
+* Mon Feb 22 1999 Jeff Johnson <jbj@redhat.com>
+- update to 1.10.5.
+
+* Tue Feb 2 1999 Jeff Johnson <jbj@redhat.com>
+- update to 1.10.4.
+
+* Tue Oct 20 1998 Jeff Johnson <jbj@redhat.com>
+- update to 1.10.3.
+
+* Mon Sep 28 1998 Jeff Johnson <jbj@redhat.com>
+- update to 1.10.2.
+
+* Wed Sep 23 1998 Jeff Johnson <jbj@redhat.com>
+- remove trailing characters from rcs2log mktemp args
+
+* Thu Sep 10 1998 Jeff Johnson <jbj@redhat.com>
+- update to 1.10.1
+
+* Mon Aug 31 1998 Jeff Johnson <jbj@redhat.com>
+- fix race conditions in cvsbug/rcs2log
+
+* Sun Aug 16 1998 Jeff Johnson <jbj@redhat.com>
+- update to 1.10.
+
+* Wed Aug 12 1998 Jeff Johnson <jbj@redhat.com>
+- update to 1.9.30.
+
+* Mon Jun 08 1998 Prospector System <bugs@redhat.com>
+- translations modified for de, fr
+
+* Mon Jun 8 1998 Jeff Johnson <jbj@redhat.com>
+- build root
+- update to 1.9.28
+
+* Mon Apr 27 1998 Prospector System <bugs@redhat.com>
+- translations modified for de, fr, tr
+
+* Wed Oct 29 1997 Otto Hammersmith <otto@redhat.com>
+- added install-info stuff
+- added changelog section
diff --git a/gnu/usr.bin/cvs/cvsnt.dsp b/gnu/usr.bin/cvs/cvsnt.dsp
index 7deb03e4b77..3f233de71d4 100644
--- a/gnu/usr.bin/cvs/cvsnt.dsp
+++ b/gnu/usr.bin/cvs/cvsnt.dsp
@@ -839,21 +839,6 @@ SOURCE=.\src\root.c
# End Source File
# Begin Source File
-SOURCE=.\src\rtag.c
-
-!IF "$(CFG)" == "cvsnt - Win32 Release"
-
-# PROP Intermediate_Dir "Release"
-
-!ELSEIF "$(CFG)" == "cvsnt - Win32 Debug"
-
-# PROP Intermediate_Dir "Debug"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
SOURCE=".\windows-NT\run.c"
!IF "$(CFG)" == "cvsnt - Win32 Release"
diff --git a/gnu/usr.bin/cvs/cvsnt.mak b/gnu/usr.bin/cvs/cvsnt.mak
index 75675bc5a10..178f1bfb9e8 100644
--- a/gnu/usr.bin/cvs/cvsnt.mak
+++ b/gnu/usr.bin/cvs/cvsnt.mak
@@ -79,7 +79,6 @@ CLEAN :
-@erase ".\WinRel\ignore.obj"
-@erase ".\WinRel\expand_path.obj"
-@erase ".\WinRel\repos.obj"
- -@erase ".\WinRel\rtag.obj"
-@erase ".\WinRel\valloc.obj"
-@erase ".\WinRel\cvsrc.obj"
-@erase ".\WinRel\lock.obj"
@@ -196,7 +195,7 @@ LINK32_OBJS= \
"$(INTDIR)/myndbm.obj" \
"$(INTDIR)/savecwd.obj" \
"$(INTDIR)/client.obj" \
- ".\WinRel\1\diff.obj" \
+ "$(INTDIR)/2/diff.obj" \
"$(INTDIR)/scramble.obj" \
"$(INTDIR)/filesubr.obj" \
"$(INTDIR)/infutil.obj" \
@@ -209,7 +208,6 @@ LINK32_OBJS= \
"$(INTDIR)/ignore.obj" \
"$(INTDIR)/expand_path.obj" \
"$(INTDIR)/repos.obj" \
- "$(INTDIR)/rtag.obj" \
"$(INTDIR)/valloc.obj" \
"$(INTDIR)/cvsrc.obj" \
"$(INTDIR)/lock.obj" \
@@ -220,11 +218,11 @@ LINK32_OBJS= \
"$(INTDIR)/commit.obj" \
"$(INTDIR)/patch.obj" \
"$(INTDIR)/classify.obj" \
- ".\WinRel\2\diff.obj" \
+ "$(INTDIR)/1/diff.obj" \
"$(INTDIR)/history.obj" \
"$(INTDIR)/add.obj" \
"$(INTDIR)/update.obj" \
- ".\WinRel\2\version.obj" \
+ "$(INTDIR)/2/version.obj" \
"$(INTDIR)/uncompr.obj" \
"$(INTDIR)/buffer.obj" \
"$(INTDIR)/rcmd.obj" \
@@ -264,7 +262,7 @@ LINK32_OBJS= \
"$(INTDIR)/inftrees.obj" \
"$(INTDIR)/regex.obj" \
"$(INTDIR)/io.obj" \
- ".\WinRel\1\version.obj" \
+ "$(INTDIR)/1/version.obj" \
"$(INTDIR)/vers_ts.obj" \
"$(INTDIR)/checkout.obj" \
"$(INTDIR)/stripslash.obj" \
@@ -306,12 +304,12 @@ INTDIR=.\WinDebug
ALL : "$(OUTDIR)\cvs.exe"
CLEAN :
- -@erase ".\WinDebug\vc40.pdb"
- -@erase ".\WinDebug\vc40.idb"
- -@erase ".\WinDebug\1\vc40.pdb"
- -@erase ".\WinDebug\1\vc40.idb"
- -@erase ".\WinDebug\2\vc40.pdb"
- -@erase ".\WinDebug\2\vc40.idb"
+ -@erase ".\WinDebug\vc60.pdb"
+ -@erase ".\WinDebug\vc60.idb"
+ -@erase ".\WinDebug\1\vc60.pdb"
+ -@erase ".\WinDebug\1\vc60.idb"
+ -@erase ".\WinDebug\2\vc60.pdb"
+ -@erase ".\WinDebug\2\vc60.idb"
-@erase ".\WinDebug\cvs.exe"
-@erase ".\WinDebug\regex.obj"
-@erase ".\WinDebug\normal.obj"
@@ -377,7 +375,6 @@ CLEAN :
-@erase ".\WinDebug\mkdir.obj"
-@erase ".\WinDebug\uncompr.obj"
-@erase ".\WinDebug\ignore.obj"
- -@erase ".\WinDebug\rtag.obj"
-@erase ".\WinDebug\root.obj"
-@erase ".\WinDebug\trees.obj"
-@erase ".\WinDebug\checkin.obj"
@@ -468,7 +465,7 @@ LINK32_OBJS= \
"$(INTDIR)/parseinfo.obj" \
"$(INTDIR)/login.obj" \
"$(INTDIR)/hash.obj" \
- ".\WinDebug\1\version.obj" \
+ "$(INTDIR)/1/version.obj" \
"$(INTDIR)/subr.obj" \
"$(INTDIR)/fncase.obj" \
"$(INTDIR)/fileattr.obj" \
@@ -499,7 +496,7 @@ LINK32_OBJS= \
"$(INTDIR)/infblock.obj" \
"$(INTDIR)/inftrees.obj" \
"$(INTDIR)/deflate.obj" \
- ".\WinDebug\1\diff.obj" \
+ "$(INTDIR)/2/diff.obj" \
"$(INTDIR)/analyze.obj" \
"$(INTDIR)/gzio.obj" \
"$(INTDIR)/patch.obj" \
@@ -509,7 +506,6 @@ LINK32_OBJS= \
"$(INTDIR)/mkdir.obj" \
"$(INTDIR)/uncompr.obj" \
"$(INTDIR)/ignore.obj" \
- "$(INTDIR)/rtag.obj" \
"$(INTDIR)/root.obj" \
"$(INTDIR)/trees.obj" \
"$(INTDIR)/checkin.obj" \
@@ -527,7 +523,7 @@ LINK32_OBJS= \
"$(INTDIR)/commit.obj" \
"$(INTDIR)/diff3.obj" \
"$(INTDIR)/expand_path.obj" \
- ".\WinDebug\2\diff.obj" \
+ "$(INTDIR)/1/diff.obj" \
"$(INTDIR)/update.obj" \
"$(INTDIR)/waitpid.obj" \
"$(INTDIR)/adler32.obj" \
@@ -539,7 +535,7 @@ LINK32_OBJS= \
"$(INTDIR)/getopt.obj" \
"$(INTDIR)/entries.obj" \
"$(INTDIR)/getopt1.obj" \
- ".\WinDebug\2\version.obj" \
+ "$(INTDIR)/2/version.obj" \
"$(INTDIR)/yesno.obj" \
"$(INTDIR)/compress.obj" \
"$(INTDIR)/io.obj" \
@@ -599,6 +595,7 @@ DEP_CPP_MKMOD=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -636,6 +633,7 @@ DEP_CPP_SUBR_=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -672,6 +670,7 @@ DEP_CPP_ADMIN=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -720,6 +719,8 @@ DEP_CPP_SERVE=\
".\lib\regex.h"\
".\lib\getopt.h"\
".\lib\wait.h"\
+ ".\lib\xselect.h"\
+ ".\lib\xtime.h"\
".\src\rcs.h"\
".\src\update.h"\
".\src\server.h"\
@@ -749,6 +750,7 @@ DEP_CPP_DIFF_=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -768,7 +770,7 @@ NODEP_CPP_DIFF_=\
".\src\popen.h"\
".\lib\tcpip.h"\
-INTDIR_SRC=.\WinRel\1
+INTDIR_SRC=$(INTDIR)/1
"$(INTDIR_SRC)" :
if not exist "$(INTDIR_SRC)/$(NULL)" mkdir "$(INTDIR_SRC)"
@@ -811,6 +813,7 @@ DEP_CPP_CLIEN=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -847,6 +850,7 @@ DEP_CPP_CHECK=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -883,12 +887,14 @@ DEP_CPP_NO_DI=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
".\lib\regex.h"\
".\lib\getopt.h"\
".\lib\wait.h"\
+ ".\lib\xtime.h"\
".\src\rcs.h"\
".\src\update.h"\
".\src\server.h"\
@@ -920,6 +926,7 @@ DEP_CPP_ENTRI=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -957,6 +964,7 @@ DEP_CPP_TAG_C=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -985,42 +993,6 @@ NODEP_CPP_TAG_C=\
################################################################################
# Begin Source File
-SOURCE=.\src\rtag.c
-DEP_CPP_RTAG_=\
- ".\src\cvs.h"\
- ".\windows-NT\config.h"\
- ".\windows-NT\options.h"\
- ".\lib\fnmatch.h"\
- ".\windows-NT\pwd.h"\
- ".\lib\system.h"\
- ".\src\hash.h"\
- ".\src\client.h"\
- ".\src\myndbm.h"\
- ".\lib\regex.h"\
- ".\lib\getopt.h"\
- ".\lib\wait.h"\
- ".\src\rcs.h"\
- ".\src\update.h"\
- ".\src\server.h"\
- {$(INCLUDE)}"\sys\Types.h"\
- {$(INCLUDE)}"\sys\Stat.h"\
- {$(INCLUDE)}"\sys\Timeb.h"\
- {$(INCLUDE)}"\sys\Utime.h"\
- ".\windows-NT\ndir.h"\
-
-NODEP_CPP_RTAG_=\
- ".\src\popen.h"\
- ".\lib\tcpip.h"\
-
-
-"$(INTDIR)\rtag.obj" : $(SOURCE) $(DEP_CPP_RTAG_) "$(INTDIR)"
- $(CPP) $(CPP_PROJ) $(SOURCE)
-
-
-# End Source File
-################################################################################
-# Begin Source File
-
SOURCE=.\src\status.c
DEP_CPP_STATU=\
".\src\cvs.h"\
@@ -1029,6 +1001,7 @@ DEP_CPP_STATU=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -1066,6 +1039,7 @@ DEP_CPP_ROOT_=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -1103,6 +1077,7 @@ DEP_CPP_MYNDB=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -1139,6 +1114,7 @@ DEP_CPP_HASH_=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -1176,6 +1152,7 @@ DEP_CPP_REPOS=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -1213,6 +1190,7 @@ DEP_CPP_PARSE=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -1249,6 +1227,7 @@ DEP_CPP_VERS_=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -1287,6 +1266,7 @@ DEP_CPP_CHECKI=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -1327,6 +1307,7 @@ DEP_CPP_COMMI=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -1363,6 +1344,7 @@ DEP_CPP_VERSI=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -1382,7 +1364,7 @@ NODEP_CPP_VERSI=\
".\src\popen.h"\
".\lib\tcpip.h"\
-INTDIR_SRC=.\WinRel\1
+INTDIR_SRC=$(INTDIR)/1
"$(INTDIR_SRC)" :
if not exist "$(INTDIR_SRC)/$(NULL)" mkdir "$(INTDIR_SRC)"
@@ -1422,6 +1404,7 @@ DEP_CPP_CVSRC=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -1458,6 +1441,7 @@ DEP_CPP_REMOV=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -1508,6 +1492,8 @@ DEP_CPP_UPDAT=\
".\lib\regex.h"\
".\lib\getopt.h"\
".\lib\wait.h"\
+ ".\lib\xselect.h"\
+ ".\lib\xtime.h"\
".\src\rcs.h"\
".\src\update.h"\
".\src\server.h"\
@@ -1539,6 +1525,7 @@ DEP_CPP_LOGMS=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -1575,6 +1562,7 @@ DEP_CPP_CLASS=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -1612,6 +1600,7 @@ DEP_CPP_HISTO=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -1650,6 +1639,7 @@ DEP_CPP_ADD_C=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -1686,6 +1676,7 @@ DEP_CPP_LOCK_=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -1725,6 +1716,7 @@ DEP_CPP_RECUR=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -1762,6 +1754,7 @@ DEP_CPP_MODUL=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -1798,6 +1791,7 @@ DEP_CPP_FIND_=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -1836,6 +1830,7 @@ DEP_CPP_RCS_C=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -1872,6 +1867,7 @@ DEP_CPP_CREAT=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -1908,6 +1904,7 @@ DEP_CPP_MAIN_=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -1945,6 +1942,7 @@ DEP_CPP_PATCH=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -1983,6 +1981,7 @@ DEP_CPP_RELEA=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -2019,6 +2018,7 @@ DEP_CPP_RCSCM=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -2035,7 +2035,7 @@ DEP_CPP_RCSCM=\
".\windows-NT\ndir.h"\
NODEP_CPP_RCSCM=\
- ".\src\diffrun.h"\
+ ".\diff\diffrun.h"\
".\src\popen.h"\
".\lib\tcpip.h"\
@@ -2045,7 +2045,7 @@ NODEP_CPP_RCSCM=\
"$(INTDIR)\rcscmds.obj" : $(SOURCE) $(DEP_CPP_RCSCM) "$(INTDIR)"
$(CPP) /nologo /ML /W3 /GX /Ob1 /I "windows-NT" /I "lib" /I "src" /I "zlib"\
- /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "HAVE_CONFIG_H"\
+ /I "diff" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "HAVE_CONFIG_H"\
/Fp"$(INTDIR)/cvsnt.pch" /YX /Fo"$(INTDIR)/" /c $(SOURCE)
@@ -2074,6 +2074,7 @@ DEP_CPP_IMPOR=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -2111,6 +2112,7 @@ DEP_CPP_IGNOR=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -2147,6 +2149,7 @@ DEP_CPP_LOG_C=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -2184,6 +2187,7 @@ DEP_CPP_WRAPP=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -2220,6 +2224,7 @@ DEP_CPP_ERROR=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -2257,6 +2262,7 @@ DEP_CPP_EXPAN=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -2296,6 +2302,7 @@ DEP_CPP_EDIT_=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -2334,6 +2341,7 @@ DEP_CPP_FILEA=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -2373,6 +2381,7 @@ DEP_CPP_WATCH=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -2410,6 +2419,7 @@ DEP_CPP_LOGIN=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -2446,6 +2456,7 @@ DEP_CPP_SCRAM=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -2483,6 +2494,7 @@ DEP_CPP_BUFFE=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -2521,6 +2533,7 @@ DEP_CPP_ZLIB_=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -2566,6 +2579,7 @@ SOURCE=.\lib\sighandle.c
DEP_CPP_SIGHA=\
".\windows-NT\config.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
{$(INCLUDE)}"\sys\Types.h"\
{$(INCLUDE)}"\sys\Stat.h"\
{$(INCLUDE)}"\sys\Timeb.h"\
@@ -2657,6 +2671,7 @@ SOURCE=.\lib\valloc.c
DEP_CPP_VALLO=\
".\windows-NT\config.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
{$(INCLUDE)}"\sys\Types.h"\
{$(INCLUDE)}"\sys\Stat.h"\
{$(INCLUDE)}"\sys\Timeb.h"\
@@ -2679,6 +2694,7 @@ SOURCE=.\lib\xgetwd.c
DEP_CPP_XGETW=\
".\windows-NT\config.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
{$(INCLUDE)}"\sys\Types.h"\
{$(INCLUDE)}"\sys\Stat.h"\
{$(INCLUDE)}"\sys\Timeb.h"\
@@ -2723,6 +2739,7 @@ SOURCE=.\lib\fnmatch.c
DEP_CPP_FNMAT=\
".\windows-NT\config.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\lib\fnmatch.h"\
{$(INCLUDE)}"\sys\Types.h"\
{$(INCLUDE)}"\sys\Stat.h"\
@@ -2745,6 +2762,7 @@ NODEP_CPP_FNMAT=\
SOURCE=.\lib\getdate.c
DEP_CPP_GETDA=\
".\windows-NT\config.h"\
+ ".\lib\xtime.h"\
{$(INCLUDE)}"\sys\Types.h"\
{$(INCLUDE)}"\sys\Timeb.h"\
@@ -2793,6 +2811,7 @@ DEP_CPP_MKDIR=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -2829,6 +2848,7 @@ DEP_CPP_RUN_C=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -2878,6 +2898,7 @@ DEP_CPP_FILES=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -2914,6 +2935,7 @@ DEP_CPP_WIN32=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -2990,6 +3012,7 @@ DEP_CPP_RCMD_=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -3026,6 +3049,7 @@ DEP_CPP_START=\
".\lib\fnmatch.h"\
".\windows-NT\pwd.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
".\src\hash.h"\
".\src\client.h"\
".\src\myndbm.h"\
@@ -3375,28 +3399,28 @@ DEP_CPP_DIFF_=\
{$(INCLUDE)}"\sys\Stat.h"\
".\windows-NT\ndir.h"\
-INTDIR_SRC=.\WinRel\2
-"$(INTDIR_SRC)" :
- if not exist "$(INTDIR_SRC)/$(NULL)" mkdir "$(INTDIR_SRC)"
+INTDIR_DIFF=$(INTDIR)/2
+"$(INTDIR_DIFF)" :
+ if not exist "$(INTDIR_DIFF)/$(NULL)" mkdir "$(INTDIR_DIFF)"
!IF "$(CFG)" == "cvsnt - Win32 Release"
# PROP Intermediate_Dir "WinRel\2"
-".\WinRel\2\diff.obj" : $(SOURCE) $(DEP_CPP_DIFF_) "$(INTDIR_SRC)"
+".\WinRel\2\diff.obj" : $(SOURCE) $(DEP_CPP_DIFF_) "$(INTDIR_DIFF)"
$(CPP) /nologo /ML /W3 /GX /Ob1 /I "windows-NT" /I "lib" /I "src" /I "zlib"\
/D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "HAVE_CONFIG_H" /Fp"WinRel/cvsnt.pch"\
- /YX /Fo"$(INTDIR_SRC)/" /c $(SOURCE)
+ /YX /Fo"$(INTDIR_DIFF)/" /c $(SOURCE)
!ELSEIF "$(CFG)" == "cvsnt - Win32 Debug"
# PROP Intermediate_Dir "WinDebug\2"
-".\WinDebug\2\diff.obj" : $(SOURCE) $(DEP_CPP_DIFF_) "$(INTDIR_SRC)"
+".\WinDebug\2\diff.obj" : $(SOURCE) $(DEP_CPP_DIFF_) "$(INTDIR_DIFF)"
$(CPP) /nologo /MLd /W3 /Gm /GX /Zi /Ob1 /I "windows-NT" /I "lib" /I "src"\
/I "zlib" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "HAVE_CONFIG_H"\
- /Fp"WinDebug/cvsnt.pch" /YX /Fo"$(INTDIR_SRC)/" /Fd"$(INTDIR_SRC)/" /c\
+ /Fp"WinDebug/cvsnt.pch" /YX /Fo"$(INTDIR_DIFF)/" /Fd"$(INTDIR_DIFF)/" /c\
$(SOURCE)
@@ -3570,28 +3594,28 @@ SOURCE=.\diff\version.c
DEP_CPP_VERSI=\
".\windows-NT\config.h"\
-INTDIR_SRC=.\WinRel\2
-"$(INTDIR_SRC)" :
- if not exist "$(INTDIR_SRC)/$(NULL)" mkdir "$(INTDIR_SRC)"
+INTDIR_DIFF=$(INTDIR)/2
+"$(INTDIR_DIFF)" :
+ if not exist "$(INTDIR_DIFF)/$(NULL)" mkdir "$(INTDIR_DIFF)"
!IF "$(CFG)" == "cvsnt - Win32 Release"
# PROP Intermediate_Dir "WinRel\2"
-".\WinRel\2\version.obj" : $(SOURCE) $(DEP_CPP_VERSI) "$(INTDIR_SRC)"
+".\WinRel\2\version.obj" : $(SOURCE) $(DEP_CPP_VERSI) "$(INTDIR_DIFF)"
$(CPP) /nologo /ML /W3 /GX /Ob1 /I "windows-NT" /I "lib" /I "src" /I "zlib"\
/D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "HAVE_CONFIG_H" /Fp"WinRel/cvsnt.pch"\
- /YX /Fo"$(INTDIR_SRC)/" /c $(SOURCE)
+ /YX /Fo"$(INTDIR_DIFF)/" /c $(SOURCE)
!ELSEIF "$(CFG)" == "cvsnt - Win32 Debug"
# PROP Intermediate_Dir "WinDebug\2"
-".\WinDebug\2\version.obj" : $(SOURCE) $(DEP_CPP_VERSI) "$(INTDIR_SRC)"
+".\WinDebug\2\version.obj" : $(SOURCE) $(DEP_CPP_VERSI) "$(INTDIR_DIFF)"
$(CPP) /nologo /MLd /W3 /Gm /GX /Zi /Ob1 /I "windows-NT" /I "lib" /I "src"\
/I "zlib" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "HAVE_CONFIG_H"\
- /Fp"WinDebug/cvsnt.pch" /YX /Fo"$(INTDIR_SRC)/" /Fd"$(INTDIR_SRC)/" /c\
+ /Fp"WinDebug/cvsnt.pch" /YX /Fo"$(INTDIR_DIFF)/" /Fd"$(INTDIR_DIFF)/" /c\
$(SOURCE)
@@ -3605,6 +3629,7 @@ SOURCE=.\lib\fncase.c
DEP_CPP_FNCAS=\
".\windows-NT\config.h"\
".\lib\system.h"\
+ ".\lib\xtime.h"\
{$(INCLUDE)}"\sys\Types.h"\
{$(INCLUDE)}"\sys\Stat.h"\
{$(INCLUDE)}"\sys\Timeb.h"\
diff --git a/gnu/usr.bin/cvs/depcomp b/gnu/usr.bin/cvs/depcomp
new file mode 100644
index 00000000000..86774be1e7c
--- /dev/null
+++ b/gnu/usr.bin/cvs/depcomp
@@ -0,0 +1,358 @@
+#! /bin/sh
+
+# depcomp - compile a program generating dependencies as side-effects
+# Copyright 1999, 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+ echo "depcomp: Variables source, object and depmode must be set" 1>&2
+ exit 1
+fi
+# `libtool' can also be set to `yes' or `no'.
+
+depfile=${depfile-`echo "$object" | sed 's,\([^/]*\)$,.deps/\1,;s/\.\([^.]*\)$/.P\1/'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags. We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write. Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+ # HP compiler uses -M and no extra arg.
+ gccflag=-M
+ depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+ # This is just like dashmstdout with a different argument.
+ dashmflag=-xM
+ depmode=dashmstdout
+fi
+
+case "$depmode" in
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want. Yay!
+ "$@" -MT "$object" -MF "$tmpdepfile" -MD -MP
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ mv "$tmpdepfile" "$depfile"
+ ;;
+
+gcc)
+## There are various ways to get dependency output from gcc. Here's
+## why we pick this rather obscure method:
+## - Don't want to use -MD because we'd like the dependencies to end
+## up in a subdir. Having to rename by hand is ugly.
+## (We might end up doing this anyway to support other compilers.)
+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
+## -MM, not -M (despite what the docs say).
+## - Using -M directly means running the compiler twice (even worse
+## than renaming).
+ if test -z "$gccflag"; then
+ gccflag=-MD,
+ fi
+ "$@" -Wp,"$gccflag$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
+## The second -e expression handles DOS-style file names with drive letters.
+ sed -e 's/^[^:]*: / /' \
+ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+## This next piece of magic avoids the `deleted header file' problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header). We avoid this by adding
+## dummy dependencies for each header file. Too bad gcc doesn't do
+## this for us directly.
+ tr ' ' '
+' < "$tmpdepfile" |
+## Some versions of gcc put a space before the `:'. On the theory
+## that the space means something, we add a space to the output as
+## well.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+hp)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+sgi)
+ if test "$libtool" = yes; then
+ "$@" "-Wp,-MDupdate,$tmpdepfile"
+ else
+ "$@" -MDupdate "$tmpdepfile"
+ fi
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+
+ if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
+ rm -f "$depfile"
+ cp "$tmpdepfile" "$depfile"
+## This next piece of magic avoids the `deleted header file' problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header). We avoid this by adding
+## dummy dependencies for each header file.
+ tr ' ' '
+' < "$tmpdepfile" | \
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' -e '/^#/d' | sed -e 's/$/ :/' >> "$depfile"
+ else
+ # The sourcefile does not contain any dependencies, so just
+ # store a dummy comment line, to avoid errors with the Makefile
+ # "include basename.Plo" scheme.
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+aix)
+ # The C for AIX Compiler uses -M and outputs the dependencies
+ # in a .u file.
+ tmpdepfile=`echo "$object" | sed 's/\(.*\)\..*$/\1.u/'`
+ if test "$libtool" = yes; then
+ "$@" -Wc,-M
+ else
+ "$@" -M
+ fi
+
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+
+ if test -f "$tmpdepfile"; then
+ rm -f "$depfile"
+ cp "$tmpdepfile" "$depfile"
+## This next piece of magic avoids the `deleted header file' problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header). We avoid this by adding
+## dummy dependencies for each header file.
+ tr ' ' '
+' < "$tmpdepfile" | \
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ else
+ # The sourcefile does not contain any dependencies, so just
+ # store a dummy comment line, to avoid errors with the Makefile
+ # "include basename.Plo" scheme.
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+#nosideeffect)
+ # This comment above is used by automake to tell side-effect
+ # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the proprocessed file to stdout, regardless of -o,
+ # because we must use -o when running libtool.
+ test -z "$dashmflag" && dashmflag=-M
+ ( IFS=" "
+ case " $* " in
+ *" --mode=compile "*) # this is libtool, let us make it quiet
+ for arg
+ do # cycle over the arguments
+ case "$arg" in
+ "--mode=compile")
+ # insert --quiet before "--mode=compile"
+ set fnord "$@" --quiet
+ shift # fnord
+ ;;
+ esac
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # "$arg"
+ done
+ ;;
+ esac
+ "$@" $dashmflag | sed 's:^[^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
+ ) &
+ proc=$!
+ "$@"
+ stat=$?
+ wait "$proc"
+ if test "$stat" != 0; then exit $stat; fi
+ rm -f "$depfile"
+ cat < "$tmpdepfile" > "$depfile"
+ tr ' ' '
+' < "$tmpdepfile" | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+dashXmstdout)
+ # This case only exists to satisfy depend.m4. It is never actually
+ # run, as this mode is specially recognized in the preamble.
+ exit 1
+ ;;
+
+makedepend)
+ # X makedepend
+ (
+ shift
+ cleared=no
+ for arg in "$@"; do
+ case $cleared in no)
+ set ""; shift
+ cleared=yes
+ esac
+ case "$arg" in
+ -D*|-I*)
+ set fnord "$@" "$arg"; shift;;
+ -*)
+ ;;
+ *)
+ set fnord "$@" "$arg"; shift;;
+ esac
+ done
+ obj_suffix="`echo $object | sed 's/^.*\././'`"
+ touch "$tmpdepfile"
+ ${MAKEDEPEND-makedepend} 2>/dev/null -o"$obj_suffix" -f"$tmpdepfile" "$@"
+ ) &
+ proc=$!
+ "$@"
+ stat=$?
+ wait "$proc"
+ if test "$stat" != 0; then exit $stat; fi
+ rm -f "$depfile"
+ cat < "$tmpdepfile" > "$depfile"
+ tail +3 "$tmpdepfile" | tr ' ' '
+' | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile" "$tmpdepfile".bak
+ ;;
+
+cpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the proprocessed file to stdout, regardless of -o,
+ # because we must use -o when running libtool.
+ ( IFS=" "
+ case " $* " in
+ *" --mode=compile "*)
+ for arg
+ do # cycle over the arguments
+ case $arg in
+ "--mode=compile")
+ # insert --quiet before "--mode=compile"
+ set fnord "$@" --quiet
+ shift # fnord
+ ;;
+ esac
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # "$arg"
+ done
+ ;;
+ esac
+ "$@" -E |
+ sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
+ sed '$ s: \\$::' > "$tmpdepfile"
+ ) &
+ proc=$!
+ "$@"
+ stat=$?
+ wait "$proc"
+ if test "$stat" != 0; then exit $stat; fi
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ cat < "$tmpdepfile" >> "$depfile"
+ sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+msvisualcpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the proprocessed file to stdout, regardless of -o,
+ # because we must use -o when running libtool.
+ ( IFS=" "
+ case " $* " in
+ *" --mode=compile "*)
+ for arg
+ do # cycle over the arguments
+ case $arg in
+ "--mode=compile")
+ # insert --quiet before "--mode=compile"
+ set fnord "$@" --quiet
+ shift # fnord
+ ;;
+ esac
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # "$arg"
+ done
+ ;;
+ esac
+ "$@" -E |
+ sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
+ ) &
+ proc=$!
+ "$@"
+ stat=$?
+ wait "$proc"
+ if test "$stat" != 0; then exit $stat; fi
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
+ echo " " >> "$depfile"
+ . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+none)
+ exec "$@"
+ ;;
+
+*)
+ echo "Unknown depmode $depmode" 1>&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/gnu/usr.bin/cvs/diff/ChangeLog b/gnu/usr.bin/cvs/diff/ChangeLog
index e3272e84c2d..565bdb78178 100644
--- a/gnu/usr.bin/cvs/diff/ChangeLog
+++ b/gnu/usr.bin/cvs/diff/ChangeLog
@@ -1,3 +1,70 @@
+2001-04-25 Derek Price <dprice@collab.net>
+
+ * Makefile.in: Regenerated using AM 1.4e as of today at 18:10 -0400.
+
+2001-03-24 Noel Cragg <noel@shave.red-bean.com>
+
+ * diff.c: fix typo in usage string.
+
+2001-03-20 Derek Price <derek.price@openavenue.com>
+ for Karl Tomlinson <k.tomlinson@auckland.ac.nz>
+
+ * diff3.c (main): changed the common file of the two diffs to
+ OLDFILE for merges and edscripts so that the diffs are more likely
+ to contain the intended changes. Not changing the horizon-lines
+ arg for the second diff. If the two diffs have the same parameters
+ equal changes in each diff are more likely to appear the same.
+
+ * analyze.c (shift_boundaries): undid Paul Eggert's patch to fix
+ the diff3 merge bug described in ccvs/doc/DIFFUTILS-2.7-BUG. The
+ patch is no longer necessary now that diff3 does its differences
+ differently. I think the hunk merges provide a better indication
+ of the area modified by the user now that the diffs are actually
+ done between the appropriate revisions.
+
+2001-03-15 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.am (INCLUDES): Add -I$(top_srcdir)/lib for platforms which
+ need the regex library there.
+
+ * Makefile.in: Regenerated.
+
+2001-03-14 Derek Price <derek.price@openavenue.com>
+
+ * .cvsignore: Added '.deps'.
+
+ Pavel Roskin <proski@gnu.org>
+
+ * Makefile.am: New file.
+ * Makefile.in: Regenerated.
+
+2001-02-22 Derek Price <derek.price@openavenue.com>
+ Pavel Roskin <proski@gnu.org>
+
+ * Makefile.in: Don't define PR_PROGRAM - it's defined by configure.
+ Remove separate rule for util.c.
+
+2001-02-06 Derek Price <derek.price@openavenue.com>
+ Rex Jolliff <Rex_Jolliff@notes.ymp.gov>
+ Shawn Smith <Shawn_Smith@notes.ymp.gov>
+
+ * dir.c: Replace opendir, closedir, & readdir calls with CVS_OPENDIR,
+ CVS_CLOSEDIR, & CVS_READDIR in support of changes to handle VMS DEC C
+ 5.7 {open,read,close}dir problems. Check today's entry in the vms
+ subdir for more.
+ * system.h: definitions of CVS_*DIR provided here.
+
+2000-12-21 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.in: Some changes to support Automake targets
+
+2000-10-26 Larry Jones <larry.jones@sdrc.com>
+
+ * Makefile.in: Get PR_PROGRAM from autoconf instead of hard coding.
+ (Patch submitted by Urs Thuermann <urs@isnogud.escape.de>.)
+ Also add a dependency for util.o on Makefile since PR_PROGRAM gets
+ compiled in.
+
2000-08-03 Larry Jones <larry.jones@sdrc.com>
* diff3.c (read_diff): Use cvs_temp_name () instead of tmpnam () so
diff --git a/gnu/usr.bin/cvs/diff/Makefile.am b/gnu/usr.bin/cvs/diff/Makefile.am
new file mode 100644
index 00000000000..38ed80ed88b
--- /dev/null
+++ b/gnu/usr.bin/cvs/diff/Makefile.am
@@ -0,0 +1,24 @@
+## Makefile.am for GNU DIFF
+## Copyright (C) 2001 Free Software Foundation, Inc.
+##
+## This file is part of GNU DIFF.
+##
+## GNU DIFF is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2, or (at your option)
+## any later version.
+##
+## GNU DIFF is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+
+INCLUDES = -I$(top_srcdir)/lib
+
+noinst_LIBRARIES = libdiff.a
+
+libdiff_a_SOURCES = diff.c diff3.c analyze.c cmpbuf.c cmpbuf.h io.c \
+ context.c ed.c normal.c ifdef.c util.c dir.c version.c diff.h \
+ side.c system.h diffrun.h
+
+EXTRA_DIST = ChangeLog build_diff.com diagmeet.note libdiff.dsp
diff --git a/gnu/usr.bin/cvs/diff/analyze.c b/gnu/usr.bin/cvs/diff/analyze.c
index f2925946e38..3262444e6b1 100644
--- a/gnu/usr.bin/cvs/diff/analyze.c
+++ b/gnu/usr.bin/cvs/diff/analyze.c
@@ -621,7 +621,9 @@ shift_boundaries (filevec)
struct file_data filevec[];
{
int f;
- int inhibit_hunk_merge = horizon_lines != context;
+
+ if (inhibit)
+ return;
for (f = 0; f < 2; f++)
{
@@ -664,21 +666,18 @@ shift_boundaries (filevec)
we can later determine whether the run has grown. */
runlength = i - start;
- if (! inhibit_hunk_merge)
- {
- /* Move the changed region back, so long as the
- previous unchanged line matches the last changed one.
- This merges with previous changed regions. */
+ /* Move the changed region back, so long as the
+ previous unchanged line matches the last changed one.
+ This merges with previous changed regions. */
- while (start && equivs[start - 1] == equivs[i - 1])
- {
- changed[--start] = 1;
- changed[--i] = 0;
- while (changed[start - 1])
- start--;
- while (other_changed[--j])
- continue;
- }
+ while (start && equivs[start - 1] == equivs[i - 1])
+ {
+ changed[--start] = 1;
+ changed[--i] = 0;
+ while (changed[start - 1])
+ start--;
+ while (other_changed[--j])
+ continue;
}
/* Set CORRESPONDING to the end of the changed run, at the last
@@ -686,15 +685,13 @@ shift_boundaries (filevec)
CORRESPONDING == I_END means no such point has been found. */
corresponding = other_changed[j - 1] ? i : i_end;
- /* Shift the changed region forward, so long as the
- first changed line matches the following unchanged one,
- but if INHIBIT_HUNK_MERGE is 1 do not shift if
- this would merge with another changed region.
+ /* Move the changed region forward, so long as the
+ first changed line matches the following unchanged one.
+ This merges with following changed regions.
Do this second, so that if there are no merges,
the changed region is moved forward as far as possible. */
- while (i != i_end && equivs[start] == equivs[i]
- && ! (inhibit_hunk_merge & other_changed[j + 1]))
+ while (i != i_end && equivs[start] == equivs[i])
{
changed[start++] = 0;
changed[i++] = 1;
diff --git a/gnu/usr.bin/cvs/diff/diff.c b/gnu/usr.bin/cvs/diff/diff.c
index aa91913fe61..ebd78aebfd1 100644
--- a/gnu/usr.bin/cvs/diff/diff.c
+++ b/gnu/usr.bin/cvs/diff/diff.c
@@ -775,7 +775,7 @@ static char const * const option_help[] = {
"-e --ed Output an ed script.",
"-n --rcs Output an RCS format diff.",
"-y --side-by-side Output in two columns.",
-" -w NUM --width=NUM Output at most NUM (default 130) characters per line.",
+" -W NUM --width=NUM Output at most NUM (default 130) characters per line.",
" --left-column Output only the left column of common lines.",
" --suppress-common-lines Do not output common lines.",
"-DNAME --ifdef=NAME Output merged file to show `#ifdef NAME' diffs.",
diff --git a/gnu/usr.bin/cvs/diff/diff3.c b/gnu/usr.bin/cvs/diff/diff3.c
index 2f05d165fc9..4a6fba618c2 100644
--- a/gnu/usr.bin/cvs/diff/diff3.c
+++ b/gnu/usr.bin/cvs/diff/diff3.c
@@ -171,7 +171,7 @@ static int edscript;
static int flagging;
/* Number of lines to keep in identical prefix and suffix. */
-static int horizon_lines = 10;
+static int const horizon_lines = 10;
/* Use a tab to align output lines (-T). */
static int tab_align_flag;
@@ -370,28 +370,44 @@ diff3_run (argc, argv, out, callbacks_arg)
file0-file1 diffs didn't line up with the file0-file2 diffs
(which is entirely possible since we don't use diff's -n option),
diff3 might report phantom changes from file1 to file2. */
+ /* Also try to compare file0 to file1 because this is the where
+ changes are expected to come from. Diffing between these pairs
+ of files is is most likely to return the intended changes. There
+ can also be the same problem with phantom changes from file0 to
+ file1. */
+ /* Historically, the default common file was file2. Ediff for emacs
+ and possibly other applications, have therefore made file2 the
+ ancestor. So, for compatibility, if this is simply a three
+ way diff (not a merge or edscript) then use the old way with
+ file2 as the common file. */
+
+ {
+ int common;
+ if (edscript || merge )
+ {
+ common = 1;
+ }
+ else
+ {
+ common = 2;
+ }
+ if (strcmp (file[common], "-") == 0)
+ {
+ /* Sigh. We've got standard input as the arg corresponding to
+ the desired common file. We can't call diff twice on
+ stdin. Use another arg as the common file instead. */
+ common = 3 - common;
+ if (strcmp (file[0], "-") == 0 || strcmp (file[common], "-") == 0)
+ {
+ diff_error ("%s", "`-' specified for more than one input file", 0);
+ return 2;
+ }
+ }
- if (strcmp (file[2], "-") == 0)
- {
- /* Sigh. We've got standard input as the last arg. We can't
- call diff twice on stdin. Use the middle arg as the common
- file instead. */
- if (strcmp (file[0], "-") == 0 || strcmp (file[1], "-") == 0)
- {
- diff_error ("%s", "`-' specified for more than one input file", 0);
- return 2;
- }
- mapping[0] = 0;
- mapping[1] = 2;
- mapping[2] = 1;
- }
- else
- {
- /* Normal, what you'd expect */
- mapping[0] = 0;
- mapping[1] = 1;
- mapping[2] = 2;
- }
+ mapping[0] = 0;
+ mapping[1] = 3 - common;
+ mapping[2] = common;
+ }
for (i = 0; i < 3; i++)
rev_mapping[mapping[i]] = i;
@@ -444,12 +460,18 @@ diff3_run (argc, argv, out, callbacks_arg)
commonname = file[rev_mapping[FILEC]];
thread1 = process_diff (file[rev_mapping[FILE1]], commonname, &last_block,
&content1);
+ /* What is the intention behind determining horizon_lines from first
+ diff? I think it is better to use the same parameters for each
+ diff so that equal differences in each diff will appear the
+ same. */
+ /*
if (thread1)
for (i = 0; i < 2; i++)
{
horizon_lines = max (horizon_lines, D_NUMLINES (thread1, i));
horizon_lines = max (horizon_lines, D_NUMLINES (last_block, i));
}
+ */
thread0 = process_diff (file[rev_mapping[FILE0]], commonname, &last_block,
&content0);
diff3 = make_3way_diff (thread0, thread1);
@@ -1855,7 +1877,6 @@ initialize_main (argcp, argvp)
always_text = 0;
edscript = 0;
flagging = 0;
- horizon_lines = 10;
tab_align_flag = 0;
simple_only = 0;
overlap_only = 0;
diff --git a/gnu/usr.bin/cvs/diff/dir.c b/gnu/usr.bin/cvs/diff/dir.c
index fae74e82c65..da497dc4a6b 100644
--- a/gnu/usr.bin/cvs/diff/dir.c
+++ b/gnu/usr.bin/cvs/diff/dir.c
@@ -61,7 +61,7 @@ dir_sort (dir, dirdata)
if (dir->desc != -1)
{
/* Open the directory and check for errors. */
- register DIR *reading = opendir (dir->name);
+ register DIR *reading = CVS_OPENDIR (dir->name);
if (!reading)
return -1;
@@ -74,7 +74,7 @@ dir_sort (dir, dirdata)
/* Read the directory entries, and insert the subfiles
into the `data' table. */
- while ((errno = 0, (next = readdir (reading)) != 0))
+ while ((errno = 0, (next = CVS_READDIR (reading)) != 0))
{
char *d_name = next->d_name;
size_t d_size = NAMLEN (next) + 1;
@@ -96,14 +96,14 @@ dir_sort (dir, dirdata)
if (errno)
{
int e = errno;
- closedir (reading);
+ CVS_CLOSEDIR (reading);
errno = e;
return -1;
}
#if CLOSEDIR_VOID
- closedir (reading);
+ CVS_CLOSEDIR (reading);
#else
- if (closedir (reading) != 0)
+ if (CVS_CLOSEDIR (reading) != 0)
return -1;
#endif
}
diff --git a/gnu/usr.bin/cvs/diff/system.h b/gnu/usr.bin/cvs/diff/system.h
index 76bc1631fee..f5037ecf70a 100644
--- a/gnu/usr.bin/cvs/diff/system.h
+++ b/gnu/usr.bin/cvs/diff/system.h
@@ -269,3 +269,16 @@ extern int errno;
*(q)++ = '\''; \
}
#endif
+
+/* these come from CVS's lib/system.h, but I wasn't sure how to include that
+ * properly or even if I really should
+ */
+#ifndef CVS_OPENDIR
+#define CVS_OPENDIR opendir
+#endif
+#ifndef CVS_READDIR
+#define CVS_READDIR readdir
+#endif
+#ifndef CVS_CLOSEDIR
+#define CVS_CLOSEDIR closedir
+#endif
diff --git a/gnu/usr.bin/cvs/doc/.cvsignore b/gnu/usr.bin/cvs/doc/.cvsignore
index ecbac0e8a4f..1dea1d71854 100644
--- a/gnu/usr.bin/cvs/doc/.cvsignore
+++ b/gnu/usr.bin/cvs/doc/.cvsignore
@@ -1,6 +1,6 @@
*.dvi
Makefile
-CVSvn.texi
+cvs-paper.pdf
cvs-paper.ps
cvs.aux
cvs.cp
@@ -12,6 +12,7 @@ cvs.info
cvs.info-*
cvs.ky
cvs.log
+cvs.pdf
cvs.pg
cvs.ps
cvs.toc
@@ -27,6 +28,7 @@ cvsclient.info
cvsclient.info-*
cvsclient.ky
cvsclient.log
+cvsclient.pdf
cvsclient.pg
cvsclient.ps
cvsclient.toc
diff --git a/gnu/usr.bin/cvs/doc/CVSvn.texi b/gnu/usr.bin/cvs/doc/CVSvn.texi
index 4081fe83077..4d037ce34b7 100644
--- a/gnu/usr.bin/cvs/doc/CVSvn.texi
+++ b/gnu/usr.bin/cvs/doc/CVSvn.texi
@@ -1 +1 @@
-@set CVSVN 1.11
+@set CVSVN 1.11.1p1
diff --git a/gnu/usr.bin/cvs/doc/CVSvn.texi.in b/gnu/usr.bin/cvs/doc/CVSvn.texi.in
new file mode 100644
index 00000000000..9cc02ea5898
--- /dev/null
+++ b/gnu/usr.bin/cvs/doc/CVSvn.texi.in
@@ -0,0 +1 @@
+@set CVSVN @VERSION@
diff --git a/gnu/usr.bin/cvs/doc/ChangeLog b/gnu/usr.bin/cvs/doc/ChangeLog
index 6a9206d5853..eca8f91f86e 100644
--- a/gnu/usr.bin/cvs/doc/ChangeLog
+++ b/gnu/usr.bin/cvs/doc/ChangeLog
@@ -1,3 +1,148 @@
+2001-04-25 Derek Price <dprice@collab.net>
+
+ * Makefile.in: Regenerated using AM 1.4e as of today at 18:10 -0400.
+ * CVSvn.texi: Regenerated.
+
+2001-03-30 Larry Jones <larry.jones@sdrc.com>
+
+ * cvsclient.texi (Dates, Requests): Add rannotate and rlog.
+
+2001-03-26 Larry Jones <larry.jones@sdrc.com>
+
+ * cvs.texinfo (admin options): Fix typo: should be @pxref, not @xref.
+
+2001-03-26 Larry Jones <larry.jones@sdrc.com>
+
+ * cvs.texinfo (admin options): Update description of -u option to
+ refer back to notify.
+
+2001-03-23 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.am (ps): Make 'ps' an alias for 'doc'.
+ (doc, pdf, ps, txt): declare as '.PHONY'.
+
+ * Makefile.in: Regenerated.
+
+2001-03-23 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.am (MOSTLYCLEANFILES): Add cvs.cps & cvs.fns as a temporary
+ workaround for an Automake deficiency.
+
+ * Makefile.in: Regenerated.
+
+2001-03-14 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.in: Regenerated
+
+2001-02-20 Larry Jones <larry.jones@sdrc.com>
+
+ * cvs.texinfo (BUGS): There's only one company listed now, not two.
+
+2001-02-13 Larry Jones <larry.jones@sdrc.com>
+
+ * cvs.texinfo (Password authentication server, First import): Use
+ @ref instead of @xref when not at the beginning of a sentence.
+
+2001-02-01 Larry Jones <larry.jones@sdrc.com>
+
+ * cvs.texinfo (Connection): Add still more notes about common
+ pserver error messages.
+
+2001-01-18 Derek Price <derek.price@openavenue.com>
+
+ * cvs.texinfo (Quick reference to CVS commands): add index entry for
+ version subcommand
+
+2001-01-18 Larry Jones <larry.jones@sdrc.com>
+
+ * cvs.texinfo (log options): Document new :: syntax for -r.
+
+2001-01-10 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.am (CVSvn.texi): specify $(srcdir) explicitly in target rule
+ so CVSvn.texi gets built properly for all makes.
+ (cvs_TEXINFOS): specify $(srcdir) explicitly for CVSvn.texi
+ (cvsclient_TEXINFOS): ditto
+ * Makefile.in: regenerated
+
+2000-12-26 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.in: update timestamp
+ * CVSvn.texi: ditto
+
+2000-12-26 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.am: new target for creation of CVSvn.texi
+ (EXTRA_DIST): add CVSvn.texi.in & CVSvn.texi
+ * Makefile.in: Regenerated
+ * CVSvn.texi: new file
+ * .cvsignore: remove CVSvn.texi since it is now included in dist
+
+2000-12-22 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.in: Regenerated
+
+2000-12-21 Derek Price <derek.price@openavenue.com>
+
+ * cvs-paper.ps: Backout accidental regeneration.
+
+2000-12-21 Derek Price <derek.price@openavenue.com>
+
+ * .cvsignore: Added *.pdf versions of the *.ps docs
+ * CVSvn.texi.in: Use configure to generate CVSvn.texi
+ * Makefile.am: New file needed by Automake
+ * Makefile.in: Regenerated
+ * cvs-paper.ps: Regenerated
+ * texinfo.tex: New file added to placate Automake. Apparently, its
+ inclusion is mandated by the GNU coding standards.
+
+2000-12-14 Derek Price <derek.price@openavenue.com>
+ Linus Tolke <linus@epact.se>
+
+ * cvs.texinfo (Merging a branch): changed some references to "BRANCH"
+ to "BRANCHNAME" for consistancy. Add a warning about merging using a
+ single tagname reference with an xref to "Merging adds and removals"
+ for the long explanation
+ (Merging adds and removals): Add the long explanation of why merging
+ from a single tagname can be tricky
+ (update): Add a warning about merging using a single tagname reference
+ with an xref to "Merging adds and removals" for the long explanation
+
+2000-11-13 Derek Price <derek.price@openavenue.com>
+
+ * cvs.texinfo: use '@sc{cvs}' instead of 'CVS' in various locations
+
+2000-11-08 Derek Price <derek.price@openavenue.com>
+
+ * cvs.texinfo (settitle): stick a 'v' in front of the version number
+ to make it harder to confuse with chapter, section, and page numbers.
+
+2000-11-08 Derek Price <derek.price@openavenue.com>
+
+ * cvs.texinfo (settitle): add the version number to the title string
+ so that it is easier to find on HTML pages and the like.
+
+2000-10-20 Jim Kingdon <http://sourceforge.net/users/kingdon/>
+
+ * cvs.texinfo (Variables): Document CVS_USER.
+
+2000-10-17 Derek Price <derek.price@openavenue.com>
+
+ * cvs.texinfo (Remote repositories): added a comment about specifying
+ a password in the repository name when performaing a checkout.
+
+2000-10-17 Derek Price <derek.price@openavenue.com>
+
+ * cvs.texinfo (Remote repositories, password authenticated, GSSAPI
+ authenticated, Kerberos authenticated, Environment variables):
+ Documented CVSROOT spec change & CVS_CLIENT_PORT.
+
+2000-10-10 Larry Jones <larry.jones@sdrc.com>
+
+ * cvs.texinfo (Connection): Add additional notes about common
+ pserver error messages. Remove information about unsetting $HOME
+ since CVS no longer pays any attention to it in server mode.
+
2000-09-07 Larry Jones <larry.jones@sdrc.com>
* Makefile.in: Use @bindir@, @libdir@, @infodir@, and @mandir@
diff --git a/gnu/usr.bin/cvs/doc/Makefile.am b/gnu/usr.bin/cvs/doc/Makefile.am
new file mode 100644
index 00000000000..7821058baa0
--- /dev/null
+++ b/gnu/usr.bin/cvs/doc/Makefile.am
@@ -0,0 +1,157 @@
+## Process this file with automake to produce Makefile.in
+# Makefile for GNU CVS documentation (excluding man pages - see ../man).
+# Copyright (C) 1986, 1988-1990, 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+#DISTFILES = \
+# .cvsignore \
+# RCSFILES \
+
+# AUTOMAKE_OPTIONS = no-texinfo.tex
+
+# FIXME - these rebuild every 'make dist' with some BSD makes due to a bug
+# that prevents make from searching VPATH for targets. There is some
+# machinery in place in configure.in to work around this for some targets
+# (see the CVSvn.texi target below) now, but fixing the two info_TEXINFOS
+# targets below is probably going to require work on Automake
+info_TEXINFOS = cvs.texinfo cvsclient.texi
+cvs_TEXINFOS = CVSvn.texi
+cvsclient_TEXINFOS = CVSvn.texi
+
+POSTSCRIPTS = \
+ cvs.ps \
+ cvs-paper.ps \
+ cvsclient.ps
+
+PDFS = \
+ cvs-paper.pdf \
+ cvs.pdf \
+ cvsclient.pdf
+
+TXTS = \
+ cvs.txt \
+ cvsclient.txt
+
+EXTRA_DIST = \
+ $(POSTSCRIPTS) \
+ .cvsignore \
+ CVSvn.texi.in \
+ ChangeLog.fsf \
+ RCSFILES \
+ cvs-paper.ms \
+ cvs.aux \
+ cvsclient.aux
+
+# Listing cvs.cps & cvs.fns here is a workaround for an Automake deficiency
+MOSTLYCLEANFILES = \
+ cvs.cps \
+ cvs.fns
+
+CLEANFILES = \
+ $(PDFS) \
+ $(TXTS)
+
+MAINTAINERCLEANFILES = \
+ cvs-paper.ps
+
+doc ps: $(POSTSCRIPTS)
+.PHONY: doc ps
+
+pdf: $(PDFS)
+.PHONY: pdf
+
+txt: $(TXTS)
+.PHONY: txt
+
+dvi: cvs.dvi cvsclient.dvi
+.PHONY: dvi
+
+cvs.aux cvs.pdf cvs.txt: cvs.texinfo $(cvs_TEXINFOS)
+cvsclient.aux cvsclient.pdf cvsclient.txt: cvsclient.texi $(cvsclient_TEXINFOS)
+
+# These targets need to be very specific so that the other PDFs get generated correctly.
+# If they are more generic and cvs.ps is made before cvs.pdf, then cvs.pdf will be
+# generated from the generic target and the PS source, which contains less information
+# than the usual texinfo source.
+cvs-paper.pdf: cvs-paper.ps
+ $(ROFF) -t -p -ms -Tps $< > $@-t
+ mv $@-t $@
+
+cvs-paper.ps: cvs-paper.ms
+ $(PS2PDF) $< $@
+
+SUFFIXES = .aux .txt .pdf
+
+# texinfo based targets automake neglects to include
+.texinfo.pdf:
+ TEXINPUTS=$(srcdir):$$TEXINPUTS \
+ MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) --pdf $<
+.txi.pdf:
+ TEXINPUTS=$(srcdir):$$TEXINPUTS \
+ MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) --pdf $<
+.texi.pdf:
+ TEXINPUTS=$(srcdir):$$TEXINPUTS \
+ MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) --pdf $<
+
+.texinfo.aux:
+ TEXINPUTS=$(srcdir):$$TEXINPUTS \
+ MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
+.txi.aux:
+ TEXINPUTS=$(srcdir):$$TEXINPUTS \
+ MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
+.texi.aux:
+ TEXINPUTS=$(srcdir):$$TEXINPUTS \
+ MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
+
+.texinfo.txt:
+ TEXINPUTS=$(srcdir):$$TEXINPUTS \
+ MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(MAKEINFO) $< --no-headers -o $@
+.txi.txt:
+ TEXINPUTS=$(srcdir):$$TEXINPUTS \
+ MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(MAKEINFO) $< --no-headers -o $@
+.texi.txt:
+ TEXINPUTS=$(srcdir):$$TEXINPUTS \
+ MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(MAKEINFO) $< --no-headers -o $@
+
+## MAINTAINER Targets
+
+## CVSvn.texi ##
+# - CVSvn.texi needs to be updated only once, since it depends on
+# configure.in, not on the results of a 'configure' run.
+# - It is guaranteed (with GNU Make) that when the version in configure.in
+# is changed, acversion.m4 is built only after the new version number is
+# propagated to the Makefile. (Libtool uses the same guarantee.)
+# - Of the next three targets, only the next one or the following two should be
+# enabled, not all three
+if MAKE_TARGETS_IN_VPATH
+# - This is the target for systems without the BSD VPATH bug in make or with
+# $(srcdir) = $(builddir)
+CVSvn.texi: $(srcdir)/CVSvn.texi.in $(top_srcdir)/configure.in
+ sed 's,@VERSION\@,$(VERSION),g' $(srcdir)/CVSvn.texi.in >$(srcdir)/CVSvn.ttexi
+ mv $(srcdir)/CVSvn.ttexi $(srcdir)/CVSvn.texi
+else
+# - The next two targets are a workaround for the fact that some BSD makes
+# don't look through VPATH for targets, but only for sources.
+# - They should be disabled on systems without the bug and in environments
+# where $(srcdir) = $(builddir)
+CVSvn.texi: $(srcdir)/CVSvn.texi
+ # use cat so the time stamp gets set properly
+ cat $(srcdir)/CVSvn.texi >$@
+$(srcdir)/CVSvn.texi: $(srcdir)/CVSvn.texi.in $(top_srcdir)/configure.in
+ sed 's,@VERSION\@,$(VERSION),g' $(srcdir)/CVSvn.texi.in >$(srcdir)/CVSvn.ttexi
+ mv $(srcdir)/CVSvn.ttexi $(srcdir)/CVSvn.texi
+endif
+
+## realclean ##
+# for backwards compatibility with the old makefiles
+realclean: maintainer-clean
+.PHONY: realclean
diff --git a/gnu/usr.bin/cvs/doc/cvsclient.texi b/gnu/usr.bin/cvs/doc/cvsclient.texi
index 5ba7ed6b4eb..b81a7736c56 100644
--- a/gnu/usr.bin/cvs/doc/cvsclient.texi
+++ b/gnu/usr.bin/cvs/doc/cvsclient.texi
@@ -484,7 +484,8 @@ in use, or sticks to a common subset.
The protocol contains times and dates in various places.
For the @samp{-D} option to the @code{annotate}, @code{co}, @code{diff},
-@code{export}, @code{history}, @code{rdiff}, @code{rtag}, @code{tag},
+@code{export}, @code{history}, @code{rannotate}, @code{rdiff},
+@code{rtag}, @code{tag},
and @code{update} requests, the server should support two formats:
@example
@@ -495,7 +496,8 @@ and @code{update} requests, the server should support two formats:
The former format is preferred; the latter however is sent by the CVS
command line client (versions 1.5 through at least 1.9).
-For the @samp{-d} option to the @code{log} request, servers should at
+For the @samp{-d} option to the @code{log} and @code{rlog} requests,
+servers should at
least support RFC 822/1123 format. Clients are encouraged to use this
format too (the command line CVS client, version 1.10 and older, just passed
along the date format specified by the user, however).
@@ -1160,12 +1162,14 @@ and send it in a future @code{Entry} request. Note that the entries
line in the @code{Created} response must indicate whether the file is
binary or text, so the client can create it correctly.
-@item rdiff \n
+@item rannotate \n
+@itemx rdiff \n
+@itemx rlog \n
@itemx rtag \n
Response expected: yes. Actually do a cvs command. This uses any
previous @code{Argument} requests, if they have been sent. The client
should not send @code{Directory}, @code{Entry}, or @code{Modified}
-requests for this command; they are not used. Arguments to these
+requests for these commands; they are not used. Arguments to these
commands are module names, as described for @code{co}.
@item init @var{root-name} \n
diff --git a/gnu/usr.bin/cvs/doc/texinfo.tex b/gnu/usr.bin/cvs/doc/texinfo.tex
new file mode 100644
index 00000000000..1889b4c6d1a
--- /dev/null
+++ b/gnu/usr.bin/cvs/doc/texinfo.tex
@@ -0,0 +1,6200 @@
+% texinfo.tex -- TeX macros to handle Texinfo files.
+%
+% Load plain if necessary, i.e., if running under initex.
+\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
+%
+\def\texinfoversion{2000-12-11.07}
+%
+% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
+% Free Software Foundation, Inc.
+%
+% This texinfo.tex file is free software; you can redistribute it and/or
+% modify it under the terms of the GNU General Public License as
+% published by the Free Software Foundation; either version 2, or (at
+% your option) any later version.
+%
+% This texinfo.tex file is distributed in the hope that it will be
+% useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+% of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+% General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with this texinfo.tex file; see the file COPYING. If not, write
+% to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+% Boston, MA 02111-1307, USA.
+%
+% In other words, you are welcome to use, share and improve this program.
+% You are forbidden to forbid anyone else to use, share and improve
+% what you give them. Help stamp out software-hoarding!
+%
+% Please try the latest version of texinfo.tex before submitting bug
+% reports; you can get the latest version from:
+% ftp://ftp.gnu.org/gnu/texinfo.tex
+% (and all GNU mirrors, see http://www.gnu.org/order/ftp.html)
+% ftp://texinfo.org/tex/texinfo.tex
+% ftp://us.ctan.org/macros/texinfo/texinfo.tex
+% (and all CTAN mirrors, finger ctan@us.ctan.org for a list).
+% /home/gd/gnu/doc/texinfo.tex on the GNU machines.
+% The texinfo.tex in any given Texinfo distribution could well be out
+% of date, so if that's what you're using, please check.
+% Texinfo has a small home page at http://texinfo.org/.
+%
+% Send bug reports to bug-texinfo@gnu.org. Please include including a
+% complete document in each bug report with which we can reproduce the
+% problem. Patches are, of course, greatly appreciated.
+%
+% To process a Texinfo manual with TeX, it's most reliable to use the
+% texi2dvi shell script that comes with the distribution. For a simple
+% manual foo.texi, however, you can get away with this:
+% tex foo.texi
+% texindex foo.??
+% tex foo.texi
+% tex foo.texi
+% dvips foo.dvi -o # or whatever, to process the dvi file; this makes foo.ps.
+% The extra runs of TeX get the cross-reference information correct.
+% Sometimes one run after texindex suffices, and sometimes you need more
+% than two; texi2dvi does it as many times as necessary.
+%
+% It is possible to adapt texinfo.tex for other languages. You can get
+% the existing language-specific files from ftp://ftp.gnu.org/gnu/texinfo/.
+
+\message{Loading texinfo [version \texinfoversion]:}
+
+% If in a .fmt file, print the version number
+% and turn on active characters that we couldn't do earlier because
+% they might have appeared in the input file name.
+\everyjob{\message{[Texinfo version \texinfoversion]}%
+ \catcode`+=\active \catcode`\_=\active}
+
+% Save some parts of plain tex whose names we will redefine.
+\let\ptexb=\b
+\let\ptexbullet=\bullet
+\let\ptexc=\c
+\let\ptexcomma=\,
+\let\ptexdot=\.
+\let\ptexdots=\dots
+\let\ptexend=\end
+\let\ptexequiv=\equiv
+\let\ptexexclam=\!
+\let\ptexi=\i
+\let\ptexlbrace=\{
+\let\ptexrbrace=\}
+\let\ptexstar=\*
+\let\ptext=\t
+
+% We never want plain's outer \+ definition in Texinfo.
+% For @tex, we can use \tabalign.
+\let\+ = \relax
+
+\message{Basics,}
+\chardef\other=12
+
+% If this character appears in an error message or help string, it
+% starts a new line in the output.
+\newlinechar = `^^J
+
+% Set up fixed words for English if not already set.
+\ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi
+\ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi
+\ifx\putwordfile\undefined \gdef\putwordfile{file}\fi
+\ifx\putwordin\undefined \gdef\putwordin{in}\fi
+\ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
+\ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi
+\ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi
+\ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi
+\ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi
+\ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi
+\ifx\putwordof\undefined \gdef\putwordof{of}\fi
+\ifx\putwordon\undefined \gdef\putwordon{on}\fi
+\ifx\putwordpage\undefined \gdef\putwordpage{page}\fi
+\ifx\putwordsection\undefined \gdef\putwordsection{section}\fi
+\ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi
+\ifx\putwordsee\undefined \gdef\putwordsee{see}\fi
+\ifx\putwordSee\undefined \gdef\putwordSee{See}\fi
+\ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi
+\ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi
+%
+\ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi
+\ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi
+\ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi
+\ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi
+\ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi
+\ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi
+\ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi
+\ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi
+\ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi
+\ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi
+\ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi
+\ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi
+%
+\ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi
+\ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi
+\ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi
+\ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi
+\ifx\putwordDeftypevar\undefined\gdef\putwordDeftypevar{Variable}\fi
+\ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi
+\ifx\putwordDeftypefun\undefined\gdef\putwordDeftypefun{Function}\fi
+
+% Ignore a token.
+%
+\def\gobble#1{}
+
+\hyphenation{ap-pen-dix}
+\hyphenation{mini-buf-fer mini-buf-fers}
+\hyphenation{eshell}
+\hyphenation{white-space}
+
+% Margin to add to right of even pages, to left of odd pages.
+\newdimen \bindingoffset
+\newdimen \normaloffset
+\newdimen\pagewidth \newdimen\pageheight
+
+% Sometimes it is convenient to have everything in the transcript file
+% and nothing on the terminal. We don't just call \tracingall here,
+% since that produces some useless output on the terminal.
+%
+\def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
+\ifx\eTeXversion\undefined
+\def\loggingall{\tracingcommands2 \tracingstats2
+ \tracingpages1 \tracingoutput1 \tracinglostchars1
+ \tracingmacros2 \tracingparagraphs1 \tracingrestores1
+ \showboxbreadth\maxdimen\showboxdepth\maxdimen
+}%
+\else
+\def\loggingall{\tracingcommands3 \tracingstats2
+ \tracingpages1 \tracingoutput1 \tracinglostchars1
+ \tracingmacros2 \tracingparagraphs1 \tracingrestores1
+ \tracingscantokens1 \tracingassigns1 \tracingifs1
+ \tracinggroups1 \tracingnesting2
+ \showboxbreadth\maxdimen\showboxdepth\maxdimen
+}%
+\fi
+
+% For @cropmarks command.
+% Do @cropmarks to get crop marks.
+%
+\newif\ifcropmarks
+\let\cropmarks = \cropmarkstrue
+%
+% Dimensions to add cropmarks at corners.
+% Added by P. A. MacKay, 12 Nov. 1986
+%
+\newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
+\newdimen\cornerlong \cornerlong=1pc
+\newdimen\cornerthick \cornerthick=.3pt
+\newdimen\topandbottommargin \topandbottommargin=.75in
+
+% Main output routine.
+\chardef\PAGE = 255
+\output = {\onepageout{\pagecontents\PAGE}}
+
+\newbox\headlinebox
+\newbox\footlinebox
+
+% \onepageout takes a vbox as an argument. Note that \pagecontents
+% does insertions, but you have to call it yourself.
+\def\onepageout#1{%
+ \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi
+ %
+ \ifodd\pageno \advance\hoffset by \bindingoffset
+ \else \advance\hoffset by -\bindingoffset\fi
+ %
+ % Do this outside of the \shipout so @code etc. will be expanded in
+ % the headline as they should be, not taken literally (outputting ''code).
+ \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}%
+ \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}%
+ %
+ {%
+ % Have to do this stuff outside the \shipout because we want it to
+ % take effect in \write's, yet the group defined by the \vbox ends
+ % before the \shipout runs.
+ %
+ \escapechar = `\\ % use backslash in output files.
+ \indexdummies % don't expand commands in the output.
+ \normalturnoffactive % \ in index entries must not stay \, e.g., if
+ % the page break happens to be in the middle of an example.
+ \shipout\vbox{%
+ % Do this early so pdf references go to the beginning of the page.
+ \ifpdfmakepagedest \pdfmkdest{\the\pageno} \fi
+ %
+ \ifcropmarks \vbox to \outervsize\bgroup
+ \hsize = \outerhsize
+ \vskip-\topandbottommargin
+ \vtop to0pt{%
+ \line{\ewtop\hfil\ewtop}%
+ \nointerlineskip
+ \line{%
+ \vbox{\moveleft\cornerthick\nstop}%
+ \hfill
+ \vbox{\moveright\cornerthick\nstop}%
+ }%
+ \vss}%
+ \vskip\topandbottommargin
+ \line\bgroup
+ \hfil % center the page within the outer (page) hsize.
+ \ifodd\pageno\hskip\bindingoffset\fi
+ \vbox\bgroup
+ \fi
+ %
+ \unvbox\headlinebox
+ \pagebody{#1}%
+ \ifdim\ht\footlinebox > 0pt
+ % Only leave this space if the footline is nonempty.
+ % (We lessened \vsize for it in \oddfootingxxx.)
+ % The \baselineskip=24pt in plain's \makefootline has no effect.
+ \vskip 2\baselineskip
+ \unvbox\footlinebox
+ \fi
+ %
+ \ifcropmarks
+ \egroup % end of \vbox\bgroup
+ \hfil\egroup % end of (centering) \line\bgroup
+ \vskip\topandbottommargin plus1fill minus1fill
+ \boxmaxdepth = \cornerthick
+ \vbox to0pt{\vss
+ \line{%
+ \vbox{\moveleft\cornerthick\nsbot}%
+ \hfill
+ \vbox{\moveright\cornerthick\nsbot}%
+ }%
+ \nointerlineskip
+ \line{\ewbot\hfil\ewbot}%
+ }%
+ \egroup % \vbox from first cropmarks clause
+ \fi
+ }% end of \shipout\vbox
+ }% end of group with \turnoffactive
+ \advancepageno
+ \ifnum\outputpenalty>-20000 \else\dosupereject\fi
+}
+
+\newinsert\margin \dimen\margin=\maxdimen
+
+\def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
+{\catcode`\@ =11
+\gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
+% marginal hacks, juha@viisa.uucp (Juha Takala)
+\ifvoid\margin\else % marginal info is present
+ \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi
+\dimen@=\dp#1 \unvbox#1
+\ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
+\ifr@ggedbottom \kern-\dimen@ \vfil \fi}
+}
+
+% Here are the rules for the cropmarks. Note that they are
+% offset so that the space between them is truly \outerhsize or \outervsize
+% (P. A. MacKay, 12 November, 1986)
+%
+\def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
+\def\nstop{\vbox
+ {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
+\def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
+\def\nsbot{\vbox
+ {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
+
+% Parse an argument, then pass it to #1. The argument is the rest of
+% the input line (except we remove a trailing comment). #1 should be a
+% macro which expects an ordinary undelimited TeX argument.
+%
+\def\parsearg#1{%
+ \let\next = #1%
+ \begingroup
+ \obeylines
+ \futurelet\temp\parseargx
+}
+
+% If the next token is an obeyed space (from an @example environment or
+% the like), remove it and recurse. Otherwise, we're done.
+\def\parseargx{%
+ % \obeyedspace is defined far below, after the definition of \sepspaces.
+ \ifx\obeyedspace\temp
+ \expandafter\parseargdiscardspace
+ \else
+ \expandafter\parseargline
+ \fi
+}
+
+% Remove a single space (as the delimiter token to the macro call).
+{\obeyspaces %
+ \gdef\parseargdiscardspace {\futurelet\temp\parseargx}}
+
+{\obeylines %
+ \gdef\parseargline#1^^M{%
+ \endgroup % End of the group started in \parsearg.
+ %
+ % First remove any @c comment, then any @comment.
+ % Result of each macro is put in \toks0.
+ \argremovec #1\c\relax %
+ \expandafter\argremovecomment \the\toks0 \comment\relax %
+ %
+ % Call the caller's macro, saved as \next in \parsearg.
+ \expandafter\next\expandafter{\the\toks0}%
+ }%
+}
+
+% Since all \c{,omment} does is throw away the argument, we can let TeX
+% do that for us. The \relax here is matched by the \relax in the call
+% in \parseargline; it could be more or less anything, its purpose is
+% just to delimit the argument to the \c.
+\def\argremovec#1\c#2\relax{\toks0 = {#1}}
+\def\argremovecomment#1\comment#2\relax{\toks0 = {#1}}
+
+% \argremovec{,omment} might leave us with trailing spaces, though; e.g.,
+% @end itemize @c foo
+% will have two active spaces as part of the argument with the
+% `itemize'. Here we remove all active spaces from #1, and assign the
+% result to \toks0.
+%
+% This loses if there are any *other* active characters besides spaces
+% in the argument -- _ ^ +, for example -- since they get expanded.
+% Fortunately, Texinfo does not define any such commands. (If it ever
+% does, the catcode of the characters in questionwill have to be changed
+% here.) But this means we cannot call \removeactivespaces as part of
+% \argremovec{,omment}, since @c uses \parsearg, and thus the argument
+% that \parsearg gets might well have any character at all in it.
+%
+\def\removeactivespaces#1{%
+ \begingroup
+ \ignoreactivespaces
+ \edef\temp{#1}%
+ \global\toks0 = \expandafter{\temp}%
+ \endgroup
+}
+
+% Change the active space to expand to nothing.
+%
+\begingroup
+ \obeyspaces
+ \gdef\ignoreactivespaces{\obeyspaces\let =\empty}
+\endgroup
+
+
+\def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
+
+%% These are used to keep @begin/@end levels from running away
+%% Call \inENV within environments (after a \begingroup)
+\newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi}
+\def\ENVcheck{%
+\ifENV\errmessage{Still within an environment; press RETURN to continue}
+\endgroup\fi} % This is not perfect, but it should reduce lossage
+
+% @begin foo is the same as @foo, for now.
+\newhelp\EMsimple{Press RETURN to continue.}
+
+\outer\def\begin{\parsearg\beginxxx}
+
+\def\beginxxx #1{%
+\expandafter\ifx\csname #1\endcsname\relax
+{\errhelp=\EMsimple \errmessage{Undefined command @begin #1}}\else
+\csname #1\endcsname\fi}
+
+% @end foo executes the definition of \Efoo.
+%
+\def\end{\parsearg\endxxx}
+\def\endxxx #1{%
+ \removeactivespaces{#1}%
+ \edef\endthing{\the\toks0}%
+ %
+ \expandafter\ifx\csname E\endthing\endcsname\relax
+ \expandafter\ifx\csname \endthing\endcsname\relax
+ % There's no \foo, i.e., no ``environment'' foo.
+ \errhelp = \EMsimple
+ \errmessage{Undefined command `@end \endthing'}%
+ \else
+ \unmatchedenderror\endthing
+ \fi
+ \else
+ % Everything's ok; the right environment has been started.
+ \csname E\endthing\endcsname
+ \fi
+}
+
+% There is an environment #1, but it hasn't been started. Give an error.
+%
+\def\unmatchedenderror#1{%
+ \errhelp = \EMsimple
+ \errmessage{This `@end #1' doesn't have a matching `@#1'}%
+}
+
+% Define the control sequence \E#1 to give an unmatched @end error.
+%
+\def\defineunmatchedend#1{%
+ \expandafter\def\csname E#1\endcsname{\unmatchedenderror{#1}}%
+}
+
+
+% Single-spacing is done by various environments (specifically, in
+% \nonfillstart and \quotations).
+\newskip\singlespaceskip \singlespaceskip = 12.5pt
+\def\singlespace{%
+ % Why was this kern here? It messes up equalizing space above and below
+ % environments. --karl, 6may93
+ %{\advance \baselineskip by -\singlespaceskip
+ %\kern \baselineskip}%
+ \setleading \singlespaceskip
+}
+
+%% Simple single-character @ commands
+
+% @@ prints an @
+% Kludge this until the fonts are right (grr).
+\def\@{{\tt\char64}}
+
+% This is turned off because it was never documented
+% and you can use @w{...} around a quote to suppress ligatures.
+%% Define @` and @' to be the same as ` and '
+%% but suppressing ligatures.
+%\def\`{{`}}
+%\def\'{{'}}
+
+% Used to generate quoted braces.
+\def\mylbrace {{\tt\char123}}
+\def\myrbrace {{\tt\char125}}
+\let\{=\mylbrace
+\let\}=\myrbrace
+\begingroup
+ % Definitions to produce actual \{ & \} command in an index.
+ \catcode`\{ = 12 \catcode`\} = 12
+ \catcode`\[ = 1 \catcode`\] = 2
+ \catcode`\@ = 0 \catcode`\\ = 12
+ @gdef@lbracecmd[\{]%
+ @gdef@rbracecmd[\}]%
+@endgroup
+
+% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
+% Others are defined by plain TeX: @` @' @" @^ @~ @= @v @H.
+\let\, = \c
+\let\dotaccent = \.
+\def\ringaccent#1{{\accent23 #1}}
+\let\tieaccent = \t
+\let\ubaraccent = \b
+\let\udotaccent = \d
+
+% Other special characters: @questiondown @exclamdown
+% Plain TeX defines: @AA @AE @O @OE @L (and lowercase versions) @ss.
+\def\questiondown{?`}
+\def\exclamdown{!`}
+
+% Dotless i and dotless j, used for accents.
+\def\imacro{i}
+\def\jmacro{j}
+\def\dotless#1{%
+ \def\temp{#1}%
+ \ifx\temp\imacro \ptexi
+ \else\ifx\temp\jmacro \j
+ \else \errmessage{@dotless can be used only with i or j}%
+ \fi\fi
+}
+
+% Be sure we're in horizontal mode when doing a tie, since we make space
+% equivalent to this in @example-like environments. Otherwise, a space
+% at the beginning of a line will start with \penalty -- and
+% since \penalty is valid in vertical mode, we'd end up putting the
+% penalty on the vertical list instead of in the new paragraph.
+{\catcode`@ = 11
+ % Avoid using \@M directly, because that causes trouble
+ % if the definition is written into an index file.
+ \global\let\tiepenalty = \@M
+ \gdef\tie{\leavevmode\penalty\tiepenalty\ }
+}
+
+% @: forces normal size whitespace following.
+\def\:{\spacefactor=1000 }
+
+% @* forces a line break.
+\def\*{\hfil\break\hbox{}\ignorespaces}
+
+% @. is an end-of-sentence period.
+\def\.{.\spacefactor=3000 }
+
+% @! is an end-of-sentence bang.
+\def\!{!\spacefactor=3000 }
+
+% @? is an end-of-sentence query.
+\def\?{?\spacefactor=3000 }
+
+% @w prevents a word break. Without the \leavevmode, @w at the
+% beginning of a paragraph, when TeX is still in vertical mode, would
+% produce a whole line of output instead of starting the paragraph.
+\def\w#1{\leavevmode\hbox{#1}}
+
+% @group ... @end group forces ... to be all on one page, by enclosing
+% it in a TeX vbox. We use \vtop instead of \vbox to construct the box
+% to keep its height that of a normal line. According to the rules for
+% \topskip (p.114 of the TeXbook), the glue inserted is
+% max (\topskip - \ht (first item), 0). If that height is large,
+% therefore, no glue is inserted, and the space between the headline and
+% the text is small, which looks bad.
+%
+\def\group{\begingroup
+ \ifnum\catcode13=\active \else
+ \errhelp = \groupinvalidhelp
+ \errmessage{@group invalid in context where filling is enabled}%
+ \fi
+ %
+ % The \vtop we start below produces a box with normal height and large
+ % depth; thus, TeX puts \baselineskip glue before it, and (when the
+ % next line of text is done) \lineskip glue after it. (See p.82 of
+ % the TeXbook.) Thus, space below is not quite equal to space
+ % above. But it's pretty close.
+ \def\Egroup{%
+ \egroup % End the \vtop.
+ \endgroup % End the \group.
+ }%
+ %
+ \vtop\bgroup
+ % We have to put a strut on the last line in case the @group is in
+ % the midst of an example, rather than completely enclosing it.
+ % Otherwise, the interline space between the last line of the group
+ % and the first line afterwards is too small. But we can't put the
+ % strut in \Egroup, since there it would be on a line by itself.
+ % Hence this just inserts a strut at the beginning of each line.
+ \everypar = {\strut}%
+ %
+ % Since we have a strut on every line, we don't need any of TeX's
+ % normal interline spacing.
+ \offinterlineskip
+ %
+ % OK, but now we have to do something about blank
+ % lines in the input in @example-like environments, which normally
+ % just turn into \lisppar, which will insert no space now that we've
+ % turned off the interline space. Simplest is to make them be an
+ % empty paragraph.
+ \ifx\par\lisppar
+ \edef\par{\leavevmode \par}%
+ %
+ % Reset ^^M's definition to new definition of \par.
+ \obeylines
+ \fi
+ %
+ % Do @comment since we are called inside an environment such as
+ % @example, where each end-of-line in the input causes an
+ % end-of-line in the output. We don't want the end-of-line after
+ % the `@group' to put extra space in the output. Since @group
+ % should appear on a line by itself (according to the Texinfo
+ % manual), we don't worry about eating any user text.
+ \comment
+}
+%
+% TeX puts in an \escapechar (i.e., `@') at the beginning of the help
+% message, so this ends up printing `@group can only ...'.
+%
+\newhelp\groupinvalidhelp{%
+group can only be used in environments such as @example,^^J%
+where each line of input produces a line of output.}
+
+% @need space-in-mils
+% forces a page break if there is not space-in-mils remaining.
+
+\newdimen\mil \mil=0.001in
+
+\def\need{\parsearg\needx}
+
+% Old definition--didn't work.
+%\def\needx #1{\par %
+%% This method tries to make TeX break the page naturally
+%% if the depth of the box does not fit.
+%{\baselineskip=0pt%
+%\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak
+%\prevdepth=-1000pt
+%}}
+
+\def\needx#1{%
+ % Ensure vertical mode, so we don't make a big box in the middle of a
+ % paragraph.
+ \par
+ %
+ % If the @need value is less than one line space, it's useless.
+ \dimen0 = #1\mil
+ \dimen2 = \ht\strutbox
+ \advance\dimen2 by \dp\strutbox
+ \ifdim\dimen0 > \dimen2
+ %
+ % Do a \strut just to make the height of this box be normal, so the
+ % normal leading is inserted relative to the preceding line.
+ % And a page break here is fine.
+ \vtop to #1\mil{\strut\vfil}%
+ %
+ % TeX does not even consider page breaks if a penalty added to the
+ % main vertical list is 10000 or more. But in order to see if the
+ % empty box we just added fits on the page, we must make it consider
+ % page breaks. On the other hand, we don't want to actually break the
+ % page after the empty box. So we use a penalty of 9999.
+ %
+ % There is an extremely small chance that TeX will actually break the
+ % page at this \penalty, if there are no other feasible breakpoints in
+ % sight. (If the user is using lots of big @group commands, which
+ % almost-but-not-quite fill up a page, TeX will have a hard time doing
+ % good page breaking, for example.) However, I could not construct an
+ % example where a page broke at this \penalty; if it happens in a real
+ % document, then we can reconsider our strategy.
+ \penalty9999
+ %
+ % Back up by the size of the box, whether we did a page break or not.
+ \kern -#1\mil
+ %
+ % Do not allow a page break right after this kern.
+ \nobreak
+ \fi
+}
+
+% @br forces paragraph break
+
+\let\br = \par
+
+% @dots{} output an ellipsis using the current font.
+% We do .5em per period so that it has the same spacing in a typewriter
+% font as three actual period characters.
+%
+\def\dots{%
+ \leavevmode
+ \hbox to 1.5em{%
+ \hskip 0pt plus 0.25fil minus 0.25fil
+ .\hss.\hss.%
+ \hskip 0pt plus 0.5fil minus 0.5fil
+ }%
+}
+
+% @enddots{} is an end-of-sentence ellipsis.
+%
+\def\enddots{%
+ \leavevmode
+ \hbox to 2em{%
+ \hskip 0pt plus 0.25fil minus 0.25fil
+ .\hss.\hss.\hss.%
+ \hskip 0pt plus 0.5fil minus 0.5fil
+ }%
+ \spacefactor=3000
+}
+
+
+% @page forces the start of a new page
+%
+\def\page{\par\vfill\supereject}
+
+% @exdent text....
+% outputs text on separate line in roman font, starting at standard page margin
+
+% This records the amount of indent in the innermost environment.
+% That's how much \exdent should take out.
+\newskip\exdentamount
+
+% This defn is used inside fill environments such as @defun.
+\def\exdent{\parsearg\exdentyyy}
+\def\exdentyyy #1{{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}}
+
+% This defn is used inside nofill environments such as @example.
+\def\nofillexdent{\parsearg\nofillexdentyyy}
+\def\nofillexdentyyy #1{{\advance \leftskip by -\exdentamount
+\leftline{\hskip\leftskip{\rm#1}}}}
+
+% @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
+% paragraph. For more general purposes, use the \margin insertion
+% class. WHICH is `l' or `r'.
+%
+\newskip\inmarginspacing \inmarginspacing=1cm
+\def\strutdepth{\dp\strutbox}
+%
+\def\doinmargin#1#2{\strut\vadjust{%
+ \nobreak
+ \kern-\strutdepth
+ \vtop to \strutdepth{%
+ \baselineskip=\strutdepth
+ \vss
+ % if you have multiple lines of stuff to put here, you'll need to
+ % make the vbox yourself of the appropriate size.
+ \ifx#1l%
+ \llap{\ignorespaces #2\hskip\inmarginspacing}%
+ \else
+ \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}%
+ \fi
+ \null
+ }%
+}}
+\def\inleftmargin{\doinmargin l}
+\def\inrightmargin{\doinmargin r}
+%
+% @inmargin{TEXT [, RIGHT-TEXT]}
+% (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right;
+% else use TEXT for both).
+%
+\def\inmargin#1{\parseinmargin #1,,\finish}
+\def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing.
+ \setbox0 = \hbox{\ignorespaces #2}%
+ \ifdim\wd0 > 0pt
+ \def\lefttext{#1}% have both texts
+ \def\righttext{#2}%
+ \else
+ \def\lefttext{#1}% have only one text
+ \def\righttext{#1}%
+ \fi
+ %
+ \ifodd\pageno
+ \def\temp{\inleftmargin\lefttext}%
+ \else
+ \def\temp{\inrightmargin\righttext}%
+ \fi
+ \temp
+}
+
+% @include file insert text of that file as input.
+% Allow normal characters that we make active in the argument (a file name).
+\def\include{\begingroup
+ \catcode`\\=12
+ \catcode`~=12
+ \catcode`^=12
+ \catcode`_=12
+ \catcode`|=12
+ \catcode`<=12
+ \catcode`>=12
+ \catcode`+=12
+ \parsearg\includezzz}
+% Restore active chars for included file.
+\def\includezzz#1{\endgroup\begingroup
+ % Read the included file in a group so nested @include's work.
+ \def\thisfile{#1}%
+ \input\thisfile
+\endgroup}
+
+\def\thisfile{}
+
+% @center line outputs that line, centered
+
+\def\center{\parsearg\centerzzz}
+\def\centerzzz #1{{\advance\hsize by -\leftskip
+\advance\hsize by -\rightskip
+\centerline{#1}}}
+
+% @sp n outputs n lines of vertical space
+
+\def\sp{\parsearg\spxxx}
+\def\spxxx #1{\vskip #1\baselineskip}
+
+% @comment ...line which is ignored...
+% @c is the same as @comment
+% @ignore ... @end ignore is another way to write a comment
+
+\def\comment{\begingroup \catcode`\^^M=\other%
+\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
+\commentxxx}
+{\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}}
+
+\let\c=\comment
+
+% @paragraphindent NCHARS
+% We'll use ems for NCHARS, close enough.
+% We cannot implement @paragraphindent asis, though.
+%
+\def\asisword{asis} % no translation, these are keywords
+\def\noneword{none}
+%
+\def\paragraphindent{\parsearg\doparagraphindent}
+\def\doparagraphindent#1{%
+ \def\temp{#1}%
+ \ifx\temp\asisword
+ \else
+ \ifx\temp\noneword
+ \defaultparindent = 0pt
+ \else
+ \defaultparindent = #1em
+ \fi
+ \fi
+ \parindent = \defaultparindent
+}
+
+% @exampleindent NCHARS
+% We'll use ems for NCHARS like @paragraphindent.
+% It seems @exampleindent asis isn't necessary, but
+% I preserve it to make it similar to @paragraphindent.
+\def\exampleindent{\parsearg\doexampleindent}
+\def\doexampleindent#1{%
+ \def\temp{#1}%
+ \ifx\temp\asisword
+ \else
+ \ifx\temp\noneword
+ \lispnarrowing = 0pt
+ \else
+ \lispnarrowing = #1em
+ \fi
+ \fi
+}
+
+% @asis just yields its argument. Used with @table, for example.
+%
+\def\asis#1{#1}
+
+% @math means output in math mode.
+% We don't use $'s directly in the definition of \math because control
+% sequences like \math are expanded when the toc file is written. Then,
+% we read the toc file back, the $'s will be normal characters (as they
+% should be, according to the definition of Texinfo). So we must use a
+% control sequence to switch into and out of math mode.
+%
+% This isn't quite enough for @math to work properly in indices, but it
+% seems unlikely it will ever be needed there.
+%
+\let\implicitmath = $
+\def\math#1{\implicitmath #1\implicitmath}
+
+% @bullet and @minus need the same treatment as @math, just above.
+\def\bullet{\implicitmath\ptexbullet\implicitmath}
+\def\minus{\implicitmath-\implicitmath}
+
+% @refill is a no-op.
+\let\refill=\relax
+
+% If working on a large document in chapters, it is convenient to
+% be able to disable indexing, cross-referencing, and contents, for test runs.
+% This is done with @novalidate (before @setfilename).
+%
+\newif\iflinks \linkstrue % by default we want the aux files.
+\let\novalidate = \linksfalse
+
+% @setfilename is done at the beginning of every texinfo file.
+% So open here the files we need to have open while reading the input.
+% This makes it possible to make a .fmt file for texinfo.
+\def\setfilename{%
+ \iflinks
+ \readauxfile
+ \fi % \openindices needs to do some work in any case.
+ \openindices
+ \fixbackslash % Turn off hack to swallow `\input texinfo'.
+ \global\let\setfilename=\comment % Ignore extra @setfilename cmds.
+ %
+ % If texinfo.cnf is present on the system, read it.
+ % Useful for site-wide @afourpaper, etc.
+ % Just to be on the safe side, close the input stream before the \input.
+ \openin 1 texinfo.cnf
+ \ifeof1 \let\temp=\relax \else \def\temp{\input texinfo.cnf }\fi
+ \closein1
+ \temp
+ %
+ \comment % Ignore the actual filename.
+}
+
+% Called from \setfilename.
+%
+\def\openindices{%
+ \newindex{cp}%
+ \newcodeindex{fn}%
+ \newcodeindex{vr}%
+ \newcodeindex{tp}%
+ \newcodeindex{ky}%
+ \newcodeindex{pg}%
+}
+
+% @bye.
+\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
+
+
+\message{pdf,}
+% adobe `portable' document format
+\newcount\tempnum
+\newcount\lnkcount
+\newtoks\filename
+\newcount\filenamelength
+\newcount\pgn
+\newtoks\toksA
+\newtoks\toksB
+\newtoks\toksC
+\newtoks\toksD
+\newbox\boxA
+\newcount\countA
+\newif\ifpdf
+\newif\ifpdfmakepagedest
+
+\ifx\pdfoutput\undefined
+ \pdffalse
+ \let\pdfmkdest = \gobble
+ \let\pdfurl = \gobble
+ \let\endlink = \relax
+ \let\linkcolor = \relax
+ \let\pdfmakeoutlines = \relax
+\else
+ \pdftrue
+ \pdfoutput = 1
+ \input pdfcolor
+ \def\dopdfimage#1#2#3{%
+ \def\imagewidth{#2}%
+ \def\imageheight{#3}%
+ \ifnum\pdftexversion < 14
+ \pdfimage
+ \else
+ \pdfximage
+ \fi
+ \ifx\empty\imagewidth\else width \imagewidth \fi
+ \ifx\empty\imageheight\else height \imageheight \fi
+ {#1.pdf}%
+ \ifnum\pdftexversion < 14 \else
+ \pdfrefximage \pdflastximage
+ \fi}
+ \def\pdfmkdest#1{\pdfdest name{#1@} xyz}
+ \def\pdfmkpgn#1{#1@}
+ \let\linkcolor = \Blue % was Cyan, but that seems light?
+ \def\endlink{\Black\pdfendlink}
+ % Adding outlines to PDF; macros for calculating structure of outlines
+ % come from Petr Olsak
+ \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
+ \else \csname#1\endcsname \fi}
+ \def\advancenumber#1{\tempnum=\expnumber{#1}\relax
+ \advance\tempnum by1
+ \expandafter\xdef\csname#1\endcsname{\the\tempnum}}
+ \def\pdfmakeoutlines{{%
+ \openin 1 \jobname.toc
+ \ifeof 1\else\bgroup
+ \closein 1
+ \indexnofonts
+ \def\tt{}
+ \let\_ = \normalunderscore
+ % Thanh's hack / proper braces in bookmarks
+ \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace
+ \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace
+ %
+ \def\chapentry ##1##2##3{}
+ \def\unnumbchapentry ##1##2{}
+ \def\secentry ##1##2##3##4{\advancenumber{chap##2}}
+ \def\unnumbsecentry ##1##2{}
+ \def\subsecentry ##1##2##3##4##5{\advancenumber{sec##2.##3}}
+ \def\unnumbsubsecentry ##1##2{}
+ \def\subsubsecentry ##1##2##3##4##5##6{\advancenumber{subsec##2.##3.##4}}
+ \def\unnumbsubsubsecentry ##1##2{}
+ \input \jobname.toc
+ \def\chapentry ##1##2##3{%
+ \pdfoutline goto name{\pdfmkpgn{##3}}count-\expnumber{chap##2}{##1}}
+ \def\unnumbchapentry ##1##2{%
+ \pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
+ \def\secentry ##1##2##3##4{%
+ \pdfoutline goto name{\pdfmkpgn{##4}}count-\expnumber{sec##2.##3}{##1}}
+ \def\unnumbsecentry ##1##2{%
+ \pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
+ \def\subsecentry ##1##2##3##4##5{%
+ \pdfoutline goto name{\pdfmkpgn{##5}}count-\expnumber{subsec##2.##3.##4}{##1}}
+ \def\unnumbsubsecentry ##1##2{%
+ \pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
+ \def\subsubsecentry ##1##2##3##4##5##6{%
+ \pdfoutline goto name{\pdfmkpgn{##6}}{##1}}
+ \def\unnumbsubsubsecentry ##1##2{%
+ \pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
+ \input \jobname.toc
+ \egroup\fi
+ }}
+ \def\makelinks #1,{%
+ \def\params{#1}\def\E{END}%
+ \ifx\params\E
+ \let\nextmakelinks=\relax
+ \else
+ \let\nextmakelinks=\makelinks
+ \ifnum\lnkcount>0,\fi
+ \picknum{#1}%
+ \startlink attr{/Border [0 0 0]}
+ goto name{\pdfmkpgn{\the\pgn}}%
+ \linkcolor #1%
+ \advance\lnkcount by 1%
+ \endlink
+ \fi
+ \nextmakelinks
+ }
+ \def\picknum#1{\expandafter\pn#1}
+ \def\pn#1{%
+ \def\p{#1}%
+ \ifx\p\lbrace
+ \let\nextpn=\ppn
+ \else
+ \let\nextpn=\ppnn
+ \def\first{#1}
+ \fi
+ \nextpn
+ }
+ \def\ppn#1{\pgn=#1\gobble}
+ \def\ppnn{\pgn=\first}
+ \def\pdfmklnk#1{\lnkcount=0\makelinks #1,END,}
+ \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
+ \def\skipspaces#1{\def\PP{#1}\def\D{|}%
+ \ifx\PP\D\let\nextsp\relax
+ \else\let\nextsp\skipspaces
+ \ifx\p\space\else\addtokens{\filename}{\PP}%
+ \advance\filenamelength by 1
+ \fi
+ \fi
+ \nextsp}
+ \def\getfilename#1{\filenamelength=0\expandafter\skipspaces#1|\relax}
+ \ifnum\pdftexversion < 14
+ \let \startlink \pdfannotlink
+ \else
+ \let \startlink \pdfstartlink
+ \fi
+ \def\pdfurl#1{%
+ \begingroup
+ \normalturnoffactive\def\@{@}%
+ \leavevmode\Red
+ \startlink attr{/Border [0 0 0]}%
+ user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
+ % #1
+ \endgroup}
+ \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
+ \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
+ \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
+ \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
+ \def\maketoks{%
+ \expandafter\poptoks\the\toksA|ENDTOKS|
+ \ifx\first0\adn0
+ \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
+ \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
+ \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
+ \else
+ \ifnum0=\countA\else\makelink\fi
+ \ifx\first.\let\next=\done\else
+ \let\next=\maketoks
+ \addtokens{\toksB}{\the\toksD}
+ \ifx\first,\addtokens{\toksB}{\space}\fi
+ \fi
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+ \next}
+ \def\makelink{\addtokens{\toksB}%
+ {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
+ \def\pdflink#1{%
+ \startlink attr{/Border [0 0 0]} goto name{\mkpgn{#1}}
+ \linkcolor #1\endlink}
+ \def\mkpgn#1{#1@}
+ \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
+\fi % \ifx\pdfoutput
+
+
+\message{fonts,}
+% Font-change commands.
+
+% Texinfo sort of supports the sans serif font style, which plain TeX does not.
+% So we set up a \sf analogous to plain's \rm, etc.
+\newfam\sffam
+\def\sf{\fam=\sffam \tensf}
+\let\li = \sf % Sometimes we call it \li, not \sf.
+
+% We don't need math for this one.
+\def\ttsl{\tenttsl}
+
+% Use Computer Modern fonts at \magstephalf (11pt).
+\newcount\mainmagstep
+\mainmagstep=\magstephalf
+
+% Set the font macro #1 to the font named #2, adding on the
+% specified font prefix (normally `cm').
+% #3 is the font's design size, #4 is a scale factor
+\def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4}
+
+% Use cm as the default font prefix.
+% To specify the font prefix, you must define \fontprefix
+% before you read in texinfo.tex.
+\ifx\fontprefix\undefined
+\def\fontprefix{cm}
+\fi
+% Support font families that don't use the same naming scheme as CM.
+\def\rmshape{r}
+\def\rmbshape{bx} %where the normal face is bold
+\def\bfshape{b}
+\def\bxshape{bx}
+\def\ttshape{tt}
+\def\ttbshape{tt}
+\def\ttslshape{sltt}
+\def\itshape{ti}
+\def\itbshape{bxti}
+\def\slshape{sl}
+\def\slbshape{bxsl}
+\def\sfshape{ss}
+\def\sfbshape{ss}
+\def\scshape{csc}
+\def\scbshape{csc}
+
+\ifx\bigger\relax
+\let\mainmagstep=\magstep1
+\setfont\textrm\rmshape{12}{1000}
+\setfont\texttt\ttshape{12}{1000}
+\else
+\setfont\textrm\rmshape{10}{\mainmagstep}
+\setfont\texttt\ttshape{10}{\mainmagstep}
+\fi
+% Instead of cmb10, you many want to use cmbx10.
+% cmbx10 is a prettier font on its own, but cmb10
+% looks better when embedded in a line with cmr10.
+\setfont\textbf\bfshape{10}{\mainmagstep}
+\setfont\textit\itshape{10}{\mainmagstep}
+\setfont\textsl\slshape{10}{\mainmagstep}
+\setfont\textsf\sfshape{10}{\mainmagstep}
+\setfont\textsc\scshape{10}{\mainmagstep}
+\setfont\textttsl\ttslshape{10}{\mainmagstep}
+\font\texti=cmmi10 scaled \mainmagstep
+\font\textsy=cmsy10 scaled \mainmagstep
+
+% A few fonts for @defun, etc.
+\setfont\defbf\bxshape{10}{\magstep1} %was 1314
+\setfont\deftt\ttshape{10}{\magstep1}
+\def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf}
+
+% Fonts for indices, footnotes, small examples (9pt).
+\setfont\smallrm\rmshape{9}{1000}
+\setfont\smalltt\ttshape{9}{1000}
+\setfont\smallbf\bfshape{10}{900}
+\setfont\smallit\itshape{9}{1000}
+\setfont\smallsl\slshape{9}{1000}
+\setfont\smallsf\sfshape{9}{1000}
+\setfont\smallsc\scshape{10}{900}
+\setfont\smallttsl\ttslshape{10}{900}
+\font\smalli=cmmi9
+\font\smallsy=cmsy9
+
+% Fonts for title page:
+\setfont\titlerm\rmbshape{12}{\magstep3}
+\setfont\titleit\itbshape{10}{\magstep4}
+\setfont\titlesl\slbshape{10}{\magstep4}
+\setfont\titlett\ttbshape{12}{\magstep3}
+\setfont\titlettsl\ttslshape{10}{\magstep4}
+\setfont\titlesf\sfbshape{17}{\magstep1}
+\let\titlebf=\titlerm
+\setfont\titlesc\scbshape{10}{\magstep4}
+\font\titlei=cmmi12 scaled \magstep3
+\font\titlesy=cmsy10 scaled \magstep4
+\def\authorrm{\secrm}
+
+% Chapter (and unnumbered) fonts (17.28pt).
+\setfont\chaprm\rmbshape{12}{\magstep2}
+\setfont\chapit\itbshape{10}{\magstep3}
+\setfont\chapsl\slbshape{10}{\magstep3}
+\setfont\chaptt\ttbshape{12}{\magstep2}
+\setfont\chapttsl\ttslshape{10}{\magstep3}
+\setfont\chapsf\sfbshape{17}{1000}
+\let\chapbf=\chaprm
+\setfont\chapsc\scbshape{10}{\magstep3}
+\font\chapi=cmmi12 scaled \magstep2
+\font\chapsy=cmsy10 scaled \magstep3
+
+% Section fonts (14.4pt).
+\setfont\secrm\rmbshape{12}{\magstep1}
+\setfont\secit\itbshape{10}{\magstep2}
+\setfont\secsl\slbshape{10}{\magstep2}
+\setfont\sectt\ttbshape{12}{\magstep1}
+\setfont\secttsl\ttslshape{10}{\magstep2}
+\setfont\secsf\sfbshape{12}{\magstep1}
+\let\secbf\secrm
+\setfont\secsc\scbshape{10}{\magstep2}
+\font\seci=cmmi12 scaled \magstep1
+\font\secsy=cmsy10 scaled \magstep2
+
+% \setfont\ssecrm\bxshape{10}{\magstep1} % This size an font looked bad.
+% \setfont\ssecit\itshape{10}{\magstep1} % The letters were too crowded.
+% \setfont\ssecsl\slshape{10}{\magstep1}
+% \setfont\ssectt\ttshape{10}{\magstep1}
+% \setfont\ssecsf\sfshape{10}{\magstep1}
+
+%\setfont\ssecrm\bfshape{10}{1315} % Note the use of cmb rather than cmbx.
+%\setfont\ssecit\itshape{10}{1315} % Also, the size is a little larger than
+%\setfont\ssecsl\slshape{10}{1315} % being scaled magstep1.
+%\setfont\ssectt\ttshape{10}{1315}
+%\setfont\ssecsf\sfshape{10}{1315}
+
+%\let\ssecbf=\ssecrm
+
+% Subsection fonts (13.15pt).
+\setfont\ssecrm\rmbshape{12}{\magstephalf}
+\setfont\ssecit\itbshape{10}{1315}
+\setfont\ssecsl\slbshape{10}{1315}
+\setfont\ssectt\ttbshape{12}{\magstephalf}
+\setfont\ssecttsl\ttslshape{10}{1315}
+\setfont\ssecsf\sfbshape{12}{\magstephalf}
+\let\ssecbf\ssecrm
+\setfont\ssecsc\scbshape{10}{\magstep1}
+\font\sseci=cmmi12 scaled \magstephalf
+\font\ssecsy=cmsy10 scaled 1315
+% The smallcaps and symbol fonts should actually be scaled \magstep1.5,
+% but that is not a standard magnification.
+
+% In order for the font changes to affect most math symbols and letters,
+% we have to define the \textfont of the standard families. Since
+% texinfo doesn't allow for producing subscripts and superscripts, we
+% don't bother to reset \scriptfont and \scriptscriptfont (which would
+% also require loading a lot more fonts).
+%
+\def\resetmathfonts{%
+ \textfont0 = \tenrm \textfont1 = \teni \textfont2 = \tensy
+ \textfont\itfam = \tenit \textfont\slfam = \tensl \textfont\bffam = \tenbf
+ \textfont\ttfam = \tentt \textfont\sffam = \tensf
+}
+
+
+% The font-changing commands redefine the meanings of \tenSTYLE, instead
+% of just \STYLE. We do this so that font changes will continue to work
+% in math mode, where it is the current \fam that is relevant in most
+% cases, not the current font. Plain TeX does \def\bf{\fam=\bffam
+% \tenbf}, for example. By redefining \tenbf, we obviate the need to
+% redefine \bf itself.
+\def\textfonts{%
+ \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
+ \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
+ \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl
+ \resetmathfonts}
+\def\titlefonts{%
+ \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl
+ \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc
+ \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
+ \let\tenttsl=\titlettsl
+ \resetmathfonts \setleading{25pt}}
+\def\titlefont#1{{\titlefonts\rm #1}}
+\def\chapfonts{%
+ \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
+ \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
+ \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\tenttsl=\chapttsl
+ \resetmathfonts \setleading{19pt}}
+\def\secfonts{%
+ \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
+ \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
+ \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy \let\tenttsl=\secttsl
+ \resetmathfonts \setleading{16pt}}
+\def\subsecfonts{%
+ \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
+ \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
+ \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl
+ \resetmathfonts \setleading{15pt}}
+\let\subsubsecfonts = \subsecfonts % Maybe make sssec fonts scaled magstephalf?
+\def\smallfonts{%
+ \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl
+ \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc
+ \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy
+ \let\tenttsl=\smallttsl
+ \resetmathfonts \setleading{11pt}}
+
+% Set up the default fonts, so we can use them for creating boxes.
+%
+\textfonts
+
+% Define these so they can be easily changed for other fonts.
+\def\angleleft{$\langle$}
+\def\angleright{$\rangle$}
+
+% Count depth in font-changes, for error checks
+\newcount\fontdepth \fontdepth=0
+
+% Fonts for short table of contents.
+\setfont\shortcontrm\rmshape{12}{1000}
+\setfont\shortcontbf\bxshape{12}{1000}
+\setfont\shortcontsl\slshape{12}{1000}
+
+%% Add scribe-like font environments, plus @l for inline lisp (usually sans
+%% serif) and @ii for TeX italic
+
+% \smartitalic{ARG} outputs arg in italics, followed by an italic correction
+% unless the following character is such as not to need one.
+\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi}
+\def\smartslanted#1{{\sl #1}\futurelet\next\smartitalicx}
+\def\smartitalic#1{{\it #1}\futurelet\next\smartitalicx}
+
+\let\i=\smartitalic
+\let\var=\smartslanted
+\let\dfn=\smartslanted
+\let\emph=\smartitalic
+\let\cite=\smartslanted
+
+\def\b#1{{\bf #1}}
+\let\strong=\b
+
+% We can't just use \exhyphenpenalty, because that only has effect at
+% the end of a paragraph. Restore normal hyphenation at the end of the
+% group within which \nohyphenation is presumably called.
+%
+\def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation}
+\def\restorehyphenation{\hyphenchar\font = `- }
+
+\def\t#1{%
+ {\tt \rawbackslash \frenchspacing #1}%
+ \null
+}
+\let\ttfont=\t
+\def\samp#1{`\tclose{#1}'\null}
+\setfont\keyrm\rmshape{8}{1000}
+\font\keysy=cmsy9
+\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
+ \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
+ \vbox{\hrule\kern-0.4pt
+ \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
+ \kern-0.4pt\hrule}%
+ \kern-.06em\raise0.4pt\hbox{\angleright}}}}
+% The old definition, with no lozenge:
+%\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null}
+\def\ctrl #1{{\tt \rawbackslash \hat}#1}
+
+% @file, @option are the same as @samp.
+\let\file=\samp
+\let\option=\samp
+
+% @code is a modification of @t,
+% which makes spaces the same size as normal in the surrounding text.
+\def\tclose#1{%
+ {%
+ % Change normal interword space to be same as for the current font.
+ \spaceskip = \fontdimen2\font
+ %
+ % Switch to typewriter.
+ \tt
+ %
+ % But `\ ' produces the large typewriter interword space.
+ \def\ {{\spaceskip = 0pt{} }}%
+ %
+ % Turn off hyphenation.
+ \nohyphenation
+ %
+ \rawbackslash
+ \frenchspacing
+ #1%
+ }%
+ \null
+}
+
+% We *must* turn on hyphenation at `-' and `_' in \code.
+% Otherwise, it is too hard to avoid overfull hboxes
+% in the Emacs manual, the Library manual, etc.
+
+% Unfortunately, TeX uses one parameter (\hyphenchar) to control
+% both hyphenation at - and hyphenation within words.
+% We must therefore turn them both off (\tclose does that)
+% and arrange explicitly to hyphenate at a dash.
+% -- rms.
+{
+ \catcode`\-=\active
+ \catcode`\_=\active
+ %
+ \global\def\code{\begingroup
+ \catcode`\-=\active \let-\codedash
+ \catcode`\_=\active \let_\codeunder
+ \codex
+ }
+ %
+ % If we end up with any active - characters when handling the index,
+ % just treat them as a normal -.
+ \global\def\indexbreaks{\catcode`\-=\active \let-\realdash}
+}
+
+\def\realdash{-}
+\def\codedash{-\discretionary{}{}{}}
+\def\codeunder{\ifusingtt{\normalunderscore\discretionary{}{}{}}{\_}}
+\def\codex #1{\tclose{#1}\endgroup}
+
+%\let\exp=\tclose %Was temporary
+
+% @kbd is like @code, except that if the argument is just one @key command,
+% then @kbd has no effect.
+
+% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
+% `example' (@kbd uses ttsl only inside of @example and friends),
+% or `code' (@kbd uses normal tty font always).
+\def\kbdinputstyle{\parsearg\kbdinputstylexxx}
+\def\kbdinputstylexxx#1{%
+ \def\arg{#1}%
+ \ifx\arg\worddistinct
+ \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
+ \else\ifx\arg\wordexample
+ \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
+ \else\ifx\arg\wordcode
+ \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
+ \fi\fi\fi
+}
+\def\worddistinct{distinct}
+\def\wordexample{example}
+\def\wordcode{code}
+
+% Default is kbdinputdistinct. (Too much of a hassle to call the macro,
+% the catcodes are wrong for parsearg to work.)
+\gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}
+
+\def\xkey{\key}
+\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
+\ifx\one\xkey\ifx\threex\three \key{#2}%
+\else{\tclose{\kbdfont\look}}\fi
+\else{\tclose{\kbdfont\look}}\fi}
+
+% For @url, @env, @command quotes seem unnecessary, so use \code.
+\let\url=\code
+\let\env=\code
+\let\command=\code
+
+% @uref (abbreviation for `urlref') takes an optional (comma-separated)
+% second argument specifying the text to display and an optional third
+% arg as text to display instead of (rather than in addition to) the url
+% itself. First (mandatory) arg is the url. Perhaps eventually put in
+% a hypertex \special here.
+%
+\def\uref#1{\douref #1,,,\finish}
+\def\douref#1,#2,#3,#4\finish{\begingroup
+ \unsepspaces
+ \pdfurl{#1}%
+ \setbox0 = \hbox{\ignorespaces #3}%
+ \ifdim\wd0 > 0pt
+ \unhbox0 % third arg given, show only that
+ \else
+ \setbox0 = \hbox{\ignorespaces #2}%
+ \ifdim\wd0 > 0pt
+ \ifpdf
+ \unhbox0 % PDF: 2nd arg given, show only it
+ \else
+ \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url
+ \fi
+ \else
+ \code{#1}% only url given, so show it
+ \fi
+ \fi
+ \endlink
+\endgroup}
+
+% rms does not like angle brackets --karl, 17may97.
+% So now @email is just like @uref, unless we are pdf.
+%
+%\def\email#1{\angleleft{\tt #1}\angleright}
+\ifpdf
+ \def\email#1{\doemail#1,,\finish}
+ \def\doemail#1,#2,#3\finish{\begingroup
+ \unsepspaces
+ \pdfurl{mailto:#1}%
+ \setbox0 = \hbox{\ignorespaces #2}%
+ \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
+ \endlink
+ \endgroup}
+\else
+ \let\email=\uref
+\fi
+
+% Check if we are currently using a typewriter font. Since all the
+% Computer Modern typewriter fonts have zero interword stretch (and
+% shrink), and it is reasonable to expect all typewriter fonts to have
+% this property, we can check that font parameter.
+%
+\def\ifmonospace{\ifdim\fontdimen3\font=0pt }
+
+% Typeset a dimension, e.g., `in' or `pt'. The only reason for the
+% argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
+%
+\def\dmn#1{\thinspace #1}
+
+\def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par}
+
+% @l was never documented to mean ``switch to the Lisp font'',
+% and it is not used as such in any manual I can find. We need it for
+% Polish suppressed-l. --karl, 22sep96.
+%\def\l#1{{\li #1}\null}
+
+% Explicit font changes: @r, @sc, undocumented @ii.
+\def\r#1{{\rm #1}} % roman font
+\def\sc#1{{\smallcaps#1}} % smallcaps font
+\def\ii#1{{\it #1}} % italic font
+
+% @acronym downcases the argument and prints in smallcaps.
+\def\acronym#1{{\smallcaps \lowercase{#1}}}
+
+% @pounds{} is a sterling sign.
+\def\pounds{{\it\$}}
+
+
+\message{page headings,}
+
+\newskip\titlepagetopglue \titlepagetopglue = 1.5in
+\newskip\titlepagebottomglue \titlepagebottomglue = 2pc
+
+% First the title page. Must do @settitle before @titlepage.
+\newif\ifseenauthor
+\newif\iffinishedtitlepage
+
+% Do an implicit @contents or @shortcontents after @end titlepage if the
+% user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage.
+%
+\newif\ifsetcontentsaftertitlepage
+ \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue
+\newif\ifsetshortcontentsaftertitlepage
+ \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue
+
+\def\shorttitlepage{\parsearg\shorttitlepagezzz}
+\def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}%
+ \endgroup\page\hbox{}\page}
+
+\def\titlepage{\begingroup \parindent=0pt \textfonts
+ \let\subtitlerm=\tenrm
+ \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}%
+ %
+ \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines}%
+ %
+ % Leave some space at the very top of the page.
+ \vglue\titlepagetopglue
+ %
+ % Now you can print the title using @title.
+ \def\title{\parsearg\titlezzz}%
+ \def\titlezzz##1{\leftline{\titlefonts\rm ##1}
+ % print a rule at the page bottom also.
+ \finishedtitlepagefalse
+ \vskip4pt \hrule height 4pt width \hsize \vskip4pt}%
+ % No rule at page bottom unless we print one at the top with @title.
+ \finishedtitlepagetrue
+ %
+ % Now you can put text using @subtitle.
+ \def\subtitle{\parsearg\subtitlezzz}%
+ \def\subtitlezzz##1{{\subtitlefont \rightline{##1}}}%
+ %
+ % @author should come last, but may come many times.
+ \def\author{\parsearg\authorzzz}%
+ \def\authorzzz##1{\ifseenauthor\else\vskip 0pt plus 1filll\seenauthortrue\fi
+ {\authorfont \leftline{##1}}}%
+ %
+ % Most title ``pages'' are actually two pages long, with space
+ % at the top of the second. We don't want the ragged left on the second.
+ \let\oldpage = \page
+ \def\page{%
+ \iffinishedtitlepage\else
+ \finishtitlepage
+ \fi
+ \oldpage
+ \let\page = \oldpage
+ \hbox{}}%
+% \def\page{\oldpage \hbox{}}
+}
+
+\def\Etitlepage{%
+ \iffinishedtitlepage\else
+ \finishtitlepage
+ \fi
+ % It is important to do the page break before ending the group,
+ % because the headline and footline are only empty inside the group.
+ % If we use the new definition of \page, we always get a blank page
+ % after the title page, which we certainly don't want.
+ \oldpage
+ \endgroup
+ %
+ % If they want short, they certainly want long too.
+ \ifsetshortcontentsaftertitlepage
+ \shortcontents
+ \contents
+ \global\let\shortcontents = \relax
+ \global\let\contents = \relax
+ \fi
+ %
+ \ifsetcontentsaftertitlepage
+ \contents
+ \global\let\contents = \relax
+ \global\let\shortcontents = \relax
+ \fi
+ %
+ \ifpdf \pdfmakepagedesttrue \fi
+ %
+ \HEADINGSon
+}
+
+\def\finishtitlepage{%
+ \vskip4pt \hrule height 2pt width \hsize
+ \vskip\titlepagebottomglue
+ \finishedtitlepagetrue
+}
+
+%%% Set up page headings and footings.
+
+\let\thispage=\folio
+
+\newtoks\evenheadline % headline on even pages
+\newtoks\oddheadline % headline on odd pages
+\newtoks\evenfootline % footline on even pages
+\newtoks\oddfootline % footline on odd pages
+
+% Now make Tex use those variables
+\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
+ \else \the\evenheadline \fi}}
+\footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
+ \else \the\evenfootline \fi}\HEADINGShook}
+\let\HEADINGShook=\relax
+
+% Commands to set those variables.
+% For example, this is what @headings on does
+% @evenheading @thistitle|@thispage|@thischapter
+% @oddheading @thischapter|@thispage|@thistitle
+% @evenfooting @thisfile||
+% @oddfooting ||@thisfile
+
+\def\evenheading{\parsearg\evenheadingxxx}
+\def\oddheading{\parsearg\oddheadingxxx}
+\def\everyheading{\parsearg\everyheadingxxx}
+
+\def\evenfooting{\parsearg\evenfootingxxx}
+\def\oddfooting{\parsearg\oddfootingxxx}
+\def\everyfooting{\parsearg\everyfootingxxx}
+
+{\catcode`\@=0 %
+
+\gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|\finish}
+\gdef\evenheadingyyy #1@|#2@|#3@|#4\finish{%
+\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+
+\gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|\finish}
+\gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{%
+\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+
+\gdef\everyheadingxxx#1{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
+
+\gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish}
+\gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{%
+\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+
+\gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish}
+\gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{%
+ \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%
+ %
+ % Leave some space for the footline. Hopefully ok to assume
+ % @evenfooting will not be used by itself.
+ \global\advance\pageheight by -\baselineskip
+ \global\advance\vsize by -\baselineskip
+}
+
+\gdef\everyfootingxxx#1{\oddfootingxxx{#1}\evenfootingxxx{#1}}
+%
+}% unbind the catcode of @.
+
+% @headings double turns headings on for double-sided printing.
+% @headings single turns headings on for single-sided printing.
+% @headings off turns them off.
+% @headings on same as @headings double, retained for compatibility.
+% @headings after turns on double-sided headings after this page.
+% @headings doubleafter turns on double-sided headings after this page.
+% @headings singleafter turns on single-sided headings after this page.
+% By default, they are off at the start of a document,
+% and turned `on' after @end titlepage.
+
+\def\headings #1 {\csname HEADINGS#1\endcsname}
+
+\def\HEADINGSoff{
+\global\evenheadline={\hfil} \global\evenfootline={\hfil}
+\global\oddheadline={\hfil} \global\oddfootline={\hfil}}
+\HEADINGSoff
+% When we turn headings on, set the page number to 1.
+% For double-sided printing, put current file name in lower left corner,
+% chapter name on inside top of right hand pages, document
+% title on inside top of left hand pages, and page numbers on outside top
+% edge of all pages.
+\def\HEADINGSdouble{
+\global\pageno=1
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\folio\hfil\thistitle}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chapoddpage
+}
+\let\contentsalignmacro = \chappager
+
+% For single-sided printing, chapter title goes across top left of page,
+% page number on top right.
+\def\HEADINGSsingle{
+\global\pageno=1
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\thischapter\hfil\folio}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chappager
+}
+\def\HEADINGSon{\HEADINGSdouble}
+
+\def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
+\let\HEADINGSdoubleafter=\HEADINGSafter
+\def\HEADINGSdoublex{%
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\folio\hfil\thistitle}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chapoddpage
+}
+
+\def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
+\def\HEADINGSsinglex{%
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\thischapter\hfil\folio}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chappager
+}
+
+% Subroutines used in generating headings
+% This produces Day Month Year style of output.
+% Only define if not already defined, in case a txi-??.tex file has set
+% up a different format (e.g., txi-cs.tex does this).
+\ifx\today\undefined
+\def\today{%
+ \number\day\space
+ \ifcase\month
+ \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr
+ \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug
+ \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec
+ \fi
+ \space\number\year}
+\fi
+
+% @settitle line... specifies the title of the document, for headings.
+% It generates no output of its own.
+\def\thistitle{\putwordNoTitle}
+\def\settitle{\parsearg\settitlezzz}
+\def\settitlezzz #1{\gdef\thistitle{#1}}
+
+
+\message{tables,}
+% Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x).
+
+% default indentation of table text
+\newdimen\tableindent \tableindent=.8in
+% default indentation of @itemize and @enumerate text
+\newdimen\itemindent \itemindent=.3in
+% margin between end of table item and start of table text.
+\newdimen\itemmargin \itemmargin=.1in
+
+% used internally for \itemindent minus \itemmargin
+\newdimen\itemmax
+
+% Note @table, @vtable, and @vtable define @item, @itemx, etc., with
+% these defs.
+% They also define \itemindex
+% to index the item name in whatever manner is desired (perhaps none).
+
+\newif\ifitemxneedsnegativevskip
+
+\def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}
+
+\def\internalBitem{\smallbreak \parsearg\itemzzz}
+\def\internalBitemx{\itemxpar \parsearg\itemzzz}
+
+\def\internalBxitem "#1"{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz}
+\def\internalBxitemx "#1"{\def\xitemsubtopix{#1} \itemxpar \parsearg\xitemzzz}
+
+\def\internalBkitem{\smallbreak \parsearg\kitemzzz}
+\def\internalBkitemx{\itemxpar \parsearg\kitemzzz}
+
+\def\kitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \lastfunction}}%
+ \itemzzz {#1}}
+
+\def\xitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \xitemsubtopic}}%
+ \itemzzz {#1}}
+
+\def\itemzzz #1{\begingroup %
+ \advance\hsize by -\rightskip
+ \advance\hsize by -\tableindent
+ \setbox0=\hbox{\itemfont{#1}}%
+ \itemindex{#1}%
+ \nobreak % This prevents a break before @itemx.
+ %
+ % If the item text does not fit in the space we have, put it on a line
+ % by itself, and do not allow a page break either before or after that
+ % line. We do not start a paragraph here because then if the next
+ % command is, e.g., @kindex, the whatsit would get put into the
+ % horizontal list on a line by itself, resulting in extra blank space.
+ \ifdim \wd0>\itemmax
+ %
+ % Make this a paragraph so we get the \parskip glue and wrapping,
+ % but leave it ragged-right.
+ \begingroup
+ \advance\leftskip by-\tableindent
+ \advance\hsize by\tableindent
+ \advance\rightskip by0pt plus1fil
+ \leavevmode\unhbox0\par
+ \endgroup
+ %
+ % We're going to be starting a paragraph, but we don't want the
+ % \parskip glue -- logically it's part of the @item we just started.
+ \nobreak \vskip-\parskip
+ %
+ % Stop a page break at the \parskip glue coming up. Unfortunately
+ % we can't prevent a possible page break at the following
+ % \baselineskip glue.
+ \nobreak
+ \endgroup
+ \itemxneedsnegativevskipfalse
+ \else
+ % The item text fits into the space. Start a paragraph, so that the
+ % following text (if any) will end up on the same line.
+ \noindent
+ % Do this with kerns and \unhbox so that if there is a footnote in
+ % the item text, it can migrate to the main vertical list and
+ % eventually be printed.
+ \nobreak\kern-\tableindent
+ \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0
+ \unhbox0
+ \nobreak\kern\dimen0
+ \endgroup
+ \itemxneedsnegativevskiptrue
+ \fi
+}
+
+\def\item{\errmessage{@item while not in a table}}
+\def\itemx{\errmessage{@itemx while not in a table}}
+\def\kitem{\errmessage{@kitem while not in a table}}
+\def\kitemx{\errmessage{@kitemx while not in a table}}
+\def\xitem{\errmessage{@xitem while not in a table}}
+\def\xitemx{\errmessage{@xitemx while not in a table}}
+
+% Contains a kludge to get @end[description] to work.
+\def\description{\tablez{\dontindex}{1}{}{}{}{}}
+
+% @table, @ftable, @vtable.
+\def\table{\begingroup\inENV\obeylines\obeyspaces\tablex}
+{\obeylines\obeyspaces%
+\gdef\tablex #1^^M{%
+\tabley\dontindex#1 \endtabley}}
+
+\def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex}
+{\obeylines\obeyspaces%
+\gdef\ftablex #1^^M{%
+\tabley\fnitemindex#1 \endtabley
+\def\Eftable{\endgraf\afterenvbreak\endgroup}%
+\let\Etable=\relax}}
+
+\def\vtable{\begingroup\inENV\obeylines\obeyspaces\vtablex}
+{\obeylines\obeyspaces%
+\gdef\vtablex #1^^M{%
+\tabley\vritemindex#1 \endtabley
+\def\Evtable{\endgraf\afterenvbreak\endgroup}%
+\let\Etable=\relax}}
+
+\def\dontindex #1{}
+\def\fnitemindex #1{\doind {fn}{\code{#1}}}%
+\def\vritemindex #1{\doind {vr}{\code{#1}}}%
+
+{\obeyspaces %
+\gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup%
+\tablez{#1}{#2}{#3}{#4}{#5}{#6}}}
+
+\def\tablez #1#2#3#4#5#6{%
+\aboveenvbreak %
+\begingroup %
+\def\Edescription{\Etable}% Necessary kludge.
+\let\itemindex=#1%
+\ifnum 0#3>0 \advance \leftskip by #3\mil \fi %
+\ifnum 0#4>0 \tableindent=#4\mil \fi %
+\ifnum 0#5>0 \advance \rightskip by #5\mil \fi %
+\def\itemfont{#2}%
+\itemmax=\tableindent %
+\advance \itemmax by -\itemmargin %
+\advance \leftskip by \tableindent %
+\exdentamount=\tableindent
+\parindent = 0pt
+\parskip = \smallskipamount
+\ifdim \parskip=0pt \parskip=2pt \fi%
+\def\Etable{\endgraf\afterenvbreak\endgroup}%
+\let\item = \internalBitem %
+\let\itemx = \internalBitemx %
+\let\kitem = \internalBkitem %
+\let\kitemx = \internalBkitemx %
+\let\xitem = \internalBxitem %
+\let\xitemx = \internalBxitemx %
+}
+
+% This is the counter used by @enumerate, which is really @itemize
+
+\newcount \itemno
+
+\def\itemize{\parsearg\itemizezzz}
+
+\def\itemizezzz #1{%
+ \begingroup % ended by the @end itemize
+ \itemizey {#1}{\Eitemize}
+}
+
+\def\itemizey #1#2{%
+\aboveenvbreak %
+\itemmax=\itemindent %
+\advance \itemmax by -\itemmargin %
+\advance \leftskip by \itemindent %
+\exdentamount=\itemindent
+\parindent = 0pt %
+\parskip = \smallskipamount %
+\ifdim \parskip=0pt \parskip=2pt \fi%
+\def#2{\endgraf\afterenvbreak\endgroup}%
+\def\itemcontents{#1}%
+\let\item=\itemizeitem}
+
+% Set sfcode to normal for the chars that usually have another value.
+% These are `.?!:;,'
+\def\frenchspacing{\sfcode46=1000 \sfcode63=1000 \sfcode33=1000
+ \sfcode58=1000 \sfcode59=1000 \sfcode44=1000 }
+
+% \splitoff TOKENS\endmark defines \first to be the first token in
+% TOKENS, and \rest to be the remainder.
+%
+\def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
+
+% Allow an optional argument of an uppercase letter, lowercase letter,
+% or number, to specify the first label in the enumerated list. No
+% argument is the same as `1'.
+%
+\def\enumerate{\parsearg\enumeratezzz}
+\def\enumeratezzz #1{\enumeratey #1 \endenumeratey}
+\def\enumeratey #1 #2\endenumeratey{%
+ \begingroup % ended by the @end enumerate
+ %
+ % If we were given no argument, pretend we were given `1'.
+ \def\thearg{#1}%
+ \ifx\thearg\empty \def\thearg{1}\fi
+ %
+ % Detect if the argument is a single token. If so, it might be a
+ % letter. Otherwise, the only valid thing it can be is a number.
+ % (We will always have one token, because of the test we just made.
+ % This is a good thing, since \splitoff doesn't work given nothing at
+ % all -- the first parameter is undelimited.)
+ \expandafter\splitoff\thearg\endmark
+ \ifx\rest\empty
+ % Only one token in the argument. It could still be anything.
+ % A ``lowercase letter'' is one whose \lccode is nonzero.
+ % An ``uppercase letter'' is one whose \lccode is both nonzero, and
+ % not equal to itself.
+ % Otherwise, we assume it's a number.
+ %
+ % We need the \relax at the end of the \ifnum lines to stop TeX from
+ % continuing to look for a <number>.
+ %
+ \ifnum\lccode\expandafter`\thearg=0\relax
+ \numericenumerate % a number (we hope)
+ \else
+ % It's a letter.
+ \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
+ \lowercaseenumerate % lowercase letter
+ \else
+ \uppercaseenumerate % uppercase letter
+ \fi
+ \fi
+ \else
+ % Multiple tokens in the argument. We hope it's a number.
+ \numericenumerate
+ \fi
+}
+
+% An @enumerate whose labels are integers. The starting integer is
+% given in \thearg.
+%
+\def\numericenumerate{%
+ \itemno = \thearg
+ \startenumeration{\the\itemno}%
+}
+
+% The starting (lowercase) letter is in \thearg.
+\def\lowercaseenumerate{%
+ \itemno = \expandafter`\thearg
+ \startenumeration{%
+ % Be sure we're not beyond the end of the alphabet.
+ \ifnum\itemno=0
+ \errmessage{No more lowercase letters in @enumerate; get a bigger
+ alphabet}%
+ \fi
+ \char\lccode\itemno
+ }%
+}
+
+% The starting (uppercase) letter is in \thearg.
+\def\uppercaseenumerate{%
+ \itemno = \expandafter`\thearg
+ \startenumeration{%
+ % Be sure we're not beyond the end of the alphabet.
+ \ifnum\itemno=0
+ \errmessage{No more uppercase letters in @enumerate; get a bigger
+ alphabet}
+ \fi
+ \char\uccode\itemno
+ }%
+}
+
+% Call itemizey, adding a period to the first argument and supplying the
+% common last two arguments. Also subtract one from the initial value in
+% \itemno, since @item increments \itemno.
+%
+\def\startenumeration#1{%
+ \advance\itemno by -1
+ \itemizey{#1.}\Eenumerate\flushcr
+}
+
+% @alphaenumerate and @capsenumerate are abbreviations for giving an arg
+% to @enumerate.
+%
+\def\alphaenumerate{\enumerate{a}}
+\def\capsenumerate{\enumerate{A}}
+\def\Ealphaenumerate{\Eenumerate}
+\def\Ecapsenumerate{\Eenumerate}
+
+% Definition of @item while inside @itemize.
+
+\def\itemizeitem{%
+\advance\itemno by 1
+{\let\par=\endgraf \smallbreak}%
+\ifhmode \errmessage{In hmode at itemizeitem}\fi
+{\parskip=0in \hskip 0pt
+\hbox to 0pt{\hss \itemcontents\hskip \itemmargin}%
+\vadjust{\penalty 1200}}%
+\flushcr}
+
+% @multitable macros
+% Amy Hendrickson, 8/18/94, 3/6/96
+%
+% @multitable ... @end multitable will make as many columns as desired.
+% Contents of each column will wrap at width given in preamble. Width
+% can be specified either with sample text given in a template line,
+% or in percent of \hsize, the current width of text on page.
+
+% Table can continue over pages but will only break between lines.
+
+% To make preamble:
+%
+% Either define widths of columns in terms of percent of \hsize:
+% @multitable @columnfractions .25 .3 .45
+% @item ...
+%
+% Numbers following @columnfractions are the percent of the total
+% current hsize to be used for each column. You may use as many
+% columns as desired.
+
+
+% Or use a template:
+% @multitable {Column 1 template} {Column 2 template} {Column 3 template}
+% @item ...
+% using the widest term desired in each column.
+%
+% For those who want to use more than one line's worth of words in
+% the preamble, break the line within one argument and it
+% will parse correctly, i.e.,
+%
+% @multitable {Column 1 template} {Column 2 template} {Column 3
+% template}
+% Not:
+% @multitable {Column 1 template} {Column 2 template}
+% {Column 3 template}
+
+% Each new table line starts with @item, each subsequent new column
+% starts with @tab. Empty columns may be produced by supplying @tab's
+% with nothing between them for as many times as empty columns are needed,
+% ie, @tab@tab@tab will produce two empty columns.
+
+% @item, @tab, @multitable or @end multitable do not need to be on their
+% own lines, but it will not hurt if they are.
+
+% Sample multitable:
+
+% @multitable {Column 1 template} {Column 2 template} {Column 3 template}
+% @item first col stuff @tab second col stuff @tab third col
+% @item
+% first col stuff
+% @tab
+% second col stuff
+% @tab
+% third col
+% @item first col stuff @tab second col stuff
+% @tab Many paragraphs of text may be used in any column.
+%
+% They will wrap at the width determined by the template.
+% @item@tab@tab This will be in third column.
+% @end multitable
+
+% Default dimensions may be reset by user.
+% @multitableparskip is vertical space between paragraphs in table.
+% @multitableparindent is paragraph indent in table.
+% @multitablecolmargin is horizontal space to be left between columns.
+% @multitablelinespace is space to leave between table items, baseline
+% to baseline.
+% 0pt means it depends on current normal line spacing.
+%
+\newskip\multitableparskip
+\newskip\multitableparindent
+\newdimen\multitablecolspace
+\newskip\multitablelinespace
+\multitableparskip=0pt
+\multitableparindent=6pt
+\multitablecolspace=12pt
+\multitablelinespace=0pt
+
+% Macros used to set up halign preamble:
+%
+\let\endsetuptable\relax
+\def\xendsetuptable{\endsetuptable}
+\let\columnfractions\relax
+\def\xcolumnfractions{\columnfractions}
+\newif\ifsetpercent
+
+% #1 is the part of the @columnfraction before the decimal point, which
+% is presumably either 0 or the empty string (but we don't check, we
+% just throw it away). #2 is the decimal part, which we use as the
+% percent of \hsize for this column.
+\def\pickupwholefraction#1.#2 {%
+ \global\advance\colcount by 1
+ \expandafter\xdef\csname col\the\colcount\endcsname{.#2\hsize}%
+ \setuptable
+}
+
+\newcount\colcount
+\def\setuptable#1{%
+ \def\firstarg{#1}%
+ \ifx\firstarg\xendsetuptable
+ \let\go = \relax
+ \else
+ \ifx\firstarg\xcolumnfractions
+ \global\setpercenttrue
+ \else
+ \ifsetpercent
+ \let\go\pickupwholefraction
+ \else
+ \global\advance\colcount by 1
+ \setbox0=\hbox{#1\unskip }% Add a normal word space as a separator;
+ % typically that is always in the input, anyway.
+ \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
+ \fi
+ \fi
+ \ifx\go\pickupwholefraction
+ % Put the argument back for the \pickupwholefraction call, so
+ % we'll always have a period there to be parsed.
+ \def\go{\pickupwholefraction#1}%
+ \else
+ \let\go = \setuptable
+ \fi%
+ \fi
+ \go
+}
+
+% This used to have \hskip1sp. But then the space in a template line is
+% not enough. That is bad. So let's go back to just & until we
+% encounter the problem it was intended to solve again.
+% --karl, nathan@acm.org, 20apr99.
+\def\tab{&}
+
+% @multitable ... @end multitable definitions:
+%
+\def\multitable{\parsearg\dotable}
+\def\dotable#1{\bgroup
+ \vskip\parskip
+ \let\item\crcr
+ \tolerance=9500
+ \hbadness=9500
+ \setmultitablespacing
+ \parskip=\multitableparskip
+ \parindent=\multitableparindent
+ \overfullrule=0pt
+ \global\colcount=0
+ \def\Emultitable{\global\setpercentfalse\cr\egroup\egroup}%
+ %
+ % To parse everything between @multitable and @item:
+ \setuptable#1 \endsetuptable
+ %
+ % \everycr will reset column counter, \colcount, at the end of
+ % each line. Every column entry will cause \colcount to advance by one.
+ % The table preamble
+ % looks at the current \colcount to find the correct column width.
+ \everycr{\noalign{%
+ %
+ % \filbreak%% keeps underfull box messages off when table breaks over pages.
+ % Maybe so, but it also creates really weird page breaks when the table
+ % breaks over pages. Wouldn't \vfil be better? Wait until the problem
+ % manifests itself, so it can be fixed for real --karl.
+ \global\colcount=0\relax}}%
+ %
+ % This preamble sets up a generic column definition, which will
+ % be used as many times as user calls for columns.
+ % \vtop will set a single line and will also let text wrap and
+ % continue for many paragraphs if desired.
+ \halign\bgroup&\global\advance\colcount by 1\relax
+ \multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname
+ %
+ % In order to keep entries from bumping into each other
+ % we will add a \leftskip of \multitablecolspace to all columns after
+ % the first one.
+ %
+ % If a template has been used, we will add \multitablecolspace
+ % to the width of each template entry.
+ %
+ % If the user has set preamble in terms of percent of \hsize we will
+ % use that dimension as the width of the column, and the \leftskip
+ % will keep entries from bumping into each other. Table will start at
+ % left margin and final column will justify at right margin.
+ %
+ % Make sure we don't inherit \rightskip from the outer environment.
+ \rightskip=0pt
+ \ifnum\colcount=1
+ % The first column will be indented with the surrounding text.
+ \advance\hsize by\leftskip
+ \else
+ \ifsetpercent \else
+ % If user has not set preamble in terms of percent of \hsize
+ % we will advance \hsize by \multitablecolspace.
+ \advance\hsize by \multitablecolspace
+ \fi
+ % In either case we will make \leftskip=\multitablecolspace:
+ \leftskip=\multitablecolspace
+ \fi
+ % Ignoring space at the beginning and end avoids an occasional spurious
+ % blank line, when TeX decides to break the line at the space before the
+ % box from the multistrut, so the strut ends up on a line by itself.
+ % For example:
+ % @multitable @columnfractions .11 .89
+ % @item @code{#}
+ % @tab Legal holiday which is valid in major parts of the whole country.
+ % Is automatically provided with highlighting sequences respectively marking
+ % characters.
+ \noindent\ignorespaces##\unskip\multistrut}\cr
+}
+
+\def\setmultitablespacing{% test to see if user has set \multitablelinespace.
+% If so, do nothing. If not, give it an appropriate dimension based on
+% current baselineskip.
+\ifdim\multitablelinespace=0pt
+\setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip
+\global\advance\multitablelinespace by-\ht0
+%% strut to put in table in case some entry doesn't have descenders,
+%% to keep lines equally spaced
+\let\multistrut = \strut
+\else
+%% FIXME: what is \box0 supposed to be?
+\gdef\multistrut{\vrule height\multitablelinespace depth\dp0
+width0pt\relax} \fi
+%% Test to see if parskip is larger than space between lines of
+%% table. If not, do nothing.
+%% If so, set to same dimension as multitablelinespace.
+\ifdim\multitableparskip>\multitablelinespace
+\global\multitableparskip=\multitablelinespace
+\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
+ %% than skip between lines in the table.
+\fi%
+\ifdim\multitableparskip=0pt
+\global\multitableparskip=\multitablelinespace
+\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
+ %% than skip between lines in the table.
+\fi}
+
+
+\message{conditionals,}
+% Prevent errors for section commands.
+% Used in @ignore and in failing conditionals.
+\def\ignoresections{%
+ \let\chapter=\relax
+ \let\unnumbered=\relax
+ \let\top=\relax
+ \let\unnumberedsec=\relax
+ \let\unnumberedsection=\relax
+ \let\unnumberedsubsec=\relax
+ \let\unnumberedsubsection=\relax
+ \let\unnumberedsubsubsec=\relax
+ \let\unnumberedsubsubsection=\relax
+ \let\section=\relax
+ \let\subsec=\relax
+ \let\subsubsec=\relax
+ \let\subsection=\relax
+ \let\subsubsection=\relax
+ \let\appendix=\relax
+ \let\appendixsec=\relax
+ \let\appendixsection=\relax
+ \let\appendixsubsec=\relax
+ \let\appendixsubsection=\relax
+ \let\appendixsubsubsec=\relax
+ \let\appendixsubsubsection=\relax
+ \let\contents=\relax
+ \let\smallbook=\relax
+ \let\titlepage=\relax
+}
+
+% Used in nested conditionals, where we have to parse the Texinfo source
+% and so want to turn off most commands, in case they are used
+% incorrectly.
+%
+\def\ignoremorecommands{%
+ \let\defcodeindex = \relax
+ \let\defcv = \relax
+ \let\deffn = \relax
+ \let\deffnx = \relax
+ \let\defindex = \relax
+ \let\defivar = \relax
+ \let\defmac = \relax
+ \let\defmethod = \relax
+ \let\defop = \relax
+ \let\defopt = \relax
+ \let\defspec = \relax
+ \let\deftp = \relax
+ \let\deftypefn = \relax
+ \let\deftypefun = \relax
+ \let\deftypeivar = \relax
+ \let\deftypeop = \relax
+ \let\deftypevar = \relax
+ \let\deftypevr = \relax
+ \let\defun = \relax
+ \let\defvar = \relax
+ \let\defvr = \relax
+ \let\ref = \relax
+ \let\xref = \relax
+ \let\printindex = \relax
+ \let\pxref = \relax
+ \let\settitle = \relax
+ \let\setchapternewpage = \relax
+ \let\setchapterstyle = \relax
+ \let\everyheading = \relax
+ \let\evenheading = \relax
+ \let\oddheading = \relax
+ \let\everyfooting = \relax
+ \let\evenfooting = \relax
+ \let\oddfooting = \relax
+ \let\headings = \relax
+ \let\include = \relax
+ \let\lowersections = \relax
+ \let\down = \relax
+ \let\raisesections = \relax
+ \let\up = \relax
+ \let\set = \relax
+ \let\clear = \relax
+ \let\item = \relax
+}
+
+% Ignore @ignore ... @end ignore.
+%
+\def\ignore{\doignore{ignore}}
+
+% Ignore @ifinfo, @ifhtml, @ifnottex, @html, @menu, and @direntry text.
+%
+\def\ifinfo{\doignore{ifinfo}}
+\def\ifhtml{\doignore{ifhtml}}
+\def\ifnottex{\doignore{ifnottex}}
+\def\html{\doignore{html}}
+\def\menu{\doignore{menu}}
+\def\direntry{\doignore{direntry}}
+
+% @dircategory CATEGORY -- specify a category of the dir file
+% which this file should belong to. Ignore this in TeX.
+\let\dircategory = \comment
+
+% Ignore text until a line `@end #1'.
+%
+\def\doignore#1{\begingroup
+ % Don't complain about control sequences we have declared \outer.
+ \ignoresections
+ %
+ % Define a command to swallow text until we reach `@end #1'.
+ % This @ is a catcode 12 token (that is the normal catcode of @ in
+ % this texinfo.tex file). We change the catcode of @ below to match.
+ \long\def\doignoretext##1@end #1{\enddoignore}%
+ %
+ % Make sure that spaces turn into tokens that match what \doignoretext wants.
+ \catcode32 = 10
+ %
+ % Ignore braces, too, so mismatched braces don't cause trouble.
+ \catcode`\{ = 9
+ \catcode`\} = 9
+ %
+ % We must not have @c interpreted as a control sequence.
+ \catcode`\@ = 12
+ %
+ % Make the letter c a comment character so that the rest of the line
+ % will be ignored. This way, the document can have (for example)
+ % @c @end ifinfo
+ % and the @end ifinfo will be properly ignored.
+ % (We've just changed @ to catcode 12.)
+ \catcode`\c = 14
+ %
+ % And now expand that command.
+ \doignoretext
+}
+
+% What we do to finish off ignored text.
+%
+\def\enddoignore{\endgroup\ignorespaces}%
+
+\newif\ifwarnedobs\warnedobsfalse
+\def\obstexwarn{%
+ \ifwarnedobs\relax\else
+ % We need to warn folks that they may have trouble with TeX 3.0.
+ % This uses \immediate\write16 rather than \message to get newlines.
+ \immediate\write16{}
+ \immediate\write16{WARNING: for users of Unix TeX 3.0!}
+ \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).}
+ \immediate\write16{If you are running another version of TeX, relax.}
+ \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.}
+ \immediate\write16{ Then upgrade your TeX installation if you can.}
+ \immediate\write16{ (See ftp://ftp.gnu.org/pub/gnu/TeX.README.)}
+ \immediate\write16{If you are stuck with version 3.0, run the}
+ \immediate\write16{ script ``tex3patch'' from the Texinfo distribution}
+ \immediate\write16{ to use a workaround.}
+ \immediate\write16{}
+ \global\warnedobstrue
+ \fi
+}
+
+% **In TeX 3.0, setting text in \nullfont hangs tex. For a
+% workaround (which requires the file ``dummy.tfm'' to be installed),
+% uncomment the following line:
+%%%%%\font\nullfont=dummy\let\obstexwarn=\relax
+
+% Ignore text, except that we keep track of conditional commands for
+% purposes of nesting, up to an `@end #1' command.
+%
+\def\nestedignore#1{%
+ \obstexwarn
+ % We must actually expand the ignored text to look for the @end
+ % command, so that nested ignore constructs work. Thus, we put the
+ % text into a \vbox and then do nothing with the result. To minimize
+ % the change of memory overflow, we follow the approach outlined on
+ % page 401 of the TeXbook: make the current font be a dummy font.
+ %
+ \setbox0 = \vbox\bgroup
+ % Don't complain about control sequences we have declared \outer.
+ \ignoresections
+ %
+ % Define `@end #1' to end the box, which will in turn undefine the
+ % @end command again.
+ \expandafter\def\csname E#1\endcsname{\egroup\ignorespaces}%
+ %
+ % We are going to be parsing Texinfo commands. Most cause no
+ % trouble when they are used incorrectly, but some commands do
+ % complicated argument parsing or otherwise get confused, so we
+ % undefine them.
+ %
+ % We can't do anything about stray @-signs, unfortunately;
+ % they'll produce `undefined control sequence' errors.
+ \ignoremorecommands
+ %
+ % Set the current font to be \nullfont, a TeX primitive, and define
+ % all the font commands to also use \nullfont. We don't use
+ % dummy.tfm, as suggested in the TeXbook, because not all sites
+ % might have that installed. Therefore, math mode will still
+ % produce output, but that should be an extremely small amount of
+ % stuff compared to the main input.
+ %
+ \nullfont
+ \let\tenrm=\nullfont \let\tenit=\nullfont \let\tensl=\nullfont
+ \let\tenbf=\nullfont \let\tentt=\nullfont \let\smallcaps=\nullfont
+ \let\tensf=\nullfont
+ % Similarly for index fonts (mostly for their use in smallexample).
+ \let\smallrm=\nullfont \let\smallit=\nullfont \let\smallsl=\nullfont
+ \let\smallbf=\nullfont \let\smalltt=\nullfont \let\smallsc=\nullfont
+ \let\smallsf=\nullfont
+ %
+ % Don't complain when characters are missing from the fonts.
+ \tracinglostchars = 0
+ %
+ % Don't bother to do space factor calculations.
+ \frenchspacing
+ %
+ % Don't report underfull hboxes.
+ \hbadness = 10000
+ %
+ % Do minimal line-breaking.
+ \pretolerance = 10000
+ %
+ % Do not execute instructions in @tex
+ \def\tex{\doignore{tex}}%
+ % Do not execute macro definitions.
+ % `c' is a comment character, so the word `macro' will get cut off.
+ \def\macro{\doignore{ma}}%
+}
+
+% @set VAR sets the variable VAR to an empty value.
+% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
+%
+% Since we want to separate VAR from REST-OF-LINE (which might be
+% empty), we can't just use \parsearg; we have to insert a space of our
+% own to delimit the rest of the line, and then take it out again if we
+% didn't need it. Make sure the catcode of space is correct to avoid
+% losing inside @example, for instance.
+%
+\def\set{\begingroup\catcode` =10
+ \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR.
+ \parsearg\setxxx}
+\def\setxxx#1{\setyyy#1 \endsetyyy}
+\def\setyyy#1 #2\endsetyyy{%
+ \def\temp{#2}%
+ \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty
+ \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted.
+ \fi
+ \endgroup
+}
+% Can't use \xdef to pre-expand #2 and save some time, since \temp or
+% \next or other control sequences that we've defined might get us into
+% an infinite loop. Consider `@set foo @cite{bar}'.
+\def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET#1\endcsname{#2}}
+
+% @clear VAR clears (i.e., unsets) the variable VAR.
+%
+\def\clear{\parsearg\clearxxx}
+\def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax}
+
+% @value{foo} gets the text saved in variable foo.
+{
+ \catcode`\_ = \active
+ %
+ % We might end up with active _ or - characters in the argument if
+ % we're called from @code, as @code{@value{foo-bar_}}. So \let any
+ % such active characters to their normal equivalents.
+ \gdef\value{\begingroup
+ \catcode`\-=12 \catcode`\_=12
+ \indexbreaks \let_\normalunderscore
+ \valuexxx}
+}
+\def\valuexxx#1{\expandablevalue{#1}\endgroup}
+
+% We have this subroutine so that we can handle at least some @value's
+% properly in indexes (we \let\value to this in \indexdummies). Ones
+% whose names contain - or _ still won't work, but we can't do anything
+% about that. The command has to be fully expandable, since the result
+% winds up in the index file. This means that if the variable's value
+% contains other Texinfo commands, it's almost certain it will fail
+% (although perhaps we could fix that with sufficient work to do a
+% one-level expansion on the result, instead of complete).
+%
+\def\expandablevalue#1{%
+ \expandafter\ifx\csname SET#1\endcsname\relax
+ {[No value for ``#1'']}%
+ \else
+ \csname SET#1\endcsname
+ \fi
+}
+
+% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
+% with @set.
+%
+\def\ifset{\parsearg\ifsetxxx}
+\def\ifsetxxx #1{%
+ \expandafter\ifx\csname SET#1\endcsname\relax
+ \expandafter\ifsetfail
+ \else
+ \expandafter\ifsetsucceed
+ \fi
+}
+\def\ifsetsucceed{\conditionalsucceed{ifset}}
+\def\ifsetfail{\nestedignore{ifset}}
+\defineunmatchedend{ifset}
+
+% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
+% defined with @set, or has been undefined with @clear.
+%
+\def\ifclear{\parsearg\ifclearxxx}
+\def\ifclearxxx #1{%
+ \expandafter\ifx\csname SET#1\endcsname\relax
+ \expandafter\ifclearsucceed
+ \else
+ \expandafter\ifclearfail
+ \fi
+}
+\def\ifclearsucceed{\conditionalsucceed{ifclear}}
+\def\ifclearfail{\nestedignore{ifclear}}
+\defineunmatchedend{ifclear}
+
+% @iftex, @ifnothtml, @ifnotinfo always succeed; we read the text
+% following, through the first @end iftex (etc.). Make `@end iftex'
+% (etc.) valid only after an @iftex.
+%
+\def\iftex{\conditionalsucceed{iftex}}
+\def\ifnothtml{\conditionalsucceed{ifnothtml}}
+\def\ifnotinfo{\conditionalsucceed{ifnotinfo}}
+\defineunmatchedend{iftex}
+\defineunmatchedend{ifnothtml}
+\defineunmatchedend{ifnotinfo}
+
+% We can't just want to start a group at @iftex (for example) and end it
+% at @end iftex, since then @set commands inside the conditional have no
+% effect (they'd get reverted at the end of the group). So we must
+% define \Eiftex to redefine itself to be its previous value. (We can't
+% just define it to fail again with an ``unmatched end'' error, since
+% the @ifset might be nested.)
+%
+\def\conditionalsucceed#1{%
+ \edef\temp{%
+ % Remember the current value of \E#1.
+ \let\nece{prevE#1} = \nece{E#1}%
+ %
+ % At the `@end #1', redefine \E#1 to be its previous value.
+ \def\nece{E#1}{\let\nece{E#1} = \nece{prevE#1}}%
+ }%
+ \temp
+}
+
+% We need to expand lots of \csname's, but we don't want to expand the
+% control sequences after we've constructed them.
+%
+\def\nece#1{\expandafter\noexpand\csname#1\endcsname}
+
+% @defininfoenclose.
+\let\definfoenclose=\comment
+
+
+\message{indexing,}
+% Index generation facilities
+
+% Define \newwrite to be identical to plain tex's \newwrite
+% except not \outer, so it can be used within \newindex.
+{\catcode`\@=11
+\gdef\newwrite{\alloc@7\write\chardef\sixt@@n}}
+
+% \newindex {foo} defines an index named foo.
+% It automatically defines \fooindex such that
+% \fooindex ...rest of line... puts an entry in the index foo.
+% It also defines \fooindfile to be the number of the output channel for
+% the file that accumulates this index. The file's extension is foo.
+% The name of an index should be no more than 2 characters long
+% for the sake of vms.
+%
+\def\newindex#1{%
+ \iflinks
+ \expandafter\newwrite \csname#1indfile\endcsname
+ \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
+ \fi
+ \expandafter\xdef\csname#1index\endcsname{% % Define @#1index
+ \noexpand\doindex{#1}}
+}
+
+% @defindex foo == \newindex{foo}
+%
+\def\defindex{\parsearg\newindex}
+
+% Define @defcodeindex, like @defindex except put all entries in @code.
+%
+\def\defcodeindex{\parsearg\newcodeindex}
+%
+\def\newcodeindex#1{%
+ \iflinks
+ \expandafter\newwrite \csname#1indfile\endcsname
+ \openout \csname#1indfile\endcsname \jobname.#1
+ \fi
+ \expandafter\xdef\csname#1index\endcsname{%
+ \noexpand\docodeindex{#1}}%
+}
+
+
+% @synindex foo bar makes index foo feed into index bar.
+% Do this instead of @defindex foo if you don't want it as a separate index.
+%
+% @syncodeindex foo bar similar, but put all entries made for index foo
+% inside @code.
+%
+\def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}}
+\def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}}
+
+% #1 is \doindex or \docodeindex, #2 the index getting redefined (foo),
+% #3 the target index (bar).
+\def\dosynindex#1#2#3{%
+ % Only do \closeout if we haven't already done it, else we'll end up
+ % closing the target index.
+ \expandafter \ifx\csname donesynindex#2\endcsname \undefined
+ % The \closeout helps reduce unnecessary open files; the limit on the
+ % Acorn RISC OS is a mere 16 files.
+ \expandafter\closeout\csname#2indfile\endcsname
+ \expandafter\let\csname\donesynindex#2\endcsname = 1
+ \fi
+ % redefine \fooindfile:
+ \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname
+ \expandafter\let\csname#2indfile\endcsname=\temp
+ % redefine \fooindex:
+ \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}%
+}
+
+% Define \doindex, the driver for all \fooindex macros.
+% Argument #1 is generated by the calling \fooindex macro,
+% and it is "foo", the name of the index.
+
+% \doindex just uses \parsearg; it calls \doind for the actual work.
+% This is because \doind is more useful to call from other macros.
+
+% There is also \dosubind {index}{topic}{subtopic}
+% which makes an entry in a two-level index such as the operation index.
+
+\def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
+\def\singleindexer #1{\doind{\indexname}{#1}}
+
+% like the previous two, but they put @code around the argument.
+\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
+\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
+
+\def\indexdummies{%
+\def\ { }%
+% Take care of the plain tex accent commands.
+\def\"{\realbackslash "}%
+\def\`{\realbackslash `}%
+\def\'{\realbackslash '}%
+\def\^{\realbackslash ^}%
+\def\~{\realbackslash ~}%
+\def\={\realbackslash =}%
+\def\b{\realbackslash b}%
+\def\c{\realbackslash c}%
+\def\d{\realbackslash d}%
+\def\u{\realbackslash u}%
+\def\v{\realbackslash v}%
+\def\H{\realbackslash H}%
+% Take care of the plain tex special European modified letters.
+\def\oe{\realbackslash oe}%
+\def\ae{\realbackslash ae}%
+\def\aa{\realbackslash aa}%
+\def\OE{\realbackslash OE}%
+\def\AE{\realbackslash AE}%
+\def\AA{\realbackslash AA}%
+\def\o{\realbackslash o}%
+\def\O{\realbackslash O}%
+\def\l{\realbackslash l}%
+\def\L{\realbackslash L}%
+\def\ss{\realbackslash ss}%
+% Take care of texinfo commands likely to appear in an index entry.
+% (Must be a way to avoid doing expansion at all, and thus not have to
+% laboriously list every single command here.)
+\def\@{@}% will be @@ when we switch to @ as escape char.
+% Need these in case \tex is in effect and \{ is a \delimiter again.
+% But can't use \lbracecmd and \rbracecmd because texindex assumes
+% braces and backslashes are used only as delimiters.
+\let\{ = \mylbrace
+\let\} = \myrbrace
+\def\_{{\realbackslash _}}%
+\def\w{\realbackslash w }%
+\def\bf{\realbackslash bf }%
+%\def\rm{\realbackslash rm }%
+\def\sl{\realbackslash sl }%
+\def\sf{\realbackslash sf}%
+\def\tt{\realbackslash tt}%
+\def\gtr{\realbackslash gtr}%
+\def\less{\realbackslash less}%
+\def\hat{\realbackslash hat}%
+\def\TeX{\realbackslash TeX}%
+\def\dots{\realbackslash dots }%
+\def\result{\realbackslash result}%
+\def\equiv{\realbackslash equiv}%
+\def\expansion{\realbackslash expansion}%
+\def\print{\realbackslash print}%
+\def\error{\realbackslash error}%
+\def\point{\realbackslash point}%
+\def\copyright{\realbackslash copyright}%
+\def\tclose##1{\realbackslash tclose {##1}}%
+\def\code##1{\realbackslash code {##1}}%
+\def\uref##1{\realbackslash uref {##1}}%
+\def\url##1{\realbackslash url {##1}}%
+\def\env##1{\realbackslash env {##1}}%
+\def\command##1{\realbackslash command {##1}}%
+\def\option##1{\realbackslash option {##1}}%
+\def\dotless##1{\realbackslash dotless {##1}}%
+\def\samp##1{\realbackslash samp {##1}}%
+\def\,##1{\realbackslash ,{##1}}%
+\def\t##1{\realbackslash t {##1}}%
+\def\r##1{\realbackslash r {##1}}%
+\def\i##1{\realbackslash i {##1}}%
+\def\b##1{\realbackslash b {##1}}%
+\def\sc##1{\realbackslash sc {##1}}%
+\def\cite##1{\realbackslash cite {##1}}%
+\def\key##1{\realbackslash key {##1}}%
+\def\file##1{\realbackslash file {##1}}%
+\def\var##1{\realbackslash var {##1}}%
+\def\kbd##1{\realbackslash kbd {##1}}%
+\def\dfn##1{\realbackslash dfn {##1}}%
+\def\emph##1{\realbackslash emph {##1}}%
+\def\acronym##1{\realbackslash acronym {##1}}%
+%
+% Handle some cases of @value -- where the variable name does not
+% contain - or _, and the value does not contain any
+% (non-fully-expandable) commands.
+\let\value = \expandablevalue
+%
+\unsepspaces
+% Turn off macro expansion
+\turnoffmacros
+}
+
+% If an index command is used in an @example environment, any spaces
+% therein should become regular spaces in the raw index file, not the
+% expansion of \tie (\\leavevmode \penalty \@M \ ).
+{\obeyspaces
+ \gdef\unsepspaces{\obeyspaces\let =\space}}
+
+% \indexnofonts no-ops all font-change commands.
+% This is used when outputting the strings to sort the index by.
+\def\indexdummyfont#1{#1}
+\def\indexdummytex{TeX}
+\def\indexdummydots{...}
+
+\def\indexnofonts{%
+% Just ignore accents.
+\let\,=\indexdummyfont
+\let\"=\indexdummyfont
+\let\`=\indexdummyfont
+\let\'=\indexdummyfont
+\let\^=\indexdummyfont
+\let\~=\indexdummyfont
+\let\==\indexdummyfont
+\let\b=\indexdummyfont
+\let\c=\indexdummyfont
+\let\d=\indexdummyfont
+\let\u=\indexdummyfont
+\let\v=\indexdummyfont
+\let\H=\indexdummyfont
+\let\dotless=\indexdummyfont
+% Take care of the plain tex special European modified letters.
+\def\oe{oe}%
+\def\ae{ae}%
+\def\aa{aa}%
+\def\OE{OE}%
+\def\AE{AE}%
+\def\AA{AA}%
+\def\o{o}%
+\def\O{O}%
+\def\l{l}%
+\def\L{L}%
+\def\ss{ss}%
+\let\w=\indexdummyfont
+\let\t=\indexdummyfont
+\let\r=\indexdummyfont
+\let\i=\indexdummyfont
+\let\b=\indexdummyfont
+\let\emph=\indexdummyfont
+\let\strong=\indexdummyfont
+\let\cite=\indexdummyfont
+\let\sc=\indexdummyfont
+%Don't no-op \tt, since it isn't a user-level command
+% and is used in the definitions of the active chars like <, >, |...
+%\let\tt=\indexdummyfont
+\let\tclose=\indexdummyfont
+\let\code=\indexdummyfont
+\let\url=\indexdummyfont
+\let\uref=\indexdummyfont
+\let\env=\indexdummyfont
+\let\acronym=\indexdummyfont
+\let\command=\indexdummyfont
+\let\option=\indexdummyfont
+\let\file=\indexdummyfont
+\let\samp=\indexdummyfont
+\let\kbd=\indexdummyfont
+\let\key=\indexdummyfont
+\let\var=\indexdummyfont
+\let\TeX=\indexdummytex
+\let\dots=\indexdummydots
+\def\@{@}%
+}
+
+% To define \realbackslash, we must make \ not be an escape.
+% We must first make another character (@) an escape
+% so we do not become unable to do a definition.
+
+{\catcode`\@=0 \catcode`\\=\other
+ @gdef@realbackslash{\}}
+
+\let\indexbackslash=0 %overridden during \printindex.
+\let\SETmarginindex=\relax % put index entries in margin (undocumented)?
+
+% For \ifx comparisons.
+\def\emptymacro{\empty}
+
+% Most index entries go through here, but \dosubind is the general case.
+%
+\def\doind#1#2{\dosubind{#1}{#2}\empty}
+
+% Workhorse for all \fooindexes.
+% #1 is name of index, #2 is stuff to put there, #3 is subentry --
+% \empty if called from \doind, as we usually are. The main exception
+% is with defuns, which call us directly.
+%
+\def\dosubind#1#2#3{%
+ % Put the index entry in the margin if desired.
+ \ifx\SETmarginindex\relax\else
+ \insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}%
+ \fi
+ {%
+ \count255=\lastpenalty
+ {%
+ \indexdummies % Must do this here, since \bf, etc expand at this stage
+ \escapechar=`\\
+ {%
+ \let\folio = 0% We will expand all macros now EXCEPT \folio.
+ \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now
+ % so it will be output as is; and it will print as backslash.
+ %
+ \def\thirdarg{#3}%
+ %
+ % If third arg is present, precede it with space in sort key.
+ \ifx\thirdarg\emptymacro
+ \let\subentry = \empty
+ \else
+ \def\subentry{ #3}%
+ \fi
+ %
+ % First process the index entry with all font commands turned
+ % off to get the string to sort by.
+ {\indexnofonts \xdef\indexsorttmp{#2\subentry}}%
+ %
+ % Now the real index entry with the fonts.
+ \toks0 = {#2}%
+ %
+ % If third (subentry) arg is present, add it to the index
+ % string. And include a space.
+ \ifx\thirdarg\emptymacro \else
+ \toks0 = \expandafter{\the\toks0 \space #3}%
+ \fi
+ %
+ % Set up the complete index entry, with both the sort key
+ % and the original text, including any font commands. We write
+ % three arguments to \entry to the .?? file, texindex reduces to
+ % two when writing the .??s sorted result.
+ \edef\temp{%
+ \write\csname#1indfile\endcsname{%
+ \realbackslash entry{\indexsorttmp}{\folio}{\the\toks0}}%
+ }%
+ %
+ % If a skip is the last thing on the list now, preserve it
+ % by backing up by \lastskip, doing the \write, then inserting
+ % the skip again. Otherwise, the whatsit generated by the
+ % \write will make \lastskip zero. The result is that sequences
+ % like this:
+ % @end defun
+ % @tindex whatever
+ % @defun ...
+ % will have extra space inserted, because the \medbreak in the
+ % start of the @defun won't see the skip inserted by the @end of
+ % the previous defun.
+ %
+ % But don't do any of this if we're not in vertical mode. We
+ % don't want to do a \vskip and prematurely end a paragraph.
+ %
+ % Avoid page breaks due to these extra skips, too.
+ %
+ \iflinks
+ \ifvmode
+ \skip0 = \lastskip
+ \ifdim\lastskip = 0pt \else \nobreak\vskip-\lastskip \fi
+ \fi
+ %
+ \temp % do the write
+ %
+ %
+ \ifvmode \ifdim\skip0 = 0pt \else \nobreak\vskip\skip0 \fi \fi
+ \fi
+ }%
+ }%
+ \penalty\count255
+ }%
+}
+
+% The index entry written in the file actually looks like
+% \entry {sortstring}{page}{topic}
+% or
+% \entry {sortstring}{page}{topic}{subtopic}
+% The texindex program reads in these files and writes files
+% containing these kinds of lines:
+% \initial {c}
+% before the first topic whose initial is c
+% \entry {topic}{pagelist}
+% for a topic that is used without subtopics
+% \primary {topic}
+% for the beginning of a topic that is used with subtopics
+% \secondary {subtopic}{pagelist}
+% for each subtopic.
+
+% Define the user-accessible indexing commands
+% @findex, @vindex, @kindex, @cindex.
+
+\def\findex {\fnindex}
+\def\kindex {\kyindex}
+\def\cindex {\cpindex}
+\def\vindex {\vrindex}
+\def\tindex {\tpindex}
+\def\pindex {\pgindex}
+
+\def\cindexsub {\begingroup\obeylines\cindexsub}
+{\obeylines %
+\gdef\cindexsub "#1" #2^^M{\endgroup %
+\dosubind{cp}{#2}{#1}}}
+
+% Define the macros used in formatting output of the sorted index material.
+
+% @printindex causes a particular index (the ??s file) to get printed.
+% It does not print any chapter heading (usually an @unnumbered).
+%
+\def\printindex{\parsearg\doprintindex}
+\def\doprintindex#1{\begingroup
+ \dobreak \chapheadingskip{10000}%
+ %
+ \smallfonts \rm
+ \tolerance = 9500
+ \indexbreaks
+ %
+ % See if the index file exists and is nonempty.
+ % Change catcode of @ here so that if the index file contains
+ % \initial {@}
+ % as its first line, TeX doesn't complain about mismatched braces
+ % (because it thinks @} is a control sequence).
+ \catcode`\@ = 11
+ \openin 1 \jobname.#1s
+ \ifeof 1
+ % \enddoublecolumns gets confused if there is no text in the index,
+ % and it loses the chapter title and the aux file entries for the
+ % index. The easiest way to prevent this problem is to make sure
+ % there is some text.
+ \putwordIndexNonexistent
+ \else
+ %
+ % If the index file exists but is empty, then \openin leaves \ifeof
+ % false. We have to make TeX try to read something from the file, so
+ % it can discover if there is anything in it.
+ \read 1 to \temp
+ \ifeof 1
+ \putwordIndexIsEmpty
+ \else
+ % Index files are almost Texinfo source, but we use \ as the escape
+ % character. It would be better to use @, but that's too big a change
+ % to make right now.
+ \def\indexbackslash{\rawbackslashxx}%
+ \catcode`\\ = 0
+ \escapechar = `\\
+ \begindoublecolumns
+ \input \jobname.#1s
+ \enddoublecolumns
+ \fi
+ \fi
+ \closein 1
+\endgroup}
+
+% These macros are used by the sorted index file itself.
+% Change them to control the appearance of the index.
+
+\def\initial#1{{%
+ % Some minor font changes for the special characters.
+ \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
+ %
+ % Remove any glue we may have, we'll be inserting our own.
+ \removelastskip
+ %
+ % We like breaks before the index initials, so insert a bonus.
+ \penalty -300
+ %
+ % Typeset the initial. Making this add up to a whole number of
+ % baselineskips increases the chance of the dots lining up from column
+ % to column. It still won't often be perfect, because of the stretch
+ % we need before each entry, but it's better.
+ %
+ % No shrink because it confuses \balancecolumns.
+ \vskip 1.67\baselineskip plus .5\baselineskip
+ \leftline{\secbf #1}%
+ \vskip .33\baselineskip plus .1\baselineskip
+ %
+ % Do our best not to break after the initial.
+ \nobreak
+}}
+
+% This typesets a paragraph consisting of #1, dot leaders, and then #2
+% flush to the right margin. It is used for index and table of contents
+% entries. The paragraph is indented by \leftskip.
+%
+\def\entry#1#2{\begingroup
+ %
+ % Start a new paragraph if necessary, so our assignments below can't
+ % affect previous text.
+ \par
+ %
+ % Do not fill out the last line with white space.
+ \parfillskip = 0in
+ %
+ % No extra space above this paragraph.
+ \parskip = 0in
+ %
+ % Do not prefer a separate line ending with a hyphen to fewer lines.
+ \finalhyphendemerits = 0
+ %
+ % \hangindent is only relevant when the entry text and page number
+ % don't both fit on one line. In that case, bob suggests starting the
+ % dots pretty far over on the line. Unfortunately, a large
+ % indentation looks wrong when the entry text itself is broken across
+ % lines. So we use a small indentation and put up with long leaders.
+ %
+ % \hangafter is reset to 1 (which is the value we want) at the start
+ % of each paragraph, so we need not do anything with that.
+ \hangindent = 2em
+ %
+ % When the entry text needs to be broken, just fill out the first line
+ % with blank space.
+ \rightskip = 0pt plus1fil
+ %
+ % A bit of stretch before each entry for the benefit of balancing columns.
+ \vskip 0pt plus1pt
+ %
+ % Start a ``paragraph'' for the index entry so the line breaking
+ % parameters we've set above will have an effect.
+ \noindent
+ %
+ % Insert the text of the index entry. TeX will do line-breaking on it.
+ #1%
+ % The following is kludged to not output a line of dots in the index if
+ % there are no page numbers. The next person who breaks this will be
+ % cursed by a Unix daemon.
+ \def\tempa{{\rm }}%
+ \def\tempb{#2}%
+ \edef\tempc{\tempa}%
+ \edef\tempd{\tempb}%
+ \ifx\tempc\tempd\ \else%
+ %
+ % If we must, put the page number on a line of its own, and fill out
+ % this line with blank space. (The \hfil is overwhelmed with the
+ % fill leaders glue in \indexdotfill if the page number does fit.)
+ \hfil\penalty50
+ \null\nobreak\indexdotfill % Have leaders before the page number.
+ %
+ % The `\ ' here is removed by the implicit \unskip that TeX does as
+ % part of (the primitive) \par. Without it, a spurious underfull
+ % \hbox ensues.
+ \ifpdf
+ \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
+ \else
+ \ #2% The page number ends the paragraph.
+ \fi
+ \fi%
+ \par
+\endgroup}
+
+% Like \dotfill except takes at least 1 em.
+\def\indexdotfill{\cleaders
+ \hbox{$\mathsurround=0pt \mkern1.5mu ${\it .}$ \mkern1.5mu$}\hskip 1em plus 1fill}
+
+\def\primary #1{\line{#1\hfil}}
+
+\newskip\secondaryindent \secondaryindent=0.5cm
+
+\def\secondary #1#2{
+{\parfillskip=0in \parskip=0in
+\hangindent =1in \hangafter=1
+\noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\par
+}}
+
+% Define two-column mode, which we use to typeset indexes.
+% Adapted from the TeXbook, page 416, which is to say,
+% the manmac.tex format used to print the TeXbook itself.
+\catcode`\@=11
+
+\newbox\partialpage
+\newdimen\doublecolumnhsize
+
+\def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
+ % Grab any single-column material above us.
+ \output = {%
+ %
+ % Here is a possibility not foreseen in manmac: if we accumulate a
+ % whole lot of material, we might end up calling this \output
+ % routine twice in a row (see the doublecol-lose test, which is
+ % essentially a couple of indexes with @setchapternewpage off). In
+ % that case we just ship out what is in \partialpage with the normal
+ % output routine. Generally, \partialpage will be empty when this
+ % runs and this will be a no-op. See the indexspread.tex test case.
+ \ifvoid\partialpage \else
+ \onepageout{\pagecontents\partialpage}%
+ \fi
+ %
+ \global\setbox\partialpage = \vbox{%
+ % Unvbox the main output page.
+ \unvbox\PAGE
+ \kern-\topskip \kern\baselineskip
+ }%
+ }%
+ \eject % run that output routine to set \partialpage
+ %
+ % Use the double-column output routine for subsequent pages.
+ \output = {\doublecolumnout}%
+ %
+ % Change the page size parameters. We could do this once outside this
+ % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
+ % format, but then we repeat the same computation. Repeating a couple
+ % of assignments once per index is clearly meaningless for the
+ % execution time, so we may as well do it in one place.
+ %
+ % First we halve the line length, less a little for the gutter between
+ % the columns. We compute the gutter based on the line length, so it
+ % changes automatically with the paper format. The magic constant
+ % below is chosen so that the gutter has the same value (well, +-<1pt)
+ % as it did when we hard-coded it.
+ %
+ % We put the result in a separate register, \doublecolumhsize, so we
+ % can restore it in \pagesofar, after \hsize itself has (potentially)
+ % been clobbered.
+ %
+ \doublecolumnhsize = \hsize
+ \advance\doublecolumnhsize by -.04154\hsize
+ \divide\doublecolumnhsize by 2
+ \hsize = \doublecolumnhsize
+ %
+ % Double the \vsize as well. (We don't need a separate register here,
+ % since nobody clobbers \vsize.)
+ \vsize = 2\vsize
+}
+
+% The double-column output routine for all double-column pages except
+% the last.
+%
+\def\doublecolumnout{%
+ \splittopskip=\topskip \splitmaxdepth=\maxdepth
+ % Get the available space for the double columns -- the normal
+ % (undoubled) page height minus any material left over from the
+ % previous page.
+ \dimen@ = \vsize
+ \divide\dimen@ by 2
+ \advance\dimen@ by -\ht\partialpage
+ %
+ % box0 will be the left-hand column, box2 the right.
+ \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
+ \onepageout\pagesofar
+ \unvbox255
+ \penalty\outputpenalty
+}
+%
+% Re-output the contents of the output page -- any previous material,
+% followed by the two boxes we just split, in box0 and box2.
+\def\pagesofar{%
+ \unvbox\partialpage
+ %
+ \hsize = \doublecolumnhsize
+ \wd0=\hsize \wd2=\hsize
+ \hbox to\pagewidth{\box0\hfil\box2}%
+}
+%
+% All done with double columns.
+\def\enddoublecolumns{%
+ \output = {%
+ % Split the last of the double-column material. Leave it on the
+ % current page, no automatic page break.
+ \balancecolumns
+ %
+ % If we end up splitting too much material for the current page,
+ % though, there will be another page break right after this \output
+ % invocation ends. Having called \balancecolumns once, we do not
+ % want to call it again. Therefore, reset \output to its normal
+ % definition right away. (We hope \balancecolumns will never be
+ % called on to balance too much material, but if it is, this makes
+ % the output somewhat more palatable.)
+ \global\output = {\onepageout{\pagecontents\PAGE}}%
+ }%
+ \eject
+ \endgroup % started in \begindoublecolumns
+ %
+ % \pagegoal was set to the doubled \vsize above, since we restarted
+ % the current page. We're now back to normal single-column
+ % typesetting, so reset \pagegoal to the normal \vsize (after the
+ % \endgroup where \vsize got restored).
+ \pagegoal = \vsize
+}
+%
+% Called at the end of the double column material.
+\def\balancecolumns{%
+ \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120.
+ \dimen@ = \ht0
+ \advance\dimen@ by \topskip
+ \advance\dimen@ by-\baselineskip
+ \divide\dimen@ by 2 % target to split to
+ %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}%
+ \splittopskip = \topskip
+ % Loop until we get a decent breakpoint.
+ {%
+ \vbadness = 10000
+ \loop
+ \global\setbox3 = \copy0
+ \global\setbox1 = \vsplit3 to \dimen@
+ \ifdim\ht3>\dimen@
+ \global\advance\dimen@ by 1pt
+ \repeat
+ }%
+ %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}%
+ \setbox0=\vbox to\dimen@{\unvbox1}%
+ \setbox2=\vbox to\dimen@{\unvbox3}%
+ %
+ \pagesofar
+}
+\catcode`\@ = \other
+
+
+\message{sectioning,}
+% Chapters, sections, etc.
+
+\newcount\chapno
+\newcount\secno \secno=0
+\newcount\subsecno \subsecno=0
+\newcount\subsubsecno \subsubsecno=0
+
+% This counter is funny since it counts through charcodes of letters A, B, ...
+\newcount\appendixno \appendixno = `\@
+% \def\appendixletter{\char\the\appendixno}
+% We do the following for the sake of pdftex, which needs the actual
+% letter in the expansion, not just typeset.
+\def\appendixletter{%
+ \ifnum\appendixno=`A A%
+ \else\ifnum\appendixno=`B B%
+ \else\ifnum\appendixno=`C C%
+ \else\ifnum\appendixno=`D D%
+ \else\ifnum\appendixno=`E E%
+ \else\ifnum\appendixno=`F F%
+ \else\ifnum\appendixno=`G G%
+ \else\ifnum\appendixno=`H H%
+ \else\ifnum\appendixno=`I I%
+ \else\ifnum\appendixno=`J J%
+ \else\ifnum\appendixno=`K K%
+ \else\ifnum\appendixno=`L L%
+ \else\ifnum\appendixno=`M M%
+ \else\ifnum\appendixno=`N N%
+ \else\ifnum\appendixno=`O O%
+ \else\ifnum\appendixno=`P P%
+ \else\ifnum\appendixno=`Q Q%
+ \else\ifnum\appendixno=`R R%
+ \else\ifnum\appendixno=`S S%
+ \else\ifnum\appendixno=`T T%
+ \else\ifnum\appendixno=`U U%
+ \else\ifnum\appendixno=`V V%
+ \else\ifnum\appendixno=`W W%
+ \else\ifnum\appendixno=`X X%
+ \else\ifnum\appendixno=`Y Y%
+ \else\ifnum\appendixno=`Z Z%
+ % The \the is necessary, despite appearances, because \appendixletter is
+ % expanded while writing the .toc file. \char\appendixno is not
+ % expandable, thus it is written literally, thus all appendixes come out
+ % with the same letter (or @) in the toc without it.
+ \else\char\the\appendixno
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
+
+% Each @chapter defines this as the name of the chapter.
+% page headings and footings can use it. @section does likewise.
+\def\thischapter{}
+\def\thissection{}
+
+\newcount\absseclevel % used to calculate proper heading level
+\newcount\secbase\secbase=0 % @raise/lowersections modify this count
+
+% @raisesections: treat @section as chapter, @subsection as section, etc.
+\def\raisesections{\global\advance\secbase by -1}
+\let\up=\raisesections % original BFox name
+
+% @lowersections: treat @chapter as section, @section as subsection, etc.
+\def\lowersections{\global\advance\secbase by 1}
+\let\down=\lowersections % original BFox name
+
+% Choose a numbered-heading macro
+% #1 is heading level if unmodified by @raisesections or @lowersections
+% #2 is text for heading
+\def\numhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
+\ifcase\absseclevel
+ \chapterzzz{#2}
+\or
+ \seczzz{#2}
+\or
+ \numberedsubseczzz{#2}
+\or
+ \numberedsubsubseczzz{#2}
+\else
+ \ifnum \absseclevel<0
+ \chapterzzz{#2}
+ \else
+ \numberedsubsubseczzz{#2}
+ \fi
+\fi
+}
+
+% like \numhead, but chooses appendix heading levels
+\def\apphead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
+\ifcase\absseclevel
+ \appendixzzz{#2}
+\or
+ \appendixsectionzzz{#2}
+\or
+ \appendixsubseczzz{#2}
+\or
+ \appendixsubsubseczzz{#2}
+\else
+ \ifnum \absseclevel<0
+ \appendixzzz{#2}
+ \else
+ \appendixsubsubseczzz{#2}
+ \fi
+\fi
+}
+
+% like \numhead, but chooses numberless heading levels
+\def\unnmhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
+\ifcase\absseclevel
+ \unnumberedzzz{#2}
+\or
+ \unnumberedseczzz{#2}
+\or
+ \unnumberedsubseczzz{#2}
+\or
+ \unnumberedsubsubseczzz{#2}
+\else
+ \ifnum \absseclevel<0
+ \unnumberedzzz{#2}
+ \else
+ \unnumberedsubsubseczzz{#2}
+ \fi
+\fi
+}
+
+% @chapter, @appendix, @unnumbered.
+\def\thischaptername{No Chapter Title}
+\outer\def\chapter{\parsearg\chapteryyy}
+\def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz
+\def\chapterzzz #1{%
+\secno=0 \subsecno=0 \subsubsecno=0
+\global\advance \chapno by 1 \message{\putwordChapter\space \the\chapno}%
+\chapmacro {#1}{\the\chapno}%
+\gdef\thissection{#1}%
+\gdef\thischaptername{#1}%
+% We don't substitute the actual chapter name into \thischapter
+% because we don't want its macros evaluated now.
+\xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}%
+ {\the\chapno}}}%
+\temp
+\donoderef
+\global\let\section = \numberedsec
+\global\let\subsection = \numberedsubsec
+\global\let\subsubsection = \numberedsubsubsec
+}
+
+\outer\def\appendix{\parsearg\appendixyyy}
+\def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz
+\def\appendixzzz #1{%
+\secno=0 \subsecno=0 \subsubsecno=0
+\global\advance \appendixno by 1
+\message{\putwordAppendix\space \appendixletter}%
+\chapmacro {#1}{\putwordAppendix{} \appendixletter}%
+\gdef\thissection{#1}%
+\gdef\thischaptername{#1}%
+\xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}%
+ {\putwordAppendix{} \appendixletter}}}%
+\temp
+\appendixnoderef
+\global\let\section = \appendixsec
+\global\let\subsection = \appendixsubsec
+\global\let\subsubsection = \appendixsubsubsec
+}
+
+% @centerchap is like @unnumbered, but the heading is centered.
+\outer\def\centerchap{\parsearg\centerchapyyy}
+\def\centerchapyyy #1{{\let\unnumbchapmacro=\centerchapmacro \unnumberedyyy{#1}}}
+
+% @top is like @unnumbered.
+\outer\def\top{\parsearg\unnumberedyyy}
+
+\outer\def\unnumbered{\parsearg\unnumberedyyy}
+\def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz
+\def\unnumberedzzz #1{%
+\secno=0 \subsecno=0 \subsubsecno=0
+%
+% This used to be simply \message{#1}, but TeX fully expands the
+% argument to \message. Therefore, if #1 contained @-commands, TeX
+% expanded them. For example, in `@unnumbered The @cite{Book}', TeX
+% expanded @cite (which turns out to cause errors because \cite is meant
+% to be executed, not expanded).
+%
+% Anyway, we don't want the fully-expanded definition of @cite to appear
+% as a result of the \message, we just want `@cite' itself. We use
+% \the<toks register> to achieve this: TeX expands \the<toks> only once,
+% simply yielding the contents of <toks register>. (We also do this for
+% the toc entries.)
+\toks0 = {#1}\message{(\the\toks0)}%
+%
+\unnumbchapmacro {#1}%
+\gdef\thischapter{#1}\gdef\thissection{#1}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash unnumbchapentry{\the\toks0}}}%
+\temp
+\unnumbnoderef
+\global\let\section = \unnumberedsec
+\global\let\subsection = \unnumberedsubsec
+\global\let\subsubsection = \unnumberedsubsubsec
+}
+
+% Sections.
+\outer\def\numberedsec{\parsearg\secyyy}
+\def\secyyy #1{\numhead1{#1}} % normally calls seczzz
+\def\seczzz #1{%
+\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
+\gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}%
+ {\the\chapno}{\the\secno}}}%
+\temp
+\donoderef
+\nobreak
+}
+
+\outer\def\appendixsection{\parsearg\appendixsecyyy}
+\outer\def\appendixsec{\parsearg\appendixsecyyy}
+\def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz
+\def\appendixsectionzzz #1{%
+\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
+\gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}%
+ {\appendixletter}{\the\secno}}}%
+\temp
+\appendixnoderef
+\nobreak
+}
+
+\outer\def\unnumberedsec{\parsearg\unnumberedsecyyy}
+\def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz
+\def\unnumberedseczzz #1{%
+\plainsecheading {#1}\gdef\thissection{#1}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsecentry{\the\toks0}}}%
+\temp
+\unnumbnoderef
+\nobreak
+}
+
+% Subsections.
+\outer\def\numberedsubsec{\parsearg\numberedsubsecyyy}
+\def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz
+\def\numberedsubseczzz #1{%
+\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
+\subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}%
+ {\the\chapno}{\the\secno}{\the\subsecno}}}%
+\temp
+\donoderef
+\nobreak
+}
+
+\outer\def\appendixsubsec{\parsearg\appendixsubsecyyy}
+\def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz
+\def\appendixsubseczzz #1{%
+\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
+\subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}%
+ {\appendixletter}{\the\secno}{\the\subsecno}}}%
+\temp
+\appendixnoderef
+\nobreak
+}
+
+\outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy}
+\def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz
+\def\unnumberedsubseczzz #1{%
+\plainsubsecheading {#1}\gdef\thissection{#1}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsecentry%
+ {\the\toks0}}}%
+\temp
+\unnumbnoderef
+\nobreak
+}
+
+% Subsubsections.
+\outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy}
+\def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz
+\def\numberedsubsubseczzz #1{%
+\gdef\thissection{#1}\global\advance \subsubsecno by 1 %
+\subsubsecheading {#1}
+ {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}%
+ {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}%
+\temp
+\donoderef
+\nobreak
+}
+
+\outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy}
+\def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz
+\def\appendixsubsubseczzz #1{%
+\gdef\thissection{#1}\global\advance \subsubsecno by 1 %
+\subsubsecheading {#1}
+ {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}%
+ {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}%
+\temp
+\appendixnoderef
+\nobreak
+}
+
+\outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy}
+\def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz
+\def\unnumberedsubsubseczzz #1{%
+\plainsubsubsecheading {#1}\gdef\thissection{#1}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsubsecentry%
+ {\the\toks0}}}%
+\temp
+\unnumbnoderef
+\nobreak
+}
+
+% These are variants which are not "outer", so they can appear in @ifinfo.
+% Actually, they should now be obsolete; ordinary section commands should work.
+\def\infotop{\parsearg\unnumberedzzz}
+\def\infounnumbered{\parsearg\unnumberedzzz}
+\def\infounnumberedsec{\parsearg\unnumberedseczzz}
+\def\infounnumberedsubsec{\parsearg\unnumberedsubseczzz}
+\def\infounnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz}
+
+\def\infoappendix{\parsearg\appendixzzz}
+\def\infoappendixsec{\parsearg\appendixseczzz}
+\def\infoappendixsubsec{\parsearg\appendixsubseczzz}
+\def\infoappendixsubsubsec{\parsearg\appendixsubsubseczzz}
+
+\def\infochapter{\parsearg\chapterzzz}
+\def\infosection{\parsearg\sectionzzz}
+\def\infosubsection{\parsearg\subsectionzzz}
+\def\infosubsubsection{\parsearg\subsubsectionzzz}
+
+% These macros control what the section commands do, according
+% to what kind of chapter we are in (ordinary, appendix, or unnumbered).
+% Define them by default for a numbered chapter.
+\global\let\section = \numberedsec
+\global\let\subsection = \numberedsubsec
+\global\let\subsubsection = \numberedsubsubsec
+
+% Define @majorheading, @heading and @subheading
+
+% NOTE on use of \vbox for chapter headings, section headings, and such:
+% 1) We use \vbox rather than the earlier \line to permit
+% overlong headings to fold.
+% 2) \hyphenpenalty is set to 10000 because hyphenation in a
+% heading is obnoxious; this forbids it.
+% 3) Likewise, headings look best if no \parindent is used, and
+% if justification is not attempted. Hence \raggedright.
+
+
+\def\majorheading{\parsearg\majorheadingzzz}
+\def\majorheadingzzz #1{%
+{\advance\chapheadingskip by 10pt \chapbreak }%
+{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
+ \parindent=0pt\raggedright
+ \rm #1\hfill}}\bigskip \par\penalty 200}
+
+\def\chapheading{\parsearg\chapheadingzzz}
+\def\chapheadingzzz #1{\chapbreak %
+{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
+ \parindent=0pt\raggedright
+ \rm #1\hfill}}\bigskip \par\penalty 200}
+
+% @heading, @subheading, @subsubheading.
+\def\heading{\parsearg\plainsecheading}
+\def\subheading{\parsearg\plainsubsecheading}
+\def\subsubheading{\parsearg\plainsubsubsecheading}
+
+% These macros generate a chapter, section, etc. heading only
+% (including whitespace, linebreaking, etc. around it),
+% given all the information in convenient, parsed form.
+
+%%% Args are the skip and penalty (usually negative)
+\def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
+
+\def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
+
+%%% Define plain chapter starts, and page on/off switching for it
+% Parameter controlling skip before chapter headings (if needed)
+
+\newskip\chapheadingskip
+
+\def\chapbreak{\dobreak \chapheadingskip {-4000}}
+\def\chappager{\par\vfill\supereject}
+\def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\fi}
+
+\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
+
+\def\CHAPPAGoff{%
+\global\let\contentsalignmacro = \chappager
+\global\let\pchapsepmacro=\chapbreak
+\global\let\pagealignmacro=\chappager}
+
+\def\CHAPPAGon{%
+\global\let\contentsalignmacro = \chappager
+\global\let\pchapsepmacro=\chappager
+\global\let\pagealignmacro=\chappager
+\global\def\HEADINGSon{\HEADINGSsingle}}
+
+\def\CHAPPAGodd{
+\global\let\contentsalignmacro = \chapoddpage
+\global\let\pchapsepmacro=\chapoddpage
+\global\let\pagealignmacro=\chapoddpage
+\global\def\HEADINGSon{\HEADINGSdouble}}
+
+\CHAPPAGon
+
+\def\CHAPFplain{
+\global\let\chapmacro=\chfplain
+\global\let\unnumbchapmacro=\unnchfplain
+\global\let\centerchapmacro=\centerchfplain}
+
+% Plain chapter opening.
+% #1 is the text, #2 the chapter number or empty if unnumbered.
+\def\chfplain#1#2{%
+ \pchapsepmacro
+ {%
+ \chapfonts \rm
+ \def\chapnum{#2}%
+ \setbox0 = \hbox{#2\ifx\chapnum\empty\else\enspace\fi}%
+ \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
+ \hangindent = \wd0 \centerparametersmaybe
+ \unhbox0 #1\par}%
+ }%
+ \nobreak\bigskip % no page break after a chapter title
+ \nobreak
+}
+
+% Plain opening for unnumbered.
+\def\unnchfplain#1{\chfplain{#1}{}}
+
+% @centerchap -- centered and unnumbered.
+\let\centerparametersmaybe = \relax
+\def\centerchfplain#1{{%
+ \def\centerparametersmaybe{%
+ \advance\rightskip by 3\rightskip
+ \leftskip = \rightskip
+ \parfillskip = 0pt
+ }%
+ \chfplain{#1}{}%
+}}
+
+\CHAPFplain % The default
+
+\def\unnchfopen #1{%
+\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
+ \parindent=0pt\raggedright
+ \rm #1\hfill}}\bigskip \par\nobreak
+}
+
+\def\chfopen #1#2{\chapoddpage {\chapfonts
+\vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
+\par\penalty 5000 %
+}
+
+\def\centerchfopen #1{%
+\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
+ \parindent=0pt
+ \hfill {\rm #1}\hfill}}\bigskip \par\nobreak
+}
+
+\def\CHAPFopen{
+\global\let\chapmacro=\chfopen
+\global\let\unnumbchapmacro=\unnchfopen
+\global\let\centerchapmacro=\centerchfopen}
+
+
+% Section titles.
+\newskip\secheadingskip
+\def\secheadingbreak{\dobreak \secheadingskip {-1000}}
+\def\secheading#1#2#3{\sectionheading{sec}{#2.#3}{#1}}
+\def\plainsecheading#1{\sectionheading{sec}{}{#1}}
+
+% Subsection titles.
+\newskip \subsecheadingskip
+\def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}}
+\def\subsecheading#1#2#3#4{\sectionheading{subsec}{#2.#3.#4}{#1}}
+\def\plainsubsecheading#1{\sectionheading{subsec}{}{#1}}
+
+% Subsubsection titles.
+\let\subsubsecheadingskip = \subsecheadingskip
+\let\subsubsecheadingbreak = \subsecheadingbreak
+\def\subsubsecheading#1#2#3#4#5{\sectionheading{subsubsec}{#2.#3.#4.#5}{#1}}
+\def\plainsubsubsecheading#1{\sectionheading{subsubsec}{}{#1}}
+
+
+% Print any size section title.
+%
+% #1 is the section type (sec/subsec/subsubsec), #2 is the section
+% number (maybe empty), #3 the text.
+\def\sectionheading#1#2#3{%
+ {%
+ \expandafter\advance\csname #1headingskip\endcsname by \parskip
+ \csname #1headingbreak\endcsname
+ }%
+ {%
+ % Switch to the right set of fonts.
+ \csname #1fonts\endcsname \rm
+ %
+ % Only insert the separating space if we have a section number.
+ \def\secnum{#2}%
+ \setbox0 = \hbox{#2\ifx\secnum\empty\else\enspace\fi}%
+ %
+ \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
+ \hangindent = \wd0 % zero if no section number
+ \unhbox0 #3}%
+ }%
+ \ifdim\parskip<10pt \nobreak\kern10pt\nobreak\kern-\parskip\fi \nobreak
+}
+
+
+\message{toc,}
+% Table of contents.
+\newwrite\tocfile
+
+% Write an entry to the toc file, opening it if necessary.
+% Called from @chapter, etc. We supply {\folio} at the end of the
+% argument, which will end up as the last argument to the \...entry macro.
+%
+% We open the .toc file here instead of at @setfilename or any other
+% given time so that @contents can be put in the document anywhere.
+%
+\newif\iftocfileopened
+\def\writetocentry#1{%
+ \iftocfileopened\else
+ \immediate\openout\tocfile = \jobname.toc
+ \global\tocfileopenedtrue
+ \fi
+ \iflinks \write\tocfile{#1{\folio}}\fi
+}
+
+\newskip\contentsrightmargin \contentsrightmargin=1in
+\newcount\savepageno
+\newcount\lastnegativepageno \lastnegativepageno = -1
+
+% Finish up the main text and prepare to read what we've written
+% to \tocfile.
+%
+\def\startcontents#1{%
+ % If @setchapternewpage on, and @headings double, the contents should
+ % start on an odd page, unlike chapters. Thus, we maintain
+ % \contentsalignmacro in parallel with \pagealignmacro.
+ % From: Torbjorn Granlund <tege@matematik.su.se>
+ \contentsalignmacro
+ \immediate\closeout\tocfile
+ %
+ % Don't need to put `Contents' or `Short Contents' in the headline.
+ % It is abundantly clear what they are.
+ \unnumbchapmacro{#1}\def\thischapter{}%
+ \savepageno = \pageno
+ \begingroup % Set up to handle contents files properly.
+ \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11
+ % We can't do this, because then an actual ^ in a section
+ % title fails, e.g., @chapter ^ -- exponentiation. --karl, 9jul97.
+ %\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi
+ \raggedbottom % Worry more about breakpoints than the bottom.
+ \advance\hsize by -\contentsrightmargin % Don't use the full line length.
+ %
+ % Roman numerals for page numbers.
+ \ifnum \pageno>0 \pageno = \lastnegativepageno \fi
+}
+
+
+% Normal (long) toc.
+\def\contents{%
+ \startcontents{\putwordTOC}%
+ \openin 1 \jobname.toc
+ \ifeof 1 \else
+ \closein 1
+ \input \jobname.toc
+ \fi
+ \vfill \eject
+ \contentsalignmacro % in case @setchapternewpage odd is in effect
+ \pdfmakeoutlines
+ \endgroup
+ \lastnegativepageno = \pageno
+ \pageno = \savepageno
+}
+
+% And just the chapters.
+\def\summarycontents{%
+ \startcontents{\putwordShortTOC}%
+ %
+ \let\chapentry = \shortchapentry
+ \let\unnumbchapentry = \shortunnumberedentry
+ % We want a true roman here for the page numbers.
+ \secfonts
+ \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl
+ \rm
+ \hyphenpenalty = 10000
+ \advance\baselineskip by 1pt % Open it up a little.
+ \def\secentry ##1##2##3##4{}
+ \def\unnumbsecentry ##1##2{}
+ \def\subsecentry ##1##2##3##4##5{}
+ \def\unnumbsubsecentry ##1##2{}
+ \def\subsubsecentry ##1##2##3##4##5##6{}
+ \def\unnumbsubsubsecentry ##1##2{}
+ \openin 1 \jobname.toc
+ \ifeof 1 \else
+ \closein 1
+ \input \jobname.toc
+ \fi
+ \vfill \eject
+ \contentsalignmacro % in case @setchapternewpage odd is in effect
+ \endgroup
+ \lastnegativepageno = \pageno
+ \pageno = \savepageno
+}
+\let\shortcontents = \summarycontents
+
+\ifpdf
+ \pdfcatalog{/PageMode /UseOutlines}%
+\fi
+
+% These macros generate individual entries in the table of contents.
+% The first argument is the chapter or section name.
+% The last argument is the page number.
+% The arguments in between are the chapter number, section number, ...
+
+% Chapter-level things, for both the long and short contents.
+\def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}}
+
+% See comments in \dochapentry re vbox and related settings
+\def\shortchapentry#1#2#3{%
+ \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#3\egroup}%
+}
+
+% Typeset the label for a chapter or appendix for the short contents.
+% The arg is, e.g. `Appendix A' for an appendix, or `3' for a chapter.
+% We could simplify the code here by writing out an \appendixentry
+% command in the toc file for appendices, instead of using \chapentry
+% for both, but it doesn't seem worth it.
+%
+\newdimen\shortappendixwidth
+%
+\def\shortchaplabel#1{%
+ % Compute width of word "Appendix", may change with language.
+ \setbox0 = \hbox{\shortcontrm \putwordAppendix}%
+ \shortappendixwidth = \wd0
+ %
+ % We typeset #1 in a box of constant width, regardless of the text of
+ % #1, so the chapter titles will come out aligned.
+ \setbox0 = \hbox{#1}%
+ \dimen0 = \ifdim\wd0 > \shortappendixwidth \shortappendixwidth \else 0pt \fi
+ %
+ % This space should be plenty, since a single number is .5em, and the
+ % widest letter (M) is 1em, at least in the Computer Modern fonts.
+ % (This space doesn't include the extra space that gets added after
+ % the label; that gets put in by \shortchapentry above.)
+ \advance\dimen0 by 1.1em
+ \hbox to \dimen0{#1\hfil}%
+}
+
+\def\unnumbchapentry#1#2{\dochapentry{#1}{#2}}
+\def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno\bgroup#2\egroup}}
+
+% Sections.
+\def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}}
+\def\unnumbsecentry#1#2{\dosecentry{#1}{#2}}
+
+% Subsections.
+\def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.#3.#4\labelspace#1}{#5}}
+\def\unnumbsubsecentry#1#2{\dosubsecentry{#1}{#2}}
+
+% And subsubsections.
+\def\subsubsecentry#1#2#3#4#5#6{%
+ \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}}
+\def\unnumbsubsubsecentry#1#2{\dosubsubsecentry{#1}{#2}}
+
+% This parameter controls the indentation of the various levels.
+\newdimen\tocindent \tocindent = 3pc
+
+% Now for the actual typesetting. In all these, #1 is the text and #2 is the
+% page number.
+%
+% If the toc has to be broken over pages, we want it to be at chapters
+% if at all possible; hence the \penalty.
+\def\dochapentry#1#2{%
+ \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
+ \begingroup
+ \chapentryfonts
+ \tocentry{#1}{\dopageno\bgroup#2\egroup}%
+ \endgroup
+ \nobreak\vskip .25\baselineskip plus.1\baselineskip
+}
+
+\def\dosecentry#1#2{\begingroup
+ \secentryfonts \leftskip=\tocindent
+ \tocentry{#1}{\dopageno\bgroup#2\egroup}%
+\endgroup}
+
+\def\dosubsecentry#1#2{\begingroup
+ \subsecentryfonts \leftskip=2\tocindent
+ \tocentry{#1}{\dopageno\bgroup#2\egroup}%
+\endgroup}
+
+\def\dosubsubsecentry#1#2{\begingroup
+ \subsubsecentryfonts \leftskip=3\tocindent
+ \tocentry{#1}{\dopageno\bgroup#2\egroup}%
+\endgroup}
+
+% Final typesetting of a toc entry; we use the same \entry macro as for
+% the index entries, but we want to suppress hyphenation here. (We
+% can't do that in the \entry macro, since index entries might consist
+% of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.)
+\def\tocentry#1#2{\begingroup
+ \vskip 0pt plus1pt % allow a little stretch for the sake of nice page breaks
+ % Do not use \turnoffactive in these arguments. Since the toc is
+ % typeset in cmr, so characters such as _ would come out wrong; we
+ % have to do the usual translation tricks.
+ \entry{#1}{#2}%
+\endgroup}
+
+% Space between chapter (or whatever) number and the title.
+\def\labelspace{\hskip1em \relax}
+
+\def\dopageno#1{{\rm #1}}
+\def\doshortpageno#1{{\rm #1}}
+
+\def\chapentryfonts{\secfonts \rm}
+\def\secentryfonts{\textfonts}
+\let\subsecentryfonts = \textfonts
+\let\subsubsecentryfonts = \textfonts
+
+
+\message{environments,}
+% @foo ... @end foo.
+
+% Since these characters are used in examples, it should be an even number of
+% \tt widths. Each \tt character is 1en, so two makes it 1em.
+% Furthermore, these definitions must come after we define our fonts.
+\newbox\dblarrowbox \newbox\longdblarrowbox
+\newbox\pushcharbox \newbox\bullbox
+\newbox\equivbox \newbox\errorbox
+
+%{\tentt
+%\global\setbox\dblarrowbox = \hbox to 1em{\hfil$\Rightarrow$\hfil}
+%\global\setbox\longdblarrowbox = \hbox to 1em{\hfil$\mapsto$\hfil}
+%\global\setbox\pushcharbox = \hbox to 1em{\hfil$\dashv$\hfil}
+%\global\setbox\equivbox = \hbox to 1em{\hfil$\ptexequiv$\hfil}
+% Adapted from the manmac format (p.420 of TeXbook)
+%\global\setbox\bullbox = \hbox to 1em{\kern.15em\vrule height .75ex width .85ex
+% depth .1ex\hfil}
+%}
+
+% @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
+\def\point{$\star$}
+\def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
+\def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}}
+\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
+\def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}}
+
+% Adapted from the TeXbook's \boxit.
+{\tentt \global\dimen0 = 3em}% Width of the box.
+\dimen2 = .55pt % Thickness of rules
+% The text. (`r' is open on the right, `e' somewhat less so on the left.)
+\setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt}
+
+\global\setbox\errorbox=\hbox to \dimen0{\hfil
+ \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
+ \advance\hsize by -2\dimen2 % Rules.
+ \vbox{
+ \hrule height\dimen2
+ \hbox{\vrule width\dimen2 \kern3pt % Space to left of text.
+ \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
+ \kern3pt\vrule width\dimen2}% Space to right.
+ \hrule height\dimen2}
+ \hfil}
+
+% The @error{} command.
+\def\error{\leavevmode\lower.7ex\copy\errorbox}
+
+% @tex ... @end tex escapes into raw Tex temporarily.
+% One exception: @ is still an escape character, so that @end tex works.
+% But \@ or @@ will get a plain tex @ character.
+
+\def\tex{\begingroup
+ \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
+ \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
+ \catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie
+ \catcode `\%=14
+ \catcode 43=12 % plus
+ \catcode`\"=12
+ \catcode`\==12
+ \catcode`\|=12
+ \catcode`\<=12
+ \catcode`\>=12
+ \escapechar=`\\
+ %
+ \let\b=\ptexb
+ \let\bullet=\ptexbullet
+ \let\c=\ptexc
+ \let\,=\ptexcomma
+ \let\.=\ptexdot
+ \let\dots=\ptexdots
+ \let\equiv=\ptexequiv
+ \let\!=\ptexexclam
+ \let\i=\ptexi
+ \let\{=\ptexlbrace
+ \let\+=\tabalign
+ \let\}=\ptexrbrace
+ \let\*=\ptexstar
+ \let\t=\ptext
+ %
+ \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
+ \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
+ \def\@{@}%
+\let\Etex=\endgroup}
+
+% Define @lisp ... @endlisp.
+% @lisp does a \begingroup so it can rebind things,
+% including the definition of @endlisp (which normally is erroneous).
+
+% Amount to narrow the margins by for @lisp.
+\newskip\lispnarrowing \lispnarrowing=0.4in
+
+% This is the definition that ^^M gets inside @lisp, @example, and other
+% such environments. \null is better than a space, since it doesn't
+% have any width.
+\def\lisppar{\null\endgraf}
+
+% Make each space character in the input produce a normal interword
+% space in the output. Don't allow a line break at this space, as this
+% is used only in environments like @example, where each line of input
+% should produce a line of output anyway.
+%
+{\obeyspaces %
+\gdef\sepspaces{\obeyspaces\let =\tie}}
+
+% Define \obeyedspace to be our active space, whatever it is. This is
+% for use in \parsearg.
+{\sepspaces%
+\global\let\obeyedspace= }
+
+% This space is always present above and below environments.
+\newskip\envskipamount \envskipamount = 0pt
+
+% Make spacing and below environment symmetrical. We use \parskip here
+% to help in doing that, since in @example-like environments \parskip
+% is reset to zero; thus the \afterenvbreak inserts no space -- but the
+% start of the next paragraph will insert \parskip
+%
+\def\aboveenvbreak{{\advance\envskipamount by \parskip
+\endgraf \ifdim\lastskip<\envskipamount
+\removelastskip \penalty-50 \vskip\envskipamount \fi}}
+
+\let\afterenvbreak = \aboveenvbreak
+
+% \nonarrowing is a flag. If "set", @lisp etc don't narrow margins.
+\let\nonarrowing=\relax
+
+% @cartouche ... @end cartouche: draw rectangle w/rounded corners around
+% environment contents.
+\font\circle=lcircle10
+\newdimen\circthick
+\newdimen\cartouter\newdimen\cartinner
+\newskip\normbskip\newskip\normpskip\newskip\normlskip
+\circthick=\fontdimen8\circle
+%
+\def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
+\def\ctr{{\hskip 6pt\circle\char'010}}
+\def\cbl{{\circle\char'012\hskip -6pt}}
+\def\cbr{{\hskip 6pt\circle\char'011}}
+\def\carttop{\hbox to \cartouter{\hskip\lskip
+ \ctl\leaders\hrule height\circthick\hfil\ctr
+ \hskip\rskip}}
+\def\cartbot{\hbox to \cartouter{\hskip\lskip
+ \cbl\leaders\hrule height\circthick\hfil\cbr
+ \hskip\rskip}}
+%
+\newskip\lskip\newskip\rskip
+
+\long\def\cartouche{%
+\begingroup
+ \lskip=\leftskip \rskip=\rightskip
+ \leftskip=0pt\rightskip=0pt %we want these *outside*.
+ \cartinner=\hsize \advance\cartinner by-\lskip
+ \advance\cartinner by-\rskip
+ \cartouter=\hsize
+ \advance\cartouter by 18.4pt % allow for 3pt kerns on either
+% side, and for 6pt waste from
+% each corner char, and rule thickness
+ \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
+ % Flag to tell @lisp, etc., not to narrow margin.
+ \let\nonarrowing=\comment
+ \vbox\bgroup
+ \baselineskip=0pt\parskip=0pt\lineskip=0pt
+ \carttop
+ \hbox\bgroup
+ \hskip\lskip
+ \vrule\kern3pt
+ \vbox\bgroup
+ \hsize=\cartinner
+ \kern3pt
+ \begingroup
+ \baselineskip=\normbskip
+ \lineskip=\normlskip
+ \parskip=\normpskip
+ \vskip -\parskip
+\def\Ecartouche{%
+ \endgroup
+ \kern3pt
+ \egroup
+ \kern3pt\vrule
+ \hskip\rskip
+ \egroup
+ \cartbot
+ \egroup
+\endgroup
+}}
+
+
+% This macro is called at the beginning of all the @example variants,
+% inside a group.
+\def\nonfillstart{%
+ \aboveenvbreak
+ \inENV % This group ends at the end of the body
+ \hfuzz = 12pt % Don't be fussy
+ \sepspaces % Make spaces be word-separators rather than space tokens.
+ \singlespace
+ \let\par = \lisppar % don't ignore blank lines
+ \obeylines % each line of input is a line of output
+ \parskip = 0pt
+ \parindent = 0pt
+ \emergencystretch = 0pt % don't try to avoid overfull boxes
+ % @cartouche defines \nonarrowing to inhibit narrowing
+ % at next level down.
+ \ifx\nonarrowing\relax
+ \advance \leftskip by \lispnarrowing
+ \exdentamount=\lispnarrowing
+ \let\exdent=\nofillexdent
+ \let\nonarrowing=\relax
+ \fi
+}
+
+% Define the \E... control sequence only if we are inside the particular
+% environment, so the error checking in \end will work.
+%
+% To end an @example-like environment, we first end the paragraph (via
+% \afterenvbreak's vertical glue), and then the group. That way we keep
+% the zero \parskip that the environments set -- \parskip glue will be
+% inserted at the beginning of the next paragraph in the document, after
+% the environment.
+%
+\def\nonfillfinish{\afterenvbreak\endgroup}
+
+% @lisp: indented, narrowed, typewriter font.
+\def\lisp{\begingroup
+ \nonfillstart
+ \let\Elisp = \nonfillfinish
+ \tt
+ \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
+ \gobble % eat return
+}
+
+% @example: Same as @lisp.
+\def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp}
+
+% @small... is usually equivalent to the non-small (@smallbook
+% redefines). We must call \example (or whatever) last in the
+% definition, since it reads the return following the @example (or
+% whatever) command.
+%
+% This actually allows (for example) @end display inside an
+% @smalldisplay. Too bad, but makeinfo will catch the error anyway.
+%
+\def\smalldisplay{\begingroup\def\Esmalldisplay{\nonfillfinish\endgroup}\display}
+\def\smallexample{\begingroup\def\Esmallexample{\nonfillfinish\endgroup}\lisp}
+\def\smallformat{\begingroup\def\Esmallformat{\nonfillfinish\endgroup}\format}
+\def\smalllisp{\begingroup\def\Esmalllisp{\nonfillfinish\endgroup}\lisp}
+
+% Real @smallexample and @smalllisp (when @smallbook): use smaller fonts.
+% Originally contributed by Pavel@xerox.
+\def\smalllispx{\begingroup
+ \def\Esmalllisp{\nonfillfinish\endgroup}%
+ \def\Esmallexample{\nonfillfinish\endgroup}%
+ \smallfonts
+ \lisp
+}
+
+% @display: same as @lisp except keep current font.
+%
+\def\display{\begingroup
+ \nonfillstart
+ \let\Edisplay = \nonfillfinish
+ \gobble
+}
+
+% @smalldisplay (when @smallbook): @display plus smaller fonts.
+%
+\def\smalldisplayx{\begingroup
+ \def\Esmalldisplay{\nonfillfinish\endgroup}%
+ \smallfonts \rm
+ \display
+}
+
+% @format: same as @display except don't narrow margins.
+%
+\def\format{\begingroup
+ \let\nonarrowing = t
+ \nonfillstart
+ \let\Eformat = \nonfillfinish
+ \gobble
+}
+
+% @smallformat (when @smallbook): @format plus smaller fonts.
+%
+\def\smallformatx{\begingroup
+ \def\Esmallformat{\nonfillfinish\endgroup}%
+ \smallfonts \rm
+ \format
+}
+
+% @flushleft (same as @format).
+%
+\def\flushleft{\begingroup \def\Eflushleft{\nonfillfinish\endgroup}\format}
+
+% @flushright.
+%
+\def\flushright{\begingroup
+ \let\nonarrowing = t
+ \nonfillstart
+ \let\Eflushright = \nonfillfinish
+ \advance\leftskip by 0pt plus 1fill
+ \gobble
+}
+
+
+% @quotation does normal linebreaking (hence we can't use \nonfillstart)
+% and narrows the margins.
+%
+\def\quotation{%
+ \begingroup\inENV %This group ends at the end of the @quotation body
+ {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
+ \singlespace
+ \parindent=0pt
+ % We have retained a nonzero parskip for the environment, since we're
+ % doing normal filling. So to avoid extra space below the environment...
+ \def\Equotation{\parskip = 0pt \nonfillfinish}%
+ %
+ % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
+ \ifx\nonarrowing\relax
+ \advance\leftskip by \lispnarrowing
+ \advance\rightskip by \lispnarrowing
+ \exdentamount = \lispnarrowing
+ \let\nonarrowing = \relax
+ \fi
+}
+
+
+% LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}
+% If we want to allow any <char> as delimiter,
+% we need the curly braces so that makeinfo sees the @verb command, eg:
+% `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org
+%
+% [Knuth]: Donald Ervin Knuth, 1996. The TeXbook.
+%
+% [Knuth] p. 344; only we need to do '@' too
+\def\dospecials{%
+ \do\ \do\\\do\@\do\{\do\}\do\$\do\&%
+ \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~}
+%
+% [Knuth] p. 380
+\def\uncatcodespecials{%
+ \def\do##1{\catcode`##1=12}\dospecials}
+%
+% [Knuth] pp. 380,381,391
+% Disable Spanish ligatures ?` and !` of \tt font
+\begingroup
+ \catcode`\`=\active\gdef`{\relax\lq}
+\endgroup
+%
+% Setup for the @verb command.
+%
+% Eight spaces for a tab
+\begingroup
+ \catcode`\^^I=\active
+ \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }}
+\endgroup
+%
+\def\setupverb{%
+ \tt % easiest (and conventionally used) font for verbatim
+ \def\par{\leavevmode\endgraf}%
+ \catcode`\`=\active
+ \tabeightspaces
+ % Respect line breaks,
+ % print special symbols as themselves, and
+ % make each space count
+ % must do in this order:
+ \obeylines \uncatcodespecials \sepspaces
+}
+
+% Setup for the @verbatim environment
+%
+% Real tab expansion
+\newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
+%
+\def\starttabbox{\setbox0=\hbox\bgroup}
+\begingroup
+ \catcode`\^^I=\active
+ \gdef\tabexpand{%
+ \catcode`\^^I=\active
+ \def^^I{\leavevmode\egroup
+ \dimen0=\wd0 % the width so far, or since the previous tab
+ \divide\dimen0 by\tabw
+ \multiply\dimen0 by\tabw % compute previous multiple of \tabw
+ \advance\dimen0 by\tabw % advance to next multiple of \tabw
+ \wd0=\dimen0 \box0 \starttabbox
+ }%
+ }
+\endgroup
+\def\setupverbatim{%
+ % Easiest (and conventionally used) font for verbatim
+ \tt
+ \def\par{\leavevmode\egroup\box0\endgraf}%
+ \catcode`\`=\active
+ \tabexpand
+ % Respect line breaks,
+ % print special symbols as themselves, and
+ % make each space count
+ % must do in this order:
+ \obeylines \uncatcodespecials \sepspaces
+ \everypar{\starttabbox}%
+}
+
+% Do the @verb magic: verbatim text is quoted by unique
+% delimiter characters. Before first delimiter expect a
+% right brace, after last delimiter expect closing brace:
+%
+% \def\doverb'{'<char>#1<char>'}'{#1}
+%
+% [Knuth] p. 382; only eat outer {}
+\begingroup
+ \catcode`[=1\catcode`]=2\catcode`\{=12\catcode`\}=12
+ \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next]
+\endgroup
+%
+\def\verb{\begingroup\setupverb\doverb}
+%
+%
+% Do the @verbatim magic: define the macro \doverbatim so that
+% the (first) argument ends when '@end verbatim' is reached, ie:
+%
+% \def\doverbatim#1@end verbatim{#1}
+%
+% For Texinfo it's a lot easier than for LaTeX,
+% because texinfo's \verbatim doesn't stop at '\end{verbatim}':
+% we need not redefine '\', '{' and '}'
+%
+% Inspired by LaTeX's verbatim command set [latex.ltx]
+%% Include LaTeX hack for completeness -- never know
+%% \begingroup
+%% \catcode`|=0 \catcode`[=1
+%% \catcode`]=2\catcode`\{=12\catcode`\}=12\catcode`\ =\active
+%% \catcode`\\=12|gdef|doverbatim#1@end verbatim[
+%% #1|endgroup|def|Everbatim[]|end[verbatim]]
+%% |endgroup
+\begingroup
+ \catcode`\ =\active
+ \gdef\doverbatim#1@end verbatim{#1\end{verbatim}}
+\endgroup
+%
+\def\verbatim{%
+ \def\Everbatim{\nonfillfinish\endgroup}%
+ \begingroup
+ \nonfillstart
+ \advance\leftskip by -\defbodyindent
+ \begingroup\setupverbatim\doverbatim
+}
+
+% @verbatiminclude FILE - insert text of file in verbatim environment.
+%
+% Allow normal characters that we make active in the argument (a file name).
+\def\verbatiminclude{%
+ \begingroup
+ \catcode`\\=12
+ \catcode`~=12
+ \catcode`^=12
+ \catcode`_=12
+ \catcode`|=12
+ \catcode`<=12
+ \catcode`>=12
+ \catcode`+=12
+ \parsearg\doverbatiminclude
+}
+\def\setupverbatiminclude{%
+ \begingroup
+ \nonfillstart
+ \advance\leftskip by -\defbodyindent
+ \begingroup\setupverbatim
+}
+%
+\def\doverbatiminclude#1{%
+ % Restore active chars for included file.
+ \endgroup
+ \begingroup
+ \def\thisfile{#1}%
+ \expandafter\expandafter\setupverbatiminclude\input\thisfile
+ \endgroup\nonfillfinish\endgroup
+}
+
+
+\message{defuns,}
+% @defun etc.
+
+% Allow user to change definition object font (\df) internally
+\def\setdeffont #1 {\csname DEF#1\endcsname}
+
+\newskip\defbodyindent \defbodyindent=.4in
+\newskip\defargsindent \defargsindent=50pt
+\newskip\deftypemargin \deftypemargin=12pt
+\newskip\deflastargmargin \deflastargmargin=18pt
+
+\newcount\parencount
+% define \functionparens, which makes ( and ) and & do special things.
+% \functionparens affects the group it is contained in.
+\def\activeparens{%
+\catcode`\(=\active \catcode`\)=\active \catcode`\&=\active
+\catcode`\[=\active \catcode`\]=\active}
+
+% Make control sequences which act like normal parenthesis chars.
+\let\lparen = ( \let\rparen = )
+
+{\activeparens % Now, smart parens don't turn on until &foo (see \amprm)
+
+% Be sure that we always have a definition for `(', etc. For example,
+% if the fn name has parens in it, \boldbrax will not be in effect yet,
+% so TeX would otherwise complain about undefined control sequence.
+\global\let(=\lparen \global\let)=\rparen
+\global\let[=\lbrack \global\let]=\rbrack
+
+\gdef\functionparens{\boldbrax\let&=\amprm\parencount=0 }
+\gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
+% This is used to turn on special parens
+% but make & act ordinary (given that it's active).
+\gdef\boldbraxnoamp{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb\let&=\ampnr}
+
+% Definitions of (, ) and & used in args for functions.
+% This is the definition of ( outside of all parentheses.
+\gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested
+ \global\advance\parencount by 1
+}
+%
+% This is the definition of ( when already inside a level of parens.
+\gdef\opnested{\char`\(\global\advance\parencount by 1 }
+%
+\gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0.
+ % also in that case restore the outer-level definition of (.
+ \ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi
+ \global\advance \parencount by -1 }
+% If we encounter &foo, then turn on ()-hacking afterwards
+\gdef\amprm#1 {{\rm\&#1}\let(=\oprm \let)=\clrm\ }
+%
+\gdef\normalparens{\boldbrax\let&=\ampnr}
+} % End of definition inside \activeparens
+%% These parens (in \boldbrax) actually are a little bolder than the
+%% contained text. This is especially needed for [ and ]
+\def\opnr{{\sf\char`\(}\global\advance\parencount by 1 }
+\def\clnr{{\sf\char`\)}\global\advance\parencount by -1 }
+\let\ampnr = \&
+\def\lbrb{{\bf\char`\[}}
+\def\rbrb{{\bf\char`\]}}
+
+% Active &'s sneak into the index arguments, so make sure it's defined.
+{
+ \catcode`& = 13
+ \global\let& = \ampnr
+}
+
+% First, defname, which formats the header line itself.
+% #1 should be the function name.
+% #2 should be the type of definition, such as "Function".
+
+\def\defname #1#2{%
+% Get the values of \leftskip and \rightskip as they were
+% outside the @def...
+\dimen2=\leftskip
+\advance\dimen2 by -\defbodyindent
+\noindent
+\setbox0=\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}%
+\dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line
+\dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuations
+\parshape 2 0in \dimen0 \defargsindent \dimen1
+% Now output arg 2 ("Function" or some such)
+% ending at \deftypemargin from the right margin,
+% but stuck inside a box of width 0 so it does not interfere with linebreaking
+{% Adjust \hsize to exclude the ambient margins,
+% so that \rightline will obey them.
+\advance \hsize by -\dimen2
+\rlap{\rightline{{\rm #2}\hskip -1.25pc }}}%
+% Make all lines underfull and no complaints:
+\tolerance=10000 \hbadness=10000
+\advance\leftskip by -\defbodyindent
+\exdentamount=\defbodyindent
+{\df #1}\enskip % Generate function name
+}
+
+% Actually process the body of a definition
+% #1 should be the terminating control sequence, such as \Edefun.
+% #2 should be the "another name" control sequence, such as \defunx.
+% #3 should be the control sequence that actually processes the header,
+% such as \defunheader.
+
+\def\defparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
+\medbreak %
+% Define the end token that this defining construct specifies
+% so that it will exit this group.
+\def#1{\endgraf\endgroup\medbreak}%
+\def#2{\begingroup\obeylines\activeparens\spacesplit#3}%
+\parindent=0in
+\advance\leftskip by \defbodyindent
+\exdentamount=\defbodyindent
+\begingroup %
+\catcode 61=\active % 61 is `='
+\obeylines\activeparens\spacesplit#3}
+
+% #1 is the \E... control sequence to end the definition (which we define).
+% #2 is the \...x control sequence for consecutive fns (which we define).
+% #3 is the control sequence to call to resume processing.
+% #4, delimited by the space, is the class name.
+%
+\def\defmethparsebody#1#2#3#4 {\begingroup\inENV %
+\medbreak %
+% Define the end token that this defining construct specifies
+% so that it will exit this group.
+\def#1{\endgraf\endgroup\medbreak}%
+\def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}%
+\parindent=0in
+\advance\leftskip by \defbodyindent
+\exdentamount=\defbodyindent
+\begingroup\obeylines\activeparens\spacesplit{#3{#4}}}
+
+% Used for @deftypemethod and @deftypeivar.
+% #1 is the \E... control sequence to end the definition (which we define).
+% #2 is the \...x control sequence for consecutive fns (which we define).
+% #3 is the control sequence to call to resume processing.
+% #4, delimited by a space, is the class name.
+% #5 is the method's return type.
+%
+\def\deftypemethparsebody#1#2#3#4 #5 {\begingroup\inENV
+ \medbreak
+ \def#1{\endgraf\endgroup\medbreak}%
+ \def#2##1 ##2 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}{##2}}}%
+ \parindent=0in
+ \advance\leftskip by \defbodyindent
+ \exdentamount=\defbodyindent
+ \begingroup\obeylines\activeparens\spacesplit{#3{#4}{#5}}}
+
+% Used for @deftypeop. The change from \deftypemethparsebody is an
+% extra argument at the beginning which is the `category', instead of it
+% being the hardwired string `Method' or `Instance Variable'. We have
+% to account for this both in the \...x definition and in parsing the
+% input at hand. Thus also need a control sequence (passed as #5) for
+% the \E... definition to assign the category name to.
+%
+\def\deftypeopparsebody#1#2#3#4#5 #6 {\begingroup\inENV
+ \medbreak
+ \def#1{\endgraf\endgroup\medbreak}%
+ \def#2##1 ##2 ##3 {%
+ \def#4{##1}%
+ \begingroup\obeylines\activeparens\spacesplit{#3{##2}{##3}}}%
+ \parindent=0in
+ \advance\leftskip by \defbodyindent
+ \exdentamount=\defbodyindent
+ \begingroup\obeylines\activeparens\spacesplit{#3{#5}{#6}}}
+
+\def\defopparsebody #1#2#3#4#5 {\begingroup\inENV %
+\medbreak %
+% Define the end token that this defining construct specifies
+% so that it will exit this group.
+\def#1{\endgraf\endgroup\medbreak}%
+\def#2##1 ##2 {\def#4{##1}%
+\begingroup\obeylines\activeparens\spacesplit{#3{##2}}}%
+\parindent=0in
+\advance\leftskip by \defbodyindent
+\exdentamount=\defbodyindent
+\begingroup\obeylines\activeparens\spacesplit{#3{#5}}}
+
+% These parsing functions are similar to the preceding ones
+% except that they do not make parens into active characters.
+% These are used for "variables" since they have no arguments.
+
+\def\defvarparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
+\medbreak %
+% Define the end token that this defining construct specifies
+% so that it will exit this group.
+\def#1{\endgraf\endgroup\medbreak}%
+\def#2{\begingroup\obeylines\spacesplit#3}%
+\parindent=0in
+\advance\leftskip by \defbodyindent
+\exdentamount=\defbodyindent
+\begingroup %
+\catcode 61=\active %
+\obeylines\spacesplit#3}
+
+% This is used for \def{tp,vr}parsebody. It could probably be used for
+% some of the others, too, with some judicious conditionals.
+%
+\def\parsebodycommon#1#2#3{%
+ \begingroup\inENV %
+ \medbreak %
+ % Define the end token that this defining construct specifies
+ % so that it will exit this group.
+ \def#1{\endgraf\endgroup\medbreak}%
+ \def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}%
+ \parindent=0in
+ \advance\leftskip by \defbodyindent
+ \exdentamount=\defbodyindent
+ \begingroup\obeylines
+}
+
+\def\defvrparsebody#1#2#3#4 {%
+ \parsebodycommon{#1}{#2}{#3}%
+ \spacesplit{#3{#4}}%
+}
+
+% This loses on `@deftp {Data Type} {struct termios}' -- it thinks the
+% type is just `struct', because we lose the braces in `{struct
+% termios}' when \spacesplit reads its undelimited argument. Sigh.
+% \let\deftpparsebody=\defvrparsebody
+%
+% So, to get around this, we put \empty in with the type name. That
+% way, TeX won't find exactly `{...}' as an undelimited argument, and
+% won't strip off the braces.
+%
+\def\deftpparsebody #1#2#3#4 {%
+ \parsebodycommon{#1}{#2}{#3}%
+ \spacesplit{\parsetpheaderline{#3{#4}}}\empty
+}
+
+% Fine, but then we have to eventually remove the \empty *and* the
+% braces (if any). That's what this does.
+%
+\def\removeemptybraces\empty#1\relax{#1}
+
+% After \spacesplit has done its work, this is called -- #1 is the final
+% thing to call, #2 the type name (which starts with \empty), and #3
+% (which might be empty) the arguments.
+%
+\def\parsetpheaderline#1#2#3{%
+ #1{\removeemptybraces#2\relax}{#3}%
+}%
+
+\def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV %
+\medbreak %
+% Define the end token that this defining construct specifies
+% so that it will exit this group.
+\def#1{\endgraf\endgroup\medbreak}%
+\def#2##1 ##2 {\def#4{##1}%
+\begingroup\obeylines\spacesplit{#3{##2}}}%
+\parindent=0in
+\advance\leftskip by \defbodyindent
+\exdentamount=\defbodyindent
+\begingroup\obeylines\spacesplit{#3{#5}}}
+
+% Split up #2 at the first space token.
+% call #1 with two arguments:
+% the first is all of #2 before the space token,
+% the second is all of #2 after that space token.
+% If #2 contains no space token, all of it is passed as the first arg
+% and the second is passed as empty.
+
+{\obeylines
+\gdef\spacesplit#1#2^^M{\endgroup\spacesplitfoo{#1}#2 \relax\spacesplitfoo}%
+\long\gdef\spacesplitfoo#1#2 #3#4\spacesplitfoo{%
+\ifx\relax #3%
+#1{#2}{}\else #1{#2}{#3#4}\fi}}
+
+% So much for the things common to all kinds of definitions.
+
+% Define @defun.
+
+% First, define the processing that is wanted for arguments of \defun
+% Use this to expand the args and terminate the paragraph they make up
+
+\def\defunargs#1{\functionparens \sl
+% Expand, preventing hyphenation at `-' chars.
+% Note that groups don't affect changes in \hyphenchar.
+% Set the font temporarily and use \font in case \setfont made \tensl a macro.
+{\tensl\hyphenchar\font=0}%
+#1%
+{\tensl\hyphenchar\font=45}%
+\ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi%
+\interlinepenalty=10000
+\advance\rightskip by 0pt plus 1fil
+\endgraf\nobreak\vskip -\parskip\nobreak
+}
+
+\def\deftypefunargs #1{%
+% Expand, preventing hyphenation at `-' chars.
+% Note that groups don't affect changes in \hyphenchar.
+% Use \boldbraxnoamp, not \functionparens, so that & is not special.
+\boldbraxnoamp
+\tclose{#1}% avoid \code because of side effects on active chars
+\interlinepenalty=10000
+\advance\rightskip by 0pt plus 1fil
+\endgraf\nobreak\vskip -\parskip\nobreak
+}
+
+% Do complete processing of one @defun or @defunx line already parsed.
+
+% @deffn Command forward-char nchars
+
+\def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader}
+
+\def\deffnheader #1#2#3{\doind {fn}{\code{#2}}%
+\begingroup\defname {#2}{#1}\defunargs{#3}\endgroup %
+\catcode 61=\other % Turn off change made in \defparsebody
+}
+
+% @defun == @deffn Function
+
+\def\defun{\defparsebody\Edefun\defunx\defunheader}
+
+\def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
+\begingroup\defname {#1}{\putwordDeffunc}%
+\defunargs {#2}\endgroup %
+\catcode 61=\other % Turn off change made in \defparsebody
+}
+
+% @deftypefun int foobar (int @var{foo}, float @var{bar})
+
+\def\deftypefun{\defparsebody\Edeftypefun\deftypefunx\deftypefunheader}
+
+% #1 is the data type. #2 is the name and args.
+\def\deftypefunheader #1#2{\deftypefunheaderx{#1}#2 \relax}
+% #1 is the data type, #2 the name, #3 the args.
+\def\deftypefunheaderx #1#2 #3\relax{%
+\doind {fn}{\code{#2}}% Make entry in function index
+\begingroup\defname {\defheaderxcond#1\relax$$$#2}{\putwordDeftypefun}%
+\deftypefunargs {#3}\endgroup %
+\catcode 61=\other % Turn off change made in \defparsebody
+}
+
+% @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar})
+
+\def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader}
+
+% \defheaderxcond#1\relax$$$
+% puts #1 in @code, followed by a space, but does nothing if #1 is null.
+\def\defheaderxcond#1#2$$${\ifx#1\relax\else\code{#1#2} \fi}
+
+% #1 is the classification. #2 is the data type. #3 is the name and args.
+\def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax}
+% #1 is the classification, #2 the data type, #3 the name, #4 the args.
+\def\deftypefnheaderx #1#2#3 #4\relax{%
+\doind {fn}{\code{#3}}% Make entry in function index
+\begingroup
+\normalparens % notably, turn off `&' magic, which prevents
+% at least some C++ text from working
+\defname {\defheaderxcond#2\relax$$$#3}{#1}%
+\deftypefunargs {#4}\endgroup %
+\catcode 61=\other % Turn off change made in \defparsebody
+}
+
+% @defmac == @deffn Macro
+
+\def\defmac{\defparsebody\Edefmac\defmacx\defmacheader}
+
+\def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
+\begingroup\defname {#1}{\putwordDefmac}%
+\defunargs {#2}\endgroup %
+\catcode 61=\other % Turn off change made in \defparsebody
+}
+
+% @defspec == @deffn Special Form
+
+\def\defspec{\defparsebody\Edefspec\defspecx\defspecheader}
+
+\def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
+\begingroup\defname {#1}{\putwordDefspec}%
+\defunargs {#2}\endgroup %
+\catcode 61=\other % Turn off change made in \defparsebody
+}
+
+% @defop CATEGORY CLASS OPERATION ARG...
+%
+\def\defop #1 {\def\defoptype{#1}%
+\defopparsebody\Edefop\defopx\defopheader\defoptype}
+%
+\def\defopheader#1#2#3{%
+\dosubind {fn}{\code{#2}}{\putwordon\ #1}% Make entry in function index
+\begingroup\defname {#2}{\defoptype\ \putwordon\ #1}%
+\defunargs {#3}\endgroup %
+}
+
+% @deftypeop CATEGORY CLASS TYPE OPERATION ARG...
+%
+\def\deftypeop #1 {\def\deftypeopcategory{#1}%
+ \deftypeopparsebody\Edeftypeop\deftypeopx\deftypeopheader
+ \deftypeopcategory}
+%
+% #1 is the class name, #2 the data type, #3 the operation name, #4 the args.
+\def\deftypeopheader#1#2#3#4{%
+ \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index
+ \begingroup
+ \defname{\defheaderxcond#2\relax$$$#3}
+ {\deftypeopcategory\ \putwordon\ \code{#1}}%
+ \deftypefunargs{#4}%
+ \endgroup
+}
+
+% @deftypemethod CLASS TYPE METHOD ARG...
+%
+\def\deftypemethod{%
+ \deftypemethparsebody\Edeftypemethod\deftypemethodx\deftypemethodheader}
+%
+% #1 is the class name, #2 the data type, #3 the method name, #4 the args.
+\def\deftypemethodheader#1#2#3#4{%
+ \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index
+ \begingroup
+ \defname{\defheaderxcond#2\relax$$$#3}{\putwordMethodon\ \code{#1}}%
+ \deftypefunargs{#4}%
+ \endgroup
+}
+
+% @deftypeivar CLASS TYPE VARNAME
+%
+\def\deftypeivar{%
+ \deftypemethparsebody\Edeftypeivar\deftypeivarx\deftypeivarheader}
+%
+% #1 is the class name, #2 the data type, #3 the variable name.
+\def\deftypeivarheader#1#2#3{%
+ \dosubind{vr}{\code{#3}}{\putwordof\ \code{#1}}% entry in variable index
+ \begingroup
+ \defname{\defheaderxcond#2\relax$$$#3}
+ {\putwordInstanceVariableof\ \code{#1}}%
+ \defvarargs{#3}%
+ \endgroup
+}
+
+% @defmethod == @defop Method
+%
+\def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader}
+%
+% #1 is the class name, #2 the method name, #3 the args.
+\def\defmethodheader#1#2#3{%
+ \dosubind{fn}{\code{#2}}{\putwordon\ \code{#1}}% entry in function index
+ \begingroup
+ \defname{#2}{\putwordMethodon\ \code{#1}}%
+ \defunargs{#3}%
+ \endgroup
+}
+
+% @defcv {Class Option} foo-class foo-flag
+
+\def\defcv #1 {\def\defcvtype{#1}%
+\defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}
+
+\def\defcvarheader #1#2#3{%
+\dosubind {vr}{\code{#2}}{\putwordof\ #1}% Make entry in var index
+\begingroup\defname {#2}{\defcvtype\ \putwordof\ #1}%
+\defvarargs {#3}\endgroup %
+}
+
+% @defivar CLASS VARNAME == @defcv {Instance Variable} CLASS VARNAME
+%
+\def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader}
+%
+\def\defivarheader#1#2#3{%
+ \dosubind {vr}{\code{#2}}{\putwordof\ #1}% entry in var index
+ \begingroup
+ \defname{#2}{\putwordInstanceVariableof\ #1}%
+ \defvarargs{#3}%
+ \endgroup
+}
+
+% @defvar
+% First, define the processing that is wanted for arguments of @defvar.
+% This is actually simple: just print them in roman.
+% This must expand the args and terminate the paragraph they make up
+\def\defvarargs #1{\normalparens #1%
+\interlinepenalty=10000
+\endgraf\nobreak\vskip -\parskip\nobreak}
+
+% @defvr Counter foo-count
+
+\def\defvr{\defvrparsebody\Edefvr\defvrx\defvrheader}
+
+\def\defvrheader #1#2#3{\doind {vr}{\code{#2}}%
+\begingroup\defname {#2}{#1}\defvarargs{#3}\endgroup}
+
+% @defvar == @defvr Variable
+
+\def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader}
+
+\def\defvarheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
+\begingroup\defname {#1}{\putwordDefvar}%
+\defvarargs {#2}\endgroup %
+}
+
+% @defopt == @defvr {User Option}
+
+\def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader}
+
+\def\defoptheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
+\begingroup\defname {#1}{\putwordDefopt}%
+\defvarargs {#2}\endgroup %
+}
+
+% @deftypevar int foobar
+
+\def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader}
+
+% #1 is the data type. #2 is the name, perhaps followed by text that
+% is actually part of the data type, which should not be put into the index.
+\def\deftypevarheader #1#2{%
+\dovarind#2 \relax% Make entry in variables index
+\begingroup\defname {\defheaderxcond#1\relax$$$#2}{\putwordDeftypevar}%
+\interlinepenalty=10000
+\endgraf\nobreak\vskip -\parskip\nobreak
+\endgroup}
+\def\dovarind#1 #2\relax{\doind{vr}{\code{#1}}}
+
+% @deftypevr {Global Flag} int enable
+
+\def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader}
+
+\def\deftypevrheader #1#2#3{\dovarind#3 \relax%
+\begingroup\defname {\defheaderxcond#2\relax$$$#3}{#1}
+\interlinepenalty=10000
+\endgraf\nobreak\vskip -\parskip\nobreak
+\endgroup}
+
+% Now define @deftp
+% Args are printed in bold, a slight difference from @defvar.
+
+\def\deftpargs #1{\bf \defvarargs{#1}}
+
+% @deftp Class window height width ...
+
+\def\deftp{\deftpparsebody\Edeftp\deftpx\deftpheader}
+
+\def\deftpheader #1#2#3{\doind {tp}{\code{#2}}%
+\begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup}
+
+% These definitions are used if you use @defunx (etc.)
+% anywhere other than immediately after a @defun or @defunx.
+%
+\def\defcvx#1 {\errmessage{@defcvx in invalid context}}
+\def\deffnx#1 {\errmessage{@deffnx in invalid context}}
+\def\defivarx#1 {\errmessage{@defivarx in invalid context}}
+\def\defmacx#1 {\errmessage{@defmacx in invalid context}}
+\def\defmethodx#1 {\errmessage{@defmethodx in invalid context}}
+\def\defoptx #1 {\errmessage{@defoptx in invalid context}}
+\def\defopx#1 {\errmessage{@defopx in invalid context}}
+\def\defspecx#1 {\errmessage{@defspecx in invalid context}}
+\def\deftpx#1 {\errmessage{@deftpx in invalid context}}
+\def\deftypefnx#1 {\errmessage{@deftypefnx in invalid context}}
+\def\deftypefunx#1 {\errmessage{@deftypefunx in invalid context}}
+\def\deftypeivarx#1 {\errmessage{@deftypeivarx in invalid context}}
+\def\deftypemethodx#1 {\errmessage{@deftypemethodx in invalid context}}
+\def\deftypeopx#1 {\errmessage{@deftypeopx in invalid context}}
+\def\deftypevarx#1 {\errmessage{@deftypevarx in invalid context}}
+\def\deftypevrx#1 {\errmessage{@deftypevrx in invalid context}}
+\def\defunx#1 {\errmessage{@defunx in invalid context}}
+\def\defvarx#1 {\errmessage{@defvarx in invalid context}}
+\def\defvrx#1 {\errmessage{@defvrx in invalid context}}
+
+
+\message{macros,}
+% @macro.
+
+% To do this right we need a feature of e-TeX, \scantokens,
+% which we arrange to emulate with a temporary file in ordinary TeX.
+\ifx\eTeXversion\undefined
+ \newwrite\macscribble
+ \def\scanmacro#1{%
+ \begingroup \newlinechar`\^^M
+ % Undo catcode changes of \startcontents and \doprintindex
+ \catcode`\@=0 \catcode`\\=12 \escapechar=`\@
+ % Append \endinput to make sure that TeX does not see the ending newline.
+ \toks0={#1\endinput}%
+ \immediate\openout\macscribble=\jobname.tmp
+ \immediate\write\macscribble{\the\toks0}%
+ \immediate\closeout\macscribble
+ \let\xeatspaces\eatspaces
+ \input \jobname.tmp
+ \endgroup
+}
+\else
+\def\scanmacro#1{%
+\begingroup \newlinechar`\^^M
+% Undo catcode changes of \startcontents and \doprintindex
+\catcode`\@=0 \catcode`\\=12 \escapechar=`\@
+\let\xeatspaces\eatspaces\scantokens{#1\endinput}\endgroup}
+\fi
+
+\newcount\paramno % Count of parameters
+\newtoks\macname % Macro name
+\newif\ifrecursive % Is it recursive?
+\def\macrolist{} % List of all defined macros in the form
+ % \do\macro1\do\macro2...
+
+% Utility routines.
+% Thisdoes \let #1 = #2, except with \csnames.
+\def\cslet#1#2{%
+\expandafter\expandafter
+\expandafter\let
+\expandafter\expandafter
+\csname#1\endcsname
+\csname#2\endcsname}
+
+% Trim leading and trailing spaces off a string.
+% Concepts from aro-bend problem 15 (see CTAN).
+{\catcode`\@=11
+\gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }}
+\gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@}
+\gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @}
+\def\unbrace#1{#1}
+\unbrace{\gdef\trim@@@ #1 } #2@{#1}
+}
+
+% Trim a single trailing ^^M off a string.
+{\catcode`\^^M=12\catcode`\Q=3%
+\gdef\eatcr #1{\eatcra #1Q^^MQ}%
+\gdef\eatcra#1^^MQ{\eatcrb#1Q}%
+\gdef\eatcrb#1Q#2Q{#1}%
+}
+
+% Macro bodies are absorbed as an argument in a context where
+% all characters are catcode 10, 11 or 12, except \ which is active
+% (as in normal texinfo). It is necessary to change the definition of \.
+
+% It's necessary to have hard CRs when the macro is executed. This is
+% done by making ^^M (\endlinechar) catcode 12 when reading the macro
+% body, and then making it the \newlinechar in \scanmacro.
+
+\def\macrobodyctxt{%
+ \catcode`\~=12
+ \catcode`\^=12
+ \catcode`\_=12
+ \catcode`\|=12
+ \catcode`\<=12
+ \catcode`\>=12
+ \catcode`\+=12
+ \catcode`\{=12
+ \catcode`\}=12
+ \catcode`\@=12
+ \catcode`\^^M=12
+ \usembodybackslash}
+
+\def\macroargctxt{%
+ \catcode`\~=12
+ \catcode`\^=12
+ \catcode`\_=12
+ \catcode`\|=12
+ \catcode`\<=12
+ \catcode`\>=12
+ \catcode`\+=12
+ \catcode`\@=12
+ \catcode`\\=12}
+
+% \mbodybackslash is the definition of \ in @macro bodies.
+% It maps \foo\ => \csname macarg.foo\endcsname => #N
+% where N is the macro parameter number.
+% We define \csname macarg.\endcsname to be \realbackslash, so
+% \\ in macro replacement text gets you a backslash.
+
+{\catcode`@=0 @catcode`@\=@active
+ @gdef@usembodybackslash{@let\=@mbodybackslash}
+ @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
+}
+\expandafter\def\csname macarg.\endcsname{\realbackslash}
+
+\def\macro{\recursivefalse\parsearg\macroxxx}
+\def\rmacro{\recursivetrue\parsearg\macroxxx}
+
+\def\macroxxx#1{%
+ \getargs{#1}% now \macname is the macname and \argl the arglist
+ \ifx\argl\empty % no arguments
+ \paramno=0%
+ \else
+ \expandafter\parsemargdef \argl;%
+ \fi
+ \if1\csname ismacro.\the\macname\endcsname
+ \message{Warning: redefining \the\macname}%
+ \else
+ \expandafter\ifx\csname \the\macname\endcsname \relax
+ \else \errmessage{The name \the\macname\space is reserved}\fi
+ \global\cslet{macsave.\the\macname}{\the\macname}%
+ \global\expandafter\let\csname ismacro.\the\macname\endcsname=1%
+ % Add the macroname to \macrolist
+ \toks0 = \expandafter{\macrolist\do}%
+ \xdef\macrolist{\the\toks0
+ \expandafter\noexpand\csname\the\macname\endcsname}%
+ \fi
+ \begingroup \macrobodyctxt
+ \ifrecursive \expandafter\parsermacbody
+ \else \expandafter\parsemacbody
+ \fi}
+
+\def\unmacro{\parsearg\unmacroxxx}
+\def\unmacroxxx#1{%
+ \if1\csname ismacro.#1\endcsname
+ \global\cslet{#1}{macsave.#1}%
+ \global\expandafter\let \csname ismacro.#1\endcsname=0%
+ % Remove the macro name from \macrolist
+ \begingroup
+ \edef\tempa{\expandafter\noexpand\csname#1\endcsname}%
+ \def\do##1{%
+ \def\tempb{##1}%
+ \ifx\tempa\tempb
+ % remove this
+ \else
+ \toks0 = \expandafter{\newmacrolist\do}%
+ \edef\newmacrolist{\the\toks0\expandafter\noexpand\tempa}%
+ \fi}%
+ \def\newmacrolist{}%
+ % Execute macro list to define \newmacrolist
+ \macrolist
+ \global\let\macrolist\newmacrolist
+ \endgroup
+ \else
+ \errmessage{Macro #1 not defined}%
+ \fi
+}
+
+% This makes use of the obscure feature that if the last token of a
+% <parameter list> is #, then the preceding argument is delimited by
+% an opening brace, and that opening brace is not consumed.
+\def\getargs#1{\getargsxxx#1{}}
+\def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
+\def\getmacname #1 #2\relax{\macname={#1}}
+\def\getmacargs#1{\def\argl{#1}}
+
+% Parse the optional {params} list. Set up \paramno and \paramlist
+% so \defmacro knows what to do. Define \macarg.blah for each blah
+% in the params list, to be ##N where N is the position in that list.
+% That gets used by \mbodybackslash (above).
+
+% We need to get `macro parameter char #' into several definitions.
+% The technique used is stolen from LaTeX: let \hash be something
+% unexpandable, insert that wherever you need a #, and then redefine
+% it to # just before using the token list produced.
+%
+% The same technique is used to protect \eatspaces till just before
+% the macro is used.
+
+\def\parsemargdef#1;{\paramno=0\def\paramlist{}%
+ \let\hash\relax\let\xeatspaces\relax\parsemargdefxxx#1,;,}
+\def\parsemargdefxxx#1,{%
+ \if#1;\let\next=\relax
+ \else \let\next=\parsemargdefxxx
+ \advance\paramno by 1%
+ \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
+ {\xeatspaces{\hash\the\paramno}}%
+ \edef\paramlist{\paramlist\hash\the\paramno,}%
+ \fi\next}
+
+% These two commands read recursive and nonrecursive macro bodies.
+% (They're different since rec and nonrec macros end differently.)
+
+\long\def\parsemacbody#1@end macro%
+{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
+\long\def\parsermacbody#1@end rmacro%
+{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
+
+% This defines the macro itself. There are six cases: recursive and
+% nonrecursive macros of zero, one, and many arguments.
+% Much magic with \expandafter here.
+% \xdef is used so that macro definitions will survive the file
+% they're defined in; @include reads the file inside a group.
+\def\defmacro{%
+ \let\hash=##% convert placeholders to macro parameter chars
+ \ifrecursive
+ \ifcase\paramno
+ % 0
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \noexpand\scanmacro{\temp}}%
+ \or % 1
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup\noexpand\macroargctxt
+ \noexpand\braceorline
+ \expandafter\noexpand\csname\the\macname xxx\endcsname}%
+ \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
+ \egroup\noexpand\scanmacro{\temp}}%
+ \else % many
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup\noexpand\macroargctxt
+ \noexpand\csname\the\macname xx\endcsname}%
+ \expandafter\xdef\csname\the\macname xx\endcsname##1{%
+ \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
+ \expandafter\expandafter
+ \expandafter\xdef
+ \expandafter\expandafter
+ \csname\the\macname xxx\endcsname
+ \paramlist{\egroup\noexpand\scanmacro{\temp}}%
+ \fi
+ \else
+ \ifcase\paramno
+ % 0
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \noexpand\norecurse{\the\macname}%
+ \noexpand\scanmacro{\temp}\egroup}%
+ \or % 1
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup\noexpand\macroargctxt
+ \noexpand\braceorline
+ \expandafter\noexpand\csname\the\macname xxx\endcsname}%
+ \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
+ \egroup
+ \noexpand\norecurse{\the\macname}%
+ \noexpand\scanmacro{\temp}\egroup}%
+ \else % many
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup\noexpand\macroargctxt
+ \expandafter\noexpand\csname\the\macname xx\endcsname}%
+ \expandafter\xdef\csname\the\macname xx\endcsname##1{%
+ \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
+ \expandafter\expandafter
+ \expandafter\xdef
+ \expandafter\expandafter
+ \csname\the\macname xxx\endcsname
+ \paramlist{%
+ \egroup
+ \noexpand\norecurse{\the\macname}%
+ \noexpand\scanmacro{\temp}\egroup}%
+ \fi
+ \fi}
+
+\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
+
+% \braceorline decides whether the next nonwhitespace character is a
+% {. If so it reads up to the closing }, if not, it reads the whole
+% line. Whatever was read is then fed to the next control sequence
+% as an argument (by \parsebrace or \parsearg)
+\def\braceorline#1{\let\next=#1\futurelet\nchar\braceorlinexxx}
+\def\braceorlinexxx{%
+ \ifx\nchar\bgroup\else
+ \expandafter\parsearg
+ \fi \next}
+
+% We mant to disable all macros during \shipout so that they are not
+% expanded by \write.
+\def\turnoffmacros{\begingroup \def\do##1{\let\noexpand##1=\relax}%
+ \edef\next{\macrolist}\expandafter\endgroup\next}
+
+
+% @alias.
+% We need some trickery to remove the optional spaces around the equal
+% sign. Just make them active and then expand them all to nothing.
+\def\alias{\begingroup\obeyspaces\parsearg\aliasxxx}
+\def\aliasxxx #1{\aliasyyy#1\relax}
+\def\aliasyyy #1=#2\relax{\ignoreactivespaces
+\edef\next{\global\let\expandafter\noexpand\csname#1\endcsname=%
+ \expandafter\noexpand\csname#2\endcsname}%
+\expandafter\endgroup\next}
+
+
+\message{cross references,}
+% @xref etc.
+
+\newwrite\auxfile
+
+\newif\ifhavexrefs % True if xref values are known.
+\newif\ifwarnedxrefs % True if we warned once that they aren't known.
+
+% @inforef is relatively simple.
+\def\inforef #1{\inforefzzz #1,,,,**}
+\def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
+ node \samp{\ignorespaces#1{}}}
+
+% @node's job is to define \lastnode.
+\def\node{\ENVcheck\parsearg\nodezzz}
+\def\nodezzz#1{\nodexxx [#1,]}
+\def\nodexxx[#1,#2]{\gdef\lastnode{#1}}
+\let\nwnode=\node
+\let\lastnode=\relax
+
+% The sectioning commands (@chapter, etc.) call these.
+\def\donoderef{%
+ \ifx\lastnode\relax\else
+ \expandafter\expandafter\expandafter\setref{\lastnode}%
+ {Ysectionnumberandtype}%
+ \global\let\lastnode=\relax
+ \fi
+}
+\def\unnumbnoderef{%
+ \ifx\lastnode\relax\else
+ \expandafter\expandafter\expandafter\setref{\lastnode}{Ynothing}%
+ \global\let\lastnode=\relax
+ \fi
+}
+\def\appendixnoderef{%
+ \ifx\lastnode\relax\else
+ \expandafter\expandafter\expandafter\setref{\lastnode}%
+ {Yappendixletterandtype}%
+ \global\let\lastnode=\relax
+ \fi
+}
+
+
+% @anchor{NAME} -- define xref target at arbitrary point.
+%
+\newcount\savesfregister
+\gdef\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi}
+\gdef\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
+\gdef\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
+
+% \setref{NAME}{SNT} defines a cross-reference point NAME, namely
+% NAME-title, NAME-pg, and NAME-SNT. Called from \foonoderef. We have
+% to set \indexdummies so commands such as @code in a section title
+% aren't expanded. It would be nicer not to expand the titles in the
+% first place, but there's so many layers that that is hard to do.
+%
+\def\setref#1#2{{%
+ \indexdummies
+ \pdfmkdest{#1}%
+ \dosetq{#1-title}{Ytitle}%
+ \dosetq{#1-pg}{Ypagenumber}%
+ \dosetq{#1-snt}{#2}%
+}}
+
+% @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is
+% the node name, #2 the name of the Info cross-reference, #3 the printed
+% node name, #4 the name of the Info file, #5 the name of the printed
+% manual. All but the node name can be omitted.
+%
+\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]}
+\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
+\def\ref#1{\xrefX[#1,,,,,,,]}
+\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
+ \unsepspaces
+ \def\printedmanual{\ignorespaces #5}%
+ \def\printednodename{\ignorespaces #3}%
+ \setbox1=\hbox{\printedmanual}%
+ \setbox0=\hbox{\printednodename}%
+ \ifdim \wd0 = 0pt
+ % No printed node name was explicitly given.
+ \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax
+ % Use the node name inside the square brackets.
+ \def\printednodename{\ignorespaces #1}%
+ \else
+ % Use the actual chapter/section title appear inside
+ % the square brackets. Use the real section title if we have it.
+ \ifdim \wd1 > 0pt
+ % It is in another manual, so we don't have it.
+ \def\printednodename{\ignorespaces #1}%
+ \else
+ \ifhavexrefs
+ % We know the real title if we have the xref values.
+ \def\printednodename{\refx{#1-title}{}}%
+ \else
+ % Otherwise just copy the Info node name.
+ \def\printednodename{\ignorespaces #1}%
+ \fi%
+ \fi
+ \fi
+ \fi
+ %
+ % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not
+ % insert empty discretionaries after hyphens, which means that it will
+ % not find a line break at a hyphen in a node names. Since some manuals
+ % are best written with fairly long node names, containing hyphens, this
+ % is a loss. Therefore, we give the text of the node name again, so it
+ % is as if TeX is seeing it for the first time.
+ \ifpdf
+ \leavevmode
+ \getfilename{#4}%
+ \ifnum\filenamelength>0
+ \startlink attr{/Border [0 0 0]}%
+ goto file{\the\filename.pdf} name{#1@}%
+ \else
+ \startlink attr{/Border [0 0 0]}%
+ goto name{#1@}%
+ \fi
+ \linkcolor
+ \fi
+ %
+ \ifdim \wd1 > 0pt
+ \putwordsection{} ``\printednodename'' \putwordin{} \cite{\printedmanual}%
+ \else
+ % _ (for example) has to be the character _ for the purposes of the
+ % control sequence corresponding to the node, but it has to expand
+ % into the usual \leavevmode...\vrule stuff for purposes of
+ % printing. So we \turnoffactive for the \refx-snt, back on for the
+ % printing, back off for the \refx-pg.
+ {\normalturnoffactive
+ % Only output a following space if the -snt ref is nonempty; for
+ % @unnumbered and @anchor, it won't be.
+ \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
+ \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
+ }%
+ % [mynode],
+ [\printednodename],\space
+ % page 3
+ \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
+ \fi
+ \endlink
+\endgroup}
+
+% \dosetq is the interface for calls from other macros
+
+% Use \normalturnoffactive so that punctuation chars such as underscore
+% and backslash work in node names. (\turnoffactive doesn't do \.)
+\def\dosetq#1#2{%
+ {\let\folio=0%
+ \normalturnoffactive
+ \edef\next{\write\auxfile{\internalsetq{#1}{#2}}}%
+ \iflinks
+ \next
+ \fi
+ }%
+}
+
+% \internalsetq {foo}{page} expands into
+% CHARACTERS 'xrdef {foo}{...expansion of \Ypage...}
+% When the aux file is read, ' is the escape character
+
+\def\internalsetq #1#2{'xrdef {#1}{\csname #2\endcsname}}
+
+% Things to be expanded by \internalsetq
+
+\def\Ypagenumber{\folio}
+
+\def\Ytitle{\thissection}
+
+\def\Ynothing{}
+
+\def\Ysectionnumberandtype{%
+\ifnum\secno=0 \putwordChapter\xreftie\the\chapno %
+\else \ifnum \subsecno=0 \putwordSection\xreftie\the\chapno.\the\secno %
+\else \ifnum \subsubsecno=0 %
+\putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno %
+\else %
+\putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno %
+\fi \fi \fi }
+
+\def\Yappendixletterandtype{%
+\ifnum\secno=0 \putwordAppendix\xreftie'char\the\appendixno{}%
+\else \ifnum \subsecno=0 \putwordSection\xreftie'char\the\appendixno.\the\secno %
+\else \ifnum \subsubsecno=0 %
+\putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno %
+\else %
+\putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno %
+\fi \fi \fi }
+
+\gdef\xreftie{'tie}
+
+% Use TeX 3.0's \inputlineno to get the line number, for better error
+% messages, but if we're using an old version of TeX, don't do anything.
+%
+\ifx\inputlineno\thisisundefined
+ \let\linenumber = \empty % Non-3.0.
+\else
+ \def\linenumber{\the\inputlineno:\space}
+\fi
+
+% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
+% If its value is nonempty, SUFFIX is output afterward.
+
+\def\refx#1#2{%
+ \expandafter\ifx\csname X#1\endcsname\relax
+ % If not defined, say something at least.
+ \angleleft un\-de\-fined\angleright
+ \iflinks
+ \ifhavexrefs
+ \message{\linenumber Undefined cross reference `#1'.}%
+ \else
+ \ifwarnedxrefs\else
+ \global\warnedxrefstrue
+ \message{Cross reference values unknown; you must run TeX again.}%
+ \fi
+ \fi
+ \fi
+ \else
+ % It's defined, so just use it.
+ \csname X#1\endcsname
+ \fi
+ #2% Output the suffix in any case.
+}
+
+% This is the macro invoked by entries in the aux file.
+%
+\def\xrdef#1{\begingroup
+ % Reenable \ as an escape while reading the second argument.
+ \catcode`\\ = 0
+ \afterassignment\endgroup
+ \expandafter\gdef\csname X#1\endcsname
+}
+
+% Read the last existing aux file, if any. No error if none exists.
+\def\readauxfile{\begingroup
+ \catcode`\^^@=\other
+ \catcode`\^^A=\other
+ \catcode`\^^B=\other
+ \catcode`\^^C=\other
+ \catcode`\^^D=\other
+ \catcode`\^^E=\other
+ \catcode`\^^F=\other
+ \catcode`\^^G=\other
+ \catcode`\^^H=\other
+ \catcode`\^^K=\other
+ \catcode`\^^L=\other
+ \catcode`\^^N=\other
+ \catcode`\^^P=\other
+ \catcode`\^^Q=\other
+ \catcode`\^^R=\other
+ \catcode`\^^S=\other
+ \catcode`\^^T=\other
+ \catcode`\^^U=\other
+ \catcode`\^^V=\other
+ \catcode`\^^W=\other
+ \catcode`\^^X=\other
+ \catcode`\^^Z=\other
+ \catcode`\^^[=\other
+ \catcode`\^^\=\other
+ \catcode`\^^]=\other
+ \catcode`\^^^=\other
+ \catcode`\^^_=\other
+ \catcode`\@=\other
+ \catcode`\^=\other
+ % It was suggested to define this as 7, which would allow ^^e4 etc.
+ % in xref tags, i.e., node names. But since ^^e4 notation isn't
+ % supported in the main text, it doesn't seem desirable. Furthermore,
+ % that is not enough: for node names that actually contain a ^
+ % character, we would end up writing a line like this: 'xrdef {'hat
+ % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first
+ % argument, and \hat is not an expandable control sequence. It could
+ % all be worked out, but why? Either we support ^^ or we don't.
+ %
+ % The other change necessary for this was to define \auxhat:
+ % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
+ % and then to call \auxhat in \setq.
+ %
+ \catcode`\~=\other
+ \catcode`\[=\other
+ \catcode`\]=\other
+ \catcode`\"=\other
+ \catcode`\_=\other
+ \catcode`\|=\other
+ \catcode`\<=\other
+ \catcode`\>=\other
+ \catcode`\$=\other
+ \catcode`\#=\other
+ \catcode`\&=\other
+ \catcode`+=\other % avoid \+ for paranoia even though we've turned it off
+ % Make the characters 128-255 be printing characters
+ {%
+ \count 1=128
+ \def\loop{%
+ \catcode\count 1=\other
+ \advance\count 1 by 1
+ \ifnum \count 1<256 \loop \fi
+ }%
+ }%
+ % The aux file uses ' as the escape (for now).
+ % Turn off \ as an escape so we do not lose on
+ % entries which were dumped with control sequences in their names.
+ % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^
+ % Reference to such entries still does not work the way one would wish,
+ % but at least they do not bomb out when the aux file is read in.
+ \catcode`\{=1
+ \catcode`\}=2
+ \catcode`\%=\other
+ \catcode`\'=0
+ \catcode`\\=\other
+ %
+ \openin 1 \jobname.aux
+ \ifeof 1 \else
+ \closein 1
+ \input \jobname.aux
+ \global\havexrefstrue
+ \global\warnedobstrue
+ \fi
+ % Open the new aux file. TeX will close it automatically at exit.
+ \openout\auxfile=\jobname.aux
+\endgroup}
+
+
+% Footnotes.
+
+\newcount \footnoteno
+
+% The trailing space in the following definition for supereject is
+% vital for proper filling; pages come out unaligned when you do a
+% pagealignmacro call if that space before the closing brace is
+% removed. (Generally, numeric constants should always be followed by a
+% space to prevent strange expansion errors.)
+\def\supereject{\par\penalty -20000\footnoteno =0 }
+
+% @footnotestyle is meaningful for info output only.
+\let\footnotestyle=\comment
+
+\let\ptexfootnote=\footnote
+
+{\catcode `\@=11
+%
+% Auto-number footnotes. Otherwise like plain.
+\gdef\footnote{%
+ \global\advance\footnoteno by \@ne
+ \edef\thisfootno{$^{\the\footnoteno}$}%
+ %
+ % In case the footnote comes at the end of a sentence, preserve the
+ % extra spacing after we do the footnote number.
+ \let\@sf\empty
+ \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi
+ %
+ % Remove inadvertent blank space before typesetting the footnote number.
+ \unskip
+ \thisfootno\@sf
+ \footnotezzz
+}%
+
+% Don't bother with the trickery in plain.tex to not require the
+% footnote text as a parameter. Our footnotes don't need to be so general.
+%
+% Oh yes, they do; otherwise, @ifset and anything else that uses
+% \parseargline fail inside footnotes because the tokens are fixed when
+% the footnote is read. --karl, 16nov96.
+%
+\long\gdef\footnotezzz{\insert\footins\bgroup
+ % We want to typeset this text as a normal paragraph, even if the
+ % footnote reference occurs in (for example) a display environment.
+ % So reset some parameters.
+ \interlinepenalty\interfootnotelinepenalty
+ \splittopskip\ht\strutbox % top baseline for broken footnotes
+ \splitmaxdepth\dp\strutbox
+ \floatingpenalty\@MM
+ \leftskip\z@skip
+ \rightskip\z@skip
+ \spaceskip\z@skip
+ \xspaceskip\z@skip
+ \parindent\defaultparindent
+ %
+ \smallfonts \rm
+ %
+ % Hang the footnote text off the number.
+ \hang
+ \textindent{\thisfootno}%
+ %
+ % Don't crash into the line above the footnote text. Since this
+ % expands into a box, it must come within the paragraph, lest it
+ % provide a place where TeX can split the footnote.
+ \footstrut
+ \futurelet\next\fo@t
+}
+\def\fo@t{\ifcat\bgroup\noexpand\next \let\next\f@@t
+ \else\let\next\f@t\fi \next}
+\def\f@@t{\bgroup\aftergroup\@foot\let\next}
+\def\f@t#1{#1\@foot}
+\def\@foot{\strut\par\egroup}
+
+}%end \catcode `\@=11
+
+% Set the baselineskip to #1, and the lineskip and strut size
+% correspondingly. There is no deep meaning behind these magic numbers
+% used as factors; they just match (closely enough) what Knuth defined.
+%
+\def\lineskipfactor{.08333}
+\def\strutheightpercent{.70833}
+\def\strutdepthpercent {.29167}
+%
+\def\setleading#1{%
+ \normalbaselineskip = #1\relax
+ \normallineskip = \lineskipfactor\normalbaselineskip
+ \normalbaselines
+ \setbox\strutbox =\hbox{%
+ \vrule width0pt height\strutheightpercent\baselineskip
+ depth \strutdepthpercent \baselineskip
+ }%
+}
+
+% @| inserts a changebar to the left of the current line. It should
+% surround any changed text. This approach does *not* work if the
+% change spans more than two lines of output. To handle that, we would
+% have adopt a much more difficult approach (putting marks into the main
+% vertical list for the beginning and end of each change).
+%
+\def\|{%
+ % \vadjust can only be used in horizontal mode.
+ \leavevmode
+ %
+ % Append this vertical mode material after the current line in the output.
+ \vadjust{%
+ % We want to insert a rule with the height and depth of the current
+ % leading; that is exactly what \strutbox is supposed to record.
+ \vskip-\baselineskip
+ %
+ % \vadjust-items are inserted at the left edge of the type. So
+ % the \llap here moves out into the left-hand margin.
+ \llap{%
+ %
+ % For a thicker or thinner bar, change the `1pt'.
+ \vrule height\baselineskip width1pt
+ %
+ % This is the space between the bar and the text.
+ \hskip 12pt
+ }%
+ }%
+}
+
+% For a final copy, take out the rectangles
+% that mark overfull boxes (in case you have decided
+% that the text looks ok even though it passes the margin).
+%
+\def\finalout{\overfullrule=0pt}
+
+% @image. We use the macros from epsf.tex to support this.
+% If epsf.tex is not installed and @image is used, we complain.
+%
+% Check for and read epsf.tex up front. If we read it only at @image
+% time, we might be inside a group, and then its definitions would get
+% undone and the next image would fail.
+\openin 1 = epsf.tex
+\ifeof 1 \else
+ \closein 1
+ % Do not bother showing banner with post-v2.7 epsf.tex (available in
+ % doc/epsf.tex until it shows up on ctan).
+ \def\epsfannounce{\toks0 = }%
+ \input epsf.tex
+\fi
+%
+% We will only complain once about lack of epsf.tex.
+\newif\ifwarnednoepsf
+\newhelp\noepsfhelp{epsf.tex must be installed for images to
+ work. It is also included in the Texinfo distribution, or you can get
+ it from ftp://tug.org/tex/epsf.tex.}
+%
+\def\image#1{%
+ \ifx\epsfbox\undefined
+ \ifwarnednoepsf \else
+ \errhelp = \noepsfhelp
+ \errmessage{epsf.tex not found, images will be ignored}%
+ \global\warnednoepsftrue
+ \fi
+ \else
+ \imagexxx #1,,,\finish
+ \fi
+}
+%
+% Arguments to @image:
+% #1 is (mandatory) image filename; we tack on .eps extension.
+% #2 is (optional) width, #3 is (optional) height.
+% #4 is just the usual extra ignored arg for parsing this stuff.
+\def\imagexxx#1,#2,#3,#4\finish{%
+ \ifpdf
+ \centerline{\dopdfimage{#1}{#2}{#3}}%
+ \else
+ % \epsfbox itself resets \epsf?size at each figure.
+ \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
+ \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
+ \begingroup
+ \catcode`\^^M = 5 % in case we're inside an example
+ % If the image is by itself, center it.
+ \ifvmode
+ \nobreak\bigskip
+ % Usually we'll have text after the image which will insert
+ % \parskip glue, so insert it here too to equalize the space
+ % above and below.
+ \nobreak\vskip\parskip
+ \nobreak
+ \centerline{\epsfbox{#1.eps}}%
+ \bigbreak
+ \else
+ % In the middle of a paragraph, no extra space.
+ \epsfbox{#1.eps}%
+ \fi
+ \endgroup
+ \fi
+}
+
+
+\message{localization,}
+% and i18n.
+
+% @documentlanguage is usually given very early, just after
+% @setfilename. If done too late, it may not override everything
+% properly. Single argument is the language abbreviation.
+% It would be nice if we could set up a hyphenation file here.
+%
+\def\documentlanguage{\parsearg\dodocumentlanguage}
+\def\dodocumentlanguage#1{%
+ \tex % read txi-??.tex file in plain TeX.
+ % Read the file if it exists.
+ \openin 1 txi-#1.tex
+ \ifeof1
+ \errhelp = \nolanghelp
+ \errmessage{Cannot read language file txi-#1.tex}%
+ \let\temp = \relax
+ \else
+ \def\temp{\input txi-#1.tex }%
+ \fi
+ \temp
+ \endgroup
+}
+\newhelp\nolanghelp{The given language definition file cannot be found or
+is empty. Maybe you need to install it? In the current directory
+should work if nowhere else does.}
+
+
+% @documentencoding should change something in TeX eventually, most
+% likely, but for now just recognize it.
+\let\documentencoding = \comment
+
+
+% Page size parameters.
+%
+\newdimen\defaultparindent \defaultparindent = 15pt
+
+\chapheadingskip = 15pt plus 4pt minus 2pt
+\secheadingskip = 12pt plus 3pt minus 2pt
+\subsecheadingskip = 9pt plus 2pt minus 2pt
+
+% Prevent underfull vbox error messages.
+\vbadness = 10000
+
+% Don't be so finicky about underfull hboxes, either.
+\hbadness = 2000
+
+% Following George Bush, just get rid of widows and orphans.
+\widowpenalty=10000
+\clubpenalty=10000
+
+% Use TeX 3.0's \emergencystretch to help line breaking, but if we're
+% using an old version of TeX, don't do anything. We want the amount of
+% stretch added to depend on the line length, hence the dependence on
+% \hsize. We call this whenever the paper size is set.
+%
+\def\setemergencystretch{%
+ \ifx\emergencystretch\thisisundefined
+ % Allow us to assign to \emergencystretch anyway.
+ \def\emergencystretch{\dimen0}%
+ \else
+ \emergencystretch = .15\hsize
+ \fi
+}
+
+% Parameters in order: 1) textheight; 2) textwidth; 3) voffset;
+% 4) hoffset; 5) binding offset; 6) topskip. Then whoever calls us can
+% set \parskip and call \setleading for \baselineskip.
+%
+\def\internalpagesizes#1#2#3#4#5#6{%
+ \voffset = #3\relax
+ \topskip = #6\relax
+ \splittopskip = \topskip
+ %
+ \vsize = #1\relax
+ \advance\vsize by \topskip
+ \outervsize = \vsize
+ \advance\outervsize by 2\topandbottommargin
+ \pageheight = \vsize
+ %
+ \hsize = #2\relax
+ \outerhsize = \hsize
+ \advance\outerhsize by 0.5in
+ \pagewidth = \hsize
+ %
+ \normaloffset = #4\relax
+ \bindingoffset = #5\relax
+ %
+ \parindent = \defaultparindent
+ \setemergencystretch
+}
+
+% @letterpaper (the default).
+\def\letterpaper{{\globaldefs = 1
+ \parskip = 3pt plus 2pt minus 1pt
+ \setleading{13.2pt}%
+ %
+ % If page is nothing but text, make it come out even.
+ \internalpagesizes{46\baselineskip}{6in}{\voffset}{.25in}{\bindingoffset}{36pt}%
+}}
+
+% Use @smallbook to reset parameters for 7x9.5 (or so) format.
+\def\smallbook{{\globaldefs = 1
+ \parskip = 2pt plus 1pt
+ \setleading{12pt}%
+ %
+ \internalpagesizes{7.5in}{5.in}{\voffset}{.25in}{\bindingoffset}{16pt}%
+ %
+ \lispnarrowing = 0.3in
+ \tolerance = 700
+ \hfuzz = 1pt
+ \contentsrightmargin = 0pt
+ \deftypemargin = 0pt
+ \defbodyindent = .5cm
+ %
+ \let\smalldisplay = \smalldisplayx
+ \let\smallexample = \smalllispx
+ \let\smallformat = \smallformatx
+ \let\smalllisp = \smalllispx
+}}
+
+% Use @afourpaper to print on European A4 paper.
+\def\afourpaper{{\globaldefs = 1
+ \setleading{12pt}%
+ \parskip = 3pt plus 2pt minus 1pt
+ %
+ \internalpagesizes{53\baselineskip}{160mm}{\voffset}{4mm}{\bindingoffset}{44pt}%
+ %
+ \tolerance = 700
+ \hfuzz = 1pt
+}}
+
+% A specific text layout, 24x15cm overall, intended for A4 paper. Top margin
+% 29mm, hence bottom margin 28mm, nominal side margin 3cm.
+\def\afourlatex{{\globaldefs = 1
+ \setleading{13.6pt}%
+ %
+ \afourpaper
+ \internalpagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm}%
+ %
+ \globaldefs = 0
+}}
+
+% Use @afourwide to print on European A4 paper in wide format.
+\def\afourwide{%
+ \afourpaper
+ \internalpagesizes{6.5in}{9.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}%
+ %
+ \globaldefs = 0
+}
+
+% @pagesizes TEXTHEIGHT[,TEXTWIDTH]
+% Perhaps we should allow setting the margins, \topskip, \parskip,
+% and/or leading, also. Or perhaps we should compute them somehow.
+%
+\def\pagesizes{\parsearg\pagesizesxxx}
+\def\pagesizesxxx#1{\pagesizesyyy #1,,\finish}
+\def\pagesizesyyy#1,#2,#3\finish{{%
+ \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi
+ \globaldefs = 1
+ %
+ \parskip = 3pt plus 2pt minus 1pt
+ \setleading{13.2pt}%
+ %
+ \internalpagesizes{#1}{\hsize}{\voffset}{\normaloffset}{\bindingoffset}{44pt}%
+}}
+
+% Set default to letter.
+%
+\letterpaper
+
+
+\message{and turning on texinfo input format.}
+
+% Define macros to output various characters with catcode for normal text.
+\catcode`\"=\other
+\catcode`\~=\other
+\catcode`\^=\other
+\catcode`\_=\other
+\catcode`\|=\other
+\catcode`\<=\other
+\catcode`\>=\other
+\catcode`\+=\other
+\catcode`\$=\other
+\def\normaldoublequote{"}
+\def\normaltilde{~}
+\def\normalcaret{^}
+\def\normalunderscore{_}
+\def\normalverticalbar{|}
+\def\normalless{<}
+\def\normalgreater{>}
+\def\normalplus{+}
+\def\normaldollar{$}
+
+% This macro is used to make a character print one way in ttfont
+% where it can probably just be output, and another way in other fonts,
+% where something hairier probably needs to be done.
+%
+% #1 is what to print if we are indeed using \tt; #2 is what to print
+% otherwise. Since all the Computer Modern typewriter fonts have zero
+% interword stretch (and shrink), and it is reasonable to expect all
+% typewriter fonts to have this, we can check that font parameter.
+%
+\def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi}
+
+% Same as above, but check for italic font. Actually this also catches
+% non-italic slanted fonts since it is impossible to distinguish them from
+% italic fonts. But since this is only used by $ and it uses \sl anyway
+% this is not a problem.
+\def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi}
+
+% Turn off all special characters except @
+% (and those which the user can use as if they were ordinary).
+% Most of these we simply print from the \tt font, but for some, we can
+% use math or other variants that look better in normal text.
+
+\catcode`\"=\active
+\def\activedoublequote{{\tt\char34}}
+\let"=\activedoublequote
+\catcode`\~=\active
+\def~{{\tt\char126}}
+\chardef\hat=`\^
+\catcode`\^=\active
+\def^{{\tt \hat}}
+
+\catcode`\_=\active
+\def_{\ifusingtt\normalunderscore\_}
+% Subroutine for the previous macro.
+\def\_{\leavevmode \kern.06em \vbox{\hrule width.3em height.1ex}}
+
+\catcode`\|=\active
+\def|{{\tt\char124}}
+\chardef \less=`\<
+\catcode`\<=\active
+\def<{{\tt \less}}
+\chardef \gtr=`\>
+\catcode`\>=\active
+\def>{{\tt \gtr}}
+\catcode`\+=\active
+\def+{{\tt \char 43}}
+\catcode`\$=\active
+\def${\ifusingit{{\sl\$}}\normaldollar}
+%\catcode 27=\active
+%\def^^[{$\diamondsuit$}
+
+% Set up an active definition for =, but don't enable it most of the time.
+{\catcode`\==\active
+\global\def={{\tt \char 61}}}
+
+\catcode`+=\active
+\catcode`\_=\active
+
+% If a .fmt file is being used, characters that might appear in a file
+% name cannot be active until we have parsed the command line.
+% So turn them off again, and have \everyjob (or @setfilename) turn them on.
+% \otherifyactive is called near the end of this file.
+\def\otherifyactive{\catcode`+=\other \catcode`\_=\other}
+
+\catcode`\@=0
+
+% \rawbackslashxx output one backslash character in current font
+\global\chardef\rawbackslashxx=`\\
+%{\catcode`\\=\other
+%@gdef@rawbackslashxx{\}}
+
+% \rawbackslash redefines \ as input to do \rawbackslashxx.
+{\catcode`\\=\active
+@gdef@rawbackslash{@let\=@rawbackslashxx }}
+
+% \normalbackslash outputs one backslash in fixed width font.
+\def\normalbackslash{{\tt\rawbackslashxx}}
+
+% \catcode 17=0 % Define control-q
+\catcode`\\=\active
+
+% Used sometimes to turn off (effectively) the active characters
+% even after parsing them.
+@def@turnoffactive{@let"=@normaldoublequote
+@let\=@realbackslash
+@let~=@normaltilde
+@let^=@normalcaret
+@let_=@normalunderscore
+@let|=@normalverticalbar
+@let<=@normalless
+@let>=@normalgreater
+@let+=@normalplus
+@let$=@normaldollar}
+
+@def@normalturnoffactive{@let"=@normaldoublequote
+@let\=@normalbackslash
+@let~=@normaltilde
+@let^=@normalcaret
+@let_=@normalunderscore
+@let|=@normalverticalbar
+@let<=@normalless
+@let>=@normalgreater
+@let+=@normalplus
+@let$=@normaldollar}
+
+% Make _ and + \other characters, temporarily.
+% This is canceled by @fixbackslash.
+@otherifyactive
+
+% If a .fmt file is being used, we don't want the `\input texinfo' to show up.
+% That is what \eatinput is for; after that, the `\' should revert to printing
+% a backslash.
+%
+@gdef@eatinput input texinfo{@fixbackslash}
+@global@let\ = @eatinput
+
+% On the other hand, perhaps the file did not have a `\input texinfo'. Then
+% the first `\{ in the file would cause an error. This macro tries to fix
+% that, assuming it is called before the first `\' could plausibly occur.
+% Also back turn on active characters that might appear in the input
+% file name, in case not using a pre-dumped format.
+%
+@gdef@fixbackslash{%
+ @ifx\@eatinput @let\ = @normalbackslash @fi
+ @catcode`+=@active
+ @catcode`@_=@active
+}
+
+% Say @foo, not \foo, in error messages.
+@escapechar = `@@
+
+% These look ok in all fonts, so just make them not special.
+@catcode`@& = @other
+@catcode`@# = @other
+@catcode`@% = @other
+
+@c Set initial fonts.
+@textfonts
+@rm
+
+
+@c Local variables:
+@c eval: (add-hook 'write-file-hooks 'time-stamp)
+@c page-delimiter: "^\\\\message"
+@c time-stamp-start: "def\\\\texinfoversion{"
+@c time-stamp-format: "%:y-%02m-%02d.%02H"
+@c time-stamp-end: "}"
+@c End:
diff --git a/gnu/usr.bin/cvs/emx/ChangeLog b/gnu/usr.bin/cvs/emx/ChangeLog
index ad5d9629e3f..a61f0a83ae0 100644
--- a/gnu/usr.bin/cvs/emx/ChangeLog
+++ b/gnu/usr.bin/cvs/emx/ChangeLog
@@ -1,3 +1,15 @@
+2001-03-14 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.in (installcheck): New target.
+
+2001-02-14 Larry Jones <larry.jones@sdrc.com>
+
+ * Makefile.in: Remove references to rtag.c & rtag.o.
+
+2000-12-21 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.in: Targets added to please Automake
+
1999-03-27 Jim Kingdon <http://www.cyclic.com>
* Makefile.in (LIB_OBJECTS, LIB_SOURCES): Remove vasprintf.
diff --git a/gnu/usr.bin/cvs/emx/Makefile.in b/gnu/usr.bin/cvs/emx/Makefile.in
index d475085f2a9..9b21474e1bc 100644
--- a/gnu/usr.bin/cvs/emx/Makefile.in
+++ b/gnu/usr.bin/cvs/emx/Makefile.in
@@ -15,6 +15,9 @@ srcdir = @srcdir@
# top_srcdir is usually ".."
top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+subdir = emx
+
lib_dir = ${top_srcdir}/lib
cvs_srcdir = ${top_srcdir}/src
diff_srcdir = ${top_srcdir}/diff
@@ -112,7 +115,6 @@ COMMON_SOURCES = \
${cvs_srcdir}/remove.c \
${cvs_srcdir}/repos.c \
${cvs_srcdir}/root.c \
- ${cvs_srcdir}/rtag.c \
${cvs_srcdir}/scramble.c \
${cvs_srcdir}/server.c \
${cvs_srcdir}/status.c \
@@ -207,7 +209,6 @@ COMMON_OBJECTS = \
${cvs_srcdir}/remove.o \
${cvs_srcdir}/repos.o \
${cvs_srcdir}/root.o \
- ${cvs_srcdir}/rtag.o \
${cvs_srcdir}/scramble.o \
${cvs_srcdir}/server.o \
${cvs_srcdir}/status.o \
@@ -279,8 +280,9 @@ DISTFILES = ${OS2_HEADERS} ${OS2_SOURCES} \
all:
-.PHONY: all install uninstall
-all install uninstall:
+# Automake
+.PHONY: all install installcheck uninstall check info
+all install installcheck uninstall check info:
installdirs:
.PHONY: installdirs
@@ -288,26 +290,45 @@ installdirs:
.PHONY: tags TAGS
tags TAGS:
-.PHONY: ls
-ls:
- @echo ${DISTFILES}
-
.PHONY: clean distclean realclean mostlyclean
-clean distclean realclean mostlyclean:
+clean distclean realclean maintainer-clean mostlyclean:
.PHONY: lint
lint:
-.PHONY: dist-dir
-dist-dir:
- mkdir ${DISTDIR}
- for i in ${DISTFILES}; do \
- ln $${i} ${DISTDIR}; \
+# distdir added for CVS.
+top_builddir = ..
+PACKAGE = @PACKAGE@
+VERSION = @VERSION@
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+# FIXME - sedding the directory off of the DISTFILES targets is really yucky.
+# The $(srcdir) prefixes should really be removed from all of the files in the
+# lists that make up DISTFILES above. Unfortunately, I don't have an EMX box
+# to test on.
+distdir: $(DISTFILES)
+ @d=$(srcdir); \
+ for f in $(DISTFILES); do \
+ file=`echo $$f |sed 's,.*/,,'`; \
+ if test -d $(distdir)/`dirname $$file`; then \
+ :; \
+ else \
+ mkdir $(distdir)/`dirname $$file`; \
+ fi; \
+ if test -d $$d/$$file; then \
+ cp -pR $$d/$$file $(distdir) \
+ || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
done
+.PHONY: distdir
# We don't have a real distclean or anything like that, but at least
-# we can get rid of the obj files and cvs.exe.
-clean:
+# we can get rid of the obj files and cvs.exe.
+.PHONY: clean distclean realclean mostlyclean maintainer-clean
+clean distclean realclean maintainer-clean mostlyclean:
rm -f cvs.exe cvs.out
rm -f ${srcdir}/*.o
rm -f ${diff_srcdir}/*.o
@@ -367,7 +388,6 @@ cvs-static.exe: ${OBJECTS} ${lib_dir}/libcvs.lib ${zlib_dir}/libz.lib
# cvs.o: ${OBJECTS} ${SOURCES} ${HEADERS}
-subdir = emx
# Hmm. This rule wants to exist on unix, so that "make dist" works.
# And it doesn't want to exist on OS/2, because configure doesn't
# run on OS/2 and so ../config.status won't exist. For now we just
diff --git a/gnu/usr.bin/cvs/install-sh b/gnu/usr.bin/cvs/install-sh
index 402d456bd15..e9de23842dc 100644
--- a/gnu/usr.bin/cvs/install-sh
+++ b/gnu/usr.bin/cvs/install-sh
@@ -1,16 +1,27 @@
#!/bin/sh
#
# install - install a program, script, or datafile
-# This comes from X11R5.
+# This comes from X11R5 (mit/util/scripts/install.sh).
+#
+# Copyright 1991 by the Massachusetts Institute of Technology
+#
+# Permission to use, copy, modify, distribute, and sell this software and its
+# documentation for any purpose is hereby granted without fee, provided that
+# the above copyright notice appear in all copies and that both that
+# copyright notice and this permission notice appear in supporting
+# documentation, and that the name of M.I.T. not be used in advertising or
+# publicity pertaining to distribution of the software without specific,
+# written prior permission. M.I.T. makes no representations about the
+# suitability of this software for any purpose. It is provided "as is"
+# without express or implied warranty.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
-# from scratch.
-#
-#
+# from scratch. It can only install one file at a time, a restriction
+# shared with many OS's install programs.
# set DOITPROG to echo to test this script
@@ -30,7 +41,7 @@ stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
-tranformbasename=""
+transformbasename=""
transform_arg=""
instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
@@ -107,6 +118,7 @@ if [ x"$dir_arg" != x ]; then
if [ -d $dst ]; then
instcmd=:
+ chmodcmd=""
else
instcmd=mkdir
fi
diff --git a/gnu/usr.bin/cvs/lib/.cvsignore b/gnu/usr.bin/cvs/lib/.cvsignore
index 3ad620cb65e..700396a4a83 100644
--- a/gnu/usr.bin/cvs/lib/.cvsignore
+++ b/gnu/usr.bin/cvs/lib/.cvsignore
@@ -1,2 +1,3 @@
-Makefile
+.deps
.pure
+Makefile
diff --git a/gnu/usr.bin/cvs/lib/ChangeLog b/gnu/usr.bin/cvs/lib/ChangeLog
index 102ca4cf4ef..107445d779c 100644
--- a/gnu/usr.bin/cvs/lib/ChangeLog
+++ b/gnu/usr.bin/cvs/lib/ChangeLog
@@ -1,3 +1,69 @@
+2001-04-25 Derek Price <dprice@collab.net>
+
+ * Makefile.in: Regenerated using AM 1.4e as of today at 18:10 -0400.
+
+2001-04-02 Derek Price <dprice@collab.net>
+ for Alon Ziv <alonz@zapper.com>
+
+ * getdate.y: Add a declaration for yyparse().
+
+ * getdate.c: Regenerated.
+
+2001-03-14 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.in: Regenerated
+
+2001-02-20 Derek Price <derek.price@openavenue.com>
+
+ * xgssapi.h: New file to perform GSSAPI include magic.
+ * Makefile.am (EXTRA_DIST): Add xgssapi.h.
+
+ * Makefile.in: Regenerated.
+
+2001-02-14 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.am (libcvs_a_SOURCES): Add xtime.h & xselect.h.
+ * Makefile.in: Regenerated.
+ * getdate.y: Include xtime.h.
+ * getdate.c: Regenerated.
+ * system.h: Include xtime.h.
+ * xtime.h: New file to do include magic for time functions.
+ * xselect.h: New file to do select include magic.
+
+2001-02-06 Derek Price <derek.price@openavenue.com>
+ Rex Jolliff <Rex_Jolliff@notes.ymp.gov>
+ Shawn Smith <Shawn_Smith@notes.ymp.gov>
+
+ * system.h: definitions of CVS_OPENDIR, CVS_READDIR, & CVS_CLOSEDIR
+ provided here in support of changes to handle VMS DEC C 5.7
+ {open,read,close}dir problems. Check today's entry in the vms subdir
+ for more.
+
+2001-01-10 Derek Price <derek.price@openavenue.com>
+ Rex Jolliff <Rex_Jolliff@notes.ymp.gov>
+
+ * rename.c: replace calls to unlink() with CVS_UNLINK() for VMS
+
+2000-12-22 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.am (INCLUDES): Fixed typo
+ * Makefile.in: Regenerated
+
+2000-12-22 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.am (INCLUDES): Added $(top_srcdir)/src
+ * Makefile.in: Regenerated
+
+2000-12-21 Derek Price <derek.price@openavenue.com>
+
+ * .cvsignore: Added .deps directory and alphabetized
+ * Makefile.am: New file needed by Automake
+ * Makefile.in: Regenerated
+
+2000-11-15 Derek Price <derek.price@openavenue.com>
+
+ * system.h: Added CVS_FDOPEN to conform to CVS_FOPEN precedent
+
2000-07-10 Larry Jones <larry.jones@sdrc.com>
* savecwd.c: #include <sys/types.h> before <fcntl.h>.
diff --git a/gnu/usr.bin/cvs/lib/Makefile.am b/gnu/usr.bin/cvs/lib/Makefile.am
new file mode 100644
index 00000000000..5984fcf0c66
--- /dev/null
+++ b/gnu/usr.bin/cvs/lib/Makefile.am
@@ -0,0 +1,88 @@
+## Process this file with automake to produce Makefile.in
+# Makefile for library files used by GNU CVS.
+# Copyright (C) 1986, 1988-1994, 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# For now we need to include $(top_srcdir)/src because some systems
+# (at least 'AIX rioscpu2 3 4 000030498200',
+# 'HP-UX hp60 B.10.20 A 9000/770 hp60 two-user license', &
+# 'IRIX64 sgiop110 6.5 07151433 IP30') have trouble finding error.h
+# when compiling savecwd.c
+#
+# FIXME - the fact that compiling on my Linux 2.2.16 system finds
+# /usr/include/error.h instead of $(top_srcdir)/src/error.h but
+# everything compiles and tests anyhow implies that src/error.h may
+# be unecessary now. Should look more deeply into this
+#
+# $(includeopt) is CVS specific and set by configure
+INCLUDES = -I$(top_srcdir)/src $(includeopt)
+
+noinst_LIBRARIES = libcvs.a
+
+# Always use CVS's regular expression matcher regex.o, because of
+# variations in regular expression syntax - we want to be the same
+# across systems and (probably) compared with old versions of CVS too.
+#
+# On a more mundane/detail level, having regex.h match regex.c can be
+# an issue if we aren't careful.
+#
+# Also should look into unifying regular expression matching in CVS
+# with the diff library (perhaps to have the caller, CVS, do the
+# matching?)
+libcvs_a_SOURCES = \
+ argmatch.c \
+ ftruncate.c \
+ getdate.y \
+ getline.c \
+ getopt.c \
+ getopt1.c \
+ md5.c \
+ regex.c \
+ savecwd.c \
+ sighandle.c \
+ stripslash.c \
+ xgetwd.c \
+ yesno.c \
+ getline.h \
+ getopt.h \
+ fnmatch.h \
+ md5.h \
+ regex.h \
+ savecwd.h \
+ system.h \
+ wait.h \
+ xselect.h \
+ xtime.h
+## because @LIBOBJS@ is included below, automake automatically knows about
+## dup2.c
+## fncase.c
+## fnmatch.c
+## hostname.c
+## memmove.c
+## mkdir.c
+## rename.c
+## strstr.c
+## strerror.c
+## strtoul.c
+## valloc.c
+## waitpid.c
+libcvs_a_LIBADD = @LIBOBJS@
+
+EXTRA_DIST = \
+ .cvsignore \
+ ChangeLog.fsf \
+ build_lib.com \
+ xgssapi.h
+
+# for backwards compatibility with the old makefiles
+realclean: maintainer-clean
+.PHONY: realclean
diff --git a/gnu/usr.bin/cvs/lib/rename.c b/gnu/usr.bin/cvs/lib/rename.c
index ae3d36ebb43..8dc02390974 100644
--- a/gnu/usr.bin/cvs/lib/rename.c
+++ b/gnu/usr.bin/cvs/lib/rename.c
@@ -37,7 +37,7 @@ rename (from, to)
{
/* We don't check existence_error because the systems which need it
have rename(). */
- if (unlink (to) && errno != ENOENT)
+ if (CVS_UNLINK (to) && errno != ENOENT)
return -1;
if ((from_stats.st_mode & S_IFMT) == S_IFDIR)
{
@@ -72,7 +72,7 @@ rename (from, to)
{
/* We don't check existence_error because the systems which need it
have rename(). */
- if (link (from, to) == 0 && (unlink (from) == 0 || errno == ENOENT))
+ if (link (from, to) == 0 && (CVS_UNLINK (from) == 0 || errno == ENOENT))
return 0;
}
}
diff --git a/gnu/usr.bin/cvs/lib/system.h b/gnu/usr.bin/cvs/lib/system.h
index 8beedf0eda7..2c3adbd45d3 100644
--- a/gnu/usr.bin/cvs/lib/system.h
+++ b/gnu/usr.bin/cvs/lib/system.h
@@ -156,16 +156,7 @@ off_t lseek ();
char *getcwd ();
#endif
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
+#include "xtime.h"
#ifdef HAVE_IO_H
#include <io.h>
@@ -175,26 +166,6 @@ char *getcwd ();
#include <direct.h>
#endif
-#ifdef timezone
-#undef timezone /* needed for sgi */
-#endif
-
-#ifdef HAVE_SYS_TIMEB_H
-#include <sys/timeb.h>
-#else
-struct timeb {
- time_t time; /* Seconds since the epoch */
- unsigned short millitm; /* Field not used */
- short timezone;
- short dstflag; /* Field not used */
-};
-#endif
-
-#if !defined(HAVE_FTIME) && !defined(HAVE_TIMEZONE)
-#if !defined(timezone)
-extern long timezone;
-#endif
-#endif
/*
@@ -429,6 +400,10 @@ extern int errno;
#define CVS_FOPEN fopen
#endif
+#ifndef CVS_FDOPEN
+#define CVS_FDOPEN fdopen
+#endif
+
#ifndef CVS_MKDIR
#define CVS_MKDIR mkdir
#endif
@@ -437,6 +412,14 @@ extern int errno;
#define CVS_OPEN open
#endif
+#ifndef CVS_READDIR
+#define CVS_READDIR readdir
+#endif
+
+#ifndef CVS_CLOSEDIR
+#define CVS_CLOSEDIR closedir
+#endif
+
#ifndef CVS_OPENDIR
#define CVS_OPENDIR opendir
#endif
diff --git a/gnu/usr.bin/cvs/lib/xgssapi.h b/gnu/usr.bin/cvs/lib/xgssapi.h
new file mode 100644
index 00000000000..31b8e39c29a
--- /dev/null
+++ b/gnu/usr.bin/cvs/lib/xgssapi.h
@@ -0,0 +1,30 @@
+/* This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details. */
+
+/* This file performs the generic include magic necessary for using
+ * cross platform gssapi which configure doesn't perform itself.
+ */
+
+/* Can't include both of these headers at the same time with Solaris 7 &
+ * Heimdal Kerberos 0.3. If some system ends up requiring both, a configure
+ * test like TIME_AND_SYS_TIME will probably be necessary.
+ */
+#ifdef HAVE_GSSAPI_H
+# include <gssapi.h>
+#else
+/* Assume existance of this header so that the user will get an informative
+ * message if HAVE_GSSAPI somehow gets defined with both headers missing.
+ */
+# include <gssapi/gssapi.h>
+#endif
+#ifdef HAVE_GSSAPI_GSSAPI_GENERIC_H
+/* MIT Kerberos 5 v1.2.1 */
+# include <gssapi/gssapi_generic.h>
+#endif
diff --git a/gnu/usr.bin/cvs/lib/xselect.h b/gnu/usr.bin/cvs/lib/xselect.h
new file mode 100644
index 00000000000..f1df204cdb4
--- /dev/null
+++ b/gnu/usr.bin/cvs/lib/xselect.h
@@ -0,0 +1,21 @@
+/* This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details. */
+
+/* This file simply performs the include magic necessary for using select */
+#include <sys/types.h>
+#ifdef HAVE_SYS_BSDTYPES_H
+# include <sys/bsdtypes.h>
+#endif
+
+#include "xtime.h"
+
+#if HAVE_SYS_SELECT_H
+# include <sys/select.h>
+#endif
diff --git a/gnu/usr.bin/cvs/lib/xtime.h b/gnu/usr.bin/cvs/lib/xtime.h
new file mode 100644
index 00000000000..00d9fae874c
--- /dev/null
+++ b/gnu/usr.bin/cvs/lib/xtime.h
@@ -0,0 +1,57 @@
+/* This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details. */
+
+/* This file simply performs the include magic necessary for using time
+ * functions
+ */
+
+#ifdef vms
+# include <time.h>
+#else /* vms */
+
+# if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+# else /* TIME_WITH_SYS_TIME */
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else /* HAVE_SYS_TIME_H */
+# include <time.h>
+# endif /* !HAVE_SYS_TIME_H */
+# endif /* !TIME_WITH_SYS_TIME */
+
+# ifdef HAVE_SYS_TIMEB_H
+# include <sys/timeb.h>
+# else /* HAVE_SYS_TIMEB_H */
+/*
+ * We use the obsolete `struct timeb' as part of our interface!
+ * Since the system doesn't have it, we define it here;
+ * our callers must do likewise.
+ *
+ * At the least we were using this in lib/getdate.y, but lib/system.h used to
+ * define it too, so maybe CVS is using it elsewhere.
+ */
+struct timeb {
+ time_t time; /* Seconds since the epoch */
+ unsigned short millitm; /* Field not used */
+ short timezone; /* Minutes west of GMT */
+ short dstflag; /* Field not used */
+};
+# endif /* !HAVE_SYS_TIMEB_H */
+
+# ifdef timezone
+# undef timezone /* needed for sgi */
+# endif /* timezone */
+
+# if !defined(HAVE_FTIME) && !defined(HAVE_TIMEZONE)
+extern long timezone;
+# endif /* !defined(HAVE_FTIME) && !defined(HAVE_TIMEZONE) */
+
+#endif /* !vms */
diff --git a/gnu/usr.bin/cvs/man/ChangeLog b/gnu/usr.bin/cvs/man/ChangeLog
index adb8e2dfec0..ed9563c8f30 100644
--- a/gnu/usr.bin/cvs/man/ChangeLog
+++ b/gnu/usr.bin/cvs/man/ChangeLog
@@ -1,3 +1,20 @@
+2001-04-25 Derek Price <dprice@collab.net>
+
+ * Makefile.in: Regenerated using AM 1.4e as of today at 18:10 -0400.
+
+2001-03-14 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.in: Regenerated
+
+2000-12-22 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.in: Regenerated
+
+2000-12-21 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.am: New file needed by Automake
+ * Makefile.in: Regenerated
+
2000-09-07 Larry Jones <larry.jones@sdrc.com>
* Makefile.in: Use @bindir@, @libdir@, @infodir@, and @mandir@
diff --git a/gnu/usr.bin/cvs/man/Makefile.am b/gnu/usr.bin/cvs/man/Makefile.am
new file mode 100644
index 00000000000..bd750c2586f
--- /dev/null
+++ b/gnu/usr.bin/cvs/man/Makefile.am
@@ -0,0 +1,22 @@
+## Process this file with automake to produce Makefile.in
+# Makefile.am for GNU CVS man pages.
+# Copyright (C) 1986-1992, 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+man_MANS = cvs.1 cvs.5 cvsbug.8
+EXTRA_DIST = \
+ .cvsignore \
+ $(man_MANS)
+
+# for backwards compatibility with the old makefiles
+realclean: maintainer-clean
+.PHONY: realclean
diff --git a/gnu/usr.bin/cvs/man/Makefile.in b/gnu/usr.bin/cvs/man/Makefile.in
index f9b566585eb..7efae1228e0 100644
--- a/gnu/usr.bin/cvs/man/Makefile.in
+++ b/gnu/usr.bin/cvs/man/Makefile.in
@@ -1,6 +1,20 @@
-# Makefile for GNU CVS documentation.
-# Do not use this makefile directly, but only from `../Makefile'.
-# Copyright (C) 1986-1992 Free Software Foundation, Inc.
+# Makefile.in generated automatically by automake 1.4e from Makefile.am.
+
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# Makefile.am for GNU CVS man pages.
+# Copyright (C) 1986-1992, 2000 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -12,80 +26,328 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-SHELL = /bin/sh
-srcdir = @srcdir@
+SHELL = @SHELL@
+
+srcdir = @srcdir@
top_srcdir = @top_srcdir@
-VPATH = @srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
-MAN1FILES = cvs.1
-MAN5FILES = cvs.5
-MAN8FILES = cvsbug.8
-MANFILES = $(MAN1FILES) $(MAN5FILES) $(MAN8FILES)
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+
+top_builddir = ..
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
-DISTFILES = .cvsignore ChangeLog Makefile.in $(MANFILES)
INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
-prefix = @prefix@
-mandir = @mandir@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = @program_transform_name@
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+AMTAR = @AMTAR@
+AWK = @AWK@
+CC = @CC@
+CSH = @CSH@
+DEPDIR = @DEPDIR@
+ETAGS = @ETAGS@
+ETAGS_INCLUDE_OPTION = @ETAGS_INCLUDE_OPTION@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INSTALL_STRIP_PROGRAM_ENV = @INSTALL_STRIP_PROGRAM_ENV@
+KRB4 = @KRB4@
+LN_S = @LN_S@
+MAKEINFO = @MAKEINFO@
+PACKAGE = @PACKAGE@
+PERL = @PERL@
+PR = @PR@
+PS2PDF = @PS2PDF@
+RANLIB = @RANLIB@
+ROFF = @ROFF@
+STRIP = @STRIP@
+TEXI2DVI = @TEXI2DVI@
+VERSION = @VERSION@
+YACC = @YACC@
+_am_include = @_am_include@
+_am_quote = @_am_quote@
+includeopt = @includeopt@
+install_sh = @install_sh@
+
+man_MANS = cvs.1 cvs.5 cvsbug.8
+EXTRA_DIST = \
+ .cvsignore \
+ $(man_MANS)
+
+EXEEXT =
+OBJEXT = o
+subdir = man
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h $(top_builddir)/src/options.h
+CONFIG_CLEAN_FILES =
+DIST_SOURCES =
+
+NROFF = nroff
+MANS = $(man_MANS)
+DIST_COMMON = ChangeLog Makefile.am Makefile.in
+all: all-am
+
+.SUFFIXES:
+
+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu man/Makefile
+
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) && \
+ CONFIG_HEADERS= CONFIG_LINKS= \
+ CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status
+
man1dir = $(mandir)/man1
+install-man1: $(man1_MANS) $(man_MANS)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(DESTDIR)$(man1dir)
+ @list='$(man1_MANS)'; \
+ l2='$(man_MANS)'; for i in $$l2; do \
+ case "$$i" in \
+ *.1*) list="$$list $$i" ;; \
+ esac; \
+ done; \
+ for i in $$list; do \
+ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
+ else file=$$i; fi; \
+ ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+ inst=`echo $$inst | sed -e 's/^.*\///'`; \
+ inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+ echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \
+ $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \
+ done
+
+uninstall-man1:
+ @$(NORMAL_UNINSTALL)
+ @list='$(man1_MANS)'; \
+ l2='$(man_MANS)'; for i in $$l2; do \
+ case "$$i" in \
+ *.1*) list="$$list $$i" ;; \
+ esac; \
+ done; \
+ for i in $$list; do \
+ ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+ inst=`echo $$inst | sed -e 's/^.*\///'`; \
+ inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+ echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \
+ rm -f $(DESTDIR)$(man1dir)/$$inst; \
+ done
+
man5dir = $(mandir)/man5
-man8dir = $(mandir)/man8
+install-man5: $(man5_MANS) $(man_MANS)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(DESTDIR)$(man5dir)
+ @list='$(man5_MANS)'; \
+ l2='$(man_MANS)'; for i in $$l2; do \
+ case "$$i" in \
+ *.5*) list="$$list $$i" ;; \
+ esac; \
+ done; \
+ for i in $$list; do \
+ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
+ else file=$$i; fi; \
+ ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+ inst=`echo $$inst | sed -e 's/^.*\///'`; \
+ inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+ echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man5dir)/$$inst"; \
+ $(INSTALL_DATA) $$file $(DESTDIR)$(man5dir)/$$inst; \
+ done
-all:
-.PHONY: all
+uninstall-man5:
+ @$(NORMAL_UNINSTALL)
+ @list='$(man5_MANS)'; \
+ l2='$(man_MANS)'; for i in $$l2; do \
+ case "$$i" in \
+ *.5*) list="$$list $$i" ;; \
+ esac; \
+ done; \
+ for i in $$list; do \
+ ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+ inst=`echo $$inst | sed -e 's/^.*\///'`; \
+ inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+ echo " rm -f $(DESTDIR)$(man5dir)/$$inst"; \
+ rm -f $(DESTDIR)$(man5dir)/$$inst; \
+ done
-# This needs to depend on installdirs so that (for example) the
-# install will not fail if $(prefix)/man/man5 does not yet exist.
-install: all installdirs
- for f in $(MAN1FILES); do \
- $(INSTALL_DATA) $(srcdir)/$$f $(man1dir)/$$f; \
+man8dir = $(mandir)/man8
+install-man8: $(man8_MANS) $(man_MANS)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(DESTDIR)$(man8dir)
+ @list='$(man8_MANS)'; \
+ l2='$(man_MANS)'; for i in $$l2; do \
+ case "$$i" in \
+ *.8*) list="$$list $$i" ;; \
+ esac; \
+ done; \
+ for i in $$list; do \
+ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
+ else file=$$i; fi; \
+ ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+ inst=`echo $$inst | sed -e 's/^.*\///'`; \
+ inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+ echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man8dir)/$$inst"; \
+ $(INSTALL_DATA) $$file $(DESTDIR)$(man8dir)/$$inst; \
done
- for f in $(MAN5FILES); do \
- $(INSTALL_DATA) $(srcdir)/$$f $(man5dir)/$$f; \
+
+uninstall-man8:
+ @$(NORMAL_UNINSTALL)
+ @list='$(man8_MANS)'; \
+ l2='$(man_MANS)'; for i in $$l2; do \
+ case "$$i" in \
+ *.8*) list="$$list $$i" ;; \
+ esac; \
+ done; \
+ for i in $$list; do \
+ ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+ inst=`echo $$inst | sed -e 's/^.*\///'`; \
+ inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+ echo " rm -f $(DESTDIR)$(man8dir)/$$inst"; \
+ rm -f $(DESTDIR)$(man8dir)/$$inst; \
done
- for f in $(MAN8FILES); do \
- $(INSTALL_DATA) $(srcdir)/$$f $(man8dir)/$$f; \
+tags: TAGS
+TAGS:
+
+
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+
+top_distdir = ..
+distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
+
+distdir: $(DISTFILES)
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+ cp -pR $$d/$$file $(distdir) \
+ || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
done
+check-am: all-am
+check: check-am
+all-am: Makefile $(MANS)
installdirs:
- $(SHELL) $(top_srcdir)/mkinstalldirs $(man1dir) $(man5dir) $(man8dir)
+ $(mkinstalldirs) $(DESTDIR)$(man1dir) $(DESTDIR)$(man5dir) $(DESTDIR)$(man8dir)
-.PHONY: install installdirs
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
-tags:
-.PHONY: tags
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-TAGS:
-.PHONY: TAGS
+installcheck: installcheck-am
-ls:
- @true
-.PHONY: ls
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ INSTALL_PROGRAM_ENV='$(INSTALL_STRIP_PROGRAM_ENV)' install
-clean:
-.PHONY: clean
+mostlyclean-generic:
-distclean: clean
- rm -f Makefile
-.PHONY: distclean
+clean-generic:
-realclean: distclean
-.PHONY: realclean
+distclean-generic:
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
-dist-dir:
- mkdir ${DISTDIR}
- for i in ${DISTFILES}; do \
- ln $(srcdir)/$${i} ${DISTDIR}; \
- done
-.PHONY: dist-dir
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+ -rm -f Makefile.in
+clean: clean-am
-subdir = man
-Makefile: ../config.status Makefile.in
- cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-am
+
+distclean-am: clean-am distclean-generic
+
+dvi:
+
+dvi-am:
+
+info:
-#../config.status: ../configure
-# cd .. ; $(SHELL) config.status --recheck
+info-am:
+
+install-data-am: install-man
+
+install-exec-am:
+
+install-info:
+
+install-man: install-man1 install-man5 install-man8
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic
+
+uninstall-am: uninstall-man
+
+uninstall-man: uninstall-man1 uninstall-man5 uninstall-man8
+
+.PHONY: all all-am check check-am clean clean-generic distclean \
+ distclean-generic distdir dvi dvi-am info info-am install \
+ install-am install-data install-data-am install-exec \
+ install-exec-am install-info install-man install-man1 \
+ install-man5 install-man8 install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic \
+ uninstall uninstall-am uninstall-man uninstall-man1 \
+ uninstall-man5 uninstall-man8
+
+
+# for backwards compatibility with the old makefiles
+realclean: maintainer-clean
+.PHONY: realclean
-#../configure: ../configure.in
-# cd $(top_srcdir) ; autoconf
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/gnu/usr.bin/cvs/missing b/gnu/usr.bin/cvs/missing
new file mode 100644
index 00000000000..5f9da90636f
--- /dev/null
+++ b/gnu/usr.bin/cvs/missing
@@ -0,0 +1,265 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+# Copyright 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+if test $# -eq 0; then
+ echo 1>&2 "Try \`$0 --help' for more information"
+ exit 1
+fi
+
+run=:
+
+case "$1" in
+--run)
+ # Try to run requested program, and just exit if it succeeds.
+ run=
+ shift
+ "$@" && exit 0
+ ;;
+esac
+
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
+case "$1" in
+
+ -h|--h|--he|--hel|--help)
+ echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
+error status if there is no known handling for PROGRAM.
+
+Options:
+ -h, --help display this help and exit
+ -v, --version output version information and exit
+ --run try to run the given command, and emulate it if it fails
+
+Supported PROGRAM values:
+ aclocal touch file \`aclocal.m4'
+ autoconf touch file \`configure'
+ autoheader touch file \`config.h.in'
+ automake touch all \`Makefile.in' files
+ bison create \`y.tab.[ch]', if possible, from existing .[ch]
+ flex create \`lex.yy.c', if possible, from existing .c
+ help2man touch the output file
+ lex create \`lex.yy.c', if possible, from existing .c
+ makeinfo touch the output file
+ tar try tar, gnutar, gtar, then tar without non-portable flags
+ yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
+ ;;
+
+ -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+ echo "missing 0.3 - GNU automake"
+ ;;
+
+ -*)
+ echo 1>&2 "$0: Unknown \`$1' option"
+ echo 1>&2 "Try \`$0 --help' for more information"
+ exit 1
+ ;;
+
+ aclocal)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified \`acinclude.m4' or \`configure.in'. You might want
+ to install the \`Automake' and \`Perl' packages. Grab them from
+ any GNU archive site."
+ touch aclocal.m4
+ ;;
+
+ autoconf)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified \`configure.in'. You might want to install the
+ \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
+ archive site."
+ touch configure
+ ;;
+
+ autoheader)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified \`acconfig.h' or \`configure.in'. You might want
+ to install the \`Autoconf' and \`GNU m4' packages. Grab them
+ from any GNU archive site."
+ files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in`
+ test -z "$files" && files="config.h"
+ touch_files=
+ for f in $files; do
+ case "$f" in
+ *:*) touch_files="$touch_files "`echo "$f" |
+ sed -e 's/^[^:]*://' -e 's/:.*//'`;;
+ *) touch_files="$touch_files $f.in";;
+ esac
+ done
+ touch $touch_files
+ ;;
+
+ automake)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'.
+ You might want to install the \`Automake' and \`Perl' packages.
+ Grab them from any GNU archive site."
+ find . -type f -name Makefile.am -print |
+ sed 's/\.am$/.in/' |
+ while read f; do touch "$f"; done
+ ;;
+
+ bison|yacc)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified a \`.y' file. You may need the \`Bison' package
+ in order for those modifications to take effect. You can get
+ \`Bison' from any GNU archive site."
+ rm -f y.tab.c y.tab.h
+ if [ $# -ne 1 ]; then
+ eval LASTARG="\${$#}"
+ case "$LASTARG" in
+ *.y)
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+ if [ -f "$SRCFILE" ]; then
+ cp "$SRCFILE" y.tab.c
+ fi
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+ if [ -f "$SRCFILE" ]; then
+ cp "$SRCFILE" y.tab.h
+ fi
+ ;;
+ esac
+ fi
+ if [ ! -f y.tab.h ]; then
+ echo >y.tab.h
+ fi
+ if [ ! -f y.tab.c ]; then
+ echo 'main() { return 0; }' >y.tab.c
+ fi
+ ;;
+
+ lex|flex)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified a \`.l' file. You may need the \`Flex' package
+ in order for those modifications to take effect. You can get
+ \`Flex' from any GNU archive site."
+ rm -f lex.yy.c
+ if [ $# -ne 1 ]; then
+ eval LASTARG="\${$#}"
+ case "$LASTARG" in
+ *.l)
+ SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+ if [ -f "$SRCFILE" ]; then
+ cp "$SRCFILE" lex.yy.c
+ fi
+ ;;
+ esac
+ fi
+ if [ ! -f lex.yy.c ]; then
+ echo 'main() { return 0; }' >lex.yy.c
+ fi
+ ;;
+
+ help2man)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified a dependency of a manual page. You may need the
+ \`Help2man' package in order for those modifications to take
+ effect. You can get \`Help2man' from any GNU archive site."
+
+ file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+ if test -z "$file"; then
+ file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
+ fi
+ if [ -f "$file" ]; then
+ touch $file
+ else
+ test -z "$file" || exec >$file
+ echo ".ab help2man is required to generate this page"
+ exit 1
+ fi
+ ;;
+
+ makeinfo)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified a \`.texi' or \`.texinfo' file, or any other file
+ indirectly affecting the aspect of the manual. The spurious
+ call might also be the consequence of using a buggy \`make' (AIX,
+ DU, IRIX). You might want to install the \`Texinfo' package or
+ the \`GNU make' package. Grab either from any GNU archive site."
+ file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+ if test -z "$file"; then
+ file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+ file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
+ fi
+ touch $file
+ ;;
+
+ tar)
+ shift
+ if test -n "$run"; then
+ echo 1>&2 "ERROR: \`tar' requires --run"
+ exit 1
+ fi
+
+ # We have already tried tar in the generic part.
+ # Look for gnutar/gtar before invocation to avoid ugly error
+ # messages.
+ if (gnutar --version > /dev/null 2>&1); then
+ gnutar ${1+"$@"} && exit 0
+ fi
+ if (gtar --version > /dev/null 2>&1); then
+ gtar ${1+"$@"} && exit 0
+ fi
+ firstarg="$1"
+ if shift; then
+ case "$firstarg" in
+ *o*)
+ firstarg=`echo "$firstarg" | sed s/o//`
+ tar "$firstarg" ${1+"$@"} && exit 0
+ ;;
+ esac
+ case "$firstarg" in
+ *h*)
+ firstarg=`echo "$firstarg" | sed s/h//`
+ tar "$firstarg" ${1+"$@"} && exit 0
+ ;;
+ esac
+ fi
+
+ echo 1>&2 "\
+WARNING: I can't seem to be able to run \`tar' with the given arguments.
+ You may want to install GNU tar or Free paxutils, or check the
+ command line arguments."
+ exit 1
+ ;;
+
+ *)
+ echo 1>&2 "\
+WARNING: \`$1' is needed, and you do not seem to have it handy on your
+ system. You might have modified some files without having the
+ proper tools for further handling them. Check the \`README' file,
+ it often tells you about the needed prerequirements for installing
+ this package. You may also peek at any GNU archive site, in case
+ some other package would contain this missing \`$1' program."
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/gnu/usr.bin/cvs/mkinstalldirs b/gnu/usr.bin/cvs/mkinstalldirs
index 9259785ed4f..33bb3e86733 100644
--- a/gnu/usr.bin/cvs/mkinstalldirs
+++ b/gnu/usr.bin/cvs/mkinstalldirs
@@ -1,27 +1,34 @@
-#!/bin/sh
+#! /bin/sh
# mkinstalldirs --- make directory hierarchy
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
-# Last modified: 1994-03-25
# Public domain
-#
+
+# $Id: mkinstalldirs,v 1.1.1.3 2001/09/28 22:45:35 tholo Exp $
errstatus=0
-for file in ${1+"$@"} ; do
+for file
+do
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
shift
pathcomp=
- for d in ${1+"$@"} ; do
+ for d
+ do
pathcomp="$pathcomp$d"
case "$pathcomp" in
-* ) pathcomp=./$pathcomp ;;
esac
if test ! -d "$pathcomp"; then
- echo "mkdir $pathcomp" 1>&2
- mkdir "$pathcomp" || errstatus=$?
+ echo "mkdir $pathcomp"
+
+ mkdir "$pathcomp" || lasterr=$?
+
+ if test ! -d "$pathcomp"; then
+ errstatus=$lasterr
+ fi
fi
pathcomp="$pathcomp/"
diff --git a/gnu/usr.bin/cvs/os2/ChangeLog b/gnu/usr.bin/cvs/os2/ChangeLog
index 0b52588be83..a53f3a26a14 100644
--- a/gnu/usr.bin/cvs/os2/ChangeLog
+++ b/gnu/usr.bin/cvs/os2/ChangeLog
@@ -1,3 +1,15 @@
+2001-03-14 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.in (installcheck): New target.
+
+2001-02-14 Larry Jones <larry.jones@sdrc.com>
+
+ * Makefile.in: Remove references to rtag.c & rtag.obj.
+
+2000-12-21 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.in: Added support for Automake targets
+
1999-02-26 Jim Kingdon <http://www.cyclic.com>
* options.h: Make RELATIVE_REPOS the default, as in
diff --git a/gnu/usr.bin/cvs/os2/Makefile.in b/gnu/usr.bin/cvs/os2/Makefile.in
index 5febf7eb335..5a4cacc7d6d 100644
--- a/gnu/usr.bin/cvs/os2/Makefile.in
+++ b/gnu/usr.bin/cvs/os2/Makefile.in
@@ -9,6 +9,7 @@ project: cvs.exe
# path slash. This was introduced so that it can be set to \
# instead of / for linking, but now that the cvs.exe rule uses
# subst to produce \, it should be possible to nuke SL.
+# FIXME - nuke SL
SL = /
# Directory in which to install executables.
@@ -20,6 +21,9 @@ srcdir = @srcdir@
# top_srcdir is usually ".."
top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+subdir = os2
+
lib_dir = @top_srcdir@${SL}lib
cvs_srcdir = @top_srcdir@${SL}src
@@ -128,7 +132,6 @@ COMMON_SOURCES = \
${cvs_srcdir}${SL}remove.c \
${cvs_srcdir}${SL}repos.c \
${cvs_srcdir}${SL}root.c \
- ${cvs_srcdir}${SL}rtag.c \
${cvs_srcdir}${SL}scramble.c \
${cvs_srcdir}${SL}server.c \
${cvs_srcdir}${SL}status.c \
@@ -213,7 +216,6 @@ COMMON_OBJECTS = \
${cvs_srcdir}${SL}remove.obj \
${cvs_srcdir}${SL}repos.obj \
${cvs_srcdir}${SL}root.obj \
- ${cvs_srcdir}${SL}rtag.obj \
${cvs_srcdir}${SL}scramble.obj \
${cvs_srcdir}${SL}server.obj \
${cvs_srcdir}${SL}status.obj \
@@ -273,32 +275,58 @@ all:
.PHONY: all install uninstall
all install uninstall:
+# Remove targets for Automake
+info:
+.PHONY: info
+
+installcheck:
+.PHONY: installcheck
+
installdirs:
.PHONY: installdirs
.PHONY: tags TAGS
tags TAGS:
-.PHONY: ls
-ls:
- @echo ${DISTFILES}
-
-.PHONY: clean distclean realclean mostlyclean
-clean distclean realclean mostlyclean:
-
.PHONY: lint
lint:
-.PHONY: dist-dir
-dist-dir:
- mkdir ${DISTDIR}
- for i in ${DISTFILES}; do \
- ln $${i} ${DISTDIR}; \
+.PHONY: check
+check:
+
+# distdir added for CVS.
+top_builddir = ..
+PACKAGE = @PACKAGE@
+VERSION = @VERSION@
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+# FIXME - sedding the directory off of the DISTFILES targets is really yucky.
+# The $(srcdir) prefixes should really be removed from all of the files in the
+# lists that make up DISTFILES above. Unfortunately, I don't have an OS2 box
+# to test on.
+distdir: $(DISTFILES)
+ @d=$(srcdir); \
+ for f in $(DISTFILES); do \
+ file=`echo $$f |sed 's,.*/,,'`; \
+ if test -d $(distdir)/`dirname $$file`; then \
+ :; \
+ else \
+ mkdir $(distdir)/`dirname $$file`; \
+ fi; \
+ if test -d $$d/$$file; then \
+ cp -pR $$d/$$file $(distdir) \
+ || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
done
+.PHONY: distdir
# We don't have a real distclean or anything like that, but at least
# we can get rid of the obj files and cvs.exe.
-clean:
+.PHONY: clean distclean realclean mostlyclean maintainer-clean
+clean distclean realclean maintainer-clean mostlyclean:
rm -f cvs.exe
rm -f ${srcdir}${SL}*.obj
rm -f ${lib_dir}${SL}*.obj
@@ -333,7 +361,6 @@ cvs.exe: ${OBJECTS}
# cvs.obj: ${OBJECTS} ${SOURCES} ${HEADERS}
-subdir = os2
# Hmm. This rule wants to exist on unix, so that "make dist" works.
# And it doesn't want to exist on OS/2, because configure doesn't
# run on OS/2 and so ../config.status won't exist. For now we just
diff --git a/gnu/usr.bin/cvs/src/.cvsignore b/gnu/usr.bin/cvs/src/.cvsignore
index be8c63aa45b..a40e885d6b4 100644
--- a/gnu/usr.bin/cvs/src/.cvsignore
+++ b/gnu/usr.bin/cvs/src/.cvsignore
@@ -1,3 +1,4 @@
+.deps
.pure
Makefile
TAGS
@@ -8,3 +9,4 @@ cvsbug
mkmodules
options.h
options.h-SAVED
+stamp-h2
diff --git a/gnu/usr.bin/cvs/src/ChangeLog b/gnu/usr.bin/cvs/src/ChangeLog
index a33464d08b4..f483a7b2309 100644
--- a/gnu/usr.bin/cvs/src/ChangeLog
+++ b/gnu/usr.bin/cvs/src/ChangeLog
@@ -1,4 +1,1079 @@
-2000-09-19 Larry Jones <larry.jones@sdrc.com>
+2001-04-27 Larry Jones <larry.jones@sdrc.com>
+
+ * main.c (lookup_command_attribute): Lookup specified command, not
+ whatever's in the global command_name.
+
+2001-04-25 Derek Price <dprice@collab.net>
+
+ * Makefile.in: Regenerated using AM 1.4e as of today at 18:10 -0400.
+ * version.c: Regenerated.
+
+2001-04-22 Larry Jones <larry.jones@sdrc.com>
+
+ * tag.c (tag_check_valid): Make an unwritable val-tags file a
+ warning instead of a fatal error.
+
+2001-04-20 Larry Jones <larry.jones@sdrc.com>
+
+ * annotate.c (annotate_usage): -r and -D are not mutually exclusive.
+ * main.c (cmd_usage): Add missing version subcommand.
+ * update.c (update_usage): Add missing -C option.
+
+ * sanity.sh (death2): New tests for previous change.
+
+ * classify.c (Classify_File): Treat a dead revision like the RCS
+ file doesn't exist.
+ * sanity.sh: Update to match.
+
+2001-04-16 Larry Jones <larry.jones@sdrc.com>
+
+ * checkout.c, update.c: Fix usage messages: -r and -D are not
+ mutually exclusive.
+ (Suggested by David L. Martin <dlmart2@home.com>.)
+
+ * logmsg.c (do_editor): Don't add a blank line to the message.
+ * sanity.sh (editor-log-file*): Update to match.
+
+ * checkout.c, update.c: Note in usage message that -k is sticky.
+
+ * server.c: (server_cleanup, wait_sig): Remove ancient SunOS kludge.
+ (Suggested by Rob Saccoccio <robs@chelsea.net>.)
+
+2001-04-04 Larry Jones <larry.jones@sdrc.com>
+
+ * sanity.sh (dotest, dotest_lit, dotest_fail, dotest_status,
+ dotest_sort): Don't count on $? being set in then or else clauses.
+
+ * ignore.c (ignore_files): Collect unignored files into a list and
+ sort it before calling PROC to avoid order dependencies. Rewrite
+ the while loop to allow normal continues instead of goto.
+
+2001-04-04 Derek Price <dprice@collab.net>
+
+ * sanity.sh (ignore-on-branch-3): Fix in the remote case.
+
+2001-04-03 Larry Jones <larry.jones@sdrc.com>
+
+ * update.c (update_fileproc): Remove unused variable (resurrecting).
+
+2001-04-03 Derek Price <dprice@collab.net>
+ Larry Jones <larry.jones@sdrc.com>
+ reported by Jakob Bøhm <JB@Danware.dk>
+
+ * update.c (update_fileproc): Don't store a file with T_UNKNOWN status
+ in ignlist if present in the sandbox.
+ * sanity.sh (ignore-on-branch): New test.
+ (ignore): Tidy this test.
+
+2001-04-02 Derek Price <dprice@collab.net>
+
+ * sanity.sh: Make sure the test for `id' fails when a nonstandard `id'
+ is used and the user is root. Fix some quoting in error messages.
+ (fork): Take `cvs' out of the PATH.
+ (TODO): Add note about the test suite not working with user names over
+ eight characters in length.
+
+2001-04-02 Derek Price <dprice@collab.net>
+
+ * sanity.sh (fork): New test for CVS_SERVER default.
+ (TODO): Note about eventually removing most of the references to
+ CVS_SERVER.
+
+2001-04-02 Larry Jones <larry.jones@sdrc.com>
+
+ * client.c (connect_to_forked_server): Use program_path as the default
+ server instead of "cvs".
+
+2001-04-02 Derek Price <dprice@collab.net>
+
+ * sanity.sh: Use less obfuscated English in my comment about sanity
+ checking sanity.sh.
+
+2001-04-02 Derek Price <dprice@collab.net>
+
+ * sanity.sh (rm-update-message): Create a test directory again but
+ change back to the correct directory upon completion this time.
+
+2001-04-02 Derek Price <dprice@collab.net>
+
+ * sanity.sh: Change last two '[.*]'s to 'test's for
+ consistency and remove...
+ (TODO): the note from the TODO list.
+
+2001-04-02 Derek Price <dprice@collab.net>
+
+ * sanity.sh: Add test for PWD before successful exit.
+
+2001-03-30 Larry Jones <larry.jones@sdrc.com>
+
+ * sanity.sh (rm-update-message): Remove duplicate code.
+
+2001-03-30 Derek Price <dprice@collab.net>
+
+ * sanity.sh (rm-update-message): New test for local/client-server
+ warning message discrepency.
+
+2001-03-30 Larry Jones <larry.jones@sdrc.com>
+
+ * annotate.c: Move annotate() here from rcs.c, support rannotate.
+ * Makefile.am, Makefile.in: Add annotate.c.
+ * main.c (cmds[], cmd_usage[]): Add rannotate.
+ * rcs.c: Move declarations of rcs_delta_op and RCS_deltas to...
+ * rcs.h: ... here.
+ * server.c (serve_rannotate): New.
+ (requests[]): Add rannotate.
+ * sanity.sh (ann): New tests for rannotate.
+
+ * log.c (rlog_proc): Remove dead code.
+
+2001-03-30 Derek Price <dprice@collab.net>
+
+ * sanity.sh (join-readonly-conflict): Run more of this through dotest.
+
+2001-03-30 Larry Jones <larry.jones@sdrc.com>
+
+ * log.c (log_fileproc): Don't output working file for rlog.
+ * sanity.sh (log): New tests for rlog.
+
+ * cvs.h (mtype): Add MISC type.
+ * log.c (cvslog): Support rlog as well as log.
+ (rlog_proc): New.
+ * main.c (cmds[], cmd_usage[]): Add rlog.
+ (main): Remove old rlog warning message.
+ * server.c (serve_rlog): New.
+ (requests[]): Add rlog.
+
+2001-03-29 Derek Price <dprice@collab.net>
+
+ * sanity.sh: cd to $TESTDIR once after it is normalized. Make TODO
+ on history and symlinks more specific. Tested properly this time.
+
+2001-03-29 Larry Jones <larry.jones@sdrc.com>
+
+ * main.c (cmds[], lookup_command_attribute, main): Include the
+ command attributes in the global command table instead of inferring
+ them from the command names. Change the sense of the
+ CVS_CMD_IGNORE_ADMROOT attribute to match its name.
+
+2001-03-29 Derek Price <dprice@collab.net>
+
+ * sanity.sh (*, basic2-64): Remove references to TMPPWD. Fix FIXME
+ at end of script now that $TESTDIR can't be relative.
+
+2001-03-29 Derek Price <dprice@collab.net>
+
+ * sanity.sh: Normalize TESTDIR even when the user set it.
+
+2001-03-29 Larry Jones <larry.jones@sdrc.com>
+
+ * client.c (connect_to_pserver, start_tcp_server): Add IP address
+ to connect failed message.
+ (connect_to_forked_server, connect_to_pserver, start_tcp_server): Add
+ trace messages ala start_rsh_server.
+ (start_rsh_server): Include entire command in trace message for
+ START_RSH_WITH_POPEN_RW like ! START_RSH_WITH_POPEN_RW does.
+
+2001-03-29 Derek Price <dprice@collab.net>
+
+ * sanity.sh: Global search & replace ${TESTDIR}/cvsroot with
+ ${CVSROOT_DIRNAME} for consistency.
+
+2001-03-29 Derek Price <dprice@collab.net>
+
+ * sanity.sh (conflicts-12[68].5): Remove sanity hack which has allowed
+ for a CVS bug since May 96/97. Not sure when the bug went bye-bye, but
+ the tests broke when $TESTDIR != $TMPPWD.
+
+2001-03-26 Larry Jones <larry.jones@sdrc.com>
+
+ * classify.c (Classify_File): Don't report a conflict for a removed
+ file when piping. Also simplify the code structure.
+ (Reported by Milos Kleint <milos.kleint@netbeans.com>.)
+ * sanity.sh (rmadd2-14[abc]): New tests for above.
+
+2001-03-24 Noel Cragg <noel@shave.cnet.com>
+
+ * diff.c: mods to allow `-T' and `-y' options to be passed through
+ to the diff library. This wasn't allowed earlier because of a
+ similarly named options that got passed through to the old rcs
+ programs. We've long since stopped sending `-T' to any rcs
+ utility and have never used `-y'. Any users of moldly CVS
+ versions which used to support `-T' have (hopefully) upgraded to
+ one where that option isn't supported. It seems reasonable to
+ enable them again and pass them through. (sanity.sh still works
+ anyways...)
+ (longopts): add short option equivalents for --initial-tab and
+ --side-by-side.
+ (diff): add new short options to getopt string and switch
+ statement.
+
+2001-03-22 Larry Jones <larry.jones@sdrc.com>
+
+ * sanity.sh: Add check for ${DOTSTAR} with large matches.
+
+2001-03-23 Derek Price <dprice@collab.net>
+
+ * sanity.sh: Do the same as below for $keep.
+
+2001-03-23 Derek Price <dprice@collab.net>
+
+ * sanity.sh: Replace 'remote=(yes|no)' with 'remote=(:|false)' since
+ often 'false' and more often ':' are shell builtins. This makes the
+ succinct, 'if $remote; then' faster than 'if test $remote = yes; then'.
+ Alter tests in the rest of the script to match the new usage. Added
+ a suffix of 'r' to remote test names when it was appropriate and I
+ remembered. Some reformatting.
+
+2001-03-22 Larry Jones <larry.jones@sdrc.com>
+
+ * sanity.sh (diffmerge1_yours, diffmerge1_mine): Check for exact
+ output instead of using wildcards to avoid buffer overflows in some
+ versions of expr.
+
+2001-03-21 Derek Price <dprice@collab.net>
+
+ * sanity.sh: cd to '/tmp' again rather than $HOME since HOME was set to
+ a value inside ${TESTDIR} by the script.
+
+2001-03-20 Derek Price <dprice@collab.net>
+
+ * sanity.sh (diffmerge1): Minor formatting and syntax changes.
+
+ for Jacob Burckhardt <bjacob@ca.metsci.com>
+
+ * sanity.sh (diffmerge1): More merging behavior tests. Specifically,
+ test some cases which broke before in Karl Tomlinson's diff fix was
+ checked in today.
+
+2001-03-20 Derek Price <dprice@collab.net>
+
+ * sanity.sh: Don't use unescaped parens in sh outside of quotes.
+
+2001-03-20 Derek Price <dprice@collab.net>
+
+ * sanity.sh: Don't remove ${TESTDIR} when -k (keep) set.
+
+2001-03-20 Derek Price <dprice@collab.net>
+
+ * sanity.sh: Change usage to match the new getopts format and comment.
+
+2001-03-16 Derek Price <dprice@collab.net>
+
+ * sanity.sh (modules2-nestedrename): New test. Verifies behavior of
+ renames nested under an ampersand module.
+ (modules2-ampertag): New test. Verifies an error condition which
+ prevents some ampersand modules from being checked out when a tag
+ is specified.
+
+2001-03-16 Derek Price <dprice@collab.net>
+
+ * sanity.sh (modules2): Additional test for ampersand module behavior
+ with '-d'.
+
+ for Greg Klanderman <greg@itasoftware.com>
+
+ * checkout.c (build_one_dir): Fix typo where clauses of two
+ conditionals were reversed in call to Create_Admin. This caused
+ the CVS/Tag file to be removed in cases where it should have been
+ set, and vice-versa. It only surfaced in rare cases as this code
+ is only invoked when using the -d option to build the path to
+ check out in. Further, the bug would only matter when checking
+ out a module containing ampersand modules within it, via
+ client/server CVS.
+
+2001-03-16 Derek Price <dprice@collab.net>
+
+ * sanity.sh (admin-28-5): Confirm that a missing tag during an
+ 'admin -n' operation is not a fatal error.
+
+2001-03-16 Derek Price <dprice@collab.net>
+
+ * admin.c (admin_data): Remove 'quiet' member.
+ (admin_fileproc): Use global 'really_quiet' rather than
+ admin_data->quiet.
+
+2001-03-16 Derek Price <dprice@collab.net>
+
+ * sanity.sh (admin): Replace hardcoded testdir path with the variable.
+
+2001-03-15 Derek Price <derek.price@openavenue.com>
+
+ * sanity.sh (basica, binfiles, head, admin): Adjust for new messages.
+ * admin.c (admin_fileproc): Only print messages when not in
+ really_quiet mode.
+
+ for Stephen Rasku <stephen@tgivan.com>
+
+ * rcs.c (RCS_tag2rev): Make a missing tag a survivable error.
+
+2001-03-15 Larry Jones <larry.jones@sdrc.com>
+
+ * subr.c (sleep_past): Fix various bugs that would result in a
+ negative sleep time if it weren't unsigned; since it is, it would
+ result in a very large sleep time. Ensure that us is always less
+ than 1000000. Don't try to sleep for more 1 sec with usleep.
+ Cast NULL select arguments to correct type just in case.
+
+2001-03-14 Derek Price <derek.price@openavenue.com>
+
+ * subr.c (sleep_past): New function.
+ * client.c (get_responses_and_close): Use new function.
+ * commit.c (commit): Ditto.
+ * update.c (do_update): Ditto.
+ * cvs.h: Prototype new function.
+
+ * stamp-h2.in: Regenerated.
+
+2001-03-14 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.in: Regenerated.
+ * stamp-h2.in: Ditto.
+
+2001-03-14 Larry Jones <larry.jones@sdrc.com>
+
+ * commit.c (check_fileproc): Allow adding on the trunk when there's
+ an existing non-Attic RCS file as long as the head revision is dead.
+ This can happen due to an aborted resurrection.
+ (commit_fileproc): When resurrecting, consider the dead revision
+ along with the other files' revisions.
+ (findmaxrev): Avoid unnecessary work.
+ (checkaddfile): Only warn if file isn't in Attic as expected.
+ (Reported by Ross Burton <r.burton@180sw.com>.)
+ * sanity.sh (basica-r*): New tests for above.
+ (basica-o4): Update to match.
+
+2001-03-09 Larry Jones <larry.jones@sdrc.com>
+
+ * edit.c (edit_fileproc, unedit_fileproc): Some implementations of
+ asctime/ctime apparently use a leading zero on the date instead
+ of the space required by the C Standard. Correct for this so that
+ shared working directories work without hassle.
+ (Reported by David L. Martin <dlmart2@home.com>.)
+ * entries.c (fgetentent): Ditto.
+ * vers_ts.c (time_stamp_server, time_stamp) Ditto.
+
+2001-03-07 Larry Jones <larry.jones@sdrc.com>
+
+ * sanity.sh (basica, binfiles2, head, admin): Update to match
+ change to admin.c.
+
+2001-03-06 Larry Jones <larry.jones@sdrc.com>
+
+ * client.c (recv_bytes): Handle EOF as in recv_line().
+ (Reported by Pavel Roskin <proski@gnu.org>.)
+
+ * admin.c (admin_fileproc): Change final error message to clarify
+ that CVS refused to modify the RCS file rather than being unable to.
+
+2001-02-28 Jim Meyering <meyering@lucent.com>
+
+ * commit.c (commit_usage): Use `-F logfile' (rather than -F file') in
+ the description of that option, to be consistent with the `-F logfile'
+ in the Usage: line. Use spaces instead of TAB characters, and realign.
+
+2001-03-02 Derek Price <derek.price@openavenue.com>
+
+ * sanity.sh (crerepos): Make failed ${CVS_RSH-rsh} attempt print the
+ name of the command it actually used rather than 'rsh'.
+
+2001-02-27 Derek Price <derek.price@openavenue.com>
+
+ * sanity.sh (modules2-ampermod-*): Added these tests to make sure the
+ top level directory is created in an ampermodule when '-n' is passed to
+ checkout.
+
+ original bug report from
+ Wolfgang Haefelinger <Wolfgang.Haefelinger@Dresdner-Bank.com>
+
+2001-02-27 Derek Price <derek.price@openavenue.com>
+
+ * sanity.sh (version-[12]): replace ' (client/server)' with .* in these
+ two tests so that 'make check' works with whatever client/server
+ options the executable was compiled with.
+
+2001-02-23 Derek Price <derek.price@openavenue.com>
+
+ * main.c (main): Only check a cvsroot_t's isremote member when client
+ support is enabled.
+ * server.c: Include GSSAPI headers with client support as well as
+ server support.
+
+2001-02-21 Larry Jones <larry.jones@sdrc.com>
+
+ * modules.c, cvs.h (do_module): Add build_dirs argument and use it
+ instead of run_module_prog. Change all callers.
+ * tag.c (cvstag): For rtag, don't build directories.
+ * sanity.sh (modules3): Update to match.
+
+2001-02-20 Derek Price <derek.price@openavenue.com>
+
+ * client.c: Use xgssapi.h.
+ * server.c: Ditto.
+
+2001-02-15 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.am (cvs_SOURCES): Correct error from yesterday.
+ * Makefile.in: Regenerated.
+
+2001-02-14 Derek Price <derek.price@openavenue.com>
+
+ * server.c: Include xselect.h.
+ * update.c (do_update): Use best available sleep function.
+
+2001-02-14 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.am (cvs_SOURCES): Alphabetize and split to one/line.
+ (cvs_LDADD): Alphabetize and split to one/line.
+ * Makefile.in: Regenerated.
+
+2001-02-14 Larry Jones <larry.jones@sdrc.com>
+
+ * build_src.com: Remove references to rtag.c & rtag.obj.
+
+2001-02-13 Derek Price <derek.price@openavenue.com>
+
+ * main.c (date_to_tm): New function to convert an RCS date string to a
+ struct tm.
+ (tm_to_internet): New function to convert a struct tm to a date string
+ as specified by RFC822 and amended by RFC 1123.
+ (date_to_internet): Use the above two functions and a struct tm
+ intermediary for conversion.
+ * patch.c (patch_fileproc): Answer somebody's comment and use the new
+ diff_exec API.
+ * rcs.c (RCS_checkin): Use new diff_exec API.
+ (RCS_delete_revs): Use new diff_exec API.
+ (make_file_label): If the file name is DEVNULL, date it the Epoch for
+ compatibility with the POSIX.2 spec and Larry Wall's patch
+ implementation.
+ * rcscmds.c (diff_exec): Accept new label arguments.
+ * sanity.sh (death2): Update some diff tests to accept the new format.
+ * update.c (patch_file): Use new diff_exec API.
+ * diff.c (diff_fileproc): Create header labels appropriate for
+ compatibility with the Larry Wall version of patch.
+ (diff): Rename calls to strcat_and_allocate.
+ (strcat_and_allocate): Rename and move...
+ * subr.c (xrealloc_and_strcat): here.
+ * cvs.h: Update prototypes to match.
+
+2001-02-13 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.am (cvs_SOURCES): Remove rtag.c.
+
+2001-02-07 Larry Jones <larry.jones@sdrc.com>
+
+ * sanity.sh (directory_cmp): Return status rather than setting ISDIFF.
+ (basic2): Rewrite using dotest.
+
+2001-02-06 Larry Jones <larry.jones@sdrc.com>
+
+ * tag.c, rtag.c: Merge with tag.c being the surviving file.
+ * Makefile.in: Update to match.
+ * main.c (cmds): rtag() => cvstag().
+ * server.c (serve_rtag): Ditto, and set command name.
+
+2001-02-06 Derek Price <derek.price@openavenue.com>
+ Rex Jolliff <Rex_Jolliff@notes.ymp.gov>
+ Shawn Smith <Shawn_Smith@notes.ymp.gov>
+
+ * add.c: Replace opendir, closedir, & readdir calls with CVS_OPENDIR,
+ CVS_CLOSEDIR, & CVS_READDIR in support of changes to handle VMS DEC C
+ 5.7 {open,read,close}dir problems. Check today's entry in the vms
+ subdir for more.
+ * filesubr.c: ditto
+ * find_names.c: ditto
+ * ignore.c: ditto
+ * import.c: ditto
+ * lock.c: ditto
+ * update.c: ditto
+
+2001-02-02 Larry Jones <larry.jones@sdrc.com>
+
+ * error.h: Changed include guard macro from _error_h_ to ERROR_H;
+ names beginning with underscore are reserved.
+ * login.c (password_entry_parseline, password_entry_operation,
+ password_entry_operation_e, password_entry_operation_t): Removed
+ leading underscore(s).
+ (password_entry_parseline): Corrected error messages.
+ (password_entry_operation): Fixed uninitialized variable (password).
+ (login): Removed unused variable (found_password).
+
+ * rtag.c (rtag_proc): Call lock_tree_for_write() before calling
+ start_recursion. This fixes a serious problem where do_recursion
+ was reading and caching RCS files without any locks in place and
+ that information was subsequently being used to rewrite the file
+ causing any intermediate changes to be lost.
+ (rtag_filesdoneproc): Defunct.
+ (Reported by Karl Tomlinson <k.tomlinson@auckland.ac.nz>.)
+ * tag.c (cvstag, tag_filesdoneproc): Ditto.
+ * lock.c (lock_tree_for_write): Add which argument, change all
+ callers to pass W_LOCAL.
+ * rcs.h: Ditto.
+
+2001-01-29 Derek Price <derek.price@openavenue.com>
+
+ * client.c (get_cvs_port_number): change the prototype to accept a
+ const cvsroot_t * as input and add a FIXME comment
+ * cvs.h: new prototypes for get_cvs_port_number & normalize_cvsroot
+ * login.c (_password_entry_operation): consolidate all the ~/.cvspass
+ access into a single new function which reads ~/.cvspass in a backwards
+ compatible manner
+ (logout): use the new _password_entry_operation function
+ (login): ditto
+ (get_cvs_password): ditto
+ * root.c (normalize_cvsroot): move knowledge of default port & username
+ values inside
+
+2001-01-29 Larry Jones <larry.jones@sdrc.com>
+
+ * subr.c (shell_escape): New function.
+ * cvs.h: Declare it.
+ * logmsg.c (logfile_write): Use it to avoid problems with filenames
+ containing "'".
+ (Reported by Gerhard Ahuis <gerhard@ats.xs4all.nl>.)
+
+ * server.c (outbuf_memory_error, pserver_authenticate_connection,
+ kserver_authenticate_connection): If available, use syslog() to
+ record some errors.
+
+2001-01-25 Larry Jones <larry.jones@sdrc.com>
+
+ * server.c (do_cvs_command): If there's a partial output line left
+ over and the client doesn't support MT, go ahead and send it in an
+ M response instead of just dropping it.
+ (Reported by Milos Kleint <Milos.Kleint@netbeans.com>.)
+
+ * update.c (update_fileproc): Handle toss_local_changes in the
+ T_NEEDS_MERGE case.
+ (Inspired by Noel L Yap <yap_noel@jpmorgan.com>.)
+ * sanity.sh (clean): New tests for above.
+
+2001-01-23 Derek Price <derek.price@openavenue.com>
+
+ * run.c (run_exec): flush, if used, stderr and stdout before exit
+ * server.c (cvs_flusherr): flush stderr & send a stderr flush command
+ on the protocol pipe
+ (cvs_flushout): like above, for stdout
+ (do_cvs_command): handle flushes properly
+ * sanity.sh (reserved): make the commitinfo script echo errors to
+ stderr rather than stdin
+
+2001-01-18 Larry Jones <larry.jones@sdrc.com>
+
+ * log.c (option_revlist, revlist, log_usage, cvslog,
+ log_parse_revlist, log_expand_revlist, log_version_requested): Add
+ support for :: for exclusive ranges.
+ * admin.c (admin_usage): Reorder -o to be parallel to log -r.
+ * sanity.sh (log): New tests for above.
+
+2001-01-18 Derek Price <derek.price@openavenue.com>
+
+ * main.c: Add '2001' to the range of copyright years listed by the
+ --version option
+ * version.c.in (version): check current_parsed_root before its isremote
+ member to avoid a core dump
+ * sanity.sh (version): add a test for the version command
+
+ * version.c: regenerated
+
+2001-01-12 Larry Jones <larry.jones@sdrc.com>
+
+ * rcs.c, rcs.h (RCS_lock, RCS_unlock): Use RCS_gettag to find the
+ correct revision so that symbolic tags work correctly. (This
+ requires removing the "const" from the rev parameter since it's
+ passed to RCS_gettag which might modify it.)
+ (Reported by irina sturm <irina.sturm@st.com>.)
+
+2001-01-11 Larry Jones <larry.jones@sdrc.com>
+
+ * run.c (close_on_exec): Remove check for FD_CLOEXEC. As far as I
+ can see, it's *never* been defined, which defeats the whole point.
+ If F_SETFD is defined, it's probably safe to use it.
+
+ * server.c (do_cvs_command): Call close_on_exec on the protocol and
+ flow control pipes in the child process so they don't get inherited
+ by any subsidiary processes.
+ (Reported by Tristan Gingold <tgi@netgem.com>.)
+
+ * cvs.h (free_cvsroot_t): Spell correctly (was free_CVSroot_t).
+
+2001-01-10 Derek Price <derek.price@openavenue.com>
+ Rex Jolliff <Rex_Jolliff@notes.ymp.gov>
+
+ * build_src.com: VMS changes
+ * filesubr.c: replace calls to unlink() with CVS_UNLINK() for VMS
+ * rcs.c: ditto
+
+2001-01-10 Derek Price <derek.price@openavenue.com>
+
+ * main.c (current_root): explicitly list this as a static global
+
+2001-01-10 Derek Price <derek.price@openavenue.com>
+
+ * cvs.h (get_cvs_port_number): change name & prototype from
+ get_port_number
+ * client.c (get_cvs_port_number): new function which returns a port
+ number based on a cvsroot_t rather than requiring all possible sources
+ passed in
+ (connect_to_pserver): use new get_cvs_port_number function
+ (connect_to_server): ditto
+ * login.c (get_password): use new get_cvs_port_number function
+ (login): ditto
+ (logout): ditto
+
+2001-01-10 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.am ($(srcdir)/version.c): specify $(srcdir) for all subparts
+ of the build since some systems don't allow mv's across partitions
+ * Makefile.in: regenerated
+
+2001-01-10 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.am (version.c): specify $(srcdir) explicitly in target rule
+ so version.c gets built properly for all makes.
+ (version.o): specify $(srcdir)/version.c explicitly so dependency is
+ found and built properly
+ * Makefile.in: regenerated
+
+2001-01-09 Derek Price <derek.price@openavenue.com>
+
+ * version.c: updated timestamp
+
+2001-01-09 Larry Jones <larry.jones@sdrc.com>
+
+ * server.c (server): Change to server_temp_dir immediately after
+ creating it so that any stray files that happen to be created go
+ there instead of in the server's initial directory, wherever that
+ may be.
+ * sanity.sh (modules5-15): Update to match.
+
+ * version.c.in: Update to match Derek's change to version.c.
+
+2001-01-09 Derek Price <derek.price@openavenue.com>
+
+ * cvs.h: Remove the various CVSroot_* bits and replace them with a
+ single structure of type cvsroot_t (current_parsed_root)
+
+ * root.c (parse_cvsroot): return pointer to a new cvsroot_t rather than
+ altering global variables
+ (local_cvsroot): return a pointer to a new cvsroot_t rather than
+ setting globals. changed the name of this function from
+ set_local_cvsroot to better explain new functionality
+ (new_cvsroot_t): new initializer function
+ (free_cvsroot_t): new function
+ (others): use current_parsed_root rather than the old CVSroot_* globals
+
+ * add.c: use current_parsed_root rather than the old CVSroot_* globals
+ * admin.c: ditto
+ * checkout.c: ditto
+ * client.c: ditto
+ * commit.c: ditto
+ * create_adm.c: ditto
+ * diff.c: ditto
+ * edit.c: ditto
+ * expand_path.c: ditto
+ * find_names.c: ditto
+ * history.c: ditto
+ * ignore.c: ditto
+ * import.c: ditto
+ * lock.c: ditto
+ * log.c: ditto
+ * login.c: ditto
+ * logmsg.c: ditto
+ * main.c: ditto
+ * mkmodules.c: ditto
+ * modules.c: ditto
+ * parseinfo.c: ditto
+ * patch.c: ditto
+ * rcs.c: ditto
+ * recurse.c: ditto
+ * release.c: ditto
+ * remove.c: ditto
+ * repos.c: ditto
+ * rtag.c: ditto
+ * server.c: ditto
+ * status.c: ditto
+ * tag.c: ditto
+ * update.c: ditto
+ * version.c: ditto
+ * watch.c: ditto
+ * wrapper.c: ditto
+
+2001-01-05 Derek Price <derek.price@openavenue.com>
+
+ * cvs.h (enum CVSmethod): add null_method
+ * root.c (method_names): correlate null_method & "undefined"
+ (parse_cvsroot): make two error cases non fatal
+ * sanity.sh (crerepos-6b): account for new error message, re above
+
+2001-01-05 Derek Price <derek.price@openavenue.com>
+
+ * src/Makefile.am (cvsbug, cvsbug_EXTRA_DIST, EXTRA_DIST): move cvsbug
+ target to configure.in - see ../ChangeLog for more
+ * src/cvsbug.in: Rename from cvsbug.sh
+ * src/cvsbug.sh: Rename to cvsbug.in
+
+2001-01-04 Larry Jones <larry.jones@sdrc.com>
+
+ * Makefile.am (cvsbug): Explicitly list input file ($< is only
+ valid in inference rules).
+ * Makefile.in: Ditto.
+
+2001-01-04 Derek Price <derek.price@openavenue.com>
+
+ * sanity.sh: use getopts rather than getopt for portability reasons
+
+2001-01-03 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.am (remotecheck): depend on 'all'
+ * Makefile.in: regenerated
+
+2000-12-29 Derek Price <derek.price@openavenue.com>
+
+ * sanity.sh: remove explicit "$@" from last checkin and move the 'do'
+ to the line following the 'for'. Apparently this is more portable.
+
+2000-12-29 Derek Price <derek.price@openavenue.com>
+
+ * sanity.sh: make "$@" explicit in 'for' statement since Solaris 5.6's
+ implementation of Bourne shell doesn't seem to implement this default
+ behavior.
+
+2000-12-27 Derek Price <derek.price@openavenue.com>
+
+ * sanity.sh: add a -f option for continuing from a particular test
+ and shorten --keep to -k so we can use the getopt function.
+
+2000-12-27 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.am (remotecheck): Make remotecheck dependant on all
+ * Makefile.in: regenerated
+
+2000-12-26 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.in: update timestamp
+ * stamp-h2.in: ditto
+ * version.c: ditto
+
+2000-12-26 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.am: new target for version.c
+ (EXTRA_DIST): add version.c.in & version.c so builds work when
+ configure doesn't
+ * Makefile.in: Regenerated
+ * stamp-h2.in: update timestamp
+ * version.c: ditto
+
+2000-12-26 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.am (INCLUDES): add zlib
+ * Makefile.in: Regenerated
+
+2000-12-22 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.am (DISTCLEANFILES): added a few files
+ (INCLUDES): commented
+ * Makefile.in: Regenerated
+
+2000-12-21 Derek Price <derek.price@openavenue.com>
+
+ * .cvsignore: Added .deps directory and a new stamp file
+ * Makefile.am: New file needed by Automake
+ * Makefile.in: Regenerated
+ * stamp-h2.in: New stamp file created by Automake
+ * version.c.in: use configure to generate version.c
+
+2000-12-16 Derek Price <derek.price@openavenue.com>
+
+ * server.c (server_update): Keep the vers structure up to date after
+ sending a Remove or Remove-entry command to the client
+ * update.c (update): remove call to server_updated() after
+ scratch_file()
+ (scratch_file): in server mode, call server_updated(), otherwise keep
+ the vers structure up to date
+ (join_file): add a trace, save the revision to Register() on a remove
+ before calling server_scratch & server_updated
+ * sanity.sh (join): Add test for a remove/add caused by an update
+ to a new branch and a join in the same step.
+
+2000-12-15 Larry Jones <larry.jones@sdrc.com>
+
+ * error.c (error): Add %ld and %lu.
+
+ * history.c: Change hrec.idx from int to long, reformat NEXT_BAR
+ for readability, add hrec_idx.
+ (fill_hrec): Change initialization to be portable and always set
+ idx so it can be used as a line number in error messages; improve
+ parsing and error checking.
+ (read_hrecs): Initialize hrec_idx, handle embedded NULs, warn about
+ no newline at end of file.
+ (select_hrec): Add basic validity checking.
+
+2000-12-07 Larry Jones <larry.jones@sdrc.com>
+
+ * history.c (history): Allow multiple -m options as documented.
+
+2000-11-29 Derek Price <derek.price@openavenue.com>
+
+ * root.c (parse_cvsroot): back out yesterday's redundant changes
+ * main.c (main): fix CVSROOT trace message to look like other trace
+ messages
+ * sanity.sh (multiroot2-9): expect new trace message
+
+2000-11-28 Derek Price <derek.price@openavenue.com>
+
+ * root.c (parse_cvsroot): add trace on this function
+ * client.c (get_port_number): make trace print look like others
+
+2000-11-16 Derek Price <derek.price@openavenue.com>
+
+ * filesubr.c (cvs_temp_file): back out the previous change in the
+ interests of portability, add an assertion, and fix the header comment
+
+2000-11-16 Derek Price <derek.price@openavenue.com>
+
+ * filesubr.c (cvs_temp_file): refine the exit behavior to notice if
+ the out param was passed in NULL and, if so, avoid setting it and delete
+ the temp file for later
+
+2000-11-16 Derek Price <derek.price@openavenue.com>
+
+ * filesubr.c (cvs_temp_file): fixed a garble or two, added some
+ additional error checking, and added a comment
+
+2000-11-15 Derek Price <derek.price@openavenue.com>
+
+ * filesubr.c (cvs_temp_file): added cvs_temp_file
+ function to use mkstemp rather than one of the other temp file
+ generators as gcc keeps complaining I should.
+ (cvs_temp_name): altered this function to simply wrap cvs_temp_file
+ and deprecated it
+ * cvs.h: added prototype for cvs_temp_file
+ * commit.c (commit): use the new function instead of the old and plug
+ an old (though related) memory leak.
+ * import.c (import): use the new function
+ * login.c (login): Ditto
+ * logmsg.c (do_editor, do_verify): Ditto
+ * patch.c (patch_fileproc): Ditto
+
+2000-11-14 Larry Jones <larry.jones@sdrc.com>
+
+ * update.c, update.h (do_update): Add xdotemplate parameter.
+ Change all callers.
+ (update_dirent_proc): Use dotemplate for Create_Admin, not 1.
+ * checkout.c (checkout_proc): Don't create CVS/Template if
+ exporting.
+ (Reported by Andrey Podkolzin <mdh@zenon.net>.)
+
+2000-11-08 Larry Jones <larry.jones@sdrc.com>
+
+ * admin.c (admin): Use getgroups() to check for membership in
+ CVS_ADMIN_GROUP if it exists. In any event, check the user's
+ primary group in addition to any additional groups.
+ (Reported by Thomas Okken <TOkken@refco.com>.)
+
+2000-11-06 Jim Meyering <meyering@lucent.com>
+
+ Compile with gcc's -Wformat and fix the exposed problems.
+ * root.c (parse_cvsroot) [! HAVE_KERBEROS]: Provide an argument
+ for the %s error format spec.
+ [! HAVE_GSSAPI]: Likewise.
+ (normalize_cvsroot): Put comment delimiters around token after `#endif'.
+
+2000-11-03 Larry Jones <larry.jones@sdrc.com>
+
+ * sanity.sh: Some versions of sed require a space between -e and
+ the value.
+
+2000-10-27 Larry Jones <larry.jones@sdrc.com>
+
+ * checkout.c (checkout): Don't check for a safe location if just
+ cat'ing the module database.
+ (Reported by Ilya Martynov <m_ilya@agava.com>.)
+ Have -s set cat as well as status; it simplifies the code.
+
+2000-10-26 Larry Jones <larry.jones@sdrc.com>
+
+ * sanity.sh (join-admin-2): Check output from all commands instead
+ of (mostly) discarding. (Some of the tests used to produce stray
+ output in remote mode.)
+
+ * sanity.sh (dotest_line_by_line): Handle empty lines in pattern
+ (expr doesn't distingish between successfully matching nothing
+ and failing to match anything).
+
+ * sanity.sh (dotest_internal): Rearrange and use elif to simplify.
+
+2000-10-24 Jim Meyering <meyering@lucent.com>
+
+ Fix a bug, introduced with my fix of 2000-07-10, whereby -kk would
+ sometimes be ignored for some of the files involved in an update.
+
+ * update.c (join_file): Restore the original value of `options'
+ right after calling checkout_file.
+ * sanity.sh (join-admin-2): New test for this.
+
+2000-10-23 Derek Price <derek.price@openavenue.com>
+ James Youngman <jay@gnu.org>
+
+ * sanity.sh: it's /gnu/bin, not /gun/bin. Thanks go to James Youngman
+ <jay@gnu.org> for the bug report and patch.
+
+2000-10-20 Jim Kingdon <http://sourceforge.net/users/kingdon/>
+
+ * server.c (switch_to_user): Set CVS_USER. Patch from Sudish
+ Joseph and popularized by dozens (e.g. mozilla.org, also others).
+
+2000-10-20 Derek Price <derek.price@openavenue.com>
+ KOIE Hidetaka <hide@koie.org>
+
+ * root.c (normalize_cvsroot): plug a memory leak. Thanks to
+ KOIE Hidetaka <hide@koie.org>
+
+2000-10-18 Derek Price <derek.price@openavenue.com>
+
+ * client.c (connect_to_pserver): added a close brace the lack of which
+ was preventing compilation when gssapi was enabled. Removed a
+ redundant check for HAVE_KERBEROS.
+
+2000-10-18 Derek Price <derek.price@openavenue.com>
+
+ * root.c (normalize_cvsroot): removed references to free_port_s and the
+ now useless call to free now that port_s is on the stack. Thanks to
+ Jon Miner.
+
+2000-10-18 Derek Price <derek.price@openavenue.com>
+
+ * root.c (normalize_cvsroot): remove calls to snprintf for
+ compatibility with M$ Windoze.
+
+2000-10-18 Derek Price <derek.price@openavenue.com>
+
+ * sanity.sh (crerepos-6a, crerepos-6a-r): fix a "?" in a regex & pipe
+ the output of a test to /dev/null since we don't know what error
+ messages specific rsh implementations will output.
+
+2000-10-17 Derek Price <derek.price@openavenue.com>
+
+ * cvs.h: added CVSroot_password variable. Provided prototypes for
+ get_port_number & normalize_cvsroot.
+ * client.c (get_port_number): Fixed an ANSI prototype I had included
+ for get_port_number.
+ * login.c (login, logout): Removed two checks for a non-null
+ CVSroot_username since parse_cvsroot now supplies a default in pserver
+ mode. allow for a password in CVSROOT
+ (get_cvs_passsword): return CVSroot_password if it was supplied
+ in the CVSROOT.
+ * root.c (parse_cvsroot): Changed CVSROOT spec from
+ :method:user@host/port:/cvsroot to
+ :method:[[user][:password]@]host[:[port]]/cvsroot
+ Removed the xstrdup function since we'd rather have the error checking
+ from the version in subr.c anyhow. Moved some error messages which
+ looked like they would print the wrong error message after a failed
+ connect_to_gserver call.
+ (normalize_cvsroot): return a normalized CVSROOT for use in the
+ .cvspass file.
+ * sanity.sh (crerepos-6): fix a test which was expecting an old error
+ message.
+
+ * client.c (connect_to_pserver): Moved some error messages which looked like they
+ would print the wrong error message after a failed connect_to_gserver
+ call.
+
+ * login.c (login): Paranoiacly zero a password in memory.
+
+2000-10-12 Derek Price <derek.price@openavenue.com>
+
+ * client.c (auth_server_port_number -> get_port_number, start_pserver,
+ start_tcp_server): use a port specified in CVSROOT instead of the
+ default port. Failing that, use the CVS_CLIENT_PORT environment
+ variable.
+ * cvs.h: Added global CVSroot_port & renamed auth_server_port_number.
+ * root.c (parse_cvsroot): Parse the new CVSROOT format properly.
+ Incidentally reformated some error messages for uniformity and
+ readability.
+ * sanity.sh (crerepos): fix two tests which were now expecting the
+ wrong error message.
+
+2000-10-11 Larry Jones <larry.jones@sdrc.com>
+
+ * server.c (pserver_authenticate_connection): Fix stupid mistake
+ in previous change.
+
+2000-10-11 Derek Price <derek.price@openavenue.com>
+
+ * main.c (main): Dispose old CVSroot when parsing a '-d' option if
+ free_CVSroot is set.
+ * root.c (parse_cvsroot): remove references to 'cvsroot_parsed', a
+ static boolean I expect hasn't been used since CVS learned to handle
+ multiple CVSROOTs.
+
+2000-10-10 Larry Jones <larry.jones@sdrc.com>
+
+ * server.c (print_error): Make up a message if strerror fails.
+
+ * server.c (pserver_authenticate_connection): Give a real error
+ message for an invalid repository.
+
+2000-10-06 Derek Price <derek.price@openavenue.com>
+
+ * add.c (add): Made quiet mode affect some warning messages as seemed
+ appropriate. Specifically, some of the messages which a user might
+ want to ignore so they don't have to be quite so specific on the
+ command line: files added twice, files already in the repository and
+ check out properly (i.e. but picked up by 'cvs add *'), & files which
+ are readded in place of a dead revision or onto a branch. '-q' will
+ not change the non-zero exit code for the cases where at least one
+ passed in file name was already in the Entries file. There seems to
+ be a precedent in remove.c.
+ * remove.c (cvsremove): switched the "use cvs ci to make these changes
+ permanent message" to only print w/o '-Q' to match the new behavior of
+ add. This seems appropriate as '-Q' is defined to restrict messages
+ to critical errors.
+ * sanity.sh (adderrmsg): Added some tests for the above behavior.
+
+2000-10-05 Larry Jones <larry.jones@sdrc.com>
+
+ * client.c (call_in_directory): Create CVSADM directory if it doesn't
+ exist in the directory. This makes client/server work more like
+ standalone when checking out into an existing (non-CVS) directory.
+ * sanity.sh (dirs2, conflicts3, toplevel): Update to match.
+
+2000-10-03 Larry Jones <larry.jones@sdrc.com>
+
+ * filesubr.c (get_homedir): Ignore $HOME when running in server mode.
+
+2000-10-02 Larry Jones <larry.jones@sdrc.com>
+
+ * cvs.h: Define (and use) T_PATCH as a valid file classification
+ even when SERVER_SUPPORT isn't defined -- it simplifies the code.
+ * classify.c (Classify_File): Ditto.
+ * commit.c (check_fileproc): Ditto.
+ * status.c (status_fileproc): Ditto.
+ * update.c (update_fileproc): Ditto.
+ * tag.c (check_fileproc): Accept T_PATCH in addition to T_CHECKOUT.
+ * sanity.sh (tagc-10): Update to match.
+
+2000-09-29 Larry Jones <larry.jones@sdrc.com>
+
+ * client.c (get_responses_and_close): Reset server_fd to -1 after
+ shutting down.
+ (Reported by Joerg Thoennes <Joerg.Thoennes@data-sciences.de>.)
+
+2000-09-27 Larry Jones <larry.jones@sdrc.com>
+
+ * commit.c (commit): Don't sleep before returning in server mode,
+ just let the client do it.
+ * update.c (do_update): Ditto.
+
+ * sanity.sh (find_tool): Correct method of checking for GNU tools.
+
+ * checkout.c (checkout_proc): Match up user directories with
+ repository directories instead of using Emptydir.
+ * sanity.sh (cvsadm, emptydir): Update to match.
+
+2000-09-19 Larry Jones <larry.jones@sdrc.com>
+
+ * version.c: Push version number to 1.11.0.1.
* version.c: Version 1.11.
diff --git a/gnu/usr.bin/cvs/src/Makefile.am b/gnu/usr.bin/cvs/src/Makefile.am
new file mode 100644
index 00000000000..768d4f8651a
--- /dev/null
+++ b/gnu/usr.bin/cvs/src/Makefile.am
@@ -0,0 +1,144 @@
+## Process this file with automake to produce Makefile.in
+# Makefile for GNU CVS program.
+# Copyright (C) 1986, 1988-1990, 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+SHELL = /bin/sh
+
+# $(includeopt) is CVS specific and set by configure
+# FIXME - This includes line is dependant on its order. This means there is
+# some namespace hackery going on that maybe shouldn't be. Long term fix is to
+# try and remove naming ocnflicts and fix Automake to allow particular includes
+# to be attached only to particular object files. Short term fix is either or.
+##INCLUDES = -I. -I.. -I$(srcdir) -I$(top_srcdir)/lib
+INCLUDES = -I$(top_srcdir)/lib -I$(top_srcdir)/diff -I$(top_srcdir)/zlib $(includeopt)
+
+bin_PROGRAMS = cvs
+bin_SCRIPTS = cvsbug
+
+# The cvs executable
+cvs_SOURCES = \
+ add.c \
+ admin.c \
+ annotate.c \
+ buffer.c \
+ checkin.c \
+ checkout.c \
+ classify.c \
+ client.c \
+ commit.c \
+ create_adm.c \
+ cvsrc.c diff.c \
+ edit.c \
+ entries.c \
+ error.c \
+ expand_path.c \
+ fileattr.c \
+ filesubr.c \
+ find_names.c \
+ hardlink.c \
+ hash.c \
+ history.c \
+ ignore.c \
+ import.c \
+ lock.c \
+ log.c \
+ login.c \
+ logmsg.c \
+ main.c \
+ mkmodules.c \
+ modules.c \
+ myndbm.c \
+ no_diff.c \
+ parseinfo.c \
+ patch.c \
+ rcs.c \
+ rcscmds.c \
+ recurse.c \
+ release.c \
+ remove.c \
+ repos.c \
+ root.c \
+ run.c \
+ scramble.c \
+ server.c \
+ status.c \
+ subr.c \
+ tag.c \
+ update.c \
+ vers_ts.c \
+ watch.c \
+ wrapper.c \
+ zlib.c \
+ buffer.h \
+ client.h \
+ cvs.h \
+ edit.h \
+ error.h \
+ fileattr.h \
+ hardlink.h \
+ hash.h \
+ myndbm.h \
+ rcs.h \
+ server.h \
+ update.h \
+ watch.h
+cvs_LDADD = \
+ ../diff/libdiff.a \
+ ../lib/libcvs.a \
+ ../zlib/libz.a \
+ version.o
+cvs_EXTRA_DIST = version.c
+
+# extra clean targets
+# wish this could be distclean-hdr-local but it's not part of automake
+DISTCLEANFILES = options.h-SAVED check.log check.plog
+
+# General
+EXTRA_DIST = \
+ $(cvs_EXTRA_DIST) \
+ .cvsignore \
+ ChangeLog-9194 \
+ ChangeLog-9395 \
+ ChangeLog-96 \
+ ChangeLog-97 \
+ build_src.com \
+ sanity.sh \
+ version.c \
+ version.c.in
+
+check-local:
+ $(SHELL) $(srcdir)/sanity.sh `pwd`/cvs
+
+.PHONY: remotecheck
+remotecheck: all
+ $(SHELL) $(srcdir)/sanity.sh -r `pwd`/cvs
+
+## MAINTAINER Targets
+
+# version.c
+# - build this here so that we can distribute it
+# - version.c needs to be updated only once, since it depends on
+# configure.in, not on the results of a 'configure' run.
+# - It is guaranteed (with GNU Make) that when the version in configure.in
+# is changed, acversion.m4 is built only after the new version number is
+# propagated to the Makefile. (Libtool uses the same guarantee.)
+# - need the explicit version.o dependency or else make won't match
+# $(srcdir)/version.c when looking for a dependency for version.c
+version.o: $(srcdir)/version.c
+$(srcdir)/version.c: $(srcdir)/version.c.in $(top_srcdir)/configure.in
+ sed 's,@VERSION\@,$(VERSION),g' $(srcdir)/version.c.in >$(srcdir)/version.tc
+ mv $(srcdir)/version.tc $(srcdir)/version.c
+
+# for backwards compatibility with the old makefiles
+.PHONY: realclean
+realclean: maintainer-clean
diff --git a/gnu/usr.bin/cvs/src/add.c b/gnu/usr.bin/cvs/src/add.c
index dbefda59ca5..9ec6a3d63d4 100644
--- a/gnu/usr.bin/cvs/src/add.c
+++ b/gnu/usr.bin/cvs/src/add.c
@@ -93,7 +93,7 @@ add (argc, argv)
if (argc <= 0)
usage (add_usage);
- cvsroot_len = strlen (CVSroot_directory);
+ cvsroot_len = strlen (current_parsed_root->directory);
/* First some sanity checks. I know that the CVS case is (sort of)
also handled by add_directory, but we need to check here so the
@@ -111,7 +111,8 @@ add (argc, argv)
|| strcmp (argv[i], "..") == 0
|| fncmp (argv[i], CVSADM) == 0)
{
- error (0, 0, "cannot add special file `%s'; skipping", argv[i]);
+ if (!quiet)
+ error (0, 0, "cannot add special file `%s'; skipping", argv[i]);
skip_file = 1;
}
else
@@ -147,7 +148,7 @@ add (argc, argv)
}
#ifdef CLIENT_SUPPORT
- if (client_active)
+ if (current_parsed_root->isremote)
{
int i;
@@ -227,7 +228,7 @@ add (argc, argv)
repository = Name_Repository (NULL, update_dir);
/* don't add stuff to Emptydir */
- if (strncmp (repository, CVSroot_directory, cvsroot_len) == 0
+ if (strncmp (repository, current_parsed_root->directory, cvsroot_len) == 0
&& ISDIRSEP (repository[cvsroot_len])
&& strncmp (repository + cvsroot_len + 1,
CVSROOTADM,
@@ -323,7 +324,7 @@ add (argc, argv)
repository = Name_Repository (NULL, finfo.update_dir);
/* don't add stuff to Emptydir */
- if (strncmp (repository, CVSroot_directory, cvsroot_len) == 0
+ if (strncmp (repository, current_parsed_root->directory, cvsroot_len) == 0
&& ISDIRSEP (repository[cvsroot_len])
&& strncmp (repository + cvsroot_len + 1,
CVSROOTADM,
@@ -356,7 +357,7 @@ add (argc, argv)
error (1, errno, "cannot read directory %s", finfo.repository);
found_name = NULL;
errno = 0;
- while ((dp = readdir (dirp)) != NULL)
+ while ((dp = CVS_READDIR (dirp)) != NULL)
{
if (cvs_casecmp (dp->d_name, finfo.file) == 0)
{
@@ -368,7 +369,7 @@ add (argc, argv)
}
if (errno != 0)
error (1, errno, "cannot read directory %s", finfo.repository);
- closedir (dirp);
+ CVS_CLOSEDIR (dirp);
if (found_name != NULL)
{
@@ -448,8 +449,8 @@ add (argc, argv)
if (vers->nonbranch)
{
error (0, 0,
- "cannot add file on non-branch tag %s",
- vers->tag);
+ "cannot add file on non-branch tag %s",
+ vers->tag);
++err;
}
else
@@ -505,18 +506,21 @@ same name already exists in the repository.");
}
else
{
- if (vers->tag)
- error (0, 0, "\
+ if (!quiet)
+ {
+ if (vers->tag)
+ error (0, 0, "\
file `%s' will be added on branch `%s' from version %s",
- finfo.fullname, vers->tag, vers->vn_rcs);
- else
- /* I'm not sure that mentioning
- vers->vn_rcs makes any sense here; I
- can't think of a way to word the
- message which is not confusing. */
- error (0, 0, "\
+ finfo.fullname, vers->tag, vers->vn_rcs);
+ else
+ /* I'm not sure that mentioning
+ vers->vn_rcs makes any sense here; I
+ can't think of a way to word the
+ message which is not confusing. */
+ error (0, 0, "\
re-adding file %s (in place of dead revision %s)",
- finfo.fullname, vers->vn_rcs);
+ finfo.fullname, vers->vn_rcs);
+ }
Register (entries, finfo.file, "0", vers->ts_user,
vers->options,
vers->tag, NULL, NULL);
@@ -542,7 +546,8 @@ re-adding file %s (in place of dead revision %s)",
* An entry for a new-born file, ts_rcs is dummy, but that is
* inappropriate here
*/
- error (0, 0, "%s has already been entered", finfo.fullname);
+ if (!quiet)
+ error (0, 0, "%s has already been entered", finfo.fullname);
err++;
}
else if (vers->vn_user[0] == '-')
@@ -607,9 +612,10 @@ cannot resurrect %s; RCS file removed by second party", finfo.fullname);
else
{
/* A normal entry, ts_rcs is valid, so it must already be there */
- error (0, 0, "%s already exists, with version number %s",
- finfo.fullname,
- vers->vn_user);
+ if (!quiet)
+ error (0, 0, "%s already exists, with version number %s",
+ finfo.fullname,
+ vers->vn_user);
err++;
}
freevers_ts (&vers);
@@ -641,7 +647,7 @@ cannot resurrect %s; RCS file removed by second party", finfo.fullname);
free (found_name);
#endif
}
- if (added_files)
+ if (added_files && !really_quiet)
error (0, 0, "use '%s commit' to add %s permanently",
program_name,
(added_files == 1) ? "this file" : "these files");
diff --git a/gnu/usr.bin/cvs/src/annotate.c b/gnu/usr.bin/cvs/src/annotate.c
new file mode 100644
index 00000000000..827619d29b3
--- /dev/null
+++ b/gnu/usr.bin/cvs/src/annotate.c
@@ -0,0 +1,277 @@
+/*
+ * Copyright (c) 1992, Brian Berliner and Jeff Polk
+ * Copyright (c) 1989-1992, Brian Berliner
+ *
+ * You may distribute under the terms of the GNU General Public License as
+ * specified in the README file that comes with the CVS source distribution.
+ *
+ * Show last revision where each line modified
+ *
+ * Prints the specified files with each line annotated with the revision
+ * number where it was last modified. With no argument, annotates all
+ * all the files in the directory (recursive by default).
+ */
+
+#include "cvs.h"
+
+/* Options from the command line. */
+
+static int force_tag_match = 1;
+static char *tag = NULL;
+static int tag_validated;
+static char *date = NULL;
+
+static int is_rannotate;
+
+static int annotate_fileproc PROTO ((void *callerdat, struct file_info *));
+static int rannotate_proc PROTO((int argc, char **argv, char *xwhere,
+ char *mwhere, char *mfile, int shorten,
+ int local, char *mname, char *msg));
+
+static const char *const annotate_usage[] =
+{
+ "Usage: %s %s [-lRf] [-r rev] [-D date] [files...]\n",
+ "\t-l\tLocal directory only, no recursion.\n",
+ "\t-R\tProcess directories recursively.\n",
+ "\t-f\tUse head revision if tag/date not found.\n",
+ "\t-r rev\tAnnotate file as of specified revision/tag.\n",
+ "\t-D date\tAnnotate file as of specified date.\n",
+ "(Specify the --help global option for a list of other help options)\n",
+ NULL
+};
+
+/* Command to show the revision, date, and author where each line of a
+ file was modified. */
+
+int
+annotate (argc, argv)
+ int argc;
+ char **argv;
+{
+ int local = 0;
+ int err = 0;
+ int c;
+
+ is_rannotate = (strcmp(command_name, "rannotate") == 0);
+
+ if (argc == -1)
+ usage (annotate_usage);
+
+ optind = 0;
+ while ((c = getopt (argc, argv, "+lr:D:fR")) != -1)
+ {
+ switch (c)
+ {
+ case 'l':
+ local = 1;
+ break;
+ case 'R':
+ local = 0;
+ break;
+ case 'r':
+ tag = optarg;
+ break;
+ case 'D':
+ date = Make_Date (optarg);
+ break;
+ case 'f':
+ force_tag_match = 0;
+ break;
+ case '?':
+ default:
+ usage (annotate_usage);
+ break;
+ }
+ }
+ argc -= optind;
+ argv += optind;
+
+#ifdef CLIENT_SUPPORT
+ if (current_parsed_root->isremote)
+ {
+ start_server ();
+
+ if (is_rannotate && !supported_request ("rannotate"))
+ error (1, 0, "server does not support rannotate");
+
+ ign_setup ();
+
+ if (local)
+ send_arg ("-l");
+ if (!force_tag_match)
+ send_arg ("-f");
+ option_with_arg ("-r", tag);
+ if (date)
+ client_senddate (date);
+ if (is_rannotate)
+ {
+ int i;
+ for (i = 0; i < argc; i++)
+ send_arg (argv[i]);
+ send_to_server ("rannotate\012", 0);
+ }
+ else
+ {
+ send_files (argc, argv, local, 0, SEND_NO_CONTENTS);
+ send_file_names (argc, argv, SEND_EXPAND_WILD);
+ send_to_server ("annotate\012", 0);
+ }
+ return get_responses_and_close ();
+ }
+#endif /* CLIENT_SUPPORT */
+
+ if (is_rannotate)
+ {
+ DBM *db;
+ int i;
+ db = open_module ();
+ for (i = 0; i < argc; i++)
+ {
+ err += do_module (db, argv[i], MISC, "Annotating", rannotate_proc,
+ (char *) NULL, 0, 0, 0, 0, (char *) NULL);
+ }
+ close_module (db);
+ }
+ else
+ {
+ err = rannotate_proc (argc + 1, argv - 1, (char *) NULL,
+ (char *) NULL, (char *) NULL, 0, 0, (char *) NULL,
+ (char *) NULL);
+ }
+
+ return err;
+}
+
+
+static int
+rannotate_proc (argc, argv, xwhere, mwhere, mfile, shorten, local, mname, msg)
+ int argc;
+ char **argv;
+ char *xwhere;
+ char *mwhere;
+ char *mfile;
+ int shorten;
+ int local;
+ char *mname;
+ char *msg;
+{
+ /* Begin section which is identical to patch_proc--should this
+ be abstracted out somehow? */
+ char *myargv[2];
+ int err = 0;
+ int which;
+ char *repository;
+ char *where;
+
+ if (is_rannotate)
+ {
+ repository = xmalloc (strlen (current_parsed_root->directory) + strlen (argv[0])
+ + (mfile == NULL ? 0 : strlen (mfile) + 1) + 2);
+ (void) sprintf (repository, "%s/%s", current_parsed_root->directory, argv[0]);
+ where = xmalloc (strlen (argv[0]) + (mfile == NULL ? 0 : strlen (mfile) + 1)
+ + 1);
+ (void) strcpy (where, argv[0]);
+
+ /* if mfile isn't null, we need to set up to do only part of the module */
+ if (mfile != NULL)
+ {
+ char *cp;
+ char *path;
+
+ /* if the portion of the module is a path, put the dir part on repos */
+ if ((cp = strrchr (mfile, '/')) != NULL)
+ {
+ *cp = '\0';
+ (void) strcat (repository, "/");
+ (void) strcat (repository, mfile);
+ (void) strcat (where, "/");
+ (void) strcat (where, mfile);
+ mfile = cp + 1;
+ }
+
+ /* take care of the rest */
+ path = xmalloc (strlen (repository) + strlen (mfile) + 5);
+ (void) sprintf (path, "%s/%s", repository, mfile);
+ if (isdir (path))
+ {
+ /* directory means repository gets the dir tacked on */
+ (void) strcpy (repository, path);
+ (void) strcat (where, "/");
+ (void) strcat (where, mfile);
+ }
+ else
+ {
+ myargv[0] = argv[0];
+ myargv[1] = mfile;
+ argc = 2;
+ argv = myargv;
+ }
+ free (path);
+ }
+
+ /* cd to the starting repository */
+ if ( CVS_CHDIR (repository) < 0)
+ {
+ error (0, errno, "cannot chdir to %s", repository);
+ free (repository);
+ return (1);
+ }
+ free (repository);
+ /* End section which is identical to patch_proc. */
+
+ if (force_tag_match && tag != NULL)
+ which = W_REPOS | W_ATTIC;
+ else
+ which = W_REPOS;
+ repository = NULL;
+ }
+ else
+ {
+ where = NULL;
+ which = W_LOCAL;
+ repository = "";
+ }
+
+ if (tag != NULL && !tag_validated)
+ {
+ tag_check_valid (tag, argc - 1, argv + 1, local, 0, repository);
+ tag_validated = 1;
+ }
+
+ err = start_recursion (annotate_fileproc, (FILESDONEPROC) NULL,
+ (DIRENTPROC) NULL, (DIRLEAVEPROC) NULL, NULL,
+ argc - 1, argv + 1, local, which, 0, 1,
+ where, 1);
+ return err;
+}
+
+
+static int
+annotate_fileproc (callerdat, finfo)
+ void *callerdat;
+ struct file_info *finfo;
+{
+ char *version;
+
+ if (finfo->rcs == NULL)
+ return (1);
+
+ if (finfo->rcs->flags & PARTIAL)
+ RCS_reparsercsfile (finfo->rcs, (FILE **) NULL, (struct rcsbuffer *) NULL);
+
+ version = RCS_getversion (finfo->rcs, tag, date, force_tag_match,
+ (int *) NULL);
+ if (version == NULL)
+ return 0;
+
+ /* Distinguish output for various files if we are processing
+ several files. */
+ cvs_outerr ("Annotations for ", 0);
+ cvs_outerr (finfo->fullname, 0);
+ cvs_outerr ("\n***************\n", 0);
+
+ RCS_deltas (finfo->rcs, (FILE *) NULL, (struct rcsbuffer *) NULL,
+ version, RCS_ANNOTATE, NULL, NULL, NULL, NULL);
+ free (version);
+ return 0;
+}
diff --git a/gnu/usr.bin/cvs/src/build_src.com b/gnu/usr.bin/cvs/src/build_src.com
index 3d3baa65891..b9a2b8144dd 100644
--- a/gnu/usr.bin/cvs/src/build_src.com
+++ b/gnu/usr.bin/cvs/src/build_src.com
@@ -39,7 +39,6 @@ $ CC release.c
$ CC remove.c
$ CC repos.c
$ CC root.c
-$ CC rtag.c
$ CC run.c
$ CC scramble.c
$ CC server.c
@@ -60,9 +59,9 @@ find_names.obj,hash.obj,history.obj,ignore.obj,import.obj,-
lock.obj,log.obj,login.obj,logmsg.obj,mkmodules.obj,modules.obj,myndbm.obj,-
no_diff.obj,-
parseinfo.obj,patch.obj,rcs.obj,rcscmds.obj,recurse.obj,release.obj,-
-remove.obj,repos.obj,root.obj,rtag.obj,run.obj,scramble.obj,server.obj,-
+remove.obj,repos.obj,root.obj,run.obj,scramble.obj,server.obj,-
status.obj,-
subr.obj,tag.obj,update.obj,version.obj,vers_ts.obj,watch.obj,wrapper.obj,-
zlib.obj
-$ link/nodeb/exe=cvs.exe main.obj,cvslib.olb/lib,[-.lib]gnulib.olb/lib,-
-[-.vms]openvmslib.olb/lib,[-.zlib]zlib.olb/lib,[-.diff]diff.olb/lib
+$ link/nodeb/exe=cvs.exe main.obj,cvslib.olb/lib,[-.vms]openvmslib.olb/lib,-
+ [-.zlib]zlib.olb/lib,[-.diff]diff.olb/lib,[-.lib]gnulib.olb/lib
diff --git a/gnu/usr.bin/cvs/src/classify.c b/gnu/usr.bin/cvs/src/classify.c
index b0084a3d0fa..9a6489e0384 100644
--- a/gnu/usr.bin/cvs/src/classify.c
+++ b/gnu/usr.bin/cvs/src/classify.c
@@ -74,6 +74,7 @@ Classify_File (finfo, tag, date, options, force_tag_match, aflag, versp,
}
else if (RCS_isdead (vers->srcfile, vers->vn_rcs))
{
+ /* there is an RCS file, but it's dead */
if (vers->ts_user == NULL)
ret = T_UPTODATE;
else
@@ -83,43 +84,17 @@ Classify_File (finfo, tag, date, options, force_tag_match, aflag, versp,
ret = T_UNKNOWN;
}
}
- else
+ else if (!pipeout && vers->ts_user && No_Difference (finfo, vers))
{
- /* there is an rcs file */
-
- if (vers->ts_user == NULL)
- {
- /* There is no user file; needs checkout */
- ret = T_CHECKOUT;
- }
- else
- {
- if (pipeout)
- {
- /*
- * The user file doesn't necessarily have anything
- * to do with this.
- */
- ret = T_CHECKOUT;
- }
- /*
- * There is a user file; print a warning and add it to the
- * conflict list, only if it is indeed different from what we
- * plan to extract
- */
- else if (No_Difference (finfo, vers))
- {
- /* the files were different so it is a conflict */
- if (!really_quiet)
- error (0, 0, "move away %s; it is in the way",
- finfo->fullname);
- ret = T_CONFLICT;
- }
- else
- /* since there was no difference, still needs checkout */
- ret = T_CHECKOUT;
- }
+ /* the files were different so it is a conflict */
+ if (!really_quiet)
+ error (0, 0, "move away %s; it is in the way",
+ finfo->fullname);
+ ret = T_CONFLICT;
}
+ else
+ /* no user file or no difference, just checkout */
+ ret = T_CHECKOUT;
}
else if (strcmp (vers->vn_user, "0") == 0)
{
@@ -135,44 +110,35 @@ Classify_File (finfo, tag, date, options, force_tag_match, aflag, versp,
error (0, 0, "warning: new-born %s has disappeared", finfo->fullname);
ret = T_REMOVE_ENTRY;
}
+ else if (vers->vn_rcs == NULL ||
+ RCS_isdead (vers->srcfile, vers->vn_rcs))
+ /* No RCS file or RCS file revision is dead */
+ ret = T_ADDED;
else
{
- /* There is a user file */
-
- if (vers->vn_rcs == NULL)
- /* There is no RCS file, added file */
- ret = T_ADDED;
- else if (RCS_isdead (vers->srcfile, vers->vn_rcs))
- /* we are resurrecting. */
- ret = T_ADDED;
+ if (vers->srcfile->flags & INATTIC
+ && vers->srcfile->flags & VALID)
+ {
+ /* This file has been added on some branch other than
+ the one we are looking at. In the branch we are
+ looking at, the file was already valid. */
+ if (!really_quiet)
+ error (0, 0,
+ "conflict: %s has been added, but already exists",
+ finfo->fullname);
+ }
else
{
- if (vers->srcfile->flags & INATTIC
- && vers->srcfile->flags & VALID)
- {
- /* This file has been added on some branch other than
- the one we are looking at. In the branch we are
- looking at, the file was already valid. */
- if (!really_quiet)
- error (0, 0,
- "\
-conflict: %s has been added, but already exists",
- finfo->fullname);
- }
- else
- {
- /*
- * There is an RCS file, so someone else must have checked
- * one in behind our back; conflict
- */
- if (!really_quiet)
- error (0, 0,
- "\
-conflict: %s created independently by second party",
- finfo->fullname);
- }
- ret = T_CONFLICT;
+ /*
+ * There is an RCS file, so someone else must have checked
+ * one in behind our back; conflict
+ */
+ if (!really_quiet)
+ error (0, 0,
+ "conflict: %s created independently by second party",
+ finfo->fullname);
}
+ ret = T_CONFLICT;
}
}
else if (vers->vn_user[0] == '-')
@@ -193,14 +159,18 @@ conflict: %s created independently by second party",
*/
ret = T_REMOVE_ENTRY;
}
- else if (vers->vn_rcs == NULL
- ? vers->vn_user[1] == '\0'
- : strcmp (vers->vn_rcs, vers->vn_user + 1) == 0)
+ else if (strcmp (vers->vn_rcs, vers->vn_user + 1) == 0)
/*
* The RCS file is the same version as the user file was, and
* that's OK; remove it
*/
ret = T_REMOVED;
+ else if (pipeout)
+ /*
+ * The RCS file doesn't match the user's file, but it doesn't
+ * matter in this case
+ */
+ ret = T_NEEDS_MERGE;
else
{
@@ -227,7 +197,7 @@ conflict: %s created independently by second party",
else
{
/* A normal entry, TS_Rcs is valid */
- if (vers->vn_rcs == NULL)
+ if (vers->vn_rcs == NULL || RCS_isdead (vers->srcfile, vers->vn_rcs))
{
/* There is no RCS file */
@@ -251,30 +221,23 @@ conflict: %s created independently by second party",
finfo->fullname);
ret = T_REMOVE_ENTRY;
}
- else
+ else if (No_Difference (finfo, vers))
{
- /*
- * The user file has been modified and since it is no longer
- * in the repository, a conflict is raised
- */
- if (No_Difference (finfo, vers))
- {
- /* they are different -> conflict */
- if (!really_quiet)
- error (0, 0,
+ /* they are different -> conflict */
+ if (!really_quiet)
+ error (0, 0,
"conflict: %s is modified but no longer in the repository",
finfo->fullname);
- ret = T_CONFLICT;
- }
- else
- {
- /* they weren't really different */
- if (!really_quiet)
- error (0, 0,
- "warning: %s is not (any longer) pertinent",
- finfo->fullname);
- ret = T_REMOVE_ENTRY;
- }
+ ret = T_CONFLICT;
+ }
+ else
+ {
+ /* they weren't really different */
+ if (!really_quiet)
+ error (0, 0,
+ "warning: %s is not (any longer) pertinent",
+ finfo->fullname);
+ ret = T_REMOVE_ENTRY;
}
}
else if (strcmp (vers->vn_rcs, vers->vn_user) == 0)
@@ -321,50 +284,39 @@ conflict: %s created independently by second party",
ret = T_UPTODATE;
}
}
- else
+ else if (No_Difference (finfo, vers))
{
/*
- * The user file appears to have been modified, but we call
- * No_Difference to verify that it really has been modified
+ * they really are different; modified if we aren't
+ * changing any sticky -k options, else needs merge
*/
- if (No_Difference (finfo, vers))
- {
-
- /*
- * they really are different; modified if we aren't
- * changing any sticky -k options, else needs merge
- */
#ifdef XXX_FIXME_WHEN_RCSMERGE_IS_FIXED
- if (strcmp (vers->entdata->options ?
- vers->entdata->options : "", vers->options) == 0)
- ret = T_MODIFIED;
- else
- ret = T_NEEDS_MERGE;
-#else
+ if (strcmp (vers->entdata->options ?
+ vers->entdata->options : "", vers->options) == 0)
ret = T_MODIFIED;
- sticky_ck (finfo, aflag, vers);
-#endif
- }
else
- {
- /* file has not changed; check out if -k changed */
- if (strcmp (vers->entdata->options ?
- vers->entdata->options : "", vers->options) != 0)
- {
- ret = T_CHECKOUT;
- }
- else
- {
+ ret = T_NEEDS_MERGE;
+#else
+ ret = T_MODIFIED;
+ sticky_ck (finfo, aflag, vers);
+#endif
+ }
+ else if (strcmp (vers->entdata->options ?
+ vers->entdata->options : "", vers->options) != 0)
+ {
+ /* file has not changed; check out if -k changed */
+ ret = T_CHECKOUT;
+ }
+ else
+ {
- /*
- * else -> note that No_Difference will Register the
- * file already for us, using the new tag/date. This
- * is the desired behaviour
- */
- ret = T_UPTODATE;
- }
- }
+ /*
+ * else -> note that No_Difference will Register the
+ * file already for us, using the new tag/date. This
+ * is the desired behaviour
+ */
+ ret = T_UPTODATE;
}
}
else
@@ -388,7 +340,6 @@ conflict: %s created independently by second party",
/*
* The user file is still unmodified, so just get it as well
*/
-#ifdef SERVER_SUPPORT
if (strcmp (vers->entdata->options ?
vers->entdata->options : "", vers->options) != 0
|| (vers->srcfile != NULL
@@ -396,31 +347,19 @@ conflict: %s created independently by second party",
ret = T_CHECKOUT;
else
ret = T_PATCH;
-#else
- ret = T_CHECKOUT;
-#endif
}
+ else if (No_Difference (finfo, vers))
+ /* really modified, needs to merge */
+ ret = T_NEEDS_MERGE;
+ else if ((strcmp (vers->entdata->options ?
+ vers->entdata->options : "", vers->options)
+ != 0)
+ || (vers->srcfile != NULL
+ && (vers->srcfile->flags & INATTIC) != 0))
+ /* not really modified, check it out */
+ ret = T_CHECKOUT;
else
- {
- if (No_Difference (finfo, vers))
- /* really modified, needs to merge */
- ret = T_NEEDS_MERGE;
-#ifdef SERVER_SUPPORT
- else if ((strcmp (vers->entdata->options ?
- vers->entdata->options : "", vers->options)
- != 0)
- || (vers->srcfile != NULL
- && (vers->srcfile->flags & INATTIC) != 0))
- /* not really modified, check it out */
- ret = T_CHECKOUT;
- else
- ret = T_PATCH;
-#else
- else
- /* not really modified, check it out */
- ret = T_CHECKOUT;
-#endif
- }
+ ret = T_PATCH;
}
}
diff --git a/gnu/usr.bin/cvs/src/create_adm.c b/gnu/usr.bin/cvs/src/create_adm.c
index 878b05891a4..1ab0f286cd3 100644
--- a/gnu/usr.bin/cvs/src/create_adm.c
+++ b/gnu/usr.bin/cvs/src/create_adm.c
@@ -84,7 +84,7 @@ Create_Admin (dir, update_dir, repository, tag, date, nonbranch, warn,
/* record the current cvs root for later use */
- Create_Root (dir, CVSroot_original);
+ Create_Root (dir, current_parsed_root->original);
if (dir != NULL)
(void) sprintf (tmp, "%s/%s", dir, CVSADM_REP);
else
@@ -106,7 +106,7 @@ Create_Admin (dir, update_dir, repository, tag, date, nonbranch, warn,
spend the time making sure all of the code can handle it if we
don't do it. */
- if (strcmp (reposcopy, CVSroot_directory) == 0)
+ if (strcmp (reposcopy, current_parsed_root->directory) == 0)
{
reposcopy = xrealloc (reposcopy, strlen (reposcopy) + 3);
strcat (reposcopy, "/.");
@@ -119,14 +119,13 @@ Create_Admin (dir, update_dir, repository, tag, date, nonbranch, warn,
* If the Repository file is to hold a relative path, try to strip off
* the leading CVSroot argument.
*/
- if (CVSroot_directory != NULL)
{
- char *path = xmalloc (strlen (CVSroot_directory) + 10);
+ char *path = xmalloc (strlen (current_parsed_root->directory) + 2);
- (void) sprintf (path, "%s/", CVSroot_directory);
- if (strncmp (cp, path, strlen (path)) == 0)
- cp += strlen (path);
- free (path);
+ (void) sprintf (path, "%s/", current_parsed_root->directory);
+ if (strncmp (cp, path, strlen (path)) == 0)
+ cp += strlen (path);
+ free (path);
}
#endif
diff --git a/gnu/usr.bin/cvs/src/cvsbug.in b/gnu/usr.bin/cvs/src/cvsbug.in
new file mode 100644
index 00000000000..8a8dc0dde3b
--- /dev/null
+++ b/gnu/usr.bin/cvs/src/cvsbug.in
@@ -0,0 +1,526 @@
+#! /bin/sh
+# Submit a problem report to a GNATS site.
+# Copyright (C) 1993 Free Software Foundation, Inc.
+# Contributed by Brendan Kehoe (brendan@cygnus.com), based on a
+# version written by Heinz G. Seidl (hgs@ide.com).
+#
+# This file is part of GNU GNATS.
+# Modified by Berliner for CVS.
+#
+# GNU GNATS is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# GNU GNATS is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# The version of this send-pr.
+VERSION=3.2
+
+# The submitter-id for your site.
+SUBMITTER=net
+
+## # Where the GNATS directory lives, if at all.
+## [ -z "$GNATS_ROOT" ] &&
+## GNATS_ROOT=/usr/local/lib/gnats/gnats-db
+
+# The default mail address for PR submissions.
+GNATS_ADDR=bug-cvs@gnu.org
+
+## # Where the gnats category tree lives.
+## DATADIR=/usr/local/lib
+
+## # If we've been moved around, try using GCC_EXEC_PREFIX.
+## [ ! -d $DATADIR/gnats -a -d "$GCC_EXEC_PREFIX" ] && DATADIR=${GCC_EXEC_PREFIX}..
+
+# The default release for this host.
+DEFAULT_RELEASE="@VERSION@"
+
+# The default organization.
+DEFAULT_ORGANIZATION="net"
+
+## # The default site to look for.
+## GNATS_SITE=unknown
+
+## # Newer config information?
+## [ -f ${GNATS_ROOT}/gnats-adm/config ] && . ${GNATS_ROOT}/gnats-adm/config
+
+# What mailer to use. This must come after the config file, since it is
+# host-dependent.
+if [ -f /usr/sbin/sendmail ]; then
+ MAIL_AGENT="/usr/sbin/sendmail -oi -t"
+else
+ MAIL_AGENT="/usr/lib/sendmail -oi -t"
+fi
+MAILER=`echo $MAIL_AGENT | sed -e 's, .*,,'`
+if [ ! -f "$MAILER" ] ; then
+ echo "$COMMAND: Cannot file mail program \"$MAILER\"."
+ echo "$COMMAND: Please fix the MAIL_AGENT entry in the $COMMAND file."
+ exit 1
+fi
+
+if test "`echo -n foo`" = foo ; then
+ ECHON=bsd
+elif test "`echo 'foo\c'`" = foo ; then
+ ECHON=sysv
+else
+ ECHON=none
+fi
+
+if [ $ECHON = bsd ] ; then
+ ECHON1="echo -n"
+ ECHON2=
+elif [ $ECHON = sysv ] ; then
+ ECHON1=echo
+ ECHON2='\c'
+else
+ ECHON1=echo
+ ECHON2=
+fi
+
+#
+
+[ -z "$TMPDIR" ] && TMPDIR=/tmp
+
+TEMP=$TMPDIR/p$$
+BAD=$TMPDIR/pbad$$
+REF=$TMPDIR/pf$$
+
+if [ -z "$LOGNAME" -a -n "$USER" ]; then
+ LOGNAME=$USER
+fi
+
+FROM="$LOGNAME"
+REPLY_TO="$LOGNAME"
+
+# Find out the name of the originator of this PR.
+if [ -n "$NAME" ]; then
+ ORIGINATOR="$NAME"
+elif [ -f $HOME/.fullname ]; then
+ ORIGINATOR="`sed -e '1q' $HOME/.fullname`"
+elif [ -f /bin/domainname ]; then
+ if [ "`/bin/domainname`" != "" -a -f /usr/bin/ypcat ]; then
+ # Must use temp file due to incompatibilities in quoting behavior
+ # and to protect shell metacharacters in the expansion of $LOGNAME
+ /usr/bin/ypcat passwd 2>/dev/null | cat - /etc/passwd | grep "^$LOGNAME:" |
+ cut -f5 -d':' | sed -e 's/,.*//' > $TEMP
+ ORIGINATOR="`cat $TEMP`"
+ rm -f $TEMP
+ fi
+fi
+
+if [ "$ORIGINATOR" = "" ]; then
+ grep "^$LOGNAME:" /etc/passwd | cut -f5 -d':' | sed -e 's/,.*//' > $TEMP
+ ORIGINATOR="`cat $TEMP`"
+ rm -f $TEMP
+fi
+
+if [ -n "$ORGANIZATION" ]; then
+ if [ -f "$ORGANIZATION" ]; then
+ ORGANIZATION="`cat $ORGANIZATION`"
+ fi
+else
+ if [ -n "$DEFAULT_ORGANIZATION" ]; then
+ ORGANIZATION="$DEFAULT_ORGANIZATION"
+ elif [ -f $HOME/.organization ]; then
+ ORGANIZATION="`cat $HOME/.organization`"
+ elif [ -f $HOME/.signature ]; then
+ ORGANIZATION="`cat $HOME/.signature`"
+ fi
+fi
+
+# If they don't have a preferred editor set, then use
+if [ -z "$VISUAL" ]; then
+ if [ -z "$EDITOR" ]; then
+ EDIT=vi
+ else
+ EDIT="$EDITOR"
+ fi
+else
+ EDIT="$VISUAL"
+fi
+
+# Find out some information.
+SYSTEM=`( [ -f /bin/uname ] && /bin/uname -a ) || \
+ ( [ -f /usr/bin/uname ] && /usr/bin/uname -a ) || echo ""`
+ARCH=`[ -f /bin/arch ] && /bin/arch`
+MACHINE=`[ -f /bin/machine ] && /bin/machine`
+
+COMMAND=`echo $0 | sed -e 's,.*/,,'`
+## USAGE="Usage: $COMMAND [-PVL] [-t address] [-f filename] [--request-id]
+USAGE="Usage: $COMMAND [-PVL]
+[--version]"
+REMOVE=
+BATCH=
+
+while [ $# -gt 0 ]; do
+ case "$1" in
+ -r) ;; # Ignore for backward compat.
+## -t | --to) if [ $# -eq 1 ]; then echo "$USAGE"; exit 1; fi
+## shift ; GNATS_ADDR="$1"
+## EXPLICIT_GNATS_ADDR=true
+## ;;
+## -f | --file) if [ $# -eq 1 ]; then echo "$USAGE"; exit 1; fi
+## shift ; IN_FILE="$1"
+## if [ "$IN_FILE" != "-" -a ! -r "$IN_FILE" ]; then
+## echo "$COMMAND: cannot read $IN_FILE"
+## exit 1
+## fi
+## ;;
+ -b | --batch) BATCH=true ;;
+ -p | -P | --print) PRINT=true ;;
+ -L | --list) FORMAT=norm ;;
+ -l | -CL | --lisp) FORMAT=lisp ;;
+## --request-id) REQUEST_ID=true ;;
+ -h | --help) echo "$USAGE"; exit 0 ;;
+ -V | --version) echo "$VERSION"; exit 0 ;;
+ -*) echo "$USAGE" ; exit 1 ;;
+ *) echo "$USAGE" ; exit 1
+## if [ -z "$USER_GNATS_SITE" ]; then
+## if [ ! -r "$DATADIR/gnats/$1" ]; then
+## echo "$COMMAND: the GNATS site $1 does not have a categories list."
+## exit 1
+## else
+## # The site name is the alias they'll have to have created.
+## USER_GNATS_SITE=$1
+## fi
+## else
+## echo "$USAGE" ; exit 1
+## fi
+ ;;
+ esac
+ shift
+done
+
+if [ -n "$USER_GNATS_SITE" ]; then
+ GNATS_SITE=$USER_GNATS_SITE
+ GNATS_ADDR=$USER_GNATS_SITE-gnats
+fi
+
+if [ "$SUBMITTER" = "unknown" -a -z "$REQUEST_ID" -a -z "$IN_FILE" ]; then
+ cat << '__EOF__'
+It seems that send-pr is not installed with your unique submitter-id.
+You need to run
+
+ install-sid YOUR-SID
+
+where YOUR-SID is the identification code you received with `send-pr'.
+`send-pr' will automatically insert this value into the template field
+`>Submitter-Id'. If you've downloaded `send-pr' from the Net, use `net'
+for this value. If you do not know your id, run `send-pr --request-id' to
+get one from your support site.
+__EOF__
+ exit 1
+fi
+
+## if [ -r "$DATADIR/gnats/$GNATS_SITE" ]; then
+## CATEGORIES=`grep -v '^#' $DATADIR/gnats/$GNATS_SITE | sort`
+## else
+## echo "$COMMAND: could not read $DATADIR/gnats/$GNATS_SITE for categories list."
+## exit 1
+## fi
+CATEGORIES="contrib cvs doc pcl-cvs portability"
+
+if [ -z "$CATEGORIES" ]; then
+ echo "$COMMAND: the categories list for $GNATS_SITE was empty!"
+ exit 1
+fi
+
+case "$FORMAT" in
+ lisp) echo "$CATEGORIES" | \
+ awk 'BEGIN {printf "( "}
+ {printf "(\"%s\") ",$0}
+ END {printf ")\n"}'
+ exit 0
+ ;;
+ norm) l=`echo "$CATEGORIES" | \
+ awk 'BEGIN {max = 0; }
+ { if (length($0) > max) { max = length($0); } }
+ END {print max + 1;}'`
+ c=`expr 70 / $l`
+ if [ $c -eq 0 ]; then c=1; fi
+ echo "$CATEGORIES" | \
+ awk 'BEGIN {print "Known categories:"; i = 0 }
+ { printf ("%-'$l'.'$l's", $0); if ((++i % '$c') == 0) { print "" } }
+ END { print ""; }'
+ exit 0
+ ;;
+esac
+
+ORIGINATOR_C='<name of the PR author (one line)>'
+ORGANIZATION_C='<organization of PR author (multiple lines)>'
+CONFIDENTIAL_C='<[ yes | no ] (one line)>'
+SYNOPSIS_C='<synopsis of the problem (one line)>'
+SEVERITY_C='<[ non-critical | serious | critical ] (one line)>'
+PRIORITY_C='<[ low | medium | high ] (one line)>'
+CATEGORY_C='<name of the product (one line)>'
+CLASS_C='<[ sw-bug | doc-bug | change-request | support ] (one line)>'
+RELEASE_C='<release number or tag (one line)>'
+ENVIRONMENT_C='<machine, os, target, libraries (multiple lines)>'
+DESCRIPTION_C='<precise description of the problem (multiple lines)>'
+HOW_TO_REPEAT_C='<code/input/activities to reproduce the problem (multiple lines)>'
+FIX_C='<how to correct or work around the problem, if known (multiple lines)>'
+
+# Catch some signals. ($xs kludge needed by Sun /bin/sh)
+xs=0
+trap 'rm -f $REF $TEMP; exit $xs' 0
+trap 'echo "$COMMAND: Aborting ..."; rm -f $REF $TEMP; xs=1; exit' 1 2 3 13 15
+
+# If they told us to use a specific file, then do so.
+if [ -n "$IN_FILE" ]; then
+ if [ "$IN_FILE" = "-" ]; then
+ # The PR is coming from the standard input.
+ if [ -n "$EXPLICIT_GNATS_ADDR" ]; then
+ sed -e "s;^[Tt][Oo]:.*;To: $GNATS_ADDR;" > $TEMP
+ else
+ cat > $TEMP
+ fi
+ else
+ # Use the file they named.
+ if [ -n "$EXPLICIT_GNATS_ADDR" ]; then
+ sed -e "s;^[Tt][Oo]:.*;To: $GNATS_ADDR;" $IN_FILE > $TEMP
+ else
+ cat $IN_FILE > $TEMP
+ fi
+ fi
+else
+
+ if [ -n "$PR_FORM" -a -z "$PRINT_INTERN" ]; then
+ # If their PR_FORM points to a bogus entry, then bail.
+ if [ ! -f "$PR_FORM" -o ! -r "$PR_FORM" -o ! -s "$PR_FORM" ]; then
+ echo "$COMMAND: can't seem to read your template file (\`$PR_FORM'), ignoring PR_FORM"
+ sleep 1
+ PRINT_INTERN=bad_prform
+ fi
+ fi
+
+ if [ -n "$PR_FORM" -a -z "$PRINT_INTERN" ]; then
+ cp $PR_FORM $TEMP ||
+ ( echo "$COMMAND: could not copy $PR_FORM" ; xs=1; exit )
+ else
+ for file in $TEMP $REF ; do
+ cat > $file << '__EOF__'
+SEND-PR: -*- send-pr -*-
+SEND-PR: Lines starting with `SEND-PR' will be removed automatically, as
+SEND-PR: will all comments (text enclosed in `<' and `>').
+SEND-PR:
+SEND-PR: Choose from the following categories:
+SEND-PR:
+__EOF__
+
+ # Format the categories so they fit onto lines.
+ l=`echo "$CATEGORIES" | \
+ awk 'BEGIN {max = 0; }
+ { if (length($0) > max) { max = length($0); } }
+ END {print max + 1;}'`
+ c=`expr 61 / $l`
+ if [ $c -eq 0 ]; then c=1; fi
+ echo "$CATEGORIES" | \
+ awk 'BEGIN {printf "SEND-PR: "; i = 0 }
+ { printf ("%-'$l'.'$l's", $0);
+ if ((++i % '$c') == 0) { printf "\nSEND-PR: " } }
+ END { printf "\nSEND-PR:\n"; }' >> $file
+
+ cat >> $file << __EOF__
+To: $GNATS_ADDR
+Subject:
+From: $FROM
+Reply-To: $REPLY_TO
+X-send-pr-version: $VERSION
+
+
+>Submitter-Id: $SUBMITTER
+>Originator: $ORIGINATOR
+>Organization:
+${ORGANIZATION-$ORGANIZATION_C}
+>Confidential: $CONFIDENTIAL_C
+>Synopsis: $SYNOPSIS_C
+>Severity: $SEVERITY_C
+>Priority: $PRIORITY_C
+>Category: $CATEGORY_C
+>Class: $CLASS_C
+>Release: ${DEFAULT_RELEASE-$RELEASE_C}
+>Environment:
+ $ENVIRONMENT_C
+`[ -n "$SYSTEM" ] && echo System: $SYSTEM`
+`[ -n "$ARCH" ] && echo Architecture: $ARCH`
+`[ -n "$MACHINE" ] && echo Machine: $MACHINE`
+>Description:
+ $DESCRIPTION_C
+>How-To-Repeat:
+ $HOW_TO_REPEAT_C
+>Fix:
+ $FIX_C
+__EOF__
+ done
+ fi
+
+ if [ "$PRINT" = true -o "$PRINT_INTERN" = true ]; then
+ cat $TEMP
+ xs=0; exit
+ fi
+
+ chmod u+w $TEMP
+ if [ -z "$REQUEST_ID" ]; then
+ eval $EDIT $TEMP
+ else
+ ed -s $TEMP << '__EOF__'
+/^Subject/s/^Subject:.*/Subject: request for a customer id/
+/^>Category/s/^>Category:.*/>Category: send-pr/
+w
+q
+__EOF__
+ fi
+
+ if cmp -s $REF $TEMP ; then
+ echo "$COMMAND: problem report not filled out, therefore not sent"
+ xs=1; exit
+ fi
+fi
+
+#
+# Check the enumeration fields
+
+# This is a "sed-subroutine" with one keyword parameter
+# (with workaround for Sun sed bug)
+#
+SED_CMD='
+/$PATTERN/{
+s|||
+s|<.*>||
+s|^[ ]*||
+s|[ ]*$||
+p
+q
+}'
+
+
+while [ -z "$REQUEST_ID" ]; do
+ CNT=0
+
+ # 1) Confidential
+ #
+ PATTERN=">Confidential:"
+ CONFIDENTIAL=`eval sed -n -e "\"$SED_CMD\"" $TEMP`
+ case "$CONFIDENTIAL" in
+ ""|yes|no) CNT=`expr $CNT + 1` ;;
+ *) echo "$COMMAND: \`$CONFIDENTIAL' is not a valid value for \`Confidential'." ;;
+ esac
+ #
+ # 2) Severity
+ #
+ PATTERN=">Severity:"
+ SEVERITY=`eval sed -n -e "\"$SED_CMD\"" $TEMP`
+ case "$SEVERITY" in
+ ""|non-critical|serious|critical) CNT=`expr $CNT + 1` ;;
+ *) echo "$COMMAND: \`$SEVERITY' is not a valid value for \`Severity'."
+ esac
+ #
+ # 3) Priority
+ #
+ PATTERN=">Priority:"
+ PRIORITY=`eval sed -n -e "\"$SED_CMD\"" $TEMP`
+ case "$PRIORITY" in
+ ""|low|medium|high) CNT=`expr $CNT + 1` ;;
+ *) echo "$COMMAND: \`$PRIORITY' is not a valid value for \`Priority'."
+ esac
+ #
+ # 4) Category
+ #
+ PATTERN=">Category:"
+ CATEGORY=`eval sed -n -e "\"$SED_CMD\"" $TEMP`
+ FOUND=
+ for C in $CATEGORIES
+ do
+ if [ "$C" = "$CATEGORY" ]; then FOUND=true ; break ; fi
+ done
+ if [ -n "$FOUND" ]; then
+ CNT=`expr $CNT + 1`
+ else
+ if [ -z "$CATEGORY" ]; then
+ echo "$COMMAND: you must include a Category: field in your report."
+ else
+ echo "$COMMAND: \`$CATEGORY' is not a known category."
+ fi
+ fi
+ #
+ # 5) Class
+ #
+ PATTERN=">Class:"
+ CLASS=`eval sed -n -e "\"$SED_CMD\"" $TEMP`
+ case "$CLASS" in
+ ""|sw-bug|doc-bug|change-request|support) CNT=`expr $CNT + 1` ;;
+ *) echo "$COMMAND: \`$CLASS' is not a valid value for \`Class'."
+ esac
+
+ [ $CNT -lt 5 -a -z "$BATCH" ] &&
+ echo "Errors were found with the problem report."
+
+ while true; do
+ if [ -z "$BATCH" ]; then
+ $ECHON1 "a)bort, e)dit or s)end? $ECHON2"
+ read input
+ else
+ if [ $CNT -eq 5 ]; then
+ input=s
+ else
+ input=a
+ fi
+ fi
+ case "$input" in
+ a*)
+ if [ -z "$BATCH" ]; then
+ echo "$COMMAND: the problem report remains in $BAD and is not sent."
+ mv $TEMP $BAD
+ else
+ echo "$COMMAND: the problem report is not sent."
+ fi
+ xs=1; exit
+ ;;
+ e*)
+ eval $EDIT $TEMP
+ continue 2
+ ;;
+ s*)
+ break 2
+ ;;
+ esac
+ done
+done
+#
+# Remove comments and send the problem report
+# (we have to use patterns, where the comment contains regex chars)
+#
+# /^>Originator:/s;$ORIGINATOR;;
+sed -e "
+/^SEND-PR:/d
+/^>Organization:/,/^>[A-Za-z-]*:/s;$ORGANIZATION_C;;
+/^>Confidential:/s;<.*>;;
+/^>Synopsis:/s;$SYNOPSIS_C;;
+/^>Severity:/s;<.*>;;
+/^>Priority:/s;<.*>;;
+/^>Category:/s;$CATEGORY_C;;
+/^>Class:/s;<.*>;;
+/^>Release:/,/^>[A-Za-z-]*:/s;$RELEASE_C;;
+/^>Environment:/,/^>[A-Za-z-]*:/s;$ENVIRONMENT_C;;
+/^>Description:/,/^>[A-Za-z-]*:/s;$DESCRIPTION_C;;
+/^>How-To-Repeat:/,/^>[A-Za-z-]*:/s;$HOW_TO_REPEAT_C;;
+/^>Fix:/,/^>[A-Za-z-]*:/s;$FIX_C;;
+" $TEMP > $REF
+
+if $MAIL_AGENT < $REF; then
+ echo "$COMMAND: problem report sent"
+ xs=0; exit
+else
+ echo "$COMMAND: mysterious mail failure."
+ if [ -z "$BATCH" ]; then
+ echo "$COMMAND: the problem report remains in $BAD and is not sent."
+ mv $REF $BAD
+ else
+ echo "$COMMAND: the problem report is not sent."
+ fi
+ xs=1; exit
+fi
diff --git a/gnu/usr.bin/cvs/src/error.c b/gnu/usr.bin/cvs/src/error.c
index fe5877f3d6e..9655a97ba96 100644
--- a/gnu/usr.bin/cvs/src/error.c
+++ b/gnu/usr.bin/cvs/src/error.c
@@ -121,7 +121,9 @@ error (status, errnum, message, va_alist)
char *q;
char *str;
int num;
+ long lnum;
unsigned int unum;
+ unsigned long ulnum;
int ch;
char buf[100];
@@ -157,6 +159,21 @@ error (status, errnum, message, va_alist)
sprintf (buf, "%d", num);
cvs_outerr (buf, strlen (buf));
break;
+ case 'l':
+ if (q[2] == 'd')
+ {
+ lnum = va_arg (args, long);
+ sprintf (buf, "%ld", lnum);
+ }
+ else if (q[2] == 'u')
+ {
+ ulnum = va_arg (args, unsigned long);
+ sprintf (buf, "%lu", ulnum);
+ }
+ else goto bad;
+ cvs_outerr (buf, strlen (buf));
+ q++;
+ break;
case 'x':
unum = va_arg (args, unsigned int);
sprintf (buf, "%x", unum);
@@ -171,6 +188,7 @@ error (status, errnum, message, va_alist)
cvs_outerr ("%", 1);
break;
default:
+ bad:
cvs_outerr (msg, sizeof (msg) - 1);
/* Don't just keep going, because q + 1 might point to the
terminating '\0'. */
diff --git a/gnu/usr.bin/cvs/src/error.h b/gnu/usr.bin/cvs/src/error.h
index e0fde4a5bec..c7268cea7bc 100644
--- a/gnu/usr.bin/cvs/src/error.h
+++ b/gnu/usr.bin/cvs/src/error.h
@@ -11,8 +11,8 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. */
-#ifndef _error_h_
-#define _error_h_
+#ifndef ERROR_H
+#define ERROR_H
/* Add prototype support. Normally this is done in cvs.h, but that
doesn't get included from lib/savecwd.c. */
@@ -54,4 +54,4 @@ extern void error_exit PROTO ((void));
process and packages up its stderr in the protocol. */
extern int error_use_protocol;
-#endif /* _error_h_ */
+#endif /* ERROR_H */
diff --git a/gnu/usr.bin/cvs/src/expand_path.c b/gnu/usr.bin/cvs/src/expand_path.c
index 25e561cc0e6..f46b39bebdc 100644
--- a/gnu/usr.bin/cvs/src/expand_path.c
+++ b/gnu/usr.bin/cvs/src/expand_path.c
@@ -272,7 +272,7 @@ expand_variable (name, file, line)
int line;
{
if (strcmp (name, CVSROOT_ENV) == 0)
- return CVSroot_original;
+ return current_parsed_root->original;
else if (strcmp (name, "RCSBIN") == 0)
{
error (0, 0, "RCSBIN internal variable is no longer supported");
diff --git a/gnu/usr.bin/cvs/src/find_names.c b/gnu/usr.bin/cvs/src/find_names.c
index 6fb927bf6a9..e34232efdc7 100644
--- a/gnu/usr.bin/cvs/src/find_names.c
+++ b/gnu/usr.bin/cvs/src/find_names.c
@@ -269,7 +269,7 @@ find_rcs (dir, list)
/* read the dir, grabbing the ,v files */
errno = 0;
- while ((dp = readdir (dirp)) != NULL)
+ while ((dp = CVS_READDIR (dirp)) != NULL)
{
if (CVS_FNMATCH (RCSPAT, dp->d_name, 0) == 0)
{
@@ -288,11 +288,11 @@ find_rcs (dir, list)
if (errno != 0)
{
int save_errno = errno;
- (void) closedir (dirp);
+ (void) CVS_CLOSEDIR (dirp);
errno = save_errno;
return 1;
}
- (void) closedir (dirp);
+ (void) CVS_CLOSEDIR (dirp);
return (0);
}
@@ -321,9 +321,9 @@ find_dirs (dir, list, checkadm, entries)
Emptydir. Except in the CVSNULLREPOS case, Emptydir is just
a normal directory name. */
if (isabsolute (dir)
- && strncmp (dir, CVSroot_directory, strlen (CVSroot_directory)) == 0
- && ISDIRSEP (dir[strlen (CVSroot_directory)])
- && strcmp (dir + strlen (CVSroot_directory) + 1, CVSROOTADM) == 0)
+ && strncmp (dir, current_parsed_root->directory, strlen (current_parsed_root->directory)) == 0
+ && ISDIRSEP (dir[strlen (current_parsed_root->directory)])
+ && strcmp (dir + strlen (current_parsed_root->directory) + 1, CVSROOTADM) == 0)
skip_emptydir = 1;
/* set up to read the dir */
@@ -332,7 +332,7 @@ find_dirs (dir, list, checkadm, entries)
/* read the dir, grabbing sub-dirs */
errno = 0;
- while ((dp = readdir (dirp)) != NULL)
+ while ((dp = CVS_READDIR (dirp)) != NULL)
{
if (strcmp (dp->d_name, ".") == 0 ||
strcmp (dp->d_name, "..") == 0 ||
@@ -414,11 +414,11 @@ find_dirs (dir, list, checkadm, entries)
if (errno != 0)
{
int save_errno = errno;
- (void) closedir (dirp);
+ (void) CVS_CLOSEDIR (dirp);
errno = save_errno;
return 1;
}
- (void) closedir (dirp);
+ (void) CVS_CLOSEDIR (dirp);
if (tmp != NULL)
free (tmp);
return (0);
diff --git a/gnu/usr.bin/cvs/src/rcs.h b/gnu/usr.bin/cvs/src/rcs.h
index 3466398f204..55eed95f725 100644
--- a/gnu/usr.bin/cvs/src/rcs.h
+++ b/gnu/usr.bin/cvs/src/rcs.h
@@ -179,6 +179,9 @@ typedef void (*RCSCHECKOUTPROC) PROTO ((void *, const char *, size_t));
struct rcsbuffer;
#endif
+/* What RCS_deltas is supposed to do. */
+enum rcs_delta_op {RCS_ANNOTATE, RCS_FETCH};
+
/*
* exported interfaces
*/
@@ -223,8 +226,8 @@ int RCS_cmp_file PROTO ((RCSNode *, char *, char *, const char *));
int RCS_settag PROTO ((RCSNode *, const char *, const char *));
int RCS_deltag PROTO ((RCSNode *, const char *));
int RCS_setbranch PROTO((RCSNode *, const char *));
-int RCS_lock PROTO ((RCSNode *, const char *, int));
-int RCS_unlock PROTO ((RCSNode *, const char *, int));
+int RCS_lock PROTO ((RCSNode *, char *, int));
+int RCS_unlock PROTO ((RCSNode *, char *, int));
int RCS_delete_revs PROTO ((RCSNode *, char *, char *, int));
void RCS_addaccess PROTO ((RCSNode *, char *));
void RCS_delaccess PROTO ((RCSNode *, char *));
@@ -234,6 +237,9 @@ void RCS_rewrite PROTO ((RCSNode *, Deltatext *, char *));
void RCS_abandon PROTO ((RCSNode *));
int rcs_change_text PROTO ((const char *, char *, size_t, const char *,
size_t, char **, size_t *));
+void RCS_deltas PROTO ((RCSNode *, FILE *, struct rcsbuffer *, char *,
+ enum rcs_delta_op, char **, size_t *,
+ char **, size_t *));
char *make_file_label PROTO ((char *, char *, RCSNode *));
extern int preserve_perms;
diff --git a/gnu/usr.bin/cvs/src/remove.c b/gnu/usr.bin/cvs/src/remove.c
index f0055d9c424..63b61d3aff8 100644
--- a/gnu/usr.bin/cvs/src/remove.c
+++ b/gnu/usr.bin/cvs/src/remove.c
@@ -77,7 +77,7 @@ cvsremove (argc, argv)
wrap_setup ();
#ifdef CLIENT_SUPPORT
- if (client_active) {
+ if (current_parsed_root->isremote) {
/* Call expand_wild so that the local removal of files will
work. It's ok to do it always because we have to send the
file names expanded anyway. */
@@ -115,7 +115,7 @@ cvsremove (argc, argv)
argc, argv,
local, W_LOCAL, 0, 1, (char *) NULL, 1);
- if (removed_files)
+ if (removed_files && !really_quiet)
error (0, 0, "use '%s commit' to remove %s permanently", program_name,
(removed_files == 1) ? "this file" : "these files");
diff --git a/gnu/usr.bin/cvs/src/run.c b/gnu/usr.bin/cvs/src/run.c
index d382cef6081..2d020eb582f 100644
--- a/gnu/usr.bin/cvs/src/run.c
+++ b/gnu/usr.bin/cvs/src/run.c
@@ -324,9 +324,19 @@ run_exec (stin, stout, sterr, flags)
out:
if (sterr)
(void) close (sherr);
+ else
+ /* ensure things are received by the parent in the correct order
+ * relative to the protocol pipe
+ */
+ cvs_flusherr();
out2:
if (stout)
(void) close (shout);
+ else
+ /* ensure things are received by the parent in the correct order
+ * relative to the protocol pipe
+ */
+ cvs_flushout();
out1:
if (stin)
(void) close (shin);
@@ -444,7 +454,7 @@ void
close_on_exec (fd)
int fd;
{
-#if defined (FD_CLOEXEC) && defined (F_SETFD)
+#ifdef F_SETFD
if (fcntl (fd, F_SETFD, 1))
error (1, errno, "can't set close-on-exec flag on %d", fd);
#endif
diff --git a/gnu/usr.bin/cvs/src/sanity.sh b/gnu/usr.bin/cvs/src/sanity.sh
index 84e67ccd663..727e33a5fa3 100644
--- a/gnu/usr.bin/cvs/src/sanity.sh
+++ b/gnu/usr.bin/cvs/src/sanity.sh
@@ -18,10 +18,18 @@
#
# Original Author: K. Richard Pixley
-# usage: sanity.sh [-r] @var{cvs-to-test} @var{tests-to-run}
-# -r means to test remote instead of local cvs.
-# @var{tests-to-run} are the names of the tests to run; if omitted run all
-# tests.
+# usage:
+exit_usage ()
+{
+ echo "Usage: `basename $0` [-kr] [-f FROM-TEST] CVS-TO-TEST [TESTS-TO-RUN...]" 1>&2
+ exit 2
+}
+# -r test remote instead of local cvs.
+# -k try to keep directories created by individual tests around
+# -f FROM-TEST run TESTS-TO-RUN, skipping all tests in the list before
+# FROM-TEST
+#
+# TESTS-TO-RUN are the names of the tests to run; if omitted default to all tests.
# See TODO list at end of file.
@@ -37,55 +45,46 @@ unset CVSREAD
LC_ALL=C
export LC_ALL
-# The default value of /tmp/cvs-sanity for TESTDIR is dubious,
-# because it loses if two people/scripts try to run the tests
-# at the same time. Some possible solutions:
-# 1. Use /tmp/cvs-test$$. One disadvantage is that the old
-# cvs-test* directories would pile up, because they wouldn't
-# necessarily get removed.
-# 2. Have everyone/everything running the testsuite set
-# TESTDIR to some appropriate directory.
-# 3. Have the default value of TESTDIR be some variation of
-# `pwd`/cvs-sanity. The biggest problem here is that we have
-# been fairly careful to test that CVS prints in messages the
-# actual pathnames that we pass to it, rather than a different
-# pathname for the same directory, as may come out of `pwd`.
-# So this would be lost if everything was `pwd`-based. I suppose
-# if we wanted to get baroque we could start making symlinks
-# to ensure the two are different.
-tmp=`(cd /tmp; /bin/pwd || pwd) 2>/dev/null`
-: ${TESTDIR=$tmp/cvs-sanity}
-# "debugger"
-#set -x
-
-echo 'This test should produce no other output than this line, and a final "OK".'
-
-if test x"$1" = x"-r"; then
- shift
- remote=yes
-else
- remote=no
-fi
-# The --keep option will eventually cause all the tests to leave around the
-# contents of the /tmp directory; right now only some implement it. Not
-# useful if you are running more than one test.
-# FIXME: need some real option parsing so this doesn't depend on the order
-# in which they are specified.
-if test x"$1" = x"--keep"; then
- shift
- keep=yes
-else
- keep=no
-fi
+#
+# read our options
+#
+unset fromtest
+keep=false
+remote=false
+while getopts f:kr option ; do
+ case "$option" in
+ f)
+ fromtest="$OPTARG"
+ ;;
+ k)
+ # The -k (keep) option will eventually cause all the tests to leave around the
+ # contents of the /tmp directory; right now only some implement it. Not
+ # originally intended to be useful with more than one test, but this should work
+ # if each test uses a uniquely named dir (use the name of the test).
+ keep=:
+ ;;
+ r)
+ remote=:
+ ;;
+ \?)
+ exit_usage
+ ;;
+ esac
+done
+
+# boot the arguments we used above
+while test $OPTIND -gt 1 ; do
+ shift
+ OPTIND=`expr $OPTIND - 1`
+done
# Use full path for CVS executable, so that CVS_SERVER gets set properly
# for remote.
case $1 in
"")
- echo "Usage: `basename $0` [-r] [--keep] CVS-TO-TEST [TESTS-TO-RUN...]" 1>&2
- exit 1
+ exit_usage
;;
/*)
testcvs=$1
@@ -94,9 +93,19 @@ case $1 in
testcvs=`pwd`/$1
;;
esac
-
shift
+
+
+###
+### GUTS
+###
+
+# "debugger"
+#set -x
+
+echo 'This test should produce no other output than this line, and a final "OK".'
+
# Regexp to match what CVS will call itself in output that it prints.
# FIXME: we don't properly quote this--if the name contains . we'll
# just spuriously match a few things; if the name contains other regexp
@@ -108,17 +117,22 @@ PROG=`basename ${testcvs}`
# not allowed in usernames. Other than that I'm not sure.
username="[-a-zA-Z0-9][-a-zA-Z0-9]*"
author="[-a-zA-Z0-9][-a-zA-Z0-9]*"
+hostname="[-_.a-zA-Z0-9]*"
# Regexp to match the name of a temporary file (from cvs_temp_name).
# This appears in certain diff output.
tempname="[-a-zA-Z0-9/.%_]*"
+# Regexp to match a date in RFC822 format (as amended by RFC1123).
+RFCDATE="[a-zA-Z0-9 ][a-zA-Z0-9 ]* [0-9:][0-9:]* -0000"
+RFCDATE_EPOCH="1 Jan 1970 00:00:00 -0000"
+
# On cygwin32, we may not have /bin/sh.
-if [ -r /bin/sh ]; then
+if test -r /bin/sh; then
TESTSHELL="/bin/sh"
else
TESTSHELL=`type -p sh 2>/dev/null`
- if [ ! -r "$TESTSHELL" ]; then
+ if test ! -r "$TESTSHELL"; then
TESTSHELL="/bin/sh"
fi
fi
@@ -141,13 +155,48 @@ if test -f check.log; then
mv check.log check.plog
fi
+# The default value of /tmp/cvs-sanity for TESTDIR is dubious,
+# because it loses if two people/scripts try to run the tests
+# at the same time. Some possible solutions:
+# 1. Use /tmp/cvs-test$$. One disadvantage is that the old
+# cvs-test* directories would pile up, because they wouldn't
+# necessarily get removed.
+# 2. Have everyone/everything running the testsuite set
+# TESTDIR to some appropriate directory.
+# 3. Have the default value of TESTDIR be some variation of
+# `pwd`/cvs-sanity. The biggest problem here is that we have
+# been fairly careful to test that CVS prints in messages the
+# actual pathnames that we pass to it, rather than a different
+# pathname for the same directory, as may come out of `pwd`.
+# So this would be lost if everything was `pwd`-based. I suppose
+# if we wanted to get baroque we could start making symlinks
+# to ensure the two are different.
+tmp=`(cd /tmp; /bin/pwd || pwd) 2>/dev/null`
+
+# Now:
+# 1) Set TESTDIR if it's not set already
+# 2) Remove any old test remnants
+# 3) Create $TESTDIR
+# 4) Normalize TESTDIR with `cd && (/bin/pwd || pwd)`
+# (This will match CVS output later)
+: ${TESTDIR=$tmp/cvs-sanity}
# clean any old remnants (we need the chmod because some tests make
# directories read-only)
if test -d ${TESTDIR}; then
chmod -R a+wx ${TESTDIR}
rm -rf ${TESTDIR}
fi
-mkdir ${TESTDIR}
+# These exits are important. The first time I tried this, if the `mkdir && cd`
+# failed then the build directory would get blown away. Some people probably
+# wouldn't appreciate that.
+mkdir ${TESTDIR} || exit 1
+cd ${TESTDIR} || exit 1
+TESTDIR=`(/bin/pwd || pwd) 2>/dev/null`
+# Ensure $TESTDIR is absolute
+if test -z "${TESTDIR}" || echo "${TESTDIR}" |grep '^[^/]'; then
+ echo "Unable to resolve TESTDIR to an absolute directory." >&2
+ exit 1
+fi
cd ${TESTDIR}
# Make sure various tools work the way we expect, or try to find
@@ -159,17 +208,19 @@ cd ${TESTDIR}
find_tool ()
{
- GLOCS="`echo $PATH | sed 's/:/ /g'` /usr/local/bin /usr/contrib/bin /usr/gnu/bin /local/bin /local/gnu/bin /gun/bin"
+ GLOCS="`echo $PATH | sed 's/:/ /g'` /usr/local/bin /usr/contrib/bin /usr/gnu/bin /local/bin /local/gnu/bin /gnu/bin"
TOOL=""
for path in $GLOCS ; do
if test -x $path/g$1 ; then
- if test "X`$path/g$1 --version`" != "X--version" ; then
+ RES="`$path/g$1 --version </dev/null 2>/dev/null`"
+ if test "X$RES" != "X--version" && test "X$RES" != "X" ; then
TOOL=$path/g$1
break
fi
fi
if test -x $path/$1 ; then
- if test "X`$path/$1 --version`" != "X--version" ; then
+ RES="`$path/$1 --version </dev/null 2>/dev/null`"
+ if test "X$RES" != "X--version" && test "X$RES" != "X" ; then
TOOL=$path/$1
break
fi
@@ -178,30 +229,41 @@ find_tool ()
if test -z "$TOOL"; then
:
else
- echo "Notice: The default version of $1 is defective, using" >&2
- echo "$TOOL instead." >&2
+ echo "Notice: The default version of \`$1' is defective, using" >&2
+ echo "\`$TOOL' instead." >&2
fi
echo "$TOOL"
}
# You can't run CVS as root; print a nice error message here instead
# of somewhere later, after making a mess.
-case "`$ID -u`" in
- "0")
- echo "Test suite does not work correctly when run as root" >&2
- exit 1
- ;;
-
- "")
- ID=`find_tool id`
- if test -z "$ID" ; then
- echo 'Running these tests requires an "id" program that understands the' >&2
- echo '-u and -n flags. Make sure that such an id (GNU, or many but not' >&2
- echo 'all vendor-supplied versions) is in your path.' >&2
+#
+# FIXME - find_tool() finds the 'gid' from GNU id-utils if I pull 'id' out of
+# my path.
+for pass in false :; do
+ case "`$ID -u 2>/dev/null`" in
+ "0")
+ echo "Test suite does not work correctly when run as root" >&2
exit 1
- fi
- ;;
-esac
+ ;;
+
+ "")
+ if $pass; then :; else
+ ID=`find_tool id`
+ fi
+ if $pass || test -z "$ID" ; then
+ echo "Running these tests requires an \`id' program that understands the" >&2
+ echo "-u and -n flags. Make sure that such an id (GNU, or many but not" >&2
+ echo "all vendor-supplied versions) is in your path." >&2
+ exit 1
+ fi
+ ;;
+
+ *)
+ break
+ ;;
+ esac
+done
username=`$ID -un`
if $EXPR "${username}" : "${username}" >/dev/null; then
: good, it works
@@ -269,7 +331,6 @@ if $EXPR "`cat ${TESTDIR}/bar`x" : "`cat ${TESTDIR}/bar`y" >/dev/null; then
else
: good, it works
fi
-rm -f ${TESTDIR}/foo ${TESTDIR}/bar
# That we should have to do this is total bogosity, but GNU expr
# version 1.9.4-1.12 uses the emacs definition of "$" instead of the unix
@@ -299,6 +360,21 @@ else
\)*'
fi
+# Now that we have DOTSTAR, make sure it works with big matches
+if $EXPR "`cat ${TESTDIR}/bar`" : "${DOTSTAR}xyzABC${DOTSTAR}$" >/dev/null; then
+ : good, it works
+else
+ EXPR=`find_tool expr`
+ if test -z "$EXPR" ; then
+ echo 'Warning: you are using a version of expr which does not correctly'
+ echo 'match large patterns. Some tests may spuriously fail.'
+ echo 'You may wish to make sure GNU expr is in your path.'
+ EXPR=expr
+ fi
+fi
+
+rm -f ${TESTDIR}/foo ${TESTDIR}/bar
+
# Work around yet another GNU expr (version 1.10) bug/incompatibility.
# "+" is a special character, yet for unix expr (e.g. SunOS 4.1.3)
# it is not. I doubt that POSIX allows us to use \+ and assume it means
@@ -350,67 +426,45 @@ fail ()
# of the implementation common to the two).
dotest_internal ()
{
+ if $EXPR "`cat ${TESTDIR}/dotest.tmp`" : "$3${ENDANCHOR}" >/dev/null; then
+ # Why, I hear you ask, do we write this to the logfile
+ # even when the test passes? The reason is that the test
+ # may give us the regexp which we were supposed to match,
+ # but sometimes it may be useful to look at the exact
+ # text which was output. For example, suppose one wants
+ # to grep for a particular warning, and make _sure_ that
+ # CVS never hits it (even in cases where the tests might
+ # match it with .*). Or suppose one wants to see the exact
+ # date format output in a certain case (where the test will
+ # surely use a somewhat non-specific pattern).
+ cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
+ pass "$1"
# expr can't distinguish between "zero characters matched" and "no match",
# so special-case it.
- if test -z "$3"; then
- if test -s ${TESTDIR}/dotest.tmp; then
- if test x"$4" != x; then
- # We want to match either the empty string or $4.
- dotest_internal "$1" "$2" "$4"
- else
- echo "** expected: " >>${LOGFILE}
- echo "$3" >>${LOGFILE}
- echo "$3" > ${TESTDIR}/dotest.exp
- rm -f ${TESTDIR}/dotest.ex2
- echo "** got: " >>${LOGFILE}
- cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
- fail "$1"
- fi
- else
- pass "$1"
- fi
- else
- if $EXPR "`cat ${TESTDIR}/dotest.tmp`" : \
- "$3"${ENDANCHOR} >/dev/null; then
- # See below about writing this to the logfile.
+ elif test -z "$3" && test ! -s ${TESTDIR}/dotest.tmp; then
+ pass "$1"
+ elif test x"$4" != x; then
+ if $EXPR "`cat ${TESTDIR}/dotest.tmp`" : "$4${ENDANCHOR}" >/dev/null; then
cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
pass "$1"
else
- if test x"$4" != x; then
- if $EXPR "`cat ${TESTDIR}/dotest.tmp`" : \
- "$4"${ENDANCHOR} >/dev/null; then
- # Why, I hear you ask, do we write this to the logfile
- # even when the test passes? The reason is that the test
- # may give us the regexp which we were supposed to match,
- # but sometimes it may be useful to look at the exact
- # text which was output. For example, suppose one wants
- # to grep for a particular warning, and make _sure_ that
- # CVS never hits it (even in cases where the tests might
- # match it with .*). Or suppose one wants to see the exact
- # date format output in a certain case (where the test will
- # surely use a somewhat non-specific pattern).
- cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
- pass "$1"
- else
- echo "** expected: " >>${LOGFILE}
- echo "$3" >>${LOGFILE}
- echo "$3" > ${TESTDIR}/dotest.ex1
- echo "** or: " >>${LOGFILE}
- echo "$4" >>${LOGFILE}
- echo "$4" > ${TESTDIR}/dotest.ex2
- echo "** got: " >>${LOGFILE}
- cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
- fail "$1"
- fi
- else
- echo "** expected: " >>${LOGFILE}
- echo "$3" >>${LOGFILE}
- echo "$3" > ${TESTDIR}/dotest.exp
- echo "** got: " >>${LOGFILE}
- cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
- fail "$1"
- fi
+ echo "** expected: " >>${LOGFILE}
+ echo "$3" >>${LOGFILE}
+ echo "$3" > ${TESTDIR}/dotest.ex1
+ echo "** or: " >>${LOGFILE}
+ echo "$4" >>${LOGFILE}
+ echo "$4" > ${TESTDIR}/dotest.ex2
+ echo "** got: " >>${LOGFILE}
+ cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
+ fail "$1"
fi
+ else
+ echo "** expected: " >>${LOGFILE}
+ echo "$3" >>${LOGFILE}
+ echo "$3" > ${TESTDIR}/dotest.exp
+ echo "** got: " >>${LOGFILE}
+ cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
+ fail "$1"
fi
}
@@ -432,6 +486,9 @@ dotest_line_by_line ()
if $EXPR "`sed -n ${line}p ${TESTDIR}/dotest.tmp`" : \
"`sed -n ${line}p ${TESTDIR}/dotest.exp`" >/dev/null; then
:
+ elif test -z "`sed -n ${line}p ${TESTDIR}/dotest.tmp`" &&
+ test -z "`sed -n ${line}p ${TESTDIR}/dotest.exp`"; then
+ :
else
echo "Line $line:" >> ${LOGFILE}
echo "**** expected: " >>${LOGFILE}
@@ -512,10 +569,9 @@ dotest_internal_debug ()
dotest ()
{
rm -f ${TESTDIR}/dotest.ex? 2>&1
- if eval "$2" >${TESTDIR}/dotest.tmp 2>&1; then
- : so far so good
- else
- status=$?
+ eval "$2" >${TESTDIR}/dotest.tmp 2>&1
+ status=$?
+ if test "$status" != 0; then
cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
echo "exit status was $status" >>${LOGFILE}
fail "$1"
@@ -527,10 +583,9 @@ dotest ()
dotest_lit ()
{
rm -f ${TESTDIR}/dotest.ex? 2>&1
- if eval "$2" >${TESTDIR}/dotest.tmp 2>&1; then
- : so far so good
- else
- status=$?
+ eval "$2" >${TESTDIR}/dotest.tmp 2>&1
+ status=$?
+ if test "$status" != 0; then
cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
echo "exit status was $status" >>${LOGFILE}
fail "$1"
@@ -551,15 +606,13 @@ dotest_lit ()
dotest_fail ()
{
rm -f ${TESTDIR}/dotest.ex? 2>&1
- if eval "$2" >${TESTDIR}/dotest.tmp 2>&1; then
- status=$?
+ eval "$2" >${TESTDIR}/dotest.tmp 2>&1
+ status=$?
+ if test "$status" = 0; then
cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
echo "exit status was $status" >>${LOGFILE}
fail "$1"
- else
- : so far so good
- fi 2>${TESTDIR}/dotest.tmp1
- cat ${TESTDIR}/dotest.tmp1 >>${TESTDIR}/dotest.tmp
+ fi
dotest_internal "$@"
}
@@ -568,9 +621,7 @@ dotest_status ()
{
eval "$3" >${TESTDIR}/dotest.tmp 2>&1
status=$?
- if test "$status" = "$2"; then
- : so far so good
- else
+ if test "$status" != "$2"; then
cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
echo "exit status was $status; expected $2" >>${LOGFILE}
fail "$1"
@@ -582,10 +633,9 @@ dotest_status ()
dotest_sort ()
{
rm -f ${TESTDIR}/dotest.ex? 2>&1
- if eval "$2" >${TESTDIR}/dotest.tmp1 2>&1; then
- : so far so good
- else
- status=$?
+ eval "$2" >${TESTDIR}/dotest.tmp1 2>&1
+ status=$?
+ if test "$status" != 0; then
cat ${TESTDIR}/dotest.tmp1 >>${LOGFILE}
echo "exit status was $status" >>${LOGFILE}
fail "$1"
@@ -594,21 +644,6 @@ dotest_sort ()
dotest_internal "$@"
}
-# This will show up in cvs history output where it prints the working
-# directory. It should *not* appear in any cvs output referring to the
-# repository; cvs should use the name of the repository as specified.
-#
-# Note that using pwd here rather than /bin/pwd will make it even less
-# likely that we test whether CVS is distinguishing between TMPPWD
-# and TESTDIR. However, there is no guarantee that will test it anyway.
-# If we really care, we should do something along the lines of:
-# cd /tmp/cvs-sanity # In reality, overridable with environment variable?
-# mkdir realdir
-# ln -s realdir testdir
-# TESTDIR=/tmp/cvs-sanity/testdir
-# TMPPWD=/tmp/cvs-sanity/realdir
-TMPPWD=`pwd`
-
# Avoid picking up any stray .cvsrc, etc., from the user running the tests
mkdir home
HOME=${TESTDIR}/home; export HOME
@@ -627,14 +662,15 @@ RCSINIT=; export RCSINIT
if test x"$*" = x; then
# Basic/miscellaneous functionality
- tests="basica basicb basicc basic1 deep basic2"
+ tests="version basica basicb basicc basic1 deep basic2"
tests="${tests} files spacefiles commit-readonly"
# Branching, tagging, removing, adding, multiple directories
- tests="${tests} rdiff diff death death2 rmadd rmadd2 dirs dirs2"
- tests="${tests} branches branches2 tagc tagf"
+ tests="${tests} rdiff diff death death2 rm-update-message rmadd rmadd2"
+ tests="${tests} dirs dirs2 branches branches2 tagc tagf"
tests="${tests} rcslib multibranch import importb importc"
tests="${tests} import-after-initial"
- tests="${tests} join join2 join3 join-readonly-conflict join-admin"
+ tests="${tests} join join2 join3 join-readonly-conflict"
+ tests="${tests} join-admin join-admin-2"
tests="${tests} new newb conflicts conflicts2 conflicts3"
tests="${tests} clean"
# Checking out various places (modules, checkout -d, &c)
@@ -642,11 +678,11 @@ if test x"$*" = x; then
tests="${tests} mkmodules-temp-file-removal"
tests="${tests} cvsadm emptydir abspath toplevel toplevel2"
# Log messages, error messages.
- tests="${tests} mflag editor errmsg1 errmsg2"
+ tests="${tests} mflag editor errmsg1 errmsg2 adderrmsg"
# Watches, binary files, history browsing, &c.
tests="${tests} devcom devcom2 devcom3 watch4 watch5"
tests="${tests} unedit-without-baserev"
- tests="${tests} ignore binfiles binfiles2 binfiles3"
+ tests="${tests} ignore ignore-on-branch binfiles binfiles2 binfiles3"
tests="${tests} mcopy binwrap binwrap2"
tests="${tests} binwrap3 mwrap info taginfo config"
tests="${tests} serverpatch log log2 logopt ann ann-id"
@@ -670,21 +706,20 @@ if test x"$*" = x; then
# Multiple root directories and low-level protocol tests.
tests="${tests} multiroot multiroot2 multiroot3 multiroot4"
tests="${tests} rmroot reposmv pserver server server2 client"
+ tests="${tests} fork"
else
tests="$*"
fi
# a simple function to compare directory contents
#
-# Returns: {nothing}
-# Side Effects: ISDIFF := true|false
+# Returns: 0 for same, 1 for different
#
directory_cmp ()
{
OLDPWD=`pwd`
DIR_1=$1
DIR_2=$2
- ISDIFF=false
cd $DIR_1
find . -print | fgrep -v /CVS | sort > /tmp/dc$$d1
@@ -698,8 +733,7 @@ directory_cmp ()
then
:
else
- ISDIFF=true
- return
+ return 1
fi
cd $OLDPWD
while read a
@@ -707,17 +741,821 @@ directory_cmp ()
if test -f $DIR_1/"$a" ; then
cmp -s $DIR_1/"$a" $DIR_2/"$a"
if test $? -ne 0 ; then
- ISDIFF=true
+ return 1
fi
fi
done < /tmp/dc$$d1
rm -f /tmp/dc$$*
+ return 0
+}
+
+
+
+#
+# The following 4 functions are used by the diffmerge1 test case. They set up,
+# respectively, the four versions of the files necessary:
+#
+# 1. Ancestor revisions.
+# 2. "Your" changes.
+# 3. "My" changes.
+# 4. Expected merge result.
+#
+
+# Create ancestor revisions for diffmerge1
+diffmerge_create_older_files() {
+ # This test case was supplied by Noah Friedman:
+ cat >testcase01 <<EOF
+// Button.java
+
+package random.application;
+
+import random.util.*;
+
+public class Button
+{
+ /* Instantiates a Button with origin (0, 0) and zero width and height.
+ * You must call an initializer method to properly initialize the Button.
+ */
+ public Button ()
+ {
+ super ();
+
+ _titleColor = Color.black;
+ _disabledTitleColor = Color.gray;
+ _titleFont = Font.defaultFont ();
+ }
+
+ /* Convenience constructor for instantiating a Button with
+ * bounds x, y, width, and height. Equivalent to
+ * foo = new Button ();
+ * foo.init (x, y, width, height);
+ */
+ public Button (int x, int y, int width, int height)
+ {
+ this ();
+ init (x, y, width, height);
+ }
+}
+EOF
+
+ # This test case was supplied by Jacob Burckhardt:
+ cat >testcase02 <<EOF
+a
+a
+a
+a
+a
+EOF
+
+ # This test case was supplied by Karl Tomlinson who also wrote the
+ # patch which lets CVS correctly handle this and several other cases:
+ cat >testcase03 <<EOF
+x
+s
+a
+b
+s
+y
+EOF
+
+ # This test case was supplied by Karl Tomlinson:
+ cat >testcase04 <<EOF
+s
+x
+m
+m
+x
+s
+v
+s
+x
+m
+m
+x
+s
+EOF
+
+ # This test case was supplied by Karl Tomlinson:
+ cat >testcase05 <<EOF
+s
+x
+m
+m
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+s
+s
+s
+s
+s
+s
+s
+s
+s
+s
+v
+EOF
+
+ # This test case was supplied by Jacob Burckhardt:
+ cat >testcase06 <<EOF
+g
+
+
+
+
+
+
+
+
+
+
+
+i
+EOF
+
+ # This test is supposed to verify that the horizon lines are the same
+ # for both 2-way diffs, but unfortunately, it does not fail with the
+ # old version of cvs. However, Karl Tomlinson still thought it would
+ # be good to test it anyway:
+ cat >testcase07 <<EOF
+h
+f
+
+
+
+
+
+
+
+
+
+g
+r
+
+
+
+i
+
+
+
+
+
+
+
+
+
+
+i
+EOF
+
+ # This test case was supplied by Jacob Burckhardt:
+ cat >testcase08 <<EOF
+Both changes move this line to the end of the file.
+
+no
+changes
+here
+
+First change will delete this line.
+
+First change will also delete this line.
+
+ no
+ changes
+ here
+
+Second change will change it here.
+
+ no
+ changes
+ here
+EOF
+
+ # This test case was supplied by Jacob Burckhardt. Note that I do not
+ # think cvs has ever failed with this case, but I include it anyway,
+ # since I think it is a hard case. It is hard because Peter Miller's
+ # fmerge utility fails on it:
+ cat >testcase09 <<EOF
+m
+a
+{
+}
+b
+{
+}
+EOF
+
+ # This test case was supplied by Martin Dorey and simplified by Jacob
+ # Burckhardt:
+ cat >testcase10 <<EOF
+
+ petRpY ( MtatRk );
+ fV ( MtatRk != Zy ) UDTXUK_DUUZU ( BGKT_ZFDK_qjT_HGTG );
+
+ MtatRk = MQfr_GttpfIRte_MtpeaL ( &acI, jfle_Uecopd_KRLIep * jfle_Uecopd_MfJe_fY_nEtek );
+ OjZy MtatRk = Uead_GttpfIRte_MtpeaL ( &acI, jfle_Uecopd_MfJe_fY_nEtek, nRVVep );
+
+ Bloke_GttpfIRte_MtpeaL ( &acI );
+MTGTXM Uead_Ktz_qjT_jfle_Uecopd ( fYt Y, uofd *nRVVep )
+{
+ fV ( Y < 16 )
+ {
+ petRpY ( Uead_Mectopk ( noot_Uecopd.qVtHatabcY0 * noot_Uecopd.MectopkFepBlRktep +
+ Y * jfle_Uecopd_MfJe_fY_Mectopk,
+ jfle_Uecopd_MfJe_fY_Mectopk,
+ nRVVep ) );
+ }
+ elke
+ {
+ petRpY ( Uead_Mectopk ( noot_Uecopd.qVtqfppHatabcY0 * noot_Uecopd.MectopkFepBlRktep +
+ ( Y - 16 ) * jfle_Uecopd_MfJe_fY_Mectopk,
+ jfle_Uecopd_MfJe_fY_Mectopk,
+ nRVVep ) );
+ }
+
+}
+
+
+/****************************************************************************
+* *
+* Uead Mectopk ( Uelatfue to tze cRppeYt raptftfoY ) *
+* *
+****************************************************************************/
+
+MTGTXM Uead_Mectopk ( RfYt64 Mtapt_Mectop, RfYt64 KRL_Mectopk, uofd *nRVVep )
+{
+MTGTXM MtatRk = Zy;
+
+ MtatRk = Uead_HfkQ ( FaptftfoY_TaIle.Uelatfue_Mectop + Mtapt_Mectop, KRL_Mectopk, nRVVep );
+
+ petRpY ( MtatRk );
+
+}
+ HfkQipfte ( waYdle, /* waYdle */
+ waYdleFok, /* ZVVket VpoL ktapt oV dfkQ */
+ (coYkt RfYt8*) nRVVep, /* nRVVep */
+ 0, /* MRrepVlRoRk KfxoYfkL */
+ beYgtz /* nEtek to Apfte */
+ );
+
+ petRpY ( Zy );
+}
+EOF
+}
+
+# Create "your" revisions for diffmerge1
+diffmerge_create_your_files() {
+ # remove the Button() method
+ cat >testcase01 <<\EOF
+// Button.java
+
+package random.application;
+
+import random.util.*;
+
+public class Button
+{
+ /* Instantiates a Button with origin (0, 0) and zero width and height.
+ * You must call an initializer method to properly initialize the Button.
+ */
+ public Button ()
+ {
+ super ();
+
+ _titleColor = Color.black;
+ _disabledTitleColor = Color.gray;
+ _titleFont = Font.defaultFont ();
+ }
+}
+EOF
+
+ cat >testcase02 <<\EOF
+y
+a
+a
+a
+a
+EOF
+
+ cat >testcase03 <<\EOF
+x
+s
+a
+b
+s
+b
+s
+y
+EOF
+
+ cat >testcase04 <<\EOF
+s
+m
+s
+v
+s
+m
+s
+EOF
+
+ cat >testcase05 <<\EOF
+v
+s
+m
+s
+s
+s
+s
+s
+s
+s
+s
+s
+s
+v
+EOF
+
+ # Test case 6 and test case 7 both use the same input files, but they
+ # order the input files differently. In one case, a certain file is
+ # used as the older file, but in the other test case, that same file
+ # is used as the file which has changes. I could have put echo
+ # commands here, but since the echo lines would be the same as those
+ # in the previous function, I decided to save space and avoid repeating
+ # several lines of code. Instead, I merely swap the files:
+ mv testcase07 tmp
+ mv testcase06 testcase07
+ mv tmp testcase06
+
+ # Make the date newer so that cvs thinks that the files are changed:
+ touch testcase06 testcase07
+
+ cat >testcase08 <<\EOF
+no
+changes
+here
+
+First change has now added this in.
+
+ no
+ changes
+ here
+
+Second change will change it here.
+
+ no
+ changes
+ here
+
+Both changes move this line to the end of the file.
+EOF
+
+ cat >testcase09 <<\EOF
+
+m
+a
+{
+}
+b
+{
+}
+c
+{
+}
+EOF
+
+ cat >testcase10 <<\EOF
+
+ fV ( BzQkV_URYYfYg ) (*jfle_Uecopdk)[0].jfle_Uecopd_KRLIep = ZpfgfYal_jUK;
+
+ petRpY ( MtatRk );
+ fV ( MtatRk != Zy ) UDTXUK_DUUZU ( BGKT_ZFDK_qjT_HGTG );
+
+ fV ( jfle_Uecopd_KRLIep < 16 )
+ {
+ MtatRk = Uead_Ktz_qjT_jfle_Uecopd ( jfle_Uecopd_KRLIep, (uofd*)nRVVep );
+ }
+ elke
+ {
+ MtatRk = ZreY_GttpfIRte_MtpeaL ( qjT_jfle_Uecopdk, qjT_jfle_Uecopd_BoRYt, HGTG_TvFD, KXbb, KXbb, &acI );
+ fV ( MtatRk != Zy ) UDTXUK_DUUZU ( BGKT_ZFDK_qjT_HGTG );
+
+ MtatRk = MQfr_GttpfIRte_MtpeaL ( &acI, jfle_Uecopd_KRLIep * jfle_Uecopd_MfJe_fY_nEtek );
+ OjZy MtatRk = Uead_GttpfIRte_MtpeaL ( &acI, jfle_Uecopd_MfJe_fY_nEtek, nRVVep );
+
+ Bloke_GttpfIRte_MtpeaL ( &acI );
+MTGTXM Uead_Ktz_qjT_jfle_Uecopd ( fYt Y, uofd *nRVVep )
+{
+MTGTXM MtatRk = Zy;
+
+ fV ( Y < 16 )
+ {
+ petRpY ( Uead_Mectopk ( noot_Uecopd.qVtHatabcY0 * noot_Uecopd.MectopkFepBlRktep +
+ Y * jfle_Uecopd_MfJe_fY_Mectopk,
+ jfle_Uecopd_MfJe_fY_Mectopk,
+ nRVVep ) );
+ }
+ elke
+ {
+ petRpY ( Uead_Mectopk ( noot_Uecopd.qVtqfppHatabcY0 * noot_Uecopd.MectopkFepBlRktep +
+ ( Y - 16 ) * jfle_Uecopd_MfJe_fY_Mectopk,
+ jfle_Uecopd_MfJe_fY_Mectopk,
+ nRVVep ) );
+ }
+
+ petRpY ( MtatRk );
+
+}
+
+
+/****************************************************************************
+* *
+* Uead Mectopk ( Uelatfue to tze cRppeYt raptftfoY ) *
+* *
+****************************************************************************/
+
+MTGTXM Uead_Mectopk ( RfYt64 Mtapt_Mectop, RfYt64 KRL_Mectopk, uofd *nRVVep )
+{
+MTGTXM MtatRk = Zy;
+
+ MtatRk = Uead_HfkQ ( FaptftfoY_TaIle.Uelatfue_Mectop + Mtapt_Mectop, KRL_Mectopk, nRVVep );
+
+ petRpY ( MtatRk );
+
+}
+ HfkQipfte ( waYdle, /* waYdle */
+ waYdleFok, /* ZVVket VpoL ktapt oV dfkQ */
+ (coYkt RfYt8*) nRVVep, /* nRVVep */
+ 0, /* MRrepVlRoRk KfxoYfkL */
+ beYgtz /* nEtek to Apfte */
+ );
+
+ petRpY ( Zy );
+}
+
+EOF
+}
+
+# Create "my" revisions for diffmerge1
+diffmerge_create_my_files() {
+ # My working copy still has the Button() method, but I
+ # comment out some code at the top of the class.
+ cat >testcase01 <<\EOF
+// Button.java
+
+package random.application;
+
+import random.util.*;
+
+public class Button
+{
+ /* Instantiates a Button with origin (0, 0) and zero width and height.
+ * You must call an initializer method to properly initialize the Button.
+ */
+ public Button ()
+ {
+ super ();
+
+ // _titleColor = Color.black;
+ // _disabledTitleColor = Color.gray;
+ // _titleFont = Font.defaultFont ();
+ }
+
+ /* Convenience constructor for instantiating a Button with
+ * bounds x, y, width, and height. Equivalent to
+ * foo = new Button ();
+ * foo.init (x, y, width, height);
+ */
+ public Button (int x, int y, int width, int height)
+ {
+ this ();
+ init (x, y, width, height);
+ }
+}
+EOF
+
+ cat >testcase02 <<\EOF
+a
+a
+a
+a
+m
+EOF
+
+ cat >testcase03 <<\EOF
+x
+s
+c
+s
+b
+s
+y
+EOF
+
+ cat >testcase04 <<\EOF
+v
+s
+x
+m
+m
+x
+s
+v
+s
+x
+m
+m
+x
+s
+v
+EOF
+
+ # Note that in test case 5, there are no changes in the "mine"
+ # section, which explains why there is no command here which writes to
+ # file testcase05.
+
+ # no changes for testcase06
+
+ # The two branches make the same changes:
+ cp ../yours/testcase07 .
+
+ cat >testcase08 <<\EOF
+no
+changes
+here
+
+First change will delete this line.
+
+First change will also delete this line.
+
+ no
+ changes
+ here
+
+Second change has now changed it here.
+
+ no
+ changes
+ here
+
+Both changes move this line to the end of the file.
+EOF
+
+ cat >testcase09 <<\EOF
+m
+a
+{
+}
+b
+{
+}
+c
+{
+}
+EOF
+
+ cat >testcase10 <<\EOF
+
+ petRpY ( MtatRk );
+ fV ( MtatRk != Zy ) UDTXUK_DUUZU ( BGKT_ZFDK_qjT_HGTG );
+
+ MtatRk = MQfr_GttpfIRte_MtpeaL ( &acI, jfle_Uecopd_KRLIep * jfle_Uecopd_MfJe_fY_nEtek );
+ OjZy MtatRk = Uead_GttpfIRte_MtpeaL ( &acI, jfle_Uecopd_MfJe_fY_nEtek, nRVVep );
+
+ Bloke_GttpfIRte_MtpeaL ( &acI );
+MTGTXM Uead_Ktz_qjT_jfle_Uecopd ( fYt Y, uofd *nRVVep )
+{
+ fV ( Y < 16 )
+ {
+ petRpY ( Uead_Mectopk ( noot_Uecopd.qVtHatabcY0 * noot_Uecopd.MectopkFepBlRktep +
+ Y * jfle_Uecopd_MfJe_fY_Mectopk,
+ jfle_Uecopd_MfJe_fY_Mectopk,
+ nRVVep ) );
+ }
+ elke
+ {
+ petRpY ( Uead_Mectopk ( noot_Uecopd.qVtqfppHatabcY0 * noot_Uecopd.MectopkFepBlRktep +
+ ( Y - 16 ) * jfle_Uecopd_MfJe_fY_Mectopk,
+ jfle_Uecopd_MfJe_fY_Mectopk,
+ nRVVep ) );
+ }
+
+}
+
+
+/****************************************************************************
+* *
+* Uead Mectopk ( Uelatfue to tze cRppeYt raptftfoY ) *
+* *
+****************************************************************************/
+
+MTGTXM Uead_Mectopk ( RfYt64 Mtapt_Mectop, RfYt64 KRL_Mectopk, uofd *nRVVep )
+{
+MTGTXM MtatRk = Zy;
+
+ MtatRk = Uead_HfkQ ( FaptftfoY_TaIle.Uelatfue_Mectop + Mtapt_Mectop, KRL_Mectopk, nRVVep );
+
+ petRpY ( MtatRk );
+
+}
+ HfkQipfte ( waYdle, /* waYdle */
+ waYdleFok, /* ZVVket VpoL ktapt oV dfkQ */
+ (coYkt RfYt8*) nRVVep, /* nRVVep */
+ beYgtz /* nEtek to Apfte */
+ );
+
+ petRpY ( Zy );
+}
+
+EOF
+}
+
+# Create expected results of merge for diffmerge1
+diffmerge_create_expected_files() {
+ cat >testcase01 <<\EOF
+// Button.java
+
+package random.application;
+
+import random.util.*;
+
+public class Button
+{
+ /* Instantiates a Button with origin (0, 0) and zero width and height.
+ * You must call an initializer method to properly initialize the Button.
+ */
+ public Button ()
+ {
+ super ();
+
+ // _titleColor = Color.black;
+ // _disabledTitleColor = Color.gray;
+ // _titleFont = Font.defaultFont ();
+ }
+}
+EOF
+
+ cat >testcase02 <<\EOF
+y
+a
+a
+a
+m
+EOF
+
+ cat >testcase03 <<\EOF
+x
+s
+c
+s
+b
+s
+b
+s
+y
+EOF
+
+ cat >testcase04 <<\EOF
+v
+s
+m
+s
+v
+s
+m
+s
+v
+EOF
+
+ # Since there are no changes in the "mine" section, just take exactly
+ # the version in the "yours" section:
+ cp ../yours/testcase05 .
+
+ cp ../yours/testcase06 .
+
+ # Since the two branches make the same changes, the result should be
+ # the same as both branches. Here, I happen to pick yours to copy from,
+ # but I could have also picked mine, since the source of the copy is
+ # the same in either case. However, the mine has already been
+ # altered by the update command, so don't use it. Instead, use the
+ # yours section which has not had an update on it and so is unchanged:
+ cp ../yours/testcase07 .
+
+ cat >testcase08 <<\EOF
+no
+changes
+here
+
+First change has now added this in.
+
+ no
+ changes
+ here
+
+Second change has now changed it here.
+
+ no
+ changes
+ here
+
+Both changes move this line to the end of the file.
+EOF
+
+ cat >testcase09 <<\EOF
+
+m
+a
+{
+}
+b
+{
+}
+c
+{
+}
+EOF
+
+ cat >testcase10 <<\EOF
+
+ fV ( BzQkV_URYYfYg ) (*jfle_Uecopdk)[0].jfle_Uecopd_KRLIep = ZpfgfYal_jUK;
+
+ petRpY ( MtatRk );
+ fV ( MtatRk != Zy ) UDTXUK_DUUZU ( BGKT_ZFDK_qjT_HGTG );
+
+ fV ( jfle_Uecopd_KRLIep < 16 )
+ {
+ MtatRk = Uead_Ktz_qjT_jfle_Uecopd ( jfle_Uecopd_KRLIep, (uofd*)nRVVep );
+ }
+ elke
+ {
+ MtatRk = ZreY_GttpfIRte_MtpeaL ( qjT_jfle_Uecopdk, qjT_jfle_Uecopd_BoRYt, HGTG_TvFD, KXbb, KXbb, &acI );
+ fV ( MtatRk != Zy ) UDTXUK_DUUZU ( BGKT_ZFDK_qjT_HGTG );
+
+ MtatRk = MQfr_GttpfIRte_MtpeaL ( &acI, jfle_Uecopd_KRLIep * jfle_Uecopd_MfJe_fY_nEtek );
+ OjZy MtatRk = Uead_GttpfIRte_MtpeaL ( &acI, jfle_Uecopd_MfJe_fY_nEtek, nRVVep );
+
+ Bloke_GttpfIRte_MtpeaL ( &acI );
+MTGTXM Uead_Ktz_qjT_jfle_Uecopd ( fYt Y, uofd *nRVVep )
+{
+MTGTXM MtatRk = Zy;
+
+ fV ( Y < 16 )
+ {
+ petRpY ( Uead_Mectopk ( noot_Uecopd.qVtHatabcY0 * noot_Uecopd.MectopkFepBlRktep +
+ Y * jfle_Uecopd_MfJe_fY_Mectopk,
+ jfle_Uecopd_MfJe_fY_Mectopk,
+ nRVVep ) );
+ }
+ elke
+ {
+ petRpY ( Uead_Mectopk ( noot_Uecopd.qVtqfppHatabcY0 * noot_Uecopd.MectopkFepBlRktep +
+ ( Y - 16 ) * jfle_Uecopd_MfJe_fY_Mectopk,
+ jfle_Uecopd_MfJe_fY_Mectopk,
+ nRVVep ) );
+ }
+
+ petRpY ( MtatRk );
+
+}
+
+
+/****************************************************************************
+* *
+* Uead Mectopk ( Uelatfue to tze cRppeYt raptftfoY ) *
+* *
+****************************************************************************/
+
+MTGTXM Uead_Mectopk ( RfYt64 Mtapt_Mectop, RfYt64 KRL_Mectopk, uofd *nRVVep )
+{
+MTGTXM MtatRk = Zy;
+
+ MtatRk = Uead_HfkQ ( FaptftfoY_TaIle.Uelatfue_Mectop + Mtapt_Mectop, KRL_Mectopk, nRVVep );
+
+ petRpY ( MtatRk );
+
+}
+ HfkQipfte ( waYdle, /* waYdle */
+ waYdleFok, /* ZVVket VpoL ktapt oV dfkQ */
+ (coYkt RfYt8*) nRVVep, /* nRVVep */
+ beYgtz /* nEtek to Apfte */
+ );
+
+ petRpY ( Zy );
+}
+
+EOF
}
# Set up CVSROOT (the crerepos tests will test operating without CVSROOT set).
CVSROOT_DIRNAME=${TESTDIR}/cvsroot
-CVSROOT=${CVSROOT_DIRNAME} ; export CVSROOT
-if test "x$remote" = xyes; then
+if $remote; then
# Currently we test :fork: and :ext: (see crerepos test).
# Testing :pserver: would be hard (inetd issues).
# Also :ext: and :fork support CVS_SERVER in a convenient way.
@@ -726,6 +1564,8 @@ if test "x$remote" = xyes; then
# difference in modes-15 (see comments there).
CVSROOT=:fork:${CVSROOT_DIRNAME} ; export CVSROOT
CVS_SERVER=${testcvs}; export CVS_SERVER
+else
+ CVSROOT=${CVSROOT_DIRNAME} ; export CVSROOT
fi
dotest 1 "${testcvs} init" ''
@@ -733,7 +1573,40 @@ dotest 1a "${testcvs} init" ''
### The big loop
for what in $tests; do
+ if test -n "$fromtest" ; then
+ if test $fromtest = $what ; then
+ unset fromtest
+ else
+ continue
+ fi
+ fi
case $what in
+
+ version)
+ # We've had cases where the version command started dumping core,
+ # so we might as well test it
+ dotest version-1 "${testcvs} --version" \
+'
+Concurrent Versions System (CVS) [0-9.]*.*
+
+Copyright (c) [-0-9]* Brian Berliner, david d .zoo. zuhn,
+ Jeff Polk, and other authors
+
+CVS may be copied only under the terms of the GNU General Public License,
+a copy of which can be found with the CVS distribution kit.
+
+Specify the --help option for further information about CVS'
+
+ if $remote; then
+ dotest version-2r "${testcvs} version" \
+'Client: Concurrent Versions System (CVS) [0-9.]* (client/server)
+Server: Concurrent Versions System (CVS) [0-9.]* (client/server)'
+ else
+ dotest version-2 "${testcvs} version" \
+'Concurrent Versions System (CVS) [0-9.]*.*'
+ fi
+ ;;
+
basica)
# Similar in spirit to some of the basic1, and basic2
# tests, but hopefully a lot faster. Also tests operating on
@@ -748,7 +1621,7 @@ for what in $tests; do
dotest basica-0a "${testcvs} -q co -l ." ''
mkdir first-dir
dotest basica-0b "${testcvs} add first-dir" \
-"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
cd ..
rm -r 1
@@ -765,17 +1638,17 @@ for what in $tests; do
# Remote CVS gives the "cannot open CVS/Entries" error, which is
# clearly a bug, but not a simple one to fix.
dotest basica-1a10 "${testcvs} -n add sdir" \
-"Directory ${TESTDIR}/cvsroot/first-dir/sdir added to the repository" \
+"Directory ${CVSROOT_DIRNAME}/first-dir/sdir added to the repository" \
"${PROG} add: cannot open CVS/Entries for reading: No such file or directory
-Directory ${TESTDIR}/cvsroot/first-dir/sdir added to the repository"
+Directory ${CVSROOT_DIRNAME}/first-dir/sdir added to the repository"
dotest_fail basica-1a11 \
"test -d ${CVSROOT_DIRNAME}/first-dir/sdir" ''
dotest basica-2 "${testcvs} add sdir" \
-"Directory ${TESTDIR}/cvsroot/first-dir/sdir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir/sdir added to the repository"
cd sdir
mkdir ssdir
dotest basica-3 "${testcvs} add ssdir" \
-"Directory ${TESTDIR}/cvsroot/first-dir/sdir/ssdir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir added to the repository"
cd ssdir
echo ssfile >ssfile
@@ -797,16 +1670,16 @@ ${PROG}"' \[[a-z]* aborted\]: correct above errors first!' \
${PROG} "'\[[a-z]* aborted\]: correct the above errors first!'
cd ../..
dotest basica-5 "${testcvs} -q ci -m add-it" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
done
Checking in sdir/ssdir/ssfile;
-${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v <-- ssfile
+${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
initial revision: 1\.1
done"
dotest_fail basica-5a \
"${testcvs} -q tag BASE sdir/ssdir/ssfile" \
"${PROG} [a-z]*: Attempt to add reserved tag name BASE
-${PROG} \[[a-z]* aborted\]: failed to set tag BASE to revision 1\.1 in ${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v"
+${PROG} \[[a-z]* aborted\]: failed to set tag BASE to revision 1\.1 in ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v"
dotest basica-5b "${testcvs} -q tag NOT_RESERVED" \
'T sdir/ssdir/ssfile'
@@ -815,11 +1688,11 @@ ${PROG} \[[a-z]* aborted\]: failed to set tag BASE to revision 1\.1 in ${TESTDIR
dotest_status basica-6.2 1 "${testcvs} -q diff -c" \
"Index: sdir/ssdir/ssfile
===================================================================
-RCS file: ${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
retrieving revision 1\.1
diff -c -r1\.1 ssfile
-\*\*\* sdir/ssdir/ssfile [0-9/]* [0-9:]* 1\.1
---- sdir/ssdir/ssfile [0-9/]* [0-9:]*
+\*\*\* sdir/ssdir/ssfile ${RFCDATE} 1\.1
+--- sdir/ssdir/ssfile ${RFCDATE}
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
\*\*\* 1 \*\*\*\*
--- 1,2 ----
@@ -828,11 +1701,11 @@ ${PLUS} ssfile line 2"
dotest_status basica-6.3 1 "${testcvs} -q diff -c -rBASE" \
"Index: sdir/ssdir/ssfile
===================================================================
-RCS file: ${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
retrieving revision 1\.1
diff -c -r1\.1 ssfile
-\*\*\* sdir/ssdir/ssfile [0-9/]* [0-9:]* 1\.1
---- sdir/ssdir/ssfile [0-9/]* [0-9:]*
+\*\*\* sdir/ssdir/ssfile ${RFCDATE} 1\.1
+--- sdir/ssdir/ssfile ${RFCDATE}
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
\*\*\* 1 \*\*\*\*
--- 1,2 ----
@@ -840,7 +1713,7 @@ diff -c -r1\.1 ssfile
${PLUS} ssfile line 2"
dotest basica-7 "${testcvs} -q ci -m modify-it" \
"Checking in sdir/ssdir/ssfile;
-${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v <-- ssfile
+${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
new revision: 1\.2; previous revision: 1\.1
done"
dotest_fail basica-nonexist "${testcvs} -q ci nonexist" \
@@ -853,31 +1726,31 @@ done"
dotest basica-8a0 "${testcvs} -q ci -m not-modified ssfile" ''
dotest basica-8a "${testcvs} -q ci -f -m force-it" \
"Checking in ssfile;
-${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v <-- ssfile
+${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
new revision: 1\.3; previous revision: 1\.2
done"
dotest basica-8a1 "${testcvs} -q ci -m bump-it -r 2.0" \
"Checking in ssfile;
-${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v <-- ssfile
+${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
new revision: 2\.0; previous revision: 1\.3
done"
# -f should not be necessary, but it should be harmless.
# Also test the "-r 3" (rather than "-r 3.0") usage.
dotest basica-8a2 "${testcvs} -q ci -m bump-it -f -r 3" \
"Checking in ssfile;
-${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v <-- ssfile
+${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
new revision: 3\.1; previous revision: 2\.0
done"
# Test using -r to create a branch
dotest_fail basica-8a3 "${testcvs} -q ci -m bogus -r 3.0.0" \
"Checking in ssfile;
-${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v <-- ssfile
-${PROG} [a-z]*: ${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v: can't find branch point 3\.0
+${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
+${PROG} [a-z]*: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v: can't find branch point 3\.0
${PROG} [a-z]*: could not check in ssfile"
dotest basica-8a4 "${testcvs} -q ci -m valid -r 3.1.2" \
"Checking in ssfile;
-${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v <-- ssfile
+${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
new revision: 3\.1\.2\.1; previous revision: 3\.1
done"
# now get rid of the sticky tag and go back to the trunk
@@ -887,7 +1760,7 @@ done"
dotest basica-8b "${testcvs} -q diff -r1.2 -r1.3" \
"Index: sdir/ssdir/ssfile
===================================================================
-RCS file: ${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
retrieving revision 1\.2
retrieving revision 1\.3
diff -r1\.2 -r1\.3"
@@ -895,7 +1768,7 @@ diff -r1\.2 -r1\.3"
dotest_fail basica-8b1 "${testcvs} -q diff -r1.2 -r1.3 -C 3isacrowd" \
"Index: sdir/ssdir/ssfile
===================================================================
-RCS file: ${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
retrieving revision 1\.2
retrieving revision 1\.3
diff -C3isacrowd -r1\.2 -r1\.3
@@ -916,6 +1789,27 @@ ${PROG} [a-z]*: invalid context length argument"
1\.1 .'"${username}"' *[0-9a-zA-Z-]*.: ssfile
1\.2 .'"${username}"' *[0-9a-zA-Z-]*.: ssfile line 2'
+ # Test resurrecting with strange revision numbers
+ cd sdir/ssdir
+ dotest basica-r1 "${testcvs} rm -f ssfile" \
+"${PROG} [a-z]*: scheduling .ssfile. for removal
+${PROG} [a-z]*: use .${PROG} commit. to remove this file permanently"
+ dotest basica-r2 "${testcvs} -q ci -m remove" \
+"Removing ssfile;
+${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
+new revision: delete; previous revision: 3\.1
+done"
+ dotest basica-r3 "${testcvs} -q up -p -r 3.1 ssfile >ssfile" ""
+ dotest basica-r4 "${testcvs} add ssfile" \
+"${PROG} [a-z]*: re-adding file ssfile (in place of dead revision 3\.2)
+${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
+ dotest basica-r5 "${testcvs} -q ci -m resurrect" \
+"Checking in ssfile;
+${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
+new revision: 3\.3; previous revision: 3\.2
+done"
+ cd ../..
+
# As long as we have a file with a few revisions, test
# a few "cvs admin -o" invocations.
cd sdir/ssdir
@@ -923,40 +1817,42 @@ ${PROG} [a-z]*: invalid context length argument"
"${PROG} [a-z]*: while processing more than one file:
${PROG} \[[a-z]* aborted\]: attempt to specify a numeric revision"
dotest basica-o2 "${testcvs} admin -o 1.2::1.2 ssfile" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
done"
dotest basica-o2a "${testcvs} admin -o 1.1::NOT_RESERVED ssfile" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
done"
dotest_fail basica-o2b "${testcvs} admin -o 1.1::NOT_EXIST ssfile" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v
-${PROG} [a-z]*: ${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v: Revision NOT_EXIST doesn't exist.
-${PROG} [a-z]*: cannot modify RCS file for .ssfile."
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
+${PROG} [a-z]*: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v: Revision NOT_EXIST doesn't exist.
+${PROG} [a-z]*: RCS file for .ssfile. not modified\."
dotest basica-o3 "${testcvs} admin -o 1.2::1.3 ssfile" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
done"
dotest basica-o4 "${testcvs} admin -o 3.1:: ssfile" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
+deleting revision 3\.3
+deleting revision 3\.2
done"
dotest basica-o5 "${testcvs} admin -o ::1.1 ssfile" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
done"
dotest basica-o5a "${testcvs} -n admin -o 1.2::3.1 ssfile" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
deleting revision 2\.0
deleting revision 1\.3
done"
dotest basica-o6 "${testcvs} admin -o 1.2::3.1 ssfile" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
deleting revision 2\.0
deleting revision 1\.3
done"
dotest basica-o6a "${testcvs} admin -o 3.1.2: ssfile" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
deleting revision 3\.1\.2\.1
done"
dotest basica-o7 "${testcvs} log -N ssfile" "
-RCS file: ${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
Working file: ssfile
head: 3\.1
branch:
@@ -996,10 +1892,10 @@ add-it
"${PROG} [a-z]*: scheduling file .topfile. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest basicb-0c "${testcvs} -q ci -m add-it topfile" \
-"RCS file: ${TESTDIR}/cvsroot/topfile,v
+"RCS file: ${CVSROOT_DIRNAME}/topfile,v
done
Checking in topfile;
-${TESTDIR}/cvsroot/topfile,v <-- topfile
+${CVSROOT_DIRNAME}/topfile,v <-- topfile
initial revision: 1\.1
done"
cd ..
@@ -1015,7 +1911,7 @@ done"
dotest basicb-0d0 "${testcvs} -q co -l ." ""
mkdir first-dir
dotest basicb-0e "${testcvs} add first-dir" \
-"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
cd ..
rm -r 2
@@ -1032,10 +1928,10 @@ done"
# (we're using relative paths).
: dotest basicb-1b "cat CVS/Repository" \
-"${TESTDIR}/cvsroot/\." \
+"${CVSROOT_DIRNAME}/\." \
"\."
dotest basicb-1c "cat first-dir/CVS/Repository" \
-"${TESTDIR}/cvsroot/first-dir" \
+"${CVSROOT_DIRNAME}/first-dir" \
"first-dir"
cd first-dir
@@ -1044,8 +1940,8 @@ done"
# special only when it is directly in $CVSROOT/CVSROOT.
mkdir Emptydir sdir2
dotest basicb-2 "${testcvs} add Emptydir sdir2" \
-"Directory ${TESTDIR}/cvsroot/first-dir/Emptydir added to the repository
-Directory ${TESTDIR}/cvsroot/first-dir/sdir2 added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir/Emptydir added to the repository
+Directory ${CVSROOT_DIRNAME}/first-dir/sdir2 added to the repository"
cd Emptydir
echo sfile1 starts >sfile1
dotest basicb-2a10 "${testcvs} -n add sfile1" \
@@ -1081,22 +1977,22 @@ ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
${PROG} [a-z]*: but CVS uses CVS for its own purposes; skipping CVS directory"
cd ..
dotest basicb-5 "${testcvs} -q ci -m add" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/Emptydir/sfile1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/Emptydir/sfile1,v
done
Checking in Emptydir/sfile1;
-${TESTDIR}/cvsroot/first-dir/Emptydir/sfile1,v <-- sfile1
+${CVSROOT_DIRNAME}/first-dir/Emptydir/sfile1,v <-- sfile1
initial revision: 1\.1
done
-RCS file: ${TESTDIR}/cvsroot/first-dir/sdir2/sfile2,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir2/sfile2,v
done
Checking in sdir2/sfile2;
-${TESTDIR}/cvsroot/first-dir/sdir2/sfile2,v <-- sfile2
+${CVSROOT_DIRNAME}/first-dir/sdir2/sfile2,v <-- sfile2
initial revision: 1\.1
done"
echo sfile1 develops >Emptydir/sfile1
dotest basicb-6 "${testcvs} -q ci -m modify" \
"Checking in Emptydir/sfile1;
-${TESTDIR}/cvsroot/first-dir/Emptydir/sfile1,v <-- sfile1
+${CVSROOT_DIRNAME}/first-dir/Emptydir/sfile1,v <-- sfile1
new revision: 1\.2; previous revision: 1\.1
done"
dotest basicb-7 "${testcvs} -q tag release-1" 'T Emptydir/sfile1
@@ -1104,7 +2000,7 @@ T sdir2/sfile2'
echo not in time for release-1 >sdir2/sfile2
dotest basicb-8 "${testcvs} -q ci -m modify-2" \
"Checking in sdir2/sfile2;
-${TESTDIR}/cvsroot/first-dir/sdir2/sfile2,v <-- sfile2
+${CVSROOT_DIRNAME}/first-dir/sdir2/sfile2,v <-- sfile2
new revision: 1\.2; previous revision: 1\.1
done"
# See if CVS can correctly notice when an invalid numeric
@@ -1146,19 +2042,19 @@ U newdir/first-dir/sdir2/sfile2'
# is defined (we're using relative paths).
: dotest basicb-9b "cat CVS/Repository" \
-"${TESTDIR}/cvsroot/\." \
+"${CVSROOT_DIRNAME}/\." \
"\."
dotest basicb-9c "cat newdir/CVS/Repository" \
-"${TESTDIR}/cvsroot/\." \
+"${CVSROOT_DIRNAME}/\." \
"\."
dotest basicb-9d "cat newdir/first-dir/CVS/Repository" \
-"${TESTDIR}/cvsroot/first-dir" \
+"${CVSROOT_DIRNAME}/first-dir" \
"first-dir"
dotest basicb-9e "cat newdir/first-dir/Emptydir/CVS/Repository" \
-"${TESTDIR}/cvsroot/first-dir/Emptydir" \
+"${CVSROOT_DIRNAME}/first-dir/Emptydir" \
"first-dir/Emptydir"
dotest basicb-9f "cat newdir/first-dir/sdir2/CVS/Repository" \
-"${TESTDIR}/cvsroot/first-dir/sdir2" \
+"${CVSROOT_DIRNAME}/first-dir/sdir2" \
"first-dir/sdir2"
dotest basicb-10 "cat newdir/first-dir/Emptydir/sfile1 newdir/first-dir/sdir2/sfile2" \
@@ -1188,24 +2084,24 @@ U sub1/sub2/sdir2/sfile2"
dotest basicb-14 "${testcvs} -q co -l ." 'U topfile'
mkdir second-dir
dotest basicb-15 "${testcvs} add second-dir" \
-"Directory ${TESTDIR}/cvsroot/second-dir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/second-dir added to the repository"
cd second-dir
touch aa
dotest basicb-16 "${testcvs} add aa" \
"${PROG} [a-z]*: scheduling file .aa. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest basicb-17 "${testcvs} -q ci -m add" \
-"RCS file: ${TESTDIR}/cvsroot/second-dir/aa,v
+"RCS file: ${CVSROOT_DIRNAME}/second-dir/aa,v
done
Checking in aa;
-${TESTDIR}/cvsroot/second-dir/aa,v <-- aa
+${CVSROOT_DIRNAME}/second-dir/aa,v <-- aa
initial revision: 1\.1
done"
cd ..
# Try to remove all revisions in a file.
dotest_fail basicb-o1 "${testcvs} admin -o1.1 topfile" \
-"RCS file: ${TESTDIR}/cvsroot/topfile,v
+"RCS file: ${CVSROOT_DIRNAME}/topfile,v
deleting revision 1\.1
${PROG} \[[a-z]* aborted\]: attempt to delete all revisions"
dotest basicb-o2 "${testcvs} -q update -d first-dir" \
@@ -1213,7 +2109,7 @@ ${PROG} \[[a-z]* aborted\]: attempt to delete all revisions"
U first-dir/sdir2/sfile2"
dotest_fail basicb-o3 \
"${testcvs} admin -o1.1:1.2 first-dir/sdir2/sfile2" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/sdir2/sfile2,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir2/sfile2,v
deleting revision 1\.2
deleting revision 1\.1
${PROG} \[[a-z]* aborted\]: attempt to delete all revisions"
@@ -1234,7 +2130,7 @@ ${PROG} \[admin aborted\]: specify ${PROG} -H admin for usage information"
cd ..
rmdir 1
- if test "$keep" = yes; then
+ if $keep; then
echo Keeping ${TESTDIR} and exiting due to --keep
exit 0
fi
@@ -1253,8 +2149,8 @@ ${PROG} \[[a-z]* aborted\]: there is no version here; run .${PROG} checkout. fir
dotest basicc-2 "${testcvs} -q co -l ." ''
mkdir first-dir second-dir
dotest basicc-3 "${testcvs} add first-dir second-dir" \
-"Directory ${TESTDIR}/cvsroot/first-dir added to the repository
-Directory ${TESTDIR}/cvsroot/second-dir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository
+Directory ${CVSROOT_DIRNAME}/second-dir added to the repository"
# Old versions of CVS often didn't create this top-level CVS
# directory in the first place. I think that maybe the only
# way to get it to work currently is to let CVS create it,
@@ -1311,7 +2207,7 @@ ${PROG} [a-z]*: Updating second-dir"
basic1)
# first dive - add a files, first singly, then in a group.
mkdir ${CVSROOT_DIRNAME}/first-dir
- mkdir 1; cd 1
+ mkdir basic1; cd basic1
# check out an empty directory
dotest basic1-1 "${testcvs} -q co first-dir" ''
@@ -1444,28 +2340,28 @@ A first-dir/file5"
cd first-dir
dotest basic1-14-add-ci \
"${testcvs} commit -m test file2 file3 file4 file5" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
done
Checking in file2;
-${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
+${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
initial revision: 1\.1
done
-RCS file: ${TESTDIR}/cvsroot/first-dir/file3,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file3,v
done
Checking in file3;
-${TESTDIR}/cvsroot/first-dir/file3,v <-- file3
+${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
initial revision: 1\.1
done
-RCS file: ${TESTDIR}/cvsroot/first-dir/file4,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
done
Checking in file4;
-${TESTDIR}/cvsroot/first-dir/file4,v <-- file4
+${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
initial revision: 1\.1
done
-RCS file: ${TESTDIR}/cvsroot/first-dir/file5,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file5,v
done
Checking in file5;
-${TESTDIR}/cvsroot/first-dir/file5,v <-- file5
+${CVSROOT_DIRNAME}/first-dir/file5,v <-- file5
initial revision: 1\.1
done"
dotest basic1-15-add-ci \
@@ -1476,7 +2372,7 @@ done"
File: file2 Status: Up-to-date
Working revision: 1\.1.*
- Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/file2,v
+ Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file2,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: (none)
@@ -1485,7 +2381,7 @@ File: file2 Status: Up-to-date
File: file3 Status: Up-to-date
Working revision: 1\.1.*
- Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/file3,v
+ Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file3,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: (none)
@@ -1494,7 +2390,7 @@ File: file3 Status: Up-to-date
File: file4 Status: Up-to-date
Working revision: 1\.1.*
- Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/file4,v
+ Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file4,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: (none)
@@ -1503,7 +2399,7 @@ File: file4 Status: Up-to-date
File: file5 Status: Up-to-date
Working revision: 1\.1.*
- Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/file5,v
+ Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file5,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: (none)"
@@ -1561,7 +2457,7 @@ R file5"
File: no file file2 Status: Locally Removed
Working revision: -1\.1.*
- Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/file2,v
+ Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file2,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: (none)
@@ -1570,7 +2466,7 @@ File: no file file2 Status: Locally Removed
File: no file file3 Status: Locally Removed
Working revision: -1\.1.*
- Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/file3,v
+ Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file3,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: (none)
@@ -1579,7 +2475,7 @@ File: no file file3 Status: Locally Removed
File: no file file4 Status: Locally Removed
Working revision: -1\.1.*
- Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/file4,v
+ Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file4,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: (none)
@@ -1588,7 +2484,7 @@ File: no file file4 Status: Locally Removed
File: no file file5 Status: Locally Removed
Working revision: -1\.1.*
- Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/file5,v
+ Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file5,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: (none)"
@@ -1628,19 +2524,19 @@ R first-dir/file5"
cd first-dir
dotest basic1-14-rm-ci "${testcvs} -q commit -m test" \
"Removing file2;
-${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
+${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
new revision: delete; previous revision: 1\.1
done
Removing file3;
-${TESTDIR}/cvsroot/first-dir/file3,v <-- file3
+${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
new revision: delete; previous revision: 1\.1
done
Removing file4;
-${TESTDIR}/cvsroot/first-dir/file4,v <-- file4
+${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
new revision: delete; previous revision: 1\.1
done
Removing file5;
-${TESTDIR}/cvsroot/first-dir/file5,v <-- file5
+${CVSROOT_DIRNAME}/first-dir/file5,v <-- file5
new revision: delete; previous revision: 1\.1
done"
dotest basic1-15-rm-ci \
@@ -1674,12 +2570,12 @@ done"
cd ..
cd ..
- if test "$keep" = yes; then
+ if $keep; then
echo Keeping ${TESTDIR} and exiting due to --keep
exit 0
fi
- rm -r 1
+ rm -r basic1
rm -rf ${CVSROOT_DIRNAME}/first-dir
;;
@@ -1691,7 +2587,7 @@ done"
for i in dir1 dir2 dir3 dir4 dir5 dir6 dir7 dir8; do
mkdir $i
dotest deep-2-$i "${testcvs} add $i" \
-"Directory ${TESTDIR}/cvsroot/first-dir/dir1[/dir0-9]* added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir/dir1[/dir0-9]* added to the repository"
cd $i
echo file1 >file1
dotest deep-3-$i "${testcvs} add file1" \
@@ -1700,52 +2596,52 @@ done"
done
cd ../../../../../../../../..
dotest_lit deep-4 "${testcvs} -q ci -m add-them first-dir" <<HERE
-RCS file: ${TESTDIR}/cvsroot/first-dir/dir1/file1,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/file1,v
done
Checking in first-dir/dir1/file1;
-${TESTDIR}/cvsroot/first-dir/dir1/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/dir1/file1,v <-- file1
initial revision: 1.1
done
-RCS file: ${TESTDIR}/cvsroot/first-dir/dir1/dir2/file1,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file1,v
done
Checking in first-dir/dir1/dir2/file1;
-${TESTDIR}/cvsroot/first-dir/dir1/dir2/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file1,v <-- file1
initial revision: 1.1
done
-RCS file: ${TESTDIR}/cvsroot/first-dir/dir1/dir2/dir3/file1,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/file1,v
done
Checking in first-dir/dir1/dir2/dir3/file1;
-${TESTDIR}/cvsroot/first-dir/dir1/dir2/dir3/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/file1,v <-- file1
initial revision: 1.1
done
-RCS file: ${TESTDIR}/cvsroot/first-dir/dir1/dir2/dir3/dir4/file1,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/file1,v
done
Checking in first-dir/dir1/dir2/dir3/dir4/file1;
-${TESTDIR}/cvsroot/first-dir/dir1/dir2/dir3/dir4/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/file1,v <-- file1
initial revision: 1.1
done
-RCS file: ${TESTDIR}/cvsroot/first-dir/dir1/dir2/dir3/dir4/dir5/file1,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/file1,v
done
Checking in first-dir/dir1/dir2/dir3/dir4/dir5/file1;
-${TESTDIR}/cvsroot/first-dir/dir1/dir2/dir3/dir4/dir5/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/file1,v <-- file1
initial revision: 1.1
done
-RCS file: ${TESTDIR}/cvsroot/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/file1,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/file1,v
done
Checking in first-dir/dir1/dir2/dir3/dir4/dir5/dir6/file1;
-${TESTDIR}/cvsroot/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/file1,v <-- file1
initial revision: 1.1
done
-RCS file: ${TESTDIR}/cvsroot/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/file1,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/file1,v
done
Checking in first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/file1;
-${TESTDIR}/cvsroot/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/file1,v <-- file1
initial revision: 1.1
done
-RCS file: ${TESTDIR}/cvsroot/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/file1,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/file1,v
done
Checking in first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/file1;
-${TESTDIR}/cvsroot/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/file1,v <-- file1
initial revision: 1.1
done
HERE
@@ -1756,7 +2652,7 @@ HERE
"${PROG} [a-z]*: scheduling .file1. for removal
${PROG} [a-z]*: use .${PROG} commit. to remove this file permanently"
dotest deep-4a1 "${testcvs} -q ci -m rm-it" "Removing file1;
-${TESTDIR}/cvsroot/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/file1,v <-- file1
new revision: delete; previous revision: 1\.1
done"
cd ../../..
@@ -1789,7 +2685,7 @@ ${PROG} [a-z]*: use .${PROG} commit. to remove this file permanently"
dotest deep-rm2 "${testcvs} -q update -d -P" 'R dir7/file1'
dotest deep-rm3 "test -d dir7" ''
dotest deep-rm4 "${testcvs} -q ci -m rm-it" "Removing dir7/file1;
-${TESTDIR}/cvsroot/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/file1,v <-- file1
new revision: delete; previous revision: 1\.1
done"
dotest deep-rm5 "${testcvs} -q update -d -P" ''
@@ -1805,11 +2701,11 @@ ${PROG} [a-z]*: scheduling .dir5/dir6/file1. for removal
${PROG} [a-z]*: use .${PROG} commit. to remove these files permanently"
dotest deep-rm8 "${testcvs} -q ci -m rm-it" \
"Removing dir5/file1;
-${TESTDIR}/cvsroot/first-dir/dir1/dir2/dir3/dir4/dir5/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/file1,v <-- file1
new revision: delete; previous revision: 1\.1
done
Removing dir5/dir6/file1;
-${TESTDIR}/cvsroot/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/file1,v <-- file1
new revision: delete; previous revision: 1\.1
done"
dotest deep-rm9 "${testcvs} -q update -d -P" ''
@@ -1844,11 +2740,8 @@ done"
for i in first-dir dir1 dir2 ; do
if test ! -d $i ; then
mkdir $i
- if ${CVS} add $i >> ${LOGFILE}; then
- pass 29-$i
- else
- fail 29-$i
- fi
+ dotest basic2-2-$i "${testcvs} add $i" \
+"Directory ${CVSROOT_DIRNAME}/.*/$i added to the repository"
fi
cd $i
@@ -1857,31 +2750,93 @@ done"
echo $j > $j
done
- if ${CVS} add file6 file7 2>> ${LOGFILE}; then
- pass 30-$i-$j
- else
- fail 30-$i-$j
- fi
+ dotest basic2-3-$i "${testcvs} add file6 file7" \
+"${PROG} [a-z]*: scheduling file .file6. for addition
+${PROG} [a-z]*: scheduling file .file7. for addition
+${PROG} [a-z]*: use .${PROG} commit. to add these files permanently"
+
done
cd ../../..
- if ${CVS} update first-dir ; then
- pass 31
- else
- fail 31
- fi
+ dotest basic2-4 "${testcvs} update first-dir" \
+"${PROG} [a-z]*: Updating first-dir
+A first-dir/file6
+A first-dir/file7
+${PROG} [a-z]*: Updating first-dir/dir1
+A first-dir/dir1/file6
+A first-dir/dir1/file7
+${PROG} [a-z]*: Updating first-dir/dir1/dir2
+A first-dir/dir1/dir2/file6
+A first-dir/dir1/dir2/file7"
# fixme: doesn't work right for added files.
- if ${CVS} log first-dir >> ${LOGFILE}; then
- pass 32
- else
- fail 32
- fi
+ dotest basic2-5 "${testcvs} log first-dir" \
+"${PROG} [a-z]*: Logging first-dir
+${PROG} [a-z]*: file6 has been added, but not committed
+${PROG} [a-z]*: file7 has been added, but not committed
+${PROG} [a-z]*: Logging first-dir/dir1
+${PROG} [a-z]*: file6 has been added, but not committed
+${PROG} [a-z]*: file7 has been added, but not committed
+${PROG} [a-z]*: Logging first-dir/dir1/dir2
+${PROG} [a-z]*: file6 has been added, but not committed
+${PROG} [a-z]*: file7 has been added, but not committed"
+
+ dotest basic2-6 "${testcvs} status first-dir" \
+"${PROG} [a-z]*: Examining first-dir
+===================================================================
+File: file6 Status: Locally Added
- if ${CVS} status first-dir >> ${LOGFILE}; then
- pass 33
- else
- fail 33
- fi
+ Working revision: New file!
+ Repository revision: No revision control file
+ Sticky Tag: (none)
+ Sticky Date: (none)
+ Sticky Options: (none)
+
+===================================================================
+File: file7 Status: Locally Added
+
+ Working revision: New file!
+ Repository revision: No revision control file
+ Sticky Tag: (none)
+ Sticky Date: (none)
+ Sticky Options: (none)
+
+${PROG} [a-z]*: Examining first-dir/dir1
+===================================================================
+File: file6 Status: Locally Added
+
+ Working revision: New file!
+ Repository revision: No revision control file
+ Sticky Tag: (none)
+ Sticky Date: (none)
+ Sticky Options: (none)
+
+===================================================================
+File: file7 Status: Locally Added
+
+ Working revision: New file!
+ Repository revision: No revision control file
+ Sticky Tag: (none)
+ Sticky Date: (none)
+ Sticky Options: (none)
+
+${PROG} [a-z]*: Examining first-dir/dir1/dir2
+===================================================================
+File: file6 Status: Locally Added
+
+ Working revision: New file!
+ Repository revision: No revision control file
+ Sticky Tag: (none)
+ Sticky Date: (none)
+ Sticky Options: (none)
+
+===================================================================
+File: file7 Status: Locally Added
+
+ Working revision: New file!
+ Repository revision: No revision control file
+ Sticky Tag: (none)
+ Sticky Date: (none)
+ Sticky Options: (none)"
# XXX why is this commented out???
# if ${CVS} diff -u first-dir >> ${LOGFILE} || test $? = 1 ; then
@@ -1890,17 +2845,54 @@ done"
# fail 34
# fi
- if ${CVS} ci -m "second dive" first-dir >> ${LOGFILE} 2>&1; then
- pass 35
- else
- fail 35
- fi
+ dotest basic2-8 "${testcvs} -q ci -m 'second dive' first-dir" \
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file6,v
+done
+Checking in first-dir/file6;
+${CVSROOT_DIRNAME}/first-dir/file6,v <-- file6
+initial revision: 1\.1
+done
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file7,v
+done
+Checking in first-dir/file7;
+${CVSROOT_DIRNAME}/first-dir/file7,v <-- file7
+initial revision: 1\.1
+done
+RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/file6,v
+done
+Checking in first-dir/dir1/file6;
+${CVSROOT_DIRNAME}/first-dir/dir1/file6,v <-- file6
+initial revision: 1\.1
+done
+RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/file7,v
+done
+Checking in first-dir/dir1/file7;
+${CVSROOT_DIRNAME}/first-dir/dir1/file7,v <-- file7
+initial revision: 1\.1
+done
+RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file6,v
+done
+Checking in first-dir/dir1/dir2/file6;
+${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file6,v <-- file6
+initial revision: 1\.1
+done
+RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file7,v
+done
+Checking in first-dir/dir1/dir2/file7;
+${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file7,v <-- file7
+initial revision: 1\.1
+done"
- if ${CVS} tag second-dive first-dir ; then
- pass 36
- else
- fail 36
- fi
+ dotest basic2-9 "${testcvs} tag second-dive first-dir" \
+"${PROG} [a-z]*: Tagging first-dir
+T first-dir/file6
+T first-dir/file7
+${PROG} [a-z]*: Tagging first-dir/dir1
+T first-dir/dir1/file6
+T first-dir/dir1/file7
+${PROG} [a-z]*: Tagging first-dir/dir1/dir2
+T first-dir/dir1/dir2/file6
+T first-dir/dir1/dir2/file7"
# third dive - in bunch o' directories, add bunch o' files,
# delete some, change some.
@@ -1914,40 +2906,228 @@ done"
# delete a file
rm file7
- if ${CVS} rm file7 2>> ${LOGFILE}; then
- pass 37-$i
- else
- fail 37-$i
- fi
+ dotest basic2-10-$i "${testcvs} rm file7" \
+"${PROG} [a-z]*: scheduling .file7. for removal
+${PROG} [a-z]*: use .${PROG} commit. to remove this file permanently"
# and add a new file
echo file14 >file14
- if ${CVS} add file14 2>> ${LOGFILE}; then
- pass 38-$i
- else
- fail 38-$i
- fi
+ dotest basic2-11-$i "${testcvs} add file14" \
+"${PROG} [a-z]*: scheduling file .file14. for addition
+${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
done
+
cd ../../..
- if ${CVS} update first-dir ; then
- pass 39
- else
- fail 39
- fi
+ dotest basic2-12 "${testcvs} update first-dir" \
+"${PROG} [a-z]*: Updating first-dir
+A first-dir/file14
+M first-dir/file6
+R first-dir/file7
+${PROG} [a-z]*: Updating first-dir/dir1
+A first-dir/dir1/file14
+M first-dir/dir1/file6
+R first-dir/dir1/file7
+${PROG} [a-z]*: Updating first-dir/dir1/dir2
+A first-dir/dir1/dir2/file14
+M first-dir/dir1/dir2/file6
+R first-dir/dir1/dir2/file7"
# FIXME: doesn't work right for added files
- if ${CVS} log first-dir >> ${LOGFILE}; then
- pass 40
- else
- fail 40
- fi
+ dotest basic2-13 "${testcvs} log first-dir" \
+"${PROG} [a-z]*: Logging first-dir
+${PROG} [a-z]*: file14 has been added, but not committed
- if ${CVS} status first-dir >> ${LOGFILE}; then
- pass 41
- else
- fail 41
- fi
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file6,v
+Working file: first-dir/file6
+head: 1\.1
+branch:
+locks: strict
+access list:
+symbolic names:
+ second-dive: 1\.1
+keyword substitution: kv
+total revisions: 1; selected revisions: 1
+description:
+----------------------------
+revision 1\.1
+date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
+second dive
+=============================================================================
+
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file7,v
+Working file: first-dir/file7
+head: 1\.1
+branch:
+locks: strict
+access list:
+symbolic names:
+ second-dive: 1\.1
+keyword substitution: kv
+total revisions: 1; selected revisions: 1
+description:
+----------------------------
+revision 1\.1
+date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
+second dive
+=============================================================================
+${PROG} [a-z]*: Logging first-dir/dir1
+${PROG} [a-z]*: file14 has been added, but not committed
+
+RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/file6,v
+Working file: first-dir/dir1/file6
+head: 1\.1
+branch:
+locks: strict
+access list:
+symbolic names:
+ second-dive: 1\.1
+keyword substitution: kv
+total revisions: 1; selected revisions: 1
+description:
+----------------------------
+revision 1\.1
+date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
+second dive
+=============================================================================
+
+RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/file7,v
+Working file: first-dir/dir1/file7
+head: 1\.1
+branch:
+locks: strict
+access list:
+symbolic names:
+ second-dive: 1\.1
+keyword substitution: kv
+total revisions: 1; selected revisions: 1
+description:
+----------------------------
+revision 1\.1
+date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
+second dive
+=============================================================================
+${PROG} [a-z]*: Logging first-dir/dir1/dir2
+${PROG} [a-z]*: file14 has been added, but not committed
+
+RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file6,v
+Working file: first-dir/dir1/dir2/file6
+head: 1\.1
+branch:
+locks: strict
+access list:
+symbolic names:
+ second-dive: 1\.1
+keyword substitution: kv
+total revisions: 1; selected revisions: 1
+description:
+----------------------------
+revision 1\.1
+date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
+second dive
+=============================================================================
+
+RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file7,v
+Working file: first-dir/dir1/dir2/file7
+head: 1\.1
+branch:
+locks: strict
+access list:
+symbolic names:
+ second-dive: 1\.1
+keyword substitution: kv
+total revisions: 1; selected revisions: 1
+description:
+----------------------------
+revision 1\.1
+date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
+second dive
+============================================================================="
+
+ dotest basic2-14 "${testcvs} status first-dir" \
+"${PROG} [a-z]*: Examining first-dir
+===================================================================
+File: file14 Status: Locally Added
+
+ Working revision: New file!
+ Repository revision: No revision control file
+ Sticky Tag: (none)
+ Sticky Date: (none)
+ Sticky Options: (none)
+
+===================================================================
+File: file6 Status: Locally Modified
+
+ Working revision: 1\.1.*
+ Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file6,v
+ Sticky Tag: (none)
+ Sticky Date: (none)
+ Sticky Options: (none)
+
+===================================================================
+File: no file file7 Status: Locally Removed
+
+ Working revision: -1\.1.*
+ Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file7,v
+ Sticky Tag: (none)
+ Sticky Date: (none)
+ Sticky Options: (none)
+
+${PROG} [a-z]*: Examining first-dir/dir1
+===================================================================
+File: file14 Status: Locally Added
+
+ Working revision: New file!
+ Repository revision: No revision control file
+ Sticky Tag: (none)
+ Sticky Date: (none)
+ Sticky Options: (none)
+
+===================================================================
+File: file6 Status: Locally Modified
+
+ Working revision: 1\.1.*
+ Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/dir1/file6,v
+ Sticky Tag: (none)
+ Sticky Date: (none)
+ Sticky Options: (none)
+
+===================================================================
+File: no file file7 Status: Locally Removed
+
+ Working revision: -1\.1.*
+ Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/dir1/file7,v
+ Sticky Tag: (none)
+ Sticky Date: (none)
+ Sticky Options: (none)
+
+${PROG} [a-z]*: Examining first-dir/dir1/dir2
+===================================================================
+File: file14 Status: Locally Added
+
+ Working revision: New file!
+ Repository revision: No revision control file
+ Sticky Tag: (none)
+ Sticky Date: (none)
+ Sticky Options: (none)
+
+===================================================================
+File: file6 Status: Locally Modified
+
+ Working revision: 1\.1.*
+ Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file6,v
+ Sticky Tag: (none)
+ Sticky Date: (none)
+ Sticky Options: (none)
+
+===================================================================
+File: no file file7 Status: Locally Removed
+
+ Working revision: -1\.1.*
+ Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file7,v
+ Sticky Tag: (none)
+ Sticky Date: (none)
+ Sticky Options: (none)"
# XXX why is this commented out?
# if ${CVS} diff -u first-dir >> ${LOGFILE} || test $? = 1 ; then
@@ -1956,113 +3136,213 @@ done"
# fail 42
# fi
- if ${CVS} ci -m "third dive" first-dir >>${LOGFILE} 2>&1; then
- pass 43
- else
- fail 43
- fi
- dotest 43.5 "${testcvs} -q update first-dir" ''
-
- if ${CVS} tag third-dive first-dir ; then
- pass 44
- else
- fail 44
- fi
+ dotest basic2-16 "${testcvs} ci -m 'third dive' first-dir" \
+"${PROG} [a-z]*: Examining first-dir
+${PROG} [a-z]*: Examining first-dir/dir1
+${PROG} [a-z]*: Examining first-dir/dir1/dir2
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file14,v
+done
+Checking in first-dir/file14;
+${CVSROOT_DIRNAME}/first-dir/file14,v <-- file14
+initial revision: 1\.1
+done
+Checking in first-dir/file6;
+${CVSROOT_DIRNAME}/first-dir/file6,v <-- file6
+new revision: 1\.2; previous revision: 1\.1
+done
+Removing first-dir/file7;
+${CVSROOT_DIRNAME}/first-dir/file7,v <-- file7
+new revision: delete; previous revision: 1\.1
+done
+RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/file14,v
+done
+Checking in first-dir/dir1/file14;
+${CVSROOT_DIRNAME}/first-dir/dir1/file14,v <-- file14
+initial revision: 1\.1
+done
+Checking in first-dir/dir1/file6;
+${CVSROOT_DIRNAME}/first-dir/dir1/file6,v <-- file6
+new revision: 1\.2; previous revision: 1\.1
+done
+Removing first-dir/dir1/file7;
+${CVSROOT_DIRNAME}/first-dir/dir1/file7,v <-- file7
+new revision: delete; previous revision: 1\.1
+done
+RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file14,v
+done
+Checking in first-dir/dir1/dir2/file14;
+${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file14,v <-- file14
+initial revision: 1\.1
+done
+Checking in first-dir/dir1/dir2/file6;
+${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file6,v <-- file6
+new revision: 1\.2; previous revision: 1\.1
+done
+Removing first-dir/dir1/dir2/file7;
+${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file7,v <-- file7
+new revision: delete; previous revision: 1\.1
+done"
+ dotest basic2-17 "${testcvs} -q update first-dir" ''
- if echo "yes" | ${CVS} release -d first-dir ; then
- pass 45
- else
- fail 45
- fi
+ dotest basic2-18 "${testcvs} tag third-dive first-dir" \
+"${PROG} [a-z]*: Tagging first-dir
+T first-dir/file14
+T first-dir/file6
+${PROG} [a-z]*: Tagging first-dir/dir1
+T first-dir/dir1/file14
+T first-dir/dir1/file6
+${PROG} [a-z]*: Tagging first-dir/dir1/dir2
+T first-dir/dir1/dir2/file14
+T first-dir/dir1/dir2/file6"
+
+ dotest basic2-19 "echo yes | ${testcvs} release -d first-dir" \
+"You have \[0\] altered files in this repository\.
+Are you sure you want to release (and delete) directory .first-dir.: "
# end of third dive
- if test -d first-dir ; then
- fail 45.5
- else
- pass 45.5
- fi
+ dotest_fail basic2-20 "test -d first-dir" ""
# now try some rtags
# rtag HEADS
- if ${CVS} rtag rtagged-by-head first-dir ; then
- pass 46
- else
- fail 46
- fi
+ dotest basic2-21 "${testcvs} rtag rtagged-by-head first-dir" \
+"${PROG} [a-z]*: Tagging first-dir
+${PROG} [a-z]*: Tagging first-dir/dir1
+${PROG} [a-z]*: Tagging first-dir/dir1/dir2"
# tag by tag
- if ${CVS} rtag -r rtagged-by-head rtagged-by-tag first-dir ; then
- pass 47
- else
- fail 47
- fi
+ dotest basic2-22 "${testcvs} rtag -r rtagged-by-head rtagged-by-tag first-dir" \
+"${PROG} [a-z]*: Tagging first-dir
+${PROG} [a-z]*: Tagging first-dir/dir1
+${PROG} [a-z]*: Tagging first-dir/dir1/dir2"
# tag by revision
- if ${CVS} rtag -r1.1 rtagged-by-revision first-dir ; then
- pass 48
- else
- fail 48
- fi
+ dotest basic2-23 "${testcvs} rtag -r1.1 rtagged-by-revision first-dir" \
+"${PROG} [a-z]*: Tagging first-dir
+${PROG} [a-z]*: Tagging first-dir/dir1
+${PROG} [a-z]*: Tagging first-dir/dir1/dir2"
# rdiff by revision
- if ${CVS} rdiff -r1.1 -rrtagged-by-head first-dir >> ${LOGFILE} || test $? = 1 ; then
- pass 49
- else
- fail 49
- fi
-
+ dotest basic2-24 "${testcvs} rdiff -r1.1 -rrtagged-by-head first-dir" \
+"${PROG} [a-z]*: Diffing first-dir
+Index: first-dir/file6
+diff -c first-dir/file6:1\.1 first-dir/file6:1\.2
+\*\*\* first-dir/file6:1\.1 .*
+--- first-dir/file6 .*
+\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
+\*\*\* 1 \*\*\*\*
+--- 1,2 ----
+ file6
+${PLUS} file6
+Index: first-dir/file7
+diff -c first-dir/file7:1\.1 first-dir/file7:removed
+\*\*\* first-dir/file7:1.1 .*
+--- first-dir/file7 .*
+\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
+\*\*\* 1 \*\*\*\*
+- file7
+--- 0 ----
+${PROG} [a-z]*: Diffing first-dir/dir1
+Index: first-dir/dir1/file6
+diff -c first-dir/dir1/file6:1\.1 first-dir/dir1/file6:1\.2
+\*\*\* first-dir/dir1/file6:1\.1 .*
+--- first-dir/dir1/file6 .*
+\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
+\*\*\* 1 \*\*\*\*
+--- 1,2 ----
+ file6
+${PLUS} file6
+Index: first-dir/dir1/file7
+diff -c first-dir/dir1/file7:1\.1 first-dir/dir1/file7:removed
+\*\*\* first-dir/dir1/file7:1\.1 .*
+--- first-dir/dir1/file7 .*
+\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
+\*\*\* 1 \*\*\*\*
+- file7
+--- 0 ----
+${PROG} [a-z]*: Diffing first-dir/dir1/dir2
+Index: first-dir/dir1/dir2/file6
+diff -c first-dir/dir1/dir2/file6:1\.1 first-dir/dir1/dir2/file6:1\.2
+\*\*\* first-dir/dir1/dir2/file6:1\.1 .*
+--- first-dir/dir1/dir2/file6 .*
+\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
+\*\*\* 1 \*\*\*\*
+--- 1,2 ----
+ file6
+${PLUS} file6
+Index: first-dir/dir1/dir2/file7
+diff -c first-dir/dir1/dir2/file7:1\.1 first-dir/dir1/dir2/file7:removed
+\*\*\* first-dir/dir1/dir2/file7:1\.1 .*
+--- first-dir/dir1/dir2/file7 .*
+\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
+\*\*\* 1 \*\*\*\*
+- file7
+--- 0 ----"
# now export by rtagged-by-head and rtagged-by-tag and compare.
- if ${CVS} export -r rtagged-by-head first-dir ; then
- pass 50
- else
- fail 50
- fi
+ dotest basic2-25 "${testcvs} export -r rtagged-by-head first-dir" \
+"${PROG} [a-z]*: Updating first-dir
+U first-dir/file14
+U first-dir/file6
+${PROG} [a-z]*: Updating first-dir/dir1
+U first-dir/dir1/file14
+U first-dir/dir1/file6
+${PROG} [a-z]*: Updating first-dir/dir1/dir2
+U first-dir/dir1/dir2/file14
+U first-dir/dir1/dir2/file6"
mv first-dir 1dir
- if ${CVS} export -r rtagged-by-tag first-dir ; then
- pass 51
- else
- fail 51
- fi
-
- directory_cmp 1dir first-dir
-
- if $ISDIFF ; then
- fail 52
- else
- pass 52
- fi
+ dotest basic2-26 "${testcvs} export -r rtagged-by-tag first-dir" \
+"${PROG} [a-z]*: Updating first-dir
+U first-dir/file14
+U first-dir/file6
+${PROG} [a-z]*: Updating first-dir/dir1
+U first-dir/dir1/file14
+U first-dir/dir1/file6
+${PROG} [a-z]*: Updating first-dir/dir1/dir2
+U first-dir/dir1/dir2/file14
+U first-dir/dir1/dir2/file6"
+
+ dotest basic2-27 "directory_cmp 1dir first-dir"
rm -r 1dir first-dir
# checkout by revision vs export by rtagged-by-revision and compare.
- if ${CVS} export -rrtagged-by-revision -d export-dir first-dir ; then
- pass 53
- else
- fail 53
- fi
-
- if ${CVS} co -r1.1 first-dir ; then
- pass 54
- else
- fail 54
- fi
+ dotest basic2-28 "${testcvs} export -rrtagged-by-revision -d export-dir first-dir" \
+"${PROG} [a-z]*: Updating export-dir
+U export-dir/file14
+U export-dir/file6
+U export-dir/file7
+${PROG} [a-z]*: Updating export-dir/dir1
+U export-dir/dir1/file14
+U export-dir/dir1/file6
+U export-dir/dir1/file7
+${PROG} [a-z]*: Updating export-dir/dir1/dir2
+U export-dir/dir1/dir2/file14
+U export-dir/dir1/dir2/file6
+U export-dir/dir1/dir2/file7"
+
+ dotest basic2-29 "${testcvs} co -r1.1 first-dir" \
+"${PROG} [a-z]*: Updating first-dir
+U first-dir/file14
+U first-dir/file6
+U first-dir/file7
+${PROG} [a-z]*: Updating first-dir/dir1
+U first-dir/dir1/file14
+U first-dir/dir1/file6
+U first-dir/dir1/file7
+${PROG} [a-z]*: Updating first-dir/dir1/dir2
+U first-dir/dir1/dir2/file14
+U first-dir/dir1/dir2/file6
+U first-dir/dir1/dir2/file7"
# directory copies are done in an oblique way in order to avoid a bug in sun's tmp filesystem.
mkdir first-dir.cpy ; (cd first-dir ; tar cf - . | (cd ../first-dir.cpy ; tar xf -))
- directory_cmp first-dir export-dir
-
- if $ISDIFF ; then
- fail 55
- else
- pass 55
- fi
+ dotest basic2-30 "directory_cmp first-dir export-dir"
# interrupt, while we've got a clean 1.1 here, let's import it
# into a couple of other modules.
cd export-dir
- dotest_sort 56 "${testcvs} import -m first-import second-dir first-immigration immigration1 immigration1_0" \
+ dotest_sort basic2-31 "${testcvs} import -m first-import second-dir first-immigration immigration1 immigration1_0" \
"
N second-dir/dir1/dir2/file14
@@ -2075,23 +3355,25 @@ N second-dir/file14
N second-dir/file6
N second-dir/file7
No conflicts created by this import
-${PROG} [a-z]*: Importing ${TESTDIR}/cvsroot/second-dir/dir1
-${PROG} [a-z]*: Importing ${TESTDIR}/cvsroot/second-dir/dir1/dir2"
+${PROG} [a-z]*: Importing ${CVSROOT_DIRNAME}/second-dir/dir1
+${PROG} [a-z]*: Importing ${CVSROOT_DIRNAME}/second-dir/dir1/dir2"
cd ..
- if ${CVS} export -r HEAD second-dir ; then
- pass 57
- else
- fail 57
- fi
-
- directory_cmp first-dir second-dir
-
- if $ISDIFF ; then
- fail 58
- else
- pass 58
- fi
+ dotest basic2-32 "${testcvs} export -r HEAD second-dir" \
+"${PROG} [a-z]*: Updating second-dir
+U second-dir/file14
+U second-dir/file6
+U second-dir/file7
+${PROG} [a-z]*: Updating second-dir/dir1
+U second-dir/dir1/file14
+U second-dir/dir1/file6
+U second-dir/dir1/file7
+${PROG} [a-z]*: Updating second-dir/dir1/dir2
+U second-dir/dir1/dir2/file14
+U second-dir/dir1/dir2/file6
+U second-dir/dir1/dir2/file7"
+
+ dotest basic2-33 "directory_cmp first-dir second-dir"
rm -r second-dir
@@ -2101,49 +3383,39 @@ ${PROG} [a-z]*: Importing ${TESTDIR}/cvsroot/second-dir/dir1/dir2"
# update the top, cancelling sticky tags, retag, update other copy, compare.
cd first-dir
- if ${CVS} update -A -l *file* 2>> ${LOGFILE}; then
- pass 59
- else
- fail 59
- fi
+ dotest basic2-34 "${testcvs} update -A -l *file*" \
+"[UP] file6
+${PROG} [a-z]*: file7 is no longer in the repository"
# If we don't delete the tag first, cvs won't retag it.
# This would appear to be a feature.
- if ${CVS} tag -l -d rtagged-by-revision ; then
- pass 60a
- else
- fail 60a
- fi
- if ${CVS} tag -l rtagged-by-revision ; then
- pass 60b
- else
- fail 60b
- fi
+ dotest basic2-35 "${testcvs} tag -l -d rtagged-by-revision" \
+"${PROG} [a-z]*: Untagging \.
+D file14
+D file6"
+ dotest basic2-36 "${testcvs} tag -l rtagged-by-revision" \
+"${PROG} [a-z]*: Tagging \.
+T file14
+T file6"
cd ..
mv first-dir 1dir
mv first-dir.cpy first-dir
cd first-dir
- dotest 61 "${testcvs} -q diff -u" ''
+ dotest basic2-37 "${testcvs} -q diff -u" ''
- if ${CVS} update ; then
- pass 62
- else
- fail 62
- fi
+ dotest basic2-38 "${testcvs} update" \
+"${PROG} [a-z]*: Updating .
+${PROG} [a-z]*: Updating dir1
+${PROG} [a-z]*: Updating dir1/dir2"
cd ..
#### FIXME: is this expected to work??? Need to investigate
#### and fix or remove the test.
-# directory_cmp 1dir first-dir
-#
-# if $ISDIFF ; then
-# fail 63
-# else
-# pass 63
-# fi
+# dotest basic2-39 "directory_cmp 1dir first-dir"
+
rm -r 1dir first-dir
# Test the cvs history command.
@@ -2158,29 +3430,29 @@ ${PROG} [a-z]*: Importing ${TESTDIR}/cvsroot/second-dir/dir1/dir2"
# which don't exist in the remote output? would seem to be
# a CVS bug.
dotest basic2-64 "${testcvs} his -x TOFWUCGMAR -a" \
-"O [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir =first-dir= ${TMPPWD}/\*
-A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6 first-dir == ${TMPPWD}
-A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7 first-dir == ${TMPPWD}
-A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6 first-dir/dir1 == ${TMPPWD}
-A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7 first-dir/dir1 == ${TMPPWD}
-A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6 first-dir/dir1/dir2 == ${TMPPWD}
-A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7 first-dir/dir1/dir2 == ${TMPPWD}
-A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14 first-dir == ${TMPPWD}
-M [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir == ${TMPPWD}
-R [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file7 first-dir == ${TMPPWD}
-A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14 first-dir/dir1 == ${TMPPWD}
-M [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir/dir1 == ${TMPPWD}
-R [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file7 first-dir/dir1 == ${TMPPWD}
-A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14 first-dir/dir1/dir2 == ${TMPPWD}
-M [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir/dir1/dir2 == ${TMPPWD}
-R [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file7 first-dir/dir1/dir2 == ${TMPPWD}
-F [0-9-]* [0-9:]* ${PLUS}0000 ${username} =first-dir= ${TMPPWD}/\*
+"O [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir =first-dir= ${TESTDIR}/\*
+A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6 first-dir == ${TESTDIR}
+A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7 first-dir == ${TESTDIR}
+A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6 first-dir/dir1 == ${TESTDIR}
+A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7 first-dir/dir1 == ${TESTDIR}
+A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6 first-dir/dir1/dir2 == ${TESTDIR}
+A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7 first-dir/dir1/dir2 == ${TESTDIR}
+A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14 first-dir == ${TESTDIR}
+M [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir == ${TESTDIR}
+R [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file7 first-dir == ${TESTDIR}
+A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14 first-dir/dir1 == ${TESTDIR}
+M [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir/dir1 == ${TESTDIR}
+R [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file7 first-dir/dir1 == ${TESTDIR}
+A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14 first-dir/dir1/dir2 == ${TESTDIR}
+M [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir/dir1/dir2 == ${TESTDIR}
+R [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file7 first-dir/dir1/dir2 == ${TESTDIR}
+F [0-9-]* [0-9:]* ${PLUS}0000 ${username} =first-dir= ${TESTDIR}/\*
T [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-head:A\]
T [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-tag:rtagged-by-head\]
T [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-revision:1\.1\]
-O [0-9-]* [0-9:]* ${PLUS}0000 ${username} \[1\.1\] first-dir =first-dir= ${TMPPWD}/\*
-U [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir == ${TMPPWD}/first-dir
-U [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file7 first-dir == ${TMPPWD}/first-dir" \
+O [0-9-]* [0-9:]* ${PLUS}0000 ${username} \[1\.1\] first-dir =first-dir= ${TESTDIR}/\*
+U [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir == ${TESTDIR}/first-dir
+W [0-9-]* [0-9:]* ${PLUS}0000 ${username} file7 first-dir == ${TESTDIR}/first-dir" \
"O [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir =first-dir= <remote>/\*
A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6 first-dir == <remote>
A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7 first-dir == <remote>
@@ -2201,7 +3473,8 @@ F [0-9-]* [0-9:]* ${PLUS}0000 ${username} =first-dir= <remot
T [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-head:A\]
T [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-tag:rtagged-by-head\]
T [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-revision:1\.1\]
-O [0-9-]* [0-9:]* ${PLUS}0000 ${username} \[1\.1\] first-dir =first-dir= <remote>/\*"
+O [0-9-]* [0-9:]* ${PLUS}0000 ${username} \[1\.1\] first-dir =first-dir= <remote>/\*
+W [0-9-]* [0-9:]* ${PLUS}0000 ${username} file7 first-dir == <remote>" \
rm -rf ${CVSROOT_DIRNAME}/first-dir
rm -rf ${CVSROOT_DIRNAME}/second-dir
@@ -2219,24 +3492,24 @@ O [0-9-]* [0-9:]* ${PLUS}0000 ${username} \[1\.1\] first-dir =first-di
dotest files-1 "${testcvs} -q co -l ." ""
mkdir first-dir
dotest files-2 "${testcvs} add first-dir" \
-"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
cd first-dir
touch tfile
dotest files-3 "${testcvs} add tfile" \
"${PROG} [a-z]*: scheduling file .tfile. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest files-4 "${testcvs} -q ci -m add" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/tfile,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/tfile,v
done
Checking in tfile;
-${TESTDIR}/cvsroot/first-dir/tfile,v <-- tfile
+${CVSROOT_DIRNAME}/first-dir/tfile,v <-- tfile
initial revision: 1\.1
done"
dotest files-5 "${testcvs} -q tag -b C" "T tfile"
dotest files-6 "${testcvs} -q update -r C" ""
mkdir dir
dotest files-7 "${testcvs} add dir" \
-"Directory ${TESTDIR}/cvsroot/first-dir/dir added to the repository
+"Directory ${CVSROOT_DIRNAME}/first-dir/dir added to the repository
--> Using per-directory sticky tag .C'"
cd dir
touch .file
@@ -2245,12 +3518,12 @@ done"
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
mkdir sdir
dotest files-7 "${testcvs} add sdir" \
-"Directory ${TESTDIR}/cvsroot/first-dir/dir/sdir added to the repository
+"Directory ${CVSROOT_DIRNAME}/first-dir/dir/sdir added to the repository
--> Using per-directory sticky tag .C'"
cd sdir
mkdir ssdir
dotest files-8 "${testcvs} add ssdir" \
-"Directory ${TESTDIR}/cvsroot/first-dir/dir/sdir/ssdir added to the repository
+"Directory ${CVSROOT_DIRNAME}/first-dir/dir/sdir/ssdir added to the repository
--> Using per-directory sticky tag .C'"
cd ssdir
touch .file
@@ -2259,29 +3532,29 @@ ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
cd ../..
dotest files-10 "${testcvs} -q ci -m test" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/dir/Attic/\.file,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/dir/Attic/\.file,v
done
Checking in \.file;
-${TESTDIR}/cvsroot/first-dir/dir/Attic/\.file,v <-- \.file
+${CVSROOT_DIRNAME}/first-dir/dir/Attic/\.file,v <-- \.file
new revision: 1\.1\.2\.1; previous revision: 1\.1
done
-RCS file: ${TESTDIR}/cvsroot/first-dir/dir/sdir/ssdir/Attic/\.file,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/dir/sdir/ssdir/Attic/\.file,v
done
Checking in sdir/ssdir/\.file;
-${TESTDIR}/cvsroot/first-dir/dir/sdir/ssdir/Attic/\.file,v <-- \.file
+${CVSROOT_DIRNAME}/first-dir/dir/sdir/ssdir/Attic/\.file,v <-- \.file
new revision: 1\.1\.2\.1; previous revision: 1\.1
done"
dotest files-11 \
"${testcvs} commit -m test -f ./.file ./sdir/ssdir/.file" \
"Checking in \.file;
-${TESTDIR}/cvsroot/first-dir/dir/Attic/\.file,v <-- \.file
+${CVSROOT_DIRNAME}/first-dir/dir/Attic/\.file,v <-- \.file
new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
done
Checking in \./sdir/ssdir/\.file;
-${TESTDIR}/cvsroot/first-dir/dir/sdir/ssdir/Attic/\.file,v <-- \.file
+${CVSROOT_DIRNAME}/first-dir/dir/sdir/ssdir/Attic/\.file,v <-- \.file
new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
done"
- if test "$remote" = yes; then
+ if $remote; then
# This is a bug, looks like that toplevel_repos cruft in
# client.c is coming back to haunt us.
# May want to think about the whole issue, toplevel_repos
@@ -2298,32 +3571,32 @@ ${PROG} \[server aborted\]: correct above errors first!"
dotest files-12-workaround \
"${testcvs} commit -f -m test sdir/ssdir/.file .file" \
"Checking in sdir/ssdir/\.file;
-${TESTDIR}/cvsroot/first-dir/dir/sdir/ssdir/Attic/\.file,v <-- \.file
+${CVSROOT_DIRNAME}/first-dir/dir/sdir/ssdir/Attic/\.file,v <-- \.file
new revision: 1\.1\.2\.3; previous revision: 1\.1\.2\.2
done
Checking in \.file;
-${TESTDIR}/cvsroot/first-dir/dir/Attic/\.file,v <-- \.file
+${CVSROOT_DIRNAME}/first-dir/dir/Attic/\.file,v <-- \.file
new revision: 1\.1\.2\.3; previous revision: 1\.1\.2\.2
done"
else
dotest files-12 \
"${testcvs} commit -f -m test ./sdir/ssdir/.file ./.file" \
"Checking in \./sdir/ssdir/\.file;
-${TESTDIR}/cvsroot/first-dir/dir/sdir/ssdir/Attic/\.file,v <-- \.file
+${CVSROOT_DIRNAME}/first-dir/dir/sdir/ssdir/Attic/\.file,v <-- \.file
new revision: 1\.1\.2\.3; previous revision: 1\.1\.2\.2
done
Checking in \.file;
-${TESTDIR}/cvsroot/first-dir/dir/Attic/\.file,v <-- \.file
+${CVSROOT_DIRNAME}/first-dir/dir/Attic/\.file,v <-- \.file
new revision: 1\.1\.2\.3; previous revision: 1\.1\.2\.2
done"
fi
dotest files-13 \
"${testcvs} commit -fmtest ./sdir/../sdir/ssdir/..///ssdir/.file" \
"Checking in \./sdir/\.\./sdir/ssdir/\.\.///ssdir/\.file;
-${TESTDIR}/cvsroot/first-dir/dir/sdir/ssdir/Attic/\.file,v <-- \.file
+${CVSROOT_DIRNAME}/first-dir/dir/sdir/ssdir/Attic/\.file,v <-- \.file
new revision: 1\.1\.2\.4; previous revision: 1\.1\.2\.3
done"
- if test "$remote" = yes; then
+ if $remote; then
dotest_fail files-14 \
"${testcvs} commit -fmtest ../../first-dir/dir/.file" \
"protocol error: .\.\./\.\./first-dir/dir' has too many \.\."
@@ -2331,7 +3604,7 @@ done"
dotest files-14 \
"${testcvs} commit -fmtest ../../first-dir/dir/.file" \
"Checking in \.\./\.\./first-dir/dir/\.file;
-${TESTDIR}/cvsroot/first-dir/dir/Attic/\.file,v <-- \.file
+${CVSROOT_DIRNAME}/first-dir/dir/Attic/\.file,v <-- \.file
new revision: 1\.1\.2\.4; previous revision: 1\.1\.2\.3
done"
fi
@@ -2350,7 +3623,7 @@ done"
# I wrote this test to worry about problems in do_module;
# but then I found that the CVS server has its own problems
# with filenames starting with "-". Work around it for now.
- if test "$remote" = yes; then
+ if $remote; then
dashb=dashb
dashc=dashc
else
@@ -2366,34 +3639,34 @@ done"
${PROG} [a-z]*: scheduling file .top. for addition
${PROG} [a-z]*: use .${PROG} commit. to add these files permanently"
dotest spacefiles-3 "${testcvs} -q ci -m add" \
-"RCS file: ${TESTDIR}/cvsroot/${dashc},v
+"RCS file: ${CVSROOT_DIRNAME}/${dashc},v
done
Checking in ${dashc};
-${TESTDIR}/cvsroot/${dashc},v <-- ${dashc}
+${CVSROOT_DIRNAME}/${dashc},v <-- ${dashc}
initial revision: 1\.1
done
-RCS file: ${TESTDIR}/cvsroot/top,v
+RCS file: ${CVSROOT_DIRNAME}/top,v
done
Checking in top;
-${TESTDIR}/cvsroot/top,v <-- top
+${CVSROOT_DIRNAME}/top,v <-- top
initial revision: 1\.1
done"
mkdir 'first dir'
dotest spacefiles-4 "${testcvs} add 'first dir'" \
-"Directory ${TESTDIR}/cvsroot/first dir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first dir added to the repository"
mkdir ./${dashb}
dotest spacefiles-5 "${testcvs} add -- ${dashb}" \
-"Directory ${TESTDIR}/cvsroot/${dashb} added to the repository"
+"Directory ${CVSROOT_DIRNAME}/${dashb} added to the repository"
cd 'first dir'
touch 'a file'
dotest spacefiles-6 "${testcvs} add 'a file'" \
"${PROG} [a-z]*: scheduling file .a file. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest spacefiles-7 "${testcvs} -q ci -m add" \
-"RCS file: ${TESTDIR}/cvsroot/first dir/a file,v
+"RCS file: ${CVSROOT_DIRNAME}/first dir/a file,v
done
Checking in a file;
-${TESTDIR}/cvsroot/first dir/a file,v <-- a file
+${CVSROOT_DIRNAME}/first dir/a file,v <-- a file
initial revision: 1\.1
done"
dotest spacefiles-8 "${testcvs} -q tag new-tag" "T a file"
@@ -2443,10 +3716,10 @@ done"
"${PROG} [a-z]*: scheduling file .$file. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest commit-readonly-4 "$testcvs -Q ci -m . $file" \
-"RCS file: ${TESTDIR}/cvsroot/$module/$file,v
+"RCS file: ${CVSROOT_DIRNAME}/$module/$file,v
done
Checking in $file;
-${TESTDIR}/cvsroot/$module/$file,v <-- $file
+${CVSROOT_DIRNAME}/$module/$file,v <-- $file
initial revision: 1\.1
done"
@@ -2456,7 +3729,7 @@ done"
dotest commit-readonly-5 "$testcvs -Q ci -m . $file" \
"Checking in $file;
-${TESTDIR}/cvsroot/$module/$file,v <-- $file
+${CVSROOT_DIRNAME}/$module/$file,v <-- $file
new revision: 1\.2; previous revision: 1\.1
done"
@@ -2494,7 +3767,7 @@ U trdiff/foo"
dotest rdiff-3 \
"${testcvs} ci -m added-something foo" \
"Checking in foo;
-${TESTDIR}/cvsroot/trdiff/foo,v <-- foo
+${CVSROOT_DIRNAME}/trdiff/foo,v <-- foo
new revision: 1\.2; previous revision: 1\.1
done"
echo '#ident "@(#)trdiff:$''Name$:$''Id$"' > new
@@ -2505,10 +3778,10 @@ done"
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest rdiff-5 \
"${testcvs} commit -m added-new-file new" \
-"RCS file: ${TESTDIR}/cvsroot/trdiff/new,v
+"RCS file: ${CVSROOT_DIRNAME}/trdiff/new,v
done
Checking in new;
-${TESTDIR}/cvsroot/trdiff/new,v <-- new
+${CVSROOT_DIRNAME}/trdiff/new,v <-- new
initial revision: 1\.1
done"
dotest rdiff-6 \
@@ -2523,7 +3796,7 @@ T new"
File: foo Status: Up-to-date
Working revision: 1\.2.*
- Repository revision: 1\.2 ${TESTDIR}/cvsroot/trdiff/foo,v
+ Repository revision: 1\.2 ${CVSROOT_DIRNAME}/trdiff/foo,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: -ko
@@ -2561,11 +3834,10 @@ diff -c /dev/null trdiff/new:1\.1
'"${PLUS}"' #ident "@(#)trdiff:\$''Name: local-v0 \$:\$''Id: new,v 1\.1 [0-9/]* [0-9:]* '"${username}"' Exp \$"
'"${PLUS}"' new file'
-# FIXME: will this work here?
-# if test "$keep" = yes; then
-# echo Keeping ${TESTDIR} and exiting due to --keep
-# exit 0
-# fi
+ if $keep; then
+ echo Keeping ${TESTDIR} and exiting due to --keep
+ exit 0
+ fi
cd ..
rm -r testimport
@@ -2583,7 +3855,7 @@ diff -c /dev/null trdiff/new:1\.1
dotest diff-1 "${testcvs} -q co -l ." ''
mkdir first-dir
dotest diff-2 "${testcvs} add first-dir" \
-"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
cd first-dir
# diff is anomalous. Most CVS commands print the "nothing
@@ -2596,16 +3868,16 @@ diff -c /dev/null trdiff/new:1\.1
"${PROG} [a-z]*: scheduling file .abc. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest diff-5 "${testcvs} -q ci -mtest" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/abc,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
done
Checking in abc;
-${TESTDIR}/cvsroot/first-dir/abc,v <-- abc
+${CVSROOT_DIRNAME}/first-dir/abc,v <-- abc
initial revision: 1\.1
done"
echo "extern int gethostname ();" >abc
dotest diff-6 "${testcvs} -q ci -mtest" \
"Checking in abc;
-${TESTDIR}/cvsroot/first-dir/abc,v <-- abc
+${CVSROOT_DIRNAME}/first-dir/abc,v <-- abc
new revision: 1\.2; previous revision: 1\.1
done"
echo "#include <winsock.h>" >abc
@@ -2613,7 +3885,7 @@ done"
dotest_fail diff-7 "${testcvs} -q diff --ifdef=HAVE_WINSOCK_H" \
"Index: abc
===================================================================
-RCS file: ${TESTDIR}/cvsroot/first-dir/abc,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
retrieving revision 1\.2
diff --ifdef=HAVE_WINSOCK_H -r1\.2 abc
#ifndef HAVE_WINSOCK_H
@@ -2622,7 +3894,7 @@ extern int gethostname ();
#include <winsock\.h>
#endif /\* HAVE_WINSOCK_H \*/"
- if test "$keep" = yes; then
+ if $keep; then
echo Keeping ${TESTDIR} and exiting due to --keep
exit 0
fi
@@ -2653,17 +3925,17 @@ extern int gethostname ();
# doesn't get confused by it.
mkdir subdir
dotest 65a0 "${testcvs} add subdir" \
-"Directory ${TESTDIR}/cvsroot/first-dir/subdir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir/subdir added to the repository"
cd subdir
echo file in subdir >sfile
dotest 65a1 "${testcvs} add sfile" \
"${PROG}"' [a-z]*: scheduling file `sfile'\'' for addition
'"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to add this file permanently'
dotest 65a2 "${testcvs} -q ci -m add-it" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/subdir/sfile,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/subdir/sfile,v
done
Checking in sfile;
-${TESTDIR}/cvsroot/first-dir/subdir/sfile,v <-- sfile
+${CVSROOT_DIRNAME}/first-dir/subdir/sfile,v <-- sfile
initial revision: 1\.1
done"
rm sfile
@@ -2672,7 +3944,7 @@ done"
'"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to remove this file permanently'
dotest 65a4 "${testcvs} -q ci -m remove-it" \
"Removing sfile;
-${TESTDIR}/cvsroot/first-dir/subdir/sfile,v <-- sfile
+${CVSROOT_DIRNAME}/first-dir/subdir/sfile,v <-- sfile
new revision: delete; previous revision: 1\.1
done"
cd ..
@@ -2746,10 +4018,10 @@ done"
"${PROG}"' [a-z]*: scheduling file `file4'\'' for addition
'"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to add this file permanently'
dotest death-file4-ciadd "${testcvs} -q ci -m add file4" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file4,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
done
Checking in file4;
-${TESTDIR}/cvsroot/first-dir/file4,v <-- file4
+${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
initial revision: 1\.1
done"
rm file4
@@ -2758,7 +4030,7 @@ done"
'"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to remove this file permanently'
dotest death-file4-cirm "${testcvs} -q ci -m remove file4" \
"Removing file4;
-${TESTDIR}/cvsroot/first-dir/file4,v <-- file4
+${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
new revision: delete; previous revision: 1\.1
done"
@@ -2890,7 +4162,7 @@ diff -c first-dir/file3:1\.1\.2\.1 first-dir/file3:removed
# join
dotest 86 "${testcvs} -q update -j branch1" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
retrieving revision 1\.3
retrieving revision 1\.3\.2\.1
Merging differences between 1\.3 and 1\.3\.2\.1 into file1
@@ -2922,15 +4194,15 @@ U file3"
# commit
dotest 89 "${testcvs} -q ci -m test" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.4; previous revision: 1\.3
done
Removing file2;
-${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
+${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
new revision: delete; previous revision: 1\.1
done
Checking in file3;
-${TESTDIR}/cvsroot/first-dir/file3,v <-- file3
+${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
new revision: 1\.2; previous revision: 1\.1
done"
cd ..
@@ -3026,16 +4298,16 @@ U first-dir/file3'
'"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to add these files permanently'
dotest death2-3 "${testcvs} -q commit -m add" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done
Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
initial revision: 1\.1
done
-RCS file: ${TESTDIR}/cvsroot/first-dir/file4,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
done
Checking in file4;
-${TESTDIR}/cvsroot/first-dir/file4,v <-- file4
+${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
initial revision: 1\.1
done"
@@ -3068,8 +4340,8 @@ ${PROG} [a-z]*: use .${PROG} commit. to remove this file permanently"
===================================================================
RCS file: file1
diff -N file1
-\*\*\* ${tempname}[ ][ ]*[a-zA-Z0-9: ]*
---- /dev/null[ ][ ]*[a-zA-Z0-9: ]*
+\*\*\* file1 ${RFCDATE} [0-9.]*
+--- /dev/null ${RFCDATE_EPOCH}
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
\*\*\* 1 \*\*\*\*
- first revision
@@ -3077,7 +4349,7 @@ diff -N file1
dotest death2-8 "${testcvs} -q ci -m removed" \
"Removing file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: delete; previous revision: 1\.1\.2
done"
@@ -3092,8 +4364,8 @@ done"
===================================================================
RCS file: file1
diff -N file1
-\*\*\* ${tempname}[ ][ ]*[a-zA-Z0-9: ]*
---- /dev/null[ ][ ]*[a-zA-Z0-9: ]*
+\*\*\* file1 ${RFCDATE} [0-9.]*
+--- /dev/null ${RFCDATE_EPOCH}
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
\*\*\* 1 \*\*\*\*
- first revision
@@ -3107,8 +4379,8 @@ diff -N file1
===================================================================
RCS file: file1
diff -N file1
-\*\*\* ${tempname}[ ][ ]*[a-zA-Z0-9: ]*
---- /dev/null[ ][ ]*[a-zA-Z0-9: ]*
+\*\*\* file1 [-a-zA-Z0-9: ]* [0-9.]*
+--- /dev/null ${RFCDATE_EPOCH}
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
\*\*\* 1 \*\*\*\*
- first revision
@@ -3121,8 +4393,8 @@ diff -N file1
dotest death2-rdiff-2 "${testcvs} -q rdiff -rtag -rbranch first-dir" \
"Index: first-dir/file1
diff -c first-dir/file1:1\.1 first-dir/file1:removed
-\*\*\* first-dir/file1:1\.1[ ][ ]*[a-zA-Z0-9: ]*
---- first-dir/file1[ ][ ]*[a-zA-Z0-9: ]*
+\*\*\* first-dir/file1:1\.1 [a-zA-Z0-9: ]*
+--- first-dir/file1 [a-zA-Z0-9: ]*
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
\*\*\* 1 \*\*\*\*
- first revision
@@ -3143,8 +4415,8 @@ diff -c first-dir/file1:1\.1 first-dir/file1:removed
===================================================================
RCS file: file1
diff -N file1
-\*\*\* /dev/null[ ][ ]*[a-zA-Z0-9: ]*
---- ${tempname}[ ][ ]*[a-zA-Z0-9: ]*
+\*\*\* /dev/null ${RFCDATE_EPOCH}
+--- file1 ${RFCDATE}
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
\*\*\* 0 \*\*\*\*
--- 1 ----
@@ -3152,7 +4424,7 @@ ${PLUS} second revision"
dotest death2-10 "${testcvs} -q commit -m add" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
done"
@@ -3162,7 +4434,7 @@ done"
${PROG} [a-z]*: use .${PROG} commit. to remove this file permanently"
dotest death2-10b "${testcvs} -q ci -m removed" \
"Removing file4;
-${TESTDIR}/cvsroot/first-dir/file4,v <-- file4
+${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
new revision: delete; previous revision: 1\.1\.2
done"
@@ -3177,10 +4449,10 @@ U file4"
"${PROG}"' [a-z]*: scheduling file `file2'\'' for addition
'"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to add this file permanently'
dotest death2-13 "${testcvs} -q commit -m add" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
done
Checking in file2;
-${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
+${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
initial revision: 1\.1
done"
@@ -3188,7 +4460,7 @@ done"
echo "new file4 revision" > file4
dotest death2-13a "${testcvs} -q commit -m mod" \
"Checking in file4;
-${TESTDIR}/cvsroot/first-dir/file4,v <-- file4
+${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
new revision: 1\.2; previous revision: 1\.1
done"
@@ -3199,7 +4471,7 @@ done"
dotest death2-14 "${testcvs} -q update -r branch" \
"[UP] file1
${PROG} [a-z]*: file2 is no longer in the repository
-${PROG} [a-z]*: warning: file4 is not (any longer) pertinent"
+${PROG} [a-z]*: file4 is no longer in the repository"
# Add a file on the branch with the same name.
echo "branch revision" > file2
@@ -3208,7 +4480,7 @@ ${PROG} [a-z]*: warning: file4 is not (any longer) pertinent"
'"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to add this file permanently'
dotest death2-16 "${testcvs} -q commit -m add" \
"Checking in file2;
-${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
+${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
new revision: 1\.1\.2\.1; previous revision: 1\.1
done"
@@ -3218,10 +4490,10 @@ done"
"${PROG}"' [a-z]*: scheduling file `file3'\'' for addition on branch `branch'\''
'"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to add this file permanently'
dotest death2-18 "${testcvs} -q commit -m add" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/Attic/file3,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v
done
Checking in file3;
-${TESTDIR}/cvsroot/first-dir/Attic/file3,v <-- file3
+${CVSROOT_DIRNAME}/first-dir/Attic/file3,v <-- file3
new revision: 1\.1\.2\.1; previous revision: 1\.1
done"
@@ -3234,8 +4506,8 @@ done"
===================================================================
RCS file: file3
diff -N file3
-\*\*\* /dev/null[ ][ ]*[a-zA-Z0-9: ]*
---- ${tempname}[ ][ ]*[a-zA-Z0-9: ]*
+\*\*\* /dev/null ${RFCDATE_EPOCH}
+--- file3 ${RFCDATE} [0-9.]*
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
\*\*\* 0 \*\*\*\*
--- 1 ----
@@ -3244,12 +4516,12 @@ ${PLUS} first revision"
dotest_fail death2-diff-11 "${testcvs} -q diff -rtag -c ." \
"Index: file1
===================================================================
-RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
retrieving revision 1\.1
retrieving revision 1\.1\.2\.2
diff -c -r1\.1 -r1\.1\.2\.2
-\*\*\* file1[ ][ ]*[a-zA-Z0-9:./ ]*
---- file1[ ][ ]*[a-zA-Z0-9:./ ]*
+\*\*\* file1 ${RFCDATE} [0-9.]*
+--- file1 ${RFCDATE} [0-9.]*
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
\*\*\* 1 \*\*\*\*
! first revision
@@ -3262,12 +4534,12 @@ ${PROG} [a-z]*: file4 no longer exists, no comparison available"
dotest_fail death2-diff-12 "${testcvs} -q diff -rtag -c -N ." \
"Index: file1
===================================================================
-RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
retrieving revision 1\.1
retrieving revision 1\.1\.2\.2
diff -c -r1\.1 -r1\.1\.2\.2
-\*\*\* file1[ ][ ]*[a-zA-Z0-9:./ ]*
---- file1[ ][ ]*[a-zA-Z0-9:./ ]*
+\*\*\* file1 ${RFCDATE} [0-9.]*
+--- file1 ${RFCDATE} [0-9.]*
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
\*\*\* 1 \*\*\*\*
! first revision
@@ -3277,8 +4549,8 @@ Index: file2
===================================================================
RCS file: file2
diff -N file2
-\*\*\* /dev/null[ ][ ]*[a-zA-Z0-9: ]*
---- ${tempname}[ ][ ]*[a-zA-Z0-9: ]*
+\*\*\* /dev/null ${RFCDATE_EPOCH}
+--- file2 ${RFCDATE} [0-9.]*
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
\*\*\* 0 \*\*\*\*
--- 1 ----
@@ -3287,8 +4559,8 @@ Index: file3
===================================================================
RCS file: file3
diff -N file3
-\*\*\* /dev/null[ ][ ]*[a-zA-Z0-9: ]*
---- ${tempname}[ ][ ]*[a-zA-Z0-9: ]*
+\*\*\* /dev/null ${RFCDATE_EPOCH}
+--- file3 ${RFCDATE} [0-9.]*
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
\*\*\* 0 \*\*\*\*
--- 1 ----
@@ -3297,8 +4569,8 @@ Index: file4
===================================================================
RCS file: file4
diff -N file4
-\*\*\* ${tempname}[ ][ ]*[a-zA-Z0-9: ]*
---- /dev/null[ ][ ]*[a-zA-Z0-9: ]*
+\*\*\* file4 ${RFCDATE} [0-9.]*
+--- /dev/null ${RFCDATE_EPOCH}
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
\*\*\* 1 \*\*\*\*
- file4 first revision
@@ -3322,16 +4594,78 @@ U file4"
===================================================================
RCS file: file1
diff -N file1
-\*\*\* /dev/null[ ][ ]*[a-zA-Z0-9: ]*
---- ${tempname}[ ][ ]*[a-zA-Z0-9: ]*
+\*\*\* /dev/null ${RFCDATE_EPOCH}
+--- file1 ${RFCDATE} [0-9.]*
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
\*\*\* 0 \*\*\*\*
--- 1 ----
${PLUS} first revision"
+ # now back to the trunk
+ dotest death2-21 "${testcvs} -q update -A" \
+"U file2
+[UP] file4"
+
+ # test merging with a dead file
+ dotest death2-22 "${testcvs} -q co first-dir" \
+"U first-dir/file1
+U first-dir/file2
+U first-dir/file4"
+
+ cd first-dir
+ dotest death2-23 "${testcvs} rm -f file4" \
+"${PROG} [a-z]*: scheduling .file4. for removal
+${PROG} [a-z]*: use .${PROG} commit. to remove this file permanently"
+ dotest death2-24 "${testcvs} -q ci -m removed file4" \
+"Removing file4;
+${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
+new revision: delete; previous revision: 1\.2
+done"
+ cd ..
+ echo "new stuff" >file4
+ dotest_fail death2-25 "${testcvs} up file4" \
+"${PROG} [a-z]*: conflict: file4 is modified but no longer in the repository
+C file4"
+
cd .. ; rm -rf first-dir ${CVSROOT_DIRNAME}/first-dir
;;
+ rm-update-message)
+ # FIXME
+ # local CVS prints a warning message when update notices a missing
+ # file and client/server CVS doesn't. These should be identical.
+ mkdir rm-update-message; cd rm-update-message
+ mkdir $CVSROOT_DIRNAME/rm-update-message
+ dotest rm-update-message-setup-1 "$testcvs -q co rm-update-message" ''
+ cd rm-update-message
+ file=x
+ echo >$file
+ dotest rm-update-message-setup-2 "$testcvs -q add $file" \
+"$PROG [a-z]*: use .cvs commit. to add this file permanently"
+ dotest rm-update-message-setup-3 "$testcvs -q ci -mcreate $file" \
+"RCS file: $CVSROOT_DIRNAME/rm-update-message/$file,v
+done
+Checking in $file;
+$CVSROOT_DIRNAME/rm-update-message/$file,v <-- $file
+initial revision: 1\.1
+done"
+
+ rm $file
+ if $remote; then
+ dotest rm-update-message-1 "$testcvs up $file" "U $file"
+ else
+ dotest rm-update-message-1 "$testcvs up $file" \
+"$PROG [a-z]*: warning: $file was lost
+U $file"
+ fi
+
+ cd ../..
+ if $keep; then :; else
+ rm -rf rm-update-message
+ rm -rf $CVSROOT_DIRNAME/rm-update-message
+ fi
+ ;;
+
rmadd)
# More tests of adding and removing files.
# In particular ci -r.
@@ -3345,7 +4679,7 @@ ${PLUS} first revision"
dotest rmadd-1 "${testcvs} -q co -l ." ''
mkdir first-dir
dotest rmadd-2 "${testcvs} add first-dir" \
-"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
cd first-dir
echo first file1 >file1
dotest rmadd-3 "${testcvs} add file1" \
@@ -3365,13 +4699,13 @@ ${PROG} \[[a-z]* aborted\]: correct above errors first!"
# bizarre behavior, but it would seem to be intentional
# (see commit.c). It probably could go away....
dotest rmadd-7 "${testcvs} -q ci -r 7.... -m add" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done
Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
initial revision: 7\.1
done"
- if test "$remote" = yes; then
+ if $remote; then
# I guess remote doesn't set a sticky tag in this case.
# Kind of odd, in the sense that rmadd-24a does set one
# both local and remote.
@@ -3395,10 +4729,10 @@ done"
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
# As in the previous example, CVS is confused....
dotest rmadd-11 "${testcvs} -q ci -m add" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
done
Checking in file2;
-${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
+${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
initial revision: 7\.1
done"
@@ -3413,10 +4747,10 @@ ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
${PROG} \[[a-z]* aborted\]: correct above errors first!"
# Whatever, let's not let file2 distract us....
dotest rmadd-15 "${testcvs} -q ci -r mybranch -m add file3" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/Attic/file3,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v
done
Checking in file3;
-${TESTDIR}/cvsroot/first-dir/Attic/file3,v <-- file3
+${CVSROOT_DIRNAME}/first-dir/Attic/file3,v <-- file3
new revision: 1\.1\.2\.1; previous revision: 1\.1
done"
@@ -3445,10 +4779,10 @@ ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
# a non-branch tag.
dotest rmadd-21 \
"${testcvs} -q ci -r mynonbranch -m add file4" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/Attic/file4,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file4,v
done
Checking in file4;
-${TESTDIR}/cvsroot/first-dir/Attic/file4,v <-- file4
+${CVSROOT_DIRNAME}/first-dir/Attic/file4,v <-- file4
new revision: 1\.1\.2\.1; previous revision: 1\.1
done"
@@ -3458,42 +4792,42 @@ done"
dotest rmadd-22 "${testcvs} add file5" \
"${PROG} [a-z]*: scheduling file .file5. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
- if test "$remote" = yes; then
+ if $remote; then
# Interesting bug (or missing feature) here. findmaxrev
# gets the major revision from the Entries. Well, remote
# doesn't send the entries for files which are not involved.
- dotest rmadd-23 "${testcvs} -q ci -m add" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file5,v
+ dotest rmadd-23r "${testcvs} -q ci -m add" \
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file5,v
done
Checking in file5;
-${TESTDIR}/cvsroot/first-dir/file5,v <-- file5
+${CVSROOT_DIRNAME}/first-dir/file5,v <-- file5
initial revision: 1\.1
done"
- dotest rmadd-23-workaround \
+ dotest rmadd-23-workaroundr \
"${testcvs} -q ci -r 7 -m bump-it file5" \
"Checking in file5;
-${TESTDIR}/cvsroot/first-dir/file5,v <-- file5
+${CVSROOT_DIRNAME}/first-dir/file5,v <-- file5
new revision: 7\.1; previous revision: 1\.1
done"
else
dotest rmadd-23 "${testcvs} -q ci -m add" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file5,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file5,v
done
Checking in file5;
-${TESTDIR}/cvsroot/first-dir/file5,v <-- file5
+${CVSROOT_DIRNAME}/first-dir/file5,v <-- file5
initial revision: 7\.1
done"
fi
echo change it >file5
dotest_fail rmadd-24 "${testcvs} -q ci -r 4.8 -m change file5" \
"Checking in file5;
-${TESTDIR}/cvsroot/first-dir/file5,v <-- file5
-${PROG} [a-z]*: ${TESTDIR}/cvsroot/first-dir/file5,v: revision 4\.8 too low; must be higher than 7\.1
+${CVSROOT_DIRNAME}/first-dir/file5,v <-- file5
+${PROG} [a-z]*: ${CVSROOT_DIRNAME}/first-dir/file5,v: revision 4\.8 too low; must be higher than 7\.1
${PROG} [a-z]*: could not check in file5
7\.1 unlocked"
dotest rmadd-24a "${testcvs} -q ci -r 8.4 -m change file5" \
"Checking in file5;
-${TESTDIR}/cvsroot/first-dir/file5,v <-- file5
+${CVSROOT_DIRNAME}/first-dir/file5,v <-- file5
new revision: 8\.4; previous revision: 7\.1
done"
# I'm not really sure that a sticky tag make sense here.
@@ -3503,7 +4837,7 @@ done"
File: file5 Status: Up-to-date
Working revision: 8\.4.*
- Repository revision: 8\.4 ${TESTDIR}/cvsroot/first-dir/file5,v
+ Repository revision: 8\.4 ${CVSROOT_DIRNAME}/first-dir/file5,v
Sticky Tag: 8\.4
Sticky Date: (none)
Sticky Options: (none)"
@@ -3520,17 +4854,17 @@ File: file5 Status: Up-to-date
dotest rmadd2-1 "${testcvs} -q co -l ." ''
mkdir first-dir
dotest rmadd2-2 "${testcvs} add first-dir" \
-"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
cd first-dir
echo 'initial contents' >file1
dotest rmadd2-3 "${testcvs} add file1" \
"${PROG} [a-z]*: scheduling file .file1. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest rmadd2-4 "${testcvs} -q ci -m add" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done
Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
initial revision: 1\.1
done"
dotest rmadd2-4a "${testcvs} -Q tag tagone" ""
@@ -3539,29 +4873,29 @@ done"
${PROG} [a-z]*: use .${PROG} commit. to remove this file permanently"
dotest rmadd2-6 "${testcvs} -q ci -m remove" \
"Removing file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: delete; previous revision: 1\.1
done"
dotest rmadd2-7 "${testcvs} -q update -j 1.2 -j 1.1 file1" "U file1"
dotest rmadd2-8 "${testcvs} -q ci -m readd" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.3; previous revision: 1\.2
done"
echo 'new contents' >file1
dotest rmadd2-9 "${testcvs} -q ci -m modify" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.4; previous revision: 1\.3
done"
dotest rmadd2-10 "${testcvs} -q update -j 1.4 -j 1.3 file1" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
retrieving revision 1\.4
retrieving revision 1\.3
Merging differences between 1\.4 and 1\.3 into file1"
dotest rmadd2-11 "${testcvs} -q ci -m undo" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.5; previous revision: 1\.4
done"
dotest rmadd2-12 "cat file1" "initial contents"
@@ -3571,13 +4905,19 @@ done"
# the head.
dotest rmadd2-14 "${testcvs} -q update -j 1.3 -j 1.2 file1" \
"${PROG} [a-z]*: scheduling file1 for removal"
+
+ # Check that -p can get arbitrary revisions of a removed file
+ dotest rmadd2-14a "${testcvs} -q update -p" "initial contents"
+ dotest rmadd2-14b "${testcvs} -q update -p -r 1.5" "initial contents"
+ dotest rmadd2-14c "${testcvs} -q update -p -r 1.3" "initial contents"
+
dotest rmadd2-15 "${testcvs} -q ci -m re-remove" \
"Removing file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: delete; previous revision: 1\.5
done"
dotest rmadd2-16 "${testcvs} log -h file1" "
-RCS file: ${TESTDIR}/cvsroot/first-dir/Attic/file1,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file1,v
Working file: file1
head: 1\.6
branch:
@@ -3593,7 +4933,7 @@ total revisions: 6
File: no file file1 Status: Up-to-date
Working revision: No entry for file1
- Repository revision: 1\.6 ${TESTDIR}/cvsroot/first-dir/Attic/file1,v
+ Repository revision: 1\.6 ${CVSROOT_DIRNAME}/first-dir/Attic/file1,v
Existing Tags:
tagone (revision: 1.1)"
@@ -3601,7 +4941,7 @@ File: no file file1 Status: Up-to-date
cd ../..
rm -r 1
- rm -rf ${TESTDIR}/cvsroot/first-dir
+ rm -rf ${CVSROOT_DIRNAME}/first-dir
;;
dirs)
@@ -3625,7 +4965,7 @@ File: no file file1 Status: Up-to-date
N dir1/file1
N dir1/sdir/sfile
No conflicts created by this import
-${PROG} [a-z]*: Importing ${TESTDIR}/cvsroot/dir1/sdir"
+${PROG} [a-z]*: Importing ${CVSROOT_DIRNAME}/dir1/sdir"
cd ..
mkdir 1; cd 1
@@ -3642,12 +4982,12 @@ ${PROG} [a-z]*: Importing ${TESTDIR}/cvsroot/dir1/sdir"
dotest dirs-3 "${testcvs} update" \
"${PROG} [a-z]*: Updating dir1
${PROG} [a-z]*: Updating dir1/sdir
-${PROG} [a-z]*: cannot open directory ${TESTDIR}/cvsroot/dir1/sdir: No such file or directory
+${PROG} [a-z]*: cannot open directory ${CVSROOT_DIRNAME}/dir1/sdir: No such file or directory
${PROG} [a-z]*: skipping directory dir1/sdir"
dotest dirs-3a "${testcvs} update -d" \
"${PROG} [a-z]*: Updating dir1
${PROG} [a-z]*: Updating dir1/sdir
-${PROG} [a-z]*: cannot open directory ${TESTDIR}/cvsroot/dir1/sdir: No such file or directory
+${PROG} [a-z]*: cannot open directory ${CVSROOT_DIRNAME}/dir1/sdir: No such file or directory
${PROG} [a-z]*: skipping directory dir1/sdir"
# If we say "yes", then CVS gives errors about not being able to
@@ -3655,7 +4995,7 @@ ${PROG} [a-z]*: skipping directory dir1/sdir"
# The fact that it says "skipping directory " rather than
# "skipping directory dir1/sdir" is some kind of bug.
echo no | dotest dirs-4 "${testcvs} release -d dir1/sdir" \
-"${PROG} [a-z]*: cannot open directory ${TESTDIR}/cvsroot/dir1/sdir: No such file or directory
+"${PROG} [a-z]*: cannot open directory ${CVSROOT_DIRNAME}/dir1/sdir: No such file or directory
${PROG} [a-z]*: skipping directory
You have \[0\] altered files in this repository\.
Are you sure you want to release (and delete) directory .dir1/sdir': .. .release' aborted by user choice."
@@ -3688,47 +5028,40 @@ D/sdir////"
dotest dirs2-1 "${testcvs} -q co -l ." ''
mkdir first-dir
dotest dirs2-2 "${testcvs} add first-dir" \
-"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
cd first-dir
mkdir sdir
dotest dirs2-3 "${testcvs} add sdir" \
-"Directory ${TESTDIR}/cvsroot/first-dir/sdir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir/sdir added to the repository"
touch sdir/file1
dotest dirs2-4 "${testcvs} add sdir/file1" \
"${PROG} [a-z]*: scheduling file .sdir/file1. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest dirs2-5 "${testcvs} -q ci -m add" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/sdir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/file1,v
done
Checking in sdir/file1;
-${TESTDIR}/cvsroot/first-dir/sdir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/sdir/file1,v <-- file1
initial revision: 1\.1
done"
rm -r sdir/CVS
- if test "$remote" = yes; then
+ if $remote; then
# This is just like conflicts3-23
dotest_fail dirs2-6 "${testcvs} update -d" \
"${QUESTION} sdir
${PROG} server: Updating \.
-${PROG} update: in directory sdir:
-${PROG} update: cannot open CVS/Entries for reading: No such file or directory
${PROG} server: Updating sdir
${PROG} update: move away sdir/file1; it is in the way
C sdir/file1"
rm sdir/file1
+ rm -r sdir/CVS
# This is where things are not just like conflicts3-23
- # As with conflicts3-23, all these CVS/Entries* warnings
- # are somewhat doubtful, and we probably should think some
- # about whether they should be changed/fixed.
dotest dirs2-7 "${testcvs} update -d" \
"${QUESTION} sdir
${PROG} server: Updating \.
-${PROG} update: in directory sdir:
-${PROG} update: cannot open CVS/Entries for reading: No such file or directory
${PROG} server: Updating sdir
-U sdir/file1
-${PROG} update: cannot open CVS/Entries.Log: No such file or directory"
+U sdir/file1"
else
dotest dirs2-6 "${testcvs} update -d" \
"${PROG} update: Updating \.
@@ -3746,7 +5079,7 @@ ${QUESTION} sdir"
cd first-dir
dotest dirs2-9 "${testcvs} -q tag -b br" "T sdir/file1"
rm -r sdir/CVS
- if test "$remote" = yes; then
+ if $remote; then
# Cute little quirk of val-tags; if we don't recurse into
# the directories where the tag is defined, val-tags won't
# get updated.
@@ -3759,14 +5092,9 @@ ${PROG} \[server aborted\]: no such tag br"
dotest_fail dirs2-10-again "${testcvs} update -d -r br" \
"${QUESTION} sdir
${PROG} server: Updating \.
-${PROG} update: in directory sdir:
-${PROG} update: cannot open CVS/Entries for reading: No such file or directory
-${PROG} update: cannot open CVS/Tag: No such file or directory
-${PROG} update: cannot open CVS/Tag: No such file or directory
${PROG} server: Updating sdir
${PROG} update: move away sdir/file1; it is in the way
-C sdir/file1
-${PROG} update: cannot open CVS/Tag: No such file or directory"
+C sdir/file1"
else
dotest_fail dirs2-10 "${testcvs} update -d -r br" \
"${PROG} update: in directory sdir:
@@ -3790,20 +5118,15 @@ ${PROG} \[update aborted\]: there is no version here; do '${PROG} checkout' firs
${PROG} [a-z]*: use .${PROG} commit. to remove this file permanently"
dotest dirs2-13 "${testcvs} -q ci -m remove" \
"Removing sdir/file1;
-${TESTDIR}/cvsroot/first-dir/sdir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/sdir/file1,v <-- file1
new revision: delete; previous revision: 1\.1\.2
done"
cd ../../2/first-dir
- if test "$remote" = yes; then
+ if $remote; then
dotest dirs2-14 "${testcvs} update -d -r br" \
-"${QUESTION} sdir
+"${QUESTION} sdir/file1
${PROG} server: Updating \.
-${PROG} update: in directory sdir:
-${PROG} update: cannot open CVS/Entries for reading: No such file or directory
-${PROG} update: cannot open CVS/Tag: No such file or directory
-${PROG} update: cannot open CVS/Tag: No such file or directory
-${PROG} server: Updating sdir
-${PROG} update: cannot open CVS/Tag: No such file or directory"
+${PROG} server: Updating sdir"
else
dotest dirs2-14 "${testcvs} update -d -r br" \
"${PROG} update: Updating \.
@@ -3812,7 +5135,7 @@ ${QUESTION} sdir"
cd ../..
rm -r 1 2 3
- rm -rf ${TESTDIR}/cvsroot/first-dir
+ rm -rf ${CVSROOT_DIRNAME}/first-dir
;;
branches)
@@ -3832,35 +5155,35 @@ ${QUESTION} sdir"
'"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to add these files permanently'
dotest branches-2a "${testcvs} -n -q ci -m dont-commit" ""
dotest_lit branches-3 "${testcvs} -q ci -m add-it" <<HERE
-RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done
Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
initial revision: 1.1
done
-RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
done
Checking in file2;
-${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
+${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
initial revision: 1.1
done
-RCS file: ${TESTDIR}/cvsroot/first-dir/file3,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file3,v
done
Checking in file3;
-${TESTDIR}/cvsroot/first-dir/file3,v <-- file3
+${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
initial revision: 1.1
done
-RCS file: ${TESTDIR}/cvsroot/first-dir/file4,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
done
Checking in file4;
-${TESTDIR}/cvsroot/first-dir/file4,v <-- file4
+${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
initial revision: 1.1
done
HERE
echo 4:trunk-2 >file4
dotest branches-3.2 "${testcvs} -q ci -m trunk-before-branch" \
"Checking in file4;
-${TESTDIR}/cvsroot/first-dir/file4,v <-- file4
+${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
new revision: 1\.2; previous revision: 1\.1
done"
# The "cvs log file4" in test branches-14.3 will test that we
@@ -3886,15 +5209,15 @@ M file1"
echo 4:br1 >file4
dotest branches-6 "${testcvs} -q ci -m modify" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.1\.2\.1; previous revision: 1\.1
done
Checking in file2;
-${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
+${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
new revision: 1\.1\.2\.1; previous revision: 1\.1
done
Checking in file4;
-${TESTDIR}/cvsroot/first-dir/file4,v <-- file4
+${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
new revision: 1\.2\.2\.1; previous revision: 1\.2
done"
dotest branches-7 "${testcvs} -q tag -b brbr" 'T file1
@@ -3906,11 +5229,11 @@ T file4'
echo 4:brbr >file4
dotest branches-9 "${testcvs} -q ci -m modify" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.1\.2\.1\.2\.1; previous revision: 1\.1\.2\.1
done
Checking in file4;
-${TESTDIR}/cvsroot/first-dir/file4,v <-- file4
+${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
new revision: 1\.2\.2\.1\.2\.1; previous revision: 1\.2\.2\.1
done"
dotest branches-10 "cat file1 file2 file3 file4" '1:brbr
@@ -3927,7 +5250,7 @@ done"
echo 4:br1-2 >file4
dotest branches-12.2 "${testcvs} -q ci -m change-on-br1" \
"Checking in file4;
-${TESTDIR}/cvsroot/first-dir/file4,v <-- file4
+${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
new revision: 1\.2\.2\.2; previous revision: 1\.2\.2\.1
done"
dotest branches-13 "${testcvs} -q update -A" '[UP] file1
@@ -3941,12 +5264,12 @@ done"
dotest branches-14.2 \
"${testcvs} -q ci -m trunk-change-after-branch" \
"Checking in file4;
-${TESTDIR}/cvsroot/first-dir/file4,v <-- file4
+${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
new revision: 1\.3; previous revision: 1\.2
done"
dotest branches-14.3 "${testcvs} log file4" \
"
-RCS file: ${TESTDIR}/cvsroot/first-dir/file4,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
Working file: file4
head: 1\.3
branch:
@@ -3989,12 +5312,12 @@ modify
"${testcvs} diff -c -r 1.1 -r 1.3 file4" \
"Index: file4
===================================================================
-RCS file: ${TESTDIR}/cvsroot/first-dir/file4,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
retrieving revision 1\.1
retrieving revision 1\.3
diff -c -r1\.1 -r1\.3
-\*\*\* file4 [0-9/]* [0-9:]* 1\.1
---- file4 [0-9/]* [0-9:]* 1\.3
+\*\*\* file4 ${RFCDATE} 1\.1
+--- file4 ${RFCDATE} 1\.3
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
\*\*\* 1 \*\*\*\*
! 4:trunk-1
@@ -4004,12 +5327,12 @@ diff -c -r1\.1 -r1\.3
"${testcvs} diff -c -r 1.1 -r 1.2.2.1 file4" \
"Index: file4
===================================================================
-RCS file: ${TESTDIR}/cvsroot/first-dir/file4,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
retrieving revision 1\.1
retrieving revision 1\.2\.2\.1
diff -c -r1\.1 -r1\.2\.2\.1
-\*\*\* file4 [0-9/]* [0-9:]* 1\.1
---- file4 [0-9/]* [0-9:]* 1\.2\.2\.1
+\*\*\* file4 ${RFCDATE} 1\.1
+--- file4 ${RFCDATE} 1\.2\.2\.1
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
\*\*\* 1 \*\*\*\*
! 4:trunk-1
@@ -4017,7 +5340,7 @@ diff -c -r1\.1 -r1\.2\.2\.1
! 4:br1"
dotest branches-15 \
"${testcvs} update -j 1.1.2.1 -j 1.1.2.1.2.1 file1" \
- "RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+ "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
retrieving revision 1\.1\.2\.1
retrieving revision 1\.1\.2\.1\.2\.1
Merging differences between 1\.1\.2\.1 and 1\.1\.2\.1\.2\.1 into file1
@@ -4029,17 +5352,17 @@ rcsmerge: warning: conflicts during merge"
[>]>>>>>> 1\.1\.2\.1\.2\.1'
dotest branches-o1 "${testcvs} -q admin -o ::brbr" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done
-RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
done
-RCS file: ${TESTDIR}/cvsroot/first-dir/file3,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file3,v
done
-RCS file: ${TESTDIR}/cvsroot/first-dir/file4,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
done"
cd ..
- if test "$keep" = yes; then
+ if $keep; then
echo Keeping ${TESTDIR} and exiting due to --keep
exit 0
fi
@@ -4066,10 +5389,10 @@ done"
"${PROG} [a-z]*: scheduling file .file1. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest branches2-3 "${testcvs} commit -m add file1" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done
Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
initial revision: 1\.1
done"
@@ -4092,23 +5415,23 @@ done"
'"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to add this file permanently'
mkdir dir1
dotest branches2-9 "${testcvs} add dir1" \
-"Directory ${TESTDIR}/cvsroot/first-dir/dir1 added to the repository
+"Directory ${CVSROOT_DIRNAME}/first-dir/dir1 added to the repository
--> Using per-directory sticky tag "'`'"b1'"
echo "file3 first revision" > dir1/file3
dotest branches2-10 "${testcvs} add dir1/file3" \
"${PROG}"' [a-z]*: scheduling file `dir1/file3'\'' for addition on branch `b1'\''
'"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to add this file permanently'
dotest branches2-11 "${testcvs} -q ci -madd ." \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/Attic/file2,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file2,v
done
Checking in file2;
-${TESTDIR}/cvsroot/first-dir/Attic/file2,v <-- file2
+${CVSROOT_DIRNAME}/first-dir/Attic/file2,v <-- file2
new revision: 1\.1\.2\.1; previous revision: 1\.1
done
-RCS file: ${TESTDIR}/cvsroot/first-dir/dir1/Attic/file3,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/Attic/file3,v
done
Checking in dir1/file3;
-${TESTDIR}/cvsroot/first-dir/dir1/Attic/file3,v <-- file3
+${CVSROOT_DIRNAME}/first-dir/dir1/Attic/file3,v <-- file3
new revision: 1\.1\.2\.1; previous revision: 1\.1
done"
@@ -4128,7 +5451,7 @@ U dir1/file3"
File: file1 Status: Up-to-date
Working revision: 1\.1.*
- Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/file1,v
+ Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file1,v
Sticky Tag: b2 (branch: 1\.1\.4)
Sticky Date: (none)
Sticky Options: (none)
@@ -4137,7 +5460,7 @@ File: file1 Status: Up-to-date
File: file3 Status: Up-to-date
Working revision: 1\.1\.2\.1.*
- Repository revision: 1\.1\.2\.1 ${TESTDIR}/cvsroot/first-dir/dir1/Attic/file3,v
+ Repository revision: 1\.1\.2\.1 ${CVSROOT_DIRNAME}/first-dir/dir1/Attic/file3,v
Sticky Tag: b1 (branch: 1\.1\.2)
Sticky Date: (none)
Sticky Options: (none)"
@@ -4159,7 +5482,7 @@ U dir1/file3"
File: file1 Status: Up-to-date
Working revision: 1\.1.*
- Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/file1,v
+ Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file1,v
Sticky Tag: b2 (branch: 1\.1\.4)
Sticky Date: (none)
Sticky Options: (none)
@@ -4185,7 +5508,7 @@ U dir1/file3"
File: file1 Status: Up-to-date
Working revision: 1\.1.*
- Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/file1,v
+ Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file1,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: (none)
@@ -4194,7 +5517,7 @@ File: file1 Status: Up-to-date
File: file3 Status: Up-to-date
Working revision: 1\.1\.2\.1.*
- Repository revision: 1\.1\.2\.1 ${TESTDIR}/cvsroot/first-dir/dir1/Attic/file3,v
+ Repository revision: 1\.1\.2\.1 ${CVSROOT_DIRNAME}/first-dir/dir1/Attic/file3,v
Sticky Tag: b1 (branch: 1\.1\.2)
Sticky Date: (none)
Sticky Options: (none)"
@@ -4208,7 +5531,7 @@ U dir1/file3"
File: file1 Status: Up-to-date
Working revision: 1\.1.*
- Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/file1,v
+ Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file1,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: (none)
@@ -4217,7 +5540,7 @@ File: file1 Status: Up-to-date
File: file3 Status: Locally Added
Working revision: New file!
- Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/dir1/Attic/file3,v
+ Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/dir1/Attic/file3,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: (none)"
@@ -4243,17 +5566,17 @@ U first-dir/dir1/file3'
cd first-dir
mkdir dir2
dotest branches2-25 "${testcvs} add dir2" \
-"Directory ${TESTDIR}/cvsroot/first-dir/dir2 added to the repository
+"Directory ${CVSROOT_DIRNAME}/first-dir/dir2 added to the repository
--> Using per-directory sticky tag "'`'"b1'"
echo "file4 first revision" > dir2/file4
dotest branches2-26 "${testcvs} add dir2/file4" \
"${PROG}"' [a-z]*: scheduling file `dir2/file4'\'' for addition on branch `b1'\''
'"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to add this file permanently'
dotest branches2-27 "${testcvs} -q commit -madd" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/dir2/Attic/file4,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/dir2/Attic/file4,v
done
Checking in dir2/file4;
-${TESTDIR}/cvsroot/first-dir/dir2/Attic/file4,v <-- file4
+${CVSROOT_DIRNAME}/first-dir/dir2/Attic/file4,v <-- file4
new revision: 1\.1\.2\.1; previous revision: 1\.1
done"
@@ -4267,7 +5590,7 @@ U dir2/file4"
File: file4 Status: Up-to-date
Working revision: 1\.1\.2\.1.*
- Repository revision: 1\.1\.2\.1 ${TESTDIR}/cvsroot/first-dir/dir2/Attic/file4,v
+ Repository revision: 1\.1\.2\.1 ${CVSROOT_DIRNAME}/first-dir/dir2/Attic/file4,v
Sticky Tag: b1 (branch: 1\.1\.2)
Sticky Date: (none)
Sticky Options: (none)"
@@ -4288,10 +5611,10 @@ File: file4 Status: Up-to-date
"${PROG}"' [a-z]*: scheduling file `file5'\'' for addition
'"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to add this file permanently'
dotest branches2-35 "${testcvs} -q commit -madd" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/dir2/file5,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/dir2/file5,v
done
Checking in file5;
-${TESTDIR}/cvsroot/first-dir/dir2/file5,v <-- file5
+${CVSROOT_DIRNAME}/first-dir/dir2/file5,v <-- file5
initial revision: 1\.1
done"
@@ -4303,7 +5626,7 @@ done"
File: file5 Status: Up-to-date
Working revision: 1\.1.*
- Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/dir2/file5,v
+ Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/dir2/file5,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: (none)"
@@ -4320,17 +5643,17 @@ File: file5 Status: Up-to-date
dotest tagc-1 "${testcvs} -q co -l ." ''
mkdir first-dir
dotest tagc-2 "${testcvs} add first-dir" \
-"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
cd first-dir
touch file1
dotest tagc-3 "${testcvs} add file1" \
"${PROG} [a-z]*: scheduling file .file1. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest tagc-4 "${testcvs} -q ci -m add" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done
Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
initial revision: 1\.1
done"
dotest tagc-5 "${testcvs} -q tag -c tag1" "T file1"
@@ -4350,16 +5673,11 @@ ${PROG} \[[a-z]* aborted\]: correct the above errors first!"
cd ../1/first-dir
dotest tagc-9 "${testcvs} -q ci -m modify" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.2; previous revision: 1\.1
done"
cd ../../2/first-dir
- # That this is an error is a bug. Although the bug has existed
- # since tag -c was created, I don't think there would be a
- # compatibility problem with just fixing it.
- dotest_fail tagc-10 "${testcvs} -q tag -c tag4" \
-"${PROG} [a-z]*: file1 is locally modified
-${PROG} \[[a-z]* aborted\]: correct the above errors first!"
+ dotest tagc-10 "${testcvs} -q tag -c tag4" "T file1"
cd ../..
rm -r 1 2
@@ -4375,7 +5693,7 @@ ${PROG} \[[a-z]* aborted\]: correct the above errors first!"
dotest tagf-1 "${testcvs} -q co -l ." ''
mkdir first-dir
dotest tagf-2 "${testcvs} add first-dir" \
-"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
cd first-dir
touch file1 file2
dotest tagf-3 "${testcvs} add file1 file2" \
@@ -4383,16 +5701,16 @@ ${PROG} \[[a-z]* aborted\]: correct the above errors first!"
${PROG} [a-z]*: scheduling file .file2. for addition
${PROG} [a-z]*: use .${PROG} commit. to add these files permanently"
dotest tagf-4 "${testcvs} -q ci -m add" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done
Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
initial revision: 1\.1
done
-RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
done
Checking in file2;
-${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
+${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
initial revision: 1\.1
done"
@@ -4404,11 +5722,11 @@ T file2"
echo brmod >> file2
dotest tagf-7 "${testcvs} -q ci -m modify" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.1\.2\.1; previous revision: 1\.1
done
Checking in file2;
-${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
+${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
new revision: 1\.1\.2\.1; previous revision: 1\.1
done"
# Here we make it a non-branch tag. Some think this should
@@ -4424,7 +5742,7 @@ T file2"
File: file1 Status: Locally Modified
Working revision: 1\.1\.2\.1.*
- Repository revision: 1\.1\.2\.1 ${TESTDIR}/cvsroot/first-dir/file1,v
+ Repository revision: 1\.1\.2\.1 ${CVSROOT_DIRNAME}/first-dir/file1,v
Sticky Tag: br (revision: 1\.1\.2\.1)
Sticky Date: (none)
Sticky Options: (none)
@@ -4441,13 +5759,13 @@ D file2"
dotest tagf-11 "${testcvs} -q tag -r 1.1 -b br file1" "T file1"
# Fix it with admin -n (cf admin-18, admin-26-4).
dotest tagf-12 "${testcvs} -q admin -nbr:1.1.2 file2" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
done"
# Another variation on the file2 test would be to use two working
# directories so that the update -r br would need to
# a merge to get from 1.1.2.1 to the head of the 1.1.2 branch.
dotest tagf-13 "${testcvs} -q update -r br" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
retrieving revision 1\.1\.2\.1
retrieving revision 1\.1
Merging differences between 1\.1\.2\.1 and 1\.1 into file1
@@ -4467,11 +5785,11 @@ moremod
echo resolve >file1
dotest tagf-15 "${testcvs} -q ci -m recovered" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.1\.4\.1; previous revision: 1\.1
done
Checking in file2;
-${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
+${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
done"
cd ../..
@@ -4495,17 +5813,17 @@ done"
"${PROG} [a-z]*: scheduling file .foo\.c. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest rcsdiff-3 "${testcvs} commit -m rev1 foo.c" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/foo\.c,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/foo\.c,v
done
Checking in foo\.c;
-${TESTDIR}/cvsroot/first-dir/foo.c,v <-- foo\.c
+${CVSROOT_DIRNAME}/first-dir/foo.c,v <-- foo\.c
initial revision: 1\.1
done"
dotest rcsdiff-4 "${testcvs} tag first foo.c" "T foo\.c"
dotest rcsdiff-5 "${testcvs} update -p -r first foo.c" \
"===================================================================
Checking out foo\.c
-RCS: ${TESTDIR}/cvsroot/first-dir/foo\.c,v
+RCS: ${CVSROOT_DIRNAME}/first-dir/foo\.c,v
VERS: 1\.1
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
I am the first foo, and my name is \$""Name: first \$\."
@@ -4513,14 +5831,14 @@ I am the first foo, and my name is \$""Name: first \$\."
echo "I am the second foo, and my name is $""Name$." > foo.c
dotest rcsdiff-6 "${testcvs} commit -m rev2 foo.c" \
"Checking in foo\.c;
-${TESTDIR}/cvsroot/first-dir/foo\.c,v <-- foo\.c
+${CVSROOT_DIRNAME}/first-dir/foo\.c,v <-- foo\.c
new revision: 1\.2; previous revision: 1\.1
done"
dotest rcsdiff-7 "${testcvs} tag second foo.c" "T foo\.c"
dotest rcsdiff-8 "${testcvs} update -p -r second foo.c" \
"===================================================================
Checking out foo\.c
-RCS: ${TESTDIR}/cvsroot/first-dir/foo\.c,v
+RCS: ${CVSROOT_DIRNAME}/first-dir/foo\.c,v
VERS: 1\.2
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
I am the second foo, and my name is \$""Name: second \$\."
@@ -4529,7 +5847,7 @@ I am the second foo, and my name is \$""Name: second \$\."
"${PROG} [a-z]*: Diffing \.
Index: foo\.c
===================================================================
-RCS file: ${TESTDIR}/cvsroot/first-dir/foo\.c,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/foo\.c,v
retrieving revision 1\.1
retrieving revision 1\.2
diff -r1\.1 -r1\.2
@@ -4543,7 +5861,7 @@ diff -r1\.1 -r1\.2
"${PROG} [a-z]*: Diffing \.
Index: foo\.c
===================================================================
-RCS file: ${TESTDIR}/cvsroot/first-dir/foo\.c,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/foo\.c,v
retrieving revision 1\.1
diff -r1\.1 foo\.c
1c1
@@ -4570,10 +5888,10 @@ EOF
dotest rcslib-diffrgx-1 "${testcvs} -q add -m '' rgx.c" \
"${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest rcslib-diffrgx-2 "${testcvs} -q ci -m '' rgx.c" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/rgx\.c,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/rgx\.c,v
done
Checking in rgx\.c;
-${TESTDIR}/cvsroot/first-dir/rgx\.c,v <-- rgx\.c
+${CVSROOT_DIRNAME}/first-dir/rgx\.c,v <-- rgx\.c
initial revision: 1\.1
done"
cat >rgx.c <<EOF
@@ -4589,11 +5907,11 @@ EOF
dotest_fail rcslib-diffrgx-3 "${testcvs} diff -c -F'.*(' rgx.c" \
"Index: rgx\.c
===================================================================
-RCS file: ${TESTDIR}/cvsroot/first-dir/rgx\.c,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/rgx\.c,v
retrieving revision 1\.1
diff -c -F\.\*( -r1\.1 rgx\.c
-\*\*\* rgx\.c [0-9/]* [0-9:]* 1\.1
---- rgx\.c [0-9/]* [0-9:]*
+\*\*\* rgx\.c ${RFCDATE} 1\.1
+--- rgx\.c ${RFCDATE}
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* test_regex (whiz, bang)
\*\*\* 3,7 \*\*\*\*
foo;
@@ -4622,7 +5940,7 @@ diff -c -F\.\*( -r1\.1 rgx\.c
dotest rcslib-merge-1 "${testcvs} -q co -l ." ""
mkdir first-dir
dotest rcslib-merge-2 "${testcvs} -q add first-dir" \
-"Directory ${TESTDIR}/cvsroot.*/first-dir added to the repository"
+"Directory ${CVSROOT_DIRNAME}.*/first-dir added to the repository"
cd ..; rm -r 1
dotest rcslib-merge-3 "${testcvs} -q co first-dir" ""
@@ -4634,16 +5952,16 @@ diff -c -F\.\*( -r1\.1 rgx\.c
dotest rcslib-merge-4 "${testcvs} -q add file1" \
"${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest rcslib-merge-5 "${testcvs} -q commit -m '' file1" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done
Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
initial revision: 1\.1
done"
sed -e 's/2/two/' file1 > f; mv f file1
dotest rcslib-merge-6 "${testcvs} -q commit -m '' file1" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.2; previous revision: 1\.1
done"
dotest rcslib-merge-7 "${testcvs} -q tag -b -r 1.1 patch1" "T file1"
@@ -4653,7 +5971,7 @@ done"
File: file1 Status: Up-to-date
Working revision: 1\.1.*
- Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/file1,v
+ Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file1,v
Sticky Tag: patch1 (branch: 1\.1\.2)
Sticky Date: (none)
Sticky Options: (none)"
@@ -4664,12 +5982,12 @@ File: file1 Status: Up-to-date
sed -e 's/3/three/' file1 > f; mv f file1
dotest rcslib-merge-11 "${testcvs} -q commit -m '' file1" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.1\.2\.1; previous revision: 1\.1
done"
dotest rcslib-merge-12 "${testcvs} -q update -kv -j1.2" \
"U file1
-RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
retrieving revision 1\.1
retrieving revision 1\.2
Merging differences between 1\.1 and 1\.2 into file1
@@ -4691,7 +6009,7 @@ two
echo "This is a change" >> file2
dotest rcslib-symlink-3 "${testcvs} ci -m because file2" \
"Checking in file2;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file2
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file2
new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
done"
dotest rcslib-symlink-4 "ls -l $CVSROOT_DIRNAME/first-dir/file2,v" \
@@ -4722,7 +6040,7 @@ U first-dir/file2"
${PROG} [a-z]*: use .${PROG} commit. to remove this file permanently"
dotest rcslib-symlink-9 "${testcvs} -q ci -m rm-it" \
"Removing file2;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file2
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file2
new revision: delete; previous revision: 1\.2
done"
# OK, why this message happens twice is relatively clear
@@ -4737,7 +6055,7 @@ ${PROG} [a-z]*: could not read RCS file for first-dir/file2"
cd ..
- if test "$keep" = yes; then
+ if $keep; then
echo Keeping ${TESTDIR} and exiting due to --keep
exit 0
fi
@@ -4757,10 +6075,10 @@ ${PROG} [a-z]*: could not read RCS file for first-dir/file2"
"${PROG}"' [a-z]*: scheduling file `file1'\'' for addition
'"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to add this file permanently'
dotest_lit multibranch-3 "${testcvs} -q ci -m add-it" <<HERE
-RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done
Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
initial revision: 1.1
done
HERE
@@ -4774,14 +6092,14 @@ T file1"
echo on-br1 >file1
dotest multibranch-7 "${testcvs} -q ci -m modify-on-br1" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.1\.2\.1; previous revision: 1\.1
done"
dotest multibranch-8 "${testcvs} -q update -r br2" '[UP] file1'
echo br2 adds a line >>file1
dotest multibranch-9 "${testcvs} -q ci -m modify-on-br2" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.1\.4\.1; previous revision: 1\.1
done"
dotest multibranch-10 "${testcvs} -q update -r br1" '[UP] file1'
@@ -4792,7 +6110,7 @@ br2 adds a line'
dotest multibranch-14 "${testcvs} log file1" \
"
-RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
Working file: file1
head: 1\.1
branch:
@@ -4820,7 +6138,7 @@ modify-on-br1
============================================================================="
cd ..
- if test "$keep" = yes; then
+ if $keep; then
echo Keeping ${TESTDIR} and exiting due to --keep
exit 0
fi
@@ -4901,18 +6219,18 @@ U first-dir/imported-f4"
dotest import-100 "${testcvs} ci -m local-changes" \
"${PROG} [a-z]*: Examining .
Removing imported-f1;
-${TESTDIR}/cvsroot/first-dir/imported-f1,v <-- imported-f1
+${CVSROOT_DIRNAME}/first-dir/imported-f1,v <-- imported-f1
new revision: delete; previous revision: 1\.1\.1\.1
done
Checking in imported-f2;
-${TESTDIR}/cvsroot/first-dir/imported-f2,v <-- imported-f2
+${CVSROOT_DIRNAME}/first-dir/imported-f2,v <-- imported-f2
new revision: 1\.2; previous revision: 1\.1
done"
# log
dotest import-101 "${testcvs} log imported-f1" \
"
-RCS file: ${TESTDIR}/cvsroot/first-dir/Attic/imported-f1,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/imported-f1,v
Working file: imported-f1
head: 1\.2
branch:
@@ -4955,13 +6273,13 @@ first-import
dotest import-104 \
"${testcvs} ci -m vendor-removed imported-f4" \
"Removing imported-f4;
-${TESTDIR}/cvsroot/first-dir/imported-f4,v <-- imported-f4
+${CVSROOT_DIRNAME}/first-dir/imported-f4,v <-- imported-f4
new revision: delete; previous revision: 1\.1\.1\.1
done"
# update to main line
dotest import-105 "${testcvs} -q update -A" \
-"${PROG} [a-z]*: warning: imported-f1 is not (any longer) pertinent
+"${PROG} [a-z]*: imported-f1 is no longer in the repository
[UP] imported-f2"
# second import - file4 deliberately unchanged
@@ -5015,7 +6333,7 @@ Use the following command to help the merge:"
# update to main line
dotest import-112 "${testcvs} -q update -A" \
-"${PROG} [a-z]*: warning: imported-f1 is not (any longer) pertinent
+"${PROG} [a-z]*: imported-f1 is no longer in the repository
[UP] imported-f2"
cd ..
@@ -5023,7 +6341,7 @@ Use the following command to help the merge:"
dotest import-113 \
"${testcvs} -q co -jjunk-1_0 -jjunk-2_0 first-dir" \
"${PROG} [a-z]*: file first-dir/imported-f1 does not exist, but is present in revision junk-2_0
-RCS file: ${TESTDIR}/cvsroot/first-dir/imported-f2,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/imported-f2,v
retrieving revision 1\.1\.1\.1
retrieving revision 1\.1\.1\.2
Merging differences between 1\.1\.1\.1 and 1\.1\.1\.2 into imported-f2
@@ -5119,7 +6437,7 @@ No conflicts created by this import"
U first-dir/file2"
cd first-dir
dotest importb-5 "${testcvs} -q log file1" "
-RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
Working file: file1
head: 1\.1
branch: 1\.1\.1
@@ -5182,13 +6500,13 @@ N first-dir/adir/sub2/file2
N first-dir/bdir/subdir/file1
N first-dir/cdir/cfile
No conflicts created by this import
-${PROG} [a-z]*: Importing ${TESTDIR}/cvsroot/first-dir/adir
-${PROG} [a-z]*: Importing ${TESTDIR}/cvsroot/first-dir/adir/sub1
-${PROG} [a-z]*: Importing ${TESTDIR}/cvsroot/first-dir/adir/sub1/ssdir
-${PROG} [a-z]*: Importing ${TESTDIR}/cvsroot/first-dir/adir/sub2
-${PROG} [a-z]*: Importing ${TESTDIR}/cvsroot/first-dir/bdir
-${PROG} [a-z]*: Importing ${TESTDIR}/cvsroot/first-dir/bdir/subdir
-${PROG} [a-z]*: Importing ${TESTDIR}/cvsroot/first-dir/cdir"
+${PROG} [a-z]*: Importing ${CVSROOT_DIRNAME}/first-dir/adir
+${PROG} [a-z]*: Importing ${CVSROOT_DIRNAME}/first-dir/adir/sub1
+${PROG} [a-z]*: Importing ${CVSROOT_DIRNAME}/first-dir/adir/sub1/ssdir
+${PROG} [a-z]*: Importing ${CVSROOT_DIRNAME}/first-dir/adir/sub2
+${PROG} [a-z]*: Importing ${CVSROOT_DIRNAME}/first-dir/bdir
+${PROG} [a-z]*: Importing ${CVSROOT_DIRNAME}/first-dir/bdir/subdir
+${PROG} [a-z]*: Importing ${CVSROOT_DIRNAME}/first-dir/cdir"
cd ..
mkdir 2; cd 2
dotest importc-2 "${testcvs} -q co first-dir" \
@@ -5211,7 +6529,14 @@ ${PROG} [a-z]*: Updating bdir/subdir"
"${testcvs} -q rtag -b -r release wip_test first-dir" ""
dotest importc-6 "${testcvs} -q update -r wip_test" "M cdir/cfile"
- if test "$remote" = no; then
+ if $remote; then
+ # Remote doesn't have the bug in the first place.
+ dotest importc-7r "${testcvs} -q ci -m modify -r wip_test" \
+"Checking in cdir/cfile;
+${CVSROOT_DIRNAME}/first-dir/cdir/cfile,v <-- cfile
+new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1
+done"
+ else
# This checkin should just succeed. That it doesn't is a
# bug (CVS 1.9.16 through the present seem to have it; CVS
# 1.9 did not).
@@ -5221,14 +6546,7 @@ ${PROG} \[[a-z]* aborted\]: there is no version here; do .${PROG} checkout. firs
# The workaround is to leave off the "-r wip_test".
dotest importc-7a "${testcvs} -q ci -m modify" \
"Checking in cdir/cfile;
-${TESTDIR}/cvsroot/first-dir/cdir/cfile,v <-- cfile
-new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1
-done"
- else
- # Remote doesn't have the bug in the first place.
- dotest importc-7r "${testcvs} -q ci -m modify -r wip_test" \
-"Checking in cdir/cfile;
-${TESTDIR}/cvsroot/first-dir/cdir/cfile,v <-- cfile
+${CVSROOT_DIRNAME}/first-dir/cdir/cfile,v <-- cfile
new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1
done"
fi
@@ -5236,7 +6554,7 @@ done"
# TODO: should also be testing "import -d" when we update
# an existing file.
dotest importc-8 "${testcvs} -q log cdir/cfile" "
-RCS file: ${TESTDIR}/cvsroot/first-dir/cdir/cfile,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/cdir/cfile,v
Working file: cdir/cfile
head: 1\.1
branch: 1\.1\.1
@@ -5266,7 +6584,7 @@ modify
============================================================================="
dotest importc-9 "${testcvs} -q log bdir/subdir/file1" "
-RCS file: ${TESTDIR}/cvsroot/first-dir/bdir/subdir/file1,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/bdir/subdir/file1,v
Working file: bdir/subdir/file1
head: 1\.1
branch: 1\.1\.1
@@ -5328,13 +6646,12 @@ import-it
dotest import-after-initial-2 "$testcvs -Q co $module" ''
cd $module
echo original > $file
- dotest import-after-initial-3 "${testcvs} -Q add $file" \
-"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to add this file permanently'
+ dotest import-after-initial-3 "${testcvs} -Q add $file" ""
dotest import-after-initial-4 "${testcvs} -Q ci -m. $file" \
-"RCS file: ${TESTDIR}/cvsroot/$module/$file,v
+"RCS file: ${CVSROOT_DIRNAME}/$module/$file,v
done
Checking in $file;
-${TESTDIR}/cvsroot/$module/$file,v <-- $file
+${CVSROOT_DIRNAME}/$module/$file,v <-- $file
initial revision: 1\.1
done"
@@ -5453,28 +6770,28 @@ done"
'"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to add these files permanently'
dotest join-3 "${testcvs} -q commit -m add" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file3,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file3,v
done
Checking in file3;
-${TESTDIR}/cvsroot/first-dir/file3,v <-- file3
+${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
initial revision: 1\.1
done
-RCS file: ${TESTDIR}/cvsroot/first-dir/file4,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
done
Checking in file4;
-${TESTDIR}/cvsroot/first-dir/file4,v <-- file4
+${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
initial revision: 1\.1
done
-RCS file: ${TESTDIR}/cvsroot/first-dir/file6,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file6,v
done
Checking in file6;
-${TESTDIR}/cvsroot/first-dir/file6,v <-- file6
+${CVSROOT_DIRNAME}/first-dir/file6,v <-- file6
initial revision: 1\.1
done
-RCS file: ${TESTDIR}/cvsroot/first-dir/file8,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file8,v
done
Checking in file8;
-${TESTDIR}/cvsroot/first-dir/file8,v <-- file8
+${CVSROOT_DIRNAME}/first-dir/file8,v <-- file8
initial revision: 1\.1
done"
@@ -5499,28 +6816,28 @@ T file8'
'"${PROG}"' [a-z]*: scheduling `file8'\'' for removal
'"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to remove these files permanently'
dotest join-7 "${testcvs} -q ci -mx ." \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
done
Checking in file2;
-${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
+${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
initial revision: 1\.1
done
Checking in file4;
-${TESTDIR}/cvsroot/first-dir/file4,v <-- file4
+${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
new revision: 1\.2; previous revision: 1\.1
done
Removing file6;
-${TESTDIR}/cvsroot/first-dir/file6,v <-- file6
+${CVSROOT_DIRNAME}/first-dir/file6,v <-- file6
new revision: delete; previous revision: 1\.1
done
-RCS file: ${TESTDIR}/cvsroot/first-dir/file7,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file7,v
done
Checking in file7;
-${TESTDIR}/cvsroot/first-dir/file7,v <-- file7
+${CVSROOT_DIRNAME}/first-dir/file7,v <-- file7
initial revision: 1\.1
done
Removing file8;
-${TESTDIR}/cvsroot/first-dir/file8,v <-- file8
+${CVSROOT_DIRNAME}/first-dir/file8,v <-- file8
new revision: delete; previous revision: 1\.1
done"
@@ -5547,21 +6864,21 @@ U first-dir/file8'
'"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to add this file permanently'
dotest join-10 "${testcvs} -q ci -mx ." \
"Checking in file3;
-${TESTDIR}/cvsroot/first-dir/file3,v <-- file3
+${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
new revision: 1\.1\.2\.1; previous revision: 1\.1
done
Checking in file4;
-${TESTDIR}/cvsroot/first-dir/file4,v <-- file4
+${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
new revision: 1\.1\.2\.1; previous revision: 1\.1
done
-RCS file: ${TESTDIR}/cvsroot/first-dir/Attic/file5,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file5,v
done
Checking in file5;
-${TESTDIR}/cvsroot/first-dir/Attic/file5,v <-- file5
+${CVSROOT_DIRNAME}/first-dir/Attic/file5,v <-- file5
new revision: 1\.1\.2\.1; previous revision: 1\.1
done
Checking in file6;
-${TESTDIR}/cvsroot/first-dir/Attic/file6,v <-- file6
+${CVSROOT_DIRNAME}/first-dir/Attic/file6,v <-- file6
new revision: 1\.1\.2\.1; previous revision: 1\.1
done"
@@ -5588,30 +6905,30 @@ T file8'
'"${PROG}"' [a-z]*: scheduling `file6'\'' for removal
'"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to remove these files permanently'
dotest join-14 "${testcvs} -q ci -mx ." \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/Attic/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file1,v
done
Checking in file1;
-${TESTDIR}/cvsroot/first-dir/Attic/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/Attic/file1,v <-- file1
new revision: 1\.1\.2\.1; previous revision: 1\.1
done
Checking in file2;
-${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
+${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
new revision: 1\.1\.2\.1; previous revision: 1\.1
done
Removing file3;
-${TESTDIR}/cvsroot/first-dir/file3,v <-- file3
+${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
new revision: delete; previous revision: 1\.1\.2\.1
done
Removing file4;
-${TESTDIR}/cvsroot/first-dir/file4,v <-- file4
+${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
new revision: delete; previous revision: 1\.1\.2\.1
done
Removing file5;
-${TESTDIR}/cvsroot/first-dir/Attic/file5,v <-- file5
+${CVSROOT_DIRNAME}/first-dir/Attic/file5,v <-- file5
new revision: delete; previous revision: 1\.1\.2\.1
done
Removing file6;
-${TESTDIR}/cvsroot/first-dir/Attic/file6,v <-- file6
+${CVSROOT_DIRNAME}/first-dir/Attic/file6,v <-- file6
new revision: delete; previous revision: 1\.1\.2\.1
done"
@@ -5674,7 +6991,7 @@ M file4'
dotest join-20 "${testcvs} -q co -jbranch first-dir" \
"U first-dir/file1
U first-dir/file2
-RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
retrieving revision 1\.1
retrieving revision 1\.1\.2\.1
Merging differences between 1\.1 and 1\.1\.2\.1 into file2
@@ -5708,7 +7025,7 @@ U first-dir/file7'
echo 'third revision of file4' > file4
dotest join-23 "${testcvs} -q update -jbranch ." \
"U file1
-RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
retrieving revision 1\.1
retrieving revision 1\.1\.2\.1
Merging differences between 1\.1 and 1\.1\.2\.1 into file2
@@ -5746,7 +7063,7 @@ T file7"
# the trunk (e.g. join-23).
dotest join-28 "${testcvs} -q update -j branch" \
"U file1
-RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
retrieving revision 1.1
retrieving revision 1.1.2.1
Merging differences between 1.1 and 1.1.2.1 into file2
@@ -5760,6 +7077,41 @@ M file2
R file3
A file8"
+ # Checkout the mainline again to try updating and merging between two
+ # branches in the same step
+ # this seems a likely scenario - the user finishes up on branch and
+ # updates to br2 and merges in the same step - and there was a bug
+ # once that if the file was removed in the update then it wouldn't be
+ # readded in the merge
+ cd ..
+ rm -r first-dir
+ dotest join-twobranch-1 "${testcvs} -q co -rbranch first-dir" \
+'U first-dir/file1
+U first-dir/file2
+U first-dir/file8'
+ cd first-dir
+ dotest join-twobranch-2 "${testcvs} -q update -rbr2 -jbranch" \
+"cvs [a-z]*: file1 is no longer in the repository
+U file1
+U file2
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
+retrieving revision 1\.1
+retrieving revision 1\.1\.2\.1
+Merging differences between 1\.1 and 1\.1\.2\.1 into file2
+U file3
+${PROG} [a-z]*: scheduling file3 for removal
+U file4
+${PROG} [a-z]*: file file4 has been modified, but has been removed in revision branch
+U file7
+${PROG} [a-z]*: file8 is no longer in the repository
+U file8"
+ # Verify that the right changes have been scheduled.
+ dotest join-twobranch-3 "${testcvs} -q update" \
+"A file1
+M file2
+R file3
+A file8"
+
# Checkout the mainline again to try merging from the trunk
# to a branch.
cd ..
@@ -5782,7 +7134,7 @@ T file7'
echo 'second revision of file7' > file7
dotest join-32 "${testcvs} -q ci -mx ." \
"Checking in file7;
-${TESTDIR}/cvsroot/first-dir/file7,v <-- file7
+${CVSROOT_DIRNAME}/first-dir/file7,v <-- file7
new revision: 1\.2; previous revision: 1\.1
done"
@@ -5808,7 +7160,7 @@ U file7"
# happens to do the right thing; see above join-20.
dotest join-36 "${testcvs} -q up -j T3 -j T4" \
"A file7
-RCS file: ${TESTDIR}/cvsroot/first-dir/file7,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file7,v
retrieving revision 1\.1
retrieving revision 1\.2
Merging differences between 1\.1 and 1\.2 into file7"
@@ -5832,17 +7184,17 @@ Merging differences between 1\.1 and 1\.2 into file7"
dotest join2-1 "${testcvs} -q co -l ." ''
mkdir first-dir
dotest join2-2 "${testcvs} add first-dir" \
-"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
cd first-dir
echo 'initial contents of file1' >file1
dotest join2-3 "${testcvs} add file1" \
"${PROG} [a-z]*: scheduling file .file1. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest join2-4 "${testcvs} -q ci -m add" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done
Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
initial revision: 1\.1
done"
dotest join2-5 "${testcvs} -q tag -b br1" "T file1"
@@ -5853,14 +7205,14 @@ done"
"${PROG} [a-z]*: scheduling file .bradd. for addition on branch .br1.
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest join2-7 "${testcvs} -q ci -m modify" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/Attic/bradd,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/bradd,v
done
Checking in bradd;
-${TESTDIR}/cvsroot/first-dir/Attic/bradd,v <-- bradd
+${CVSROOT_DIRNAME}/first-dir/Attic/bradd,v <-- bradd
new revision: 1\.1\.2\.1; previous revision: 1\.1
done
Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.1\.2\.1; previous revision: 1\.1
done"
@@ -5872,14 +7224,14 @@ done"
File: file1 Status: Up-to-date
Working revision: 1\.1.*
- Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/file1,v
+ Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file1,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: (none)"
dotest join2-10 "cat CVS/Tag" "Tbr1"
dotest join2-11 "${testcvs} -q update -j br1 file1" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
retrieving revision 1\.1
retrieving revision 1\.1\.2\.1
Merging differences between 1\.1 and 1\.1\.2\.1 into file1"
@@ -5891,7 +7243,7 @@ modify on branch"
File: file1 Status: Locally Modified
Working revision: 1\.1.*
- Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/file1,v
+ Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file1,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: (none)"
@@ -5899,7 +7251,7 @@ File: file1 Status: Locally Modified
# And the checkin should go to the trunk
dotest join2-15 "${testcvs} -q ci -m modify file1" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.2; previous revision: 1\.1
done"
@@ -5916,7 +7268,7 @@ done"
# CVS, would be a lot of work and I'm not sure this case justifies
# it.
dotest join2-17-circumvent "${testcvs} -q update -A" \
-"${PROG} [a-z]*: warning: bradd is not (any longer) pertinent
+"${PROG} [a-z]*: bradd is no longer in the repository
[UP] file1"
: dotest join2-17 "${testcvs} -q update -A bradd" \
"${PROG} [a-z]*: warning: bradd is not (any longer) pertinent"
@@ -5926,13 +7278,13 @@ done"
File: bradd Status: Locally Added
Working revision: New file!
- Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/Attic/bradd,v
+ Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/Attic/bradd,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: (none)"
dotest join2-20 "${testcvs} -q ci -m modify bradd" \
"Checking in bradd;
-${TESTDIR}/cvsroot/first-dir/bradd,v <-- bradd
+${CVSROOT_DIRNAME}/first-dir/bradd,v <-- bradd
new revision: 1\.2; previous revision: 1\.1
done"
@@ -5949,17 +7301,17 @@ done"
dotest join3-1 "${testcvs} -q co -l ." ''
mkdir first-dir
dotest join3-2 "${testcvs} add first-dir" \
-"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
cd first-dir
echo 'initial contents of file1' >file1
dotest join3-3 "${testcvs} add file1" \
"${PROG} [a-z]*: scheduling file .file1. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest join3-4 "${testcvs} -q ci -m add" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done
Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
initial revision: 1\.1
done"
dotest join3-5 "${testcvs} -q tag -b br1" "T file1"
@@ -5967,7 +7319,7 @@ done"
echo 'br1:line1' >>file1
dotest join3-7 "${testcvs} -q ci -m modify" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.1\.2\.1; previous revision: 1\.1
done"
@@ -5982,13 +7334,13 @@ ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
echo 'trunk:line1' >>file1
dotest join3-9 "${testcvs} -q ci -m modify" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.2; previous revision: 1\.1
done
-RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
done
Checking in file2;
-${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
+${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
initial revision: 1\.1
done"
dotest join3-10 "${testcvs} -q tag -b br2" "T file1
@@ -5998,7 +7350,7 @@ T file2"
dotest join3-11 "${testcvs} -q update -r br1" "[UP] file1
${PROG} [a-z]*: file2 is no longer in the repository"
dotest join3-12 "${testcvs} -q update -j br2" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
retrieving revision 1\.1
retrieving revision 1\.2
Merging differences between 1\.1 and 1\.2 into file1
@@ -6020,7 +7372,7 @@ U file1" "U file1"
echo 'br2:line1' >>file1
dotest join3-15 "${testcvs} -q ci -m modify file1" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.2\.2\.1; previous revision: 1\.2
done"
@@ -6031,7 +7383,7 @@ done"
# and so it merges both the 1.1->1.2 and 1.2->1.2.2.1 changes.
# This seems like a reasonably plausible behavior.
dotest join3-17 "${testcvs} -q update -j br2 file1" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
retrieving revision 1\.1
retrieving revision 1\.2\.2\.1
Merging differences between 1\.1 and 1\.2\.2\.1 into file1
@@ -6051,6 +7403,9 @@ br2:line1
;;
join-readonly-conflict)
+ # Previously, only tests 1 & 11 were being tested. I added the
+ # intermediate dotest's to try and diagnose a different failure
+ #
# Demonstrate that cvs-1.9.29 can fail on 2nd and subsequent
# conflict-evoking join attempts.
# Even with that version of CVS, This test failed only in
@@ -6058,50 +7413,77 @@ br2:line1
# operation only for files that were read-only (either due to
# use of cvs' global -r option, setting the CVSREAD envvar,
# or use of watch lists).
- mkdir 1; cd 1
+ mkdir join-readonly-conflict; cd join-readonly-conflict
dotest join-readonly-conflict-1 "$testcvs -q co -l ." ''
- module=x
+ module=join-readonly-conflict
mkdir $module
$testcvs -q add $module >>$LOGFILE 2>&1
cd $module
file=m
echo trunk > $file
- $testcvs -q add $file >>$LOGFILE 2>&1
- $testcvs -q ci -m . $file >>$LOGFILE 2>&1
+ dotest join-readonly-conflict-2 "$testcvs -Q add $file" ''
- $testcvs tag -b B $file >>$LOGFILE 2>&1
- $testcvs -q update -rB $file >>$LOGFILE 2>&1
+ dotest join-readonly-conflict-3 "$testcvs -q ci -m . $file" \
+"RCS file: $CVSROOT_DIRNAME/$module/$file,v
+done
+Checking in $file;
+$CVSROOT_DIRNAME/$module/$file,v <-- $file
+initial revision: 1\.1
+done"
+
+ dotest join-readonly-conflict-4 "$testcvs tag -b B $file" "T $file"
+ dotest join-readonly-conflict-5 "$testcvs -q update -rB $file" ''
echo branch B > $file
- $testcvs ci -m . $file >>$LOGFILE 2>&1
+ dotest join-readonly-conflict-6 "$testcvs -q ci -m . $file" \
+"Checking in $file;
+$CVSROOT_DIRNAME/$module/$file,v <-- $file
+new revision: 1\.1\.2\.1; previous revision: 1\.1
+done"
rm $file
- $testcvs update -A $file >>$LOGFILE 2>&1
+ dotest join-readonly-conflict-7 "$testcvs -Q update -A $file" ''
# Make sure $file is read-only. This can happen more realistically
# via patch -- which could be used to apply a delta, yet would
# preserve a file's read-only permissions.
echo conflict > $file; chmod u-w $file
- $testcvs update -r B $file >>$LOGFILE 2>&1
+ dotest join-readonly-conflict-8 "$testcvs update -r B $file" \
+"RCS file: $CVSROOT_DIRNAME/$module/$file,v
+retrieving revision 1\.1
+retrieving revision 1\.1\.2\.1
+Merging differences between 1\.1 and 1\.1\.2\.1 into $file
+rcsmerge: warning: conflicts during merge
+$PROG [a-z]*: conflicts found in $file
+C $file"
+ # restore to the trunk
rm -f $file
- $testcvs update -A $file >>$LOGFILE 2>&1
+ dotest join-readonly-conflict-9 "$testcvs -Q update -A $file" ''
+
# This one would fail because cvs couldn't open the existing
# (and read-only) .# file for writing.
echo conflict > $file
- test -w ".#$file.1.1" && fail "$file is writable"
- dotest join-readonly-conflict-2 "$testcvs update -r B $file" \
-"RCS file: ${TESTDIR}/cvsroot/$module/$file,v
+ # verify that the backup file is writable
+ if test -w ".#$file.1.1"; then
+ fail "join-readonly-conflict-10 : .#$file.1.1 is writable"
+ else
+ pass "join-readonly-conflict-10"
+ fi
+ dotest join-readonly-conflict-11 "$testcvs update -r B $file" \
+"RCS file: $CVSROOT_DIRNAME/$module/$file,v
retrieving revision 1\.1
retrieving revision 1\.1\.2\.1
Merging differences between 1\.1 and 1\.1\.2\.1 into $file
rcsmerge: warning: conflicts during merge
-${PROG} [a-z]*: conflicts found in $file
+$PROG [a-z]*: conflicts found in $file
C m"
cd ../..
- rm -rf 1
- rm -rf ${CVSROOT_DIRNAME}/$module
+ if $keep; then :; else
+ rm -rf join-readonly-conflict
+ rm -rf $CVSROOT_DIRNAME/$module
+ fi
;;
join-admin)
@@ -6137,7 +7519,7 @@ C m"
File: b Status: Up-to-date
Working revision: 1\.1.*
- Repository revision: 1\.1 ${TESTDIR}/cvsroot/x/b,v
+ Repository revision: 1\.1 ${CVSROOT_DIRNAME}/x/b,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: (none)"
@@ -6147,6 +7529,87 @@ File: b Status: Up-to-date
rm -rf ${CVSROOT_DIRNAME}/$module
;;
+ join-admin-2)
+ # Show that when a merge (via update -kk -jtag1 -jtag2) first
+ # removes a file, then modifies another containing an $Id...$ line,
+ # the resulting file contains the unexpanded `$Id.$' string, as
+ # -kk requires.
+ mkdir 1; cd 1
+ dotest join-admin-2-1 "$testcvs -q co -l ." ''
+ module=x
+ mkdir $module
+ dotest join-admin-2-2 "$testcvs -q add $module" \
+"Directory ${CVSROOT_DIRNAME}/x added to the repository"
+ cd $module
+
+ # Create a file so applying the first tag works.
+ echo '$''Id$' > e0
+ cp e0 e
+ dotest join-admin-2-3 "$testcvs -Q add e" ''
+ dotest join-admin-2-4 "$testcvs -Q ci -m. e" \
+"RCS file: ${CVSROOT_DIRNAME}/x/e,v
+done
+Checking in e;
+${CVSROOT_DIRNAME}/x/e,v <-- e
+initial revision: 1\.1
+done"
+
+ dotest join-admin-2-5 "$testcvs -Q tag -b T" '' "${QUESTION} e0"
+ dotest join-admin-2-6 "$testcvs -Q update -r T" '' "${QUESTION} e0"
+ cp e0 e
+ dotest join-admin-2-7 "$testcvs -Q ci -m. e" \
+"Checking in e;
+${CVSROOT_DIRNAME}/x/e,v <-- e
+new revision: 1\.1\.2\.1; previous revision: 1\.1
+done"
+
+ dotest join-admin-2-8 "$testcvs -Q update -A" '' "${QUESTION} e0"
+ dotest join-admin-2-9 "$testcvs -Q tag -b M1" '' "${QUESTION} e0"
+
+ echo '$''Id$' > b
+ dotest join-admin-2-10 "$testcvs -Q add b" ''
+ cp e0 e
+ dotest join-admin-2-11 "$testcvs -Q ci -m. b e" \
+"RCS file: ${CVSROOT_DIRNAME}/x/b,v
+done
+Checking in b;
+${CVSROOT_DIRNAME}/x/b,v <-- b
+initial revision: 1\.1
+done
+Checking in e;
+${CVSROOT_DIRNAME}/x/e,v <-- e
+new revision: 1\.2; previous revision: 1\.1
+done"
+
+ dotest join-admin-2-12 "$testcvs -Q tag -b M2" '' "${QUESTION} e0"
+
+ dotest join-admin-2-13 "$testcvs -Q update -r T" '' "${QUESTION} e0"
+ dotest join-admin-2-14 "$testcvs update -kk -jM1 -jM2" \
+"${PROG} [a-z]*: Updating .
+U b
+U e
+RCS file: ${CVSROOT_DIRNAME}/x/e,v
+retrieving revision 1\.1
+retrieving revision 1\.2
+Merging differences between 1\.1 and 1\.2 into e
+${QUESTION} e0" \
+"${QUESTION} e0
+${PROG} [a-z]*: Updating .
+U b
+U e
+RCS file: ${CVSROOT_DIRNAME}/x/e,v
+retrieving revision 1\.1
+retrieving revision 1\.2
+Merging differences between 1\.1 and 1\.2 into e"
+
+ # Verify that the $Id.$ string is not expanded.
+ dotest join-admin-2-15 "cat e" '$''Id$'
+
+ cd ../..
+ rm -rf 1
+ rm -rf ${CVSROOT_DIRNAME}/$module
+ ;;
+
new) # look for stray "no longer pertinent" messages.
mkdir ${CVSROOT_DIRNAME}/first-dir
@@ -6218,10 +7681,10 @@ File: b Status: Up-to-date
"${PROG} [a-z]*: scheduling file .a. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest newb-123c "${testcvs} -q ci -m added" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/a,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/a,v
done
Checking in a;
-${TESTDIR}/cvsroot/first-dir/a,v <-- a
+${CVSROOT_DIRNAME}/first-dir/a,v <-- a
initial revision: 1\.1
done"
@@ -6249,7 +7712,7 @@ done"
${PROG} [a-z]*: use .${PROG} commit. to remove this file permanently"
dotest newb-123h "${testcvs} -q ci -m removed" \
"Removing a;
-${TESTDIR}/cvsroot/first-dir/a,v <-- a
+${CVSROOT_DIRNAME}/first-dir/a,v <-- a
new revision: delete; previous revision: 1\.1\.2
done"
@@ -6263,29 +7726,20 @@ done"
# Update the other copy, and make sure that a is removed.
cd ../1/first-dir
- # "Needs Patch" is a rather strange output here. Something like
+ # "Entry Invalid" is a rather strange output here. Something like
# "Removed in Repository" would make more sense.
- # The "Need Checkout" output is what CVS does if configured
- # --disable-server.
dotest newb-123j0 "${testcvs} status a" \
-"===================================================================
-File: a Status: Needs Patch
-
- Working revision: 1\.1.*
- Repository revision: 1\.1\.2\.1 ${TESTDIR}/cvsroot/first-dir/a,v
- Sticky Tag: branch (branch: 1\.1\.2)
- Sticky Date: (none)
- Sticky Options: (none)" \
-"===================================================================
-File: a Status: Needs Checkout
+"${PROG} [a-z]*: a is no longer in the repository
+===================================================================
+File: a Status: Entry Invalid
Working revision: 1\.1.*
- Repository revision: 1\.1\.2\.1 ${TESTDIR}/cvsroot/first-dir/a,v
+ Repository revision: 1\.1\.2\.1 ${CVSROOT_DIRNAME}/first-dir/a,v
Sticky Tag: branch (branch: 1\.1\.2)
Sticky Date: (none)
Sticky Options: (none)"
dotest newb-123j "${testcvs} -q update" \
-"${PROG} [a-z]*: warning: a is not (any longer) pertinent"
+"${PROG} [a-z]*: a is no longer in the repository"
if test -f a; then
fail newb-123k
@@ -6313,10 +7767,10 @@ File: a Status: Needs Checkout
"${PROG} [a-z]*: scheduling file .a. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest conflicts-126 "${testcvs} -q ci -m added" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/a,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/a,v
done
Checking in a;
-${TESTDIR}/cvsroot/first-dir/a,v <-- a
+${CVSROOT_DIRNAME}/first-dir/a,v <-- a
initial revision: 1\.1
done"
@@ -6324,13 +7778,11 @@ done"
mkdir 2
cd 2
- # The need for TMPPWD here is a (minor) CVS bug; the
- # output should use the name of the repository as specified.
dotest conflicts-126.5 "${testcvs} co -p first-dir" \
"${PROG} [a-z]*: Updating first-dir
===================================================================
Checking out first-dir/a
-RCS: ${TMPPWD}/cvsroot/first-dir/a,v
+RCS: ${CVSROOT_DIRNAME}/first-dir/a,v
VERS: 1\.1
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*"
if ${CVS} co first-dir ; then
@@ -6349,10 +7801,10 @@ VERS: 1\.1
echo add a line >>a
mkdir dir1
dotest conflicts-127b "${testcvs} add dir1" \
-"Directory ${TESTDIR}/cvsroot/first-dir/dir1 added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir/dir1 added to the repository"
dotest conflicts-128 "${testcvs} -q ci -m changed" \
"Checking in a;
-${TESTDIR}/cvsroot/first-dir/a,v <-- a
+${CVSROOT_DIRNAME}/first-dir/a,v <-- a
new revision: 1\.2; previous revision: 1\.1
done"
cd ../..
@@ -6361,13 +7813,11 @@ done"
# contents.
mkdir 3
cd 3
- # The need for TMPPWD here is a (minor) CVS bug; the
- # output should use the name of the repository as specified.
dotest conflicts-128.5 "${testcvs} co -p -l first-dir" \
"${PROG} [a-z]*: Updating first-dir
===================================================================
Checking out first-dir/a
-RCS: ${TMPPWD}/cvsroot/first-dir/a,v
+RCS: ${CVSROOT_DIRNAME}/first-dir/a,v
VERS: 1\.2
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
add a line"
@@ -6388,12 +7838,12 @@ add a line"
File: a Status: Needs Merge
Working revision: 1\.1.*
- Repository revision: 1\.2 ${TESTDIR}/cvsroot/first-dir/a,v
+ Repository revision: 1\.2 ${CVSROOT_DIRNAME}/first-dir/a,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: (none)"
dotest conflicts-129a "${testcvs} -nq update a" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/a,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/a,v
retrieving revision 1\.1
retrieving revision 1\.2
Merging differences between 1\.1 and 1\.2 into a
@@ -6401,7 +7851,7 @@ rcsmerge: warning: conflicts during merge
${PROG} [a-z]*: conflicts found in a
C a"
dotest conflicts-130 "${testcvs} -q update" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/a,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/a,v
retrieving revision 1\.1
retrieving revision 1\.2
Merging differences between 1\.1 and 1\.2 into a
@@ -6412,7 +7862,7 @@ ${QUESTION} dir1
${QUESTION} sdir" \
"${QUESTION} dir1
${QUESTION} sdir
-RCS file: ${TESTDIR}/cvsroot/first-dir/a,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/a,v
retrieving revision 1\.1
retrieving revision 1\.2
Merging differences between 1\.1 and 1\.2 into a
@@ -6426,7 +7876,7 @@ C a"
File: a Status: File had conflicts on merge
Working revision: 1\.2.*
- Repository revision: 1\.2 ${TESTDIR}/cvsroot/first-dir/a,v
+ Repository revision: 1\.2 ${CVSROOT_DIRNAME}/first-dir/a,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: (none)"
@@ -6456,14 +7906,14 @@ ${PROG} \[[a-z]* aborted\]: correct above errors first!"
File: a Status: File had conflicts on merge
Working revision: 1\.2.*
- Repository revision: 1\.2 ${TESTDIR}/cvsroot/first-dir/a,v
+ Repository revision: 1\.2 ${CVSROOT_DIRNAME}/first-dir/a,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: (none)"
dotest conflicts-132 "${testcvs} -q ci -m try" \
"${PROG} [a-z]*: warning: file .a. seems to still contain conflict indicators
Checking in a;
-${TESTDIR}/cvsroot/first-dir/a,v <-- a
+${CVSROOT_DIRNAME}/first-dir/a,v <-- a
new revision: 1\.3; previous revision: 1\.2
done"
@@ -6475,13 +7925,13 @@ done"
File: a Status: Locally Modified
Working revision: 1\.3.*
- Repository revision: 1\.3 ${TESTDIR}/cvsroot/first-dir/a,v
+ Repository revision: 1\.3 ${CVSROOT_DIRNAME}/first-dir/a,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: (none)"
dotest conflicts-133 "${testcvs} -q ci -m resolved" \
"Checking in a;
-${TESTDIR}/cvsroot/first-dir/a,v <-- a
+${CVSROOT_DIRNAME}/first-dir/a,v <-- a
new revision: 1\.4; previous revision: 1\.3
done"
dotest conflicts-status-7 "${testcvs} status a" \
@@ -6489,7 +7939,7 @@ done"
File: a Status: Up-to-date
Working revision: 1\.4.*
- Repository revision: 1\.4 ${TESTDIR}/cvsroot/first-dir/a,v
+ Repository revision: 1\.4 ${CVSROOT_DIRNAME}/first-dir/a,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: (none)"
@@ -6584,16 +8034,16 @@ File: a Status: Up-to-date
${PROG} [a-z]*: scheduling file .abc. for addition
${PROG} [a-z]*: use .${PROG} commit. to add these files permanently"
dotest conflicts2-142a3 "${testcvs} -q ci -m added" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/a,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/a,v
done
Checking in a;
-${TESTDIR}/cvsroot/first-dir/a,v <-- a
+${CVSROOT_DIRNAME}/first-dir/a,v <-- a
initial revision: 1\.1
done
-RCS file: ${TESTDIR}/cvsroot/first-dir/abc,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
done
Checking in abc;
-${TESTDIR}/cvsroot/first-dir/abc,v <-- abc
+${CVSROOT_DIRNAME}/first-dir/abc,v <-- abc
initial revision: 1\.1
done"
@@ -6615,7 +8065,7 @@ U first-dir/abc'
echo modify a >>a
dotest conflicts2-142b2 "${testcvs} -q ci -m modify-a" \
"Checking in a;
-${TESTDIR}/cvsroot/first-dir/a,v <-- a
+${CVSROOT_DIRNAME}/first-dir/a,v <-- a
new revision: 1\.2; previous revision: 1\.1
done"
cd ../../2/first-dir
@@ -6638,7 +8088,13 @@ ${PROG} [a-z]*: a, version 1\.1, resurrected"
"${PROG} [a-z]*: scheduling .first-dir/a. for removal
${PROG} [a-z]*: use .${PROG} commit. to remove this file permanently"
- if test "$remote" = no; then
+ if $remote; then
+ # Haven't investigated this one.
+ dotest_fail conflicts2-142b8 "${testcvs} add first-dir/a" \
+"${PROG} add: in directory \.:
+${PROG} \[add aborted\]: there is no version here; do '${PROG} checkout' first"
+ cd first-dir
+ else
# The "nothing known" is a bug. Correct behavior is for a to get
# created, as above. Cause is pretty obvious - add.c
# calls update() without dealing with the fact we are chdir'd.
@@ -6656,12 +8112,6 @@ ${PROG} [a-z]*: first-dir/a, version 1\.2, resurrected"
dotest conflicts2-142b9 "${testcvs} rm -f a" \
"${PROG} [a-z]*: scheduling .a. for removal
${PROG} [a-z]*: use .${PROG} commit. to remove this file permanently"
- else
- # Haven't investigated this one.
- dotest_fail conflicts2-142b8 "${testcvs} add first-dir/a" \
-"${PROG} add: in directory \.:
-${PROG} \[add aborted\]: there is no version here; do '${PROG} checkout' first"
- cd first-dir
fi
# As before, 1.2 instead of 1.1 is a bug.
@@ -6682,7 +8132,7 @@ ${PROG} [a-z]*: a, version 1\.2, resurrected"
${PROG} [a-z]*: use .${PROG} commit. to remove this file permanently"
dotest conflicts2-142c1 "${testcvs} -q ci -m remove-abc" \
"Removing abc;
-${TESTDIR}/cvsroot/first-dir/abc,v <-- abc
+${CVSROOT_DIRNAME}/first-dir/abc,v <-- abc
new revision: delete; previous revision: 1\.1
done"
cd ../../2/first-dir
@@ -6704,16 +8154,16 @@ ${PROG} [a-z]*: use .${PROG} commit. to remove this file permanently"
${PROG} [a-z]*: scheduling file .same\.c. for addition
${PROG} [a-z]*: use .${PROG} commit. to add these files permanently"
dotest conflicts2-142d1 "${testcvs} -q ci -m added" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/aa\.c,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/aa\.c,v
done
Checking in aa\.c;
-${TESTDIR}/cvsroot/first-dir/aa\.c,v <-- aa\.c
+${CVSROOT_DIRNAME}/first-dir/aa\.c,v <-- aa\.c
initial revision: 1\.1
done
-RCS file: ${TESTDIR}/cvsroot/first-dir/same\.c,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/same\.c,v
done
Checking in same\.c;
-${TESTDIR}/cvsroot/first-dir/same\.c,v <-- same\.c
+${CVSROOT_DIRNAME}/first-dir/same\.c,v <-- same\.c
initial revision: 1\.1
done"
cd ../../2/first-dir
@@ -6726,7 +8176,7 @@ done"
# cvs add just to get them in that habit (also, trying to implement
# the local CVS behavior for remote without the cvs add seems
# pretty difficult).
- if test "$remote" = yes; then
+ if $remote; then
dotest_fail conflicts2-142d2 "${testcvs} -q update" \
"${QUESTION} aa\.c
${QUESTION} same\.c
@@ -6746,7 +8196,7 @@ U same\.c"
File: aa\.c Status: Unresolved Conflict
Working revision: No entry for aa\.c
- Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/aa\.c,v"
+ Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/aa\.c,v"
# Could also be testing the case in which the cvs add happened
# before the commit by the other user.
@@ -6789,7 +8239,7 @@ File: aa\.c Status: Unresolved Conflict
dotest conflicts3-1 "${testcvs} -q co -l ." ''
mkdir first-dir
dotest conflicts3-2 "${testcvs} add first-dir" \
-"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
cd ..
mkdir 2; cd 2
dotest conflicts3-3 "${testcvs} -q co -l first-dir" ''
@@ -6800,16 +8250,16 @@ File: aa\.c Status: Unresolved Conflict
${PROG} [a-z]*: scheduling file .file2. for addition
${PROG} [a-z]*: use .${PROG} commit. to add these files permanently"
dotest conflicts3-5 "${testcvs} -q ci -m add-them" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done
Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
initial revision: 1\.1
done
-RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
done
Checking in file2;
-${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
+${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
initial revision: 1\.1
done"
cd ../../2/first-dir
@@ -6831,35 +8281,35 @@ ${PROG} [a-z]*: scheduling .file2. for removal
${PROG} [a-z]*: use .${PROG} commit. to remove these files permanently"
dotest conflicts3-11 "${testcvs} -q ci -m remove-them" \
"Removing file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: delete; previous revision: 1\.1
done
Removing file2;
-${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
+${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
new revision: delete; previous revision: 1\.1
done"
cd ../../1/first-dir
dotest conflicts3-12 "${testcvs} -n -q update" \
-"${PROG} [a-z]*: warning: file1 is not (any longer) pertinent
-${PROG} [a-z]*: warning: file2 is not (any longer) pertinent"
+"${PROG} [a-z]*: file1 is no longer in the repository
+${PROG} [a-z]*: file2 is no longer in the repository"
dotest conflicts3-13 "${testcvs} -q update" \
-"${PROG} [a-z]*: warning: file1 is not (any longer) pertinent
-${PROG} [a-z]*: warning: file2 is not (any longer) pertinent"
+"${PROG} [a-z]*: file1 is no longer in the repository
+${PROG} [a-z]*: file2 is no longer in the repository"
# OK, now add a directory to both working directories
# and see that CVS doesn't lose its mind.
mkdir sdir
dotest conflicts3-14 "${testcvs} add sdir" \
-"Directory ${TESTDIR}/cvsroot/first-dir/sdir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir/sdir added to the repository"
touch sdir/sfile
dotest conflicts3-14a "${testcvs} add sdir/sfile" \
"${PROG} [a-z]*: scheduling file .sdir/sfile. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest conflicts3-14b "${testcvs} -q ci -m add" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/sdir/sfile,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/sfile,v
done
Checking in sdir/sfile;
-${TESTDIR}/cvsroot/first-dir/sdir/sfile,v <-- sfile
+${CVSROOT_DIRNAME}/first-dir/sdir/sfile,v <-- sfile
initial revision: 1\.1
done"
@@ -6876,7 +8326,7 @@ done"
# that sdir is even a directory (stat'ing everything would be
# too slow). The remote behavior makes more sense to me (but
# would this affect other cases?).
- if test "$remote" = yes; then
+ if $remote; then
dotest conflicts3-15 "${testcvs} -q update" \
"${QUESTION} sdir"
else
@@ -6923,16 +8373,9 @@ ${PROG} [a-z]*: ignoring first-dir/sdir (CVS/Entries missing)"
dotest conflicts3-21 "${testcvs} -q update -d sdir" "U sdir/sfile"
rm -r sdir/CVS
dotest conflicts3-22 "${testcvs} -q update" "${QUESTION} sdir"
- if test "x$remote" = xyes; then
- # It isn't particularly swift that CVS prints this
- # "cannot open CVS/Entries" where it has already printed
- # "? sdir". At least I don't think so. But do note: (1)
- # non-fatal error, and (2) tells us which directory has
- # the problem.
+ if $remote; then
dotest_fail conflicts3-23 "${testcvs} -q update -PdA" \
"${QUESTION} sdir
-${PROG} update: in directory sdir:
-${PROG} update: cannot open CVS/Entries for reading: No such file or directory
${PROG} update: move away sdir/sfile; it is in the way
C sdir/sfile"
else
@@ -6954,22 +8397,13 @@ C sdir/sfile"
${PROG} [a-z]*: use .${PROG} commit. to remove this file permanently"
dotest conflicts3-26 "${testcvs} ci -m remove sdir/sfile" \
"Removing sdir/sfile;
-${TESTDIR}/cvsroot/first-dir/sdir/sfile,v <-- sfile
+${CVSROOT_DIRNAME}/first-dir/sdir/sfile,v <-- sfile
new revision: delete; previous revision: 1\.1
done"
rm -r sdir/CVS
dotest conflicts3-27 "${testcvs} -q update" "${QUESTION} sdir"
- if test "x$remote" = xyes; then
- # Regarding "cannot open CVS/Entries", see comments at
- # conflicts3-23.
- dotest conflicts3-28 "${testcvs} -q update -PdA" \
-"${QUESTION} sdir
-${PROG} update: in directory sdir:
-${PROG} update: cannot open CVS/Entries for reading: No such file or directory"
- else
- dotest conflicts3-28 "${testcvs} -q update -PdA" \
+ dotest conflicts3-28 "${testcvs} -q update -PdA" \
"${QUESTION} sdir"
- fi
cd ../..
@@ -6983,17 +8417,17 @@ ${PROG} update: cannot open CVS/Entries for reading: No such file or directory"
dotest clean-1 "${testcvs} -q co -l ." ''
mkdir first-dir
dotest clean-2 "${testcvs} add first-dir" \
-"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
cd first-dir
echo "The usual boring test text." > cleanme.txt
dotest clean-3 "${testcvs} add cleanme.txt" \
"${PROG} [a-z]*: scheduling file .cleanme\.txt. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest clean-4 "${testcvs} -q ci -m clean-3" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/cleanme\.txt,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/cleanme\.txt,v
done
Checking in cleanme\.txt;
-${TESTDIR}/cvsroot/first-dir/cleanme\.txt,v <-- cleanme\.txt
+${CVSROOT_DIRNAME}/first-dir/cleanme\.txt,v <-- cleanme\.txt
initial revision: 1\.1
done"
# Okay, preparation is done, now test.
@@ -7027,10 +8461,38 @@ U cleanme\.txt"
"The usual boring test text\.
bluegill"
+ # Now try with conflicts
+ cd ..
+ dotest clean-15 "${testcvs} -q co -d second-dir first-dir" \
+'U second-dir/cleanme\.txt'
+ cd second-dir
+ echo "conflict test" >> cleanme.txt
+ dotest clean-16 "${testcvs} -q ci -m." \
+"Checking in cleanme\.txt;
+${CVSROOT_DIRNAME}/first-dir/cleanme\.txt,v <-- cleanme\.txt
+new revision: 1\.2; previous revision: 1\.1
+done"
+ cd ../first-dir
+ echo "fish" >> cleanme.txt
+ dotest clean-17 "${testcvs} -nq update" \
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/cleanme\.txt,v
+retrieving revision 1\.1
+retrieving revision 1\.2
+Merging differences between 1\.1 and 1\.2 into cleanme\.txt
+rcsmerge: warning: conflicts during merge
+${PROG} [a-z]*: conflicts found in cleanme\.txt
+C cleanme\.txt"
+ dotest clean-18 "${testcvs} -q update -C" \
+"(Locally modified cleanme\.txt moved to \.#cleanme\.txt\.1\.1)
+U cleanme\.txt"
+ dotest clean-19 "cat .#cleanme.txt.1.1" \
+"The usual boring test text\.
+fish"
+
# Done. Clean up.
cd ../..
rm -rf 1
- rm -rf ${TESTDIR}/cvsroot/first-dir
+ rm -rf ${CVSROOT_DIRNAME}/first-dir
;;
modules)
@@ -7069,7 +8531,7 @@ U CVSROOT/verifymsg'
echo "# made a change" >>CVSROOT/modules
dotest modules-1d "${testcvs} -q ci -m add-modules" \
"Checking in CVSROOT/modules;
-${TESTDIR}/cvsroot/CVSROOT/modules,v <-- modules
+${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
done
${PROG} [a-z]*: Rebuilding administrative file database"
@@ -7093,7 +8555,7 @@ U CVSROOT/verifymsg'
echo "# made a change" >>CVSROOT/modules
dotest modules-2d "${testcvs} -q ci -m add-modules" \
"Checking in CVSROOT/modules;
-${TESTDIR}/cvsroot/CVSROOT/modules,v <-- modules
+${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
done
${PROG} [a-z]*: Rebuilding administrative file database"
@@ -7120,7 +8582,7 @@ U CVSROOT/verifymsg'
echo "# made a change" >>CVSROOT/modules
dotest modules-3g "${testcvs} -q ci -m add-modules" \
"Checking in CVSROOT/modules;
-${TESTDIR}/cvsroot/CVSROOT/modules,v <-- modules
+${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
done
${PROG} [a-z]*: Rebuilding administrative file database"
@@ -7142,12 +8604,12 @@ ${PROG} [a-z]*: Rebuilding administrative file database"
cd first-dir
mkdir subdir
dotest modules-143a "${testcvs} add subdir" \
-"Directory ${TESTDIR}/cvsroot/first-dir/subdir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir/subdir added to the repository"
cd subdir
mkdir ssdir
dotest modules-143b "${testcvs} add ssdir" \
-"Directory ${TESTDIR}/cvsroot/first-dir/subdir/ssdir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir/subdir/ssdir added to the repository"
touch a b
@@ -7159,16 +8621,16 @@ ${PROG} [a-z]*: use .${PROG} commit. to add these files permanently"
dotest modules-145 "${testcvs} ci -m added" \
"${PROG} [a-z]*: Examining .
${PROG} [a-z]*: Examining ssdir
-RCS file: ${TESTDIR}/cvsroot/first-dir/subdir/a,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/subdir/a,v
done
Checking in a;
-${TESTDIR}/cvsroot/first-dir/subdir/a,v <-- a
+${CVSROOT_DIRNAME}/first-dir/subdir/a,v <-- a
initial revision: 1\.1
done
-RCS file: ${TESTDIR}/cvsroot/first-dir/subdir/b,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/subdir/b,v
done
Checking in b;
-${TESTDIR}/cvsroot/first-dir/subdir/b,v <-- b
+${CVSROOT_DIRNAME}/first-dir/subdir/b,v <-- b
initial revision: 1\.1
done"
@@ -7208,7 +8670,7 @@ bogusalias first-dir/subdir/a -a
EOF
dotest modules-148 "${testcvs} ci -m 'add modules' CVSROOT/modules" \
"Checking in CVSROOT/modules;
-${TESTDIR}/cvsroot/CVSROOT/modules,v <-- modules
+${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
done
${PROG} [a-z]*: Rebuilding administrative file database"
@@ -7337,16 +8799,16 @@ U first-dir/subdir/b"
'"${PROG}"' [a-z]*: scheduling file `file2'\'' for addition
'"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to add these files permanently'
dotest modules-155c3 "${testcvs} -q ci -m add-it" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done
Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
initial revision: 1\.1
done
-RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
done
Checking in file2;
-${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
+${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
initial revision: 1\.1
done"
@@ -7363,7 +8825,7 @@ U first-dir/file2"
"${PROG} [a-z]*: use .${PROG} commit. to remove this file permanently"
dotest modules-155c7 "${testcvs} -q ci -m remove-it" \
"Removing file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: delete; previous revision: 1\.1
done"
cd ..
@@ -7385,19 +8847,19 @@ U first-dir/file2"
mkdir first-dir second-dir third-dir
dotest modules2-setup-2 \
"${testcvs} add first-dir second-dir third-dir" \
-"Directory ${TESTDIR}/cvsroot/first-dir added to the repository
-Directory ${TESTDIR}/cvsroot/second-dir added to the repository
-Directory ${TESTDIR}/cvsroot/third-dir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository
+Directory ${CVSROOT_DIRNAME}/second-dir added to the repository
+Directory ${CVSROOT_DIRNAME}/third-dir added to the repository"
cd third-dir
touch file3
dotest modules2-setup-3 "${testcvs} add file3" \
"${PROG} [a-z]*: scheduling file .file3. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest modules2-setup-4 "${testcvs} -q ci -m add file3" \
-"RCS file: ${TESTDIR}/cvsroot/third-dir/file3,v
+"RCS file: ${CVSROOT_DIRNAME}/third-dir/file3,v
done
Checking in file3;
-${TESTDIR}/cvsroot/third-dir/file3,v <-- file3
+${CVSROOT_DIRNAME}/third-dir/file3,v <-- file3
initial revision: 1\.1
done"
cd ../..
@@ -7409,15 +8871,19 @@ done"
dotest modules2-1 "${testcvs} -q co CVSROOT/modules" \
'U CVSROOT/modules'
cd CVSROOT
- echo 'ampermodule &first-dir &second-dir' > modules
- echo 'combmodule third-dir file3 &first-dir' >> modules
- echo 'ampdirmod -d newdir &first-dir &second-dir' >> modules
- echo 'badmod -d newdir' >> modules
+ cat >> modules << EOF
+ampermodule &first-dir &second-dir
+combmodule third-dir file3 &first-dir
+ampdirmod -d newdir &first-dir &second-dir
+badmod -d newdir
+messymod first-dir &messymodchild
+messymodchild -d sdir/child second-dir
+EOF
# Depending on whether the user also ran the modules test
# we will be checking in revision 1.2 or 1.3.
dotest modules2-2 "${testcvs} -q ci -m add-modules" \
"Checking in modules;
-${TESTDIR}/cvsroot/CVSROOT/modules,v <-- modules
+${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
done
${PROG} [a-z]*: Rebuilding administrative file database"
@@ -7445,6 +8911,26 @@ EOF
cd ..
+ # There used to be a nasty-hack that made CVS skip creation of the
+ # module dir (in this case ampermodule) when -n was specified
+ dotest modules2-ampermod-1 "${testcvs} -q co -n ampermodule" ''
+ dotest modules2-ampermod-2 "test -d ampermodule/first-dir" ''
+ dotest modules2-ampermod-3 "test -d ampermodule/second-dir" ''
+
+ # Test release of a module
+ if echo yes |${testcvs} release -d ampermodule >>${LOGFILE}; then
+ pass modules2-ampermod-release-1
+ else
+ fail modules2-ampermod-release-1
+ fi
+ dotest_fail modules2-ampermod-release-2 "test -d ampermodule" ''
+
+ # and the '-n' test again, but in conjunction with '-d'
+ dotest modules2-ampermod-4 "${testcvs} -q co -n -d newname ampermodule" ''
+ dotest modules2-ampermod-5 "test -d newname/first-dir" ''
+ dotest modules2-ampermod-6 "test -d newname/second-dir" ''
+ rm -rf newname
+
# Now we create another directory named first-dir and make
# sure that CVS doesn't get them mixed up.
mkdir first-dir
@@ -7468,12 +8954,12 @@ ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
A first-dir/amper1
${PROG} [a-z]*: Updating second-dir"
- if test "$remote" = no; then
+ if $remote; then
dotest modules2-13 "${testcvs} -q ci -m add-it ampermodule" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/amper1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/amper1,v
done
Checking in ampermodule/first-dir/amper1;
-${TESTDIR}/cvsroot/first-dir/amper1,v <-- amper1
+${CVSROOT_DIRNAME}/first-dir/amper1,v <-- amper1
initial revision: 1\.1
done"
else
@@ -7481,10 +8967,10 @@ done"
# Work around this bug.
cd ampermodule
dotest modules2-13 "${testcvs} -q ci -m add-it" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/amper1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/amper1,v
done
Checking in first-dir/amper1;
-${TESTDIR}/cvsroot/first-dir/amper1,v <-- amper1
+${CVSROOT_DIRNAME}/first-dir/amper1,v <-- amper1
initial revision: 1\.1
done"
cd ..
@@ -7529,13 +9015,61 @@ U first-dir/amper1"
U first-dir/amper1
${PROG} [a-z]*: Updating second-dir"
dotest modules2-21 "test -f newdir/first-dir/amper1" ""
- dotest_fail modules2-22 "${testcvs} co badmod" \
+ dotest modules2-22 "test -d newdir/second-dir" ""
+ dotest_fail modules2-23 "${testcvs} co badmod" \
"${PROG} [a-z]*: modules file missing directory for module badmod" \
"${PROG} [a-z]*: modules file missing directory for module badmod
${PROG} \[[a-z]* aborted\]: cannot expand modules"
cd ..
rm -r 1
+ # Confirm that a rename with added depth nested in an ampersand
+ # module works.
+ mkdir 1; cd 1
+ dotest modules2-nestedrename-1 "${testcvs} -q co messymod" \
+"U messymod/amper1"
+ dotest modules2-nestedrename-2 "test -d messymod/sdir" ''
+ dotest modules2-nestedrename-3 "test -d messymod/sdir/CVS" ''
+ dotest modules2-nestedrename-4 "test -d messymod/sdir/child" ''
+ dotest modules2-nestedrename-5 "test -d messymod/sdir/child/CVS" ''
+ cd ..; rm -r 1
+
+ # FIXME: client/server has a bug. It should be working like a local
+ # repository in this case, but fails to check out the second module
+ # in the list when a branch is specified.
+ mkdir 1; cd 1
+ dotest modules2-ampertag-setup-1 \
+"${testcvs} -Q rtag tag first-dir second-dir third-dir" \
+''
+ dotest modules2-ampertag-1 "${testcvs} -q co -rtag ampermodule" \
+"U first-dir/amper1"
+ if $remote; then
+ dotest_fail modules2-ampertag-2 "test -d ampermodule/second-dir" ''
+ dotest_fail modules2-ampertag-3 "test -d ampermodule/second-dir/CVS" ''
+ else
+ dotest modules2-ampertag-2 "test -d ampermodule/second-dir" ''
+ dotest modules2-ampertag-3 "test -d ampermodule/second-dir/CVS" ''
+ fi
+ cd ..; rm -r 1
+
+ # Test for tag files when an ampermod is renamed with more path
+ # elements than it started with.
+ #
+ # FIXME: This is currently broken in the remote case, possibly only
+ # because the messymodchild isn't being checked out at all.
+ mkdir 1; cd 1
+# dotest modules2-tagfiles-setup-1 \
+#"${testcvs} -Q rtag -b branch first-dir second-dir" \
+#''
+ dotest modules2-tagfiles-1 "${testcvs} -q co -rtag messymod" \
+"U messymod/amper1"
+ if $remote; then
+ dotest_fail modules2-tagfiles-2r "test -d messymod/sdir" ''
+ else
+ dotest modules2-tagfiles-2 "cat messymod/sdir/CVS/Tag" 'Ttag'
+ fi
+ cd ..; rm -r 1
+
# Test that CVS gives an error if one combines -a with
# other options.
# Probably would be better to break this out into a separate
@@ -7548,7 +9082,7 @@ ${PROG} \[[a-z]* aborted\]: cannot expand modules"
echo 'aliasopt -a -d onedir first-dir' >modules
dotest modules2-a0 "${testcvs} -q ci -m add-modules" \
"Checking in modules;
-${TESTDIR}/cvsroot/CVSROOT/modules,v <-- modules
+${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
done
${PROG} [a-z]*: Rebuilding administrative file database"
@@ -7557,11 +9091,9 @@ ${PROG} [a-z]*: Rebuilding administrative file database"
"${PROG} [a-z]*: -a cannot be specified in the modules file along with other options" \
"${PROG} [a-z]*: -a cannot be specified in the modules file along with other options
${PROG} \[[a-z]* aborted\]: cannot expand modules"
+ cd ..; rm -r 1
# Clean up.
- rm -r CVSROOT
- cd ..
- rm -r 1
rm -rf ${CVSROOT_DIRNAME}/first-dir
rm -rf ${CVSROOT_DIRNAME}/second-dir
rm -rf ${CVSROOT_DIRNAME}/third-dir
@@ -7577,7 +9109,7 @@ ${PROG} \[[a-z]* aborted\]: cannot expand modules"
dotest modules3-0 "${testcvs} -q co -l ." ''
mkdir first-dir
dotest modules3-1 "${testcvs} add first-dir" \
-"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
cd first-dir
echo file1 >file1
@@ -7585,10 +9117,10 @@ ${PROG} \[[a-z]* aborted\]: cannot expand modules"
"${PROG}"' [a-z]*: scheduling file `file1'\'' for addition
'"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to add this file permanently'
dotest modules3-3 "${testcvs} -q ci -m add-it" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done
Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
initial revision: 1\.1
done"
cd ..
@@ -7607,7 +9139,7 @@ another/path/test -d another/path/test first-dir
EOF
dotest modules3-5 "${testcvs} -q ci -m add-modules" \
"Checking in modules;
-${TESTDIR}/cvsroot/CVSROOT/modules,v <-- modules
+${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
done
${PROG} [a-z]*: Rebuilding administrative file database"
@@ -7627,8 +9159,8 @@ ${PROG} [a-z]*: Rebuilding administrative file database"
# considering this is a documented technique and everything.
dotest modules3-7a \
"${testcvs} import -m add-dirs second-dir tag1 tag2" \
-"${PROG} [a-z]*: Importing ${TESTDIR}/cvsroot/second-dir/suba
-${PROG} [a-z]*: Importing ${TESTDIR}/cvsroot/second-dir/suba/subb
+"${PROG} [a-z]*: Importing ${CVSROOT_DIRNAME}/second-dir/suba
+${PROG} [a-z]*: Importing ${CVSROOT_DIRNAME}/second-dir/suba/subb
No conflicts created by this import" "
No conflicts created by this import"
@@ -7640,15 +9172,15 @@ ${PROG} [a-z]*: Updating second-dir/suba
${PROG} [a-z]*: Updating second-dir/suba/subb" \
"${PROG} server: Updating second-dir"
- if test "x$remote" = xyes; then
+ if $remote; then
cd second-dir
mkdir suba
dotest modules3-7-workaround1 "${testcvs} add suba" \
-"Directory ${TESTDIR}/cvsroot/second-dir/suba added to the repository"
+"Directory ${CVSROOT_DIRNAME}/second-dir/suba added to the repository"
cd suba
mkdir subb
dotest modules3-7-workaround2 "${testcvs} add subb" \
-"Directory ${TESTDIR}/cvsroot/second-dir/suba/subb added to the repository"
+"Directory ${CVSROOT_DIRNAME}/second-dir/suba/subb added to the repository"
cd ../..
fi
@@ -7658,10 +9190,10 @@ ${PROG} [a-z]*: Updating second-dir/suba/subb" \
"${PROG} [a-z]*: scheduling file .fileb. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest modules3-7d "${testcvs} -q ci -m add-it" \
-"RCS file: ${TESTDIR}/cvsroot/second-dir/suba/subb/fileb,v
+"RCS file: ${CVSROOT_DIRNAME}/second-dir/suba/subb/fileb,v
done
Checking in fileb;
-${TESTDIR}/cvsroot/second-dir/suba/subb/fileb,v <-- fileb
+${CVSROOT_DIRNAME}/second-dir/suba/subb/fileb,v <-- fileb
initial revision: 1\.1
done"
cd ../../..
@@ -7686,7 +9218,7 @@ done"
# While we are doing things like twisted uses of '/' (e.g.
# modules3-12), try this one.
- if test "x$remote" = xyes; then
+ if $remote; then
dotest_fail modules3-11b \
"${testcvs} -q update ${TESTDIR}/1/src/sub1/sub2/sub3/dir/file1" \
"absolute pathname .${TESTDIR}/1/src/sub1/sub2/sub3/dir. illegal for server"
@@ -7708,24 +9240,24 @@ done"
# instead of a real error).
# I'm tempted to just make it a fatal error to have '/' in a
# module name. But see comments at modules3-16.
- if test "x$remote" = xno; then
- mkdir 1; cd 1
- dotest modules3-12 "${testcvs} -q co path/in/modules" \
+ if $remote; then :; else
+ mkdir 1; cd 1
+ dotest modules3-12 "${testcvs} -q co path/in/modules" \
"U first-dir/file1"
- dotest modules3-13 "test -f path/in/modules/first-dir/file1" ''
- cd ..; rm -r 1
+ dotest modules3-13 "test -f path/in/modules/first-dir/file1" ''
+ cd ..; rm -r 1
+ fi # end of tests skipped for remote
- # Now here is where it gets seriously bogus.
+ # Now here is where it used to get seriously bogus.
mkdir 1; cd 1
dotest modules3-14 \
"${testcvs} -q rtag tag1 path/in/modules" ''
- # CVS creates this even though rtag should *never* affect
+ # CVS used to create this even though rtag should *never* affect
# the directory current when it is called!
- dotest modules3-15 "test -d path/in/modules" ''
- # Just for trivia's sake, rdiff is not similarly vulnerable
- # because it passes 0 for run_module_prog to do_module.
+ dotest_fail modules3-15 "test -d path/in/modules" ''
+ # Just for trivia's sake, rdiff was not similarly vulnerable
+ # because it passed 0 for run_module_prog to do_module.
cd ..; rm -r 1
- fi # end of tests skipped for remote
# Some people seem to want this to work. I still suspect there
# are dark corners in slashes in module names. This probably wants
@@ -7750,12 +9282,12 @@ done"
dotest modules4-1 "${testcvs} -q co -l ." ''
mkdir first-dir
dotest modules4-2 "${testcvs} add first-dir" \
-"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
cd first-dir
mkdir subdir
dotest modules4-3 "${testcvs} add subdir" \
-"Directory ${TESTDIR}/cvsroot/first-dir/subdir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir/subdir added to the repository"
echo file1 > file1
dotest modules4-4 "${testcvs} add file1" \
@@ -7768,16 +9300,16 @@ done"
'"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to add this file permanently'
dotest modules4-6 "${testcvs} -q ci -m add-it" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done
Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
initial revision: 1\.1
done
-RCS file: ${TESTDIR}/cvsroot/first-dir/subdir/file2,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/subdir/file2,v
done
Checking in subdir/file2;
-${TESTDIR}/cvsroot/first-dir/subdir/file2,v <-- file2
+${CVSROOT_DIRNAME}/first-dir/subdir/file2,v <-- file2
initial revision: 1\.1
done"
@@ -7793,7 +9325,7 @@ somewhat -a first-dir !first-dir/subdir
EOF
dotest modules4-8 "${testcvs} -q ci -m add-modules" \
"Checking in modules;
-${TESTDIR}/cvsroot/CVSROOT/modules,v <-- modules
+${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
done
${PROG} [a-z]*: Rebuilding administrative file database"
@@ -7811,7 +9343,11 @@ U first-dir/subdir/file2"
dotest_fail modules4-11 "test -d first-dir/subdir" ''
rm -r first-dir
- if test "$remote" = no; then
+ if $remote; then
+ # But remote seems to do it the other way.
+ dotest modules4-11a "${testcvs} -q co somewhat" "U first-dir/file1"
+ dotest_fail modules4-11b "test -d first-dir/subdir" ''
+ else
# This is strange behavior, in that the order of the
# "!first-dir/subdir" and "first-dir" matter, and it isn't
# clear that they should. I suspect it is long-standing
@@ -7819,10 +9355,6 @@ U first-dir/subdir/file2"
dotest modules4-11a "${testcvs} -q co somewhat" \
"U first-dir/file1
U first-dir/subdir/file2"
- else
- # But remote seems to do it the other way.
- dotest modules4-11a "${testcvs} -q co somewhat" "U first-dir/file1"
- dotest_fail modules4-11b "test -d first-dir/subdir" ''
fi
rm -r first-dir
@@ -7835,7 +9367,7 @@ ${PROG} [a-z]*: Ignoring first-dir/subdir"
cd 1/first-dir/subdir
dotest modules4-13 "${testcvs} log file2" "
-RCS file: ${TESTDIR}/cvsroot/first-dir/subdir/file2,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/subdir/file2,v
Working file: file2
head: 1\.1
branch:
@@ -7867,11 +9399,11 @@ add-it
cd first-dir
mkdir subdir
dotest modules5-2 "${testcvs} add subdir" \
-"Directory ${TESTDIR}/cvsroot/first-dir/subdir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir/subdir added to the repository"
cd subdir
mkdir ssdir
dotest modules5-3 "${testcvs} add ssdir" \
-"Directory ${TESTDIR}/cvsroot/first-dir/subdir/ssdir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir/subdir/ssdir added to the repository"
touch a b
dotest modules5-4 "${testcvs} add a b" \
"${PROG} [a-z]*: scheduling file .a. for addition
@@ -7881,16 +9413,16 @@ ${PROG} [a-z]*: use .${PROG} commit. to add these files permanently"
dotest modules5-5 "${testcvs} ci -m added" \
"${PROG} [a-z]*: Examining .
${PROG} [a-z]*: Examining ssdir
-RCS file: ${TESTDIR}/cvsroot/first-dir/subdir/a,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/subdir/a,v
done
Checking in a;
-${TESTDIR}/cvsroot/first-dir/subdir/a,v <-- a
+${CVSROOT_DIRNAME}/first-dir/subdir/a,v <-- a
initial revision: 1\.1
done
-RCS file: ${TESTDIR}/cvsroot/first-dir/subdir/b,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/subdir/b,v
done
Checking in b;
-${TESTDIR}/cvsroot/first-dir/subdir/b,v <-- b
+${CVSROOT_DIRNAME}/first-dir/subdir/b,v <-- b
initial revision: 1\.1
done"
@@ -7927,7 +9459,7 @@ EOF
dotest modules5-7 "${testcvs} ci -m 'add modules' CVSROOT/modules" \
"" \
"Checking in CVSROOT/modules;
-${TESTDIR}/cvsroot/CVSROOT/modules,v <-- modules
+${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
done
${PROG} [a-z]*: Rebuilding administrative file database"
@@ -7935,7 +9467,7 @@ ${PROG} [a-z]*: Rebuilding administrative file database"
cd ..
rm -rf first-dir
# Test that real modules check out to realmodule/a, not subdir/a.
- if test "$remote" = "yes"; then
+ if $remote; then
dotest modules5-8 "${testcvs} co realmodule" \
"U realmodule/a
${PROG} [a-z]*: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .realmodule..
@@ -7950,7 +9482,7 @@ args: realmodule"
fi
dotest modules5-9 "test -d realmodule && test -f realmodule/a" ""
dotest_fail modules5-10 "test -f realmodule/b" ""
- if test "$remote" = "yes"; then
+ if $remote; then
dotest modules5-11 "${testcvs} -q co realmodule" \
"checkout script invoked in .*
args: realmodule"
@@ -7990,8 +9522,10 @@ args: ${CVSROOT_DIRNAME}/first-dir/subdir"
Are you sure you want to release (and delete) directory .realmodule.: "
dotest modules5-15 "${testcvs} -q rtag -Dnow MYTAG realmodule" \
"tag script invoked in ${TESTDIR}/1
+args: realmodule MYTAG" \
+"tag script invoked in $tmp/cvs-serv[0-9a-z]*
args: realmodule MYTAG"
- if test "$remote" = "yes"; then
+ if $remote; then
dotest modules5-16 "${testcvs} -q export -r MYTAG realmodule" \
"U realmodule/a
export script invoked in .*
@@ -8010,7 +9544,7 @@ args: realmodule"
# FIXCVS: The client gets confused in these cases and tries to
# store the scripts in the wrong places.
- if test "$remote" != "yes"; then
+ if $remote; then :; else
# Now test the ability to check out a single file from a directory
dotest modules5-18 "${testcvs} co dirmodule/a" \
"U dirmodule/a
@@ -8149,7 +9683,7 @@ $PROG [a-z]*: Rebuilding administrative file database"
echo "TopLevelAdmin=yes" >config
dotest cvsadm-setup-2 "${testcvs} -q ci -m yes-top-level" \
"Checking in config;
-${TESTDIR}/cvsroot/CVSROOT/config,v <-- config
+${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
done
${PROG} [a-z]*: Rebuilding administrative file database"
@@ -8222,12 +9756,12 @@ ${PROG} [a-z]*: Examining CVSROOT"
mkdir mod2-2
mkdir mod2-2/sub2-2
dotest cvsadm-2a "${testcvs} add mod1 mod1-2 mod2 mod2/sub2 mod2-2 mod2-2/sub2-2" \
-"Directory ${TESTDIR}/cvsroot/mod1 added to the repository
-Directory ${TESTDIR}/cvsroot/mod1-2 added to the repository
-Directory ${TESTDIR}/cvsroot/mod2 added to the repository
-Directory ${TESTDIR}/cvsroot/mod2/sub2 added to the repository
-Directory ${TESTDIR}/cvsroot/mod2-2 added to the repository
-Directory ${TESTDIR}/cvsroot/mod2-2/sub2-2 added to the repository"
+"Directory ${CVSROOT_DIRNAME}/mod1 added to the repository
+Directory ${CVSROOT_DIRNAME}/mod1-2 added to the repository
+Directory ${CVSROOT_DIRNAME}/mod2 added to the repository
+Directory ${CVSROOT_DIRNAME}/mod2/sub2 added to the repository
+Directory ${CVSROOT_DIRNAME}/mod2-2 added to the repository
+Directory ${CVSROOT_DIRNAME}/mod2-2/sub2-2 added to the repository"
# Populate the directories for the halibut
echo "file1" > mod1/file1
@@ -8327,7 +9861,7 @@ U dir2d1/sub2d1/file1"
dotest cvsadm-7b "cat CVS/Repository" \
"${AREP}\."
dotest cvsadm-7d "cat dir2d1/CVS/Repository" \
-"${AREP}CVSROOT/Emptydir"
+"${AREP}\."
dotest cvsadm-7f "cat dir2d1/sub2d1/CVS/Repository" \
"${AREP}mod1"
rm -rf CVS dir2d1
@@ -8338,7 +9872,7 @@ U dir2d2/sub2d2/file2"
dotest cvsadm-8b "cat CVS/Repository" \
"${AREP}\."
dotest cvsadm-8d "cat dir2d2/CVS/Repository" \
-"${AREP}CVSROOT/Emptydir"
+"${AREP}mod2"
dotest cvsadm-8f "cat dir2d2/sub2d2/CVS/Repository" \
"${AREP}mod2/sub2"
rm -rf CVS dir2d2
@@ -8428,7 +9962,7 @@ U dir2d1/sub2d1/file1"
"${AREP}mod1"
# the usual for 2d1mod
dotest cvsadm-13f "cat dir2d1/CVS/Repository" \
-"${AREP}CVSROOT/Emptydir"
+"${AREP}."
dotest cvsadm-13h "cat dir2d1/sub2d1/CVS/Repository" \
"${AREP}mod1"
rm -rf CVS 1mod dir2d1
@@ -8446,7 +9980,7 @@ U dir2d2/sub2d2/file2"
"${AREP}mod1"
# the usual for 2d2mod
dotest cvsadm-14f "cat dir2d2/CVS/Repository" \
-"${AREP}CVSROOT/Emptydir"
+"${AREP}mod2"
dotest cvsadm-14h "cat dir2d2/sub2d2/CVS/Repository" \
"${AREP}mod2/sub2"
rm -rf CVS 1mod dir2d2
@@ -8516,7 +10050,7 @@ U dir2d1/sub2d1/file1"
"${AREP}mod2/sub2"
# the usual for 2d1mod
dotest cvsadm-18f "cat dir2d1/CVS/Repository" \
-"${AREP}CVSROOT/Emptydir"
+"${AREP}."
dotest cvsadm-18h "cat dir2d1/sub2d1/CVS/Repository" \
"${AREP}mod1"
rm -rf CVS 2mod dir2d1
@@ -8534,7 +10068,7 @@ U dir2d2/sub2d2/file2"
"${AREP}mod2/sub2"
# the usual for 2d2mod
dotest cvsadm-19f "cat dir2d2/CVS/Repository" \
-"${AREP}CVSROOT/Emptydir"
+"${AREP}mod2"
dotest cvsadm-19h "cat dir2d2/sub2d2/CVS/Repository" \
"${AREP}mod2/sub2"
rm -rf CVS 2mod dir2d2
@@ -8587,7 +10121,7 @@ U dir2d1/sub2d1/file1"
"${AREP}mod1"
# the usual for 2d1mod
dotest cvsadm-22f "cat dir2d1/CVS/Repository" \
-"${AREP}CVSROOT/Emptydir"
+"${AREP}\."
dotest cvsadm-22h "cat dir2d1/sub2d1/CVS/Repository" \
"${AREP}mod1"
rm -rf CVS dir1d1 dir2d1
@@ -8605,7 +10139,7 @@ U dir2d2/sub2d2/file2"
"${AREP}mod1"
# the usual for 2d2mod
dotest cvsadm-23f "cat dir2d2/CVS/Repository" \
-"${AREP}CVSROOT/Emptydir"
+"${AREP}mod2"
dotest cvsadm-23h "cat dir2d2/sub2d2/CVS/Repository" \
"${AREP}mod2/sub2"
rm -rf CVS dir1d1 dir2d2
@@ -8642,7 +10176,7 @@ U dir2d1/sub2d1/file1"
"${AREP}mod2/sub2"
# the usual for 2d1mod
dotest cvsadm-25f "cat dir2d1/CVS/Repository" \
-"${AREP}CVSROOT/Emptydir"
+"${AREP}\."
dotest cvsadm-25h "cat dir2d1/sub2d1/CVS/Repository" \
"${AREP}mod1"
rm -rf CVS dir1d2 dir2d1
@@ -8660,7 +10194,7 @@ U dir2d2/sub2d2/file2"
"${AREP}mod2/sub2"
# the usual for 2d2mod
dotest cvsadm-26f "cat dir2d2/CVS/Repository" \
-"${AREP}CVSROOT/Emptydir"
+"${AREP}mod2"
dotest cvsadm-26h "cat dir2d2/sub2d2/CVS/Repository" \
"${AREP}mod2/sub2"
rm -rf CVS dir1d2 dir2d2
@@ -8678,12 +10212,12 @@ U dir2d1-2/sub2d1-2/file1-2"
"${AREP}\."
# the usual for 2d1mod
dotest cvsadm-27d "cat dir2d1/CVS/Repository" \
-"${AREP}CVSROOT/Emptydir"
+"${AREP}\."
dotest cvsadm-27f "cat dir2d1/sub2d1/CVS/Repository" \
"${AREP}mod1"
# the usual for 2d1mod
dotest cvsadm-27h "cat dir2d1-2/CVS/Repository" \
-"${AREP}CVSROOT/Emptydir"
+"${AREP}\."
dotest cvsadm-27j "cat dir2d1-2/sub2d1-2/CVS/Repository" \
"${AREP}mod1-2"
rm -rf CVS dir2d1 dir2d1-2
@@ -8698,12 +10232,12 @@ U dir2d2/sub2d2/file2"
"${AREP}\."
# the usual for 2d1mod
dotest cvsadm-28d "cat dir2d1/CVS/Repository" \
-"${AREP}CVSROOT/Emptydir"
+"${AREP}\."
dotest cvsadm-28f "cat dir2d1/sub2d1/CVS/Repository" \
"${AREP}mod1"
# the usual for 2d2mod
dotest cvsadm-28h "cat dir2d2/CVS/Repository" \
-"${AREP}CVSROOT/Emptydir"
+"${AREP}mod2"
dotest cvsadm-28j "cat dir2d2/sub2d2/CVS/Repository" \
"${AREP}mod2/sub2"
rm -rf CVS dir2d1 dir2d2
@@ -8721,12 +10255,12 @@ U dir2d2-2/sub2d2-2/file2-2"
"${AREP}\."
# the usual for 2d2mod
dotest cvsadm-29d "cat dir2d2/CVS/Repository" \
-"${AREP}CVSROOT/Emptydir"
+"${AREP}mod2"
dotest cvsadm-29f "cat dir2d2/sub2d2/CVS/Repository" \
"${AREP}mod2/sub2"
# the usual for 2d2mod
dotest cvsadm-29h "cat dir2d2-2/CVS/Repository" \
-"${AREP}CVSROOT/Emptydir"
+"${AREP}mod2-2"
dotest cvsadm-29j "cat dir2d2-2/sub2d2-2/CVS/Repository" \
"${AREP}mod2-2/sub2-2"
rm -rf CVS dir2d2 dir2d2-2
@@ -8885,7 +10419,7 @@ U dir/dir2d1/sub2d1/file1"
"${AREP}mod1"
# the usual for 2d1mod
dotest cvsadm-1d13h "cat dir/dir2d1/CVS/Repository" \
-"${AREP}CVSROOT/Emptydir"
+"${AREP}\."
dotest cvsadm-1d13j "cat dir/dir2d1/sub2d1/CVS/Repository" \
"${AREP}mod1"
rm -rf CVS dir
@@ -8905,7 +10439,7 @@ U dir/dir2d2/sub2d2/file2"
"${AREP}mod1"
# the usual for 2d2mod
dotest cvsadm-1d14h "cat dir/dir2d2/CVS/Repository" \
-"${AREP}CVSROOT/Emptydir"
+"${AREP}mod2"
dotest cvsadm-1d14j "cat dir/dir2d2/sub2d2/CVS/Repository" \
"${AREP}mod2/sub2"
rm -rf CVS dir
@@ -8922,7 +10456,7 @@ U dir/2mod-2/file2-2"
"${AREP}\."
# the usual for the dir level
dotest cvsadm-1d15d "cat dir/CVS/Repository" \
-"${AREP}\."
+"${AREP}mod2"
# the usual for 2mod
dotest cvsadm-1d15f "cat dir/2mod/CVS/Repository" \
"${AREP}mod2/sub2"
@@ -8940,7 +10474,7 @@ U dir/dir1d1/file1"
"${AREP}\."
# the usual for the dir level
dotest cvsadm-1d16d "cat dir/CVS/Repository" \
-"${AREP}\."
+"${AREP}mod2"
# the usual for 2mod
dotest cvsadm-1d16f "cat dir/2mod/CVS/Repository" \
"${AREP}mod2/sub2"
@@ -8958,7 +10492,7 @@ U dir/dir1d2/file2"
"${AREP}\."
# the usual for the dir level
dotest cvsadm-1d17d "cat dir/CVS/Repository" \
-"${AREP}\."
+"${AREP}mod2"
# the usual for 2mod
dotest cvsadm-1d17f "cat dir/2mod/CVS/Repository" \
"${AREP}mod2/sub2"
@@ -8976,13 +10510,13 @@ U dir/dir2d1/sub2d1/file1"
"${AREP}\."
# the usual for the dir level
dotest cvsadm-1d18d "cat dir/CVS/Repository" \
-"${AREP}\."
+"${AREP}mod2"
# the usual for 2mod
dotest cvsadm-1d18f "cat dir/2mod/CVS/Repository" \
"${AREP}mod2/sub2"
# the usual for 2d1mod
dotest cvsadm-1d18h "cat dir/dir2d1/CVS/Repository" \
-"${AREP}CVSROOT/Emptydir"
+"${AREP}\."
dotest cvsadm-1d18j "cat dir/dir2d1/sub2d1/CVS/Repository" \
"${AREP}mod1"
rm -rf CVS dir
@@ -8996,13 +10530,13 @@ U dir/dir2d2/sub2d2/file2"
"${AREP}\."
# the usual for the dir level
dotest cvsadm-1d19d "cat dir/CVS/Repository" \
-"${AREP}\."
+"${AREP}mod2"
# the usual for 2mod
dotest cvsadm-1d19f "cat dir/2mod/CVS/Repository" \
"${AREP}mod2/sub2"
# the usual for 2d2mod
dotest cvsadm-1d19h "cat dir/dir2d2/CVS/Repository" \
-"${AREP}CVSROOT/Emptydir"
+"${AREP}mod2"
dotest cvsadm-1d19j "cat dir/dir2d2/sub2d2/CVS/Repository" \
"${AREP}mod2/sub2"
rm -rf CVS dir
@@ -9061,7 +10595,7 @@ U dir/dir2d1/sub2d1/file1"
"${AREP}mod1"
# the usual for 2d1mod
dotest cvsadm-1d22h "cat dir/dir2d1/CVS/Repository" \
-"${AREP}CVSROOT/Emptydir"
+"${AREP}\."
dotest cvsadm-1d22j "cat dir/dir2d1/sub2d1/CVS/Repository" \
"${AREP}mod1"
rm -rf CVS dir
@@ -9081,7 +10615,7 @@ U dir/dir2d2/sub2d2/file2"
"${AREP}mod1"
# the usual for 2d2mod
dotest cvsadm-1d23h "cat dir/dir2d2/CVS/Repository" \
-"${AREP}CVSROOT/Emptydir"
+"${AREP}mod2"
dotest cvsadm-1d23j "cat dir/dir2d2/sub2d2/CVS/Repository" \
"${AREP}mod2/sub2"
rm -rf CVS dir
@@ -9098,7 +10632,7 @@ U dir/dir1d2-2/file2-2"
"${AREP}\."
# the usual for the dir level
dotest cvsadm-1d24d "cat dir/CVS/Repository" \
-"${AREP}\."
+"${AREP}mod2"
# the usual for 1d2mod
dotest cvsadm-1d24f "cat dir/dir1d2/CVS/Repository" \
"${AREP}mod2/sub2"
@@ -9116,13 +10650,13 @@ U dir/dir2d1/sub2d1/file1"
"${AREP}\."
# the usual for the dir level
dotest cvsadm-1d25d "cat dir/CVS/Repository" \
-"${AREP}\."
+"${AREP}mod2"
# the usual for 1d2mod
dotest cvsadm-1d25f "cat dir/dir1d2/CVS/Repository" \
"${AREP}mod2/sub2"
# the usual for 2d1mod
dotest cvsadm-1d25h "cat dir/dir2d1/CVS/Repository" \
-"${AREP}CVSROOT/Emptydir"
+"${AREP}\."
dotest cvsadm-1d25j "cat dir/dir2d1/sub2d1/CVS/Repository" \
"${AREP}mod1"
rm -rf CVS dir
@@ -9136,13 +10670,13 @@ U dir/dir2d2/sub2d2/file2"
"${AREP}\."
# the usual for the dir level
dotest cvsadm-1d26d "cat dir/CVS/Repository" \
-"${AREP}\."
+"${AREP}mod2"
# the usual for 1d2mod
dotest cvsadm-1d26f "cat dir/dir1d2/CVS/Repository" \
"${AREP}mod2/sub2"
# the usual for 2d2mod
dotest cvsadm-1d26h "cat dir/dir2d2/CVS/Repository" \
-"${AREP}CVSROOT/Emptydir"
+"${AREP}mod2"
dotest cvsadm-1d26j "cat dir/dir2d2/sub2d2/CVS/Repository" \
"${AREP}mod2/sub2"
rm -rf CVS dir
@@ -9159,15 +10693,15 @@ U dir/dir2d1-2/sub2d1-2/file1-2"
"${AREP}\."
# the usual for the dir level
dotest cvsadm-1d27d "cat dir/CVS/Repository" \
-"${AREP}\."
+"${AREP}CVSROOT/Emptydir"
# the usual for 2d1mod
dotest cvsadm-1d27f "cat dir/dir2d1/CVS/Repository" \
-"${AREP}CVSROOT/Emptydir"
+"${AREP}\."
dotest cvsadm-1d27h "cat dir/dir2d1/sub2d1/CVS/Repository" \
"${AREP}mod1"
# the usual for 2d1mod
dotest cvsadm-1d27j "cat dir/dir2d1-2/CVS/Repository" \
-"${AREP}CVSROOT/Emptydir"
+"${AREP}\."
dotest cvsadm-1d27l "cat dir/dir2d1-2/sub2d1-2/CVS/Repository" \
"${AREP}mod1-2"
rm -rf CVS dir
@@ -9181,15 +10715,15 @@ U dir/dir2d2/sub2d2/file2"
"${AREP}\."
# the usual for the dir level
dotest cvsadm-1d28d "cat dir/CVS/Repository" \
-"${AREP}\."
+"${AREP}CVSROOT/Emptydir"
# the usual for 2d1mod
dotest cvsadm-1d28f "cat dir/dir2d1/CVS/Repository" \
-"${AREP}CVSROOT/Emptydir"
+"${AREP}\."
dotest cvsadm-1d28h "cat dir/dir2d1/sub2d1/CVS/Repository" \
"${AREP}mod1"
# the usual for 2d2mod
dotest cvsadm-1d28j "cat dir/dir2d2/CVS/Repository" \
-"${AREP}CVSROOT/Emptydir"
+"${AREP}mod2"
dotest cvsadm-1d28l "cat dir/dir2d2/sub2d2/CVS/Repository" \
"${AREP}mod2/sub2"
rm -rf CVS dir
@@ -9209,12 +10743,12 @@ U dir/dir2d2-2/sub2d2-2/file2-2"
"${AREP}\."
# the usual for 2d2mod
dotest cvsadm-1d29f "cat dir/dir2d2/CVS/Repository" \
-"${AREP}CVSROOT/Emptydir"
+"${AREP}mod2"
dotest cvsadm-1d29h "cat dir/dir2d2/sub2d2/CVS/Repository" \
"${AREP}mod2/sub2"
# the usual for 2d2mod
dotest cvsadm-1d29j "cat dir/dir2d2-2/CVS/Repository" \
-"${AREP}CVSROOT/Emptydir"
+"${AREP}mod2-2"
dotest cvsadm-1d29l "cat dir/dir2d2-2/sub2d2-2/CVS/Repository" \
"${AREP}mod2-2/sub2-2"
rm -rf CVS dir
@@ -9228,283 +10762,283 @@ U dir/dir2d2-2/sub2d2-2/file2-2"
"${PROG} [a-z]*: cannot chdir to dir: No such file or directory
${PROG} [a-z]*: ignoring module 1mod"
- if test "$remote" = no; then
- # Remote can't handle this, even with the "mkdir dir".
- # This was also true of CVS 1.9.
+ if $remote; then :; else
+ # Remote can't handle this, even with the "mkdir dir".
+ # This was also true of CVS 1.9.
- mkdir dir
- dotest cvsadm-2d3 "${testcvs} co -d dir/dir2 1mod" \
+ mkdir dir
+ dotest cvsadm-2d3 "${testcvs} co -d dir/dir2 1mod" \
"${PROG} [a-z]*: Updating dir/dir2
U dir/dir2/file1"
- dotest cvsadm-2d3b "cat CVS/Repository" \
+ dotest cvsadm-2d3b "cat CVS/Repository" \
"${AREP}\."
- dotest_fail cvsadm-2d3d "test -f dir/CVS/Repository" ""
- dotest cvsadm-2d3f "cat dir/dir2/CVS/Repository" \
+ dotest_fail cvsadm-2d3d "test -f dir/CVS/Repository" ""
+ dotest cvsadm-2d3f "cat dir/dir2/CVS/Repository" \
"${AREP}mod1"
- rm -rf CVS dir
+ rm -rf CVS dir
- mkdir dir
- dotest cvsadm-2d4 "${testcvs} co -d dir/dir2 2mod" \
+ mkdir dir
+ dotest cvsadm-2d4 "${testcvs} co -d dir/dir2 2mod" \
"${PROG} [a-z]*: Updating dir/dir2
U dir/dir2/file2"
- dotest cvsadm-2d4b "cat CVS/Repository" \
+ dotest cvsadm-2d4b "cat CVS/Repository" \
"${AREP}\."
- dotest cvsadm-2d4f "cat dir/dir2/CVS/Repository" \
+ dotest cvsadm-2d4f "cat dir/dir2/CVS/Repository" \
"${AREP}mod2/sub2"
- rm -rf CVS dir
+ rm -rf CVS dir
- mkdir dir
- dotest cvsadm-2d5 "${testcvs} co -d dir/dir2 1d1mod" \
+ mkdir dir
+ dotest cvsadm-2d5 "${testcvs} co -d dir/dir2 1d1mod" \
"${PROG} [a-z]*: Updating dir/dir2
U dir/dir2/file1"
- dotest cvsadm-2d5b "cat CVS/Repository" \
+ dotest cvsadm-2d5b "cat CVS/Repository" \
"${AREP}\."
- dotest cvsadm-2d5f "cat dir/dir2/CVS/Repository" \
+ dotest cvsadm-2d5f "cat dir/dir2/CVS/Repository" \
"${AREP}mod1"
- rm -rf CVS dir
+ rm -rf CVS dir
- mkdir dir
- dotest cvsadm-2d6 "${testcvs} co -d dir/dir2 1d2mod" \
+ mkdir dir
+ dotest cvsadm-2d6 "${testcvs} co -d dir/dir2 1d2mod" \
"${PROG} [a-z]*: Updating dir/dir2
U dir/dir2/file2"
- dotest cvsadm-2d6b "cat CVS/Repository" \
+ dotest cvsadm-2d6b "cat CVS/Repository" \
"${AREP}\."
- dotest cvsadm-2d6f "cat dir/dir2/CVS/Repository" \
+ dotest cvsadm-2d6f "cat dir/dir2/CVS/Repository" \
"${AREP}mod2/sub2"
- rm -rf CVS dir
+ rm -rf CVS dir
- mkdir dir
- dotest cvsadm-2d7 "${testcvs} co -d dir/dir2 2d1mod" \
+ mkdir dir
+ dotest cvsadm-2d7 "${testcvs} co -d dir/dir2 2d1mod" \
"${PROG} [a-z]*: Updating dir/dir2
U dir/dir2/file1"
- dotest cvsadm-2d7b "cat CVS/Repository" \
+ dotest cvsadm-2d7b "cat CVS/Repository" \
"${AREP}\."
- dotest cvsadm-2d7f "cat dir/dir2/CVS/Repository" \
+ dotest cvsadm-2d7f "cat dir/dir2/CVS/Repository" \
"${AREP}mod1"
- rm -rf CVS dir
+ rm -rf CVS dir
- mkdir dir
- dotest cvsadm-2d8 "${testcvs} co -d dir/dir2 2d2mod" \
+ mkdir dir
+ dotest cvsadm-2d8 "${testcvs} co -d dir/dir2 2d2mod" \
"${PROG} [a-z]*: Updating dir/dir2
U dir/dir2/file2"
- dotest cvsadm-2d8b "cat CVS/Repository" \
+ dotest cvsadm-2d8b "cat CVS/Repository" \
"${AREP}\."
- dotest cvsadm-2d8f "cat dir/dir2/CVS/Repository" \
+ dotest cvsadm-2d8f "cat dir/dir2/CVS/Repository" \
"${AREP}mod2/sub2"
- rm -rf CVS dir
+ rm -rf CVS dir
- ##################################################
- ## And now, a few of those tests revisited to
- ## test the behavior of the -N flag.
- ##################################################
+ ##################################################
+ ## And now, a few of those tests revisited to
+ ## test the behavior of the -N flag.
+ ##################################################
- dotest cvsadm-N3 "${testcvs} co -N 1mod" \
+ dotest cvsadm-N3 "${testcvs} co -N 1mod" \
"${PROG} [a-z]*: Updating 1mod
U 1mod/file1"
- dotest cvsadm-N3b "cat CVS/Repository" \
+ dotest cvsadm-N3b "cat CVS/Repository" \
"${AREP}\."
- dotest cvsadm-N3d "cat 1mod/CVS/Repository" \
+ dotest cvsadm-N3d "cat 1mod/CVS/Repository" \
"${AREP}mod1"
- rm -rf CVS 1mod
+ rm -rf CVS 1mod
- dotest cvsadm-N4 "${testcvs} co -N 2mod" \
+ dotest cvsadm-N4 "${testcvs} co -N 2mod" \
"${PROG} [a-z]*: Updating 2mod
U 2mod/file2"
- dotest cvsadm-N4b "cat CVS/Repository" \
+ dotest cvsadm-N4b "cat CVS/Repository" \
"${AREP}\."
- dotest cvsadm-N4d "cat 2mod/CVS/Repository" \
+ dotest cvsadm-N4d "cat 2mod/CVS/Repository" \
"${AREP}mod2/sub2"
- rm -rf CVS 2mod
+ rm -rf CVS 2mod
- dotest cvsadm-N5 "${testcvs} co -N 1d1mod" \
+ dotest cvsadm-N5 "${testcvs} co -N 1d1mod" \
"${PROG} [a-z]*: Updating dir1d1
U dir1d1/file1"
- dotest cvsadm-N5b "cat CVS/Repository" \
+ dotest cvsadm-N5b "cat CVS/Repository" \
"${AREP}\."
- dotest cvsadm-N5d "cat dir1d1/CVS/Repository" \
+ dotest cvsadm-N5d "cat dir1d1/CVS/Repository" \
"${AREP}mod1"
- rm -rf CVS dir1d1
+ rm -rf CVS dir1d1
- dotest cvsadm-N6 "${testcvs} co -N 1d2mod" \
+ dotest cvsadm-N6 "${testcvs} co -N 1d2mod" \
"${PROG} [a-z]*: Updating dir1d2
U dir1d2/file2"
- dotest cvsadm-N6b "cat CVS/Repository" \
+ dotest cvsadm-N6b "cat CVS/Repository" \
"${AREP}\."
- dotest cvsadm-N6d "cat dir1d2/CVS/Repository" \
+ dotest cvsadm-N6d "cat dir1d2/CVS/Repository" \
"${AREP}mod2/sub2"
- rm -rf CVS dir1d2
+ rm -rf CVS dir1d2
- dotest cvsadm-N7 "${testcvs} co -N 2d1mod" \
+ dotest cvsadm-N7 "${testcvs} co -N 2d1mod" \
"${PROG} [a-z]*: Updating dir2d1/sub2d1
U dir2d1/sub2d1/file1"
- dotest cvsadm-N7b "cat CVS/Repository" \
+ dotest cvsadm-N7b "cat CVS/Repository" \
"${AREP}\."
- dotest cvsadm-N7d "cat dir2d1/CVS/Repository" \
-"${AREP}CVSROOT/Emptydir"
- dotest cvsadm-N7f "cat dir2d1/sub2d1/CVS/Repository" \
+ dotest cvsadm-N7d "cat dir2d1/CVS/Repository" \
+"${AREP}\."
+ dotest cvsadm-N7f "cat dir2d1/sub2d1/CVS/Repository" \
"${AREP}mod1"
- rm -rf CVS dir2d1
+ rm -rf CVS dir2d1
- dotest cvsadm-N8 "${testcvs} co -N 2d2mod" \
+ dotest cvsadm-N8 "${testcvs} co -N 2d2mod" \
"${PROG} [a-z]*: Updating dir2d2/sub2d2
U dir2d2/sub2d2/file2"
- dotest cvsadm-N8b "cat CVS/Repository" \
+ dotest cvsadm-N8b "cat CVS/Repository" \
"${AREP}\."
- dotest cvsadm-N8d "cat dir2d2/CVS/Repository" \
-"${AREP}CVSROOT/Emptydir"
- dotest cvsadm-N8f "cat dir2d2/sub2d2/CVS/Repository" \
+ dotest cvsadm-N8d "cat dir2d2/CVS/Repository" \
+"${AREP}mod2"
+ dotest cvsadm-N8f "cat dir2d2/sub2d2/CVS/Repository" \
"${AREP}mod2/sub2"
- rm -rf CVS dir2d2
+ rm -rf CVS dir2d2
- ## the ones in one-deep directories
+ ## the ones in one-deep directories
- dotest cvsadm-N1d3 "${testcvs} co -N -d dir 1mod" \
+ dotest cvsadm-N1d3 "${testcvs} co -N -d dir 1mod" \
"${PROG} [a-z]*: Updating dir/1mod
U dir/1mod/file1"
- dotest cvsadm-N1d3b "cat CVS/Repository" \
+ dotest cvsadm-N1d3b "cat CVS/Repository" \
"${AREP}\."
- dotest cvsadm-N1d3d "cat dir/CVS/Repository" \
+ dotest cvsadm-N1d3d "cat dir/CVS/Repository" \
"${AREP}\."
- dotest cvsadm-N1d3f "cat dir/1mod/CVS/Repository" \
+ dotest cvsadm-N1d3f "cat dir/1mod/CVS/Repository" \
"${AREP}mod1"
- rm -rf CVS dir
+ rm -rf CVS dir
- dotest cvsadm-N1d4 "${testcvs} co -N -d dir 2mod" \
+ dotest cvsadm-N1d4 "${testcvs} co -N -d dir 2mod" \
"${PROG} [a-z]*: Updating dir/2mod
U dir/2mod/file2"
- dotest cvsadm-N1d4b "cat CVS/Repository" \
-"${AREP}\."
- dotest cvsadm-N1d4d "cat dir/CVS/Repository" \
+ dotest cvsadm-N1d4b "cat CVS/Repository" \
"${AREP}\."
- dotest cvsadm-N1d4f "cat dir/2mod/CVS/Repository" \
+ dotest cvsadm-N1d4d "cat dir/CVS/Repository" \
+"${AREP}mod2"
+ dotest cvsadm-N1d4f "cat dir/2mod/CVS/Repository" \
"${AREP}mod2/sub2"
- rm -rf CVS dir
+ rm -rf CVS dir
- dotest cvsadm-N1d5 "${testcvs} co -N -d dir 1d1mod" \
+ dotest cvsadm-N1d5 "${testcvs} co -N -d dir 1d1mod" \
"${PROG} [a-z]*: Updating dir/dir1d1
U dir/dir1d1/file1"
- dotest cvsadm-N1d5b "cat CVS/Repository" \
+ dotest cvsadm-N1d5b "cat CVS/Repository" \
"${AREP}\."
- dotest cvsadm-N1d5d "cat dir/CVS/Repository" \
+ dotest cvsadm-N1d5d "cat dir/CVS/Repository" \
"${AREP}\."
- dotest cvsadm-N1d5d "cat dir/dir1d1/CVS/Repository" \
+ dotest cvsadm-N1d5d "cat dir/dir1d1/CVS/Repository" \
"${AREP}mod1"
- rm -rf CVS dir
+ rm -rf CVS dir
- dotest cvsadm-N1d6 "${testcvs} co -N -d dir 1d2mod" \
+ dotest cvsadm-N1d6 "${testcvs} co -N -d dir 1d2mod" \
"${PROG} [a-z]*: Updating dir/dir1d2
U dir/dir1d2/file2"
- dotest cvsadm-N1d6b "cat CVS/Repository" \
-"${AREP}\."
- dotest cvsadm-N1d6d "cat dir/CVS/Repository" \
+ dotest cvsadm-N1d6b "cat CVS/Repository" \
"${AREP}\."
- dotest cvsadm-N1d6f "cat dir/dir1d2/CVS/Repository" \
+ dotest cvsadm-N1d6d "cat dir/CVS/Repository" \
+"${AREP}mod2"
+ dotest cvsadm-N1d6f "cat dir/dir1d2/CVS/Repository" \
"${AREP}mod2/sub2"
- rm -rf CVS dir
+ rm -rf CVS dir
- dotest cvsadm-N1d7 "${testcvs} co -N -d dir 2d1mod" \
+ dotest cvsadm-N1d7 "${testcvs} co -N -d dir 2d1mod" \
"${PROG} [a-z]*: Updating dir/dir2d1/sub2d1
U dir/dir2d1/sub2d1/file1"
- dotest cvsadm-N1d7b "cat CVS/Repository" \
-"${AREP}\."
- dotest cvsadm-N1d7d "cat dir/CVS/Repository" \
+ dotest cvsadm-N1d7b "cat CVS/Repository" \
"${AREP}\."
- dotest cvsadm-N1d7f "cat dir/dir2d1/CVS/Repository" \
+ dotest cvsadm-N1d7d "cat dir/CVS/Repository" \
"${AREP}CVSROOT/Emptydir"
- dotest cvsadm-N1d7h "cat dir/dir2d1/sub2d1/CVS/Repository" \
+ dotest cvsadm-N1d7f "cat dir/dir2d1/CVS/Repository" \
+"${AREP}\."
+ dotest cvsadm-N1d7h "cat dir/dir2d1/sub2d1/CVS/Repository" \
"${AREP}mod1"
- rm -rf CVS dir
+ rm -rf CVS dir
- dotest cvsadm-N1d8 "${testcvs} co -N -d dir 2d2mod" \
+ dotest cvsadm-N1d8 "${testcvs} co -N -d dir 2d2mod" \
"${PROG} [a-z]*: Updating dir/dir2d2/sub2d2
U dir/dir2d2/sub2d2/file2"
- dotest cvsadm-N1d8b "cat CVS/Repository" \
+ dotest cvsadm-N1d8b "cat CVS/Repository" \
"${AREP}\."
- dotest cvsadm-N1d8d "cat dir/CVS/Repository" \
+ dotest cvsadm-N1d8d "cat dir/CVS/Repository" \
"${AREP}\."
- dotest cvsadm-N1d8d "cat dir/dir2d2/CVS/Repository" \
-"${AREP}CVSROOT/Emptydir"
- dotest cvsadm-N1d8d "cat dir/dir2d2/sub2d2/CVS/Repository" \
+ dotest cvsadm-N1d8d "cat dir/dir2d2/CVS/Repository" \
+"${AREP}mod2"
+ dotest cvsadm-N1d8d "cat dir/dir2d2/sub2d2/CVS/Repository" \
"${AREP}mod2/sub2"
- rm -rf CVS dir
+ rm -rf CVS dir
- ## the ones in two-deep directories
+ ## the ones in two-deep directories
- mkdir dir
- dotest cvsadm-N2d3 "${testcvs} co -N -d dir/dir2 1mod" \
+ mkdir dir
+ dotest cvsadm-N2d3 "${testcvs} co -N -d dir/dir2 1mod" \
"${PROG} [a-z]*: Updating dir/dir2/1mod
U dir/dir2/1mod/file1"
- dotest cvsadm-N2d3b "cat CVS/Repository" \
+ dotest cvsadm-N2d3b "cat CVS/Repository" \
"${AREP}\."
- dotest cvsadm-N2d3f "cat dir/dir2/CVS/Repository" \
+ dotest cvsadm-N2d3f "cat dir/dir2/CVS/Repository" \
"${AREP}\."
- dotest cvsadm-N2d3h "cat dir/dir2/1mod/CVS/Repository" \
+ dotest cvsadm-N2d3h "cat dir/dir2/1mod/CVS/Repository" \
"${AREP}mod1"
- rm -rf CVS dir
+ rm -rf CVS dir
- mkdir dir
- dotest cvsadm-N2d4 "${testcvs} co -N -d dir/dir2 2mod" \
+ mkdir dir
+ dotest cvsadm-N2d4 "${testcvs} co -N -d dir/dir2 2mod" \
"${PROG} [a-z]*: Updating dir/dir2/2mod
U dir/dir2/2mod/file2"
- dotest cvsadm-N2d4b "cat CVS/Repository" \
-"${AREP}\."
- dotest cvsadm-N2d4f "cat dir/dir2/CVS/Repository" \
+ dotest cvsadm-N2d4b "cat CVS/Repository" \
"${AREP}\."
- dotest cvsadm-N2d4h "cat dir/dir2/2mod/CVS/Repository" \
+ dotest cvsadm-N2d4f "cat dir/dir2/CVS/Repository" \
+"${AREP}mod2"
+ dotest cvsadm-N2d4h "cat dir/dir2/2mod/CVS/Repository" \
"${AREP}mod2/sub2"
- rm -rf CVS dir
+ rm -rf CVS dir
- mkdir dir
- dotest cvsadm-N2d5 "${testcvs} co -N -d dir/dir2 1d1mod" \
+ mkdir dir
+ dotest cvsadm-N2d5 "${testcvs} co -N -d dir/dir2 1d1mod" \
"${PROG} [a-z]*: Updating dir/dir2/dir1d1
U dir/dir2/dir1d1/file1"
- dotest cvsadm-N2d5b "cat CVS/Repository" \
+ dotest cvsadm-N2d5b "cat CVS/Repository" \
"${AREP}\."
- dotest cvsadm-N2d5f "cat dir/dir2/CVS/Repository" \
+ dotest cvsadm-N2d5f "cat dir/dir2/CVS/Repository" \
"${AREP}\."
- dotest cvsadm-N2d5h "cat dir/dir2/dir1d1/CVS/Repository" \
+ dotest cvsadm-N2d5h "cat dir/dir2/dir1d1/CVS/Repository" \
"${AREP}mod1"
- rm -rf CVS dir
+ rm -rf CVS dir
- mkdir dir
- dotest cvsadm-N2d6 "${testcvs} co -N -d dir/dir2 1d2mod" \
+ mkdir dir
+ dotest cvsadm-N2d6 "${testcvs} co -N -d dir/dir2 1d2mod" \
"${PROG} [a-z]*: Updating dir/dir2/dir1d2
U dir/dir2/dir1d2/file2"
- dotest cvsadm-N2d6b "cat CVS/Repository" \
-"${AREP}\."
- dotest cvsadm-N2d6f "cat dir/dir2/CVS/Repository" \
+ dotest cvsadm-N2d6b "cat CVS/Repository" \
"${AREP}\."
- dotest cvsadm-N2d6h "cat dir/dir2/dir1d2/CVS/Repository" \
+ dotest cvsadm-N2d6f "cat dir/dir2/CVS/Repository" \
+"${AREP}mod2"
+ dotest cvsadm-N2d6h "cat dir/dir2/dir1d2/CVS/Repository" \
"${AREP}mod2/sub2"
- rm -rf CVS dir
+ rm -rf CVS dir
- mkdir dir
- dotest cvsadm-N2d7 "${testcvs} co -N -d dir/dir2 2d1mod" \
+ mkdir dir
+ dotest cvsadm-N2d7 "${testcvs} co -N -d dir/dir2 2d1mod" \
"${PROG} [a-z]*: Updating dir/dir2/dir2d1/sub2d1
U dir/dir2/dir2d1/sub2d1/file1"
- dotest cvsadm-N2d7b "cat CVS/Repository" \
-"${AREP}\."
- dotest cvsadm-N2d7f "cat dir/dir2/CVS/Repository" \
+ dotest cvsadm-N2d7b "cat CVS/Repository" \
"${AREP}\."
- dotest cvsadm-N2d7f "cat dir/dir2/dir2d1/CVS/Repository" \
+ dotest cvsadm-N2d7f "cat dir/dir2/CVS/Repository" \
"${AREP}CVSROOT/Emptydir"
- dotest cvsadm-N2d7h "cat dir/dir2/dir2d1/sub2d1/CVS/Repository" \
+ dotest cvsadm-N2d7g "cat dir/dir2/dir2d1/CVS/Repository" \
+"${AREP}\."
+ dotest cvsadm-N2d7h "cat dir/dir2/dir2d1/sub2d1/CVS/Repository" \
"${AREP}mod1"
- rm -rf CVS dir
+ rm -rf CVS dir
- mkdir dir
- dotest cvsadm-N2d8 "${testcvs} co -N -d dir/dir2 2d2mod" \
+ mkdir dir
+ dotest cvsadm-N2d8 "${testcvs} co -N -d dir/dir2 2d2mod" \
"${PROG} [a-z]*: Updating dir/dir2/dir2d2/sub2d2
U dir/dir2/dir2d2/sub2d2/file2"
- dotest cvsadm-N2d8b "cat CVS/Repository" \
+ dotest cvsadm-N2d8b "cat CVS/Repository" \
"${AREP}\."
- dotest cvsadm-N2d8f "cat dir/dir2/CVS/Repository" \
+ dotest cvsadm-N2d8f "cat dir/dir2/CVS/Repository" \
"${AREP}\."
- dotest cvsadm-N2d8h "cat dir/dir2/dir2d2/CVS/Repository" \
-"${AREP}CVSROOT/Emptydir"
- dotest cvsadm-N2d8j "cat dir/dir2/dir2d2/sub2d2/CVS/Repository" \
+ dotest cvsadm-N2d8h "cat dir/dir2/dir2d2/CVS/Repository" \
+"${AREP}mod2"
+ dotest cvsadm-N2d8j "cat dir/dir2/dir2d2/sub2d2/CVS/Repository" \
"${AREP}mod2/sub2"
- rm -rf CVS dir
+ rm -rf CVS dir
fi # end of tests to be skipped for remote
@@ -9518,7 +11052,7 @@ U dir/dir2/dir2d2/sub2d2/file2"
echo "# empty file" >config
dotest cvsadm-cleanup-2 "${testcvs} -q ci -m cvsadm-cleanup" \
"Checking in config;
-${TESTDIR}/cvsroot/CVSROOT/config,v <-- config
+${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
done
${PROG} [a-z]*: Rebuilding administrative file database"
@@ -9547,9 +11081,10 @@ ${PROG} [a-z]*: Rebuilding administrative file database"
dotest emptydir-1 "${testcvs} co CVSROOT/modules" \
"U CVSROOT/modules"
echo "# Module defs for emptydir tests" > CVSROOT/modules
- echo "2d1mod -d dir2d1/sub2d1 mod1" >> CVSROOT/modules
+ echo "2d1mod -d dir2d1/sub/sub2d1 mod1" >> CVSROOT/modules
echo "2d1moda -d dir2d1/suba moda/modasub" >> CVSROOT/modules
- echo "comb -a 2d1mod 2d1moda" >> CVSROOT/modules
+ echo "2d1modb -d dir2d1/suba mod1" >> CVSROOT/modules
+ echo "comb -a 2d1modb 2d1moda" >> CVSROOT/modules
dotest emptydir-2 "${testcvs} ci -m add-modules" \
"${PROG} [a-z]*: Examining CVSROOT
@@ -9570,7 +11105,7 @@ ${PROG} [a-z]*: Updating moda"
echo "file1" > mod1/file1
mkdir moda/modasub
dotest emptydir-3b "${testcvs} add moda/modasub" \
-"Directory ${TESTDIR}/cvsroot/moda/modasub added to the repository"
+"Directory ${CVSROOT_DIRNAME}/moda/modasub added to the repository"
echo "filea" > moda/modasub/filea
dotest emptydir-4 "${testcvs} add mod1/file1 moda/modasub/filea" \
"${PROG} [a-z]*: scheduling file .mod1/file1. for addition
@@ -9593,8 +11128,8 @@ done"
# End Populate.
dotest emptydir-6 "${testcvs} co 2d1mod" \
-"${PROG} [a-z]*: Updating dir2d1/sub2d1
-U dir2d1/sub2d1/file1"
+"${PROG} [a-z]*: Updating dir2d1/sub/sub2d1
+U dir2d1/sub/sub2d1/file1"
cd dir2d1
touch emptyfile
# It doesn't make any sense to add a file (or do much of anything
@@ -9602,10 +11137,10 @@ U dir2d1/sub2d1/file1"
# the working directory doesn't correspond to anything in
# the repository.
dotest_fail emptydir-7 "${testcvs} add emptyfile" \
-"${PROG} \[[a-z]* aborted\]: cannot add to ${TESTDIR}/cvsroot/CVSROOT/Emptydir"
+"${PROG} \[[a-z]* aborted\]: cannot add to ${CVSROOT_DIRNAME}/CVSROOT/Emptydir"
mkdir emptydir
dotest_fail emptydir-8 "${testcvs} add emptydir" \
-"${PROG} \[[a-z]* aborted\]: cannot add to ${TESTDIR}/cvsroot/CVSROOT/Emptydir"
+"${PROG} \[[a-z]* aborted\]: cannot add to ${CVSROOT_DIRNAME}/CVSROOT/Emptydir"
cd ..
rm -rf CVS dir2d1
@@ -9626,15 +11161,16 @@ U dir2d1/sub2d1/file1"
mkdir 2; cd 2
dotest emptydir-12 "${testcvs} -q co 2d1moda" \
"U dir2d1/suba/filea"
- # OK, this is the crux of the matter. Some people think
- # it would be more logical if this showed "moda". But why
- # "moda" (from module 2d1moda) and not "." (from module 2d1mod)?
- dotest emptydir-13 "cat dir2d1/CVS/Repository" "CVSROOT/Emptydir"
- dotest emptydir-14 "${testcvs} co comb" \
-"${PROG} [a-z]*: Updating dir2d1/sub2d1
-U dir2d1/sub2d1/file1
+ # OK, this is the crux of the matter. This used to show "Emptydir",
+ # but everyone seemed to think it should show "moda". This
+ # usually works better, but not always as shown by the following
+ # test.
+ dotest emptydir-13 "cat dir2d1/CVS/Repository" "moda"
+ dotest_fail emptydir-14 "${testcvs} co comb" \
+"${PROG} [a-z]*: existing repository ${CVSROOT_DIRNAME}/moda/modasub does not match ${TESTDIR}/cvsroot/mod1
+${PROG} [a-z]*: ignoring module 2d1modb
${PROG} [a-z]*: Updating dir2d1/suba"
- dotest emptydir-15 "cat dir2d1/CVS/Repository" "CVSROOT/Emptydir"
+ dotest emptydir-15 "cat dir2d1/CVS/Repository" "moda"
cd ..
rm -r 1 2
@@ -9692,14 +11228,14 @@ done"
# Done.
# Try checking out the module in a local directory
- if test "$remote" = yes; then
+ if $remote; then
dotest_fail abspath-2a "${testcvs} co -d ${TESTDIR}/1 mod1" \
"${PROG} \[server aborted\]: absolute pathname .${TESTDIR}/1. illegal for server"
dotest abspath-2a-try2 "${testcvs} co -d 1 mod1" \
"${PROG} [a-z]*: Updating 1
U 1/file1"
else
- dotest abspath-2a "${testcvs} co -d ${TESTDIR}/1 mod1" \
+ dotest abspath-2a "${testcvs} co -d ${TESTDIR}/1 mod1" \
"${PROG} [a-z]*: Updating ${TESTDIR}/1
U ${TESTDIR}/1/file1"
fi # remote workaround
@@ -9731,8 +11267,8 @@ U ${TESTDIR}/1/file1"
# "touch 1/2/3" requires directories 1 and 1/2 to already
# exist, we expect ${TESTDIR}/1 to already exist. I believe
# this is the behavior of CVS 1.9 and earlier.
- if test "$remote" = no; then
- dotest_fail abspath-3.1 "${testcvs} co -d ${TESTDIR}/1/2 mod1" \
+ if $remote; then :; else
+ dotest_fail abspath-3.1 "${testcvs} co -d ${TESTDIR}/1/2 mod1" \
"${PROG} [a-z]*: cannot chdir to 1: No such file or directory
${PROG} [a-z]*: ignoring module mod1"
fi
@@ -9741,7 +11277,7 @@ ${PROG} [a-z]*: ignoring module mod1"
${PROG} [a-z]*: ignoring module mod1"
mkdir 1
- if test "$remote" = yes; then
+ if $remote; then
# The server wants the directory to exist, but that is
# a bug, it should only need to exist on the client side.
# See also cvsadm-2d3.
@@ -9774,8 +11310,8 @@ U ${TESTDIR}/1/2/file1"
# Now try someplace where we don't have permission.
mkdir ${TESTDIR}/barf
chmod -w ${TESTDIR}/barf
- if test "$remote" = yes; then
- dotest_fail abspath-4 "${testcvs} co -d ${TESTDIR}/barf/sub mod1" \
+ if $remote; then
+ dotest_fail abspath-4r "${testcvs} co -d ${TESTDIR}/barf/sub mod1" \
"${PROG} \[server aborted\]: absolute pathname .${TESTDIR}/barf/sub. illegal for server"
else
dotest_fail abspath-4 "${testcvs} co -d ${TESTDIR}/barf/sub mod1" \
@@ -9787,8 +11323,8 @@ U ${TESTDIR}/1/2/file1"
# Try checking out two modules into the same directory.
- if test "$remote" = yes; then
- dotest abspath-5a "${testcvs} co -d 1 mod1 mod2" \
+ if $remote; then
+ dotest abspath-5ar "${testcvs} co -d 1 mod1 mod2" \
"${PROG} [a-z]*: Updating 1/mod1
U 1/mod1/file1
${PROG} [a-z]*: Updating 1/mod2
@@ -9811,8 +11347,8 @@ U ${TESTDIR}/1/mod2/file2"
# Try checking out the top-level module.
- if test "$remote" = yes; then
- dotest abspath-6a "${testcvs} co -d 1 ." \
+ if $remote; then
+ dotest abspath-6ar "${testcvs} co -d 1 ." \
"${PROG} [a-z]*: Updating 1
${PROG} [a-z]*: Updating 1/CVSROOT
${DOTSTAR}
@@ -9845,25 +11381,25 @@ U ${TESTDIR}/1/mod2/file2"
# doesn't mess with the current working directory.
mkdir 1
cd 1
- if test "$remote" = yes; then
- dotest_fail abspath-7a "${testcvs} -q co -d ../2 mod2" \
+ if $remote; then
+ dotest_fail abspath-7ar "${testcvs} -q co -d ../2 mod2" \
"${PROG} server: protocol error: .\.\./2. contains more leading \.\.
${PROG} \[server aborted\]: than the 0 which Max-dotdot specified"
cd ..
- dotest abspath-7a-try2 "${testcvs} -q co -d 2 mod2" \
+ dotest abspath-7a-try2r "${testcvs} -q co -d 2 mod2" \
"U 2/file2"
cd 1
else
- dotest abspath-7a "${testcvs} -q co -d ${TESTDIR}/2 mod2" \
+ dotest abspath-7a "${testcvs} -q co -d ${TESTDIR}/2 mod2" \
"U ${TESTDIR}/2/file2"
fi # remote workaround
dotest abspath-7b "ls" ""
dotest abspath-7c "${testcvs} -q co mod1" \
"U mod1/file1"
cd mod1
- if test "$remote" = yes; then
+ if $remote; then
cd ../..
- dotest abspath-7d "${testcvs} -q co -d 3 mod2" \
+ dotest abspath-7dr "${testcvs} -q co -d 3 mod2" \
"U 3/file2"
cd 1/mod1
else
@@ -9902,7 +11438,7 @@ ${PROG} \[server aborted\]: than the 0 which Max-dotdot specified"
echo "TopLevelAdmin=yes" >config
dotest toplevel-1b "${testcvs} -q ci -m yes-top-level" \
"Checking in config;
-${TESTDIR}/cvsroot/CVSROOT/config,v <-- config
+${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
done
${PROG} [a-z]*: Rebuilding administrative file database"
@@ -9913,8 +11449,8 @@ ${PROG} [a-z]*: Rebuilding administrative file database"
dotest toplevel-1 "${testcvs} -q co -l ." ''
mkdir top-dir second-dir
dotest toplevel-2 "${testcvs} add top-dir second-dir" \
-"Directory ${TESTDIR}/cvsroot/top-dir added to the repository
-Directory ${TESTDIR}/cvsroot/second-dir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/top-dir added to the repository
+Directory ${CVSROOT_DIRNAME}/second-dir added to the repository"
cd top-dir
touch file1
@@ -9922,10 +11458,10 @@ Directory ${TESTDIR}/cvsroot/second-dir added to the repository"
"${PROG} [a-z]*: scheduling file .file1. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest toplevel-4 "${testcvs} -q ci -m add" \
-"RCS file: ${TESTDIR}/cvsroot/top-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/top-dir/file1,v
done
Checking in file1;
-${TESTDIR}/cvsroot/top-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/top-dir/file1,v <-- file1
initial revision: 1\.1
done"
cd ..
@@ -9936,10 +11472,10 @@ done"
"${PROG} [a-z]*: scheduling file .file2. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest toplevel-4s "${testcvs} -q ci -m add" \
-"RCS file: ${TESTDIR}/cvsroot/second-dir/file2,v
+"RCS file: ${CVSROOT_DIRNAME}/second-dir/file2,v
done
Checking in file2;
-${TESTDIR}/cvsroot/second-dir/file2,v <-- file2
+${CVSROOT_DIRNAME}/second-dir/file2,v <-- file2
initial revision: 1\.1
done"
@@ -9998,6 +11534,7 @@ U top-dir/file1"
"${PROG} [a-z]*: warning: cannot make directory CVS in \.: Permission denied
${PROG} [a-z]*: Updating top-dir" \
"${PROG} [a-z]*: warning: cannot make directory CVS in \.: Permission denied
+${PROG} [a-z]*: warning: cannot make directory CVS in \.: Permission denied
${PROG} [a-z]*: in directory \.:
${PROG} [a-z]*: cannot open CVS/Entries for reading: No such file or directory
${PROG} [a-z]*: Updating top-dir"
@@ -10010,7 +11547,7 @@ ${PROG} [a-z]*: Updating top-dir"
echo "# empty file" >config
dotest toplevel-cleanup-2 "${testcvs} -q ci -m toplevel-cleanup" \
"Checking in config;
-${TESTDIR}/cvsroot/CVSROOT/config,v <-- config
+${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
done
${PROG} [a-z]*: Rebuilding administrative file database"
@@ -10031,7 +11568,7 @@ ${PROG} [a-z]*: Rebuilding administrative file database"
echo "TopLevelAdmin=no" >config
dotest toplevel2-1b "${testcvs} -q ci -m no-top-level" \
"Checking in config;
-${TESTDIR}/cvsroot/CVSROOT/config,v <-- config
+${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
done
${PROG} [a-z]*: Rebuilding administrative file database"
@@ -10043,8 +11580,8 @@ ${PROG} [a-z]*: Rebuilding administrative file database"
dotest toplevel2-1 "${testcvs} -q co -l ." ''
mkdir top-dir second-dir
dotest toplevel2-2 "${testcvs} add top-dir second-dir" \
-"Directory ${TESTDIR}/cvsroot/top-dir added to the repository
-Directory ${TESTDIR}/cvsroot/second-dir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/top-dir added to the repository
+Directory ${CVSROOT_DIRNAME}/second-dir added to the repository"
cd top-dir
touch file1
@@ -10052,10 +11589,10 @@ Directory ${TESTDIR}/cvsroot/second-dir added to the repository"
"${PROG} [a-z]*: scheduling file .file1. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest toplevel2-4 "${testcvs} -q ci -m add" \
-"RCS file: ${TESTDIR}/cvsroot/top-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/top-dir/file1,v
done
Checking in file1;
-${TESTDIR}/cvsroot/top-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/top-dir/file1,v <-- file1
initial revision: 1\.1
done"
cd ..
@@ -10066,10 +11603,10 @@ done"
"${PROG} [a-z]*: scheduling file .file2. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest toplevel2-4s "${testcvs} -q ci -m add" \
-"RCS file: ${TESTDIR}/cvsroot/second-dir/file2,v
+"RCS file: ${CVSROOT_DIRNAME}/second-dir/file2,v
done
Checking in file2;
-${TESTDIR}/cvsroot/second-dir/file2,v <-- file2
+${CVSROOT_DIRNAME}/second-dir/file2,v <-- file2
initial revision: 1\.1
done"
@@ -10106,7 +11643,7 @@ U top-dir/file1"
echo "# empty file" >config
dotest toplevel2-cleanup-2 "${testcvs} -q ci -m toplevel2-cleanup" \
"Checking in config;
-${TESTDIR}/cvsroot/CVSROOT/config,v <-- config
+${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
done
${PROG} [a-z]*: Rebuilding administrative file database"
@@ -10190,7 +11727,7 @@ EOF
dotest editor-1 "${testcvs} -q co -l ." ''
mkdir first-dir
dotest editor-2 "${testcvs} add first-dir" \
-"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
cd first-dir
touch file1 file2
dotest editor-3 "${testcvs} add file1 file2" \
@@ -10198,16 +11735,16 @@ EOF
${PROG} [a-z]*: scheduling file .file2. for addition
${PROG} [a-z]*: use .${PROG} commit. to add these files permanently"
dotest editor-4 "${testcvs} -e ${TESTDIR}/editme -q ci" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done
Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
initial revision: 1\.1
done
-RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
done
Checking in file2;
-${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
+${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
initial revision: 1\.1
done"
dotest editor-5 "${testcvs} -q tag -b br" "T file1
@@ -10216,7 +11753,7 @@ T file2"
echo modify >>file1
dotest editor-7 "${testcvs} -e ${TESTDIR}/editme -q ci" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.1\.2\.1; previous revision: 1\.1
done"
# OK, now we want to make sure "ci -r" puts in the branch
@@ -10228,12 +11765,12 @@ done"
echo add a line >>file2
dotest editor-9 "${testcvs} -q -e ${TESTDIR}/editme ci -rbr file2" \
"Checking in file2;
-${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
+${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
new revision: 1\.1\.2\.1; previous revision: 1\.1
done"
dotest editor-log-file1 "${testcvs} log -N file1" "
-RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
Working file: file1
head: 1\.1
branch:
@@ -10246,7 +11783,6 @@ description:
revision 1\.1
date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
branches: 1\.1\.2;
-x
xCVS: ----------------------------------------------------------------------
xCVS: Enter Log. Lines beginning with .CVS:. are removed automatically
xCVS:
@@ -10258,7 +11794,6 @@ xCVS: ----------------------------------------------------------------------
----------------------------
revision 1\.1\.2\.1
date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
-x
xCVS: ----------------------------------------------------------------------
xCVS: Enter Log. Lines beginning with .CVS:. are removed automatically
xCVS:
@@ -10273,7 +11808,7 @@ xCVS: ----------------------------------------------------------------------
# The only difference between the two expect strings is the
# presence or absence of "Committing in ." for 1.1.2.1.
dotest editor-log-file2 "${testcvs} log -N file2" "
-RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
Working file: file2
head: 1\.1
branch:
@@ -10286,7 +11821,6 @@ description:
revision 1\.1
date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
branches: 1\.1\.2;
-x
xCVS: ----------------------------------------------------------------------
xCVS: Enter Log. Lines beginning with .CVS:. are removed automatically
xCVS:
@@ -10298,7 +11832,6 @@ xCVS: ----------------------------------------------------------------------
----------------------------
revision 1\.1\.2\.1
date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
-x
xCVS: ----------------------------------------------------------------------
xCVS: Enter Log. Lines beginning with .CVS:. are removed automatically
xCVS:
@@ -10307,7 +11840,7 @@ xCVS: Tag: br
xCVS: file2
xCVS: ----------------------------------------------------------------------
=============================================================================" "
-RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
Working file: file2
head: 1\.1
branch:
@@ -10320,7 +11853,6 @@ description:
revision 1\.1
date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
branches: 1\.1\.2;
-x
xCVS: ----------------------------------------------------------------------
xCVS: Enter Log. Lines beginning with .CVS:. are removed automatically
xCVS:
@@ -10332,7 +11864,6 @@ xCVS: ----------------------------------------------------------------------
----------------------------
revision 1\.1\.2\.1
date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
-x
xCVS: ----------------------------------------------------------------------
xCVS: Enter Log. Lines beginning with .CVS:. are removed automatically
xCVS:
@@ -10393,20 +11924,11 @@ xCVS: ----------------------------------------------------------------------
fi
cd ../../2/1dir
- # FIXME: should be using dotest.
- ${testcvs} -q update 2>../tst167.err
- cat ../tst167.err >>${LOGFILE}
- cat <<EOF >../tst167.ans
-${PROG} server: warning: foo is not (any longer) pertinent
-${PROG} update: unable to remove ./foo: Permission denied
-EOF
- if cmp ../tst167.ans ../tst167.err >/dev/null ||
- ( echo "${PROG} [update aborted]: cannot rename file foo to CVS/,,foo: Permission denied" | cmp - ../tst167.err >/dev/null )
- then
- pass 168
- else
- fail 168
- fi
+ dotest 168 "${testcvs} -q update" \
+"${PROG} [a-z]*: foo is no longer in the repository
+${PROG} update: unable to remove foo: Permission denied" \
+"${PROG} [a-z]*: foo is no longer in the repository
+${PROG} update: unable to remove \./foo: Permission denied"
cd ..
chmod u+w 1dir
@@ -10428,7 +11950,7 @@ EOF
dotest errmsg2-1 "${testcvs} -q co -l ." ''
mkdir first-dir
dotest errmsg2-2 "${testcvs} add first-dir" \
-"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
cd first-dir
dotest_fail errmsg2-3 "${testcvs} add CVS" \
"${PROG} [a-z]*: cannot add special file .CVS.; skipping"
@@ -10453,16 +11975,16 @@ ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
# Make sure that none of the error messages left droppings
# which interfere with normal operation.
dotest errmsg2-7 "${testcvs} -q ci -m add-file1" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done
Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
initial revision: 1\.1
done"
mkdir sdir
cd ..
dotest errmsg2-8 "${testcvs} add first-dir/sdir" \
-"Directory ${TESTDIR}/cvsroot/first-dir/sdir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir/sdir added to the repository"
# while we're here... check commit with no CVS directory
dotest_fail errmsg2-8a "${testcvs} -q ci first-dir nonexistant" \
"${PROG} [a-z]*: nothing known about .nonexistant'
@@ -10478,13 +12000,13 @@ ${PROG} \[[a-z]* aborted\]: correct above errors first!"
mkdir sdir10
dotest errmsg2-10 "${testcvs} add file10 sdir10" \
"${PROG} [a-z]*: scheduling file .file10. for addition
-Directory ${TESTDIR}/cvsroot/first-dir/sdir10 added to the repository
+Directory ${CVSROOT_DIRNAME}/first-dir/sdir10 added to the repository
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest errmsg2-11 "${testcvs} -q ci -m add-file10" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file10,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file10,v
done
Checking in file10;
-${TESTDIR}/cvsroot/first-dir/file10,v <-- file10
+${CVSROOT_DIRNAME}/first-dir/file10,v <-- file10
initial revision: 1\.1
done"
# Try to see that there are no droppings left by
@@ -10496,7 +12018,7 @@ done"
cd ..
mkdir first-dir/sdir10/ssdir
dotest errmsg2-13 "${testcvs} add first-dir/sdir10/ssdir" \
-"Directory ${TESTDIR}/cvsroot/first-dir/sdir10/ssdir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir/sdir10/ssdir added to the repository"
touch first-dir/sdir10/ssdir/ssfile
dotest errmsg2-14 \
@@ -10527,26 +12049,23 @@ ${PROG} \[add aborted\]: no repository"
# or directory which already is there.
dotest errmsg2-17 "${testcvs} -q ci -m checkin" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file15,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file15,v
done
Checking in first-dir/file15;
-${TESTDIR}/cvsroot/first-dir/file15,v <-- file15
+${CVSROOT_DIRNAME}/first-dir/file15,v <-- file15
initial revision: 1\.1
done
-RCS file: ${TESTDIR}/cvsroot/first-dir/sdir10/ssdir/ssfile,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir10/ssdir/ssfile,v
done
Checking in first-dir/sdir10/ssdir/ssfile;
-${TESTDIR}/cvsroot/first-dir/sdir10/ssdir/ssfile,v <-- ssfile
+${CVSROOT_DIRNAME}/first-dir/sdir10/ssdir/ssfile,v <-- ssfile
initial revision: 1\.1
done"
dotest errmsg2-18 "${testcvs} -Q tag test" ''
- dotest_fail errmsg2-19 "${testcvs} annotate -rtest -Dyesterday" \
-"${PROG} \[[a-z]* aborted\]: rcsbuf_open: internal error"
-
# trying to import the repository
- if test "$remote" = "no"; then
+ if $remote; then :; else
cd ${CVSROOT_DIRNAME}
dotest_fail errmsg2-20 "${testcvs} import -mtest . A B" \
"${PROG} \[[a-z]* aborted\]: attempt to import the repository"
@@ -10556,7 +12075,57 @@ done"
cd ..
rm -r 1
- rm -rf ${TESTDIR}/cvsroot/first-dir
+ rm -rf ${CVSROOT_DIRNAME}/first-dir
+ ;;
+
+ adderrmsg)
+ # Test some of the error messages the 'add' command can return and
+ # their reactions to '-q'.
+
+ # First the usual setup; create a directory first-dir.
+ mkdir 1; cd 1
+ dotest adderrmsg-init1 "${testcvs} -q co -l ." ''
+ mkdir adderrmsg-dir
+ dotest adderrmsg-init2 "${testcvs} add adderrmsg-dir" \
+"Directory ${CVSROOT_DIRNAME}/adderrmsg-dir added to the repository"
+ cd adderrmsg-dir
+
+ # try to add the admin dir
+ dotest_fail adderrmsg-1 "${testcvs} add CVS" \
+"${PROG} [a-z]*: cannot add special file .CVS.; skipping"
+ # might not want to see this message when you 'cvs add *'
+ dotest_fail adderrmsg-2 "${testcvs} -q add CVS" ""
+
+ # to test some other messages
+ touch file1
+ dotest adderrmsg-3 "${testcvs} add file1" \
+"${PROG} [a-z]*: scheduling file .file1. for addition
+${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
+
+ # add it twice
+ dotest_fail adderrmsg-4 "${testcvs} add file1" \
+"${PROG} [a-z]*: file1 has already been entered"
+ dotest_fail adderrmsg-5 "${testcvs} -q add file1" ""
+
+ dotest adderrmsg-6 "${testcvs} -q ci -madd" \
+"RCS file: ${CVSROOT_DIRNAME}/adderrmsg-dir/file1,v
+done
+Checking in file1;
+${CVSROOT_DIRNAME}/adderrmsg-dir/file1,v <-- file1
+initial revision: 1\.1
+done"
+
+ # file in Entries & repository
+ dotest_fail adderrmsg-7 "${testcvs} add file1" \
+"${PROG} [a-z]*: file1 already exists, with version number 1\.1"
+ dotest_fail adderrmsg-8 "${testcvs} -q add file1" ""
+
+ # clean up
+ cd ../..
+ if $keep; then :; else
+ rm -r 1
+ rm -rf ${CVSROOT_DIRNAME}/adderrmsg-dir
+ fi
;;
devcom)
@@ -10769,7 +12338,7 @@ U first-dir/abc'
dotest_fail devcom-some3 "test -w first-dir/abc" ''
cd ..
- if test "$keep" = yes; then
+ if $keep; then
echo Keeping ${TESTDIR} and exiting due to --keep
exit 0
fi
@@ -10922,7 +12491,7 @@ G@#..!@#=&"
# Now test disconnected "cvs edit" and the format of the
# CVS/Notify file.
- if test "$remote" = yes; then
+ if $remote; then
CVS_SERVER_SAVED=${CVS_SERVER}
CVS_SERVER=${TESTDIR}/cvs-none; export CVS_SERVER
@@ -10931,18 +12500,18 @@ G@#..!@#=&"
# (if the process doing the exec exits before the parent
# gets around to sending data to it) or "broken pipe" (if it
# is the other way around).
- dotest_fail devcom3-9a "${testcvs} edit w1" \
+ dotest_fail devcom3-9ar "${testcvs} edit w1" \
"${PROG} \[edit aborted\]: cannot exec ${TESTDIR}/cvs-none: ${DOTSTAR}"
- dotest devcom3-9b "test -w w1" ""
- dotest devcom3-9c "cat CVS/Notify" \
+ dotest devcom3-9br "test -w w1" ""
+ dotest devcom3-9cr "cat CVS/Notify" \
"Ew1 [SMTWF][uoehra][neduit] [JFAMSOND][aepuco][nbrylgptvc] [0-9 ][0-9] [0-9:]* [0-9][0-9][0-9][0-9] GMT [-a-zA-Z_.0-9]* ${TESTDIR}/1/first-dir EUC"
CVS_SERVER=${CVS_SERVER_SAVED}; export CVS_SERVER
- dotest devcom3-9d "${testcvs} -q update" ""
- dotest_fail devcom3-9e "test -f CVS/Notify" ""
- dotest devcom3-9f "${testcvs} watchers w1" \
+ dotest devcom3-9dr "${testcvs} -q update" ""
+ dotest_fail devcom3-9er "test -f CVS/Notify" ""
+ dotest devcom3-9fr "${testcvs} watchers w1" \
"w1 ${username} tedit tunedit tcommit"
- dotest devcom3-9g "${testcvs} unedit w1" ""
- dotest devcom3-9h "${testcvs} watchers w1" ""
+ dotest devcom3-9gr "${testcvs} unedit w1" ""
+ dotest devcom3-9hr "${testcvs} watchers w1" ""
fi
cd ../..
@@ -10969,7 +12538,7 @@ G@#..!@#=&"
dotest watch4-0a "${testcvs} -q co -l ." ''
mkdir first-dir
dotest watch4-0b "${testcvs} add first-dir" \
-"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
cd first-dir
dotest watch4-1 "${testcvs} watch on" ''
@@ -10979,26 +12548,26 @@ G@#..!@#=&"
"${PROG} [a-z]*: scheduling file .file1. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest watch4-3 "${testcvs} -q ci -m add" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done
Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
initial revision: 1\.1
done"
# Now test the analogous behavior for directories.
mkdir subdir
dotest watch4-4 "${testcvs} add subdir" \
-"Directory ${TESTDIR}/cvsroot/first-dir/subdir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir/subdir added to the repository"
cd subdir
touch sfile
dotest watch4-5 "${testcvs} add sfile" \
"${PROG} [a-z]*: scheduling file .sfile. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest watch4-6 "${testcvs} -q ci -m add" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/subdir/sfile,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/subdir/sfile,v
done
Checking in sfile;
-${TESTDIR}/cvsroot/first-dir/subdir/sfile,v <-- sfile
+${CVSROOT_DIRNAME}/first-dir/subdir/sfile,v <-- sfile
initial revision: 1\.1
done"
cd ../../..
@@ -11017,13 +12586,13 @@ U first-dir/subdir/sfile"
echo 'edited in 1' >file1
dotest watch4-12 "${testcvs} -q ci -m edit-in-1" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.2; previous revision: 1\.1
done"
cd ../..
cd 2/first-dir
dotest watch4-13 "${testcvs} -q update" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
retrieving revision 1\.1
retrieving revision 1\.2
Merging differences between 1\.1 and 1\.2 into file1
@@ -11075,7 +12644,7 @@ C file1"
dotest watch5-0a "${testcvs} -q co -l ." ''
mkdir first-dir
dotest watch5-0b "${testcvs} add first-dir" \
-"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
cd first-dir
dotest watch5-1 "${testcvs} watch on" ''
@@ -11085,10 +12654,10 @@ C file1"
"${PROG} [a-z]*: scheduling file .file1. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest watch5-3 "${testcvs} -q ci -m add" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done
Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
initial revision: 1\.1
done"
dotest watch5-4 "${testcvs} edit file1" ''
@@ -11145,8 +12714,8 @@ ${PROG} unedit: run update to complete the unedit"
dotest unedit-without-baserev-5 "cat CVS/Entries" \
"/$file/1\.1\.1\.1/${DOTSTAR}"
- if test "$remote" = yes; then
- dotest unedit-without-baserev-6 "${testcvs} -q update" "U m"
+ if $remote; then
+ dotest unedit-without-baserev-6r "${testcvs} -q update" "U m"
else
dotest unedit-without-baserev-6 "${testcvs} -q update" \
"${PROG} update: warning: m was lost
@@ -11172,13 +12741,13 @@ U m"
echo 'edited in 1' >m
dotest unedit-without-baserev-12 "${testcvs} -q ci -m edit-in-1" \
"Checking in m;
-${TESTDIR}/cvsroot/x/m,v <-- m
+${CVSROOT_DIRNAME}/x/m,v <-- m
new revision: 1\.2; previous revision: 1\.1
done"
cd ../..
cd 2/x
dotest unedit-without-baserev-13 "${testcvs} -q update" \
-"RCS file: ${TESTDIR}/cvsroot/x/m,v
+"RCS file: ${CVSROOT_DIRNAME}/x/m,v
retrieving revision 1\.1\.1\.1
retrieving revision 1\.2
Merging differences between 1\.1\.1\.1 and 1\.2 into m
@@ -11189,8 +12758,8 @@ C m"
echo yes | dotest unedit-without-baserev-14 "${testcvs} unedit m" \
"m has been modified; revert changes${QUESTION} ${PROG} unedit: m not mentioned in CVS/Baserev
${PROG} unedit: run update to complete the unedit"
- if test "$remote" = yes; then
- dotest unedit-without-baserev-15 "${testcvs} -q update" "U m"
+ if $remote; then
+ dotest unedit-without-baserev-15r "${testcvs} -q update" "U m"
else
dotest unedit-without-baserev-15 "${testcvs} -q update" \
"${PROG} update: warning: m was lost
@@ -11213,32 +12782,32 @@ U m"
ignore)
# On Windows, we can't check out CVSROOT, because the case
# insensitivity means that this conflicts with cvsroot.
- mkdir wnt
- cd wnt
+ mkdir ignore
+ cd ignore
- dotest 187a1 "${testcvs} -q co CVSROOT" "U CVSROOT/${DOTSTAR}"
+ dotest ignore-1 "${testcvs} -q co CVSROOT" "U CVSROOT/${DOTSTAR}"
cd CVSROOT
echo rootig.c >cvsignore
- dotest 187a2 "${testcvs} add cvsignore" "${PROG}"' [a-z]*: scheduling file `cvsignore'"'"' for addition
+ dotest ignore-2 "${testcvs} add cvsignore" "${PROG}"' [a-z]*: scheduling file `cvsignore'"'"' for addition
'"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to add this file permanently'
# As of Jan 96, local CVS prints "Examining ." and remote doesn't.
# Accept either.
- dotest 187a3 " ${testcvs} ci -m added" \
+ dotest ignore-3 " ${testcvs} ci -m added" \
"${PROG} [a-z]*: Examining \.
-RCS file: ${TESTDIR}/cvsroot/CVSROOT/cvsignore,v
+RCS file: ${CVSROOT_DIRNAME}/CVSROOT/cvsignore,v
done
Checking in cvsignore;
-${TESTDIR}/cvsroot/CVSROOT/cvsignore,v <-- cvsignore
+${CVSROOT_DIRNAME}/CVSROOT/cvsignore,v <-- cvsignore
initial revision: 1\.1
done
${PROG} [a-z]*: Rebuilding administrative file database"
cd ..
if echo "yes" | ${testcvs} release -d CVSROOT >>${LOGFILE} ; then
- pass 187a4
+ pass ignore-4
else
- fail 187a4
+ fail ignore-4
fi
# CVS looks at the home dir from getpwuid, not HOME (is that correct
@@ -11250,46 +12819,46 @@ ${PROG} [a-z]*: Rebuilding administrative file database"
touch foobar.c bar.c rootig.c defig.o envig.c optig.c
# We use sort because we can't predict the order in which
# the files will be listed.
- dotest_sort 188a "${testcvs} import -m m -I optig.c first-dir tag1 tag2" \
+ dotest_sort ignore-5 "${testcvs} import -m m -I optig.c ignore/first-dir tag1 tag2" \
'
-I first-dir/defig.o
-I first-dir/envig.c
-I first-dir/optig.c
-I first-dir/rootig.c
-N first-dir/bar.c
-N first-dir/foobar.c
+I ignore/first-dir/defig.o
+I ignore/first-dir/envig.c
+I ignore/first-dir/optig.c
+I ignore/first-dir/rootig.c
+N ignore/first-dir/bar.c
+N ignore/first-dir/foobar.c
No conflicts created by this import'
- dotest_sort 188b "${testcvs} import -m m -I ! second-dir tag3 tag4" \
+ dotest_sort ignore-6 "${testcvs} import -m m -I ! ignore/second-dir tag3 tag4" \
'
-N second-dir/bar.c
-N second-dir/defig.o
-N second-dir/envig.c
-N second-dir/foobar.c
-N second-dir/optig.c
-N second-dir/rootig.c
+N ignore/second-dir/bar.c
+N ignore/second-dir/defig.o
+N ignore/second-dir/envig.c
+N ignore/second-dir/foobar.c
+N ignore/second-dir/optig.c
+N ignore/second-dir/rootig.c
No conflicts created by this import'
cd ..
rm -r dir-to-import
mkdir 1
cd 1
- dotest 189a "${testcvs} -q co second-dir" \
+ dotest ignore-7 "${testcvs} -q co -dsecond-dir ignore/second-dir" \
'U second-dir/bar.c
U second-dir/defig.o
U second-dir/envig.c
U second-dir/foobar.c
U second-dir/optig.c
U second-dir/rootig.c'
- dotest 189b "${testcvs} -q co first-dir" 'U first-dir/bar.c
+ dotest ignore-8 "${testcvs} -q co -dfirst-dir ignore/first-dir" 'U first-dir/bar.c
U first-dir/foobar.c'
cd first-dir
touch rootig.c defig.o envig.c optig.c notig.c
- dotest 189c "${testcvs} -q update -I optig.c" "${QUESTION} notig.c"
+ dotest ignore-9 "${testcvs} -q update -I optig.c" "${QUESTION} notig.c"
# The fact that CVS requires us to specify -I CVS here strikes me
# as a bug.
- dotest_sort 189d "${testcvs} -q update -I ! -I CVS" \
+ dotest_sort ignore-10 "${testcvs} -q update -I ! -I CVS" \
"${QUESTION} defig.o
${QUESTION} envig.c
${QUESTION} notig.c
@@ -11300,8 +12869,8 @@ ${QUESTION} rootig.c"
# where appropriate. Only test this for remote, because local
# CVS only prints it on update.
rm optig.c
- if test "x$remote" = xyes; then
- dotest 189e "${testcvs} -q diff" "${QUESTION} notig.c"
+ if $remote; then
+ dotest ignore-11r "${testcvs} -q diff" "${QUESTION} notig.c"
# Force the server to be contacted. Ugh. Having CVS
# contact the server for the sole purpose of checking
@@ -11312,7 +12881,7 @@ ${QUESTION} rootig.c"
# contents.
touch bar.c
- dotest 189f "${testcvs} -q ci -m commit-it" "${QUESTION} notig.c"
+ dotest ignore-11r "${testcvs} -q ci -m commit-it" "${QUESTION} notig.c"
fi
# now test .cvsignore files
@@ -11320,11 +12889,11 @@ ${QUESTION} rootig.c"
echo notig.c >first-dir/.cvsignore
echo foobar.c >second-dir/.cvsignore
touch first-dir/notig.c second-dir/notig.c second-dir/foobar.c
- dotest_sort 190 "${testcvs} -qn update" \
+ dotest_sort ignore-12 "${testcvs} -qn update" \
"${QUESTION} first-dir/.cvsignore
${QUESTION} second-dir/.cvsignore
${QUESTION} second-dir/notig.c"
- dotest_sort 191 "${testcvs} -qn update -I! -I CVS" \
+ dotest_sort ignore-13 "${testcvs} -qn update -I! -I CVS" \
"${QUESTION} first-dir/.cvsignore
${QUESTION} first-dir/defig.o
${QUESTION} first-dir/envig.c
@@ -11332,22 +12901,93 @@ ${QUESTION} first-dir/rootig.c
${QUESTION} second-dir/.cvsignore
${QUESTION} second-dir/notig.c"
- echo yes | dotest ignore-192 "${testcvs} release -d first-dir" \
+ echo yes | dotest ignore-14 "${testcvs} release -d first-dir" \
"${QUESTION} \.cvsignore
You have \[0\] altered files in this repository.
Are you sure you want to release (and delete) directory .first-dir': "
echo add a line >>second-dir/foobar.c
rm second-dir/notig.c second-dir/.cvsignore
- echo yes | dotest ignore-194 "${testcvs} release -d second-dir" \
+ echo yes | dotest ignore-15 "${testcvs} release -d second-dir" \
"M foobar.c
You have \[1\] altered files in this repository.
Are you sure you want to release (and delete) directory .second-dir': "
+
+ cd ../..
+ if $keep; then :; else
+ rm -r ignore
+ rm -rf ${CVSROOT_DIRNAME}/ignore
+ fi
+ ;;
+
+ ignore-on-branch)
+ # Test that CVS _doesn't_ ignore files on branches because they were
+ # added to the trunk.
+ mkdir ignore-on-branch; cd ignore-on-branch
+ mkdir $CVSROOT_DIRNAME/ignore-on-branch
+
+ # create file1 & file2 on trunk
+ dotest ignore-on-branch-setup-1 "$testcvs -q co -dsetup ignore-on-branch" ''
+ cd setup
+ echo file1 >file1
+ dotest ignore-on-branch-setup-2 "$testcvs -q add file1" \
+"$PROG [a-z]*: use .cvs commit. to add this file permanently"
+ dotest ignore-on-branch-setup-3 "$testcvs -q ci -mfile1 file1" \
+"RCS file: $CVSROOT_DIRNAME/ignore-on-branch/file1,v
+done
+Checking in file1;
+$CVSROOT_DIRNAME/ignore-on-branch/file1,v <-- file1
+initial revision: 1\.1
+done"
+ dotest ignore-on-branch-setup-4 "$testcvs -q tag -b branch" 'T file1'
+ echo file2 >file2
+ dotest ignore-on-branch-setup-5 "$testcvs -q add file2" \
+"$PROG [a-z]*: use .cvs commit. to add this file permanently"
+ dotest ignore-on-branch-setup-6 "$testcvs -q ci -mtrunk file2" \
+"RCS file: $CVSROOT_DIRNAME/ignore-on-branch/file2,v
+done
+Checking in file2;
+$CVSROOT_DIRNAME/ignore-on-branch/file2,v <-- file2
+initial revision: 1\.1
+done"
+
cd ..
- rm -r 1
- cd ..
- rm -r wnt
- rm -rf ${CVSROOT_DIRNAME}/first-dir ${CVSROOT_DIRNAME}/second-dir
+
+ # Check out branch.
+ #
+ # - This was the original failure case - file2 would not be flagged
+ # with a '?'
+ dotest ignore-on-branch-1 "$testcvs -q co -rbranch ignore-on-branch" \
+'U ignore-on-branch/file1'
+ cd ignore-on-branch
+ echo file2 on branch >file2
+ dotest ignore-on-branch-2 "$testcvs -nq update" '? file2'
+
+ # Now set up for a join. One of the original fixes for this would
+ # print out a 'U' and a '?' during a join which added a file.
+ if $remote; then
+ dotest ignore-on-branch-3 "$testcvs -q tag -b branch2" \
+'? file2
+T file1'
+ else
+ dotest ignore-on-branch-3 "$testcvs -q tag -b branch2" 'T file1'
+ fi
+ dotest ignore-on-branch-4 "$testcvs -q add file2" \
+"$PROG [a-z]*: use .cvs commit. to add this file permanently"
+ dotest ignore-on-branch-5 "$testcvs -q ci -mbranch file2" \
+"Checking in file2;
+$CVSROOT_DIRNAME/ignore-on-branch/file2,v <-- file2
+new revision: 1\.1\.2\.1; previous revision: 1\.1
+done"
+ dotest ignore-on-branch-6 "$testcvs -q up -rbranch2" \
+"$PROG [a-z]*: file2 is no longer in the repository"
+ dotest ignore-on-branch-7 "$testcvs -q up -jbranch" 'U file2'
+
+ cd ../..
+ if $keep; then :; else
+ rm -r ignore-on-branch
+ rm -rf $CVSROOT_DIRNAME/ignore-on-branch
+ fi
;;
binfiles)
@@ -11371,10 +13011,10 @@ Are you sure you want to release (and delete) directory .second-dir': "
"${PROG}"' [a-z]*: scheduling file `binfile'\'' for addition
'"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to add this file permanently'
dotest binfiles-3 "${testcvs} -q ci -m add-it" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/binfile,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/binfile,v
done
Checking in binfile;
-${TESTDIR}/cvsroot/first-dir/binfile,v <-- binfile
+${CVSROOT_DIRNAME}/first-dir/binfile,v <-- binfile
initial revision: 1\.1
done"
cd ../..
@@ -11390,7 +13030,7 @@ done"
File: binfile Status: Up-to-date
Working revision: 1\.1.*
- Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/binfile,v
+ Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/binfile,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: -kb"
@@ -11408,7 +13048,7 @@ File: binfile Status: Up-to-date
File: binfile Status: Up-to-date
Working revision: 1\.1.*
- Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/binfile,v
+ Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/binfile,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: -kb"
@@ -11419,7 +13059,7 @@ File: binfile Status: Up-to-date
cp ../../1/binfile2.dat binfile
dotest binfiles-6 "${testcvs} -q ci -m modify-it" \
"Checking in binfile;
-${TESTDIR}/cvsroot/first-dir/binfile,v <-- binfile
+${CVSROOT_DIRNAME}/first-dir/binfile,v <-- binfile
new revision: 1\.2; previous revision: 1\.1
done"
cd ../../1/first-dir
@@ -11430,7 +13070,7 @@ done"
cp ../binfile.dat binfile
dotest binfiles-con0 "${testcvs} -q ci -m modify-it" \
"Checking in binfile;
-${TESTDIR}/cvsroot/first-dir/binfile,v <-- binfile
+${CVSROOT_DIRNAME}/first-dir/binfile,v <-- binfile
new revision: 1\.3; previous revision: 1\.2
done"
cd ../../2/first-dir
@@ -11447,7 +13087,7 @@ C binfile"
cp ../../1/binfile2.dat binfile
dotest binfiles-con4 "${testcvs} -q ci -m resolve-it" \
"Checking in binfile;
-${TESTDIR}/cvsroot/first-dir/binfile,v <-- binfile
+${CVSROOT_DIRNAME}/first-dir/binfile,v <-- binfile
new revision: 1\.4; previous revision: 1\.3
done"
cd ../../1/first-dir
@@ -11471,7 +13111,7 @@ done"
File: binfile Status: Up-to-date
Working revision: 1\.4.*
- Repository revision: 1\.4 ${TESTDIR}/cvsroot/first-dir/binfile,v
+ Repository revision: 1\.4 ${CVSROOT_DIRNAME}/first-dir/binfile,v
Sticky Tag: HEAD (revision: 1\.4)
Sticky Date: (none)
Sticky Options: -kb"
@@ -11482,7 +13122,7 @@ File: binfile Status: Up-to-date
echo 'this file is $''RCSfile$' >binfile
dotest binfiles-14a "${testcvs} -q ci -m modify-it" \
"Checking in binfile;
-${TESTDIR}/cvsroot/first-dir/binfile,v <-- binfile
+${CVSROOT_DIRNAME}/first-dir/binfile,v <-- binfile
new revision: 1\.5; previous revision: 1\.4
done"
dotest binfiles-14b "cat binfile" 'this file is $''RCSfile$'
@@ -11492,12 +13132,12 @@ done"
File: binfile Status: Up-to-date
Working revision: 1\.5.*
- Repository revision: 1\.5 ${TESTDIR}/cvsroot/first-dir/binfile,v
+ Repository revision: 1\.5 ${CVSROOT_DIRNAME}/first-dir/binfile,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: -kb"
dotest binfiles-14d "${testcvs} admin -kv binfile" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/binfile,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/binfile,v
done"
# cvs admin doesn't change the checked-out file or its sticky
# kopts. There probably should be a way which does (but
@@ -11509,7 +13149,7 @@ done"
File: binfile Status: Up-to-date
Working revision: 1\.5.*
- Repository revision: 1\.5 ${TESTDIR}/cvsroot/first-dir/binfile,v
+ Repository revision: 1\.5 ${CVSROOT_DIRNAME}/first-dir/binfile,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: -kb"
@@ -11520,7 +13160,7 @@ File: binfile Status: Up-to-date
File: binfile Status: Up-to-date
Working revision: 1\.5.*
- Repository revision: 1\.5 ${TESTDIR}/cvsroot/first-dir/binfile,v
+ Repository revision: 1\.5 ${CVSROOT_DIRNAME}/first-dir/binfile,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: -kv"
@@ -11530,10 +13170,10 @@ File: binfile Status: Up-to-date
dotest binfiles-sticky1 "${testcvs} -q add nibfile" \
"${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest binfiles-sticky2 "${testcvs} -q ci -m add-it nibfile" \
- "RCS file: ${TESTDIR}/cvsroot/first-dir/nibfile,v
+ "RCS file: ${CVSROOT_DIRNAME}/first-dir/nibfile,v
done
Checking in nibfile;
-${TESTDIR}/cvsroot/first-dir/nibfile,v <-- nibfile
+${CVSROOT_DIRNAME}/first-dir/nibfile,v <-- nibfile
initial revision: 1\.1
done"
dotest binfiles-sticky3 "${testcvs} -q update -kb nibfile" \
@@ -11543,7 +13183,7 @@ done"
File: nibfile Status: Up-to-date
Working revision: 1\.1.*
- Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/nibfile,v
+ Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/nibfile,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: -kb"
@@ -11556,12 +13196,12 @@ File: nibfile Status: Up-to-date
File: nibfile Status: Up-to-date
Working revision: 1\.1.*
- Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/nibfile,v
+ Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/nibfile,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: (none)"
dotest binfiles-15 "${testcvs} -q admin -kb nibfile" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/nibfile,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/nibfile,v
done"
dotest binfiles-16 "${testcvs} -q update nibfile" "[UP] nibfile"
dotest binfiles-17 "${testcvs} -q status nibfile" \
@@ -11569,23 +13209,23 @@ done"
File: nibfile Status: Up-to-date
Working revision: 1\.1.*
- Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/nibfile,v
+ Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/nibfile,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: -kb"
dotest binfiles-o1 "${testcvs} admin -o1.3:: binfile" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/binfile,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/binfile,v
deleting revision 1\.5
deleting revision 1\.4
done"
dotest binfiles-o2 "${testcvs} admin -o::1.3 binfile" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/binfile,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/binfile,v
deleting revision 1\.2
deleting revision 1\.1
done"
dotest binfiles-o3 "${testcvs} -q log -h -N binfile" "
-RCS file: ${TESTDIR}/cvsroot/first-dir/binfile,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/binfile,v
Working file: binfile
head: 1\.3
branch:
@@ -11652,22 +13292,22 @@ ${PROG} [a-z]*: scheduling file .brmod-trmod. for addition
${PROG} [a-z]*: scheduling file .brmod-wdmod. for addition
${PROG} [a-z]*: use .${PROG} commit. to add these files permanently"
dotest binfiles2-1b "${testcvs} -q ci -m add" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/brmod,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/brmod,v
done
Checking in brmod;
-${TESTDIR}/cvsroot/first-dir/brmod,v <-- brmod
+${CVSROOT_DIRNAME}/first-dir/brmod,v <-- brmod
initial revision: 1\.1
done
-RCS file: ${TESTDIR}/cvsroot/first-dir/brmod-trmod,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/brmod-trmod,v
done
Checking in brmod-trmod;
-${TESTDIR}/cvsroot/first-dir/brmod-trmod,v <-- brmod-trmod
+${CVSROOT_DIRNAME}/first-dir/brmod-trmod,v <-- brmod-trmod
initial revision: 1\.1
done
-RCS file: ${TESTDIR}/cvsroot/first-dir/brmod-wdmod,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/brmod-wdmod,v
done
Checking in brmod-wdmod;
-${TESTDIR}/cvsroot/first-dir/brmod-wdmod,v <-- brmod-wdmod
+${CVSROOT_DIRNAME}/first-dir/brmod-wdmod,v <-- brmod-wdmod
initial revision: 1\.1
done"
dotest binfiles2-2 "${testcvs} -q tag -b br" 'T brmod
@@ -11682,26 +13322,26 @@ ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
cp ../binfile2 brmod-trmod
cp ../binfile2 brmod-wdmod
dotest binfiles2-5 "${testcvs} -q ci -m br-changes" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/Attic/binfile\.dat,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/binfile\.dat,v
done
Checking in binfile\.dat;
-${TESTDIR}/cvsroot/first-dir/Attic/binfile\.dat,v <-- binfile\.dat
+${CVSROOT_DIRNAME}/first-dir/Attic/binfile\.dat,v <-- binfile\.dat
new revision: 1\.1\.2\.1; previous revision: 1\.1
done
Checking in brmod;
-${TESTDIR}/cvsroot/first-dir/brmod,v <-- brmod
+${CVSROOT_DIRNAME}/first-dir/brmod,v <-- brmod
new revision: 1\.1\.2\.1; previous revision: 1\.1
done
Checking in brmod-trmod;
-${TESTDIR}/cvsroot/first-dir/brmod-trmod,v <-- brmod-trmod
+${CVSROOT_DIRNAME}/first-dir/brmod-trmod,v <-- brmod-trmod
new revision: 1\.1\.2\.1; previous revision: 1\.1
done
Checking in brmod-wdmod;
-${TESTDIR}/cvsroot/first-dir/brmod-wdmod,v <-- brmod-wdmod
+${CVSROOT_DIRNAME}/first-dir/brmod-wdmod,v <-- brmod-wdmod
new revision: 1\.1\.2\.1; previous revision: 1\.1
done"
dotest binfiles2-6 "${testcvs} -q update -A" \
-"${PROG} [a-z]*: warning: binfile\.dat is not (any longer) pertinent
+"${PROG} [a-z]*: binfile\.dat is no longer in the repository
[UP] brmod
[UP] brmod-trmod
[UP] brmod-wdmod"
@@ -11710,7 +13350,7 @@ done"
cp ../binfile3 brmod-trmod
dotest binfiles2-7a "${testcvs} -q ci -m tr-modify" \
"Checking in brmod-trmod;
-${TESTDIR}/cvsroot/first-dir/brmod-trmod,v <-- brmod-trmod
+${CVSROOT_DIRNAME}/first-dir/brmod-trmod,v <-- brmod-trmod
new revision: 1\.2; previous revision: 1\.1
done"
cp ../binfile3 brmod-wdmod
@@ -11738,38 +13378,38 @@ C brmod-wdmod"
# Test that everything was properly scheduled.
dotest binfiles2-10 "${testcvs} -q ci -m checkin" \
"Checking in binfile\.dat;
-${TESTDIR}/cvsroot/first-dir/binfile\.dat,v <-- binfile\.dat
+${CVSROOT_DIRNAME}/first-dir/binfile\.dat,v <-- binfile\.dat
new revision: 1\.2; previous revision: 1\.1
done
Checking in brmod;
-${TESTDIR}/cvsroot/first-dir/brmod,v <-- brmod
+${CVSROOT_DIRNAME}/first-dir/brmod,v <-- brmod
new revision: 1\.2; previous revision: 1\.1
done
Checking in brmod-trmod;
-${TESTDIR}/cvsroot/first-dir/brmod-trmod,v <-- brmod-trmod
+${CVSROOT_DIRNAME}/first-dir/brmod-trmod,v <-- brmod-trmod
new revision: 1\.3; previous revision: 1\.2
done
Checking in brmod-wdmod;
-${TESTDIR}/cvsroot/first-dir/brmod-wdmod,v <-- brmod-wdmod
+${CVSROOT_DIRNAME}/first-dir/brmod-wdmod,v <-- brmod-wdmod
new revision: 1\.2; previous revision: 1\.1
done"
dotest_fail binfiles2-o1 "${testcvs} -q admin -o :1.2 brmod-trmod" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/brmod-trmod,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/brmod-trmod,v
deleting revision 1\.2
-${PROG} [a-z]*: ${TESTDIR}/cvsroot/first-dir/brmod-trmod,v: can't remove branch point 1\.1
-${PROG} [a-z]*: cannot modify RCS file for .brmod-trmod."
+${PROG} [a-z]*: ${CVSROOT_DIRNAME}/first-dir/brmod-trmod,v: can't remove branch point 1\.1
+${PROG} [a-z]*: RCS file for .brmod-trmod. not modified\."
dotest binfiles2-o2 "${testcvs} -q admin -o 1.1.2.1: brmod-trmod" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/brmod-trmod,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/brmod-trmod,v
deleting revision 1\.1\.2\.1
done"
dotest binfiles2-o3 "${testcvs} -q admin -o :1.2 brmod-trmod" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/brmod-trmod,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/brmod-trmod,v
deleting revision 1\.2
deleting revision 1\.1
done"
dotest binfiles2-o4 "${testcvs} -q log -N brmod-trmod" "
-RCS file: ${TESTDIR}/cvsroot/first-dir/brmod-trmod,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/brmod-trmod,v
Working file: brmod-trmod
head: 1\.3
branch:
@@ -11804,10 +13444,10 @@ checkin
"${PROG} [a-z]*: scheduling file .file1. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest binfiles3-3 "${testcvs} -q ci -m add-it" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done
Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
initial revision: 1\.1
done"
rm file1
@@ -11816,7 +13456,7 @@ done"
${PROG} [a-z]*: use .${PROG} commit. to remove this file permanently"
dotest binfiles3-5 "${testcvs} -q ci -m remove-it" \
"Removing file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: delete; previous revision: 1\.1
done"
cp ../binfile.dat file1
@@ -11835,11 +13475,11 @@ D"
dotest binfiles3-7 "${testcvs} -q ci -m readd-it" \
"${PROG} [a-z]*: changing keyword expansion mode to -kb
Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.3; previous revision: 1\.2
done"
dotest binfiles3-8 "${testcvs} -q log -h -N file1" "
-RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
Working file: file1
head: 1\.3
branch:
@@ -11859,17 +13499,17 @@ total revisions: 3
cp ../binfile4.dat file1
dotest binfiles3-9 "${testcvs} -q ci -m change" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.4; previous revision: 1\.3
done"
cp ../binfile5.dat file1
dotest binfiles3-10 "${testcvs} -q ci -m change" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.5; previous revision: 1\.4
done"
dotest binfiles3-11 "${testcvs} admin -o 1.3::1.5 file1" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
deleting revision 1\.4
done"
dotest binfiles3-12 "${testcvs} -q update -r 1.3 file1" "U file1"
@@ -11899,98 +13539,98 @@ done"
# For the moment, remote CVS can't pass wrappers from CVSWRAPPERS
# (see wrap_send). So skip these tests for remote.
- if test "x$remote" = xno; then
+ if $remote; then :; else
- mkdir ${CVSROOT_DIRNAME}/first-dir
- mkdir 1; cd 1
- dotest mcopy-1 "${testcvs} -q co first-dir" ''
- cd first-dir
+ mkdir ${CVSROOT_DIRNAME}/first-dir
+ mkdir 1; cd 1
+ dotest mcopy-1 "${testcvs} -q co first-dir" ''
+ cd first-dir
- # FIXCVS: unless a branch has at least one file on it,
- # tag_check_valid won't know it exists. So if brmod didn't
- # exist, we would have to invent it.
- echo 'brmod initial contents' >brmod
- echo 'brmod-trmod initial contents' >brmod-trmod
- echo 'brmod-wdmod initial contents' >brmod-wdmod
- echo "* -m 'COPY'" >.cvswrappers
- dotest mcopy-1a \
+ # FIXCVS: unless a branch has at least one file on it,
+ # tag_check_valid won't know it exists. So if brmod didn't
+ # exist, we would have to invent it.
+ echo 'brmod initial contents' >brmod
+ echo 'brmod-trmod initial contents' >brmod-trmod
+ echo 'brmod-wdmod initial contents' >brmod-wdmod
+ echo "* -m 'COPY'" >.cvswrappers
+ dotest mcopy-1a \
"${testcvs} add .cvswrappers brmod brmod-trmod brmod-wdmod" \
"${PROG} [a-z]*: scheduling file .\.cvswrappers. for addition
${PROG} [a-z]*: scheduling file .brmod. for addition
${PROG} [a-z]*: scheduling file .brmod-trmod. for addition
${PROG} [a-z]*: scheduling file .brmod-wdmod. for addition
${PROG} [a-z]*: use .${PROG} commit. to add these files permanently"
- dotest mcopy-1b "${testcvs} -q ci -m add" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/\.cvswrappers,v
+ dotest mcopy-1b "${testcvs} -q ci -m add" \
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/\.cvswrappers,v
done
Checking in \.cvswrappers;
-${TESTDIR}/cvsroot/first-dir/\.cvswrappers,v <-- \.cvswrappers
+${CVSROOT_DIRNAME}/first-dir/\.cvswrappers,v <-- \.cvswrappers
initial revision: 1\.1
done
-RCS file: ${TESTDIR}/cvsroot/first-dir/brmod,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/brmod,v
done
Checking in brmod;
-${TESTDIR}/cvsroot/first-dir/brmod,v <-- brmod
+${CVSROOT_DIRNAME}/first-dir/brmod,v <-- brmod
initial revision: 1\.1
done
-RCS file: ${TESTDIR}/cvsroot/first-dir/brmod-trmod,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/brmod-trmod,v
done
Checking in brmod-trmod;
-${TESTDIR}/cvsroot/first-dir/brmod-trmod,v <-- brmod-trmod
+${CVSROOT_DIRNAME}/first-dir/brmod-trmod,v <-- brmod-trmod
initial revision: 1\.1
done
-RCS file: ${TESTDIR}/cvsroot/first-dir/brmod-wdmod,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/brmod-wdmod,v
done
Checking in brmod-wdmod;
-${TESTDIR}/cvsroot/first-dir/brmod-wdmod,v <-- brmod-wdmod
+${CVSROOT_DIRNAME}/first-dir/brmod-wdmod,v <-- brmod-wdmod
initial revision: 1\.1
done"
- # NOTE: .cvswrappers files are broken (see comment in
- # src/wrapper.c). So doing everything via the environment
- # variable is a workaround. Better would be to test them
- # both.
- CVSWRAPPERS="* -m 'COPY'"
- export CVSWRAPPERS
- dotest mcopy-2 "${testcvs} -q tag -b br" 'T \.cvswrappers
+ # NOTE: .cvswrappers files are broken (see comment in
+ # src/wrapper.c). So doing everything via the environment
+ # variable is a workaround. Better would be to test them
+ # both.
+ CVSWRAPPERS="* -m 'COPY'"
+ export CVSWRAPPERS
+ dotest mcopy-2 "${testcvs} -q tag -b br" 'T \.cvswrappers
T brmod
T brmod-trmod
T brmod-wdmod'
- dotest mcopy-3 "${testcvs} -q update -r br" ''
- echo 'modify brmod on br' >brmod
- echo 'modify brmod-trmod on br' >brmod-trmod
- echo 'modify brmod-wdmod on br' >brmod-wdmod
- dotest mcopy-5 "${testcvs} -q ci -m br-changes" \
+ dotest mcopy-3 "${testcvs} -q update -r br" ''
+ echo 'modify brmod on br' >brmod
+ echo 'modify brmod-trmod on br' >brmod-trmod
+ echo 'modify brmod-wdmod on br' >brmod-wdmod
+ dotest mcopy-5 "${testcvs} -q ci -m br-changes" \
"Checking in brmod;
-${TESTDIR}/cvsroot/first-dir/brmod,v <-- brmod
+${CVSROOT_DIRNAME}/first-dir/brmod,v <-- brmod
new revision: 1\.1\.2\.1; previous revision: 1\.1
done
Checking in brmod-trmod;
-${TESTDIR}/cvsroot/first-dir/brmod-trmod,v <-- brmod-trmod
+${CVSROOT_DIRNAME}/first-dir/brmod-trmod,v <-- brmod-trmod
new revision: 1\.1\.2\.1; previous revision: 1\.1
done
Checking in brmod-wdmod;
-${TESTDIR}/cvsroot/first-dir/brmod-wdmod,v <-- brmod-wdmod
+${CVSROOT_DIRNAME}/first-dir/brmod-wdmod,v <-- brmod-wdmod
new revision: 1\.1\.2\.1; previous revision: 1\.1
done"
- dotest mcopy-6 "${testcvs} -q update -A" \
+ dotest mcopy-6 "${testcvs} -q update -A" \
"[UP] brmod
[UP] brmod-trmod
[UP] brmod-wdmod"
- dotest mcopy-7 "cat brmod brmod-trmod brmod-wdmod" \
+ dotest mcopy-7 "cat brmod brmod-trmod brmod-wdmod" \
"brmod initial contents
brmod-trmod initial contents
brmod-wdmod initial contents"
- echo 'modify brmod-trmod again on trunk' >brmod-trmod
- dotest mcopy-7a "${testcvs} -q ci -m tr-modify" \
+ echo 'modify brmod-trmod again on trunk' >brmod-trmod
+ dotest mcopy-7a "${testcvs} -q ci -m tr-modify" \
"Checking in brmod-trmod;
-${TESTDIR}/cvsroot/first-dir/brmod-trmod,v <-- brmod-trmod
+${CVSROOT_DIRNAME}/first-dir/brmod-trmod,v <-- brmod-trmod
new revision: 1\.2; previous revision: 1\.1
done"
- echo 'modify brmod-wdmod in working dir' >brmod-wdmod
+ echo 'modify brmod-wdmod in working dir' >brmod-wdmod
- dotest mcopy-8 "${testcvs} -q update -j br" \
+ dotest mcopy-8 "${testcvs} -q update -j br" \
"U brmod
${PROG} [a-z]*: nonmergeable file needs merge
${PROG} [a-z]*: revision 1.1.2.1 from repository is now in brmod-trmod
@@ -12002,34 +13642,34 @@ ${PROG} [a-z]*: revision 1.1.2.1 from repository is now in brmod-wdmod
${PROG} [a-z]*: file from working directory is now in .#brmod-wdmod.1.1
C brmod-wdmod"
- dotest mcopy-9 "cat brmod brmod-trmod brmod-wdmod" \
+ dotest mcopy-9 "cat brmod brmod-trmod brmod-wdmod" \
"modify brmod on br
modify brmod-trmod on br
modify brmod-wdmod on br"
- dotest mcopy-9a "cat .#brmod-trmod.1.2 .#brmod-wdmod.1.1" \
+ dotest mcopy-9a "cat .#brmod-trmod.1.2 .#brmod-wdmod.1.1" \
"modify brmod-trmod again on trunk
modify brmod-wdmod in working dir"
- # Test that everything was properly scheduled.
- dotest mcopy-10 "${testcvs} -q ci -m checkin" \
+ # Test that everything was properly scheduled.
+ dotest mcopy-10 "${testcvs} -q ci -m checkin" \
"Checking in brmod;
-${TESTDIR}/cvsroot/first-dir/brmod,v <-- brmod
+${CVSROOT_DIRNAME}/first-dir/brmod,v <-- brmod
new revision: 1\.2; previous revision: 1\.1
done
Checking in brmod-trmod;
-${TESTDIR}/cvsroot/first-dir/brmod-trmod,v <-- brmod-trmod
+${CVSROOT_DIRNAME}/first-dir/brmod-trmod,v <-- brmod-trmod
new revision: 1\.3; previous revision: 1\.2
done
Checking in brmod-wdmod;
-${TESTDIR}/cvsroot/first-dir/brmod-wdmod,v <-- brmod-wdmod
+${CVSROOT_DIRNAME}/first-dir/brmod-wdmod,v <-- brmod-wdmod
new revision: 1\.2; previous revision: 1\.1
done"
- cd ..
- cd ..
+ cd ..
+ cd ..
- rm -rf ${CVSROOT_DIRNAME}/first-dir
- rm -r 1
- unset CVSWRAPPERS
+ rm -rf ${CVSROOT_DIRNAME}/first-dir
+ rm -r 1
+ unset CVSWRAPPERS
fi # end of tests to be skipped for remote
@@ -12063,7 +13703,7 @@ U first-dir/foo.exe'
File: foo\.c Status: Up-to-date
Working revision: 1\.1\.1\.1.*
- Repository revision: 1\.1\.1\.1 ${TESTDIR}/cvsroot/first-dir/foo\.c,v
+ Repository revision: 1\.1\.1\.1 ${CVSROOT_DIRNAME}/first-dir/foo\.c,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: (none)
@@ -12072,7 +13712,7 @@ File: foo\.c Status: Up-to-date
File: foo\.exe Status: Up-to-date
Working revision: 1\.1\.1\.1.*
- Repository revision: 1\.1\.1\.1 ${TESTDIR}/cvsroot/first-dir/foo\.exe,v
+ Repository revision: 1\.1\.1\.1 ${CVSROOT_DIRNAME}/first-dir/foo\.exe,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: -kb"
@@ -12108,7 +13748,7 @@ U first-dir/foo.exe'
File: foo\.c Status: Up-to-date
Working revision: 1\.1\.1\.1.*
- Repository revision: 1\.1\.1\.1 ${TESTDIR}/cvsroot/first-dir/foo\.c,v
+ Repository revision: 1\.1\.1\.1 ${CVSROOT_DIRNAME}/first-dir/foo\.c,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: -ko
@@ -12117,7 +13757,7 @@ File: foo\.c Status: Up-to-date
File: foo\.exe Status: Up-to-date
Working revision: 1\.1\.1\.1.*
- Repository revision: 1\.1\.1\.1 ${TESTDIR}/cvsroot/first-dir/foo\.exe,v
+ Repository revision: 1\.1\.1\.1 ${CVSROOT_DIRNAME}/first-dir/foo\.exe,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: -kb"
@@ -12231,7 +13871,7 @@ File: foo\.exe Status: Up-to-date
echo "foo*.sb -k 'b'" > cvswrappers
dotest binwrap3-2 "${testcvs} -q ci -m cvswrappers-mod" \
"Checking in cvswrappers;
-${TESTDIR}/cvsroot/CVSROOT/cvswrappers,v <-- cvswrappers
+${CVSROOT_DIRNAME}/CVSROOT/cvswrappers,v <-- cvswrappers
new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
done
${PROG} [a-z]*: Rebuilding administrative file database"
@@ -12265,16 +13905,16 @@ ${PROG} [a-z]*: Rebuilding administrative file database"
${PROG} [a-z]*: scheduling file .file1\.txt. for addition
${PROG} [a-z]*: use .${PROG} commit. to add these files permanently"
dotest binwrap3-2d "${testcvs} -q ci -m add" \
-"RCS file: ${TESTDIR}/cvsroot/binwrap3/sub2/file1\.newbin,v
+"RCS file: ${CVSROOT_DIRNAME}/binwrap3/sub2/file1\.newbin,v
done
Checking in file1\.newbin;
-${TESTDIR}/cvsroot/binwrap3/sub2/file1\.newbin,v <-- file1\.newbin
+${CVSROOT_DIRNAME}/binwrap3/sub2/file1\.newbin,v <-- file1\.newbin
initial revision: 1\.1
done
-RCS file: ${TESTDIR}/cvsroot/binwrap3/sub2/file1\.txt,v
+RCS file: ${CVSROOT_DIRNAME}/binwrap3/sub2/file1\.txt,v
done
Checking in file1\.txt;
-${TESTDIR}/cvsroot/binwrap3/sub2/file1\.txt,v <-- file1\.txt
+${CVSROOT_DIRNAME}/binwrap3/sub2/file1\.txt,v <-- file1\.txt
initial revision: 1\.1
done"
cd ..
@@ -12390,7 +14030,7 @@ done"
echo "* -m 'COPY'" >>cvswrappers
dotest mwrap-c2 "${testcvs} -q ci -m wrapper-mod" \
"Checking in cvswrappers;
-${TESTDIR}/cvsroot/CVSROOT/cvswrappers,v <-- cvswrappers
+${CVSROOT_DIRNAME}/CVSROOT/cvswrappers,v <-- cvswrappers
new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
done
${PROG} [a-z]*: Rebuilding administrative file database"
@@ -12399,17 +14039,17 @@ ${PROG} [a-z]*: Rebuilding administrative file database"
dotest mwrap-1 "${testcvs} -q co -l ." ''
mkdir first-dir
dotest mwrap-2 "${testcvs} add first-dir" \
-"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
cd first-dir
touch aa
dotest mwrap-3 "${testcvs} add aa" \
"${PROG} [a-z]*: scheduling file .aa. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest mwrap-4 "${testcvs} -q ci -m add" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/aa,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/aa,v
done
Checking in aa;
-${TESTDIR}/cvsroot/first-dir/aa,v <-- aa
+${CVSROOT_DIRNAME}/first-dir/aa,v <-- aa
initial revision: 1\.1
done"
cd ../..
@@ -12419,20 +14059,13 @@ done"
echo "changed in m2" >aa
dotest mwrap-6 "${testcvs} -q ci -m m2-mod" \
"Checking in aa;
-${TESTDIR}/cvsroot/first-dir/aa,v <-- aa
+${CVSROOT_DIRNAME}/first-dir/aa,v <-- aa
new revision: 1\.2; previous revision: 1\.1
done"
cd ../..
cd m1/first-dir
echo "changed in m1" >aa
- if test "$remote" = no; then
- dotest mwrap-7 "${testcvs} -nq update" \
-"U aa
-${PROG} [a-z]*: nonmergeable file needs merge
-${PROG} [a-z]*: revision 1\.2 from repository is now in aa
-${PROG} [a-z]*: file from working directory is now in \.#aa\.1\.1
-C aa"
- else
+ if $remote; then
# The tagged text code swallows up "U aa" but isn't yet up to
# trying to figure out how it interacts with the "C aa" and
# other stuff. The whole deal of having both is pretty iffy.
@@ -12442,6 +14075,13 @@ ${PROG} [a-z]*: revision 1\.2 from repository is now in aa
${PROG} [a-z]*: file from working directory is now in \.#aa\.1\.1
C aa
U aa"
+ else
+ dotest mwrap-7 "${testcvs} -nq update" \
+"U aa
+${PROG} [a-z]*: nonmergeable file needs merge
+${PROG} [a-z]*: revision 1\.2 from repository is now in aa
+${PROG} [a-z]*: file from working directory is now in \.#aa\.1\.1
+C aa"
fi
dotest mwrap-8 "${testcvs} -q update" \
"U aa
@@ -12456,7 +14096,7 @@ C aa"
echo '# comment out' >cvswrappers
dotest mwrap-ce "${testcvs} -q ci -m wrapper-mod" \
"Checking in cvswrappers;
-${TESTDIR}/cvsroot/CVSROOT/cvswrappers,v <-- cvswrappers
+${CVSROOT_DIRNAME}/CVSROOT/cvswrappers,v <-- cvswrappers
new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
done
${PROG} [a-z]*: Rebuilding administrative file database"
@@ -12505,7 +14145,7 @@ ${PROG} [a-z]*: Rebuilding administrative file database"
dotest info-3 "${testcvs} -q ci -m new-loginfo" \
"Checking in loginfo;
-${TESTDIR}/cvsroot/CVSROOT/loginfo,v <-- loginfo
+${CVSROOT_DIRNAME}/CVSROOT/loginfo,v <-- loginfo
new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
done
${PROG} [a-z]*: Rebuilding administrative file database"
@@ -12520,28 +14160,28 @@ ${PROG} [a-z]*: Rebuilding administrative file database"
'"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to add this file permanently'
echo "cvs -s OTHER=not-this -s MYENV=env-" >>$HOME/.cvsrc
dotest info-6a "${testcvs} -q -s OTHER=value ci -m add-it" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done
Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
initial revision: 1\.1
done
${PROG} [a-z]*: loginfo:1: no such user variable \${=ZEE}"
echo line0 >>file1
dotest info-6b "${testcvs} -q -sOTHER=foo ci -m mod-it" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.2; previous revision: 1\.1
done
${PROG} [a-z]*: loginfo:1: no such user variable \${=ZEE}"
echo line1 >>file1
dotest info-7 "${testcvs} -q -s OTHER=value -s ZEE=z ci -m mod-it" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.3; previous revision: 1\.2
done"
cd ..
- dotest info-9 "cat $TESTDIR/testlog" "xenv-valueyz=${username}=${TESTDIR}/cvsroot="
+ dotest info-9 "cat $TESTDIR/testlog" "xenv-valueyz=${username}=${CVSROOT_DIRNAME}="
dotest info-10 "cat $TESTDIR/testlog2" 'first-dir file1,NONE,1.1
first-dir 1.1
first-dir file1
@@ -12562,7 +14202,7 @@ first-dir file1ux'
echo '# do nothing' >loginfo
dotest info-11 "${testcvs} -q -s ZEE=garbage ci -m nuke-loginfo" \
"Checking in loginfo;
-${TESTDIR}/cvsroot/CVSROOT/loginfo,v <-- loginfo
+${CVSROOT_DIRNAME}/CVSROOT/loginfo,v <-- loginfo
new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
done
${PROG} [a-z]*: Rebuilding administrative file database"
@@ -12582,7 +14222,7 @@ EOF
echo "^first-dir ${TESTDIR}/vscript" >>verifymsg
dotest info-v1 "${testcvs} -q ci -m add-verification" \
"Checking in verifymsg;
-${TESTDIR}/cvsroot/CVSROOT/verifymsg,v <-- verifymsg
+${CVSROOT_DIRNAME}/CVSROOT/verifymsg,v <-- verifymsg
new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
done
${PROG} [a-z]*: Rebuilding administrative file database"
@@ -12599,7 +14239,7 @@ and many more lines after it
EOF
dotest info-v3 "${testcvs} -q ci -F ${TESTDIR}/comment.tmp" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.4; previous revision: 1\.3
done"
cd ..
@@ -12618,7 +14258,7 @@ ${PROG} \[[a-z]* aborted\]: Message verification failed"
echo '# do nothing' >verifymsg
dotest info-cleanup-verifymsg "${testcvs} -q ci -m nuke-verifymsg" \
"Checking in verifymsg;
-${TESTDIR}/cvsroot/CVSROOT/verifymsg,v <-- verifymsg
+${CVSROOT_DIRNAME}/CVSROOT/verifymsg,v <-- verifymsg
new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
done
${PROG} [a-z]*: Rebuilding administrative file database"
@@ -12666,7 +14306,7 @@ EOF
echo "ALL ${TESTDIR}/1/loggit" >taginfo
dotest taginfo-2 "${testcvs} -q ci -m check-in-taginfo" \
"Checking in taginfo;
-${TESTDIR}/cvsroot/CVSROOT/taginfo,v <-- taginfo
+${CVSROOT_DIRNAME}/CVSROOT/taginfo,v <-- taginfo
new revision: 1\.2; previous revision: 1\.1
done
${PROG} [a-z]*: Rebuilding administrative file database"
@@ -12685,10 +14325,10 @@ ${PROG} [a-z]*: Rebuilding administrative file database"
"${PROG} [a-z]*: scheduling file .file1. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest taginfo-5 "${testcvs} -q ci -m add-it" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done
Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
initial revision: 1\.1
done"
dotest taginfo-6 "${testcvs} -q tag tag1" "T file1"
@@ -12697,7 +14337,7 @@ done"
echo add text on branch >>file1
dotest taginfo-9 "${testcvs} -q ci -m modify-on-br" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.1\.2\.1; previous revision: 1\.1
done"
dotest taginfo-10 "${testcvs} -q tag -F -c brtag" "T file1"
@@ -12738,21 +14378,21 @@ ${PROG} \[[a-z]* aborted\]: correct the above errors first!"
# I suppose passing "1.1.branch" or "branch" for "br"
# would be an improvement.
dotest taginfo-examine "cat ${TESTDIR}/1/taglog" \
-"tag1 add ${TESTDIR}/cvsroot/first-dir file1 1.1
-br add ${TESTDIR}/cvsroot/first-dir file1 1.1
-brtag mov ${TESTDIR}/cvsroot/first-dir file1 1.1.2.1
-tag1 del ${TESTDIR}/cvsroot/first-dir file1 1.1
-tag1 del ${TESTDIR}/cvsroot/first-dir
-tag1 add ${TESTDIR}/cvsroot/first-dir file1 1.1
-tag1 del ${TESTDIR}/cvsroot/first-dir file1 1.1
-tag1 del ${TESTDIR}/cvsroot/first-dir"
+"tag1 add ${CVSROOT_DIRNAME}/first-dir file1 1.1
+br add ${CVSROOT_DIRNAME}/first-dir file1 1.1
+brtag mov ${CVSROOT_DIRNAME}/first-dir file1 1.1.2.1
+tag1 del ${CVSROOT_DIRNAME}/first-dir file1 1.1
+tag1 del ${CVSROOT_DIRNAME}/first-dir
+tag1 add ${CVSROOT_DIRNAME}/first-dir file1 1.1
+tag1 del ${CVSROOT_DIRNAME}/first-dir file1 1.1
+tag1 del ${CVSROOT_DIRNAME}/first-dir"
cd ..
cd CVSROOT
echo '# Keep life simple' > taginfo
dotest taginfo-cleanup-1 "${testcvs} -q ci -m check-in-taginfo" \
"Checking in taginfo;
-${TESTDIR}/cvsroot/CVSROOT/taginfo,v <-- taginfo
+${CVSROOT_DIRNAME}/CVSROOT/taginfo,v <-- taginfo
new revision: 1\.3; previous revision: 1\.2
done
${PROG} [a-z]*: Rebuilding administrative file database"
@@ -12778,23 +14418,23 @@ ${PROG} [a-z]*: Rebuilding administrative file database"
# might need to modify CVSROOT/config
dotest config-3 "${testcvs} -q ci -m change-to-bogus-line" \
"Checking in config;
-${TESTDIR}/cvsroot/CVSROOT/config,v <-- config
+${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
done
${PROG} [a-z]*: Rebuilding administrative file database"
echo 'BogusOption=yes' >config
dotest config-4 "${testcvs} -q ci -m change-to-bogus-opt" \
-"${PROG} [a-z]*: syntax error in ${TESTDIR}/cvsroot/CVSROOT/config: line 'bogus line' is missing '='
+"${PROG} [a-z]*: syntax error in ${CVSROOT_DIRNAME}/CVSROOT/config: line 'bogus line' is missing '='
Checking in config;
-${TESTDIR}/cvsroot/CVSROOT/config,v <-- config
+${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
done
${PROG} [a-z]*: Rebuilding administrative file database"
echo '# No config is a good config' > config
dotest config-5 "${testcvs} -q ci -m change-to-comment" \
-"${PROG} [a-z]*: ${TESTDIR}/cvsroot/CVSROOT/config: unrecognized keyword 'BogusOption'
+"${PROG} [a-z]*: ${CVSROOT_DIRNAME}/CVSROOT/config: unrecognized keyword 'BogusOption'
Checking in config;
-${TESTDIR}/cvsroot/CVSROOT/config,v <-- config
+${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
done
${PROG} [a-z]*: Rebuilding administrative file database"
@@ -12826,10 +14466,10 @@ ${PROG} [a-z]*: Rebuilding administrative file database"
'"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to add this file permanently'
dotest serverpatch-3 "${testcvs} -q commit -m add" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done
Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
initial revision: 1\.1
done"
@@ -12852,7 +14492,7 @@ done"
echo '2' >> file1
dotest serverpatch-7 "${testcvs} -q ci -mx file1" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.2; previous revision: 1\.1
done"
@@ -12903,10 +14543,10 @@ U file1'
echo ' ' >>${TESTDIR}/comment.tmp
echo ' ' >>${TESTDIR}/comment.tmp
dotest log-3 "${testcvs} -q commit -F ${TESTDIR}/comment.tmp" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done
Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
initial revision: 1\.1
done"
rm -f ${TESTDIR}/comment.tmp
@@ -12914,7 +14554,7 @@ done"
echo 'second revision' > file1
dotest log-4 "${testcvs} -q ci -m2 file1" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.2; previous revision: 1\.1
done"
@@ -12923,7 +14563,7 @@ done"
echo 'third revision' > file1
dotest log-6 "${testcvs} -q ci -m3 file1" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.3; previous revision: 1\.2
done"
@@ -12932,7 +14572,7 @@ done"
echo 'first branch revision' > file1
dotest log-8 "${testcvs} -q ci -m1b file1" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.2\.2\.1; previous revision: 1\.2
done"
@@ -12941,19 +14581,25 @@ done"
echo 'second branch revision' > file1
dotest log-10 "${testcvs} -q ci -m2b file1" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.2\.2\.2; previous revision: 1\.2\.2\.1
done"
# Set up a bunch of shell variables to make the later tests
# easier to describe.=
log_header="
-RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
Working file: file1
head: 1\.3
branch:
locks: strict
access list:"
+ rlog_header="
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
+head: 1\.3
+branch:
+locks: strict
+access list:"
log_tags='symbolic names:
tag: 1\.2\.2\.1
branch: 1\.2\.0\.2'
@@ -13077,6 +14723,13 @@ total revisions: 5; selected revisions: 1
description:
${log_rev3}
${log_trailer}"
+ dotest log-14f "${testcvs} log -r:: file1" \
+"${log_header}
+${log_tags}
+${log_header2}
+total revisions: 5; selected revisions: 0
+description:
+${log_trailer}"
dotest log-15 "${testcvs} log -r1.2 file1" \
"${log_header}
@@ -13151,6 +14804,15 @@ ${log_rev3}
${log_rev2}
${log_trailer}"
+ dotest log-20a "${testcvs} log -r1.2:: file1" \
+"${log_header}
+${log_tags}
+${log_header2}
+total revisions: 5; selected revisions: 1
+description:
+${log_rev3}
+${log_trailer}"
+
dotest log-21 "${testcvs} log -r:1.2 file1" \
"${log_header}
${log_tags}
@@ -13161,6 +14823,15 @@ ${log_rev2}
${log_rev1}
${log_trailer}"
+ dotest log-21a "${testcvs} log -r::1.2 file1" \
+"${log_header}
+${log_tags}
+${log_header2}
+total revisions: 5; selected revisions: 1
+description:
+${log_rev1}
+${log_trailer}"
+
dotest log-22 "${testcvs} log -r1.1:1.2 file1" \
"${log_header}
${log_tags}
@@ -13171,14 +14842,253 @@ ${log_rev2}
${log_rev1}
${log_trailer}"
+ dotest log-22a "${testcvs} log -r1.1::1.2 file1" \
+"${log_header}
+${log_tags}
+${log_header2}
+total revisions: 5; selected revisions: 0
+description:
+${log_trailer}"
+
+ dotest log-22b "${testcvs} log -r1.1::1.3 file1" \
+"${log_header}
+${log_tags}
+${log_header2}
+total revisions: 5; selected revisions: 1
+description:
+${log_rev2}
+${log_trailer}"
+
+ # Now the same tests but with rlog
+
+ dotest log-r11 "${testcvs} rlog first-dir/file1" \
+"${rlog_header}
+${log_tags}
+${log_header2}
+total revisions: 5; selected revisions: 5
+description:
+${log_rev3}
+${log_rev2}
+${log_rev1}
+${log_rev2b}
+${log_rev1b}
+${log_trailer}"
+
+ dotest log-r12 "${testcvs} rlog -N first-dir/file1" \
+"${rlog_header}
+${log_header2}
+total revisions: 5; selected revisions: 5
+description:
+${log_rev3}
+${log_rev2}
+${log_rev1}
+${log_rev2b}
+${log_rev1b}
+${log_trailer}"
+
+ dotest log-r13 "${testcvs} rlog -b first-dir/file1" \
+"${rlog_header}
+${log_tags}
+${log_header2}
+total revisions: 5; selected revisions: 3
+description:
+${log_rev3}
+${log_rev2}
+${log_rev1}
+${log_trailer}"
+
+ dotest log-r14 "${testcvs} rlog -r first-dir/file1" \
+"${rlog_header}
+${log_tags}
+${log_header2}
+total revisions: 5; selected revisions: 1
+description:
+${log_rev3}
+${log_trailer}"
+
+ dotest log-r14a "${testcvs} rlog -rHEAD first-dir/file1" \
+"${rlog_header}
+${log_tags}
+${log_header2}
+total revisions: 5; selected revisions: 1
+description:
+${log_rev3}
+${log_trailer}"
+
+ dotest_fail log-r14b "${testcvs} rlog -r HEAD first-dir/file1" \
+"${PROG} [a-z]*: cannot find module .HEAD. - ignored
+${rlog_header}
+${log_tags}
+${log_header2}
+total revisions: 5; selected revisions: 1
+description:
+${log_rev3}
+${log_trailer}"
+
+ dotest log-r14c "${testcvs} rlog -r: first-dir/file1" \
+"${rlog_header}
+${log_tags}
+${log_header2}
+total revisions: 5; selected revisions: 1
+description:
+${log_rev3}
+${log_trailer}"
+ dotest log-r14d "${testcvs} rlog -r, first-dir/file1" \
+"${rlog_header}
+${log_tags}
+${log_header2}
+total revisions: 5; selected revisions: 1
+description:
+${log_rev3}
+${log_trailer}"
+ dotest log-r14e "${testcvs} rlog -r. first-dir/file1" \
+"${rlog_header}
+${log_tags}
+${log_header2}
+total revisions: 5; selected revisions: 1
+description:
+${log_rev3}
+${log_trailer}"
+ dotest log-r14f "${testcvs} rlog -r:: first-dir/file1" \
+"${rlog_header}
+${log_tags}
+${log_header2}
+total revisions: 5; selected revisions: 0
+description:
+${log_trailer}"
+
+ dotest log-r15 "${testcvs} rlog -r1.2 first-dir/file1" \
+"${rlog_header}
+${log_tags}
+${log_header2}
+total revisions: 5; selected revisions: 1
+description:
+${log_rev2}
+${log_trailer}"
+
+ dotest log-r16 "${testcvs} rlog -r1.2.2 first-dir/file1" \
+"${rlog_header}
+${log_tags}
+${log_header2}
+total revisions: 5; selected revisions: 2
+description:
+${log_rev2b}
+${log_rev1b}
+${log_trailer}"
+
+ dotest log-r17 "${testcvs} rlog -rbranch first-dir/file1" \
+"${rlog_header}
+${log_tags}
+${log_header2}
+total revisions: 5; selected revisions: 2
+description:
+${log_rev2b}
+${log_rev1b}
+${log_trailer}"
+
+ dotest log-r18 "${testcvs} rlog -r1.2.2. first-dir/file1" \
+"${rlog_header}
+${log_tags}
+${log_header2}
+total revisions: 5; selected revisions: 1
+description:
+${log_rev2b}
+${log_trailer}"
+
+ dotest log-r18a "${testcvs} rlog -r1.2.2.2 -r1.3:1.3 first-dir/file1" \
+"${rlog_header}
+${log_tags}
+${log_header2}
+total revisions: 5; selected revisions: 2
+description:
+${log_rev3}
+${log_rev2b}
+${log_trailer}"
+
+ dotest log-r19 "${testcvs} rlog -rbranch. first-dir/file1" \
+"${rlog_header}
+${log_tags}
+${log_header2}
+total revisions: 5; selected revisions: 1
+description:
+${log_rev2b}
+${log_trailer}"
+
+ dotest log-r20 "${testcvs} rlog -r1.2: first-dir/file1" \
+"${rlog_header}
+${log_tags}
+${log_header2}
+total revisions: 5; selected revisions: 2
+description:
+${log_rev3}
+${log_rev2}
+${log_trailer}"
+
+ dotest log-r20a "${testcvs} rlog -r1.2:: first-dir/file1" \
+"${rlog_header}
+${log_tags}
+${log_header2}
+total revisions: 5; selected revisions: 1
+description:
+${log_rev3}
+${log_trailer}"
+
+ dotest log-r21 "${testcvs} rlog -r:1.2 first-dir/file1" \
+"${rlog_header}
+${log_tags}
+${log_header2}
+total revisions: 5; selected revisions: 2
+description:
+${log_rev2}
+${log_rev1}
+${log_trailer}"
+
+ dotest log-r21a "${testcvs} rlog -r::1.2 first-dir/file1" \
+"${rlog_header}
+${log_tags}
+${log_header2}
+total revisions: 5; selected revisions: 1
+description:
+${log_rev1}
+${log_trailer}"
+
+ dotest log-r22 "${testcvs} rlog -r1.1:1.2 first-dir/file1" \
+"${rlog_header}
+${log_tags}
+${log_header2}
+total revisions: 5; selected revisions: 2
+description:
+${log_rev2}
+${log_rev1}
+${log_trailer}"
+
+ dotest log-r22a "${testcvs} rlog -r1.1::1.2 first-dir/file1" \
+"${rlog_header}
+${log_tags}
+${log_header2}
+total revisions: 5; selected revisions: 0
+description:
+${log_trailer}"
+
+ dotest log-r22b "${testcvs} rlog -r1.1::1.3 first-dir/file1" \
+"${rlog_header}
+${log_tags}
+${log_header2}
+total revisions: 5; selected revisions: 1
+description:
+${log_rev2}
+${log_trailer}"
+
+ # Now test outdating revisions
+
dotest log-o0 "${testcvs} admin -o 1.2.2.2:: file1" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done"
dotest log-o1 "${testcvs} admin -o ::1.2.2.1 file1" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done"
dotest log-o2 "${testcvs} admin -o 1.2.2.1:: file1" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
deleting revision 1\.2\.2\.2
done"
dotest log-o3 "${testcvs} log file1" \
@@ -13192,6 +15102,17 @@ ${log_rev2}
${log_rev1}
${log_rev1b}
${log_trailer}"
+ dotest log-ro3 "${testcvs} rlog first-dir/file1" \
+"${rlog_header}
+${log_tags}
+${log_header2}
+total revisions: 4; selected revisions: 4
+description:
+${log_rev3}
+${log_rev2}
+${log_rev1}
+${log_rev1b}
+${log_trailer}"
dotest log-o4 "${testcvs} -q update -p -r 1.2.2.1 file1" \
"first branch revision"
cd ..
@@ -13211,18 +15132,18 @@ ${log_trailer}"
"${PROG}"' [a-z]*: scheduling file `file1'\'' for addition
'"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to add this file permanently'
dotest log2-3 "${testcvs} -q commit -m 1" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done
Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
initial revision: 1\.1
done"
# Setting the file description with add -m doesn't yet work
# client/server, so skip log2-4 for remote.
- if test "x$remote" = xno; then
+ if $remote; then :; else
- dotest log2-4 "${testcvs} log -N file1" "
-RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+ dotest log2-4 "${testcvs} log -N file1" "
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
Working file: file1
head: 1\.1
branch:
@@ -13241,10 +15162,10 @@ date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
fi # end of tests skipped for remote
dotest log2-5 "${testcvs} admin -t-change-description file1" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done"
dotest log2-6 "${testcvs} log -N file1" "
-RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
Working file: file1
head: 1\.1
branch:
@@ -13263,12 +15184,12 @@ date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
echo 'longer description' >${TESTDIR}/descrip
echo 'with two lines' >>${TESTDIR}/descrip
dotest log2-7 "${testcvs} admin -t${TESTDIR}/descrip file1" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done"
dotest_fail log2-7a "${testcvs} admin -t${TESTDIR}/nonexist file1" \
"${PROG} \[[a-z]* aborted\]: can't stat ${TESTDIR}/nonexist: No such file or directory"
dotest log2-8 "${testcvs} log -N file1" "
-RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
Working file: file1
head: 1\.1
branch:
@@ -13292,7 +15213,7 @@ date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
dotest log2-9 "echo change from stdin | ${testcvs} admin -t -q file1" ""
dotest log2-10 "${testcvs} log -N file1" "
-RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
Working file: file1
head: 1\.1
branch:
@@ -13321,17 +15242,17 @@ date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
dotest logopt-1 "${testcvs} -q co -l ." ''
mkdir first-dir
dotest logopt-2 "${testcvs} add first-dir" \
-"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
cd first-dir
echo hi >file1
dotest logopt-3 "${testcvs} add file1" \
"${PROG} [a-z]*: scheduling file .file1. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest logopt-4 "${testcvs} -q ci -m add file1" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done
Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
initial revision: 1\.1
done"
cd ..
@@ -13339,19 +15260,19 @@ done"
dotest logopt-5 "${testcvs} log -R -d 2038-01-01" \
"${PROG} [a-z]*: Logging \.
${PROG} [a-z]*: Logging first-dir
-${TESTDIR}/cvsroot/first-dir/file1,v"
+${CVSROOT_DIRNAME}/first-dir/file1,v"
dotest logopt-6 "${testcvs} log -d 2038-01-01 -R" \
"${PROG} [a-z]*: Logging \.
${PROG} [a-z]*: Logging first-dir
-${TESTDIR}/cvsroot/first-dir/file1,v"
+${CVSROOT_DIRNAME}/first-dir/file1,v"
dotest logopt-6a "${testcvs} log -Rd 2038-01-01" \
"${PROG} [a-z]*: Logging \.
${PROG} [a-z]*: Logging first-dir
-${TESTDIR}/cvsroot/first-dir/file1,v"
+${CVSROOT_DIRNAME}/first-dir/file1,v"
dotest logopt-7 "${testcvs} log -s Exp -R" \
"${PROG} [a-z]*: Logging \.
${PROG} [a-z]*: Logging first-dir
-${TESTDIR}/cvsroot/first-dir/file1,v"
+${CVSROOT_DIRNAME}/first-dir/file1,v"
cd ..
rm -r 1
@@ -13367,7 +15288,7 @@ ${TESTDIR}/cvsroot/first-dir/file1,v"
dotest ann-1 "${testcvs} -q co -l ." ''
mkdir first-dir
dotest ann-2 "${testcvs} add first-dir" \
-"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
cd first-dir
cat >file1 <<EOF
this
@@ -13380,10 +15301,10 @@ EOF
"${PROG} [a-z]*: scheduling file .file1. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest ann-4 "${testcvs} -q ci -m add file1" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done
Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
initial revision: 1\.1
done"
cat >file1 <<EOF
@@ -13399,7 +15320,7 @@ line
EOF
dotest ann-5 "${testcvs} -q ci -m modify file1" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.2; previous revision: 1\.1
done"
dotest ann-6 "${testcvs} -q tag -b br" "T file1"
@@ -13416,7 +15337,7 @@ line
EOF
dotest ann-7 "${testcvs} -q ci -m modify file1" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.3; previous revision: 1\.2
done"
dotest ann-8 "${testcvs} -q update -r br" "[UP] file1"
@@ -13435,7 +15356,7 @@ branched content
EOF
dotest ann-9 "${testcvs} -q ci -m modify" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.2\.2\.1; previous revision: 1\.2
done"
# Note that this annotates the trunk despite the presence
@@ -13487,8 +15408,54 @@ done"
dotest_fail ann-14 "${testcvs} ann -r bill-clintons-chastity file1" \
"${PROG} \[[a-z]* aborted\]: no such tag bill-clintons-chastity"
+ # Now get rid of the working directory and test rannotate
+
cd ../..
rm -r 1
+ dotest ann-r10 "${testcvs} rann first-dir" \
+"Annotations for first-dir/file1
+\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
+1\.1 (${username} *[0-9a-zA-Z-]*): this
+1\.1 (${username} *[0-9a-zA-Z-]*): is
+1\.2 (${username} *[0-9a-zA-Z-]*): a
+1\.3 (${username} *[0-9a-zA-Z-]*): trunk file
+1\.2 (${username} *[0-9a-zA-Z-]*):
+1\.2 (${username} *[0-9a-zA-Z-]*): with
+1\.2 (${username} *[0-9a-zA-Z-]*): a
+1\.2 (${username} *[0-9a-zA-Z-]*): blank
+1\.2 (${username} *[0-9a-zA-Z-]*): line"
+ dotest ann-r11 "${testcvs} rann -r br first-dir" \
+"Annotations for first-dir/file1
+\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
+1\.1 (${username} *[0-9a-zA-Z-]*): this
+1\.1 (${username} *[0-9a-zA-Z-]*): is
+1\.2 (${username} *[0-9a-zA-Z-]*): a
+1\.1 (${username} *[0-9a-zA-Z-]*): file
+1\.2 (${username} *[0-9a-zA-Z-]*):
+1\.2 (${username} *[0-9a-zA-Z-]*): with
+1\.2 (${username} *[0-9a-zA-Z-]*): a
+1\.2 (${username} *[0-9a-zA-Z-]*): blank
+1\.2 (${username} *[0-9a-zA-Z-]*): line
+1\.2\.2\.1 (${username} *[0-9a-zA-Z-]*): and some
+1\.2\.2\.1 (${username} *[0-9a-zA-Z-]*): branched content"
+ dotest ann-r12 "${testcvs} rann -r 1.2.0.2 first-dir/file1" ""
+ dotest ann-r13 "${testcvs} rann -r 1.2.2 first-dir/file1" \
+"Annotations for first-dir/file1
+\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
+1\.1 (${username} *[0-9a-zA-Z-]*): this
+1\.1 (${username} *[0-9a-zA-Z-]*): is
+1\.2 (${username} *[0-9a-zA-Z-]*): a
+1\.1 (${username} *[0-9a-zA-Z-]*): file
+1\.2 (${username} *[0-9a-zA-Z-]*):
+1\.2 (${username} *[0-9a-zA-Z-]*): with
+1\.2 (${username} *[0-9a-zA-Z-]*): a
+1\.2 (${username} *[0-9a-zA-Z-]*): blank
+1\.2 (${username} *[0-9a-zA-Z-]*): line
+1\.2\.2\.1 (${username} *[0-9a-zA-Z-]*): and some
+1\.2\.2\.1 (${username} *[0-9a-zA-Z-]*): branched content"
+ dotest_fail ann-r14 "${testcvs} rann -r bill-clintons-chastity first-dir/file1" \
+"${PROG} \[[a-z]* aborted\]: no such tag bill-clintons-chastity"
+
rm -rf ${CVSROOT_DIRNAME}/first-dir
;;
@@ -13502,7 +15469,7 @@ done"
module=x
mkdir $module
dotest ann-id-2 "${testcvs} add $module" \
-"Directory ${TESTDIR}/cvsroot/$module added to the repository"
+"Directory ${CVSROOT_DIRNAME}/$module added to the repository"
cd $module
file=m
@@ -13512,17 +15479,17 @@ done"
"${PROG} [a-z]*: scheduling file .$file. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest ann-id-4 "$testcvs -Q ci -m . $file" \
-"RCS file: ${TESTDIR}/cvsroot/$module/$file,v
+"RCS file: ${CVSROOT_DIRNAME}/$module/$file,v
done
Checking in $file;
-${TESTDIR}/cvsroot/$module/$file,v <-- $file
+${CVSROOT_DIRNAME}/$module/$file,v <-- $file
initial revision: 1\.1
done"
echo line2 >> $file
dotest ann-id-5 "$testcvs -Q ci -m . $file" \
"Checking in $file;
-${TESTDIR}/cvsroot/$module/$file,v <-- $file
+${CVSROOT_DIRNAME}/$module/$file,v <-- $file
new revision: 1\.2; previous revision: 1\.1
done"
@@ -13546,7 +15513,36 @@ done"
# Because this test is all about -d options and such, it
# at least to some extent needs to be different for remote vs.
# local.
- if test "x$remote" = "xno"; then
+ if $remote; then
+
+ # For remote, just create the repository. We don't yet do
+ # the various other tests above for remote but that should be
+ # changed.
+ mkdir crerepos
+ mkdir crerepos/CVSROOT
+
+ # Use :ext: rather than :fork:. Most of the tests use :fork:,
+ # so we want to make sure that we test :ext: _somewhere_.
+
+ # Maybe a bit dubious in the sense that people need to
+ # have rsh working to run the tests, but at least it
+ # isn't inetd :-). Might want to think harder about this -
+ # maybe try :ext:, and if it fails, print a (single, nice)
+ # message and fall back to :fork:. Maybe testing :ext:
+ # with our own CVS_RSH rather than worrying about a system one
+ # would do the trick.
+
+ # Note that we set CVS_SERVER at the beginning.
+ CREREPOS_ROOT=:ext:`hostname`:${TESTDIR}/crerepos
+
+ # If we're going to do remote testing, make sure 'rsh' works first.
+ host="`hostname`"
+ if test "x`${CVS_RSH-rsh} $host -n 'echo hi'`" != "xhi"; then
+ echo "ERROR: cannot test remote CVS, because \`${CVS_RSH-rsh} $host' fails." >&2
+ exit 1
+ fi
+
+ else
# First, if the repository doesn't exist at all...
dotest_fail crerepos-1 \
@@ -13587,65 +15583,47 @@ ${testcvs} -d ${TESTDIR}/crerepos release -d CVSROOT >>${LOGFILE}; then
CREREPOS_ROOT=${TESTDIR}/crerepos
- else
- # For remote, just create the repository. We don't yet do
- # the various other tests above for remote but that should be
- # changed.
- mkdir crerepos
- mkdir crerepos/CVSROOT
-
- # Use :ext: rather than :fork:. Most of the tests use :fork:,
- # so we want to make sure that we test :ext: _somewhere_.
-
- # Maybe a bit dubious in the sense that people need to
- # have rsh working to run the tests, but at least it
- # isn't inetd :-). Might want to think harder about this -
- # maybe try :ext:, and if it fails, print a (single, nice)
- # message and fall back to :fork:. Maybe testing :ext:
- # with our own CVS_RSH rather than worrying about a system one
- # would do the trick.
-
- # Note that we set CVS_SERVER at the beginning.
- CREREPOS_ROOT=:ext:`hostname`:${TESTDIR}/crerepos
-
- # If we're going to do remote testing, make sure 'rsh' works first.
- host="`hostname`"
- if test "x`${CVS_RSH-rsh} $host -n 'echo hi'`" != "xhi"; then
- echo "ERROR: cannot test remote CVS, because \`rsh $host' fails." >&2
- exit 1
- fi
fi
- if test "x$remote" = "xno"; then
+ if $remote; then
# Test that CVS rejects a relative path in CVSROOT.
mkdir 1; cd 1
- dotest_fail crerepos-6a "${testcvs} -q -d ../crerepos get ." \
-"${PROG} \[[a-z]* aborted\]: CVSROOT ../crerepos must be an absolute pathname"
+ # Note that having the client reject the pathname (as :fork:
+ # does), does _not_ test for the bugs we are trying to catch
+ # here. The point is that malicious clients might send all
+ # manner of things and the server better protect itself.
+ dotest_fail crerepos-6a-r \
+"${testcvs} -q -d :ext:`hostname`:../crerepos get ." \
+"${PROG} [a-z]*: CVSROOT (\":ext:${hostname}:\.\./crerepos\")
+${PROG} [a-z]*: may only specify a positive, non-zero, integer port (not \"\.\.\")\.
+${PROG} [a-z]*: perhaps you entered a relative pathname${QUESTION}
+${PROG} \[[a-z]* aborted\]: Bad CVSROOT\."
cd ..
rm -r 1
mkdir 1; cd 1
- dotest_fail crerepos-6b "${testcvs} -d crerepos init" \
-"${PROG} \[[a-z]* aborted\]: CVSROOT crerepos must be an absolute pathname"
+ dotest_fail crerepos-6b-r \
+"${testcvs} -d :ext:`hostname`:crerepos init" \
+"${PROG} [a-z]*: CVSROOT (\":ext:${hostname}:crerepos\")
+${PROG} [a-z]*: requires a path spec
+${PROG} [a-z]*: :(gserver|kserver|pserver):\[\[user\]\[:password\]@\]host\[:\[port\]\]/path
+${PROG} [a-z]*: \[:(ext|server):\]\[\[user\]@\]host\[:\]/path
+${PROG} \[[a-z]* aborted\]: Bad CVSROOT\."
cd ..
rm -r 1
- else # remote
+ else # local
# Test that CVS rejects a relative path in CVSROOT.
mkdir 1; cd 1
- # Note that having the client reject the pathname (as :fork:
- # does), does _not_ test for the bugs we are trying to catch
- # here. The point is that malicious clients might send all
- # manner of things and the server better protect itself.
- dotest_fail crerepos-6a \
-"${testcvs} -q -d :ext:`hostname`:../crerepos get ." \
-"Root ../crerepos must be an absolute pathname"
+ # piping the output of this test to /dev/null since we have no way of knowing
+ # what error messages different rsh implementations will output.
+ dotest_fail crerepos-6a "${testcvs} -q -d ../crerepos get . >/dev/null 2>&1" ""
cd ..
rm -r 1
mkdir 1; cd 1
- dotest_fail crerepos-6b \
-"${testcvs} -d :ext:`hostname`:crerepos init" \
-"Root crerepos must be an absolute pathname"
+ dotest_fail crerepos-6b "${testcvs} -d crerepos init" \
+"${PROG} [a-z]*: CVSROOT \"crerepos\" must be an absolute pathname
+${PROG} \[[a-z]* aborted\]: Bad CVSROOT\."
cd ..
rm -r 1
fi # end of tests to be skipped for remote
@@ -13662,17 +15640,17 @@ ${testcvs} -d ${TESTDIR}/crerepos release -d CVSROOT >>${LOGFILE}; then
dotest crerepos-8 "${testcvs} -q co -l ." ''
mkdir first-dir
dotest crerepos-9 "${testcvs} add first-dir" \
-"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
cd first-dir
touch file1
dotest crerepos-10 "${testcvs} add file1" \
"${PROG} [a-z]*: scheduling file .file1. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest crerepos-11 "${testcvs} -q ci -m add-it" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done
Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
initial revision: 1\.1
done"
cd ../..
@@ -13711,7 +15689,7 @@ ${PROG} [a-z]*: Updating crerepos-dir"
cd ..
- if test "$keep" = yes; then
+ if $keep; then
echo Keeping ${TESTDIR} and exiting due to --keep
exit 0
fi
@@ -13820,7 +15798,7 @@ EOF
dotest rcs-1 "${testcvs} -q co first-dir" 'U first-dir/file1'
cd first-dir
dotest rcs-2 "${testcvs} -q log" "
-RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
Working file: file1
head: 1\.3
branch:
@@ -13854,7 +15832,7 @@ add file1
# ISO8601 format. There are many, many, other variations
# specified by ISO8601 which we should be testing too.
dotest rcs-3 "${testcvs} -q log -d '1996-12-11<'" "
-RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
Working file: file1
head: 1\.3
branch:
@@ -13874,7 +15852,7 @@ delete second line; modify twelfth line
# RFC822 format (as amended by RFC1123).
dotest rcs-4 "${testcvs} -q log -d '<3 Apr 2000 00:00'" \
"
-RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
Working file: file1
head: 1\.3
branch:
@@ -13966,13 +15944,13 @@ EOF
echo "next branch revision" > file2
dotest rcs-6b "${testcvs} -q ci -m mod file2" \
"Checking in file2;
-${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
+${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
new revision: 1\.2\.6\.2; previous revision: 1\.2\.6\.1
done"
# Now get rid of the default branch, it will get in the way.
dotest rcs-7 "${testcvs} admin -b file2" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
done"
# But we do want to make sure that "cvs admin" leaves the newphrases
# in the file.
@@ -14118,7 +16096,7 @@ next branch revision
# OK, now make sure cvs log doesn't have any trouble with the
# newphrases and such.
dotest rcs-14 "${testcvs} -q log file2" "
-RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
Working file: file2
head: 1\.5
branch:
@@ -14304,14 +16282,14 @@ EOF
# question one way or the other (it has a grammar but almost
# nothing about lexical analysis).
dotest_fail rcs3-1 "${testcvs} -q co first-dir" \
-"${PROG} \[[a-z]* aborted\]: EOF while looking for value in RCS file ${TESTDIR}/cvsroot/first-dir/file1,v"
+"${PROG} \[[a-z]* aborted\]: EOF while looking for value in RCS file ${CVSROOT_DIRNAME}/first-dir/file1,v"
cat <<EOF >${CVSROOT_DIRNAME}/first-dir/file1,v
head 1.1; access; symbols; locks; expand o; 1.1 date 2007.03.20.04.03.02
; author jeremiah ;state ; branches; next;desc @@1.1log@@text@head@
EOF
# Whitespace issues, likewise.
dotest_fail rcs3-2 "${testcvs} -q co first-dir" \
-"${PROG} \[[a-z]* aborted\]: unexpected '.x6c' reading revision number in RCS file ${TESTDIR}/cvsroot/first-dir/file1,v"
+"${PROG} \[[a-z]* aborted\]: unexpected '.x6c' reading revision number in RCS file ${CVSROOT_DIRNAME}/first-dir/file1,v"
cat <<EOF >${CVSROOT_DIRNAME}/first-dir/file1,v
head 1.1; access; symbols; locks; expand o; 1.1 date 2007.03.20.04.03.02
; author jeremiah ;state ; branches; next;desc @@1.1 log@@text@head@
@@ -14319,7 +16297,7 @@ EOF
# Charming array of different messages for similar
# whitespace issues (depending on where the whitespace is).
dotest_fail rcs3-3 "${testcvs} -q co first-dir" \
-"${PROG} \[[a-z]* aborted\]: EOF while looking for value in RCS file ${TESTDIR}/cvsroot/first-dir/file1,v"
+"${PROG} \[[a-z]* aborted\]: EOF while looking for value in RCS file ${CVSROOT_DIRNAME}/first-dir/file1,v"
cat <<EOF >${CVSROOT_DIRNAME}/first-dir/file1,v
head 1.1; access; symbols; locks; expand o; 1.1 date 2007.03.20.04.03.02
; author jeremiah ;state ; branches; next;desc @@1.1 log @@text @head@
@@ -14338,13 +16316,13 @@ EOF
# See remote code above for rationale for cd.
cd first-dir
dotest rcs3-6 "${testcvs} log -R file1" \
-"${TESTDIR}/cvsroot/first-dir/file1,v"
+"${CVSROOT_DIRNAME}/first-dir/file1,v"
# OK, now put an extraneous '\0' at the end.
${AWK} </dev/null 'BEGIN { printf "@%c", 10 }' | ${TR} '@' '\000' \
>>${CVSROOT_DIRNAME}/first-dir/file1,v
dotest_fail rcs3-7 "${testcvs} log -s nostate file1" \
-"${PROG} \[[a-z]* aborted\]: unexpected '.x0' reading revision number in RCS file ${TESTDIR}/cvsroot/first-dir/file1,v"
+"${PROG} \[[a-z]* aborted\]: unexpected '.x0' reading revision number in RCS file ${CVSROOT_DIRNAME}/first-dir/file1,v"
cd ../..
rm -r 1
@@ -14373,7 +16351,7 @@ EOF
echo "LockDir=${TESTDIR}/locks" >config
dotest lockfiles-4 "${testcvs} -q ci -m config-it" \
"Checking in config;
-${TESTDIR}/cvsroot/CVSROOT/config,v <-- config
+${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
done
${PROG} [a-z]*: Rebuilding administrative file database"
@@ -14410,7 +16388,7 @@ ${PROG} \[[a-z]* aborted\]: cannot stat ${TESTDIR}/locks: No such file or direct
echo "# nobody here but us comments" >config
dotest lockfiles-cleanup-1 "${testcvs} -q ci -m config-it" \
"Checking in config;
-${TESTDIR}/cvsroot/CVSROOT/config,v <-- config
+${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
done
${PROG} [a-z]*: Rebuilding administrative file database"
@@ -14450,25 +16428,25 @@ ${PROG} [a-z]*: Rebuilding administrative file database"
dotest backuprecover-1 "${testcvs} -q co -l ." ''
mkdir first-dir
dotest backuprecover-2 "${testcvs} add first-dir" \
-"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
cd first-dir
mkdir dir
dotest backuprecover-3 "${testcvs} add dir" \
-"Directory ${TESTDIR}/cvsroot/first-dir/dir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir/dir added to the repository"
touch file1 dir/file2
dotest backuprecover-4 "${testcvs} -q add file1 dir/file2" \
"${PROG} [a-z]*: use '${PROG} commit' to add these files permanently"
dotest backuprecover-5 "${testcvs} -q ci -mtest" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done
Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
initial revision: 1\.1
done
-RCS file: ${TESTDIR}/cvsroot/first-dir/dir/file2,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/dir/file2,v
done
Checking in dir/file2;
-${TESTDIR}/cvsroot/first-dir/dir/file2,v <-- file2
+${CVSROOT_DIRNAME}/first-dir/dir/file2,v <-- file2
initial revision: 1\.1
done"
echo "Line one" >>file1
@@ -14485,11 +16463,11 @@ done"
echo " God only knows" >>dir/file2
dotest backuprecover-6 "${testcvs} -q ci -mtest" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.2; previous revision: 1\.1
done
Checking in dir/file2;
-${TESTDIR}/cvsroot/first-dir/dir/file2,v <-- file2
+${CVSROOT_DIRNAME}/first-dir/dir/file2,v <-- file2
new revision: 1\.2; previous revision: 1\.1
done"
@@ -14499,8 +16477,8 @@ done"
mkdir 2; cd 2
dotest backuprecover-7 "${testcvs} -Q co first-dir" ''
cd first-dir
- sed -e"s/looks like/just looks like/" file1 >tmp; mv tmp file1
- sed -e"s/don't use/don't just use/" dir/file2 >tmp; mv tmp dir/file2
+ sed -e "s/looks like/just looks like/" file1 >tmp; mv tmp file1
+ sed -e "s/don't use/don't just use/" dir/file2 >tmp; mv tmp dir/file2
# developer 1 is on a roll
cd ../../1/first-dir
@@ -14512,16 +16490,16 @@ done"
echo " a word that fits here would be something like dials" >>dir/file2
dotest backuprecover-8 "${testcvs} -q ci -mtest" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.3; previous revision: 1\.2
done
Checking in dir/file2;
-${TESTDIR}/cvsroot/first-dir/dir/file2,v <-- file2
+${CVSROOT_DIRNAME}/first-dir/dir/file2,v <-- file2
new revision: 1\.3; previous revision: 1\.2
done"
# Save a backup copy
- cp -r ${TESTDIR}/cvsroot/first-dir ${TESTDIR}/cvsroot/backup
+ cp -r ${CVSROOT_DIRNAME}/first-dir ${TESTDIR}/cvsroot/backup
# Simulate developer 3
cd ../..
@@ -14536,11 +16514,11 @@ done"
echo " I think you should quit and get a job in the foundry" >>dir/file2
dotest backuprecover-9b "${testcvs} -q ci -mtest" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.4; previous revision: 1\.3
done
Checking in dir/file2;
-${TESTDIR}/cvsroot/first-dir/dir/file2,v <-- file2
+${CVSROOT_DIRNAME}/first-dir/dir/file2,v <-- file2
new revision: 1\.4; previous revision: 1\.3
done"
@@ -14549,7 +16527,7 @@ done"
mkdir 4; cd 4
dotest backuprecover-10 "${testcvs} -Q co first-dir" ''
cd first-dir
- sed -e"s/quit and/be fired so he can/" dir/file2 >tmp; mv tmp dir/file2
+ sed -e "s/quit and/be fired so he can/" dir/file2 >tmp; mv tmp dir/file2
# And back to developer 1
cd ../../1/first-dir
@@ -14566,21 +16544,21 @@ done"
echo " once you find what's in store!" >>dir/file2
dotest backuprecover-12 "${testcvs} -q ci -mtest" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.5; previous revision: 1\.4
done
Checking in dir/file2;
-${TESTDIR}/cvsroot/first-dir/dir/file2,v <-- file2
+${CVSROOT_DIRNAME}/first-dir/dir/file2,v <-- file2
new revision: 1\.5; previous revision: 1\.4
done"
# developer 3'll do a bit of work that never gets checked in
cd ../../3/first-dir
dotest backuprecover-13 "${testcvs} -Q update" ''
- sed -e"s/very/some extremely/" file1 >tmp; mv tmp file1
+ sed -e "s/very/some extremely/" file1 >tmp; mv tmp file1
dotest backuprecover-14 "${testcvs} -q ci -mtest" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.6; previous revision: 1\.5
done"
echo >>file1
@@ -14591,8 +16569,8 @@ done"
echo " You've got an ill, and I have the cure!" >>dir/file2
# Slag the original and restore it a few revisions back
- rm -rf ${TESTDIR}/cvsroot/first-dir
- mv ${TESTDIR}/cvsroot/backup ${TESTDIR}/cvsroot/first-dir
+ rm -rf ${CVSROOT_DIRNAME}/first-dir
+ mv ${CVSROOT_DIRNAME}/backup ${TESTDIR}/cvsroot/first-dir
# Have developer 1 try an update and lose some data
#
@@ -14610,7 +16588,7 @@ U dir/file2"
cd ../../3/first-dir
dotest_fail backuprecover-16 "${testcvs} update" \
"${PROG} [a-z]*: Updating \.
-${PROG} \[[a-z]* aborted\]: could not find desired version 1\.6 in ${TESTDIR}/cvsroot/first-dir/file1,v"
+${PROG} \[[a-z]* aborted\]: could not find desired version 1\.6 in ${CVSROOT_DIRNAME}/first-dir/file1,v"
# create our workspace fixin' script
cd ../..
@@ -14645,11 +16623,11 @@ done" >fixit
cd first-dir
dotest backuprecover-19 "${testcvs} -q ci -mrecover/merge" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.4; previous revision: 1\.3
done
Checking in dir/file2;
-${TESTDIR}/cvsroot/first-dir/dir/file2,v <-- file2
+${CVSROOT_DIRNAME}/first-dir/dir/file2,v <-- file2
new revision: 1\.4; previous revision: 1\.3
done"
@@ -14657,7 +16635,7 @@ done"
cd ../../4/first-dir
dotest backuprecover-20 "${testcvs} update" \
"${PROG} [a-z]*: Updating \.
-RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
retrieving revision 1\.3
retrieving revision 1\.4
Merging differences between 1\.3 and 1\.4 into file1
@@ -14665,7 +16643,7 @@ rcsmerge: warning: conflicts during merge
${PROG} [a-z]*: conflicts found in file1
C file1
${PROG} [a-z]*: Updating dir
-RCS file: ${TESTDIR}/cvsroot/first-dir/dir/file2,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/dir/file2,v
retrieving revision 1\.3
retrieving revision 1\.4
Merging differences between 1\.3 and 1\.4 into file2
@@ -14681,28 +16659,28 @@ C dir/file2"
s/quit and/be fired so he can/" dir/file2 >tmp; mv tmp dir/file2
dotest backuprecover-21 "${testcvs} -q ci -mrecover/merge" \
"Checking in dir/file2;
-${TESTDIR}/cvsroot/first-dir/dir/file2,v <-- file2
+${CVSROOT_DIRNAME}/first-dir/dir/file2,v <-- file2
new revision: 1\.5; previous revision: 1\.4
done"
# go back and commit developer 2's stuff to prove it can still be done
cd ../../2/first-dir
dotest backuprecover-22 "${testcvs} -Q update" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
retrieving revision 1\.2
retrieving revision 1\.4
Merging differences between 1\.2 and 1\.4 into file1
-RCS file: ${TESTDIR}/cvsroot/first-dir/dir/file2,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/dir/file2,v
retrieving revision 1\.2
retrieving revision 1\.5
Merging differences between 1\.2 and 1\.5 into file2"
dotest backuprecover-23 "${testcvs} -q ci -mtest" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.5; previous revision: 1\.4
done
Checking in dir/file2;
-${TESTDIR}/cvsroot/first-dir/dir/file2,v <-- file2
+${CVSROOT_DIRNAME}/first-dir/dir/file2,v <-- file2
new revision: 1\.6; previous revision: 1\.5
done"
@@ -14829,10 +16807,10 @@ O 1997-06-06 08:12 ${PLUS}0000 kingdon ccvs =ccvs= <remote>/\*"
"${PROG} [a-z]*: scheduling file .file1. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest big-3 "${testcvs} -q ci -m add" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done
Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
initial revision: 1\.1
done"
cd ..
@@ -14843,7 +16821,7 @@ done"
echo "add a line to the end" >>file1
dotest big-5 "${testcvs} -q ci -m modify" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.2; previous revision: 1\.1
done"
cd ../2/first-dir
@@ -14852,7 +16830,7 @@ done"
dotest big-6 "${testcvs} -q update" "[UP] file1"
cd ../..
- if test "$keep" = yes; then
+ if $keep; then
echo Keeping ${TESTDIR} and exiting due to --keep
exit 0
fi
@@ -14879,20 +16857,20 @@ done"
dotest modes-1 "${testcvs} -q co -l ." ''
mkdir first-dir
dotest modes-2 "${testcvs} add first-dir" \
-"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
cd first-dir
touch aa
dotest modes-3 "${testcvs} add aa" \
"${PROG} [a-z]*: scheduling file .aa. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest modes-4 "${testcvs} -q ci -m add" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/aa,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/aa,v
done
Checking in aa;
-${TESTDIR}/cvsroot/first-dir/aa,v <-- aa
+${CVSROOT_DIRNAME}/first-dir/aa,v <-- aa
initial revision: 1\.1
done"
- dotest modes-5 "ls -l ${TESTDIR}/cvsroot/first-dir/aa,v" \
+ dotest modes-5 "ls -l ${CVSROOT_DIRNAME}/first-dir/aa,v" \
"-r--r--r-- .*"
# Test for whether we can set the execute bit.
@@ -14900,24 +16878,24 @@ done"
echo change it >>aa
dotest modes-6 "${testcvs} -q ci -m set-execute-bit" \
"Checking in aa;
-${TESTDIR}/cvsroot/first-dir/aa,v <-- aa
+${CVSROOT_DIRNAME}/first-dir/aa,v <-- aa
new revision: 1\.2; previous revision: 1\.1
done"
# If CVS let us update the execute bit, it would be set here.
# But it doesn't, and as far as I know that is longstanding
# CVS behavior.
- dotest modes-7 "ls -l ${TESTDIR}/cvsroot/first-dir/aa,v" \
+ dotest modes-7 "ls -l ${CVSROOT_DIRNAME}/first-dir/aa,v" \
"-r--r--r-- .*"
# OK, now manually change the modes and see what happens.
- chmod g=r,o= ${TESTDIR}/cvsroot/first-dir/aa,v
+ chmod g=r,o= ${CVSROOT_DIRNAME}/first-dir/aa,v
echo second line >>aa
dotest modes-7a "${testcvs} -q ci -m set-execute-bit" \
"Checking in aa;
-${TESTDIR}/cvsroot/first-dir/aa,v <-- aa
+${CVSROOT_DIRNAME}/first-dir/aa,v <-- aa
new revision: 1\.3; previous revision: 1\.2
done"
- dotest modes-7b "ls -l ${TESTDIR}/cvsroot/first-dir/aa,v" \
+ dotest modes-7b "ls -l ${CVSROOT_DIRNAME}/first-dir/aa,v" \
"-r--r----- .*"
CVSUMASK=007
@@ -14929,20 +16907,20 @@ done"
"${PROG} [a-z]*: scheduling file .ab. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest modes-9 "${testcvs} -q ci -m add" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/ab,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/ab,v
done
Checking in ab;
-${TESTDIR}/cvsroot/first-dir/ab,v <-- ab
+${CVSROOT_DIRNAME}/first-dir/ab,v <-- ab
initial revision: 1\.1
done"
- if test "x$remote" = xyes; then
+ if $remote; then
# The problem here is that the CVSUMASK environment variable
# needs to be set on the server (e.g. .bashrc). This is, of
# course, bogus, but that is the way it is currently.
- dotest modes-10 "ls -l ${TESTDIR}/cvsroot/first-dir/ab,v" \
+ dotest modes-10r "ls -l ${CVSROOT_DIRNAME}/first-dir/ab,v" \
"-r-xr-x---.*" "-r-xr-xr-x.*"
else
- dotest modes-10 "ls -l ${TESTDIR}/cvsroot/first-dir/ab,v" \
+ dotest modes-10 "ls -l ${CVSROOT_DIRNAME}/first-dir/ab,v" \
"-r-xr-x---.*"
fi
@@ -14959,25 +16937,25 @@ ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
# when we are just now adding the file; as far as I know
# that is longstanding CVS behavior, for what it's worth.
dotest modes-14 "${testcvs} -q ci -m add" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/Attic/ac,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/ac,v
done
Checking in ac;
-${TESTDIR}/cvsroot/first-dir/Attic/ac,v <-- ac
+${CVSROOT_DIRNAME}/first-dir/Attic/ac,v <-- ac
new revision: 1\.1\.2\.1; previous revision: 1\.1
done"
- if test "x$remote" = xyes; then
+ if $remote; then
# The problem here is that the CVSUMASK environment variable
# needs to be set on the server (e.g. .bashrc). This is, of
# course, bogus, but that is the way it is currently. The
# first match is for the :ext: method (where the CVSUMASK
# won't be set), while the second is for the :fork: method
# (where it will be).
- dotest modes-15 \
-"ls -l ${TESTDIR}/cvsroot/first-dir/Attic/ac,v" \
+ dotest modes-15r \
+"ls -l ${CVSROOT_DIRNAME}/first-dir/Attic/ac,v" \
"-r--r--r--.*" "-r--r-----.*"
else
dotest modes-15 \
-"ls -l ${TESTDIR}/cvsroot/first-dir/Attic/ac,v" \
+"ls -l ${CVSROOT_DIRNAME}/first-dir/Attic/ac,v" \
"-r--r-----.*"
fi
@@ -14997,23 +16975,23 @@ done"
dotest modes2-1 "${testcvs} -q co -l ." ''
mkdir first-dir
dotest modes2-2 "${testcvs} add first-dir" \
-"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
cd first-dir
touch aa
dotest modes2-3 "${testcvs} add aa" \
"${PROG} [a-z]*: scheduling file .aa. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest modes2-4 "${testcvs} -q ci -m add" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/aa,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/aa,v
done
Checking in aa;
-${TESTDIR}/cvsroot/first-dir/aa,v <-- aa
+${CVSROOT_DIRNAME}/first-dir/aa,v <-- aa
initial revision: 1\.1
done"
echo "more money" >> aa
dotest modes2-5 "${testcvs} -q ci -m add" \
"Checking in aa;
-${TESTDIR}/cvsroot/first-dir/aa,v <-- aa
+${CVSROOT_DIRNAME}/first-dir/aa,v <-- aa
new revision: 1\.2; previous revision: 1\.1
done"
@@ -15044,31 +17022,31 @@ done"
dotest modes3-1 "${testcvs} -q co -l ." ''
mkdir first-dir second-dir
dotest modes3-2 "${testcvs} add first-dir second-dir" \
-"Directory ${TESTDIR}/cvsroot/first-dir added to the repository
-Directory ${TESTDIR}/cvsroot/second-dir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository
+Directory ${CVSROOT_DIRNAME}/second-dir added to the repository"
touch first-dir/aa second-dir/ab
dotest modes3-3 "${testcvs} add first-dir/aa second-dir/ab" \
"${PROG} [a-z]*: scheduling file .first-dir/aa. for addition
${PROG} [a-z]*: scheduling file .second-dir/ab. for addition
${PROG} [a-z]*: use .${PROG} commit. to add these files permanently"
dotest modes3-4 "${testcvs} -q ci -m add" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/aa,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/aa,v
done
Checking in first-dir/aa;
-${TESTDIR}/cvsroot/first-dir/aa,v <-- aa
+${CVSROOT_DIRNAME}/first-dir/aa,v <-- aa
initial revision: 1\.1
done
-RCS file: ${TESTDIR}/cvsroot/second-dir/ab,v
+RCS file: ${CVSROOT_DIRNAME}/second-dir/ab,v
done
Checking in second-dir/ab;
-${TESTDIR}/cvsroot/second-dir/ab,v <-- ab
+${CVSROOT_DIRNAME}/second-dir/ab,v <-- ab
initial revision: 1\.1
done"
- chmod a= ${TESTDIR}/cvsroot/first-dir
+ chmod a= ${CVSROOT_DIRNAME}/first-dir
dotest modes3-5 "${testcvs} update" \
"${PROG} [a-z]*: Updating \.
${PROG} [a-z]*: Updating first-dir
-${PROG} [a-z]*: cannot open directory ${TESTDIR}/cvsroot/first-dir: Permission denied
+${PROG} [a-z]*: cannot open directory ${CVSROOT_DIRNAME}/first-dir: Permission denied
${PROG} [a-z]*: skipping directory first-dir
${PROG} [a-z]*: Updating second-dir"
@@ -15082,14 +17060,14 @@ ${PROG} [a-z]*: Updating second-dir"
${PROG} [a-z]*: Updating CVSROOT
U ${DOTSTAR}
${PROG} [a-z]*: Updating first-dir
-${PROG} [a-z]*: cannot open directory ${TESTDIR}/cvsroot/first-dir: Permission denied
+${PROG} [a-z]*: cannot open directory ${CVSROOT_DIRNAME}/first-dir: Permission denied
${PROG} [a-z]*: skipping directory first-dir
${PROG} [a-z]*: Updating second-dir"
cd ..
rm -r 1
- chmod u+rwx ${TESTDIR}/cvsroot/first-dir
- rm -rf ${TESTDIR}/cvsroot/first-dir ${TESTDIR}/cvsroot/second-dir
+ chmod u+rwx ${CVSROOT_DIRNAME}/first-dir
+ rm -rf ${CVSROOT_DIRNAME}/first-dir ${TESTDIR}/cvsroot/second-dir
;;
stamps)
@@ -15098,7 +17076,7 @@ ${PROG} [a-z]*: Updating second-dir"
dotest stamps-1 "${testcvs} -q co -l ." ''
mkdir first-dir
dotest stamps-2 "${testcvs} add first-dir" \
-"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
cd first-dir
touch aa
echo '$''Id$' >kw
@@ -15121,16 +17099,16 @@ ${PROG} [a-z]*: use .${PROG} commit. to add these files permanently"
"cmp ${TESTDIR}/1/stamp.kw.touch ${TESTDIR}/1/stamp.kw.add" ''
sleep 60
dotest stamps-5 "${testcvs} -q ci -m add" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/aa,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/aa,v
done
Checking in aa;
-${TESTDIR}/cvsroot/first-dir/aa,v <-- aa
+${CVSROOT_DIRNAME}/first-dir/aa,v <-- aa
initial revision: 1\.1
done
-RCS file: ${TESTDIR}/cvsroot/first-dir/kw,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/kw,v
done
Checking in kw;
-${TESTDIR}/cvsroot/first-dir/kw,v <-- kw
+${CVSROOT_DIRNAME}/first-dir/kw,v <-- kw
initial revision: 1\.1
done"
ls -l aa >${TESTDIR}/1/stamp.aa.ci
@@ -15177,11 +17155,11 @@ U first-dir/kw"
echo add a line >>kw
dotest stamps-9 "${testcvs} -q ci -m change-them" \
"Checking in aa;
-${TESTDIR}/cvsroot/first-dir/aa,v <-- aa
+${CVSROOT_DIRNAME}/first-dir/aa,v <-- aa
new revision: 1\.2; previous revision: 1\.1
done
Checking in kw;
-${TESTDIR}/cvsroot/first-dir/kw,v <-- kw
+${CVSROOT_DIRNAME}/first-dir/kw,v <-- kw
new revision: 1\.2; previous revision: 1\.1
done"
ls -l aa >${TESTDIR}/1/stamp.aa.ci2
@@ -15223,7 +17201,7 @@ done"
cd ../..
- if test "$keep" = yes; then
+ if $keep; then
echo Keeping ${TESTDIR} and exiting due to --keep
exit 0
fi
@@ -15242,7 +17220,7 @@ done"
dotest perms-1 "${testcvs} -q co -l ." ''
mkdir first-dir
dotest perms-2 "${testcvs} add first-dir" \
-"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
cd first-dir
touch foo
@@ -15254,7 +17232,7 @@ ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
"RCS file: ${CVSROOT_DIRNAME}/first-dir/foo,v
done
Checking in foo;
-${TESTDIR}/cvsroot/first-dir/foo,v <-- foo
+${CVSROOT_DIRNAME}/first-dir/foo,v <-- foo
initial revision: 1\.1
done"
@@ -15263,7 +17241,7 @@ done"
mkdir 2; cd 2
dotest perms-5 "${testcvs} -q co first-dir" "U first-dir/foo"
cd first-dir
- if test "$remote" = no; then
+ if $remote; then :; else
# PreservePermissions not yet implemented for remote.
dotest perms-6 "ls -l foo" "-r---wx--x .* foo"
fi
@@ -15287,24 +17265,24 @@ done"
dotest symlinks-1 "${testcvs} -q co -l ." ''
mkdir first-dir
dotest symlinks-2 "${testcvs} add first-dir" \
-"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
cd first-dir
dotest symlinks-2.1 "ln -s ${TESTDIR}/fumble slink" ""
dotest symlinks-3 "${testcvs} add slink" \
"${PROG} [a-z]*: scheduling file .slink. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
- if test "$remote" = yes; then
+ if $remote; then
# Remote doesn't implement PreservePermissions, and in its
# absence the correct behavior is to follow the symlink.
- dotest_fail symlinks-4 "${testcvs} -q ci -m ''" \
+ dotest_fail symlinks-4r "${testcvs} -q ci -m ''" \
"${PROG} \[commit aborted\]: reading slink: No such file or directory"
else
dotest symlinks-4 "${testcvs} -q ci -m ''" \
"RCS file: ${CVSROOT_DIRNAME}/first-dir/slink,v
done
Checking in slink;
-${TESTDIR}/cvsroot/first-dir/slink,v <-- slink
+${CVSROOT_DIRNAME}/first-dir/slink,v <-- slink
initial revision: 1\.1
done"
@@ -15334,7 +17312,7 @@ done"
dotest symlinks2-1 "${testcvs} -q co -l ." ''
mkdir first-dir
dotest symlinks2-2 "${testcvs} add first-dir" \
-"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
cd first-dir
echo nonsymlink > slink
dotest symlinks2-3 "${testcvs} add slink" \
@@ -15344,7 +17322,7 @@ ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
"RCS file: ${CVSROOT_DIRNAME}/first-dir/slink,v
done
Checking in slink;
-${TESTDIR}/cvsroot/first-dir/slink,v <-- slink
+${CVSROOT_DIRNAME}/first-dir/slink,v <-- slink
initial revision: 1\.1
done"
rm slink
@@ -15353,7 +17331,7 @@ done"
dotest symlinks2-5 "ln -s cvslog.file2 slink" ""
dotest symlinks2-6 "${testcvs} -q ci -m linkify" \
"Checking in slink;
-${TESTDIR}/cvsroot/first-dir/slink,v <-- slink
+${CVSROOT_DIRNAME}/first-dir/slink,v <-- slink
new revision: 1\.2; previous revision: 1\.1
done"
dotest symlinks2-7 "${testcvs} -q update -r 1.1 slink" "[UP] slink"
@@ -15375,7 +17353,7 @@ done"
dotest hardlinks-1 "${testcvs} -q co -l ." ''
mkdir first-dir
dotest hardlinks-2 "${testcvs} add first-dir" \
-"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
cd first-dir
# Make up some ugly filenames, to test that they get
@@ -15411,32 +17389,32 @@ ${PROG} [a-z]*: use .${PROG} commit. to add these files permanently"
"RCS file: ${CVSROOT_DIRNAME}/first-dir/aaaa,v
done
Checking in aaaa;
-${TESTDIR}/cvsroot/first-dir/aaaa,v <-- aaaa
+${CVSROOT_DIRNAME}/first-dir/aaaa,v <-- aaaa
initial revision: 1\.1
done
RCS file: ${CVSROOT_DIRNAME}/first-dir/b\.b\.b\.b,v
done
Checking in b\.b\.b\.b;
-${TESTDIR}/cvsroot/first-dir/b\.b\.b\.b,v <-- b\.b\.b\.b
+${CVSROOT_DIRNAME}/first-dir/b\.b\.b\.b,v <-- b\.b\.b\.b
initial revision: 1\.1
done
RCS file: ${CVSROOT_DIRNAME}/first-dir/dd dd dd,v
done
Checking in dd dd dd;
-${TESTDIR}/cvsroot/first-dir/dd dd dd,v <-- dd dd dd
+${CVSROOT_DIRNAME}/first-dir/dd dd dd,v <-- dd dd dd
initial revision: 1\.1
done"
# Test checking out hardlinked files.
cd ../..
mkdir 2; cd 2
- if test "$remote" = yes; then
+ if $remote; then
# Remote does not implement PreservePermissions.
- dotest hardlinks-5 "${testcvs} -q co first-dir" \
+ dotest hardlinks-5r "${testcvs} -q co first-dir" \
"U first-dir/aaaa
U first-dir/b\.b\.b\.b
U first-dir/dd dd dd"
cd first-dir
- dotest hardlinks-6 "ls -l [abd]*" \
+ dotest hardlinks-6r "ls -l [abd]*" \
"-[rwx\-]* *1 .* aaaa
-[rwx\-]* *1 .* b\.b\.b\.b
-[rwx\-]* *1 .* dd dd dd"
@@ -15476,7 +17454,7 @@ U first-dir/dd dd dd"
dotest sticky-1 "${testcvs} -q co -l ." ''
mkdir first-dir
dotest sticky-2 "${testcvs} add first-dir" \
-"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
cd first-dir
touch file1
@@ -15484,17 +17462,17 @@ U first-dir/dd dd dd"
"${PROG} [a-z]*: scheduling file .file1. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest sticky-4 "${testcvs} -q ci -m add" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done
Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
initial revision: 1\.1
done"
dotest sticky-5 "${testcvs} -q tag tag1" "T file1"
echo add a line >>file1
dotest sticky-6 "${testcvs} -q ci -m modify" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.2; previous revision: 1\.1
done"
dotest sticky-7 "${testcvs} -q update -r tag1" "[UP] file1"
@@ -15511,10 +17489,10 @@ ${QUESTION} file2" "${QUESTION} file2
"${PROG} [a-z]*: scheduling file .file2. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest sticky-14 "${testcvs} -q ci -m add" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
done
Checking in file2;
-${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
+${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
initial revision: 1\.1
done"
@@ -15580,7 +17558,7 @@ U file1" "U file1"
dotest keyword-1 "${testcvs} -q co -l ." ''
mkdir first-dir
dotest keyword-2 "${testcvs} add first-dir" \
-"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
cd first-dir
echo '$''Author$' > file1
@@ -15605,22 +17583,22 @@ U file1" "U file1"
"${PROG} [a-z]*: scheduling file .file1. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest keyword-4 "${testcvs} -q ci -m add" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done
Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
initial revision: 1\.1
done"
dotest keyword-5 "cat file1" \
'\$'"Author: ${username} "'\$'"
"'\$'"Date: [0-9][0-9][0-9][0-9]/[0-9][0-9]/[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9] "'\$'"
-"'\$'"Header: ${TESTDIR}/cvsroot/first-dir/file1,v 1\.1 [0-9/]* [0-9:]* ${username} Exp "'\$'"
+"'\$'"Header: ${CVSROOT_DIRNAME}/first-dir/file1,v 1\.1 [0-9/]* [0-9:]* ${username} Exp "'\$'"
"'\$'"Id: file1,v 1\.1 [0-9/]* [0-9:]* ${username} Exp "'\$'"
"'\$'"Locker: "'\$'"
"'\$'"Name: "'\$'"
"'\$'"RCSfile: file1,v "'\$'"
"'\$'"Revision: 1\.1 "'\$'"
-"'\$'"Source: ${TESTDIR}/cvsroot/first-dir/file1,v "'\$'"
+"'\$'"Source: ${CVSROOT_DIRNAME}/first-dir/file1,v "'\$'"
"'\$'"State: Exp "'\$'"
"'\$'"Nonkey"'\$'"
"'\$'"Date
@@ -15634,7 +17612,7 @@ xx"
# vs. -kkv. CVS does not normally lock RCS files, but some
# people use cvs admin to enforce reserved checkouts.
dotest keyword-6 "${testcvs} admin -l file1" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
1\.1 locked
done"
@@ -15642,13 +17620,13 @@ done"
dotest keyword-8 "cat file1" \
'\$'"Author: ${username} "'\$'"
"'\$'"Date: [0-9][0-9][0-9][0-9]/[0-9][0-9]/[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9] "'\$'"
-"'\$'"Header: ${TESTDIR}/cvsroot/first-dir/file1,v 1\.1 [0-9/]* [0-9:]* ${username} Exp "'\$'"
+"'\$'"Header: ${CVSROOT_DIRNAME}/first-dir/file1,v 1\.1 [0-9/]* [0-9:]* ${username} Exp "'\$'"
"'\$'"Id: file1,v 1\.1 [0-9/]* [0-9:]* ${username} Exp "'\$'"
"'\$'"Locker: "'\$'"
"'\$'"Name: "'\$'"
"'\$'"RCSfile: file1,v "'\$'"
"'\$'"Revision: 1\.1 "'\$'"
-"'\$'"Source: ${TESTDIR}/cvsroot/first-dir/file1,v "'\$'"
+"'\$'"Source: ${CVSROOT_DIRNAME}/first-dir/file1,v "'\$'"
"'\$'"State: Exp "'\$'"
"'\$'"Nonkey"'\$'"
"'\$'"Date
@@ -15662,13 +17640,13 @@ xx"
dotest keyword-10 "cat file1" \
'\$'"Author: ${username} "'\$'"
"'\$'"Date: [0-9][0-9][0-9][0-9]/[0-9][0-9]/[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9] "'\$'"
-"'\$'"Header: ${TESTDIR}/cvsroot/first-dir/file1,v 1\.1 [0-9/]* [0-9:]* ${username} Exp ${username} "'\$'"
+"'\$'"Header: ${CVSROOT_DIRNAME}/first-dir/file1,v 1\.1 [0-9/]* [0-9:]* ${username} Exp ${username} "'\$'"
"'\$'"Id: file1,v 1\.1 [0-9/]* [0-9:]* ${username} Exp ${username} "'\$'"
"'\$'"Locker: ${username} "'\$'"
"'\$'"Name: "'\$'"
"'\$'"RCSfile: file1,v "'\$'"
"'\$'"Revision: 1\.1 "'\$'"
-"'\$'"Source: ${TESTDIR}/cvsroot/first-dir/file1,v "'\$'"
+"'\$'"Source: ${CVSROOT_DIRNAME}/first-dir/file1,v "'\$'"
"'\$'"State: Exp "'\$'"
"'\$'"Nonkey"'\$'"
"'\$'"Date
@@ -15702,13 +17680,13 @@ xx"
dotest keyword-14 "cat file1" \
"${username}
[0-9][0-9][0-9][0-9]/[0-9][0-9]/[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9]
-${TESTDIR}/cvsroot/first-dir/file1,v 1\.1 [0-9/]* [0-9:]* ${username} Exp
+${CVSROOT_DIRNAME}/first-dir/file1,v 1\.1 [0-9/]* [0-9:]* ${username} Exp
file1,v 1\.1 [0-9/]* [0-9:]* ${username} Exp
file1,v
1\.1
-${TESTDIR}/cvsroot/first-dir/file1,v
+${CVSROOT_DIRNAME}/first-dir/file1,v
Exp
"'\$'"Nonkey"'\$'"
"'\$'"Date
@@ -15742,24 +17720,24 @@ xx "'\$'"Log"'\$'
echo '$''Name$' > file1
dotest keyword-18 "${testcvs} ci -m modify file1" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.2; previous revision: 1\.1
done"
dotest keyword-19 "${testcvs} -q tag tag1" "T file1"
echo "change" >> file1
dotest keyword-20 "${testcvs} -q ci -m mod2 file1" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.3; previous revision: 1\.2
done"
dotest keyword-21 "${testcvs} -q update -r tag1" "[UP] file1"
dotest keyword-22 "cat file1" '\$'"Name: tag1 "'\$'
- if test "$remote" = yes; then
+ if $remote; then
# Like serverpatch-8. Not sure there is anything much we
# can or should do about this.
- dotest keyword-23 "${testcvs} update -A file1" "P file1
+ dotest keyword-23r "${testcvs} update -A file1" "P file1
${PROG} update: checksum failure after patch to \./file1; will refetch
${PROG} client: refetching unpatchable files
U file1"
@@ -15780,7 +17758,7 @@ change"
dotest keywordlog-1 "${testcvs} -q co -l ." ''
mkdir first-dir
dotest keywordlog-2 "${testcvs} add first-dir" \
-"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
cd first-dir
echo initial >file1
dotest keywordlog-3 "${testcvs} add file1" \
@@ -15789,10 +17767,10 @@ ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
# See "rmadd" for a list of other tests of cvs ci -r.
dotest keywordlog-4 "${testcvs} -q ci -r 1.3 -m add file1" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done
Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
initial revision: 1\.3
done"
@@ -15815,7 +17793,7 @@ ${PROG} \[[a-z]* aborted\]: correct above errors first!"
dotest keywordlog-5 "${testcvs} ci -F ${TESTDIR}/comment.tmp file1" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.4; previous revision: 1\.3
done"
rm -f ${TESTDIR}/comment.tmp
@@ -15842,7 +17820,7 @@ xx"
echo "change" >> file1
dotest keywordlog-10 "${testcvs} ci -m modify file1" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.5; previous revision: 1\.4
done"
dotest keywordlog-11 "cat file1" \
@@ -15876,7 +17854,7 @@ change"
echo br-change >>file1
dotest keywordlog-15 "${testcvs} -q ci -m br-modify" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.4\.2\.1; previous revision: 1\.4
done"
dotest keywordlog-16 "cat file1" \
@@ -15973,7 +17951,7 @@ xx"
dotest keywordlog-24 \
"${testcvs} admin -oHEAD 1/first-dir/file1" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
deleting revision 1\.5
done"
@@ -15986,7 +17964,7 @@ xx First log line
xx Second log line
xx"
- if test $keep = yes; then
+ if $keep; then
echo Keeping ${TESTDIR} and exiting due to --keep
exit 0
fi
@@ -16009,7 +17987,7 @@ xx"
dotest keyword2-1 "${testcvs} -q co -l ." ''
mkdir first-dir
dotest keyword2-2 "${testcvs} add first-dir" \
-"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
cd first-dir
echo '$''Revision$' >> file1
@@ -16039,16 +18017,16 @@ ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest keyword2-6 "${testcvs} -q ci -m add" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/binfile\.dat,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/binfile\.dat,v
done
Checking in binfile\.dat;
-${TESTDIR}/cvsroot/first-dir/binfile\.dat,v <-- binfile\.dat
+${CVSROOT_DIRNAME}/first-dir/binfile\.dat,v <-- binfile\.dat
initial revision: 1\.1
done
-RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done
Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
initial revision: 1\.1
done"
@@ -16059,7 +18037,7 @@ T file1"
sed -e 's/our/the best of and the worst of/' file1 >f; mv f file1
dotest keyword2-8 "${testcvs} -q ci -m change" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.2; previous revision: 1\.1
done"
@@ -16068,14 +18046,14 @@ done"
echo "what else do we have?" >>file1
dotest keyword2-10 "${testcvs} -q ci -m change" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.1\.2\.1; previous revision: 1\.1
done"
# Okay, first a conflict in file1 - should be okay with binfile.dat
dotest keyword2-11 "${testcvs} -q update -A -j branch" \
"U file1
-RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
retrieving revision 1\.1
retrieving revision 1\.1\.2\.1
Merging differences between 1\.1 and 1\.1\.2\.1 into file1
@@ -16084,7 +18062,7 @@ rcsmerge: warning: conflicts during merge"
dotest_fail keyword2-12 "${testcvs} diff file1" \
"Index: file1
===================================================================
-RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
retrieving revision 1\.2
diff -r1\.2 file1
0a1
@@ -16098,11 +18076,11 @@ diff -r1\.2 file1
# Here's the problem... shouldn't -kk a binary file...
rm file1
- if test "$remote" = yes; then
- dotest keyword2-13 "${testcvs} -q update -A -kk -j branch" \
+ if $remote; then
+ dotest keyword2-13r "${testcvs} -q update -A -kk -j branch" \
"U binfile.dat
U file1
-RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
retrieving revision 1\.1
retrieving revision 1\.1\.2\.1
Merging differences between 1\.1 and 1\.1\.2\.1 into file1"
@@ -16111,7 +18089,7 @@ Merging differences between 1\.1 and 1\.1\.2\.1 into file1"
"U binfile.dat
${PROG} [a-z]*: warning: file1 was lost
U file1
-RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
retrieving revision 1\.1
retrieving revision 1\.1\.2\.1
Merging differences between 1\.1 and 1\.1\.2\.1 into file1"
@@ -16121,7 +18099,7 @@ Merging differences between 1\.1 and 1\.1\.2\.1 into file1"
# have been checked in if it had changed on the branch...
dotest keyword2-14 "${testcvs} -q ci -m change" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.3; previous revision: 1\.2
done"
@@ -16141,12 +18119,12 @@ T file1"
</dev/null | ${TR} '@' '\000' >>binfile.dat
dotest keyword2-19 "${testcvs} -q ci -m badbadbad" \
"Checking in binfile\.dat;
-${TESTDIR}/cvsroot/first-dir/binfile\.dat,v <-- binfile\.dat
+${CVSROOT_DIRNAME}/first-dir/binfile\.dat,v <-- binfile\.dat
new revision: 1\.1\.4\.1; previous revision: 1\.1
done"
dotest keyword2-20 "${testcvs} -q update -A -kk -j branch2" \
"U binfile\.dat
-RCS file: ${TESTDIR}/cvsroot/first-dir/binfile\.dat,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/binfile\.dat,v
retrieving revision 1\.1
retrieving revision 1\.1\.4\.1
Merging differences between 1\.1 and 1\.1\.4\.1 into binfile\.dat
@@ -16190,7 +18168,7 @@ U first-dir/file2"
echo 'add a line on trunk' >> file1
dotest head-3 "${testcvs} -q ci -m modify" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.2; previous revision: 1\.1
done"
dotest head-4 "${testcvs} -q tag trunktag" "T file1
@@ -16198,7 +18176,7 @@ T file2"
echo 'add a line on trunk after trunktag' >> file1
dotest head-5 "${testcvs} -q ci -m modify" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.3; previous revision: 1\.2
done"
dotest head-6 "${testcvs} -q tag -b br1" "T file1
@@ -16207,7 +18185,7 @@ T file2"
echo 'modify on branch' >>file1
dotest head-8 "${testcvs} -q ci -m modify" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.3\.2\.1; previous revision: 1\.3
done"
dotest head-9 "${testcvs} -q tag brtag" "T file1
@@ -16215,7 +18193,7 @@ T file2"
echo 'modify on branch after brtag' >>file1
dotest head-10 "${testcvs} -q ci -m modify" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.3\.2\.2; previous revision: 1\.3\.2\.1
done"
# With no sticky tags, HEAD is the head of the trunk.
@@ -16229,12 +18207,12 @@ add a line on trunk after trunktag"
dotest_fail head-trunk-diff "${testcvs} -q diff -c -r HEAD -r br1" \
"Index: file1
===================================================================
-RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
retrieving revision 1\.3
retrieving revision 1\.3\.2\.2
diff -c -r1\.3 -r1\.3\.2\.2
-\*\*\* file1 [0-9/]* [0-9:]* 1\.3
---- file1 [0-9/]* [0-9:]* 1\.3\.2\.2
+\*\*\* file1 ${RFCDATE} 1\.3
+--- file1 ${RFCDATE} 1\.3\.2\.2
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
\*\*\* 1,3 \*\*\*\*
--- 1,5 ----
@@ -16282,12 +18260,12 @@ add a line on trunk after trunktag"
"${testcvs} -q diff -c -r HEAD -r br1" \
"Index: file1
===================================================================
-RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
retrieving revision 1\.3
retrieving revision 1\.3\.2\.2
diff -c -r1\.3 -r1\.3\.2\.2
-\*\*\* file1 [0-9/]* [0-9:]* 1\.3
---- file1 [0-9/]* [0-9:]* 1\.3\.2\.2
+\*\*\* file1 ${RFCDATE} 1\.3
+--- file1 ${RFCDATE} 1\.3\.2\.2
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
\*\*\* 1,3 \*\*\*\*
--- 1,5 ----
@@ -16306,10 +18284,10 @@ ${PLUS} modify on branch after brtag"
# a revision (file1) and the case where it does not (file2)
dotest_fail head-o0a "${testcvs} admin -o ::br1" \
"${PROG} [a-z]*: Administrating \.
-RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
${PROG} [a-z]*: cannot remove revision 1\.3\.2\.1 because it has tags
-${PROG} [a-z]*: cannot modify RCS file for .file1.
-RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
+${PROG} [a-z]*: RCS file for .file1. not modified\.
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
done"
dotest head-o0b "${testcvs} tag -d brtag" \
"${PROG} [a-z]*: Untagging \.
@@ -16317,10 +18295,10 @@ D file1
D file2"
dotest head-o1 "${testcvs} admin -o ::br1" \
"${PROG} [a-z]*: Administrating \.
-RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
deleting revision 1\.3\.2\.1
done
-RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
done"
cd ../..
rm -r 1
@@ -16348,7 +18326,7 @@ done"
dotest tagdate-1 "${testcvs} -q co -l ." ''
mkdir first-dir
dotest tagdate-2 "${testcvs} add first-dir" \
-"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
cd first-dir
echo trunk-1 >file1
@@ -16356,10 +18334,10 @@ done"
"${PROG} [a-z]*: scheduling file .file1. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest tagdate-4 "${testcvs} -q ci -m add" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done
Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
initial revision: 1\.1
done"
dotest tagdate-5 "${testcvs} -q tag -b br1" "T file1"
@@ -16367,7 +18345,7 @@ done"
echo trunk-2 >file1
dotest tagdate-7 "${testcvs} -q ci -m modify-on-trunk" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.2; previous revision: 1\.1
done"
# We are testing -r -D where br1 is a (magic) branch without
@@ -16378,7 +18356,7 @@ done"
echo br2-1 >file1
dotest tagdate-10 "${testcvs} -q ci -m modify-on-br2" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.1\.4\.1; previous revision: 1\.1
done"
@@ -16406,7 +18384,7 @@ done"
echo br2-2 >file1
dotest tagdate-13 "${testcvs} -q ci -m modify-2-on-br2" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.1\.4\.2; previous revision: 1\.1\.4\.1
done"
cd ../..
@@ -16427,7 +18405,7 @@ done"
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
1\.1\.4\.2 (${username} *[0-9a-zA-Z-]*): br2-2"
- if test $keep = yes; then
+ if $keep; then
echo Keeping ${TESTDIR} and exiting due to --keep
exit 0
fi
@@ -16446,7 +18424,7 @@ done"
dotest multibranch2-1 "${testcvs} -q co -l ." ''
mkdir first-dir
dotest multibranch2-2 "${testcvs} add first-dir" \
-"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
cd first-dir
echo trunk-1 >file1
@@ -16456,16 +18434,16 @@ done"
${PROG} [a-z]*: scheduling file .file2. for addition
${PROG} [a-z]*: use .${PROG} commit. to add these files permanently"
dotest multibranch2-4 "${testcvs} -q ci -m add" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done
Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
initial revision: 1\.1
done
-RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
done
Checking in file2;
-${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
+${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
initial revision: 1\.1
done"
dotest multibranch2-5 "${testcvs} -q tag -b A" "T file1
@@ -16478,11 +18456,11 @@ T file2"
echo branch-B >file2
dotest multibranch2-8 "${testcvs} -q ci -m modify-on-B" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.1\.4\.1; previous revision: 1\.1
done
Checking in file2;
-${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
+${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
new revision: 1\.1\.4\.1; previous revision: 1\.1
done"
@@ -16492,13 +18470,13 @@ done"
# When using cvs-1.9.20, this commit gets a failed assertion in rcs.c.
dotest multibranch2-10 "${testcvs} -q ci -m modify-on-A" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.1\.2\.1; previous revision: 1\.1
done"
dotest multibranch2-11 "${testcvs} -q log file1" \
"
-RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
Working file: file1
head: 1\.1
branch:
@@ -16528,7 +18506,7 @@ modify-on-A
# This one is more concise.
dotest multibranch2-12 "${testcvs} -q log -r1.1 file1" \
"
-RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
Working file: file1
head: 1\.1
branch:
@@ -16555,13 +18533,13 @@ add
[UP] file2"
dotest multibranch2-14 "${testcvs} -q update -r A -j B file2" \
"[UP] file2
-RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
retrieving revision 1.1
retrieving revision 1.1.4.1
Merging differences between 1.1 and 1.1.4.1 into file2"
dotest multibranch2-15 "${testcvs} -q ci -m commit-on-A file2" \
"Checking in file2;
-${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
+${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
new revision: 1\.1\.2\.1; previous revision: 1\.1
done"
cd ../..
@@ -16594,10 +18572,10 @@ done"
"${PROG} [a-z]*: scheduling file .$file. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest tag8k-4 "$testcvs -Q ci -m . $file" \
-"RCS file: ${TESTDIR}/cvsroot/$module/$file,v
+"RCS file: ${CVSROOT_DIRNAME}/$module/$file,v
done
Checking in $file;
-${TESTDIR}/cvsroot/$module/$file,v <-- $file
+${CVSROOT_DIRNAME}/$module/$file,v <-- $file
initial revision: 1\.1
done"
@@ -16605,7 +18583,7 @@ done"
echo a > $file
dotest tag8k-5 "$testcvs -Q ci -m . $file" \
"Checking in $file;
-${TESTDIR}/cvsroot/$module/$file,v <-- $file
+${CVSROOT_DIRNAME}/$module/$file,v <-- $file
new revision: 1\.2; previous revision: 1\.1
done"
@@ -16629,7 +18607,7 @@ done"
dotest tag8k-16 "$testcvs -Q tag $t-a $file" ''
# Extract the author value.
- name=`sed -n 's/.*; author \([^;]*\);.*/\1/p' ${TESTDIR}/cvsroot/$module/$file,v|head -1`
+ name=`sed -n 's/.*; author \([^;]*\);.*/\1/p' ${CVSROOT_DIRNAME}/$module/$file,v|head -1`
# Form a suffix string of length (16 - length($name)).
# CAREFUL: this will lose if $name is longer than 16.
@@ -16645,7 +18623,7 @@ done"
echo a >> $file
dotest tag8k-18 "$testcvs -Q ci -m . $file" \
"Checking in $file;
-${TESTDIR}/cvsroot/$module/$file,v <-- $file
+${CVSROOT_DIRNAME}/$module/$file,v <-- $file
new revision: 1\.3; previous revision: 1\.2
done"
cd ../..
@@ -16682,7 +18660,7 @@ done"
dotest admin-1 "${testcvs} -q co -l ." ''
mkdir first-dir
dotest admin-2 "${testcvs} add first-dir" \
-"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
cd first-dir
dotest_fail admin-3 "${testcvs} -q admin -i file1" \
@@ -16700,16 +18678,16 @@ ${PROG} \[admin aborted\]: specify ${PROG} -H admin for usage information"
${PROG} [a-z]*: scheduling file .file2. for addition
${PROG} [a-z]*: use .${PROG} commit. to add these files permanently"
dotest admin-6 "${testcvs} -q ci -m add" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done
Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
initial revision: 1\.1
done
-RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
done
Checking in file2;
-${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
+${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
initial revision: 1\.1
done"
dotest admin-7 "${testcvs} -q tag -b br" "T file1
@@ -16718,7 +18696,7 @@ T file2"
echo 'add a line on the branch' >> file1
dotest admin-9 "${testcvs} -q ci -m modify-on-branch" \
"Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.1\.2\.1; previous revision: 1\.1
done"
dotest admin-10 "${testcvs} -q update -A" "U file1"
@@ -16735,12 +18713,12 @@ ${PROG} \[[a-z]* aborted\]: attempt to specify a numeric revision"
# try a bad symbolic revision
dotest_fail admin-10c "${testcvs} -q admin -bBOGUS" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
-${PROG} [a-z]*: ${TESTDIR}/cvsroot/first-dir/file1,v: Symbolic name BOGUS is undefined.
-${PROG} [a-z]*: cannot modify RCS file for .file1.
-RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
-${PROG} [a-z]*: ${TESTDIR}/cvsroot/first-dir/file2,v: Symbolic name BOGUS is undefined.
-${PROG} [a-z]*: cannot modify RCS file for .file2."
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
+${PROG} [a-z]*: ${CVSROOT_DIRNAME}/first-dir/file1,v: Symbolic name BOGUS is undefined.
+${PROG} [a-z]*: RCS file for .file1. not modified\.
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
+${PROG} [a-z]*: ${CVSROOT_DIRNAME}/first-dir/file2,v: Symbolic name BOGUS is undefined.
+${PROG} [a-z]*: RCS file for .file2. not modified\."
# Note that -s option applies to the new default branch, not
# the old one.
@@ -16749,10 +18727,10 @@ ${PROG} [a-z]*: cannot modify RCS file for .file2."
# to change that once CVS parses options.
dotest admin-11 "${testcvs} -q admin -afoo,bar -abaz \
-b1.1.2 -cxx -U -sfoo file1" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done"
dotest admin-11a "${testcvs} log -N file1" "
-RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
Working file: file1
head: 1\.1
branch: 1\.1\.2
@@ -16775,10 +18753,10 @@ date: [0-9/]* [0-9:]*; author: ${username}; state: foo; lines: ${PLUS}1 -0
modify-on-branch
============================================================================="
dotest admin-12 "${testcvs} -q admin -bbr file1" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done"
dotest admin-12a "${testcvs} log -N file1" "
-RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
Working file: file1
head: 1\.1
branch: 1\.1\.2
@@ -16859,10 +18837,10 @@ add a line on the branch
@"
dotest admin-14 "${testcvs} -q admin -aauth3 -aauth2,foo \
-soneone:1.1 -m1.1:changed-log-message -ntagone: file2" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
done"
dotest admin-15 "${testcvs} -q log file2" "
-RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
Working file: file2
head: 1\.1
branch:
@@ -16885,10 +18863,10 @@ changed-log-message
dotest admin-16 "${testcvs} -q admin \
-A${CVSROOT_DIRNAME}/first-dir/file2,v -b -L -Nbr:1.1 file1" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done"
dotest admin-17 "${testcvs} -q log file1" "
-RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
Working file: file1
head: 1\.1
branch:
@@ -16916,14 +18894,14 @@ modify-on-branch
============================================================================="
dotest_fail admin-18 "${testcvs} -q admin -nbr:1.1.2 file1" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
-${PROG} [a-z]*: ${TESTDIR}/cvsroot/first-dir/file1,v: symbolic name br already bound to 1\.1
-${PROG} [a-z]*: cannot modify RCS file for .file1."
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
+${PROG} [a-z]*: ${CVSROOT_DIRNAME}/first-dir/file1,v: symbolic name br already bound to 1\.1
+${PROG} [a-z]*: RCS file for .file1. not modified\."
dotest admin-19 "${testcvs} -q admin -ebaz -ebar,auth3 -nbr file1" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done"
dotest admin-20 "${testcvs} -q log file1" "
-RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
Working file: file1
head: 1\.1
branch:
@@ -16952,19 +18930,18 @@ modify-on-branch
# relative pathnames in admin -A?
dotest_fail admin-19a-nonexist \
"${testcvs} -q admin -A${TESTDIR}/foo/bar file1" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
${PROG} [a-z]*: Couldn't open rcs file .${TESTDIR}/foo/bar.: No such file or directory
${PROG} \[[a-z]* aborted\]: cannot continue"
# In the remote case, we are cd'd off into the temp directory
# and so these tests give "No such file or directory" errors.
- if test "x$remote" = xno; then
-
- dotest admin-19a-admin "${testcvs} -q admin -A../../cvsroot/first-dir/file2,v file1" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+ if $remote; then :; else
+ dotest admin-19a-admin "${testcvs} -q admin -A../../cvsroot/first-dir/file2,v file1" \
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done"
- dotest admin-19a-log "${testcvs} -q log -h -N file1" "
-RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+ dotest admin-19a-log "${testcvs} -q log -h -N file1" "
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
Working file: file1
head: 1\.1
branch:
@@ -16980,10 +18957,10 @@ total revisions: 2
# Now test that plain -e works right.
dotest admin-19a-2 "${testcvs} -q admin -e file1" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done"
dotest admin-19a-3 "${testcvs} -q log -h -N file1" "
-RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
Working file: file1
head: 1\.1
branch:
@@ -16995,18 +18972,18 @@ total revisions: 2
# Put the access list back, to avoid special cases later.
dotest admin-19a-4 "${testcvs} -q admin -afoo,auth2 file1" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done"
# Add another revision to file2, so we can delete one.
echo 'add a line' >> file2
dotest admin-21 "${testcvs} -q ci -m modify file2" \
"Checking in file2;
-${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
+${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
new revision: 1\.2; previous revision: 1\.1
done"
dotest admin-22 "${testcvs} -q admin -o1.1 file2" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
deleting revision 1\.1
done"
# Test admin -o. More variants that we could be testing:
@@ -17020,48 +18997,48 @@ done"
"${PROG} [a-z]*: scheduling file .aaa. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest admin-22-o2 "${testcvs} -q ci -m first aaa" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/aaa,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/aaa,v
done
Checking in aaa;
-${TESTDIR}/cvsroot/first-dir/aaa,v <-- aaa
+${CVSROOT_DIRNAME}/first-dir/aaa,v <-- aaa
initial revision: 1\.1
done"
echo second rev >> aaa
dotest admin-22-o3 "${testcvs} -q ci -m second aaa" \
"Checking in aaa;
-${TESTDIR}/cvsroot/first-dir/aaa,v <-- aaa
+${CVSROOT_DIRNAME}/first-dir/aaa,v <-- aaa
new revision: 1\.2; previous revision: 1\.1
done"
echo third rev >> aaa
dotest admin-22-o4 "${testcvs} -q ci -m third aaa" \
"Checking in aaa;
-${TESTDIR}/cvsroot/first-dir/aaa,v <-- aaa
+${CVSROOT_DIRNAME}/first-dir/aaa,v <-- aaa
new revision: 1\.3; previous revision: 1\.2
done"
echo fourth rev >> aaa
dotest admin-22-o5 "${testcvs} -q ci -m fourth aaa" \
"Checking in aaa;
-${TESTDIR}/cvsroot/first-dir/aaa,v <-- aaa
+${CVSROOT_DIRNAME}/first-dir/aaa,v <-- aaa
new revision: 1\.4; previous revision: 1\.3
done"
echo fifth rev >>aaa
dotest admin-22-o6 "${testcvs} -q ci -m fifth aaa" \
"Checking in aaa;
-${TESTDIR}/cvsroot/first-dir/aaa,v <-- aaa
+${CVSROOT_DIRNAME}/first-dir/aaa,v <-- aaa
new revision: 1\.5; previous revision: 1\.4
done"
echo sixth rev >> aaa
dotest admin-22-o7 "${testcvs} -q ci -m sixth aaa" \
"Checking in aaa;
-${TESTDIR}/cvsroot/first-dir/aaa,v <-- aaa
+${CVSROOT_DIRNAME}/first-dir/aaa,v <-- aaa
new revision: 1\.6; previous revision: 1\.5
done"
dotest admin-22-o8 "${testcvs} admin -l1.6 aaa" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/aaa,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/aaa,v
1\.6 locked
done"
dotest admin-22-o9 "${testcvs} log -r1.6 aaa" "
-RCS file: ${TESTDIR}/cvsroot/first-dir/aaa,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/aaa,v
Working file: aaa
head: 1\.6
branch:
@@ -17078,20 +19055,20 @@ date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
sixth
============================================================================="
dotest_fail admin-22-o10 "${testcvs} admin -o1.5: aaa" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/aaa,v
-${PROG} [a-z]*: ${TESTDIR}/cvsroot/first-dir/aaa,v: can't remove locked revision 1\.6
-${PROG} [a-z]*: cannot modify RCS file for .aaa."
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/aaa,v
+${PROG} [a-z]*: ${CVSROOT_DIRNAME}/first-dir/aaa,v: can't remove locked revision 1\.6
+${PROG} [a-z]*: RCS file for .aaa. not modified\."
dotest admin-22-o11 "${testcvs} admin -u aaa" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/aaa,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/aaa,v
1\.6 unlocked
done"
dotest admin-22-o12 "${testcvs} admin -o1.5: aaa" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/aaa,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/aaa,v
deleting revision 1\.6
deleting revision 1\.5
done"
dotest admin-22-o13 "${testcvs} log aaa" "
-RCS file: ${TESTDIR}/cvsroot/first-dir/aaa,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/aaa,v
Working file: aaa
head: 1\.4
branch:
@@ -17124,18 +19101,18 @@ first
echo new branch rev >> aaa
dotest admin-22-o16 "${testcvs} ci -m new-branch aaa" \
"Checking in aaa;
-${TESTDIR}/cvsroot/first-dir/aaa,v <-- aaa
+${CVSROOT_DIRNAME}/first-dir/aaa,v <-- aaa
new revision: 1\.3\.2\.1; previous revision: 1\.3
done"
dotest_fail admin-22-o17 "${testcvs} admin -o1.2:1.4 aaa" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/aaa,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/aaa,v
deleting revision 1\.4
-${PROG} [a-z]*: ${TESTDIR}/cvsroot/first-dir/aaa,v: can't remove branch point 1\.3
-${PROG} [a-z]*: cannot modify RCS file for .aaa."
+${PROG} [a-z]*: ${CVSROOT_DIRNAME}/first-dir/aaa,v: can't remove branch point 1\.3
+${PROG} [a-z]*: RCS file for .aaa. not modified\."
dotest admin-22-o18 "${testcvs} update -p -r1.4 aaa" \
"===================================================================
Checking out aaa
-RCS: ${TESTDIR}/cvsroot/first-dir/aaa,v
+RCS: ${CVSROOT_DIRNAME}/first-dir/aaa,v
VERS: 1\.4
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
first rev
@@ -17145,29 +19122,29 @@ fourth rev"
echo second branch rev >> aaa
dotest admin-22-o19 "${testcvs} ci -m branch-two aaa" \
"Checking in aaa;
-${TESTDIR}/cvsroot/first-dir/aaa,v <-- aaa
+${CVSROOT_DIRNAME}/first-dir/aaa,v <-- aaa
new revision: 1\.3\.2\.2; previous revision: 1\.3\.2\.1
done"
echo third branch rev >> aaa
dotest admin-22-o20 "${testcvs} ci -m branch-three aaa" \
"Checking in aaa;
-${TESTDIR}/cvsroot/first-dir/aaa,v <-- aaa
+${CVSROOT_DIRNAME}/first-dir/aaa,v <-- aaa
new revision: 1\.3\.2\.3; previous revision: 1\.3\.2\.2
done"
echo fourth branch rev >> aaa
dotest admin-22-o21 "${testcvs} ci -m branch-four aaa" \
"Checking in aaa;
-${TESTDIR}/cvsroot/first-dir/aaa,v <-- aaa
+${CVSROOT_DIRNAME}/first-dir/aaa,v <-- aaa
new revision: 1\.3\.2\.4; previous revision: 1\.3\.2\.3
done"
dotest admin-22-o22 "${testcvs} admin -o:1.3.2.3 aaa" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/aaa,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/aaa,v
deleting revision 1\.3\.2\.1
deleting revision 1\.3\.2\.2
deleting revision 1\.3\.2\.3
done"
dotest admin-22-o23 "${testcvs} log aaa" "
-RCS file: ${TESTDIR}/cvsroot/first-dir/aaa,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/aaa,v
Working file: aaa
head: 1\.4
branch:
@@ -17215,7 +19192,7 @@ fourth branch rev"
# wonder whether the "cvs admin -o" should give a warning in
# this case.
dotest admin-23 "${testcvs} -q log file2" "
-RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
Working file: file2
head: 1\.2
branch:
@@ -17287,27 +19264,27 @@ add a line on the branch
# tagtwo should be a revision
#
dotest admin-26-1 "${testcvs} admin -ntagtwo:tagone file2" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
done"
# br1 should be a branch
#
dotest admin-26-2 "${testcvs} admin -nbr1:br file2" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
done"
# Attach some tags using RCS versions
#
dotest admin-26-3 "${testcvs} admin -ntagthree:1.1 file2" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
done"
dotest admin-26-4 "${testcvs} admin -nbr2:1.1.2 file2" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
done"
dotest admin-26-5 "${testcvs} admin -nbr4:1.1.0.2 file2" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
done"
# Check results so far
@@ -17317,7 +19294,7 @@ done"
File: file2 Status: Up-to-date
Working revision: 1\.2.*
- Repository revision: 1\.2 ${TESTDIR}/cvsroot/first-dir/file2,v
+ Repository revision: 1\.2 ${CVSROOT_DIRNAME}/first-dir/file2,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: (none)
@@ -17337,68 +19314,74 @@ File: file2 Status: Up-to-date
echo "nuthr_line" >> file2
dotest admin-27-1 "${testcvs} commit -m nuthr_line file2" \
"Checking in file2;
-${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
+${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
new revision: 1\.3; previous revision: 1\.2
done"
echo "yet_another" >> file2
dotest admin-27-2 "${testcvs} commit -m yet_another file2" \
"Checking in file2;
-${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
+${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
new revision: 1\.4; previous revision: 1\.3
done"
# Fail trying to reattach existing tag with -n
#
dotest admin-27-3 "${testcvs} admin -ntagfour:1.1 file2" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
done"
dotest_fail admin-27-4 "${testcvs} admin -ntagfour:1.3 file2" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
-${PROG} [a-z]*: ${TESTDIR}/cvsroot/first-dir/file2,v: symbolic name tagfour already bound to 1\.1
-${PROG} [a-z]*: cannot modify RCS file for .file2."
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
+${PROG} [a-z]*: ${CVSROOT_DIRNAME}/first-dir/file2,v: symbolic name tagfour already bound to 1\.1
+${PROG} [a-z]*: RCS file for .file2. not modified\."
# Succeed at reattaching existing tag, using -N
#
dotest admin-27-5 "${testcvs} admin -Ntagfour:1.3 file2" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
done"
# Fail on some bogus operations
# Try to attach to nonexistant tag
#
- dotest_fail admin-28-1 "${testcvs} admin -ntagsix:tagfive file2" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
-${PROG} \[[a-z]* aborted\]: tag .tagfive. does not exist"
+ dotest_fail admin-28-1 "${testcvs} admin -ntagsix:tagfive file2" \
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
+${PROG} [a-z]*: ${CVSROOT_DIRNAME}/first-dir/file2,v: Symbolic name or revision tagfive is undefined\.
+${PROG} [a-z]*: RCS file for .file2. not modified\."
# Try a some nonexisting numeric target tags
#
dotest_fail admin-28-2 "${testcvs} admin -ntagseven:2.1 file2" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
${PROG} \[[a-z]* aborted\]: revision .2\.1. does not exist"
dotest_fail admin-28-3 "${testcvs} admin -ntageight:2.1.2 file2" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
${PROG} \[[a-z]* aborted\]: revision .2\.1\.2. does not exist"
# Try some invalid targets
#
dotest_fail admin-28-4 "${testcvs} admin -ntagnine:1.a.2 file2" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
${PROG} \[[a-z]* aborted\]: tag .1\.a\.2. must start with a letter"
- dotest_fail admin-28-5 "${testcvs} admin -ntagten:BO+GUS file2" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
-${PROG} \[[a-z]* aborted\]: tag .BO${PLUS}GUS. does not exist"
-
+ # Confirm that a missing tag is not a fatal error.
+ dotest admin-28-5.1 "${testcvs} -Q tag BO+GUS file1" ''
+ dotest_fail admin-28-5.2 "${testcvs} admin -ntagten:BO+GUS file2 file1" \
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
+${PROG} [a-z]*: ${CVSROOT_DIRNAME}/first-dir/file2,v: Symbolic name or revision BO${PLUS}GUS is undefined\.
+${PROG} [a-z]*: RCS file for .file2. not modified\.
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
+done"
+
dotest_fail admin-28-6 "${testcvs} admin -nq.werty:tagfour file2" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
${PROG} \[[a-z]* aborted\]: tag .q\.werty. must not contain the characters ..*"
# Verify the archive
#
- dotest admin-29 "cat ${TESTDIR}/cvsroot/first-dir/file2,v" \
+ dotest admin-29 "cat ${CVSROOT_DIRNAME}/first-dir/file2,v" \
"head 1\.4;
access
auth3
@@ -17487,26 +19470,26 @@ text
dotest reserved-1 "${testcvs} -q co -l ." ''
mkdir first-dir
dotest reserved-2 "${testcvs} add first-dir" \
-"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
cd first-dir
touch file1
dotest reserved-3 "${testcvs} add file1" \
"${PROG} [a-z]*: scheduling file .file1. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest reserved-4 "${testcvs} -q ci -m add" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done
Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
initial revision: 1\.1
done"
dotest reserved-5 "${testcvs} -q admin -l file1" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
1\.1 locked
done"
dotest reserved-6 "${testcvs} log -N file1" "
-RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
Working file: file1
head: 1\.1
branch:
@@ -17525,12 +19508,12 @@ add
# Note that this just tests the owner of the lock giving
# it up. It doesn't test breaking a lock.
dotest reserved-7 "${testcvs} -q admin -u file1" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
1\.1 unlocked
done"
dotest reserved-8 "${testcvs} log -N file1" "
-RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
Working file: file1
head: 1\.1
branch:
@@ -17562,7 +19545,7 @@ if test -z "\$line"; then
else
user=\`echo \$line | sed -e 's/locks \\(${author}\\):[0-9.]*;.*/\\1/'\`
version=\`echo \$line | sed -e 's/locks ${author}:\\([0-9.]*\\);.*/\\1/'\`
- echo "\$user has file a-lock locked for version \$version"
+ echo "\$user has file a-lock locked for version \$version" >&2
exit 1
fi
EOF
@@ -17573,10 +19556,10 @@ EOF
"${PROG} [a-z]*: scheduling file .a-lock. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest reserved-10 "${testcvs} -q ci -m new a-lock" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/a-lock,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/a-lock,v
done
Checking in a-lock;
-${TESTDIR}/cvsroot/first-dir/a-lock,v <-- a-lock
+${CVSROOT_DIRNAME}/first-dir/a-lock,v <-- a-lock
initial revision: 1\.1
done"
# FIXME: the contents of CVSROOT fluctuate a lot
@@ -17593,7 +19576,7 @@ done"
echo "DEFAULT ${TESTDIR}/lockme" >>commitinfo
dotest reserved-12 "${testcvs} -q ci -m rcslock commitinfo" \
"Checking in commitinfo;
-${TESTDIR}/cvsroot/CVSROOT/commitinfo,v <-- commitinfo
+${CVSROOT_DIRNAME}/CVSROOT/commitinfo,v <-- commitinfo
new revision: 1\.2; previous revision: 1\.1
done
${PROG} [a-z]*: Rebuilding administrative file database"
@@ -17601,10 +19584,10 @@ ${PROG} [a-z]*: Rebuilding administrative file database"
# Simulate (approximately) what a-lock would look like
# if someone else had locked revision 1.1.
- sed -e 's/locks; strict;/locks fred:1.1; strict;/' ${TESTDIR}/cvsroot/first-dir/a-lock,v > a-lock,v
- chmod 644 ${TESTDIR}/cvsroot/first-dir/a-lock,v
- dotest reserved-13 "mv a-lock,v ${TESTDIR}/cvsroot/first-dir/a-lock,v"
- chmod 444 ${TESTDIR}/cvsroot/first-dir/a-lock,v
+ sed -e 's/locks; strict;/locks fred:1.1; strict;/' ${CVSROOT_DIRNAME}/first-dir/a-lock,v > a-lock,v
+ chmod 644 ${CVSROOT_DIRNAME}/first-dir/a-lock,v
+ dotest reserved-13 "mv a-lock,v ${CVSROOT_DIRNAME}/first-dir/a-lock,v"
+ chmod 444 ${CVSROOT_DIRNAME}/first-dir/a-lock,v
echo more stuff >> a-lock
dotest_fail reserved-13b "${testcvs} ci -m '' a-lock" \
"fred has file a-lock locked for version 1\.1
@@ -17613,31 +19596,31 @@ ${PROG} \[[a-z]* aborted\]: correct above errors first!"
# OK, now test "cvs admin -l" in the case where someone
# else has the file locked.
dotest_fail reserved-13c "${testcvs} admin -l a-lock" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/a-lock,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/a-lock,v
${PROG} \[[a-z]* aborted\]: Revision 1\.1 is already locked by fred"
dotest reserved-14 "${testcvs} admin -u1.1 a-lock" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/a-lock,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/a-lock,v
1\.1 unlocked
done"
dotest reserved-15 "${testcvs} -q ci -m success a-lock" \
"Checking in a-lock;
-${TESTDIR}/cvsroot/first-dir/a-lock,v <-- a-lock
+${CVSROOT_DIRNAME}/first-dir/a-lock,v <-- a-lock
new revision: 1\.2; previous revision: 1\.1
done"
# Now test for a bug involving branches and locks
- sed -e 's/locks; strict;/locks fred:1.2; strict;/' ${TESTDIR}/cvsroot/first-dir/a-lock,v > a-lock,v
- chmod 644 ${TESTDIR}/cvsroot/first-dir/a-lock,v
+ sed -e 's/locks; strict;/locks fred:1.2; strict;/' ${CVSROOT_DIRNAME}/first-dir/a-lock,v > a-lock,v
+ chmod 644 ${CVSROOT_DIRNAME}/first-dir/a-lock,v
dotest reserved-16 \
-"mv a-lock,v ${TESTDIR}/cvsroot/first-dir/a-lock,v" ""
- chmod 444 ${TESTDIR}/cvsroot/first-dir/a-lock,v
+"mv a-lock,v ${CVSROOT_DIRNAME}/first-dir/a-lock,v" ""
+ chmod 444 ${CVSROOT_DIRNAME}/first-dir/a-lock,v
dotest reserved-17 "${testcvs} -q tag -b br a-lock" "T a-lock"
dotest reserved-18 "${testcvs} -q update -r br a-lock" ""
echo edit it >>a-lock
dotest reserved-19 "${testcvs} -q ci -m modify a-lock" \
"Checking in a-lock;
-${TESTDIR}/cvsroot/first-dir/a-lock,v <-- a-lock
+${CVSROOT_DIRNAME}/first-dir/a-lock,v <-- a-lock
new revision: 1\.2\.2\.1; previous revision: 1\.2
done"
@@ -17646,7 +19629,7 @@ done"
echo '# vanilla commitinfo' >commitinfo
dotest reserved-cleanup-1 "${testcvs} -q ci -m back commitinfo" \
"Checking in commitinfo;
-${TESTDIR}/cvsroot/CVSROOT/commitinfo,v <-- commitinfo
+${CVSROOT_DIRNAME}/CVSROOT/commitinfo,v <-- commitinfo
new revision: 1\.3; previous revision: 1\.2
done
${PROG} [a-z]*: Rebuilding administrative file database"
@@ -17691,149 +19674,152 @@ ${PROG} [a-z]*: Rebuilding administrative file database"
mkdir diffmerge1
cd diffmerge1
- # The text of the file is inlined here because `echo' loses
- # newlines, and I don't know how portable the -e flag is.
- #
- # This is the file we both start out with:
- echo "// Button.java
-
-package random.application;
-
-import random.util.star;
-
-public class Button
-{
- /star Instantiates a Button with origin (0, 0) and zero width and height.
- star You must call an initializer method to properly initialize the Button.
- star/
- public Button ()
- {
- super ();
-
- _titleColor = Color.black;
- _disabledTitleColor = Color.gray;
- _titleFont = Font.defaultFont ();
- }
-
- /star Convenience constructor for instantiating a Button with
- star bounds x, y, width, and height. Equivalent to
- star foo = new Button ();
- star foo.init (x, y, width, height);
- star/
- public Button (int x, int y, int width, int height)
- {
- this ();
- init (x, y, width, height);
- }
-}" > the_file
+ # These are the files we both start out with:
+ mkdir import
+ cd import
+ diffmerge_create_older_files
dotest diffmerge1_import \
"${testcvs} import -m import diffmerge1 tag1 tag2" \
"${DOTSTAR}No conflicts created by this import"
cd ..
- rm -rf diffmerge1
- # Check out two working copies, one for "you" and one for "me"
- ${testcvs} checkout diffmerge1 >/dev/null 2>&1
- mv diffmerge1 diffmerge1_yours
+ # Check out two working copies, one for "you" and one for
+ # "me". If no branch is used and cvs detects that only one
+ # of the two people made changes, then cvs does not run the
+ # merge algorithm. But if a branch is used, then cvs does run
+ # the merge algorithm (even in this case of only one of the two
+ # people having made changes). CVS used to have a bug in this
+ # case. Therefore, it is important to test this case by
+ # using a branch:
+ ${testcvs} rtag -b tag diffmerge1 >/dev/null 2>&1
+ ${testcvs} checkout -r tag diffmerge1 >/dev/null 2>&1
+ mv diffmerge1 yours
${testcvs} checkout diffmerge1 >/dev/null 2>&1
- mv diffmerge1 diffmerge1_mine
-
- # In your working copy, you'll remove the Button() method, and
- # then check in your change before I check in mine:
- cd diffmerge1_yours
- echo "// Button.java
-
-package random.application;
-
-import random.util.star;
-
-public class Button
-{
- /star Instantiates a Button with origin (0, 0) and zero width and height.
- star You must call an initializer method to properly initialize the Button.
- star/
- public Button ()
- {
- super ();
-
- _titleColor = Color.black;
- _disabledTitleColor = Color.gray;
- _titleFont = Font.defaultFont ();
- }
-}" > the_file
- dotest diffmerge1_yours \
- "${testcvs} ci -m yours" \
- "${DOTSTAR}hecking in ${DOTSTAR}"
+ mv diffmerge1 mine
+
+ # In your working copy, you'll make changes, and
+ # then check in your changes before I check in mine:
+ cd yours
+ diffmerge_create_your_files
+ dotest diffmerge1_yours "${testcvs} -q ci -m yours" \
+"Checking in testcase01;
+${CVSROOT_DIRNAME}/diffmerge1/testcase01,v <-- testcase01
+new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1
+done
+Checking in testcase02;
+${CVSROOT_DIRNAME}/diffmerge1/testcase02,v <-- testcase02
+new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1
+done
+Checking in testcase03;
+${CVSROOT_DIRNAME}/diffmerge1/testcase03,v <-- testcase03
+new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1
+done
+Checking in testcase04;
+${CVSROOT_DIRNAME}/diffmerge1/testcase04,v <-- testcase04
+new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1
+done
+Checking in testcase05;
+${CVSROOT_DIRNAME}/diffmerge1/testcase05,v <-- testcase05
+new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1
+done
+Checking in testcase06;
+${CVSROOT_DIRNAME}/diffmerge1/testcase06,v <-- testcase06
+new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1
+done
+Checking in testcase07;
+${CVSROOT_DIRNAME}/diffmerge1/testcase07,v <-- testcase07
+new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1
+done
+Checking in testcase08;
+${CVSROOT_DIRNAME}/diffmerge1/testcase08,v <-- testcase08
+new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1
+done
+Checking in testcase09;
+${CVSROOT_DIRNAME}/diffmerge1/testcase09,v <-- testcase09
+new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1
+done
+Checking in testcase10;
+${CVSROOT_DIRNAME}/diffmerge1/testcase10,v <-- testcase10
+new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1
+done"
- # My working copy still has the Button() method, but I
- # comment out some code at the top of the class. Then I
+ # Change my copy. Then I
# update, after both my modifications and your checkin:
- cd ../diffmerge1_mine
- echo "// Button.java
-
-package random.application;
-
-import random.util.star;
-
-public class Button
-{
- /star Instantiates a Button with origin (0, 0) and zero width and height.
- star You must call an initializer method to properly initialize the Button.
- star/
- public Button ()
- {
- super ();
-
- // _titleColor = Color.black;
- // _disabledTitleColor = Color.gray;
- // _titleFont = Font.defaultFont ();
- }
-
- /star Convenience constructor for instantiating a Button with
- star bounds x, y, width, and height. Equivalent to
- star foo = new Button ();
- star foo.init (x, y, width, height);
- star/
- public Button (int x, int y, int width, int height)
- {
- this ();
- init (x, y, width, height);
- }
-}" > the_file
- dotest diffmerge1_mine \
- "${testcvs} update" \
- "${DOTSTAR}erging${DOTSTAR}"
+ cd ../mine
+ diffmerge_create_my_files
+ dotest diffmerge1_mine "${testcvs} -q update -j tag" \
+"M testcase01
+RCS file: ${CVSROOT_DIRNAME}/diffmerge1/testcase01,v
+retrieving revision 1\.1\.1\.1
+retrieving revision 1\.1\.1\.1\.2\.1
+Merging differences between 1\.1\.1\.1 and 1\.1\.1\.1\.2\.1 into testcase01
+M testcase02
+RCS file: ${CVSROOT_DIRNAME}/diffmerge1/testcase02,v
+retrieving revision 1\.1\.1\.1
+retrieving revision 1\.1\.1\.1\.2\.1
+Merging differences between 1\.1\.1\.1 and 1\.1\.1\.1\.2\.1 into testcase02
+M testcase03
+RCS file: ${CVSROOT_DIRNAME}/diffmerge1/testcase03,v
+retrieving revision 1\.1\.1\.1
+retrieving revision 1\.1\.1\.1\.2\.1
+Merging differences between 1\.1\.1\.1 and 1\.1\.1\.1\.2\.1 into testcase03
+M testcase04
+RCS file: ${CVSROOT_DIRNAME}/diffmerge1/testcase04,v
+retrieving revision 1\.1\.1\.1
+retrieving revision 1\.1\.1\.1\.2\.1
+Merging differences between 1\.1\.1\.1 and 1\.1\.1\.1\.2\.1 into testcase04
+RCS file: ${CVSROOT_DIRNAME}/diffmerge1/testcase05,v
+retrieving revision 1\.1\.1\.1
+retrieving revision 1\.1\.1\.1\.2\.1
+Merging differences between 1\.1\.1\.1 and 1\.1\.1\.1\.2\.1 into testcase05
+RCS file: ${CVSROOT_DIRNAME}/diffmerge1/testcase06,v
+retrieving revision 1\.1\.1\.1
+retrieving revision 1\.1\.1\.1\.2\.1
+Merging differences between 1\.1\.1\.1 and 1\.1\.1\.1\.2\.1 into testcase06
+M testcase07
+RCS file: ${CVSROOT_DIRNAME}/diffmerge1/testcase07,v
+retrieving revision 1\.1\.1\.1
+retrieving revision 1\.1\.1\.1\.2\.1
+Merging differences between 1\.1\.1\.1 and 1\.1\.1\.1\.2\.1 into testcase07
+M testcase08
+RCS file: ${CVSROOT_DIRNAME}/diffmerge1/testcase08,v
+retrieving revision 1\.1\.1\.1
+retrieving revision 1\.1\.1\.1\.2\.1
+Merging differences between 1\.1\.1\.1 and 1\.1\.1\.1\.2\.1 into testcase08
+M testcase09
+RCS file: ${CVSROOT_DIRNAME}/diffmerge1/testcase09,v
+retrieving revision 1\.1\.1\.1
+retrieving revision 1\.1\.1\.1\.2\.1
+Merging differences between 1\.1\.1\.1 and 1\.1\.1\.1\.2\.1 into testcase09
+M testcase10
+RCS file: ${CVSROOT_DIRNAME}/diffmerge1/testcase10,v
+retrieving revision 1\.1\.1\.1
+retrieving revision 1\.1\.1\.1\.2\.1
+Merging differences between 1\.1\.1\.1 and 1\.1\.1\.1\.2\.1 into testcase10"
# So if your changes didn't make it into my working copy, or
- # in any case if the file does not look like the final text as
- # quoted below, then the test flunks:
- echo "// Button.java
-
-package random.application;
-
-import random.util.star;
-
-public class Button
-{
- /star Instantiates a Button with origin (0, 0) and zero width and height.
- star You must call an initializer method to properly initialize the Button.
- star/
- public Button ()
- {
- super ();
+ # in any case if the files do not look like the final text
+ # in the files in directory comp_me, then the test flunks:
+ cd ..
+ mkdir comp_me
+ cd comp_me
+ diffmerge_create_expected_files
+ cd ..
+ rm mine/.#*
- // _titleColor = Color.black;
- // _disabledTitleColor = Color.gray;
- // _titleFont = Font.defaultFont ();
- }
-}" > comp_me
- dotest diffmerge1_cmp "cmp the_file comp_me" ''
+ # If you have GNU's version of diff, you may try
+ # uncommenting the following line which will give more
+ # fine-grained information about how cvs differed from the
+ # correct result:
+ #dotest diffmerge1_cmp "diff -u --recursive --exclude=CVS comp_me mine" ''
+ dotest diffmerge1_cmp "directory_cmp comp_me mine"
# Clean up after ourselves:
cd ..
- rm -rf diffmerge1_yours diffmerge1_mine ${CVSROOT_DIRNAME}/diffmerge1
-
+ if $keep; then :; else
+ rm -rf diffmerge1 ${CVSROOT_DIRNAME}/diffmerge1
+ fi
;;
diffmerge2)
@@ -18537,18 +20523,18 @@ d472 12
dotest release-1 "${testcvs} -q co -l ." ''
mkdir first-dir
dotest release-2 "${testcvs} add first-dir" \
-"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
cd first-dir
mkdir dir1
dotest release-3 "${testcvs} add dir1" \
-"Directory ${TESTDIR}/cvsroot/first-dir/dir1 added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir/dir1 added to the repository"
mkdir dir2
dotest release-4 "${testcvs} add dir2" \
-"Directory ${TESTDIR}/cvsroot/first-dir/dir2 added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir/dir2 added to the repository"
cd dir2
mkdir dir3
dotest release-5 "${testcvs} add dir3" \
-"Directory ${TESTDIR}/cvsroot/first-dir/dir2/dir3 added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir/dir2/dir3 added to the repository"
cd ../..
dotest release-6 "${testcvs} release -d first-dir/dir2/dir3 first-dir/dir1" \
@@ -18569,11 +20555,11 @@ ${PROG} [a-z]*: Updating first-dir/dir2"
cd first-dir
mkdir dir1
dotest release-10 "${testcvs} add dir1" \
-"Directory ${TESTDIR}/cvsroot/first-dir/dir1 added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir/dir1 added to the repository"
cd dir2
mkdir dir3
dotest release-11 "${testcvs} add dir3" \
-"Directory ${TESTDIR}/cvsroot/first-dir/dir2/dir3 added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir/dir2/dir3 added to the repository"
cd ../..
dotest release-12 "${testcvs} release first-dir/dir2/dir3 first-dir/dir1" \
@@ -18613,7 +20599,7 @@ ${PROG} [a-z]*: Updating first-dir"
CVSROOT2_DIRNAME=${TESTDIR}/root2
CVSROOT1=${CVSROOT1_DIRNAME} ; export CVSROOT1
CVSROOT2=${CVSROOT2_DIRNAME} ; export CVSROOT2
- if test "x$remote" = xyes; then
+ if $remote; then
CVSROOT1=:fork:${CVSROOT1_DIRNAME} ; export CVSROOT1
CVSROOT2=:fork:${CVSROOT2_DIRNAME} ; export CVSROOT2
fi
@@ -18808,7 +20794,11 @@ ${PROG} [a-z]*: cannot open directory ${TESTDIR}/root2/mod1-2: No such file or d
${PROG} [a-z]*: skipping directory mod2-2/mod1-2"
else
# non-RELATIVE_REPOS.
- if test "$remote" = no; then
+ if $remote; then
+ # Hmm, this one is specific to non-RELATIVE_REPOS too I think.
+ dotest_fail multiroot-update-1ar "${testcvs1} update" \
+"protocol error: directory '${TESTDIR}/root2/mod2-2' not within root '${TESTDIR}/root1'"
+ else
# The basic idea is that -d overrides CVS/Root.
# With RELATIVE_REPOS, CVS could print an error when it
# tries to recurse to mod2-2, which doesn't exist in
@@ -18823,14 +20813,13 @@ ${PROG} [a-z]*: Updating mod1-2/mod2-2
${PROG} [a-z]*: Updating mod2-1
${PROG} [a-z]*: Updating mod2-2
${PROG} [a-z]*: Updating mod2-2/mod1-2"
- else
- # Hmm, this one is specific to non-RELATIVE_REPOS too I think.
- dotest_fail multiroot-update-1a "${testcvs1} update" \
-"protocol error: directory '${TESTDIR}/root2/mod2-2' not within root '${TESTDIR}/root1'"
- fi # non-remote
+ fi # remote
# Same deal but with -d ${CVSROOT2}.
- if test "$remote" = no; then
+ if $remote; then
+ dotest_fail multiroot-update-1b "${testcvs2} update" \
+"protocol error: directory '${TESTDIR}/root1' not within root '${TESTDIR}/root2'"
+ else
dotest multiroot-update-1b "${testcvs2} update" \
"${PROG} update: Updating \.
${PROG} [a-z]*: Updating mod1-1
@@ -18839,10 +20828,7 @@ ${PROG} [a-z]*: Updating mod1-2/mod2-2
${PROG} [a-z]*: Updating mod2-1
${PROG} [a-z]*: Updating mod2-2
${PROG} [a-z]*: Updating mod2-2/mod1-2"
- else
- dotest_fail multiroot-update-1b "${testcvs2} update" \
-"protocol error: directory '${TESTDIR}/root1' not within root '${TESTDIR}/root2'"
- fi # non-remote
+ fi # remote
fi # non-RELATIVE_REPOS
# modify all files and do a diff
@@ -19005,31 +20991,31 @@ ${PROG} [a-z]*: Tagging mod2-2"
echo anotherfile1-2 > mod2-2/mod1-2/anotherfile1-2
echo anotherfile2-2 > mod1-2/mod2-2/anotherfile2-2
- if test "x$remote" = xno; then
- dotest multiroot-add-1 "${testcvs} add mod1-1/anotherfile1-1 mod2-1/anotherfile2-1 mod2-2/mod1-2/anotherfile1-2 mod1-2/mod2-2/anotherfile2-2" \
-"${PROG} [a-z]*: scheduling file .mod1-1/anotherfile1-1. for addition
-${PROG} [a-z]*: scheduling file .mod2-1/anotherfile2-1. for addition
-${PROG} [a-z]*: scheduling file .mod2-2/mod1-2/anotherfile1-2. for addition
-${PROG} [a-z]*: scheduling file .mod1-2/mod2-2/anotherfile2-2. for addition
-${PROG} [a-z]*: use .${PROG} commit. to add these files permanently"
- else
+ if $remote; then
cd mod1-1
- dotest multiroot-add-1a "${testcvs} add anotherfile1-1" \
+ dotest multiroot-add-1ar "${testcvs} add anotherfile1-1" \
"${PROG} [a-z]*: scheduling file .anotherfile1-1. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
cd ../mod2-1
- dotest multiroot-add-1b "${testcvs} add anotherfile2-1" \
+ dotest multiroot-add-1br "${testcvs} add anotherfile2-1" \
"${PROG} [a-z]*: scheduling file .anotherfile2-1. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
cd ../mod2-2/mod1-2
- dotest multiroot-add-1c "${testcvs} add anotherfile1-2" \
+ dotest multiroot-add-1cr "${testcvs} add anotherfile1-2" \
"${PROG} [a-z]*: scheduling file .anotherfile1-2. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
cd ../../mod1-2/mod2-2
- dotest multiroot-add-1d "${testcvs} add anotherfile2-2" \
+ dotest multiroot-add-1dr "${testcvs} add anotherfile2-2" \
"${PROG} [a-z]*: scheduling file .anotherfile2-2. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
cd ../..
+ else
+ dotest multiroot-add-1 "${testcvs} add mod1-1/anotherfile1-1 mod2-1/anotherfile2-1 mod2-2/mod1-2/anotherfile1-2 mod1-2/mod2-2/anotherfile2-2" \
+"${PROG} [a-z]*: scheduling file .mod1-1/anotherfile1-1. for addition
+${PROG} [a-z]*: scheduling file .mod2-1/anotherfile2-1. for addition
+${PROG} [a-z]*: scheduling file .mod2-2/mod1-2/anotherfile1-2. for addition
+${PROG} [a-z]*: scheduling file .mod1-2/mod2-2/anotherfile2-2. for addition
+${PROG} [a-z]*: use .${PROG} commit. to add these files permanently"
fi
dotest multiroot-status-1 "${testcvs} status -v" \
@@ -19786,7 +21772,7 @@ anyone
# refer to parts of our checked-out tree (e.g. "cvs update
# mod1-1 mod2-2")
- if test "$keep" = yes; then
+ if $keep; then
echo Keeping ${TESTDIR} and exiting due to --keep
exit 0
fi
@@ -19806,7 +21792,7 @@ anyone
CVSROOT2_DIRNAME=${TESTDIR}/root2
CVSROOT1=${CVSROOT1_DIRNAME} ; export CVSROOT1
CVSROOT2=${CVSROOT2_DIRNAME} ; export CVSROOT2
- if test "x$remote" = xyes; then
+ if $remote; then
CVSROOT1=:fork:${CVSROOT1_DIRNAME} ; export CVSROOT1
CVSROOT2=:fork:${CVSROOT2_DIRNAME} ; export CVSROOT2
fi
@@ -19869,12 +21855,12 @@ ${PROG} server: Updating dir1/sdir/ssdir"
# also prints some trace messages, and (2) the server trace
# messages are subject to out-of-order bugs (this one is hard
# to work around).
- if test "$remote" = no; then
+ if $remote; then :; else
dotest multiroot2-9 "${testcvs} -t update" \
-"${PROG} update: notice: main loop with CVSROOT=${TESTDIR}/root1
+" -> main loop with CVSROOT=${TESTDIR}/root1
${PROG} update: Updating \.
${PROG} update: Updating dir1
-${PROG} update: notice: main loop with CVSROOT=${TESTDIR}/root2
+ -> main loop with CVSROOT=${TESTDIR}/root2
${PROG} update: Updating dir1/sdir
${PROG} update: Updating dir1/sdir/ssdir"
fi
@@ -19906,8 +21892,8 @@ RCS file: ${TESTDIR}/root1/dir1/file1,v
retrieving revision 1\.1\.1\.1
retrieving revision 1\.2
diff -u -r1\.1\.1\.1 -r1\.2
---- dir1/file1 [0-9/]* [0-9:]* 1\.1\.1\.1
-${PLUS}${PLUS}${PLUS} dir1/file1 [0-9/]* [0-9:]* 1\.2
+--- dir1/file1 ${RFCDATE} 1\.1\.1\.1
+${PLUS}${PLUS}${PLUS} dir1/file1 ${RFCDATE} 1\.2
@@ -1 ${PLUS}1,2 @@
file1
${PLUS}change it
@@ -19917,13 +21903,13 @@ RCS file: ${TESTDIR}/root2/sdir/sfile,v
retrieving revision 1\.1\.1\.1
retrieving revision 1\.2
diff -u -r1\.1\.1\.1 -r1\.2
---- dir1/sdir/sfile [0-9/]* [0-9:]* 1\.1\.1\.1
-${PLUS}${PLUS}${PLUS} dir1/sdir/sfile [0-9/]* [0-9:]* 1\.2
+--- dir1/sdir/sfile ${RFCDATE} 1\.1\.1\.1
+${PLUS}${PLUS}${PLUS} dir1/sdir/sfile ${RFCDATE} 1\.2
@@ -1 ${PLUS}1,2 @@
sfile
${PLUS}change him too"
- if test "$keep" = yes; then
+ if $keep; then
echo Keeping ${TESTDIR} and exiting due to --keep
exit 0
fi
@@ -19941,7 +21927,7 @@ ${PLUS}change him too"
# Not drastically different from multiroot but it covers somewhat
# different stuff.
- if test "x$remote" = xyes; then
+ if $remote; then
CVSROOT1=:fork:${TESTDIR}/root1 ; export CVSROOT1
CVSROOT2=:fork:${TESTDIR}/root2 ; export CVSROOT2
else
@@ -19964,7 +21950,7 @@ ${PLUS}change him too"
# I suppose because of the "rm -r".
# For local this fixes it up.
dotest multiroot3-6 "${testcvs} -d ${CVSROOT1} -q co dir1" ""
- if test "$remote" = yes; then
+ if $remote; then
# For remote that doesn't do it. Use the quick and dirty fix.
echo "D/dir1////" >CVS/Entries
echo "D/dir2////" >>CVS/Entries
@@ -19974,7 +21960,7 @@ ${PLUS}change him too"
"Directory ${TESTDIR}/root2/dir2 added to the repository"
touch dir1/file1 dir2/file2
- if test "$remote" = yes; then
+ if $remote; then
# Trying to add them both in one command doesn't work,
# because add.c doesn't do multiroot (it doesn't use recurse.c).
# Furthermore, it can't deal with the parent directory
@@ -20019,7 +22005,7 @@ ${PROG} [a-z]*: failed to obtain dir lock in repository .${TESTDIR}/root1/dir2'
${PROG} \[[a-z]* aborted\]: read lock failed - giving up"
else
# Not RELATIVE_REPOS.
- if test "$remote" = yes; then
+ if $remote; then
# This is good behavior - we are asking CVS to do something
# which doesn't make sense.
dotest_fail multiroot3-10 \
@@ -20067,7 +22053,7 @@ ${PROG} \[[a-z]* aborted\]: illegal source repository"
cd ../..
- if test "$keep" = yes; then
+ if $keep; then
echo Keeping ${TESTDIR} and exiting due to --keep
exit 0
fi
@@ -20082,7 +22068,7 @@ ${PROG} \[[a-z]* aborted\]: illegal source repository"
# More multiroot tests, in particular we have two roots with
# similarly-named directories and we try to see that CVS can
# keep them separate.
- if test "x$remote" = xyes; then
+ if $remote; then
CVSROOT1=:fork:${TESTDIR}/root1 ; export CVSROOT1
CVSROOT2=:fork:${TESTDIR}/root2 ; export CVSROOT2
else
@@ -20163,7 +22149,7 @@ done"
dotest rmroot-setup-1 "${testcvs} -q co -l ." ''
mkdir first-dir
dotest rmroot-setup-2 "${testcvs} add first-dir" \
-"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
+"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
cd first-dir
touch file1 file2
dotest rmroot-setup-3 "${testcvs} add file1 file2" \
@@ -20171,16 +22157,16 @@ done"
${PROG} [a-z]*: scheduling file .file2. for addition
${PROG} [a-z]*: use .${PROG} commit. to add these files permanently"
dotest rmroot-setup-4 "${testcvs} -q commit -minit" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done
Checking in file1;
-${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
initial revision: 1\.1
done
-RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
done
Checking in file2;
-${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
+${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
initial revision: 1\.1
done"
rm CVS/Root
@@ -20195,7 +22181,7 @@ done"
# Similar to crerepos but that test is probably getting big
# enough.
- if test "x$remote" = xyes; then
+ if $remote; then
CVSROOT1=:fork:${TESTDIR}/root1 ; export CVSROOT1
CVSROOT_MOVED=:fork:${TESTDIR}/root-moved ; export CVSROOT1
else
@@ -20226,19 +22212,26 @@ No conflicts created by this import"
# There were some duplicated warnings and such; only test
# for the part of the error message which makes sense.
# Bug: "skipping directory " without filename.
- if test "$remote" = no; then
+ if $remote; then
+ dotest_fail reposmv-2r "${testcvs} update" \
+"Cannot access ${TESTDIR}/root1/CVSROOT
+No such file or directory"
+ else
dotest reposmv-2 "${testcvs} update" "${DOTSTAR}
${PROG} update: ignoring CVS/Root because it specifies a non-existent repository ${TESTDIR}/root1
-${PROG} update: cannot open directory ${TESTDIR}/cvsroot/dir1: No such file or directory
+${PROG} update: cannot open directory ${CVSROOT_DIRNAME}/dir1: No such file or directory
${PROG} update: skipping directory "
- else
- dotest_fail reposmv-2 "${testcvs} update" \
-"Cannot access ${TESTDIR}/root1/CVSROOT
-No such file or directory"
fi
# CVS/Root overrides $CVSROOT
- if test "$remote" = no; then
+ if $remote; then
+ CVSROOT_SAVED=${CVSROOT}
+ CVSROOT=:fork:${TESTDIR}/root-moved; export CVSROOT
+ dotest_fail reposmv-3r "${testcvs} update" \
+"Cannot access ${TESTDIR}/root1/CVSROOT
+No such file or directory"
+ CVSROOT=${CVSROOT_SAVED}; export CVSROOT
+ else
CVSROOT_SAVED=${CVSROOT}
CVSROOT=${TESTDIR}/root-moved; export CVSROOT
dotest reposmv-3 "${testcvs} update" \
@@ -20247,16 +22240,16 @@ ${PROG} update: ignoring CVS/Root because it specifies a non-existent repository
${PROG} update: Updating \.
${DOTSTAR}"
CVSROOT=${CVSROOT_SAVED}; export CVSROOT
- else
+ fi
+
+ if $remote; then
CVSROOT_SAVED=${CVSROOT}
- CVSROOT=:fork:${TESTDIR}/root-moved; export CVSROOT
- dotest_fail reposmv-3 "${testcvs} update" \
+ CVSROOT=:fork:${TESTDIR}/root-none; export CVSROOT
+ dotest_fail reposmv-4 "${testcvs} update" \
"Cannot access ${TESTDIR}/root1/CVSROOT
No such file or directory"
CVSROOT=${CVSROOT_SAVED}; export CVSROOT
- fi
-
- if test "$remote" = no; then
+ else
# CVS/Root doesn't seem to quite completely override $CVSROOT
# Bug? Not necessarily a big deal if it only affects error
# messages.
@@ -20267,13 +22260,6 @@ No such file or directory"
${PROG} update: ignoring CVS/Root because it specifies a non-existent repository ${TESTDIR}/root1
${PROG} \[update aborted\]: ${TESTDIR}/root-none/CVSROOT: No such file or directory"
CVSROOT=${CVSROOT_SAVED}; export CVSROOT
- else
- CVSROOT_SAVED=${CVSROOT}
- CVSROOT=:fork:${TESTDIR}/root-none; export CVSROOT
- dotest_fail reposmv-4 "${testcvs} update" \
-"Cannot access ${TESTDIR}/root1/CVSROOT
-No such file or directory"
- CVSROOT=${CVSROOT_SAVED}; export CVSROOT
fi
# -d overrides CVS/Root
@@ -20297,7 +22283,7 @@ No such file or directory"
pserver)
# Test basic pserver functionality.
- if test "$remote" = yes; then
+ if $remote; then
# First set SystemAuth=no. Not really necessary, I don't
# think, but somehow it seems like the clean thing for
# the testsuite.
@@ -20307,7 +22293,7 @@ No such file or directory"
echo "SystemAuth=no" >config
dotest pserver-2 "${testcvs} -q ci -m config-it" \
"Checking in config;
-${TESTDIR}/cvsroot/CVSROOT/config,v <-- config
+${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
done
${PROG} [a-z]*: Rebuilding administrative file database"
@@ -20437,7 +22423,7 @@ EOF
echo "# comments only" >config
dotest pserver-cleanup-1 "${testcvs} -q ci -m config-it" \
"Checking in config;
-${TESTDIR}/cvsroot/CVSROOT/config,v <-- config
+${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
done
${PROG} [a-z]*: Rebuilding administrative file database"
@@ -20449,7 +22435,7 @@ ${PROG} [a-z]*: Rebuilding administrative file database"
server)
# Some tests of the server (independent of the client).
- if test "$remote" = yes; then
+ if $remote; then
dotest server-1 "${testcvs} server" \
"E Protocol error: Root request missing
error " <<EOF
@@ -20618,7 +22604,7 @@ ${TESTDIR}/crerepos/dir1
editors
EOF
- if test "$keep" = yes; then
+ if $keep; then
echo Keeping ${TESTDIR} and exiting due to --keep
exit 0
fi
@@ -20631,29 +22617,29 @@ EOF
server2)
# More server tests, in particular testing that various
# possible security holes are plugged.
- if test "$remote" = yes; then
+ if $remote; then
dotest server2-1 "${testcvs} server" \
-"E protocol error: directory '${TESTDIR}/cvsroot/\.\./dir1' not within root '${TESTDIR}/cvsroot'
+"E protocol error: directory '${CVSROOT_DIRNAME}/\.\./dir1' not within root '${TESTDIR}/cvsroot'
error " <<EOF
-Root ${TESTDIR}/cvsroot
+Root ${CVSROOT_DIRNAME}
Directory .
-${TESTDIR}/cvsroot/../dir1
+${CVSROOT_DIRNAME}/../dir1
noop
EOF
dotest server2-2 "${testcvs} server" \
-"E protocol error: directory '${TESTDIR}/cvsrootdir1' not within root '${TESTDIR}/cvsroot'
+"E protocol error: directory '${CVSROOT_DIRNAME}dir1' not within root '${TESTDIR}/cvsroot'
error " <<EOF
-Root ${TESTDIR}/cvsroot
+Root ${CVSROOT_DIRNAME}
Directory .
-${TESTDIR}/cvsrootdir1
+${CVSROOT_DIRNAME}dir1
noop
EOF
dotest 2-3 "${testcvs} server" \
-"E protocol error: directory '${TESTDIR}' not within root '${TESTDIR}/cvsroot'
+"E protocol error: directory '${TESTDIR}' not within root '${CVSROOT_DIRNAME}'
error " <<EOF
-Root ${TESTDIR}/cvsroot
+Root ${CVSROOT_DIRNAME}
Directory .
${TESTDIR}
noop
@@ -20666,9 +22652,9 @@ EOF
dotest server2-4 "${testcvs} server" \
"E protocol error: directory 'foo/bar' not within current directory
error " <<EOF
-Root ${TESTDIR}/cvsroot
+Root ${CVSROOT_DIRNAME}
Directory .
-${TESTDIR}/cvsroot
+${CVSROOT_DIRNAME}
Unchanged foo/bar
noop
EOF
@@ -20677,7 +22663,7 @@ EOF
client)
# Some tests of the client (independent of the server).
- if test "$remote" = yes; then
+ if $remote; then
cat >${TESTDIR}/serveme <<EOF
#!${TESTSHELL}
# This is admittedly a bit cheezy, in the sense that we make lots
@@ -20689,7 +22675,7 @@ echo "Valid-requests Root Valid-responses valid-requests Directory Entry Modifie
echo "ok"
echo "M special message"
echo "Created first-dir/"
-echo "${TESTDIR}/cvsroot/first-dir/file1"
+echo "${CVSROOT_DIRNAME}/first-dir/file1"
echo "/file1/1.1///"
echo "u=rw,g=rw,o=rw"
echo "4"
@@ -20710,10 +22696,10 @@ echo "Valid-requests Root Valid-responses valid-requests Directory Entry Modifie
echo "ok"
echo "M merge-it"
echo "Copy-file ./"
-echo "${TESTDIR}/cvsroot/first-dir/file1"
+echo "${CVSROOT_DIRNAME}/first-dir/file1"
echo "${TESTDIR}/bogus/.#file1.1.1"
echo "Merged ./"
-echo "${TESTDIR}/cvsroot/first-dir/file1"
+echo "${CVSROOT_DIRNAME}/first-dir/file1"
echo "/file1/1.2///"
echo "u=rw,g=rw,o=rw"
echo "4"
@@ -20733,10 +22719,10 @@ echo "Valid-requests Root Valid-responses valid-requests Directory Entry Modifie
echo "ok"
echo "M merge-it"
echo "Copy-file ./"
-echo "${TESTDIR}/cvsroot/first-dir/file1"
+echo "${CVSROOT_DIRNAME}/first-dir/file1"
echo ".#file1.1.1"
echo "Merged ./"
-echo "${TESTDIR}/cvsroot/first-dir/file1"
+echo "${CVSROOT_DIRNAME}/first-dir/file1"
echo "/file1/1.2///"
echo "u=rw,g=rw,o=rw"
echo "4"
@@ -20763,13 +22749,13 @@ EOF
# know exactly how that will translate to GMT.
dotest client-8 "${testcvs} update -D 99-10-04" "OK, whatever"
dotest client-9 "cat ${TESTDIR}/client.tmp" \
-"Root ${TESTDIR}/cvsroot
+"Root ${CVSROOT_DIRNAME}
Valid-responses [-a-zA-Z ]*
valid-requests
Argument -D
Argument [34] Oct 1999 [0-9][0-9]:00:00 -0000
Directory \.
-${TESTDIR}/cvsroot/first-dir
+${CVSROOT_DIRNAME}/first-dir
Entry /file1/1\.2///
Modified file1
u=rw,g=,o=
@@ -20785,16 +22771,51 @@ update"
fi # skip the whole thing for local
;;
+ fork)
+ # Test that the server defaults to the correct executable in :fork:
+ # mode. See the note in the TODO at the end of this file about this.
+ #
+ # This test and client should be left after all other references to
+ # CVS_SERVER are removed from this script.
+ #
+ # The client series of tests already tests that CVS_SERVER is
+ # working, but that test might be better here.
+ if $remote; then
+ mkdir fork; cd fork
+ unset CVS_SERVER
+ # So looking through $PATH for cvs won't work...
+ echo "echo junk" >cvs
+ chmod a+x cvs
+ save_PATH=$PATH; PATH=.:$PATH
+ dotest fork-1 "$testcvs -d:fork:$CVSROOT_DIRNAME version" \
+'Client: \(.*\)
+Server: \1'
+ CVS_SERVER=${testcvs}; export CVS_SERVER
+ PATH=$save_PATH; unset save_PATH
+ cd ..
+ if $keep; then :; else
+ rm -rf fork
+ fi
+ fi
+ ;;
+
*)
echo $what is not the name of a test -- ignored
;;
esac
done
+# Sanity check sanity.sh. :)
+#
+# Test our exit directory so that tests that exit in an incorrect directory are
+# noticed during single test runs.
+if test "x$TESTDIR" != "x`pwd`"; then
+ fail "cleanup: PWD != TESTDIR (\``pwd`' != \`$TESTDIR')"
+fi
+
echo "OK, all tests completed."
# TODO:
-# * use "test" not "[" and see if all test's support `-z'
# * Test `cvs update -d foo' (where foo does not exist).
# * Test `cvs update foo bar' (where foo and bar are both from the
# same directory in the repository). Suppose one is a branch--make
@@ -20829,10 +22850,24 @@ echo "OK, all tests completed."
# this needs to be documented in cvs.texinfo, but is not)
# - Test that unrecognized files in CVS directories (e.g. CVS/Foobar)
# are ignored (per cvs.texinfo).
+# - Test 'cvs history' with symlinks in the path to the working directory.
+# - Remove most of the CVS_SERVER stuff after a reasonable amount of time.
+# The "fork" & "client" series of tests should be left. 4/2/00, CVS
+# 1.11.0.1 was altered so that it would default to program_name (set from
+# argv[0]) rather than "cvs", but I'd like this script to work on legacy
+# versions of CVS for awhile.
+# - Testsuite doesn't work with usernames over eight characters in length.
+# Fix it.
# End of TODO list.
+# Exit if keep set
+if $keep; then
+ echo "Keeping ${TESTDIR} and exiting due to -k (keep) option."
+ exit 0
+fi
+
# Remove the test directory, but first change out of it.
-cd /tmp
+cd `dirname ${TESTDIR}`
rm -rf ${TESTDIR}
# end of sanity.sh
diff --git a/gnu/usr.bin/cvs/src/stamp-h2.in b/gnu/usr.bin/cvs/src/stamp-h2.in
new file mode 100644
index 00000000000..9788f70238c
--- /dev/null
+++ b/gnu/usr.bin/cvs/src/stamp-h2.in
@@ -0,0 +1 @@
+timestamp
diff --git a/gnu/usr.bin/cvs/src/status.c b/gnu/usr.bin/cvs/src/status.c
index 4e5ddcbd658..7b64d30b4d8 100644
--- a/gnu/usr.bin/cvs/src/status.c
+++ b/gnu/usr.bin/cvs/src/status.c
@@ -67,7 +67,7 @@ cvsstatus (argc, argv)
wrap_setup ();
#ifdef CLIENT_SUPPORT
- if (client_active)
+ if (current_parsed_root->isremote)
{
start_server ();
@@ -135,11 +135,9 @@ status_fileproc (callerdat, finfo)
case T_CHECKOUT:
sstat = "Needs Checkout";
break;
-#ifdef SERVER_SUPPORT
case T_PATCH:
sstat = "Needs Patch";
break;
-#endif
case T_CONFLICT:
/* I _think_ that "unresolved" is correct; that if it has
been resolved then the status will change. But I'm not
diff --git a/gnu/usr.bin/cvs/src/tag.c b/gnu/usr.bin/cvs/src/tag.c
index a9d8534160a..a2883c8e1b4 100644
--- a/gnu/usr.bin/cvs/src/tag.c
+++ b/gnu/usr.bin/cvs/src/tag.c
@@ -5,15 +5,19 @@
* You may distribute under the terms of the GNU General Public License as
* specified in the README file that comes with the CVS source distribution.
*
- * Tag
+ * Tag and Rtag
*
* Add or delete a symbolic name to an RCS file, or a collection of RCS files.
- * Uses the checked out revision in the current directory.
+ * Tag uses the checked out revision in the current directory, rtag uses
+ * the modules database, if necessary.
*/
#include "cvs.h"
#include "savecwd.h"
+static int rtag_proc PROTO((int argc, char **argv, char *xwhere,
+ char *mwhere, char *mfile, int shorten,
+ int local_specified, char *mname, char *msg));
static int check_fileproc PROTO ((void *callerdat, struct file_info *finfo));
static int check_filesdoneproc PROTO ((void *callerdat, int err,
char *repos, char *update_dir,
@@ -26,20 +30,22 @@ static int pretag_list_proc PROTO((Node *p, void *closure));
static Dtype tag_dirproc PROTO ((void *callerdat, char *dir,
char *repos, char *update_dir,
List *entries));
+static int rtag_fileproc PROTO ((void *callerdat, struct file_info *finfo));
+static int rtag_delete PROTO((RCSNode *rcsfile));
static int tag_fileproc PROTO ((void *callerdat, struct file_info *finfo));
-static int tag_filesdoneproc PROTO ((void *callerdat, int err,
- char *repos, char *update_dir,
- List *entries));
-static char *numtag;
+static char *numtag; /* specific revision to tag */
+static int numtag_validated = 0;
static char *date = NULL;
-static char *symtag;
+static char *symtag; /* tag to add or delete */
static int delete_flag; /* adding a tag by default */
static int branch_mode; /* make an automagic "branch" tag */
static int local; /* recursive by default */
-static int force_tag_match = 1; /* force tag to match by default */
+static int force_tag_match = 1; /* force tag to match by default */
static int force_tag_move; /* don't force tag to move by default */
static int check_uptodate; /* no uptodate-check by default */
+static int attic_too; /* remove tag from Attic files */
+static int is_rtag;
struct tag_info
{
@@ -57,18 +63,37 @@ struct master_lists
static List *mtlist;
static List *tlist;
-static const char *const tag_usage[] =
+static const char rtag_opts[] = "+abdFflnQqRr:D:";
+static const char *const rtag_usage[] =
{
- "Usage: %s %s [-lRF] [-b] [-d] [-c] [-r rev|-D date] tag [files...]\n",
+ "Usage: %s %s [-abdFflnR] [-r rev|-D date] tag modules...\n",
+ "\t-a\tClear tag from removed files that would not otherwise be tagged.\n",
+ "\t-b\tMake the tag a \"branch\" tag, allowing concurrent development.\n",
+ "\t-d\tDelete the given tag.\n",
+ "\t-F\tMove tag if it already exists.\n",
+ "\t-f\tForce a head revision match if tag/date not found.\n",
"\t-l\tLocal directory only, not recursive.\n",
+ "\t-n\tNo execution of 'tag program'.\n",
"\t-R\tProcess directories recursively.\n",
- "\t-d\tDelete the given tag.\n",
"\t-r rev\tExisting revision/tag.\n",
"\t-D\tExisting date.\n",
- "\t-f\tForce a head revision if specified tag not found.\n",
+ "(Specify the --help global option for a list of other help options)\n",
+ NULL
+};
+
+static const char tag_opts[] = "+bcdFflQqRr:D:";
+static const char *const tag_usage[] =
+{
+ "Usage: %s %s [-bcdFflR] [-r rev|-D date] tag [files...]\n",
"\t-b\tMake the tag a \"branch\" tag, allowing concurrent development.\n",
- "\t-F\tMove tag if it already exists.\n",
"\t-c\tCheck that working files are unmodified.\n",
+ "\t-d\tDelete the given tag.\n",
+ "\t-F\tMove tag if it already exists.\n",
+ "\t-f\tForce a head revision match if tag/date not found.\n",
+ "\t-l\tLocal directory only, not recursive.\n",
+ "\t-R\tProcess directories recursively.\n",
+ "\t-r rev\tExisting revision/tag.\n",
+ "\t-D\tExisting date.\n",
"(Specify the --help global option for a list of other help options)\n",
NULL
};
@@ -80,15 +105,42 @@ cvstag (argc, argv)
{
int c;
int err = 0;
+ int run_module_prog = 1;
+ is_rtag = (strcmp (command_name, "rtag") == 0);
+
if (argc == -1)
- usage (tag_usage);
+ usage (is_rtag ? rtag_usage : tag_usage);
optind = 0;
- while ((c = getopt (argc, argv, "+FQqlRcdr:D:bf")) != -1)
+ while ((c = getopt (argc, argv, is_rtag ? rtag_opts : tag_opts)) != -1)
{
switch (c)
{
+ case 'a':
+ attic_too = 1;
+ break;
+ case 'b':
+ branch_mode = 1;
+ break;
+ case 'c':
+ check_uptodate = 1;
+ break;
+ case 'd':
+ delete_flag = 1;
+ break;
+ case 'F':
+ force_tag_move = 1;
+ break;
+ case 'f':
+ force_tag_match = 0;
+ break;
+ case 'l':
+ local = 1;
+ break;
+ case 'n':
+ run_module_prog = 0;
+ break;
case 'Q':
case 'q':
#ifdef SERVER_SUPPORT
@@ -100,18 +152,9 @@ cvstag (argc, argv)
"-q or -Q must be specified before \"%s\"",
command_name);
break;
- case 'l':
- local = 1;
- break;
case 'R':
local = 0;
break;
- case 'd':
- delete_flag = 1;
- break;
- case 'c':
- check_uptodate = 1;
- break;
case 'r':
numtag = optarg;
break;
@@ -120,26 +163,17 @@ cvstag (argc, argv)
free (date);
date = Make_Date (optarg);
break;
- case 'f':
- force_tag_match = 0;
- break;
- case 'b':
- branch_mode = 1;
- break;
- case 'F':
- force_tag_move = 1;
- break;
case '?':
default:
- usage (tag_usage);
+ usage (is_rtag ? rtag_usage : tag_usage);
break;
}
}
argc -= optind;
argv += optind;
- if (argc == 0)
- usage (tag_usage);
+ if (argc < (is_rtag ? 2 : 1))
+ usage (is_rtag ? rtag_usage : tag_usage);
symtag = argv[0];
argc--;
argv++;
@@ -151,25 +185,29 @@ cvstag (argc, argv)
RCS_check_tag (symtag);
#ifdef CLIENT_SUPPORT
- if (client_active)
+ if (current_parsed_root->isremote)
{
/* We're the client side. Fire up the remote server. */
start_server ();
ign_setup ();
- if (!force_tag_match)
- send_arg ("-f");
- if (local)
- send_arg("-l");
- if (delete_flag)
- send_arg("-d");
- if (check_uptodate)
- send_arg("-c");
+ if (attic_too)
+ send_arg("-a");
if (branch_mode)
send_arg("-b");
+ if (check_uptodate)
+ send_arg("-c");
+ if (delete_flag)
+ send_arg("-d");
if (force_tag_move)
send_arg("-F");
+ if (!force_tag_match)
+ send_arg ("-f");
+ if (local)
+ send_arg("-l");
+ if (!run_module_prog)
+ send_arg("-n");
if (numtag)
option_with_arg ("-r", numtag);
@@ -178,20 +216,155 @@ cvstag (argc, argv)
send_arg (symtag);
- send_files (argc, argv, local, 0,
+ if (is_rtag)
+ {
+ int i;
+ for (i = 0; i < argc; ++i)
+ send_arg (argv[i]);
+ send_to_server ("rtag\012", 0);
+ }
+ else
+ {
+
+ send_files (argc, argv, local, 0,
/* I think the -c case is like "cvs status", in
which we really better be correct rather than
being fast; it is just too confusing otherwise. */
- check_uptodate ? 0 : SEND_NO_CONTENTS);
- send_file_names (argc, argv, SEND_EXPAND_WILD);
- send_to_server ("tag\012", 0);
+ check_uptodate ? 0 : SEND_NO_CONTENTS);
+ send_file_names (argc, argv, SEND_EXPAND_WILD);
+ send_to_server ("tag\012", 0);
+ }
+
return get_responses_and_close ();
}
#endif
- if (numtag != NULL)
- tag_check_valid (numtag, argc, argv, local, 0, "");
+ if (is_rtag)
+ {
+ DBM *db;
+ int i;
+ db = open_module ();
+ for (i = 0; i < argc; i++)
+ {
+ /* XXX last arg should be repository, but doesn't make sense here */
+ history_write ('T', (delete_flag ? "D" : (numtag ? numtag :
+ (date ? date : "A"))), symtag, argv[i], "");
+ err += do_module (db, argv[i], TAG,
+ delete_flag ? "Untagging" : "Tagging",
+ rtag_proc, (char *) NULL, 0, 0, run_module_prog,
+ 0, symtag);
+ }
+ close_module (db);
+ }
+ else
+ {
+ err = rtag_proc (argc + 1, argv - 1, NULL, NULL, NULL, 0, 0, NULL,
+ NULL);
+ }
+
+ return (err);
+}
+
+/*
+ * callback proc for doing the real work of tagging
+ */
+/* ARGSUSED */
+static int
+rtag_proc (argc, argv, xwhere, mwhere, mfile, shorten, local_specified,
+ mname, msg)
+ int argc;
+ char **argv;
+ char *xwhere;
+ char *mwhere;
+ char *mfile;
+ int shorten;
+ int local_specified;
+ char *mname;
+ char *msg;
+{
+ /* Begin section which is identical to patch_proc--should this
+ be abstracted out somehow? */
+ char *myargv[2];
+ int err = 0;
+ int which;
+ char *repository;
+ char *where;
+
+ if (is_rtag)
+ {
+ repository = xmalloc (strlen (current_parsed_root->directory) + strlen (argv[0])
+ + (mfile == NULL ? 0 : strlen (mfile) + 1) + 2);
+ (void) sprintf (repository, "%s/%s", current_parsed_root->directory, argv[0]);
+ where = xmalloc (strlen (argv[0]) + (mfile == NULL ? 0 : strlen (mfile) + 1)
+ + 1);
+ (void) strcpy (where, argv[0]);
+
+ /* if mfile isn't null, we need to set up to do only part of the module */
+ if (mfile != NULL)
+ {
+ char *cp;
+ char *path;
+
+ /* if the portion of the module is a path, put the dir part on repos */
+ if ((cp = strrchr (mfile, '/')) != NULL)
+ {
+ *cp = '\0';
+ (void) strcat (repository, "/");
+ (void) strcat (repository, mfile);
+ (void) strcat (where, "/");
+ (void) strcat (where, mfile);
+ mfile = cp + 1;
+ }
+
+ /* take care of the rest */
+ path = xmalloc (strlen (repository) + strlen (mfile) + 5);
+ (void) sprintf (path, "%s/%s", repository, mfile);
+ if (isdir (path))
+ {
+ /* directory means repository gets the dir tacked on */
+ (void) strcpy (repository, path);
+ (void) strcat (where, "/");
+ (void) strcat (where, mfile);
+ }
+ else
+ {
+ myargv[0] = argv[0];
+ myargv[1] = mfile;
+ argc = 2;
+ argv = myargv;
+ }
+ free (path);
+ }
+
+ /* cd to the starting repository */
+ if ( CVS_CHDIR (repository) < 0)
+ {
+ error (0, errno, "cannot chdir to %s", repository);
+ free (repository);
+ return (1);
+ }
+ free (repository);
+ /* End section which is identical to patch_proc. */
+
+ if (delete_flag || attic_too || (force_tag_match && numtag))
+ which = W_REPOS | W_ATTIC;
+ else
+ which = W_REPOS;
+ repository = NULL;
+ }
+ else
+ {
+ where = NULL;
+ which = W_LOCAL;
+ repository = "";
+ }
+
+ if (numtag != NULL && !numtag_validated)
+ {
+ tag_check_valid (numtag, argc - 1, argv + 1, local, 0, repository);
+ numtag_validated = 1;
+ }
/* check to make sure they are authorized to tag all the
specified files in the repository */
@@ -199,19 +372,32 @@ cvstag (argc, argv)
mtlist = getlist();
err = start_recursion (check_fileproc, check_filesdoneproc,
(DIRENTPROC) NULL, (DIRLEAVEPROC) NULL, NULL,
- argc, argv, local, W_LOCAL, 0, 1,
- (char *) NULL, 1);
+ argc - 1, argv + 1, local, which, 0, 1,
+ where, 1);
if (err)
{
error (1, 0, "correct the above errors first!");
}
+ /* It would be nice to provide consistency with respect to
+ commits; however CVS lacks the infrastructure to do that (see
+ Concurrency in cvs.texinfo and comment in do_recursion). We
+ do need to ensure that the RCS file info that gets read and
+ cached in do_recursion isn't stale by the time we get around
+ to using it to rewrite the RCS file in the callback, and this
+ is the easiest way to accomplish that. */
+ lock_tree_for_write (argc - 1, argv + 1, local, which, 0);
+
/* start the recursion processor */
- err = start_recursion (tag_fileproc, tag_filesdoneproc, tag_dirproc,
- (DIRLEAVEPROC) NULL, NULL, argc, argv, local,
- W_LOCAL, 0, 0, (char *) NULL, 1);
- dellist(&mtlist);
+ err = start_recursion (is_rtag ? rtag_fileproc : tag_fileproc,
+ (FILESDONEPROC) NULL, tag_dirproc,
+ (DIRLEAVEPROC) NULL, NULL, argc - 1, argv + 1,
+ local, which, 0, 0, where, 1);
+ Lock_Cleanup ();
+ dellist (&mtlist);
+ if (where != NULL)
+ free (where);
return (err);
}
@@ -231,7 +417,8 @@ check_fileproc (callerdat, finfo)
{
Ctype status = Classify_File (finfo, (char *) NULL, (char *) NULL,
(char *) NULL, 1, 0, &vers, 0);
- if ((status != T_UPTODATE) && (status != T_CHECKOUT))
+ if ((status != T_UPTODATE) && (status != T_CHECKOUT) &&
+ (status != T_PATCH))
{
error (0, 0, "%s is locally modified", finfo->fullname);
freevers_ts (&vers);
@@ -282,7 +469,7 @@ check_fileproc (callerdat, finfo)
version we are going to tag. There probably are some subtle races
(e.g. numtag is "foo" which gets moved between here and
tag_fileproc). */
- if (numtag == NULL && date == NULL)
+ if (!is_rtag && numtag == NULL && date == NULL)
p->data = xstrdup (vers->vn_user);
else
p->data = RCS_getversion (vers->srcfile, numtag, date,
@@ -327,7 +514,7 @@ check_fileproc (callerdat, finfo)
p->data = NULL;
}
}
- freevers_ts(&vers);
+ freevers_ts (&vers);
(void) addnode (tlist, p);
return (0);
}
@@ -437,6 +624,192 @@ pretag_list_proc(p, closure)
/*
+ * Called to rtag a particular file, as appropriate with the options that were
+ * set above.
+ */
+/* ARGSUSED */
+static int
+rtag_fileproc (callerdat, finfo)
+ void *callerdat;
+ struct file_info *finfo;
+{
+ RCSNode *rcsfile;
+ char *version, *rev;
+ int retcode = 0;
+
+ /* find the parsed RCS data */
+ if ((rcsfile = finfo->rcs) == NULL)
+ return (1);
+
+ /*
+ * For tagging an RCS file which is a symbolic link, you'd best be
+ * running with RCS 5.6, since it knows how to handle symbolic links
+ * correctly without breaking your link!
+ */
+
+ if (delete_flag)
+ return (rtag_delete (rcsfile));
+
+ /*
+ * If we get here, we are adding a tag. But, if -a was specified, we
+ * need to check to see if a -r or -D option was specified. If neither
+ * was specified and the file is in the Attic, remove the tag.
+ */
+ if (attic_too && (!numtag && !date))
+ {
+ if ((rcsfile->flags & VALID) && (rcsfile->flags & INATTIC))
+ return (rtag_delete (rcsfile));
+ }
+
+ version = RCS_getversion (rcsfile, numtag, date, force_tag_match,
+ (int *) NULL);
+ if (version == NULL)
+ {
+ /* If -a specified, clean up any old tags */
+ if (attic_too)
+ (void) rtag_delete (rcsfile);
+
+ if (!quiet && !force_tag_match)
+ {
+ error (0, 0, "cannot find tag `%s' in `%s'",
+ numtag ? numtag : "head", rcsfile->path);
+ return (1);
+ }
+ return (0);
+ }
+ if (numtag
+ && isdigit ((unsigned char) *numtag)
+ && strcmp (numtag, version) != 0)
+ {
+
+ /*
+ * We didn't find a match for the numeric tag that was specified, but
+ * that's OK. just pass the numeric tag on to rcs, to be tagged as
+ * specified. Could get here if one tried to tag "1.1.1" and there
+ * was a 1.1.1 branch with some head revision. In this case, we want
+ * the tag to reference "1.1.1" and not the revision at the head of
+ * the branch. Use a symbolic tag for that.
+ */
+ rev = branch_mode ? RCS_magicrev (rcsfile, version) : numtag;
+ retcode = RCS_settag(rcsfile, symtag, numtag);
+ if (retcode == 0)
+ RCS_rewrite (rcsfile, NULL, NULL);
+ }
+ else
+ {
+ char *oversion;
+
+ /*
+ * As an enhancement for the case where a tag is being re-applied to
+ * a large body of a module, make one extra call to RCS_getversion to
+ * see if the tag is already set in the RCS file. If so, check to
+ * see if it needs to be moved. If not, do nothing. This will
+ * likely save a lot of time when simply moving the tag to the
+ * "current" head revisions of a module -- which I have found to be a
+ * typical tagging operation.
+ */
+ rev = branch_mode ? RCS_magicrev (rcsfile, version) : version;
+ oversion = RCS_getversion (rcsfile, symtag, (char *) NULL, 1,
+ (int *) NULL);
+ if (oversion != NULL)
+ {
+ int isbranch = RCS_nodeisbranch (finfo->rcs, symtag);
+
+ /*
+ * if versions the same and neither old or new are branches don't
+ * have to do anything
+ */
+ if (strcmp (version, oversion) == 0 && !branch_mode && !isbranch)
+ {
+ free (oversion);
+ free (version);
+ return (0);
+ }
+
+ if (!force_tag_move)
+ {
+ /* we're NOT going to move the tag */
+ (void) printf ("W %s", finfo->fullname);
+
+ (void) printf (" : %s already exists on %s %s",
+ symtag, isbranch ? "branch" : "version",
+ oversion);
+ (void) printf (" : NOT MOVING tag to %s %s\n",
+ branch_mode ? "branch" : "version", rev);
+ free (oversion);
+ free (version);
+ return (0);
+ }
+ free (oversion);
+ }
+ retcode = RCS_settag(rcsfile, symtag, rev);
+ if (retcode == 0)
+ RCS_rewrite (rcsfile, NULL, NULL);
+ }
+
+ if (retcode != 0)
+ {
+ error (1, retcode == -1 ? errno : 0,
+ "failed to set tag `%s' to revision `%s' in `%s'",
+ symtag, rev, rcsfile->path);
+ if (branch_mode)
+ free (rev);
+ free (version);
+ return (1);
+ }
+ if (branch_mode)
+ free (rev);
+ free (version);
+ return (0);
+}
+
+/*
+ * If -d is specified, "force_tag_match" is set, so that this call to
+ * RCS_getversion() will return a NULL version string if the symbolic
+ * tag does not exist in the RCS file.
+ *
+ * If the -r flag was used, numtag is set, and we only delete the
+ * symtag from files that have numtag.
+ *
+ * This is done here because it's MUCH faster than just blindly calling
+ * "rcs" to remove the tag... trust me.
+ */
+static int
+rtag_delete (rcsfile)
+ RCSNode *rcsfile;
+{
+ char *version;
+ int retcode;
+
+ if (numtag)
+ {
+ version = RCS_getversion (rcsfile, numtag, (char *) NULL, 1,
+ (int *) NULL);
+ if (version == NULL)
+ return (0);
+ free (version);
+ }
+
+ version = RCS_getversion (rcsfile, symtag, (char *) NULL, 1,
+ (int *) NULL);
+ if (version == NULL)
+ return (0);
+ free (version);
+
+ if ((retcode = RCS_deltag(rcsfile, symtag)) != 0)
+ {
+ if (!quiet)
+ error (0, retcode == -1 ? errno : 0,
+ "failed to remove tag `%s' from `%s'", symtag,
+ rcsfile->path);
+ return (1);
+ }
+ RCS_rewrite (rcsfile, NULL, NULL);
+ return (0);
+}
+
+
+/*
* Called to tag a particular file (the currently checked out version is
* tagged with the specified tag - or the specified tag is deleted).
*/
@@ -452,17 +825,6 @@ tag_fileproc (callerdat, finfo)
Vers_TS *vers;
int retcode = 0;
- /* Lock the directory if it is not already locked. We can't rely
- on tag_dirproc because it won't handle the case where the user
- specifies a list of files on the command line. */
- /* We do not need to acquire a full write lock for the tag operation:
- the revisions are obtained from the working directory, so we do not
- require consistency across the entire repository. However, we do
- need to prevent simultaneous tag operations from interfering with
- each other. Therefore, we write lock each directory as we enter
- it, and unlock it as we leave it. */
- lock_dir_for_write (finfo->repository);
-
vers = Version_TS (finfo, NULL, NULL, NULL, 0, 0);
if ((numtag != NULL) || (date != NULL))
@@ -644,21 +1006,6 @@ tag_fileproc (callerdat, finfo)
return (0);
}
-/* Clear any lock we may hold on the current directory. */
-
-static int
-tag_filesdoneproc (callerdat, err, repos, update_dir, entries)
- void *callerdat;
- int err;
- char *repos;
- char *update_dir;
- List *entries;
-{
- Lock_Cleanup ();
-
- return (err);
-}
-
/*
* Print a warm fuzzy message
*/
@@ -671,6 +1018,15 @@ tag_dirproc (callerdat, dir, repos, update_dir, entries)
char *update_dir;
List *entries;
{
+
+ if (ignore_directory (update_dir))
+ {
+ /* print the warm fuzzy message */
+ if (!quiet)
+ error (0, 0, "Ignoring %s", update_dir);
+ return R_SKIP_ALL;
+ }
+
if (!quiet)
error (0, 0, "%s %s", delete_flag ? "Untagging" : "Tagging", update_dir);
return (R_PROCESS);
@@ -758,6 +1114,7 @@ tag_check_valid (name, argc, argv, local, aflag, repository)
DBM *db;
char *valtags_filename;
int err;
+ int nowrite = 0;
datum mytag;
struct val_args the_val_args;
struct saved_cwd cwd;
@@ -789,24 +1146,28 @@ Numeric tag %s contains characters other than digits and '.'", name);
mytag.dptr = name;
mytag.dsize = strlen (name);
- valtags_filename = xmalloc (strlen (CVSroot_directory)
+ valtags_filename = xmalloc (strlen (current_parsed_root->directory)
+ sizeof CVSROOTADM
- + sizeof CVSROOTADM_VALTAGS + 20);
- strcpy (valtags_filename, CVSroot_directory);
- strcat (valtags_filename, "/");
- strcat (valtags_filename, CVSROOTADM);
- strcat (valtags_filename, "/");
- strcat (valtags_filename, CVSROOTADM_VALTAGS);
+ + sizeof CVSROOTADM_VALTAGS + 3);
+ sprintf (valtags_filename, "%s/%s/%s", current_parsed_root->directory,
+ CVSROOTADM, CVSROOTADM_VALTAGS);
db = dbm_open (valtags_filename, O_RDWR, 0666);
if (db == NULL)
{
if (!existence_error (errno))
- error (1, errno, "cannot read %s", valtags_filename);
-
+ {
+ error (0, errno, "warning: cannot open %s read/write",
+ valtags_filename);
+ db = dbm_open (valtags_filename, O_RDONLY, 0666);
+ if (db != NULL)
+ nowrite = 1;
+ else if (!existence_error (errno))
+ error (1, errno, "cannot read %s", valtags_filename);
+ }
/* If the file merely fails to exist, we just keep going and create
it later if need be. */
}
- else
+ if (db != NULL)
{
datum val;
@@ -868,7 +1229,7 @@ Numeric tag %s contains characters other than digits and '.'", name);
/* The tags is valid but not mentioned in val-tags. Add it. */
datum value;
- if (noexec)
+ if (noexec || nowrite)
{
if (db != NULL)
dbm_close (db);
@@ -885,7 +1246,7 @@ Numeric tag %s contains characters other than digits and '.'", name);
if (db == NULL)
{
- error (0, errno, "cannot create %s", valtags_filename);
+ error (0, errno, "warning: cannot create %s", valtags_filename);
free (valtags_filename);
return;
}
diff --git a/gnu/usr.bin/cvs/src/update.h b/gnu/usr.bin/cvs/src/update.h
index ba713104a9c..9a1fc003db9 100644
--- a/gnu/usr.bin/cvs/src/update.h
+++ b/gnu/usr.bin/cvs/src/update.h
@@ -13,6 +13,7 @@
int do_update PROTO((int argc, char *argv[], char *xoptions, char *xtag,
char *xdate, int xforce, int local, int xbuild,
int xaflag, int xprune, int xpipeout, int which,
- char *xjoin_rev1, char *xjoin_rev2, char *preload_update_dir));
+ char *xjoin_rev1, char *xjoin_rev2, char *preload_update_dir,
+ int xdotemplate));
int joining PROTO((void));
extern int isemptydir PROTO ((char *dir, int might_not_exist));
diff --git a/gnu/usr.bin/cvs/src/vers_ts.c b/gnu/usr.bin/cvs/src/vers_ts.c
index 8d552845a03..5524babfb4a 100644
--- a/gnu/usr.bin/cvs/src/vers_ts.c
+++ b/gnu/usr.bin/cvs/src/vers_ts.c
@@ -322,6 +322,8 @@ time_stamp_server (file, vers_ts, entdata)
cp = ctime (&sb.st_mtime);
cp[24] = 0;
+ /* Fix non-standard format. */
+ if (cp[8] == '0') cp[8] = ' ';
(void) strcpy (vers_ts->ts_user, cp);
}
}
@@ -365,6 +367,8 @@ time_stamp (file)
cp = ctime(&sb.st_mtime);
cp[24] = 0;
+ /* Fix non-standard format. */
+ if (cp[8] == '0') cp[8] = ' ';
(void) strcpy (ts, cp);
}
diff --git a/gnu/usr.bin/cvs/src/version.c b/gnu/usr.bin/cvs/src/version.c
index c8273fb55c5..50706157519 100644
--- a/gnu/usr.bin/cvs/src/version.c
+++ b/gnu/usr.bin/cvs/src/version.c
@@ -12,7 +12,7 @@
#include "cvs.h"
-char *version_string = "Concurrent Versions System (CVS) 1.11";
+char *version_string = "Concurrent Versions System (CVS) 1.11.1p1";
#ifdef CLIENT_SUPPORT
#ifdef SERVER_SUPPORT
@@ -28,12 +28,23 @@ char *config_string = "\n";
#endif
#endif
+
+
static const char *const version_usage[] =
{
"Usage: %s %s\n",
NULL
};
+
+
+/*
+ * Output a version string for the client and server.
+ *
+ * This function will output the simple version number (for the '--version'
+ * option) or the version numbers of the client and server (using the 'version'
+ * command).
+ */
int
version (argc, argv)
int argc;
@@ -45,7 +56,7 @@ version (argc, argv)
usage (version_usage);
#ifdef CLIENT_SUPPORT
- if (client_active)
+ if (current_parsed_root && current_parsed_root->isremote)
(void) fputs ("Client: ", stdout);
#endif
@@ -56,7 +67,7 @@ version (argc, argv)
(void) fputs (config_string, stdout);
#ifdef CLIENT_SUPPORT
- if (client_active)
+ if (current_parsed_root && current_parsed_root->isremote)
{
(void) fputs ("Server: ", stdout);
start_server ();
diff --git a/gnu/usr.bin/cvs/src/version.c.in b/gnu/usr.bin/cvs/src/version.c.in
new file mode 100644
index 00000000000..aa2f97f3e8a
--- /dev/null
+++ b/gnu/usr.bin/cvs/src/version.c.in
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 1994 david d `zoo' zuhn
+ * Copyright (c) 1994 Free Software Foundation, Inc.
+ * Copyright (c) 1992, Brian Berliner and Jeff Polk
+ * Copyright (c) 1989-1992, Brian Berliner
+ *
+ * You may distribute under the terms of the GNU General Public License as
+ * specified in the README file that comes with this CVS source distribution.
+ *
+ * version.c - the CVS version number
+ */
+
+#include "cvs.h"
+
+char *version_string = "Concurrent Versions System (CVS) @VERSION@";
+
+#ifdef CLIENT_SUPPORT
+#ifdef SERVER_SUPPORT
+char *config_string = " (client/server)\n";
+#else
+char *config_string = " (client)\n";
+#endif
+#else
+#ifdef SERVER_SUPPORT
+char *config_string = " (server)\n";
+#else
+char *config_string = "\n";
+#endif
+#endif
+
+
+
+static const char *const version_usage[] =
+{
+ "Usage: %s %s\n",
+ NULL
+};
+
+
+
+/*
+ * Output a version string for the client and server.
+ *
+ * This function will output the simple version number (for the '--version'
+ * option) or the version numbers of the client and server (using the 'version'
+ * command).
+ */
+int
+version (argc, argv)
+ int argc;
+ char **argv;
+{
+ int err = 0;
+
+ if (argc == -1)
+ usage (version_usage);
+
+#ifdef CLIENT_SUPPORT
+ if (current_parsed_root && current_parsed_root->isremote)
+ (void) fputs ("Client: ", stdout);
+#endif
+
+ /* Having the year here is a good idea, so people have
+ some idea of how long ago their version of CVS was
+ released. */
+ (void) fputs (version_string, stdout);
+ (void) fputs (config_string, stdout);
+
+#ifdef CLIENT_SUPPORT
+ if (current_parsed_root && current_parsed_root->isremote)
+ {
+ (void) fputs ("Server: ", stdout);
+ start_server ();
+ if (supported_request ("version"))
+ send_to_server ("version\012", 0);
+ else
+ {
+ send_to_server ("noop\012", 0);
+ fputs ("(unknown)\n", stdout);
+ }
+ err = get_responses_and_close ();
+ }
+#endif
+ return err;
+}
+
diff --git a/gnu/usr.bin/cvs/src/watch.c b/gnu/usr.bin/cvs/src/watch.c
index 1a0ecfe61f4..d86968b0cff 100644
--- a/gnu/usr.bin/cvs/src/watch.c
+++ b/gnu/usr.bin/cvs/src/watch.c
@@ -308,7 +308,7 @@ watch_addremove (argc, argv)
}
#ifdef CLIENT_SUPPORT
- if (client_active)
+ if (current_parsed_root->isremote)
{
start_server ();
ign_setup ();
@@ -348,7 +348,7 @@ watch_addremove (argc, argv)
the_args.setting_default = (argc <= 0);
- lock_tree_for_write (argc, argv, local, 0);
+ lock_tree_for_write (argc, argv, local, W_LOCAL, 0);
err = start_recursion (addremove_fileproc, addremove_filesdoneproc,
(DIRENTPROC) NULL, (DIRLEAVEPROC) NULL, NULL,
@@ -509,7 +509,7 @@ watchers (argc, argv)
argv += optind;
#ifdef CLIENT_SUPPORT
- if (client_active)
+ if (current_parsed_root->isremote)
{
start_server ();
ign_setup ();
diff --git a/gnu/usr.bin/cvs/stamp-h1.in b/gnu/usr.bin/cvs/stamp-h1.in
new file mode 100644
index 00000000000..9788f70238c
--- /dev/null
+++ b/gnu/usr.bin/cvs/stamp-h1.in
@@ -0,0 +1 @@
+timestamp
diff --git a/gnu/usr.bin/cvs/tools/ChangeLog b/gnu/usr.bin/cvs/tools/ChangeLog
index 99c3af733fd..d83619cc76f 100644
--- a/gnu/usr.bin/cvs/tools/ChangeLog
+++ b/gnu/usr.bin/cvs/tools/ChangeLog
@@ -1,3 +1,20 @@
+2001-04-25 Derek Price <dprice@collab.net>
+
+ * Makefile.in: Regenerated using AM 1.4e as of today at 18:10 -0400.
+
+2001-03-14 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.in: Regenerated
+
+2000-12-22 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.in: Regenerated
+
+2000-12-21 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.am: New file needed by Automake
+ * Makefile.in: Regenerated
+
1998-09-09 Jim Kingdon <kingdon@harvey.cyclic.com>
* README: Update now that pcl-cvs is no longer here.
diff --git a/gnu/usr.bin/cvs/tools/Makefile.am b/gnu/usr.bin/cvs/tools/Makefile.am
new file mode 100644
index 00000000000..cf0a073e23e
--- /dev/null
+++ b/gnu/usr.bin/cvs/tools/Makefile.am
@@ -0,0 +1,21 @@
+## Process this file with automake to produce Makefile.in
+# Makefile for GNU CVS auxiliary tools.
+# Do not use this makefile directly, but only from `../Makefile'.
+# Copyright (C) 1986, 1988-1990, 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+EXTRA_DIST = \
+ README .cvsignore
+
+# for backwards compatibility with the old makefiles
+realclean: maintainer-clean
+.PHONY: realclean
diff --git a/gnu/usr.bin/cvs/tools/Makefile.in b/gnu/usr.bin/cvs/tools/Makefile.in
index 752224dc3ba..2e333f7d0c4 100644
--- a/gnu/usr.bin/cvs/tools/Makefile.in
+++ b/gnu/usr.bin/cvs/tools/Makefile.in
@@ -1,6 +1,21 @@
+# Makefile.in generated automatically by automake 1.4e from Makefile.am.
+
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
# Makefile for GNU CVS auxiliary tools.
# Do not use this makefile directly, but only from `../Makefile'.
-# Copyright (C) 1986, 1988-1990 Free Software Foundation, Inc.
+# Copyright (C) 1986, 1988-1990, 2000 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -12,61 +27,202 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-SHELL = /bin/sh
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
+SHELL = @SHELL@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
-# Where to put the manual pages.
-mandir = $(prefix)/man
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+
+top_builddir = ..
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
-# Use cp if you don't have install.
INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = @program_transform_name@
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+AMTAR = @AMTAR@
+AWK = @AWK@
+CC = @CC@
+CSH = @CSH@
+DEPDIR = @DEPDIR@
+ETAGS = @ETAGS@
+ETAGS_INCLUDE_OPTION = @ETAGS_INCLUDE_OPTION@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INSTALL_STRIP_PROGRAM_ENV = @INSTALL_STRIP_PROGRAM_ENV@
+KRB4 = @KRB4@
+LN_S = @LN_S@
+MAKEINFO = @MAKEINFO@
+PACKAGE = @PACKAGE@
+PERL = @PERL@
+PR = @PR@
+PS2PDF = @PS2PDF@
+RANLIB = @RANLIB@
+ROFF = @ROFF@
+STRIP = @STRIP@
+TEXI2DVI = @TEXI2DVI@
+VERSION = @VERSION@
+YACC = @YACC@
+_am_include = @_am_include@
+_am_quote = @_am_quote@
+includeopt = @includeopt@
+install_sh = @install_sh@
+
+EXTRA_DIST = \
+ README .cvsignore
+
+EXEEXT =
+OBJEXT = o
+subdir = tools
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h $(top_builddir)/src/options.h
+CONFIG_CLEAN_FILES =
+DIST_SOURCES =
+DIST_COMMON = README ChangeLog Makefile.am Makefile.in
+all: all-am
+
+.SUFFIXES:
+
+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu tools/Makefile
+
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) && \
+ CONFIG_HEADERS= CONFIG_LINKS= \
+ CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status
+tags: TAGS
+TAGS:
-DISTFILES = ChangeLog README .cvsignore Makefile.in
-all: Makefile
-.PHONY: all
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-install: all
- @echo "pcl-cvs not installed"
-.PHONY: install
+top_distdir = ..
+distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
+
+distdir: $(DISTFILES)
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+ cp -pR $$d/$$file $(distdir) \
+ || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile
installdirs:
-.PHONY: installdirs
-tags:
-.PHONY: tags
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
-TAGS:
-.PHONY: TAGS
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-ls:
- @echo $(DISTFILES)
-.PHONY: ls
+installcheck: installcheck-am
-clean:
- rm -f *.o core
-.PHONY: clean
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ INSTALL_PROGRAM_ENV='$(INSTALL_STRIP_PROGRAM_ENV)' install
-distclean: clean
- rm -f Makefile
-.PHONY: distclean
+mostlyclean-generic:
-realclean: distclean
-.PHONY: realclean
+clean-generic:
-dist-dir:
- mkdir ${DISTDIR}
- for i in ${DISTFILES}; do \
- ln $(srcdir)/$${i} ${DISTDIR}; \
- done
-.PHONY: dist-dir
+distclean-generic:
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
-subdir = tools
-Makefile: ../config.status Makefile.in
- cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+ -rm -f Makefile.in
+clean: clean-am
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-am
+
+distclean-am: clean-am distclean-generic
+
+dvi:
+
+dvi-am:
+
+info:
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info:
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic
+
+.PHONY: all all-am check check-am clean clean-generic distclean \
+ distclean-generic distdir dvi dvi-am info info-am install \
+ install-am install-data install-data-am install-exec \
+ install-exec-am install-info install-man install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic \
+ uninstall uninstall-am
+
+
+# for backwards compatibility with the old makefiles
+realclean: maintainer-clean
+.PHONY: realclean
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/gnu/usr.bin/cvs/vms/ChangeLog b/gnu/usr.bin/cvs/vms/ChangeLog
index 49f9a85b84e..104ecf5cf20 100644
--- a/gnu/usr.bin/cvs/vms/ChangeLog
+++ b/gnu/usr.bin/cvs/vms/ChangeLog
@@ -1,3 +1,52 @@
+2001-04-25 Derek Price <dprice@collab.net>
+
+ * Makefile.in: Regenerated using AM 1.4e as of today at 18:10 -0400.
+
+2001-03-14 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.in: Regenerated
+
+2000-02-06 Derek Price <derek.price@openavenue.com>
+ Rex Jolliff <Rex_Jolliff@notes.ymp.gov>
+ Shawn Smith <Shawn_Smith@notes.ymp.gov>
+
+ * filesubr.c: Changes to handle VMS DEC C 5.7 {open,read,close}dir
+ (expand_wild): Handle comma-separated lists of files for VMS 7.2 and
+ DEC C 5.7.
+ * config.h: Changes to handle VMS DEC C 5.7 {open,read,close}dir
+ problems.
+ * ndir.c: ditto
+ * ndir.h: ditto
+
+2001-01-10 Derek Price <derek.price@openavenue.com>
+ Rex Jolliff <Rex_Jolliff@notes.ymp.gov>
+ Shawn Smith <Shawn_Smith@notes.ymp.gov>
+
+ * filesubr.c (expand_wild): rewrote for VMS 7.x. Actually
+ globs vms wildcarded filespecs now.
+ * pwd.h: put the pid_t define in a conditional since it's
+ now typedefed in VMS 7.x
+ * unlink.c: provided correct prototype for unlink based on
+ version of VMS since it changes.
+ * vms.h: put conditional compilation macros around mode_t as
+ it is defined as of VMS 7.x, and fixed prototype of unlink
+ as per above.
+ * ndir.c: undefine function for 7.x+ since it is now defined by system
+ * pipe.c: ditto
+ * pwd.c: ditto
+ * rmdir.c: ditto
+ * waitpid.c: ditto
+ * config.h: various new defines & switches
+
+2000-12-22 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.in: Regenerated
+
+2000-12-21 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.am: New file needed by Automake
+ * Makefile.in: Regenerated
+
1999-02-26 Jim Kingdon <http://www.cyclic.com>
* options.h: Make RELATIVE_REPOS the default, as in
diff --git a/gnu/usr.bin/cvs/vms/Makefile.am b/gnu/usr.bin/cvs/vms/Makefile.am
new file mode 100644
index 00000000000..234293e121f
--- /dev/null
+++ b/gnu/usr.bin/cvs/vms/Makefile.am
@@ -0,0 +1,59 @@
+## Process this file with automake to produce Makefile.in
+
+# *** Under VMS, we use *.COM to build, not
+# *** this makefile. However, we need this file in order for 'make
+# *** dist' to work properly on Unix machines.
+
+# Makefile for GNU CVS VMS distribution.
+# Copyright (C) 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+EXTRA_DIST = \
+ ChangeLog \
+ Makefile.in \
+ build_vms.com \
+ config.h \
+ dir.h \
+ filesubr.c \
+ filutils.c \
+ filutils.h \
+ getpass.c \
+ getwd.c \
+ misc.c \
+ misc.h \
+ ndir.c \
+ ndir.h \
+ options.h \
+ pathnames.h \
+ pc.c \
+ pipe.c \
+ pipe.h \
+ piped_child.c \
+ pwd.c \
+ pwd.h \
+ rcmd.c \
+ readlink.c \
+ rmdir.c \
+ startserver.c \
+ stat.c \
+ unlink.c \
+ utime.c \
+ vms-types.h \
+ vms.h \
+ vmsmunch.c \
+ vmsmunch.h \
+ vmsmunch_private.h \
+ waitpid.c
+
+# for backwards compatibility with the old makefiles
+realclean: maintainer-clean
+.PHONY: realclean
diff --git a/gnu/usr.bin/cvs/vms/Makefile.in b/gnu/usr.bin/cvs/vms/Makefile.in
index d725a72625f..b985197737e 100644
--- a/gnu/usr.bin/cvs/vms/Makefile.in
+++ b/gnu/usr.bin/cvs/vms/Makefile.in
@@ -1,18 +1,109 @@
-#### Under VMS, we use *.COM to build, not
-#### this makefile. However, we need this file in order for 'make
-#### dist' to work properly on Unix machines.
+# Makefile.in generated automatically by automake 1.4e from Makefile.am.
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-cvs_srcdir = @top_srcdir@/src
-VPATH = @srcdir@
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# *** Under VMS, we use *.COM to build, not
+# *** this makefile. However, we need this file in order for 'make
+# *** dist' to work properly on Unix machines.
+
+# Makefile for GNU CVS VMS distribution.
+# Copyright (C) 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
-SHELL = /bin/sh
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
-DISTFILES = \
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+
+top_builddir = ..
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = @program_transform_name@
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+AMTAR = @AMTAR@
+AWK = @AWK@
+CC = @CC@
+CSH = @CSH@
+DEPDIR = @DEPDIR@
+ETAGS = @ETAGS@
+ETAGS_INCLUDE_OPTION = @ETAGS_INCLUDE_OPTION@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INSTALL_STRIP_PROGRAM_ENV = @INSTALL_STRIP_PROGRAM_ENV@
+KRB4 = @KRB4@
+LN_S = @LN_S@
+MAKEINFO = @MAKEINFO@
+PACKAGE = @PACKAGE@
+PERL = @PERL@
+PR = @PR@
+PS2PDF = @PS2PDF@
+RANLIB = @RANLIB@
+ROFF = @ROFF@
+STRIP = @STRIP@
+TEXI2DVI = @TEXI2DVI@
+VERSION = @VERSION@
+YACC = @YACC@
+_am_include = @_am_include@
+_am_quote = @_am_quote@
+includeopt = @includeopt@
+install_sh = @install_sh@
+
+EXTRA_DIST = \
ChangeLog \
Makefile.in \
build_vms.com \
@@ -49,40 +140,126 @@ DISTFILES = \
vmsmunch_private.h \
waitpid.c
-all:
+EXEEXT =
+OBJEXT = o
+subdir = vms
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h $(top_builddir)/src/options.h
+CONFIG_CLEAN_FILES =
+DIST_SOURCES =
+DIST_COMMON = ChangeLog Makefile.am Makefile.in
+all: all-am
-.PHONY: all install uninstall
-all install uninstall:
+.SUFFIXES:
-installdirs:
-.PHONY: installdirs
+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu vms/Makefile
-.PHONY: tags TAGS
-tags TAGS:
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) && \
+ CONFIG_HEADERS= CONFIG_LINKS= \
+ CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status
+tags: TAGS
+TAGS:
-.PHONY: ls
-ls:
- @echo ${DISTFILES}
-.PHONY: clean distclean realclean mostlyclean
-clean realclean mostlyclean:
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-.PHONY: lint
-lint:
+top_distdir = ..
+distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
-.PHONY: dist-dir
-dist-dir:
- mkdir ${DISTDIR}
- for i in ${DISTFILES}; do \
- ln $(srcdir)/$${i} ${DISTDIR}; \
+distdir: $(DISTFILES)
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+ cp -pR $$d/$$file $(distdir) \
+ || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
done
+check-am: all-am
+check: check-am
+all-am: Makefile
-clean:
- @echo make clean does nothing in vms subdir
+installdirs:
-distclean:
- rm -f Makefile
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
-subdir = vms
-Makefile: ../config.status Makefile.in
- cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ INSTALL_PROGRAM_ENV='$(INSTALL_STRIP_PROGRAM_ENV)' install
+
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+ -rm -f Makefile.in
+clean: clean-am
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-am
+
+distclean-am: clean-am distclean-generic
+
+dvi:
+
+dvi-am:
+
+info:
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info:
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic
+
+.PHONY: all all-am check check-am clean clean-generic distclean \
+ distclean-generic distdir dvi dvi-am info info-am install \
+ install-am install-data install-data-am install-exec \
+ install-exec-am install-info install-man install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic \
+ uninstall uninstall-am
+
+
+# for backwards compatibility with the old makefiles
+realclean: maintainer-clean
+.PHONY: realclean
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/gnu/usr.bin/cvs/vms/config.h b/gnu/usr.bin/cvs/vms/config.h
index 63e7d6251e6..af8c2060792 100644
--- a/gnu/usr.bin/cvs/vms/config.h
+++ b/gnu/usr.bin/cvs/vms/config.h
@@ -5,6 +5,14 @@
#define CLIENT_SUPPORT 1
#undef SERVER_SUPPORT
+/* Set up for other #if's which follow */
+#ifndef __DECC_VER
+#define __DECC_VER 0
+#endif
+#ifndef __VMS_VER
+#define __VMS_VER 0
+#endif
+
/* VMS is case insensitive */
/* #define FOLD_FN_CHAR(c) tolower(c) */
@@ -126,7 +134,9 @@
/* #undef HAVE_ERRNO_H */
/* Define if you have the <fcntl.h> header file. */
-/* #undef HAVE_FCNTL_H */
+#if __DECC_VER >= 50700000
+# define HAVE_FCNTL_H 1
+#endif
/* Define if you have the <memory.h> header file. */
/* #undef HAVE_MEMORY_H */
@@ -137,6 +147,12 @@
/* Define if you have the <string.h> header file. */
#define HAVE_STRING_H 1
+/* Define to force lib/regex.c to use malloc instead of alloca. */
+#define REGEX_MALLOC 1
+
+/* Define to force lib/regex.c to define re_comp et al. */
+#define _REGEX_RE_COMP 1
+
/* Define if you have the <sys/select.h> header file. */
/* #undef HAVE_SYS_SELECT_H */
@@ -190,6 +206,12 @@ extern void fnfold (char *FILENAME);
#define optarg cvs_optarg
#define opterr cvs_opterr
+/* Avoid open/read/closedir name conflicts with DEC C 5.7 libraries,
+ and fix the problem with readdir() retaining the trailing period. */
+#define CVS_OPENDIR vms_opendir
+#define CVS_READDIR vms_readdir
+#define CVS_CLOSEDIR vms_closedir
+
/* argv[0] in VMS is the full pathname which would look really ugly in error
messages. Even if we stripped out the directory and ".EXE;5", it would
still be misleading, as if one has used "OLDCVS :== ...CVS-JULY.EXE",
@@ -198,3 +220,5 @@ extern void fnfold (char *FILENAME);
might be worth messing with, but it also seems fine to just always call
it "cvs". */
#define ARGV0_NOT_PROGRAM_NAME
+
+#define CVS_UNLINK vms_unlink
diff --git a/gnu/usr.bin/cvs/vms/filesubr.c b/gnu/usr.bin/cvs/vms/filesubr.c
index c9110ad6038..74628d9f8d1 100644
--- a/gnu/usr.bin/cvs/vms/filesubr.c
+++ b/gnu/usr.bin/cvs/vms/filesubr.c
@@ -432,7 +432,7 @@ unlink_file (f_file)
if (noexec)
return (0);
- return (unlink (f));
+ return (vms_unlink (f));
}
/*
@@ -464,7 +464,7 @@ unlink_file_dir (f_file)
if (noexec)
return (0);
- if (unlink (f) != 0)
+ if (vms_unlink (f) != 0)
{
/* under NEXTSTEP errno is set to return EPERM if
* the file is a directory,or if the user is not
@@ -499,13 +499,13 @@ deep_remove_dir (path)
if (rmdir (path) != 0 && (errno == ENOTEMPTY || errno == EEXIST))
{
- if ((dirp = opendir (path)) == NULL)
+ if ((dirp = CVS_OPENDIR (path)) == NULL)
/* If unable to open the directory return
* an error
*/
return -1;
- while ((dp = readdir (dirp)) != NULL)
+ while ((dp = CVS_READDIR (dirp)) != NULL)
{
if (strcmp (dp->d_name, ".") == 0 ||
strcmp (dp->d_name, "..") == 0)
@@ -513,13 +513,13 @@ deep_remove_dir (path)
sprintf (buf, "%s/%s", path, dp->d_name);
- if (unlink (buf) != 0 )
+ if (vms_unlink (buf) != 0 )
{
if (errno == EISDIR || errno == EPERM)
{
if (deep_remove_dir (buf))
{
- closedir (dirp);
+ CVS_CLOSEDIR (dirp);
return -1;
}
}
@@ -528,12 +528,12 @@ deep_remove_dir (path)
/* buf isn't a directory, or there are
* some sort of permision problems
*/
- closedir (dirp);
+ CVS_CLOSEDIR (dirp);
return -1;
}
}
}
- closedir (dirp);
+ CVS_CLOSEDIR (dirp);
return rmdir (path);
}
@@ -701,7 +701,7 @@ fncmp (const char *n1, const char *n2)
{
while (*n1 && *n2
&& (VMS_filename_classes[(unsigned char) *n1]
- == VMS_filename_classes[(unsigned char) *n2]))
+ == VMS_filename_classes[(unsigned char) *n2]))
n1++, n2++;
return (VMS_filename_classes[(unsigned char) *n1]
- VMS_filename_classes[(unsigned char) *n2]);
@@ -785,6 +785,14 @@ get_homedir ()
return getenv ("HOME");
}
+#ifndef __VMS_VER
+#define __VMS_VER 0
+#endif
+#ifndef __DECC_VER
+#define __DECC_VER 0
+#endif
+
+#if __VMS_VER < 70200000 || __DECC_VER < 50700000
/* See cvs.h for description. On VMS this currently does nothing, although
I think we should be expanding wildcards here. */
void
@@ -798,5 +806,211 @@ expand_wild (argc, argv, pargc, pargv)
*pargc = argc;
*pargv = (char **) xmalloc (argc * sizeof (char *));
for (i = 0; i < argc; ++i)
- (*pargv)[i] = xstrdup (argv[i]);
+ (*pargv)[i] = xstrdup (argv[i]);
+}
+
+#else /* __VMS_VER >= 70200000 && __DECC_VER >= 50700000 */
+
+/* These global variables are necessary to pass information from the
+ * routine that calls decc$from_vms into the callback routine. In a
+ * multi-threaded environment, access to these variables MUST be
+ * serialized.
+ */
+static char CurWorkingDir[PATH_MAX+1];
+static char **ArgvList;
+static int CurArg;
+static int MaxArgs;
+
+static int ew_no_op (char *fname) {
+ (void) fname; /* Shut the compiler up */
+ return 1; /* Continue */
+}
+
+static int ew_add_file (char *fname) {
+ char *lastslash, *firstper;
+ int i;
+
+ if (strncmp(fname,CurWorkingDir,strlen(CurWorkingDir)) == 0) {
+ fname += strlen(CurWorkingDir);
+ }
+ lastslash = strrchr(fname,'/');
+ if (!lastslash) {
+ lastslash = fname;
+ }
+ if ((firstper=strchr(lastslash,'.')) != strrchr(lastslash,'.')) {
+ /* We have two periods -- one is to separate the version off */
+ *strrchr(fname,'.') = '\0';
+ }
+ if (firstper && firstper[1]=='\0') {
+ *firstper = '\0';
+ }
+ /* The following code is to insure that no duplicates appear,
+ * because most of the time it will just be a different version
+ */
+ for (i=0; i<CurArg && strcmp(ArgvList[i],fname)!=0; ++i) {
+ ;
+ }
+ if (i==CurArg && CurArg<MaxArgs) {
+ ArgvList[CurArg++] = strdup(fname);
+ }
+ return ArgvList[CurArg-1] != 0; /* Stop if we couldn't dup the string */
+}
+
+/* The following two routines are meant to allow future versions of new_arglist
+ * routine to be multi-thread-safe. It will be necessary in that environment
+ * to serialize access to CurWorkingDir, ArgvList, MaxArg, and CurArg. We
+ * currently don't do any multi-threaded programming, so right now these
+ * routines are no-ops.
+ */
+static void wait_and_protect_globs (void) {
+ return;
+}
+
+static void release_globs (void) {
+ return;
+}
+
+/*pf---------------------------------------------------------------- expand_wild
+ *
+ * New Argument List - (SDS)
+ *
+ * DESCRIPTION:
+ * This routine takes the argc, argv passed in from main() and returns a
+ * new argc, argv list, which simulates (to an extent) Unix-Style filename
+ * globbing with VMS wildcards. The key difference is that it will return
+ * Unix-style filenames, i.e., no VMS file version numbers. The complexity
+ * comes from the desire to not simply allocate 10000 argv entries.
+ *
+ * INPUTS:
+ * argc - The integer argc passed into main
+ * argv - The pointer to the array of char*'s passed into main
+ *
+ * OUTPUTS:
+ * pargv - A pointer to a (char **) to hold the new argv list
+ * pargc - A pointer to an int to hold the new argc
+ *
+ * RETURNS:
+ * NONE
+ *
+ * SIDE EFFECTS:
+ * This routine will normally modify the global statics CurArg, MaxArg,
+ * ArgvList, and CurWorkingDir.
+ *
+ * NOTES:
+ * It is ok for &argc == pargc and &argv == pargv.
+ *
+ *------------------------------------------------------------------------------
+ */
+void expand_wild (int argc, char **argv, int *pargc, char ***pargv) {
+ int totfiles, filesgotten;
+ int i;
+ int largc;
+ char **largv;
+
+ /* This first loop is to find out AT MOST how big to make the
+ * pargv array.
+ */
+ for (totfiles=0,i=0; i<argc; ++i) {
+ char *arg = argv[i];
+
+ if (arg != 0 && ( strchr(arg,' ') != 0
+ || strcmp(arg,".") == 0
+ || strcmp(arg,"..") == 0) ) {
+ ++totfiles;
+ }else if (arg != 0) {
+ int num;
+ char *p = arg;
+ /* Handle comma-separated filelists */
+ while ( (p=strchr(p,',')) != 0) {
+ *p = '\0';
+ num = decc$from_vms (arg, ew_no_op, 1);
+ totfiles += num>0 ? num : 1;
+ *p++ = ',';
+ arg = p;
+ }
+ if (*arg != '\0') {
+ num = decc$from_vms (arg, ew_no_op, 1);
+ totfiles += num>0 ? num : 1;
+ }
+ }
+ }
+ largv = 0;
+ if (totfiles) {
+ largv = malloc (sizeof*largv * (totfiles + 1));
+ }
+ filesgotten = 0;
+ if (largv != 0) {
+ int len;
+ /* All bits set to zero may not be a NULL ptr */
+ for (i=totfiles; --i>=0; ) {
+ largv[i] = 0;
+ }
+ largv[totfiles] = 0;
+
+ wait_and_protect_globs ();
+
+ /*--- getcwd has an OpenVMS extension that allows us to ---*/
+ /*--- get back Unix-style path names ---*/
+ (void) getcwd (CurWorkingDir, sizeof CurWorkingDir - 1, 0);
+ len = strlen (CurWorkingDir);
+ if ( len > 0 && CurWorkingDir[len-1] != '/') {
+ (void) strcat (CurWorkingDir, "/");
+ }
+ CurArg = 0;
+ ArgvList = largv;
+ MaxArgs = totfiles + 1;
+
+ for (i=0; i<argc; ++i) {
+ char *arg = argv[i];
+
+ if (arg != 0 && ( strchr(arg,' ') != 0
+ || strcmp(arg,".") == 0
+ || strcmp(arg,"..") == 0) ) {
+ if (CurArg < MaxArgs) {
+ ArgvList[CurArg++] = strdup(arg);
+ }
+ ++filesgotten;
+ }else if (arg != 0) {
+ char *p = arg;
+ int num;
+ /* Handle comma-separated filelists */
+ while ( (p=strchr(p,',')) != 0) {
+ *p = '\0';
+ num = decc$from_vms (arg, ew_add_file, 1);
+ if (num <= 0 && CurArg < MaxArgs) {
+ ArgvList[CurArg++] = strdup(arg);
+ }
+ filesgotten += num>0 ? num : 1;
+ *p++ = ',';
+ arg = p;
+ }
+ if (*arg != '\0') {
+ num = decc$from_vms (arg, ew_add_file, 1);
+ if (num <= 0 && CurArg < MaxArgs) {
+ ArgvList[CurArg++] = strdup(arg);
+ }
+ filesgotten += num>0 ? num : 1;
+ }
+ }
+ }
+ if (filesgotten != totfiles) {
+ /*--- Files must have been created/deleted here ---*/;
+ }
+ filesgotten = CurArg;
+
+ release_globs();
+ }
+ if (!largv) {
+ (*pargv) = malloc (sizeof(char *));
+ if ((*pargv) != 0) {
+ *(*pargv) = 0;
+ }
+ }else {
+ (*pargv) = largv;
+ }
+ (*pargc) = largv ? filesgotten : 0;
+
+ return;
}
+
+#endif /* __VMS_VER >= 70200000 && __DECC_VER >= 50700000 */
diff --git a/gnu/usr.bin/cvs/vms/ndir.c b/gnu/usr.bin/cvs/vms/ndir.c
index 99c85121190..1e651861d10 100644
--- a/gnu/usr.bin/cvs/vms/ndir.c
+++ b/gnu/usr.bin/cvs/vms/ndir.c
@@ -17,6 +17,13 @@
* GNU General Public License for more details.
*/
+#ifndef __VMS_VER
+#define __VMS_VER 0
+#endif
+#ifndef __DECC_VER
+#define __DECC_VER 0
+#endif
+
#include <varargs.h>
#include <rms.h>
#include <descrip.h>
@@ -92,7 +99,7 @@ typedef struct
} VMS_DIR;
DIR *
-opendir (infilename, filepattern)
+vms_opendir (infilename, filepattern)
char *infilename; /* name of directory */
char *filepattern;
{
@@ -171,7 +178,7 @@ opendir (infilename, filepattern)
now, by trying to read the first entry. */
if (vms_low_readdir ((DIR *) dirp) == (struct direct *) -1)
{
- closedir (dirp); /* was: xfree (dirp); */
+ vms_closedir (dirp); /* was: xfree (dirp); */
errno = ENOENT;
return 0;
}
@@ -182,8 +189,8 @@ opendir (infilename, filepattern)
}
int
-closedir (dirp)
- register DIR *dirp; /* stream from opendir */
+vms_closedir (dirp)
+ register DIR *dirp; /* stream from vms_opendir */
{
{
VMS_DIR *vms_dirp = (VMS_DIR *) dirp;
@@ -287,8 +294,8 @@ vms_low_readdir (dirp)
/* ARGUSED */
struct direct *
-readdir (dirp)
- register DIR *dirp; /* stream from opendir */
+vms_readdir (dirp)
+ register DIR *dirp; /* stream from vms_opendir */
{
register struct direct *dp;
diff --git a/gnu/usr.bin/cvs/vms/ndir.h b/gnu/usr.bin/cvs/vms/ndir.h
index 21ad429f2a7..b7047262104 100644
--- a/gnu/usr.bin/cvs/vms/ndir.h
+++ b/gnu/usr.bin/cvs/vms/ndir.h
@@ -49,13 +49,13 @@ typedef struct
char dd_buf[DIRBLKSIZ]; /* directory block */
} DIR; /* stream data from opendir() */
-extern DIR *opendir();
-extern struct direct *readdir();
+extern DIR *vms_opendir();
+extern struct direct *vms_readdir();
#ifndef VMS
extern long telldir();
extern void seekdir();
#endif
-extern int closedir();
+extern int vms_closedir();
#define rewinddir( dirp ) seekdir( dirp, 0L )
diff --git a/gnu/usr.bin/cvs/vms/pipe.c b/gnu/usr.bin/cvs/vms/pipe.c
index eae384791bb..ea81a8e8d9d 100644
--- a/gnu/usr.bin/cvs/vms/pipe.c
+++ b/gnu/usr.bin/cvs/vms/pipe.c
@@ -27,6 +27,15 @@
* Added members to PIPE structure and memory corruption tests.
*/
+#ifndef __VMS_VER
+#define __VMS_VER 0
+#endif
+#ifndef __DECC_VER
+#define __DECC_VER 0
+#endif
+
+#if __VMS_VER < 70200000 || __DECC_VER < 50700000
+
/* This won't work with GCC, but it won't cause any problems either. */
#define MODULE PIPE
#define VERSION "V1.5"
@@ -434,3 +443,7 @@ main (argc, argv)
}
}
#endif
+
+#else /* __VMS_VER >= 70200000 && __DECC_VER >= 50700000 */
+#pragma message disable EMPTYFILE
+#endif /* __VMS_VER >= 70200000 && __DECC_VER >= 50700000 */
diff --git a/gnu/usr.bin/cvs/vms/pwd.c b/gnu/usr.bin/cvs/vms/pwd.c
index 5d81194e1a6..40c6f5a1fef 100644
--- a/gnu/usr.bin/cvs/vms/pwd.c
+++ b/gnu/usr.bin/cvs/vms/pwd.c
@@ -2,6 +2,15 @@
#include <stdio.h>
#include <unixlib.h>
+#ifndef __VMS_VER
+#define __VMS_VER 0
+#endif
+#ifndef __DECC_VER
+#define __DECC_VER 0
+#endif
+
+#if __VMS_VER < 70200000 || __DECC_VER < 50700000
+
static struct passwd pw;
/* This is only called from one relevant place, lock.c. In that context
@@ -18,3 +27,7 @@ char *getlogin()
static char login[256];
return cuserid(login);
}
+
+#else /* __VMS_VER >= 70200000 && __DECC_VER >= 50700000 */
+#pragma message disable EMPTYFILE
+#endif /* __VMS_VER >= 70200000 && __DECC_VER >= 50700000 */
diff --git a/gnu/usr.bin/cvs/vms/pwd.h b/gnu/usr.bin/cvs/vms/pwd.h
index 857d75188f7..0fe9cd4a886 100644
--- a/gnu/usr.bin/cvs/vms/pwd.h
+++ b/gnu/usr.bin/cvs/vms/pwd.h
@@ -8,7 +8,11 @@
the group part of the UIC), so we are better off with higher-level
hooks like get_homedir and SYSTEM_GETCALLER. */
+#if !defined(__VMS_VER)
#define pid_t int
+#elif __VMS_VER < 70000000
+#define pid_t int
+#endif
struct passwd {
char *pw_name;
diff --git a/gnu/usr.bin/cvs/vms/rmdir.c b/gnu/usr.bin/cvs/vms/rmdir.c
index 050580e0878..bebe1ea7005 100644
--- a/gnu/usr.bin/cvs/vms/rmdir.c
+++ b/gnu/usr.bin/cvs/vms/rmdir.c
@@ -1,3 +1,13 @@
+
+#ifndef __VMS_VER
+#define __VMS_VER 0
+#endif
+#ifndef __DECC_VER
+#define __DECC_VER 0
+#endif
+
+#if __VMS_VER < 70200000 || __DECC_VER < 50700000
+
#include <stdio.h>
#include <unixio.h>
@@ -8,3 +18,6 @@ char *path;
return remove(path);
}
+#else /* __VMS_VER >= 70200000 && __DECC_VER >= 50700000 */
+#pragma message disable EMPTYFILE
+#endif /* __VMS_VER >= 70200000 && __DECC_VER >= 50700000 */
diff --git a/gnu/usr.bin/cvs/vms/unlink.c b/gnu/usr.bin/cvs/vms/unlink.c
index 8bda6554863..80a5a748713 100644
--- a/gnu/usr.bin/cvs/vms/unlink.c
+++ b/gnu/usr.bin/cvs/vms/unlink.c
@@ -2,7 +2,13 @@
/* UNIX-like file deletion, deletes previous VMS file versions so UNIX
style locking through files dosen't lose. */
-int unlink(char *path)
+#ifndef __VMS_VER
+int vms_unlink(char *path)
+#elif __VMS_VER < 70200000
+int vms_unlink(char *path)
+#else
+int vms_unlink(char const*path)
+#endif
{
int rs, junk_rs;
diff --git a/gnu/usr.bin/cvs/vms/vms.h b/gnu/usr.bin/cvs/vms/vms.h
index d41e196be44..d96ffad5925 100644
--- a/gnu/usr.bin/cvs/vms/vms.h
+++ b/gnu/usr.bin/cvs/vms/vms.h
@@ -1,6 +1,10 @@
/* Determined from CC RTL function prototypes in online documentation */
+#if !defined(__VMS_VER)
#define mode_t unsigned int
+#elif __VMS_VER < 70000000
+#define mode_t unsigned int
+#endif
#define fork(x) vfork(x)
@@ -26,9 +30,16 @@ extern int fnmatch(char *pattern, char *string, int options);
#include "pwd.h"
#include "pipe.h"
-int unlink(char *path);
+#if !defined(__VMS_VER)
+int vms_unlink(char *path);
+#elif __VMS_VER < 70000000
+int vms_unlink(char *path);
+#else
+int vms_unlink(char const*path);
+#endif
int link(char *from, char *to);
#define stat(a, b) wrapped_stat(a, b)
+#define lstat stat
#undef POSIX
diff --git a/gnu/usr.bin/cvs/vms/waitpid.c b/gnu/usr.bin/cvs/vms/waitpid.c
index 36f20d52553..ff9f5514aa3 100644
--- a/gnu/usr.bin/cvs/vms/waitpid.c
+++ b/gnu/usr.bin/cvs/vms/waitpid.c
@@ -13,6 +13,15 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. */
+#ifndef __VMS_VER
+#define __VMS_VER 0
+#endif
+#ifndef __DECC_VER
+#define __DECC_VER 0
+#endif
+
+#if __VMS_VER < 70200000 || __DECC_VER < 50700000
+
#include "vms.h"
#define WAITPID_CHILDREN 8
@@ -62,3 +71,7 @@ success:
*stat_loc = waited_status[i];
return p;
}
+
+#else /* __VMS_VER >= 70200000 && __DECC_VER >= 50700000 */
+#pragma message disable EMPTYFILE
+#endif /* __VMS_VER >= 70200000 && __DECC_VER >= 50700000 */
diff --git a/gnu/usr.bin/cvs/windows-NT/ChangeLog b/gnu/usr.bin/cvs/windows-NT/ChangeLog
index dd0d855dadc..245dfad5d86 100644
--- a/gnu/usr.bin/cvs/windows-NT/ChangeLog
+++ b/gnu/usr.bin/cvs/windows-NT/ChangeLog
@@ -1,3 +1,43 @@
+2001-04-25 Derek Price <dprice@collab.net>
+
+ * Makefile.in: Regenerated using AM 1.4e as of today at 18:10 -0400.
+
+2001-03-14 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.in: Regenerated
+
+2001-02-15 Derek Price <derek.price@openavenue.com>
+ Laine Stump <laine+info-cvs@laine.org>
+
+ * config.h: Define HAVE_USLEEP and define a prototype for usleep.
+ * win32.c (usleep): New function.
+
+2000-12-22 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.in: Regenerated
+
+2000-12-21 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.am: New file needed by Automake
+ * Makefile.in: Regenerated
+
+2000-11-21 Derek Price <derek.price@openavenue.com>
+
+ * filesubr.c (check_statbuf): subtract 3600 from the times returned
+ by the stat function when daylight savings time is in effect due to a
+ bug in Windoze. Fixes a bug where CVS thinks all files have been
+ touched after a transition to or from daylight savings time.
+
+2000-11-20 Derek Price <derek.price@openavenue.com>
+
+ * filesubr.c (cvs_temp_file): add this function to match the one in
+ src/filesubr.c
+ (cvs_temp_name): wrap cvs_temp_file as in src/filesubr.c
+
+2000-10-18 Derek Price <derek.price@openavenue.com>
+
+ * config.h: Add () to a macro function to supress a warning.
+
2000-06-26 Larry Jones <larry.jones@sdrc.com>
* config.h: Define REGEX_MALLOC and _REGEX_RE_COMP.
diff --git a/gnu/usr.bin/cvs/windows-NT/Makefile.am b/gnu/usr.bin/cvs/windows-NT/Makefile.am
new file mode 100644
index 00000000000..ba5928a1602
--- /dev/null
+++ b/gnu/usr.bin/cvs/windows-NT/Makefile.am
@@ -0,0 +1,43 @@
+## Process this file with automake to produce Makefile.in
+
+# *** Under Windows NT and Microsoft Visual C++, we use cvsnt.mak, not
+# *** this makefile. However, we need this file in order for 'make
+# *** dist' to work properly on Unix machines.
+
+# Makefile for GNU CVS windows-NT dist.
+# Copyright (C) 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+EXTRA_DIST = \
+ config.h \
+ ndir.h \
+ options.h \
+ pwd.h \
+ rcmd.h \
+ filesubr.c \
+ mkdir.c \
+ ndir.c \
+ pwd.c \
+ rcmd.c \
+ run.c \
+ sockerror.c \
+ startserver.c \
+ stripslash.c \
+ waitpid.c \
+ win32.c \
+ .cvsignore
+
+SUBDIRS = SCC
+
+# for backwards compatibility with the old makefiles
+realclean: maintainer-clean
+.PHONY: realclean
diff --git a/gnu/usr.bin/cvs/windows-NT/Makefile.in b/gnu/usr.bin/cvs/windows-NT/Makefile.in
index f901edfe4e4..f490d266103 100644
--- a/gnu/usr.bin/cvs/windows-NT/Makefile.in
+++ b/gnu/usr.bin/cvs/windows-NT/Makefile.in
@@ -1,78 +1,362 @@
-#### Under Windows NT and Microsoft Visual C++, we use cvsnt.mak, not
-#### this makefile. However, we need this file in order for 'make
-#### dist' to work properly on Unix machines.
+# Makefile.in generated automatically by automake 1.4e from Makefile.am.
+
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# *** Under Windows NT and Microsoft Visual C++, we use cvsnt.mak, not
+# *** this makefile. However, we need this file in order for 'make
+# *** dist' to work properly on Unix machines.
+
+# Makefile for GNU CVS windows-NT dist.
+# Copyright (C) 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-cvs_srcdir = @top_srcdir@/src
-VPATH = @srcdir@
-SHELL = /bin/sh
+SHELL = @SHELL@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+
+top_builddir = ..
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = @program_transform_name@
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+AMTAR = @AMTAR@
+AWK = @AWK@
+CC = @CC@
+CSH = @CSH@
+DEPDIR = @DEPDIR@
+ETAGS = @ETAGS@
+ETAGS_INCLUDE_OPTION = @ETAGS_INCLUDE_OPTION@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INSTALL_STRIP_PROGRAM_ENV = @INSTALL_STRIP_PROGRAM_ENV@
+KRB4 = @KRB4@
+LN_S = @LN_S@
+MAKEINFO = @MAKEINFO@
+PACKAGE = @PACKAGE@
+PERL = @PERL@
+PR = @PR@
+PS2PDF = @PS2PDF@
+RANLIB = @RANLIB@
+ROFF = @ROFF@
+STRIP = @STRIP@
+TEXI2DVI = @TEXI2DVI@
+VERSION = @VERSION@
+YACC = @YACC@
+_am_include = @_am_include@
+_am_quote = @_am_quote@
+includeopt = @includeopt@
+install_sh = @install_sh@
+
+EXTRA_DIST = \
+ config.h \
+ ndir.h \
+ options.h \
+ pwd.h \
+ rcmd.h \
+ filesubr.c \
+ mkdir.c \
+ ndir.c \
+ pwd.c \
+ rcmd.c \
+ run.c \
+ sockerror.c \
+ startserver.c \
+ stripslash.c \
+ waitpid.c \
+ win32.c \
+ .cvsignore
+
+
+SUBDIRS = SCC
+EXEEXT =
+OBJEXT = o
+subdir = windows-NT
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h $(top_builddir)/src/options.h
+CONFIG_CLEAN_FILES =
+DIST_SOURCES =
+
+RECURSIVE_TARGETS = all-recursive install-data-recursive \
+ install-exec-recursive installdirs-recursive install-recursive \
+ uninstall-recursive check-recursive installcheck-recursive
+DIST_COMMON = README ChangeLog Makefile.am Makefile.in
+DIST_SUBDIRS = $(SUBDIRS)
+all: all-recursive
+
+.SUFFIXES:
+
+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu windows-NT/Makefile
+
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) && \
+ CONFIG_HEADERS= CONFIG_LINKS= \
+ CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @set fnord $(MAKEFLAGS); amf=$$2; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+ @set fnord $(MAKEFLAGS); amf=$$2; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique $(LISP)
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -f $$subdir/TAGS && tags="$$tags $(ETAGS_INCLUDE_OPTION)$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
+ unique=`for i in $$list @CONFIG@; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+ || $(ETAGS) $(ETAGS_ARGS) $$tags $$unique $(LISP)
+
+GTAGS:
+ here=`CDPATH=: && cd $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $$here
+
+distclean-tags:
+ -rm -f TAGS ID
-HEADERS = \
- config.h \
- ndir.h \
- options.h \
- pwd.h \
- rcmd.h
-SOURCES = \
- filesubr.c \
- mkdir.c \
- ndir.c \
- pwd.c \
- rcmd.c \
- run.c \
- sockerror.c \
- startserver.c \
- stripslash.c \
- waitpid.c \
- win32.c
-DISTFILES = ${HEADERS} ${SOURCES} \
- README ChangeLog Makefile.in .cvsignore
-
-SUBDIRS=SCC
-
-all:
-
-.PHONY: all install uninstall
-all install uninstall:
-
-installdirs:
-.PHONY: installdirs
-
-.PHONY: tags TAGS
-tags TAGS:
-
-.PHONY: ls
-ls:
- @echo ${DISTFILES}
-
-.PHONY: clean distclean realclean mostlyclean
-clean realclean mostlyclean:
-
-distclean:
- rm -f Makefile
-
-.PHONY: lint
-lint:
-
-.PHONY: dist-dir
-dist-dir:
- mkdir ${DISTDIR}
- for i in ${DISTFILES}; do \
- ln $(srcdir)/$${i} ${DISTDIR}; \
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+
+top_distdir = ..
+distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
+
+distdir: $(DISTFILES)
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+ cp -pR $$d/$$file $(distdir) \
+ || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
done
- for i in ${SUBDIRS}; do \
- cd $${i}; ${MAKE} dist-dir DISTDIR="../${DISTDIR}/$${i}"; \
+ for subdir in $(SUBDIRS); do \
+ if test "$$subdir" = .; then :; else \
+ test -d $(distdir)/$$subdir \
+ || mkdir $(distdir)/$$subdir \
+ || exit 1; \
+ (cd $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$(top_distdir)" \
+ distdir=../$(distdir)/$$subdir \
+ distdir) \
+ || exit 1; \
+ fi; \
done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
-clean:
- @echo make clean does nothing in windows-NT subdir
+installdirs: installdirs-recursive
+installdirs-am:
-subdir = windows-NT
-Makefile: ../config.status Makefile.in
- cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ INSTALL_PROGRAM_ENV='$(INSTALL_STRIP_PROGRAM_ENV)' install
+
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+ -rm -f Makefile.in
+clean: clean-recursive
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-recursive
+
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi:
+
+dvi-am:
+
+info:
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info:
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic
+
+.PHONY: $(RECURSIVE_TARGETS) all all-am check check-am clean \
+ clean-generic clean-recursive distclean distclean-generic \
+ distclean-recursive distclean-tags distdir dvi dvi-am info \
+ info-am install install-am install-data install-data-am \
+ install-data-recursive install-exec install-exec-am \
+ install-exec-recursive install-info install-man \
+ install-recursive install-strip installcheck installcheck-am \
+ installdirs installdirs-am installdirs-recursive \
+ maintainer-clean maintainer-clean-generic \
+ maintainer-clean-recursive mostlyclean mostlyclean-generic \
+ mostlyclean-recursive tags tags-recursive uninstall \
+ uninstall-am uninstall-recursive
+
+
+# for backwards compatibility with the old makefiles
+realclean: maintainer-clean
+.PHONY: realclean
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/gnu/usr.bin/cvs/windows-NT/SCC/ChangeLog b/gnu/usr.bin/cvs/windows-NT/SCC/ChangeLog
index 0039f34c0a5..ed9f00368eb 100644
--- a/gnu/usr.bin/cvs/windows-NT/SCC/ChangeLog
+++ b/gnu/usr.bin/cvs/windows-NT/SCC/ChangeLog
@@ -1,3 +1,20 @@
+2001-04-25 Derek Price <dprice@collab.net>
+
+ * Makefile.in: Regenerated using AM 1.4e as of today at 18:10 -0400.
+
+2001-03-14 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.in: Regenerated
+
+2000-12-22 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.in: Regenerated
+
+2000-12-21 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.am: New file needed by Automake
+ * Makefile.in: Regenerated
+
1999-04-09 Jim Kingdon <http://www.cyclic.com>
* Makefile.in (DISTFILES): Add SCC.dsp.
diff --git a/gnu/usr.bin/cvs/windows-NT/SCC/Makefile.am b/gnu/usr.bin/cvs/windows-NT/SCC/Makefile.am
new file mode 100644
index 00000000000..8e19b61d07c
--- /dev/null
+++ b/gnu/usr.bin/cvs/windows-NT/SCC/Makefile.am
@@ -0,0 +1,31 @@
+## Process this file with automake to produce Makefile.in
+
+# *** Under Windows NT and Microsoft Visual C++, we use cvsnt.mak, not
+# *** this makefile. However, we need this file in order for 'make
+# *** dist' to work properly on Unix machines.
+
+# Makefile for GNU CVS windows-NT/SCC dist.
+# Copyright (C) 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+EXTRA_DIST = \
+ .cvsignore \
+ README.txt \
+ SCC.mak \
+ SCC.dsp \
+ scc.c \
+ scc.def \
+ pubscc.h
+
+# for backwards compatibility with the old makefiles
+realclean: maintainer-clean
+.PHONY: realclean
diff --git a/gnu/usr.bin/cvs/windows-NT/SCC/Makefile.in b/gnu/usr.bin/cvs/windows-NT/SCC/Makefile.in
index 7e346bd5980..60ad1e0a72e 100644
--- a/gnu/usr.bin/cvs/windows-NT/SCC/Makefile.in
+++ b/gnu/usr.bin/cvs/windows-NT/SCC/Makefile.in
@@ -1,39 +1,237 @@
-# Makefile for distributing files. Note that it only has a dist-dir
-# target, so other targets should not recurse into this directory.
-# This makefile is in the public domain.
+# Makefile.in generated automatically by automake 1.4e from Makefile.am.
-#### Start of system configuration section. ####
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# *** Under Windows NT and Microsoft Visual C++, we use cvsnt.mak, not
+# *** this makefile. However, we need this file in order for 'make
+# *** dist' to work properly on Unix machines.
+
+# Makefile for GNU CVS windows-NT/SCC dist.
+# Copyright (C) 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+
+SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
-# Just in case...
-SHELL = /bin/sh
-@SET_MAKE@
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
-DISTFILES = \
- .cvsignore ChangeLog Makefile.in README.txt \
- SCC.mak SCC.dsp scc.c scc.def pubscc.h
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
-all:
-.PHONY: all
+top_builddir = ../..
-dist-dir: ${DISTFILES}
- mkdir ${DISTDIR}
- for i in ${DISTFILES}; do \
- ln $(srcdir)/$${i} ${DISTDIR}; \
- done
-.PHONY: dist-dir
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = @program_transform_name@
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+AMTAR = @AMTAR@
+AWK = @AWK@
+CC = @CC@
+CSH = @CSH@
+DEPDIR = @DEPDIR@
+ETAGS = @ETAGS@
+ETAGS_INCLUDE_OPTION = @ETAGS_INCLUDE_OPTION@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INSTALL_STRIP_PROGRAM_ENV = @INSTALL_STRIP_PROGRAM_ENV@
+KRB4 = @KRB4@
+LN_S = @LN_S@
+MAKEINFO = @MAKEINFO@
+PACKAGE = @PACKAGE@
+PERL = @PERL@
+PR = @PR@
+PS2PDF = @PS2PDF@
+RANLIB = @RANLIB@
+ROFF = @ROFF@
+STRIP = @STRIP@
+TEXI2DVI = @TEXI2DVI@
+VERSION = @VERSION@
+YACC = @YACC@
+_am_include = @_am_include@
+_am_quote = @_am_quote@
+includeopt = @includeopt@
+install_sh = @install_sh@
+EXTRA_DIST = \
+ .cvsignore \
+ README.txt \
+ SCC.mak \
+ SCC.dsp \
+ scc.c \
+ scc.def \
+ pubscc.h
+
+EXEEXT =
+OBJEXT = o
subdir = windows-NT/SCC
-Makefile: ../../config.status Makefile.in
- cd ../.. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h $(top_builddir)/src/options.h
+CONFIG_CLEAN_FILES =
+DIST_SOURCES =
+DIST_COMMON = ChangeLog Makefile.am Makefile.in
+all: all-am
+
+.SUFFIXES:
+
+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu windows-NT/SCC/Makefile
+
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) && \
+ CONFIG_HEADERS= CONFIG_LINKS= \
+ CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status
+tags: TAGS
+TAGS:
+
+
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+
+top_distdir = ../..
+distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
+
+distdir: $(DISTFILES)
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+ cp -pR $$d/$$file $(distdir) \
+ || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile
+
+installdirs:
+
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ INSTALL_PROGRAM_ENV='$(INSTALL_STRIP_PROGRAM_ENV)' install
+
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+ -rm -f Makefile.in
+clean: clean-am
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-am
+
+distclean-am: clean-am distclean-generic
+
+dvi:
+
+dvi-am:
+
+info:
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info:
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic
+
+.PHONY: all all-am check check-am clean clean-generic distclean \
+ distclean-generic distdir dvi dvi-am info info-am install \
+ install-am install-data install-data-am install-exec \
+ install-exec-am install-info install-man install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic \
+ uninstall uninstall-am
+
-# CYGNUS LOCAL: don't depend on auto-re-config
-#../config.status: ../configure
-# cd .. ; $(SHELL) config.status --recheck
+# for backwards compatibility with the old makefiles
+realclean: maintainer-clean
+.PHONY: realclean
-# CYGNUS LOCAL: don't depend on auto-re-config
-#../configure: ../configure.in
-# cd $(top_srcdir) ; autoconf
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/gnu/usr.bin/cvs/windows-NT/config.h b/gnu/usr.bin/cvs/windows-NT/config.h
index 33550d595cc..2750b644f3d 100644
--- a/gnu/usr.bin/cvs/windows-NT/config.h
+++ b/gnu/usr.bin/cvs/windows-NT/config.h
@@ -154,6 +154,9 @@
this function in the code anyway, hmm. */
#undef HAVE_TIMEZONE
+/* Define if you have the usleep function. */
+#define HAVE_USLEEP 1
+
/* Define if you have the vfork function. */
#undef HAVE_VFORK
@@ -255,6 +258,8 @@ extern pid_t getpid (void);
/* This is just a call to the Win32 Sleep function. */
unsigned int sleep (unsigned int);
+/* So is this */
+int usleep (unsigned long);
/* Don't worry, Microsoft, it's okay for these functions to
be in our namespace. */
@@ -291,7 +296,7 @@ extern void wnt_shutdown_server (int fd);
#define SYSTEM_INITIALIZE(pargc,pargv) init_winsock()
extern void init_winsock();
-#define SYSTEM_CLEANUP() wnt_cleanup
+#define SYSTEM_CLEANUP() wnt_cleanup()
extern void wnt_cleanup (void);
#define HAVE_WINSOCK_H
diff --git a/gnu/usr.bin/cvs/windows-NT/filesubr.c b/gnu/usr.bin/cvs/windows-NT/filesubr.c
index 9dae900176b..52db5051880 100644
--- a/gnu/usr.bin/cvs/windows-NT/filesubr.c
+++ b/gnu/usr.bin/cvs/windows-NT/filesubr.c
@@ -654,21 +654,75 @@ xcmp (file1, file2)
return (ret);
}
-
/* Generate a unique temporary filename. Returns a pointer to a newly
- malloc'd string containing the name. Returns successfully or not at
- all. */
+ * malloc'd string containing the name. Returns successfully or not at
+ * all.
+ *
+ * THIS FUNCTION IS DEPRECATED!!! USE cvs_temp_file INSTEAD!!!
+ *
+ * and yes, I know about the way the rcs commands use temp files. I think
+ * they should be converted too but I don't have time to look into it right
+ * now.
+ */
char *
cvs_temp_name ()
{
- char *retval;
+ char *fn;
+ FILE *fp;
- retval = _tempnam (NULL, NULL);
- if (retval == NULL)
- error (1, errno, "cannot generate temporary filename");
- return retval;
+ fp = cvs_temp_file (&fn);
+ if (fp == NULL)
+ error (1, errno, "Failed to create temporary file");
+ if (fclose (fp) == EOF)
+ error (0, errno, "Failed to close temporary file %s", fn);
+ return fn;
+}
+
+/* Generate a unique temporary filename and return an open file stream
+ * to the truncated file by that name
+ *
+ * INPUTS
+ * filename where to place the pointer to the newly allocated file
+ * name string
+ *
+ * OUTPUTS
+ * filename dereferenced, will point to the newly allocated file
+ * name string. This value is undefined if the function
+ * returns an error.
+ *
+ * RETURNS
+ * An open file pointer to a read/write mode empty temporary file with the
+ * unique file name or NULL on failure.
+ *
+ * ERRORS
+ * on error, errno will be set to some value either by CVS_FOPEN or
+ * whatever system function is called to generate the temporary file name
+ */
+FILE *cvs_temp_file (filename)
+ char **filename;
+{
+ char *fn;
+ FILE *fp;
+
+ /* FIXME - I'd like to be returning NULL here in noexec mode, but I think
+ * some of the rcs & diff functions which rely on a temp file run in
+ * noexec mode too.
+ */
+
+ /* assert (filename != NULL); */
+
+ fn = _tempnam (Tmpdir, "cvs");
+ if (fn == NULL) fp = NULL;
+ else if ((fp = CVS_FOPEN (fn, "w+")) == NULL) free (fn);
+
+ /* tempnam returns a pointer to a newly malloc'd string, so there's
+ * no need for a xstrdup
+ */
+
+ *filename = fn;
+ return fp;
}
-
+
/* Return non-zero iff FILENAME is absolute.
Trivial under Unix, but more complicated under other systems. */
int
@@ -893,6 +947,9 @@ expand_wild (argc, argv, pargc, pargv)
static void check_statbuf (const char *file, struct stat *sb)
{
+ struct tm *newtime;
+ time_t long_time;
+
/* Win32 processes file times in a 64 bit format
(see Win32 functions SetFileTime and GetFileTime).
If the file time on a file doesn't fit into the
@@ -912,6 +969,23 @@ static void check_statbuf (const char *file, struct stat *sb)
error (1, 0, "invalid ctime for %s", file);
if (sb->st_atime == (time_t) -1)
error (1, 0, "invalid access time for %s", file);
+
+ time( &long_time ); /* Get time as long integer. */
+ newtime = localtime( &long_time ); /* Convert to local time. */
+
+ /* we know for a fact that the stat function under Windoze NT 4.0 and,
+ * by all reports, many other Windoze systems, will return file times
+ * 3600 seconds too big when daylight savings time is in effect. This is
+ * a bug since it is defined as returning the time in UTC.
+ *
+ * So correct for it for now.
+ */
+ if (newtime->tm_isdst == 1)
+ {
+ sb->st_ctime -= 3600;
+ sb->st_mtime -= 3600;
+ sb->st_atime -= 3600;
+ }
}
int
diff --git a/gnu/usr.bin/cvs/windows-NT/win32.c b/gnu/usr.bin/cvs/windows-NT/win32.c
index 88e7e7f8062..b8c08caadb7 100644
--- a/gnu/usr.bin/cvs/windows-NT/win32.c
+++ b/gnu/usr.bin/cvs/windows-NT/win32.c
@@ -54,6 +54,16 @@ unsigned sleep(unsigned seconds)
return 0;
}
+/*
+ * Sleep at least useconds microseconds.
+ */
+int usleep(unsigned long useconds)
+{
+ /* Not very accurate, but it gets the job done */
+ Sleep(useconds/1000 + (useconds%1000 ? 1 : 0));
+ return 0;
+}
+
#if 0
/* WinSock has a gethostname. But note that WinSock gethostname may
diff --git a/gnu/usr.bin/cvs/zlib/.cvsignore b/gnu/usr.bin/cvs/zlib/.cvsignore
index 51de950c818..206ab8398fb 100644
--- a/gnu/usr.bin/cvs/zlib/.cvsignore
+++ b/gnu/usr.bin/cvs/zlib/.cvsignore
@@ -1,5 +1,6 @@
Makefile
example
minigzip
+foo.gz
Debug
Release
diff --git a/gnu/usr.bin/cvs/zlib/ChangeLog b/gnu/usr.bin/cvs/zlib/ChangeLog
index 7686cb17726..2e4214ce35b 100644
--- a/gnu/usr.bin/cvs/zlib/ChangeLog
+++ b/gnu/usr.bin/cvs/zlib/ChangeLog
@@ -1,3 +1,17 @@
+2001-03-14 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.in: Regenerated
+
+2000-12-21 Derek Price <derek.price@openavenue.com>
+
+ * .cvsignore: Added the foo.gz file created by 'make check'
+ * Makefile.in: Added support for Automake targets
+
+2000-10-31 Derek Price <derek.price@openavenue.com>
+
+ * Makefile.in (DISTFILES, test, libz.a): propogate local (CVS)
+ zlib mods to the most recent version of zlib (1.1.3).
+
1999-05-06 Jim Kingdon <http://www.cyclic.com>
* Makefile.in (DISTFILES): Remove zlib.mak.
@@ -48,6 +62,238 @@ Fri Aug 16 16:07:38 1996 Norbert Kiesel <nk@col.sw-ley.de>
ChangeLog file for zlib
+Changes in 1.1.3 (9 July 1998)
+- fix "an inflate input buffer bug that shows up on rare but persistent
+ occasions" (Mark)
+- fix gzread and gztell for concatenated .gz files (Didier Le Botlan)
+- fix gzseek(..., SEEK_SET) in write mode
+- fix crc check after a gzeek (Frank Faubert)
+- fix miniunzip when the last entry in a zip file is itself a zip file
+ (J Lillge)
+- add contrib/asm586 and contrib/asm686 (Brian Raiter)
+ See http://www.muppetlabs.com/~breadbox/software/assembly.html
+- add support for Delphi 3 in contrib/delphi (Bob Dellaca)
+- add support for C++Builder 3 and Delphi 3 in contrib/delphi2 (Davide Moretti)
+- do not exit prematurely in untgz if 0 at start of block (Magnus Holmgren)
+- use macro EXTERN instead of extern to support DLL for BeOS (Sander Stoks)
+- added a FAQ file
+
+- Support gzdopen on Mac with Metrowerks (Jason Linhart)
+- Do not redefine Byte on Mac (Brad Pettit & Jason Linhart)
+- define SEEK_END too if SEEK_SET is not defined (Albert Chin-A-Young)
+- avoid some warnings with Borland C (Tom Tanner)
+- fix a problem in contrib/minizip/zip.c for 16-bit MSDOS (Gilles Vollant)
+- emulate utime() for WIN32 in contrib/untgz (Gilles Vollant)
+- allow several arguments to configure (Tim Mooney, Frodo Looijaard)
+- use libdir and includedir in Makefile.in (Tim Mooney)
+- support shared libraries on OSF1 V4 (Tim Mooney)
+- remove so_locations in "make clean" (Tim Mooney)
+- fix maketree.c compilation error (Glenn, Mark)
+- Python interface to zlib now in Python 1.5 (Jeremy Hylton)
+- new Makefile.riscos (Rich Walker)
+- initialize static descriptors in trees.c for embedded targets (Nick Smith)
+- use "foo-gz" in example.c for RISCOS and VMS (Nick Smith)
+- add the OS/2 files in Makefile.in too (Andrew Zabolotny)
+- fix fdopen and halloc macros for Microsoft C 6.0 (Tom Lane)
+- fix maketree.c to allow clean compilation of inffixed.h (Mark)
+- fix parameter check in deflateCopy (Gunther Nikl)
+- cleanup trees.c, use compressed_len only in debug mode (Christian Spieler)
+- Many portability patches by Christian Spieler:
+ . zutil.c, zutil.h: added "const" for zmem*
+ . Make_vms.com: fixed some typos
+ . Make_vms.com: msdos/Makefile.*: removed zutil.h from some dependency lists
+ . msdos/Makefile.msc: remove "default rtl link library" info from obj files
+ . msdos/Makefile.*: use model-dependent name for the built zlib library
+ . msdos/Makefile.emx, nt/Makefile.emx, nt/Makefile.gcc:
+ new makefiles, for emx (DOS/OS2), emx&rsxnt and mingw32 (Windows 9x / NT)
+- use define instead of typedef for Bytef also for MSC small/medium (Tom Lane)
+- replace __far with _far for better portability (Christian Spieler, Tom Lane)
+- fix test for errno.h in configure (Tim Newsham)
+
+Changes in 1.1.2 (19 March 98)
+- added contrib/minzip, mini zip and unzip based on zlib (Gilles Vollant)
+ See http://www.winimage.com/zLibDll/unzip.html
+- preinitialize the inflate tables for fixed codes, to make the code
+ completely thread safe (Mark)
+- some simplifications and slight speed-up to the inflate code (Mark)
+- fix gzeof on non-compressed files (Allan Schrum)
+- add -std1 option in configure for OSF1 to fix gzprintf (Martin Mokrejs)
+- use default value of 4K for Z_BUFSIZE for 16-bit MSDOS (Tim Wegner + Glenn)
+- added os2/Makefile.def and os2/zlib.def (Andrew Zabolotny)
+- add shared lib support for UNIX_SV4.2MP (MATSUURA Takanori)
+- do not wrap extern "C" around system includes (Tom Lane)
+- mention zlib binding for TCL in README (Andreas Kupries)
+- added amiga/Makefile.pup for Amiga powerUP SAS/C PPC (Andreas Kleinert)
+- allow "make install prefix=..." even after configure (Glenn Randers-Pehrson)
+- allow "configure --prefix $HOME" (Tim Mooney)
+- remove warnings in example.c and gzio.c (Glenn Randers-Pehrson)
+- move Makefile.sas to amiga/Makefile.sas
+
+Changes in 1.1.1 (27 Feb 98)
+- fix macros _tr_tally_* in deflate.h for debug mode (Glenn Randers-Pehrson)
+- remove block truncation heuristic which had very marginal effect for zlib
+ (smaller lit_bufsize than in gzip 1.2.4) and degraded a little the
+ compression ratio on some files. This also allows inlining _tr_tally for
+ matches in deflate_slow.
+- added msdos/Makefile.w32 for WIN32 Microsoft Visual C++ (Bob Frazier)
+
+Changes in 1.1.0 (24 Feb 98)
+- do not return STREAM_END prematurely in inflate (John Bowler)
+- revert to the zlib 1.0.8 inflate to avoid the gcc 2.8.0 bug (Jeremy Buhler)
+- compile with -DFASTEST to get compression code optimized for speed only
+- in minigzip, try mmap'ing the input file first (Miguel Albrecht)
+- increase size of I/O buffers in minigzip.c and gzio.c (not a big gain
+ on Sun but significant on HP)
+
+- add a pointer to experimental unzip library in README (Gilles Vollant)
+- initialize variable gcc in configure (Chris Herborth)
+
+Changes in 1.0.9 (17 Feb 1998)
+- added gzputs and gzgets functions
+- do not clear eof flag in gzseek (Mark Diekhans)
+- fix gzseek for files in transparent mode (Mark Diekhans)
+- do not assume that vsprintf returns the number of bytes written (Jens Krinke)
+- replace EXPORT with ZEXPORT to avoid conflict with other programs
+- added compress2 in zconf.h, zlib.def, zlib.dnt
+- new asm code from Gilles Vollant in contrib/asm386
+- simplify the inflate code (Mark):
+ . Replace ZALLOC's in huft_build() with single ZALLOC in inflate_blocks_new()
+ . ZALLOC the length list in inflate_trees_fixed() instead of using stack
+ . ZALLOC the value area for huft_build() instead of using stack
+ . Simplify Z_FINISH check in inflate()
+
+- Avoid gcc 2.8.0 comparison bug a little differently than zlib 1.0.8
+- in inftrees.c, avoid cc -O bug on HP (Farshid Elahi)
+- in zconf.h move the ZLIB_DLL stuff earlier to avoid problems with
+ the declaration of FAR (Gilles VOllant)
+- install libz.so* with mode 755 (executable) instead of 644 (Marc Lehmann)
+- read_buf buf parameter of type Bytef* instead of charf*
+- zmemcpy parameters are of type Bytef*, not charf* (Joseph Strout)
+- do not redeclare unlink in minigzip.c for WIN32 (John Bowler)
+- fix check for presence of directories in "make install" (Ian Willis)
+
+Changes in 1.0.8 (27 Jan 1998)
+- fixed offsets in contrib/asm386/gvmat32.asm (Gilles Vollant)
+- fix gzgetc and gzputc for big endian systems (Markus Oberhumer)
+- added compress2() to allow setting the compression level
+- include sys/types.h to get off_t on some systems (Marc Lehmann & QingLong)
+- use constant arrays for the static trees in trees.c instead of computing
+ them at run time (thanks to Ken Raeburn for this suggestion). To create
+ trees.h, compile with GEN_TREES_H and run "make test".
+- check return code of example in "make test" and display result
+- pass minigzip command line options to file_compress
+- simplifying code of inflateSync to avoid gcc 2.8 bug
+
+- support CC="gcc -Wall" in configure -s (QingLong)
+- avoid a flush caused by ftell in gzopen for write mode (Ken Raeburn)
+- fix test for shared library support to avoid compiler warnings
+- zlib.lib -> zlib.dll in msdos/zlib.rc (Gilles Vollant)
+- check for TARGET_OS_MAC in addition to MACOS (Brad Pettit)
+- do not use fdopen for Metrowerks on Mac (Brad Pettit))
+- add checks for gzputc and gzputc in example.c
+- avoid warnings in gzio.c and deflate.c (Andreas Kleinert)
+- use const for the CRC table (Ken Raeburn)
+- fixed "make uninstall" for shared libraries
+- use Tracev instead of Trace in infblock.c
+- in example.c use correct compressed length for test_sync
+- suppress +vnocompatwarnings in configure for HPUX (not always supported)
+
+Changes in 1.0.7 (20 Jan 1998)
+- fix gzseek which was broken in write mode
+- return error for gzseek to negative absolute position
+- fix configure for Linux (Chun-Chung Chen)
+- increase stack space for MSC (Tim Wegner)
+- get_crc_table and inflateSyncPoint are EXPORTed (Gilles Vollant)
+- define EXPORTVA for gzprintf (Gilles Vollant)
+- added man page zlib.3 (Rick Rodgers)
+- for contrib/untgz, fix makedir() and improve Makefile
+
+- check gzseek in write mode in example.c
+- allocate extra buffer for seeks only if gzseek is actually called
+- avoid signed/unsigned comparisons (Tim Wegner, Gilles Vollant)
+- add inflateSyncPoint in zconf.h
+- fix list of exported functions in nt/zlib.dnt and mdsos/zlib.def
+
+Changes in 1.0.6 (19 Jan 1998)
+- add functions gzprintf, gzputc, gzgetc, gztell, gzeof, gzseek, gzrewind and
+ gzsetparams (thanks to Roland Giersig and Kevin Ruland for some of this code)
+- Fix a deflate bug occuring only with compression level 0 (thanks to
+ Andy Buckler for finding this one).
+- In minigzip, pass transparently also the first byte for .Z files.
+- return Z_BUF_ERROR instead of Z_OK if output buffer full in uncompress()
+- check Z_FINISH in inflate (thanks to Marc Schluper)
+- Implement deflateCopy (thanks to Adam Costello)
+- make static libraries by default in configure, add --shared option.
+- move MSDOS or Windows specific files to directory msdos
+- suppress the notion of partial flush to simplify the interface
+ (but the symbol Z_PARTIAL_FLUSH is kept for compatibility with 1.0.4)
+- suppress history buffer provided by application to simplify the interface
+ (this feature was not implemented anyway in 1.0.4)
+- next_in and avail_in must be initialized before calling inflateInit or
+ inflateInit2
+- add EXPORT in all exported functions (for Windows DLL)
+- added Makefile.nt (thanks to Stephen Williams)
+- added the unsupported "contrib" directory:
+ contrib/asm386/ by Gilles Vollant <info@winimage.com>
+ 386 asm code replacing longest_match().
+ contrib/iostream/ by Kevin Ruland <kevin@rodin.wustl.edu>
+ A C++ I/O streams interface to the zlib gz* functions
+ contrib/iostream2/ by Tyge Løvset <Tyge.Lovset@cmr.no>
+ Another C++ I/O streams interface
+ contrib/untgz/ by "Pedro A. Aranda Guti\irrez" <paag@tid.es>
+ A very simple tar.gz file extractor using zlib
+ contrib/visual-basic.txt by Carlos Rios <c_rios@sonda.cl>
+ How to use compress(), uncompress() and the gz* functions from VB.
+- pass params -f (filtered data), -h (huffman only), -1 to -9 (compression
+ level) in minigzip (thanks to Tom Lane)
+
+- use const for rommable constants in deflate
+- added test for gzseek and gztell in example.c
+- add undocumented function inflateSyncPoint() (hack for Paul Mackerras)
+- add undocumented function zError to convert error code to string
+ (for Tim Smithers)
+- Allow compilation of gzio with -DNO_DEFLATE to avoid the compression code.
+- Use default memcpy for Symantec MSDOS compiler.
+- Add EXPORT keyword for check_func (needed for Windows DLL)
+- add current directory to LD_LIBRARY_PATH for "make test"
+- create also a link for libz.so.1
+- added support for FUJITSU UXP/DS (thanks to Toshiaki Nomura)
+- use $(SHAREDLIB) instead of libz.so in Makefile.in (for HPUX)
+- added -soname for Linux in configure (Chun-Chung Chen,
+- assign numbers to the exported functions in zlib.def (for Windows DLL)
+- add advice in zlib.h for best usage of deflateSetDictionary
+- work around compiler bug on Atari (cast Z_NULL in call of s->checkfn)
+- allow compilation with ANSI keywords only enabled for TurboC in large model
+- avoid "versionString"[0] (Borland bug)
+- add NEED_DUMMY_RETURN for Borland
+- use variable z_verbose for tracing in debug mode (L. Peter Deutsch).
+- allow compilation with CC
+- defined STDC for OS/2 (David Charlap)
+- limit external names to 8 chars for MVS (Thomas Lund)
+- in minigzip.c, use static buffers only for 16-bit systems
+- fix suffix check for "minigzip -d foo.gz"
+- do not return an error for the 2nd of two consecutive gzflush() (Felix Lee)
+- use _fdopen instead of fdopen for MSC >= 6.0 (Thomas Fanslau)
+- added makelcc.bat for lcc-win32 (Tom St Denis)
+- in Makefile.dj2, use copy and del instead of install and rm (Frank Donahoe)
+- Avoid expanded $Id: ChangeLog,v 1.1.1.5 2001/09/28 22:45:40 tholo Exp $. Use "rcs -kb" or "cvs admin -kb" to avoid Id expansion.
+- check for unistd.h in configure (for off_t)
+- remove useless check parameter in inflate_blocks_free
+- avoid useless assignment of s->check to itself in inflate_blocks_new
+- do not flush twice in gzclose (thanks to Ken Raeburn)
+- rename FOPEN as F_OPEN to avoid clash with /usr/include/sys/file.h
+- use NO_ERRNO_H instead of enumeration of operating systems with errno.h
+- work around buggy fclose on pipes for HP/UX
+- support zlib DLL with BORLAND C++ 5.0 (thanks to Glenn Randers-Pehrson)
+- fix configure if CC is already equal to gcc
+
+Changes in 1.0.5 (3 Jan 98)
+- Fix inflate to terminate gracefully when fed corrupted or invalid data
+- Use const for rommable constants in inflate
+- Eliminate memory leaks on error conditions in inflate
+- Removed some vestigial code in inflate
+- Update web address in README
+
Changes in 1.0.4 (24 Jul 96)
- In very rare conditions, deflate(s, Z_FINISH) could fail to produce an EOF
bit, so the decompressor could decompress all the correct data but went
diff --git a/gnu/usr.bin/cvs/zlib/FAQ b/gnu/usr.bin/cvs/zlib/FAQ
new file mode 100644
index 00000000000..0feb6d3e9bb
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/FAQ
@@ -0,0 +1,72 @@
+
+ Frequently Asked Questions about zlib
+
+
+If your question is not there, please check the zlib home page
+http://www.cdrom.com/pub/infozip/zlib/ which may have more recent information.
+
+
+1) I need a Windows DLL
+2) I need a Visual Basic interface to zlib
+3) compress() returns Z_BUF_ERROR
+4) deflate or inflate returns Z_BUF_ERROR
+5) Where is the zlib documentation (man pages, etc...)?
+6) Why don't you use GNU autoconf, libtool, etc...?
+7) There is a bug in zlib.
+8) I get "undefined reference to gzputc"
+
+
+
+1) I need a Windows DLL
+
+ The zlib sources can be compiled without change to produce a DLL.
+ If you want a precompiled DLL, see http://www.winimage.com/zLibDll
+
+
+2) I need a Visual Basic interface to zlib
+
+ See http://www.tcfb.com/dowseware/cmp-z-it.zip
+ http://web2.airmail.net/markn/articles/zlibtool/zlibtool.htm
+ and contrib/visual-basic.txt
+
+3) compress() returns Z_BUF_ERROR
+
+ Make sure that before the call of compress, the length of the
+ compressed buffer is equal to the total size of the compressed buffer
+ and not zero. For Visual Basic, check that this parameter is passed
+ by reference ("as any"), not by value ("as long").
+
+
+4) deflate or inflate returns Z_BUF_ERROR
+
+ Make sure that before the call avail_in and avail_out are not zero.
+
+
+5) Where is the zlib documentation (man pages, etc...)?
+
+ It's in zlib.h for the moment. Volunteers to transform this
+ to man pages, please contact jloup@gzip.org. Examples of zlib usage
+ are in the files example.c and minigzip.c.
+
+
+6) Why don't you use GNU autoconf, libtool, etc...?
+
+ Because we would like to keep zlib as a very small and simple package.
+ zlib is rather portable and doesn't need much configuration.
+
+
+7) There is a bug in zlib.
+
+ Most of the time, such problems are due to an incorrect usage
+ of zlib. Please try to reproduce the problem with a small
+ program and send us the corresponding source at zlib@quest.jpl.nasa.gov
+ Do not send multi-megabyte data files without prior agreement.
+
+
+8) I get "undefined reference to gzputc"
+
+ If "make test" produces something like
+ example.o(.text+0x174):
+ check that you don't have old files libz.* in /usr/lib, /usr/local/lib
+ or /usr/X11R6/lib. Remove old versions then do "make install".
+
diff --git a/gnu/usr.bin/cvs/zlib/INDEX b/gnu/usr.bin/cvs/zlib/INDEX
index bb1e3f0b135..8a245766402 100644
--- a/gnu/usr.bin/cvs/zlib/INDEX
+++ b/gnu/usr.bin/cvs/zlib/INDEX
@@ -1,22 +1,35 @@
-ChangeLog history of changes
-INDEX this file
-Make_vms.com script for Vax/VMS
-Makefile makefile for Unix (generated by configure)
-Makefile.b32 makefile for Borland C++ 32-bit
-Makefile.bor makefile for Borland C/C++ 16-bit
-Makefile.dj2 makefile for DJGPP 2.x
-Makefile.in makefile for Unix (template for configure)
-Makefile.msc makefile for Microsoft C 16-bit
-Makefile.riscos makefile for RISCOS
-Makefile.sas makefile for Amiga SAS/C
-Makefile.tc makefile for Turbo C
-Makefile.wat makefile for Watcom C
-README guess what
-algorithm.doc description of the compression & decompression algorithms
-configure configure script for Unix
-descrip.mms makefile for Vax/VMS
-zlib.def definition file for Windows DLL
-zlib.rc definition file for Windows DLL
+ChangeLog history of changes
+INDEX this file
+FAQ Frequently Asked Questions about zlib
+Make_vms.com script for Vax/VMS
+Makefile makefile for Unix (generated by configure)
+Makefile.in makefile for Unix (template for configure)
+Makefile.riscos makefile for RISCOS
+README guess what
+algorithm.txt description of the (de)compression algorithm
+configure configure script for Unix
+descrip.mms makefile for Vax/VMS
+zlib.3 mini man page for zlib (volunteers to write full
+ man pages from zlib.h welcome. write to jloup@gzip.org)
+
+amiga/Makefile.sas makefile for Amiga SAS/C
+amiga/Makefile.pup makefile for Amiga powerUP SAS/C PPC
+
+msdos/Makefile.w32 makefile for Microsoft Visual C++ 32-bit
+msdos/Makefile.b32 makefile for Borland C++ 32-bit
+msdos/Makefile.bor makefile for Borland C/C++ 16-bit
+msdos/Makefile.dj2 makefile for DJGPP 2.x
+msdos/Makefile.emx makefile for EMX 0.9c (32-bit DOS/OS2)
+msdos/Makefile.msc makefile for Microsoft C 16-bit
+msdos/Makefile.tc makefile for Turbo C
+msdos/Makefile.wat makefile for Watcom C
+msdos/zlib.def definition file for Windows DLL
+msdos/zlib.rc definition file for Windows DLL
+
+nt/Makefile.nt makefile for Windows NT
+nt/zlib.dnt definition file for Windows NT DLL
+nt/Makefile.emx makefile for EMX 0.9c/RSXNT 1.41 (Win32 Intel)
+nt/Makefile.gcc makefile for Windows NT using GCC (mingw32)
zlib public header files (must be kept):
@@ -41,6 +54,7 @@ inftrees.c
inftrees.h
infutil.c
infutil.h
+maketree.c
trees.c
uncompr.c
zutil.c
@@ -49,3 +63,24 @@ zutil.h
source files for sample programs:
example.c
minigzip.c
+
+ unsupported contribution by third parties
+
+contrib/asm386/ by Gilles Vollant <info@winimage.com>
+ 386 asm code replacing longest_match().
+
+contrib/minizip/ by Gilles Vollant <info@winimage.com>
+ Mini zip and unzip based on zlib
+ See http://www.winimage.com/zLibDll/unzip.html
+
+contrib/iostream/ by Kevin Ruland <kevin@rodin.wustl.edu>
+ A C++ I/O streams interface to the zlib gz* functions
+
+contrib/iostream2/ by Tyge Løvset <Tyge.Lovset@cmr.no>
+ Another C++ I/O streams interface
+
+contrib/untgz/ by "Pedro A. Aranda Guti\irrez" <paag@tid.es>
+ A very simple tar.gz extractor using zlib
+
+contrib/visual-basic.txt by Carlos Rios <c_rios@sonda.cl>
+ How to use compress(), uncompress() and the gz* functions from VB.
diff --git a/gnu/usr.bin/cvs/zlib/Make_vms.com b/gnu/usr.bin/cvs/zlib/Make_vms.com
index 0008d00bb68..1c57e8f0e02 100644
--- a/gnu/usr.bin/cvs/zlib/Make_vms.com
+++ b/gnu/usr.bin/cvs/zlib/Make_vms.com
@@ -28,15 +28,15 @@ $ if f$search("SYS$SYSTEM:MMS.EXE").eqs.""
$ then
$ dele example.obj;*,minigzip.obj;*
$ CALL MAKE adler32.OBJ "CC ''CCOPT' adler32" -
- adler32.c zutil.h zlib.h zconf.h
+ adler32.c zlib.h zconf.h
$ CALL MAKE compress.OBJ "CC ''CCOPT' compress" -
compress.c zlib.h zconf.h
$ CALL MAKE crc32.OBJ "CC ''CCOPT' crc32" -
- crc32.c zutil.h zlib.h zconf.h
+ crc32.c zlib.h zconf.h
$ CALL MAKE deflate.OBJ "CC ''CCOPT' deflate" -
- deflatec.c deflate.h zutil.h zlib.h zconf.h
+ deflate.c deflate.h zutil.h zlib.h zconf.h
$ CALL MAKE gzio.OBJ "CC ''CCOPT' gzio" -
- gsio.c zutil.h zlib.h zconf.h
+ gzio.c zutil.h zlib.h zconf.h
$ CALL MAKE infblock.OBJ "CC ''CCOPT' infblock" -
infblock.c zutil.h zlib.h zconf.h infblock.h
$ CALL MAKE infcodes.OBJ "CC ''CCOPT' infcodes" -
diff --git a/gnu/usr.bin/cvs/zlib/Makefile.in b/gnu/usr.bin/cvs/zlib/Makefile.in
index 6d09f330809..ddb31207292 100644
--- a/gnu/usr.bin/cvs/zlib/Makefile.in
+++ b/gnu/usr.bin/cvs/zlib/Makefile.in
@@ -1,5 +1,5 @@
# Makefile for zlib
-# Copyright (C) 1995-1996 Jean-loup Gailly.
+# Copyright (C) 1995-1998 Jean-loup Gailly.
# For conditions of distribution and use, see copyright notice in zlib.h
srcdir = @srcdir@
@@ -9,6 +9,7 @@ VPATH = @srcdir@
# To compile and test, type:
# ./configure; make test
# The call of configure is optional if you don't have special requirements
+# If you wish to build zlib as a shared library, use: ./configure -s
# To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type:
# make install
@@ -25,43 +26,78 @@ CFLAGS=@CFLAGS@
LDFLAGS=@LDFLAGS@
LDSHARED=$(CC)
+CPP=$(CC) -E
-VER=1.0.4
+VER=1.1.3
LIBS=libz.a
+SHAREDLIB=libz.so
# For CVS, separate AR and ARFLAGS.
AR=ar
-RANLIB=ranlib
-TAR=tar
+RANLIB=@RANLIB@
+AMTAR=@AMTAR@
+SHELL=/bin/sh
prefix=@prefix@
exec_prefix = $(prefix)
+libdir = ${exec_prefix}/lib
+includedir = ${prefix}/include
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
+OBJA =
+# to use the asm code: make OBJA=match.o
+
TEST_OBJS = example.o minigzip.o
-# build_zlib.com added for CVS
-DISTFILES = README INDEX ChangeLog configure Makefile.*[a-z0-9] Make_vms.com \
- descrip.mms zlib.def zlib.rc algorithm.doc *.[ch] \
- build_zlib.com zlib.dsp .cvsignore
+DISTFILES = README FAQ INDEX ChangeLog configure Makefile.* *.[ch] *.mms \
+ algorithm.txt zlib.3 msdos/Make*[a-z0-9] msdos/zlib.def msdos/zlib.rc \
+ nt/Make*[a-z0-9] nt/zlib.dnt amiga/Make*.??? os2/M*.os2 os2/zlib.def \
+ contrib/RE*.contrib contrib/*.txt contrib/asm386/*.asm contrib/asm386/*.c \
+ contrib/asm386/*.bat contrib/asm386/zlibvc.d?? contrib/asm[56]86/*.?86 \
+ contrib/asm[56]86/*.S contrib/iostream/*.cpp \
+ contrib/iostream/*.h contrib/iostream2/*.h contrib/iostream2/*.cpp \
+ contrib/untgz/Makefile contrib/untgz/*.c contrib/untgz/*.w32 \
+ contrib/minizip/[CM]*[pe] contrib/minizip/*.[ch] contrib/minizip/*.[td]?? \
+ contrib/delphi*/*.??? \
+ Make_vms.com .cvsignore
+
+# for CVS's distdir & Makefile targets
+subdir = zlib
# For CVS, just build libz.a
all: libz.a
-test: all
- ./example
- echo hello world | ./minigzip | ./minigzip -d
+# To reenable make test
+all-original: all minigzip example
+
+check test: all-original
+ @LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
+ echo hello world | ./minigzip | ./minigzip -d || \
+ echo ' *** minigzip test FAILED ***' ; \
+ if ./example; then \
+ echo ' *** zlib test OK ***'; \
+ else \
+ echo ' *** zlib test FAILED ***'; \
+ fi
# For CVS, use an explict rc after $(AR).
-libz.a: $(OBJS)
- $(AR) rc $@ $(OBJS)
- -@ ($(RANLIB) $@ || true) 2>/dev/null
+libz.a: $(OBJS) $(OBJA)
+ $(AR) rc $@ $(OBJS) $(OBJA)
+ -@ ($(RANLIB) $@ || true) >/dev/null 2>&1
-libz.so.$(VER): $(OBJS)
+match.o: match.S
+ $(CPP) match.S > _match.s
+ $(CC) -c _match.s
+ mv _match.o match.o
+ rm -f _match.s
+
+$(SHAREDLIB).$(VER): $(OBJS)
$(LDSHARED) -o $@ $(OBJS)
- rm -f libz.so; ln -s $@ libz.so
+ rm -f $(SHAREDLIB) $(SHAREDLIB).1
+ ln -s $@ $(SHAREDLIB)
+ ln -s $@ $(SHAREDLIB).1
example: example.o $(LIBS)
$(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS) $(LIBS)
@@ -69,61 +105,122 @@ example: example.o $(LIBS)
minigzip: minigzip.o $(LIBS)
$(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS) $(LIBS)
-# For CVS, remove the install and uninstall targets.
-install:
+# For CVS, make install dependant on all and remove the uninstall target.
+install: all
uninstall:
.PHONY: install uninstall
+# Remove targets for CVS
+info:
+installcheck:
+.PHONY: info installcheck
+
+#install: $(LIBS)
+# -@if [ ! -d $(includedir) ]; then mkdir $(includedir); fi
+# -@if [ ! -d $(libdir) ]; then mkdir $(libdir); fi
+# cp zlib.h zconf.h $(includedir)
+# chmod 644 $(includedir)/zlib.h $(includedir)/zconf.h
+# cp $(LIBS) $(libdir)
+# cd $(libdir); chmod 755 $(LIBS)
+# -@(cd $(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1
+# cd $(libdir); if test -f $(SHAREDLIB).$(VER); then \
+# rm -f $(SHAREDLIB) $(SHAREDLIB).1; \
+# ln -s $(SHAREDLIB).$(VER) $(SHAREDLIB); \
+# ln -s $(SHAREDLIB).$(VER) $(SHAREDLIB).1; \
+# (ldconfig || true) >/dev/null 2>&1; \
+# fi
+# The ranlib in install is needed on NeXTSTEP which checks file times
+# ldconfig is for Linux
+
+#uninstall:
+# cd $(includedir); \
+# v=$(VER); \
+# if test -f zlib.h; then \
+# v=`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`; \
+# rm -f zlib.h zconf.h; \
+# fi; \
+# cd $(libdir); rm -f libz.a; \
+# if test -f $(SHAREDLIB).$$v; then \
+# rm -f $(SHAREDLIB).$$v $(SHAREDLIB) $(SHAREDLIB).1; \
+# fi
+
installdirs:
.PHONY: installdirs
+# distdir added for CVS.
+top_builddir = ..
+PACKAGE = @PACKAGE@
+VERSION = @VERSION@
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+distdir:
+ @d=$(srcdir); \
+ for file in `cd $$d; echo $(DISTFILES)`; do \
+ if test -d $(distdir)/`dirname $$file`; then \
+ :; \
+ else \
+ mkdir $(distdir)/`dirname $$file`; \
+ fi; \
+ if test -d $$d/$$file; then \
+ cp -pR $$d/$$file $(distdir) \
+ || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+.PHONY: distdir
+
# mostlyclean added for CVS.
-clean mostlyclean:
- rm -f *.o *~ example minigzip libz.a libz.so* foo.gz
+mostlyclean clean:
+ rm -f *.o *~ example minigzip libz.a libz.so* foo.gz so_locations \
+ _match.s maketree
+.PHONY: mostlyclean clean
-# distclean and realclean added for CVS.
-distclean realclean: clean
+# distclean and realclean and maintainer-clean added for CVS.
+distclean realclean maintainer-clean: clean
rm -f Makefile
-.PHONY: distclean realclean
-
-# dist-dir added for CVS.
-dist-dir:
- mkdir ${DISTDIR}
- for i in `cd $(srcdir); echo ${DISTFILES}`; do \
- ln $(srcdir)/$${i} ${DISTDIR}; \
- done
-.PHONY: dist-dir
-
-# ls added for CVS.
-ls:
- @echo $(DISTFILES)
-.PHONY: ls
+.PHONY: distclean realclean maintainer-clean
zip:
mv Makefile Makefile~; cp -p Makefile.in Makefile
+ rm -f test.c ztest*.c contrib/minizip/test.zip
v=`sed -n -e 's/\.//g' -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
zip -ul9 zlib$$v $(DISTFILES)
mv Makefile~ Makefile
dist:
mv Makefile Makefile~; cp -p Makefile.in Makefile
+ rm -f test.c ztest*.c contrib/minizip/test.zip
d=zlib-`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
rm -f $$d.tar.gz; \
if test ! -d ../$$d; then rm -f ../$$d; ln -s `pwd` ../$$d; fi; \
files=""; \
for f in $(DISTFILES); do files="$$files $$d/$$f"; done; \
cd ..; \
- GZIP=-9 $(TAR) chofz $$d/$$d.tar.gz $$files; \
+ GZIP=-9 $(AMTAR) chofz $$d/$$d.tar.gz $$files; \
if test ! -d $$d; then rm -f $$d; fi
mv Makefile~ Makefile
-tags:
- etags *.[ch]
+.PHONY: tags
+tags: TAGS
+
+TAGS:
+ tags=; \
+ here=`pwd`; \
+ list=`(echo *.[ch] && cd $(srcdir) && echo *.[ch]) |sort |uniq`; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+ || etags $(ETAGS_ARGS) $$tags $$unique $(LISP)
# Makefile target added for CVS.
-subdir = zlib
-Makefile: ../config.status Makefile.in
- cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
depend:
makedepend -- $(CFLAGS) -- *.[ch]
@@ -145,6 +242,6 @@ inflate.o: zutil.h zlib.h zconf.h infblock.h
inftrees.o: zutil.h zlib.h zconf.h inftrees.h
infutil.o: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h
minigzip.o: zlib.h zconf.h
-trees.o: deflate.h zutil.h zlib.h zconf.h
+trees.o: deflate.h zutil.h zlib.h zconf.h trees.h
uncompr.o: zlib.h zconf.h
zutil.o: zutil.h zlib.h zconf.h
diff --git a/gnu/usr.bin/cvs/zlib/Makefile.riscos b/gnu/usr.bin/cvs/zlib/Makefile.riscos
index 0f10aa8918c..d97f4492370 100644
--- a/gnu/usr.bin/cvs/zlib/Makefile.riscos
+++ b/gnu/usr.bin/cvs/zlib/Makefile.riscos
@@ -1,8 +1,9 @@
# Project: zlib_1_03
-
+# Patched for zlib 1.1.2 rw@shadow.org.uk 19980430
+# test works out-of-the-box, installs `somewhere' on demand
# Toolflags:
-CCflags = -c -depend !Depend -IC: -g -throwback -DRISCOS -fnah
+CCflags = -c -depend !Depend -IC: -g -throwback -DRISCOS -fah
C++flags = -c -depend !Depend -IC: -throwback
Linkflags = -aif -c++ -o $@
ObjAsmflags = -throwback -NoCache -depend !Depend
@@ -10,37 +11,141 @@ CMHGflags =
LibFileflags = -c -l -o $@
Squeezeflags = -o $@
+# change the line below to where _you_ want the library installed.
+libdest = lib:zlib
# Final targets:
-@.zlib_lib: @.o.adler32 @.o.compress @.o.crc32 @.o.deflate @.o.gzio \
+@.lib: @.o.adler32 @.o.compress @.o.crc32 @.o.deflate @.o.gzio \
@.o.infblock @.o.infcodes @.o.inffast @.o.inflate @.o.inftrees @.o.infutil @.o.trees \
- @.o.uncompress @.o.zutil
+ @.o.uncompr @.o.zutil
LibFile $(LibFileflags) @.o.adler32 @.o.compress @.o.crc32 @.o.deflate \
@.o.gzio @.o.infblock @.o.infcodes @.o.inffast @.o.inflate @.o.inftrees @.o.infutil \
- @.o.trees @.o.uncompress @.o.zutil
-@.test: @.tests.minigzip @.tests.example
- echo Please run "Test" in directory tests
-@.tests.minigzip: @.o.minigzip @.zlib_lib C:o.Stubs
- Link $(Linkflags) @.o.minigzip @.zlib_lib C:o.Stubs
-@.tests.example: @.o.example @.zlib_lib C:o.Stubs
- Link $(Linkflags) @.o.example @.zlib_lib C:o.Stubs
+ @.o.trees @.o.uncompr @.o.zutil
+test: @.minigzip @.example @.lib
+ @copy @.lib @.libc A~C~DF~L~N~P~Q~RS~TV
+ @echo running tests: hang on.
+ @/@.minigzip -f -9 libc
+ @/@.minigzip -d libc-gz
+ @/@.minigzip -f -1 libc
+ @/@.minigzip -d libc-gz
+ @/@.minigzip -h -9 libc
+ @/@.minigzip -d libc-gz
+ @/@.minigzip -h -1 libc
+ @/@.minigzip -d libc-gz
+ @/@.minigzip -9 libc
+ @/@.minigzip -d libc-gz
+ @/@.minigzip -1 libc
+ @/@.minigzip -d libc-gz
+ @diff @.lib @.libc
+ @echo that should have reported '@.lib and @.libc identical' if you have diff.
+ @/@.example @.fred @.fred
+ @echo that will have given lots of hello!'s.
+
+@.minigzip: @.o.minigzip @.lib C:o.Stubs
+ Link $(Linkflags) @.o.minigzip @.lib C:o.Stubs
+@.example: @.o.example @.lib C:o.Stubs
+ Link $(Linkflags) @.o.example @.lib C:o.Stubs
+install: @.lib
+ cdir $(libdest)
+ cdir $(libdest).h
+ @copy @.h.zlib $(libdest).h.zlib A~C~DF~L~N~P~Q~RS~TV
+ @copy @.h.zconf $(libdest).h.zconf A~C~DF~L~N~P~Q~RS~TV
+ @copy @.lib $(libdest).lib A~C~DF~L~N~P~Q~RS~TV
+ @echo okay, installed zlib in $(libdest)
+
+clean:; remove @.minigzip
+ remove @.example
+ remove @.libc
+ -wipe @.o.* F~r~cV
+ remove @.fred
# User-editable dependencies:
.c.o:
cc $(ccflags) -o $@ $<
# Static dependencies:
-@.o.example: @.tests.c.example
- cc $(ccflags) -o @.o.example @.tests.c.example
-@.o.minigzip: @.tests.c.minigzip
- cc $(ccflags) -o @.o.minigzip @.tests.c.minigzip
-
# Dynamic dependencies:
-o.minigzip: tests.c.minigzip
-o.minigzip: h.zlib
-o.minigzip: h.zconf
-o.example: tests.c.example
+o.example: c.example
o.example: h.zlib
o.example: h.zconf
+o.minigzip: c.minigzip
+o.minigzip: h.zlib
+o.minigzip: h.zconf
+o.adler32: c.adler32
+o.adler32: h.zlib
+o.adler32: h.zconf
+o.compress: c.compress
+o.compress: h.zlib
+o.compress: h.zconf
+o.crc32: c.crc32
+o.crc32: h.zlib
+o.crc32: h.zconf
+o.deflate: c.deflate
+o.deflate: h.deflate
+o.deflate: h.zutil
+o.deflate: h.zlib
+o.deflate: h.zconf
+o.gzio: c.gzio
+o.gzio: h.zutil
+o.gzio: h.zlib
+o.gzio: h.zconf
+o.infblock: c.infblock
+o.infblock: h.zutil
+o.infblock: h.zlib
+o.infblock: h.zconf
+o.infblock: h.infblock
+o.infblock: h.inftrees
+o.infblock: h.infcodes
+o.infblock: h.infutil
+o.infcodes: c.infcodes
+o.infcodes: h.zutil
+o.infcodes: h.zlib
+o.infcodes: h.zconf
+o.infcodes: h.inftrees
+o.infcodes: h.infblock
+o.infcodes: h.infcodes
+o.infcodes: h.infutil
+o.infcodes: h.inffast
+o.inffast: c.inffast
+o.inffast: h.zutil
+o.inffast: h.zlib
+o.inffast: h.zconf
+o.inffast: h.inftrees
+o.inffast: h.infblock
+o.inffast: h.infcodes
+o.inffast: h.infutil
+o.inffast: h.inffast
+o.inflate: c.inflate
+o.inflate: h.zutil
+o.inflate: h.zlib
+o.inflate: h.zconf
+o.inflate: h.infblock
+o.inftrees: c.inftrees
+o.inftrees: h.zutil
+o.inftrees: h.zlib
+o.inftrees: h.zconf
+o.inftrees: h.inftrees
+o.inftrees: h.inffixed
+o.infutil: c.infutil
+o.infutil: h.zutil
+o.infutil: h.zlib
+o.infutil: h.zconf
+o.infutil: h.infblock
+o.infutil: h.inftrees
+o.infutil: h.infcodes
+o.infutil: h.infutil
+o.trees: c.trees
+o.trees: h.deflate
+o.trees: h.zutil
+o.trees: h.zlib
+o.trees: h.zconf
+o.trees: h.trees
+o.uncompr: c.uncompr
+o.uncompr: h.zlib
+o.uncompr: h.zconf
+o.zutil: c.zutil
+o.zutil: h.zutil
+o.zutil: h.zlib
+o.zutil: h.zconf
diff --git a/gnu/usr.bin/cvs/zlib/README b/gnu/usr.bin/cvs/zlib/README
index 28adc90b218..8ff458799b9 100644
--- a/gnu/usr.bin/cvs/zlib/README
+++ b/gnu/usr.bin/cvs/zlib/README
@@ -1,74 +1,123 @@
-zlib 1.0.4 is a general purpose data compression library. All the code
-is reentrant (thread safe). The data format used by the zlib library
+zlib 1.1.3 is a general purpose data compression library. All the code
+is thread safe. The data format used by the zlib library
is described by RFCs (Request for Comments) 1950 to 1952 in the files
ftp://ds.internic.net/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate
format) and rfc1952.txt (gzip format). These documents are also available in
other formats from ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html
-All functions of the compression library are documented in the file
-zlib.h. A usage example of the library is given in the file example.c
-which also tests that the library is working correctly. Another
-example is given in the file minigzip.c. The compression library itself
-is composed of all source files except example.c and minigzip.c.
+All functions of the compression library are documented in the file zlib.h
+(volunteer to write man pages welcome, contact jloup@gzip.org). A usage
+example of the library is given in the file example.c which also tests that
+the library is working correctly. Another example is given in the file
+minigzip.c. The compression library itself is composed of all source files
+except example.c and minigzip.c.
To compile all files and run the test program, follow the instructions
given at the top of Makefile. In short "make test; make install"
-should work for most machines. For MSDOS, use one of the special
-makefiles such as Makefile.msc; for VMS, use Make_vms.com or descrip.mms.
-
-Questions about zlib should be sent to <zlib@quest.jpl.nasa.gov> or,
-if this fails, to the addresses given below in the Copyright section.
-The zlib home page is http://quest.jpl.nasa.gov/zlib/
-
-The changes made in version 1.0.4 are documented in the file ChangeLog.
-The main changes since 1.0.3 are:
-
-- In very rare conditions, deflate(s, Z_FINISH) could fail to produce an EOF
- bit, so the decompressor could decompress all the correct data but went
- on to attempt decompressing extra garbage data. This affected minigzip too.
-- zlibVersion and gzerror return const char* (needed for DLL)
-- port to RISCOS (no fdopen, no multiple dots, no unlink, no fileno)
-
+should work for most machines. For Unix: "configure; make test; make install"
+For MSDOS, use one of the special makefiles such as Makefile.msc.
+For VMS, use Make_vms.com or descrip.mms.
+
+Questions about zlib should be sent to <zlib@quest.jpl.nasa.gov>, or to
+Gilles Vollant <info@winimage.com> for the Windows DLL version.
+The zlib home page is http://www.cdrom.com/pub/infozip/zlib/
+The official zlib ftp site is ftp://ftp.cdrom.com/pub/infozip/zlib/
+Before reporting a problem, please check those sites to verify that
+you have the latest version of zlib; otherwise get the latest version and
+check whether the problem still exists or not.
+
+Mark Nelson <markn@tiny.com> wrote an article about zlib for the Jan. 1997
+issue of Dr. Dobb's Journal; a copy of the article is available in
+http://web2.airmail.net/markn/articles/zlibtool/zlibtool.htm
+
+The changes made in version 1.1.3 are documented in the file ChangeLog.
+The main changes since 1.1.2 are:
+
+- fix "an inflate input buffer bug that shows up on rare but persistent
+ occasions" (Mark)
+- fix gzread and gztell for concatenated .gz files (Didier Le Botlan)
+- fix gzseek(..., SEEK_SET) in write mode
+- fix crc check after a gzeek (Frank Faubert)
+- fix miniunzip when the last entry in a zip file is itself a zip file
+ (J Lillge)
+- add contrib/asm586 and contrib/asm686 (Brian Raiter)
+ See http://www.muppetlabs.com/~breadbox/software/assembly.html
+- add support for Delphi 3 in contrib/delphi (Bob Dellaca)
+- add support for C++Builder 3 and Delphi 3 in contrib/delphi2 (Davide Moretti)
+- do not exit prematurely in untgz if 0 at start of block (Magnus Holmgren)
+- use macro EXTERN instead of extern to support DLL for BeOS (Sander Stoks)
+- added a FAQ file
+
+plus many changes for portability.
+
+Unsupported third party contributions are provided in directory "contrib".
+
+A Java implementation of zlib is available in the Java Development Kit 1.1
+http://www.javasoft.com/products/JDK/1.1/docs/api/Package-java.util.zip.html
+See the zlib home page http://www.cdrom.com/pub/infozip/zlib/ for details.
A Perl interface to zlib written by Paul Marquess <pmarquess@bfsec.bt.co.uk>
is in the CPAN (Comprehensive Perl Archive Network) sites, such as:
ftp://ftp.cis.ufl.edu/pub/perl/CPAN/modules/by-module/Compress/Compress-Zlib*
+A Python interface to zlib written by A.M. Kuchling <amk@magnet.com>
+is available in Python 1.5 and later versions, see
+http://www.python.org/doc/lib/module-zlib.html
+
+A zlib binding for TCL written by Andreas Kupries <a.kupries@westend.com>
+is availlable at http://www.westend.com/~kupries/doc/trf/man/man.html
+
+An experimental package to read and write files in .zip format,
+written on top of zlib by Gilles Vollant <info@winimage.com>, is
+available at http://www.winimage.com/zLibDll/unzip.html
+and also in the contrib/minizip directory of zlib.
+
Notes for some targets:
-- For Turbo C the small model is supported only with reduced performance to
- avoid any far allocation; it was tested with -DMAX_WBITS=11 -DMAX_MEM_LEVEL=3
+- To build a Windows DLL version, include in a DLL project zlib.def, zlib.rc
+ and all .c files except example.c and minigzip.c; compile with -DZLIB_DLL
+ The zlib DLL support was initially done by Alessandro Iacopetti and is
+ now maintained by Gilles Vollant <info@winimage.com>. Check the zlib DLL
+ home page at http://www.winimage.com/zLibDll
+
+ From Visual Basic, you can call the DLL functions which do not take
+ a structure as argument: compress, uncompress and all gz* functions.
+ See contrib/visual-basic.txt for more information, or get
+ http://www.tcfb.com/dowseware/cmp-z-it.zip
-- For 64-bit Iris, deflate.c must be compiled without any optimization.
+- For 64-bit Irix, deflate.c must be compiled without any optimization.
With -O, one libpng test fails. The test works in 32 bit mode (with
- the -32 compiler flag). The compiler bug has been reported to SGI.
+ the -n32 compiler flag). The compiler bug has been reported to SGI.
- zlib doesn't work with gcc 2.6.3 on a DEC 3000/300LX under OSF/1 2.1
it works when compiled with cc.
-- zlib doesn't work on HP-UX 9.05 with one cc compiler (the one not
- accepting the -O option). It works with the other cc compiler.
+- on Digital Unix 4.0D (formely OSF/1) on AlphaServer, the cc option -std1
+ is necessary to get gzprintf working correctly. This is done by configure.
-- To build a Windows DLL version, include in a DLL project zlib.def, zlib.rc
- and all .c files except example.c and minigzip.c; compile with -DZLIB_DLL
- For help on building a zlib DLL, contact Alessandro Iacopetti
- <iaco@email.alessandria.alpcom.it> http://lisa.unial.it/iaco ,
- or contact Brad Clarke <bclarke@cyberus.ca>.
+- zlib doesn't work on HP-UX 9.05 with some versions of /bin/cc. It works
+ with other compilers. Use "make test" to check your compiler.
+
+- gzdopen is not supported on RISCOS, BEOS and by some Mac compilers.
+
+- For Turbo C the small model is supported only with reduced performance to
+ avoid any far allocation; it was tested with -DMAX_WBITS=11 -DMAX_MEM_LEVEL=3
-- gzdopen is not supported on RISCOS
+- For PalmOs, see http://www.cs.uit.no/~perm/PASTA/pilot/software.html
+ Per Harald Myrvang <perm@stud.cs.uit.no>
Acknowledgments:
The deflate format used by zlib was defined by Phil Katz. The deflate
- and zlib specifications were written by Peter Deutsch. Thanks to all the
+ and zlib specifications were written by L. Peter Deutsch. Thanks to all the
people who reported problems and suggested various improvements in zlib;
they are too numerous to cite here.
Copyright notice:
- (C) 1995-1996 Jean-loup Gailly and Mark Adler
+ (C) 1995-1998 Jean-loup Gailly and Mark Adler
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -87,7 +136,7 @@ Copyright notice:
3. This notice may not be removed or altered from any source distribution.
Jean-loup Gailly Mark Adler
- gzip@prep.ai.mit.edu madler@alumni.caltech.edu
+ jloup@gzip.org madler@alumni.caltech.edu
If you use the zlib library in a product, we would appreciate *not*
receiving lengthy legal documents to sign. The sources are provided
diff --git a/gnu/usr.bin/cvs/zlib/adler32.c b/gnu/usr.bin/cvs/zlib/adler32.c
index d651187e44b..803b831fa6e 100644
--- a/gnu/usr.bin/cvs/zlib/adler32.c
+++ b/gnu/usr.bin/cvs/zlib/adler32.c
@@ -1,9 +1,9 @@
/* adler32.c -- compute the Adler-32 checksum of a data stream
- * Copyright (C) 1995-1996 Mark Adler
+ * Copyright (C) 1995-1998 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
-/* $Id: adler32.c,v 1.1.1.1 1996/10/18 03:35:04 tholo Exp $ */
+/* @(#) $Id: adler32.c,v 1.1.1.2 2001/09/28 22:45:40 tholo Exp $ */
#include "zlib.h"
@@ -18,7 +18,7 @@
#define DO16(buf) DO8(buf,0); DO8(buf,8);
/* ========================================================================= */
-uLong adler32(adler, buf, len)
+uLong ZEXPORT adler32(adler, buf, len)
uLong adler;
const Bytef *buf;
uInt len;
diff --git a/gnu/usr.bin/cvs/zlib/algorithm.txt b/gnu/usr.bin/cvs/zlib/algorithm.txt
new file mode 100644
index 00000000000..cdc830b5deb
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/algorithm.txt
@@ -0,0 +1,213 @@
+1. Compression algorithm (deflate)
+
+The deflation algorithm used by gzip (also zip and zlib) is a variation of
+LZ77 (Lempel-Ziv 1977, see reference below). It finds duplicated strings in
+the input data. The second occurrence of a string is replaced by a
+pointer to the previous string, in the form of a pair (distance,
+length). Distances are limited to 32K bytes, and lengths are limited
+to 258 bytes. When a string does not occur anywhere in the previous
+32K bytes, it is emitted as a sequence of literal bytes. (In this
+description, `string' must be taken as an arbitrary sequence of bytes,
+and is not restricted to printable characters.)
+
+Literals or match lengths are compressed with one Huffman tree, and
+match distances are compressed with another tree. The trees are stored
+in a compact form at the start of each block. The blocks can have any
+size (except that the compressed data for one block must fit in
+available memory). A block is terminated when deflate() determines that
+it would be useful to start another block with fresh trees. (This is
+somewhat similar to the behavior of LZW-based _compress_.)
+
+Duplicated strings are found using a hash table. All input strings of
+length 3 are inserted in the hash table. A hash index is computed for
+the next 3 bytes. If the hash chain for this index is not empty, all
+strings in the chain are compared with the current input string, and
+the longest match is selected.
+
+The hash chains are searched starting with the most recent strings, to
+favor small distances and thus take advantage of the Huffman encoding.
+The hash chains are singly linked. There are no deletions from the
+hash chains, the algorithm simply discards matches that are too old.
+
+To avoid a worst-case situation, very long hash chains are arbitrarily
+truncated at a certain length, determined by a runtime option (level
+parameter of deflateInit). So deflate() does not always find the longest
+possible match but generally finds a match which is long enough.
+
+deflate() also defers the selection of matches with a lazy evaluation
+mechanism. After a match of length N has been found, deflate() searches for
+a longer match at the next input byte. If a longer match is found, the
+previous match is truncated to a length of one (thus producing a single
+literal byte) and the process of lazy evaluation begins again. Otherwise,
+the original match is kept, and the next match search is attempted only N
+steps later.
+
+The lazy match evaluation is also subject to a runtime parameter. If
+the current match is long enough, deflate() reduces the search for a longer
+match, thus speeding up the whole process. If compression ratio is more
+important than speed, deflate() attempts a complete second search even if
+the first match is already long enough.
+
+The lazy match evaluation is not performed for the fastest compression
+modes (level parameter 1 to 3). For these fast modes, new strings
+are inserted in the hash table only when no match was found, or
+when the match is not too long. This degrades the compression ratio
+but saves time since there are both fewer insertions and fewer searches.
+
+
+2. Decompression algorithm (inflate)
+
+2.1 Introduction
+
+The real question is, given a Huffman tree, how to decode fast. The most
+important realization is that shorter codes are much more common than
+longer codes, so pay attention to decoding the short codes fast, and let
+the long codes take longer to decode.
+
+inflate() sets up a first level table that covers some number of bits of
+input less than the length of longest code. It gets that many bits from the
+stream, and looks it up in the table. The table will tell if the next
+code is that many bits or less and how many, and if it is, it will tell
+the value, else it will point to the next level table for which inflate()
+grabs more bits and tries to decode a longer code.
+
+How many bits to make the first lookup is a tradeoff between the time it
+takes to decode and the time it takes to build the table. If building the
+table took no time (and if you had infinite memory), then there would only
+be a first level table to cover all the way to the longest code. However,
+building the table ends up taking a lot longer for more bits since short
+codes are replicated many times in such a table. What inflate() does is
+simply to make the number of bits in the first table a variable, and set it
+for the maximum speed.
+
+inflate() sends new trees relatively often, so it is possibly set for a
+smaller first level table than an application that has only one tree for
+all the data. For inflate, which has 286 possible codes for the
+literal/length tree, the size of the first table is nine bits. Also the
+distance trees have 30 possible values, and the size of the first table is
+six bits. Note that for each of those cases, the table ended up one bit
+longer than the ``average'' code length, i.e. the code length of an
+approximately flat code which would be a little more than eight bits for
+286 symbols and a little less than five bits for 30 symbols. It would be
+interesting to see if optimizing the first level table for other
+applications gave values within a bit or two of the flat code size.
+
+
+2.2 More details on the inflate table lookup
+
+Ok, you want to know what this cleverly obfuscated inflate tree actually
+looks like. You are correct that it's not a Huffman tree. It is simply a
+lookup table for the first, let's say, nine bits of a Huffman symbol. The
+symbol could be as short as one bit or as long as 15 bits. If a particular
+symbol is shorter than nine bits, then that symbol's translation is duplicated
+in all those entries that start with that symbol's bits. For example, if the
+symbol is four bits, then it's duplicated 32 times in a nine-bit table. If a
+symbol is nine bits long, it appears in the table once.
+
+If the symbol is longer than nine bits, then that entry in the table points
+to another similar table for the remaining bits. Again, there are duplicated
+entries as needed. The idea is that most of the time the symbol will be short
+and there will only be one table look up. (That's whole idea behind data
+compression in the first place.) For the less frequent long symbols, there
+will be two lookups. If you had a compression method with really long
+symbols, you could have as many levels of lookups as is efficient. For
+inflate, two is enough.
+
+So a table entry either points to another table (in which case nine bits in
+the above example are gobbled), or it contains the translation for the symbol
+and the number of bits to gobble. Then you start again with the next
+ungobbled bit.
+
+You may wonder: why not just have one lookup table for how ever many bits the
+longest symbol is? The reason is that if you do that, you end up spending
+more time filling in duplicate symbol entries than you do actually decoding.
+At least for deflate's output that generates new trees every several 10's of
+kbytes. You can imagine that filling in a 2^15 entry table for a 15-bit code
+would take too long if you're only decoding several thousand symbols. At the
+other extreme, you could make a new table for every bit in the code. In fact,
+that's essentially a Huffman tree. But then you spend two much time
+traversing the tree while decoding, even for short symbols.
+
+So the number of bits for the first lookup table is a trade of the time to
+fill out the table vs. the time spent looking at the second level and above of
+the table.
+
+Here is an example, scaled down:
+
+The code being decoded, with 10 symbols, from 1 to 6 bits long:
+
+A: 0
+B: 10
+C: 1100
+D: 11010
+E: 11011
+F: 11100
+G: 11101
+H: 11110
+I: 111110
+J: 111111
+
+Let's make the first table three bits long (eight entries):
+
+000: A,1
+001: A,1
+010: A,1
+011: A,1
+100: B,2
+101: B,2
+110: -> table X (gobble 3 bits)
+111: -> table Y (gobble 3 bits)
+
+Each entry is what the bits decode to and how many bits that is, i.e. how
+many bits to gobble. Or the entry points to another table, with the number of
+bits to gobble implicit in the size of the table.
+
+Table X is two bits long since the longest code starting with 110 is five bits
+long:
+
+00: C,1
+01: C,1
+10: D,2
+11: E,2
+
+Table Y is three bits long since the longest code starting with 111 is six
+bits long:
+
+000: F,2
+001: F,2
+010: G,2
+011: G,2
+100: H,2
+101: H,2
+110: I,3
+111: J,3
+
+So what we have here are three tables with a total of 20 entries that had to
+be constructed. That's compared to 64 entries for a single table. Or
+compared to 16 entries for a Huffman tree (six two entry tables and one four
+entry table). Assuming that the code ideally represents the probability of
+the symbols, it takes on the average 1.25 lookups per symbol. That's compared
+to one lookup for the single table, or 1.66 lookups per symbol for the
+Huffman tree.
+
+There, I think that gives you a picture of what's going on. For inflate, the
+meaning of a particular symbol is often more than just a letter. It can be a
+byte (a "literal"), or it can be either a length or a distance which
+indicates a base value and a number of bits to fetch after the code that is
+added to the base value. Or it might be the special end-of-block code. The
+data structures created in inftrees.c try to encode all that information
+compactly in the tables.
+
+
+Jean-loup Gailly Mark Adler
+jloup@gzip.org madler@alumni.caltech.edu
+
+
+References:
+
+[LZ77] Ziv J., Lempel A., ``A Universal Algorithm for Sequential Data
+Compression,'' IEEE Transactions on Information Theory, Vol. 23, No. 3,
+pp. 337-343.
+
+``DEFLATE Compressed Data Format Specification'' available in
+ftp://ds.internic.net/rfc/rfc1951.txt
diff --git a/gnu/usr.bin/cvs/zlib/amiga/Makefile.pup b/gnu/usr.bin/cvs/zlib/amiga/Makefile.pup
new file mode 100644
index 00000000000..6cfad1dc04a
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/amiga/Makefile.pup
@@ -0,0 +1,66 @@
+# Amiga powerUP (TM) Makefile
+# makefile for libpng and SAS C V6.58/7.00 PPC compiler
+# Copyright (C) 1998 by Andreas R. Kleinert
+
+CC = scppc
+CFLAGS = NOSTKCHK NOSINT OPTIMIZE OPTGO OPTPEEP OPTINLOCAL OPTINL \
+ OPTLOOP OPTRDEP=8 OPTDEP=8 OPTCOMP=8
+LIBNAME = libzip.a
+AR = ppc-amigaos-ar
+AR_FLAGS = cr
+RANLIB = ppc-amigaos-ranlib
+LDFLAGS = -r -o
+LDLIBS = LIB:scppc.a
+LN = ppc-amigaos-ld
+RM = delete quiet
+
+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
+
+TEST_OBJS = example.o minigzip.o
+
+all: example minigzip
+
+test: all
+ example
+ echo hello world | minigzip | minigzip -d
+
+$(LIBNAME): $(OBJS)
+ $(AR) $(AR_FLAGS) $@ $(OBJS)
+ $(RANLIB) $@
+
+example: example.o $(LIBNAME)
+ $(LN) $(LDFLAGS) example LIB:c_ppc.o example.o $(LIBNAME) $(LDLIBS) LIB:end.o
+
+minigzip: minigzip.o $(LIBNAME)
+ $(LN) $(LDFLAGS) minigzip LIB:c_ppc.o minigzip.o $(LIBNAME) $(LDLIBS) LIB:end.o
+
+clean:
+ $(RM) *.o example minigzip $(LIBNAME) foo.gz
+
+zip:
+ zip -ul9 zlib README ChangeLog Makefile Make????.??? Makefile.?? \
+ descrip.mms *.[ch]
+
+tgz:
+ cd ..; tar cfz zlib/zlib.tgz zlib/README zlib/ChangeLog zlib/Makefile \
+ zlib/Make????.??? zlib/Makefile.?? zlib/descrip.mms zlib/*.[ch]
+
+# DO NOT DELETE THIS LINE -- make depend depends on it.
+
+adler32.o: zutil.h zlib.h zconf.h
+compress.o: zlib.h zconf.h
+crc32.o: zutil.h zlib.h zconf.h
+deflate.o: deflate.h zutil.h zlib.h zconf.h
+example.o: zlib.h zconf.h
+gzio.o: zutil.h zlib.h zconf.h
+infblock.o: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h
+infcodes.o: zutil.h zlib.h zconf.h inftrees.h infutil.h infcodes.h inffast.h
+inffast.o: zutil.h zlib.h zconf.h inftrees.h infutil.h inffast.h
+inflate.o: zutil.h zlib.h zconf.h infblock.h
+inftrees.o: zutil.h zlib.h zconf.h inftrees.h
+infutil.o: zutil.h zlib.h zconf.h inftrees.h infutil.h
+minigzip.o: zlib.h zconf.h
+trees.o: deflate.h zutil.h zlib.h zconf.h
+uncompr.o: zlib.h zconf.h
+zutil.o: zutil.h zlib.h zconf.h
diff --git a/gnu/usr.bin/cvs/zlib/amiga/Makefile.sas b/gnu/usr.bin/cvs/zlib/amiga/Makefile.sas
new file mode 100644
index 00000000000..5323e821708
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/amiga/Makefile.sas
@@ -0,0 +1,64 @@
+# SMakefile for zlib
+# Modified from the standard UNIX Makefile Copyright Jean-loup Gailly
+# Osma Ahvenlampi <Osma.Ahvenlampi@hut.fi>
+# Amiga, SAS/C 6.56 & Smake
+
+CC=sc
+CFLAGS=OPT
+#CFLAGS=OPT CPU=68030
+#CFLAGS=DEBUG=LINE
+LDFLAGS=LIB z.lib
+
+SCOPTIONS=OPTSCHED OPTINLINE OPTALIAS OPTTIME OPTINLOCAL STRMERGE \
+ NOICONS PARMS=BOTH NOSTACKCHECK UTILLIB NOVERSION ERRORREXX
+
+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
+
+TEST_OBJS = example.o minigzip.o
+
+all: SCOPTIONS example minigzip
+
+test: all
+ `cd`/example
+ echo hello world | minigzip | minigzip -d
+
+install: z.lib
+ copy zlib.h zconf.h INCLUDE: clone
+ copy z.lib LIB: clone
+
+z.lib: $(OBJS)
+ oml z.lib r $(OBJS)
+
+example: example.o z.lib
+ $(CC) $(CFLAGS) LINK TO $@ example.o $(LDFLAGS)
+
+minigzip: minigzip.o z.lib
+ $(CC) $(CFLAGS) LINK TO $@ minigzip.o $(LDFLAGS)
+
+clean:
+ -delete force quiet *.o example minigzip z.lib foo.gz *.lnk SCOPTIONS
+
+SCOPTIONS: Smakefile
+ copy to $@ <from <
+$(SCOPTIONS)
+<
+
+# DO NOT DELETE THIS LINE -- make depend depends on it.
+
+adler32.o: zutil.h zlib.h zconf.h
+compress.o: zlib.h zconf.h
+crc32.o: zutil.h zlib.h zconf.h
+deflate.o: deflate.h zutil.h zlib.h zconf.h
+example.o: zlib.h zconf.h
+gzio.o: zutil.h zlib.h zconf.h
+infblock.o: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h
+infcodes.o: zutil.h zlib.h zconf.h inftrees.h infutil.h infcodes.h inffast.h
+inffast.o: zutil.h zlib.h zconf.h inftrees.h infutil.h inffast.h
+inflate.o: zutil.h zlib.h zconf.h infblock.h
+inftrees.o: zutil.h zlib.h zconf.h inftrees.h
+infutil.o: zutil.h zlib.h zconf.h inftrees.h infutil.h
+minigzip.o: zlib.h zconf.h
+trees.o: deflate.h zutil.h zlib.h zconf.h
+uncompr.o: zlib.h zconf.h
+zutil.o: zutil.h zlib.h zconf.h
diff --git a/gnu/usr.bin/cvs/zlib/compress.c b/gnu/usr.bin/cvs/zlib/compress.c
index 6f8c42ff684..11919eef0e7 100644
--- a/gnu/usr.bin/cvs/zlib/compress.c
+++ b/gnu/usr.bin/cvs/zlib/compress.c
@@ -1,29 +1,29 @@
/* compress.c -- compress a memory buffer
- * Copyright (C) 1995-1996 Jean-loup Gailly.
+ * Copyright (C) 1995-1998 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
-/* $Id: compress.c,v 1.1.1.1 1996/10/18 03:35:04 tholo Exp $ */
+/* @(#) $Id: compress.c,v 1.1.1.2 2001/09/28 22:45:40 tholo Exp $ */
#include "zlib.h"
/* ===========================================================================
- Compresses the source buffer into the destination buffer. sourceLen is
- the byte length of the source buffer. Upon entry, destLen is the total
- size of the destination buffer, which must be at least 0.1% larger than
- sourceLen plus 8 bytes. Upon exit, destLen is the actual size of the
- compressed buffer.
- This function can be used to compress a whole file at once if the
- input file is mmap'ed.
- compress returns Z_OK if success, Z_MEM_ERROR if there was not
- enough memory, Z_BUF_ERROR if there was not enough room in the output
- buffer.
+ Compresses the source buffer into the destination buffer. The level
+ parameter has the same meaning as in deflateInit. sourceLen is the byte
+ length of the source buffer. Upon entry, destLen is the total size of the
+ destination buffer, which must be at least 0.1% larger than sourceLen plus
+ 12 bytes. Upon exit, destLen is the actual size of the compressed buffer.
+
+ compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_BUF_ERROR if there was not enough room in the output buffer,
+ Z_STREAM_ERROR if the level parameter is invalid.
*/
-int compress (dest, destLen, source, sourceLen)
+int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
Bytef *dest;
uLongf *destLen;
const Bytef *source;
uLong sourceLen;
+ int level;
{
z_stream stream;
int err;
@@ -42,7 +42,7 @@ int compress (dest, destLen, source, sourceLen)
stream.zfree = (free_func)0;
stream.opaque = (voidpf)0;
- err = deflateInit(&stream, Z_DEFAULT_COMPRESSION);
+ err = deflateInit(&stream, level);
if (err != Z_OK) return err;
err = deflate(&stream, Z_FINISH);
@@ -55,3 +55,14 @@ int compress (dest, destLen, source, sourceLen)
err = deflateEnd(&stream);
return err;
}
+
+/* ===========================================================================
+ */
+int ZEXPORT compress (dest, destLen, source, sourceLen)
+ Bytef *dest;
+ uLongf *destLen;
+ const Bytef *source;
+ uLong sourceLen;
+{
+ return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION);
+}
diff --git a/gnu/usr.bin/cvs/zlib/configure b/gnu/usr.bin/cvs/zlib/configure
index a354e4cf407..e8942359bc1 100644
--- a/gnu/usr.bin/cvs/zlib/configure
+++ b/gnu/usr.bin/cvs/zlib/configure
@@ -4,42 +4,96 @@
# of if you need special compiler, flags or install directory.
# Otherwise, you can just use directly "make test; make install"
#
+# To create a shared library, use "configure --shared"; by default a static
+# library is created. If the primitive shared library support provided here
+# does not work, use ftp://prep.ai.mit.edu/pub/gnu/libtool-*.tar.gz
+#
# To impose specific compiler or flags or install directory, use for example:
# prefix=$HOME CC=cc CFLAGS="-O4" ./configure
# or for csh/tcsh users:
# (setenv prefix $HOME; setenv CC cc; setenv CFLAGS "-O4"; ./configure)
# LDSHARED is the command to be used to create a shared library
+# Incorrect settings of CC or CFLAGS may prevent creating a shared library.
+# If you have problems, try without defining CC and CFLAGS before reporting
+# an error.
+
LIBS=libz.a
+SHAREDLIB=libz.so
VER=`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`
AR=${AR-"ar rc"}
RANLIB=${RANLIB-"ranlib"}
prefix=${prefix-/usr/local}
-exec_prefix=${exec_prefix-$prefix}
+exec_prefix=${exec_prefix-'${prefix}'}
+libdir=${libdir-'${exec_prefix}/lib'}
+includedir=${includedir-'${prefix}/include'}
+shared_ext='.so'
+shared=0
+gcc=0
+old_cc="$CC"
+old_cflags="$CFLAGS"
+
+while test $# -ge 1
+do
+case "$1" in
+ -h* | --h*)
+ echo 'usage:'
+ echo ' configure [--shared] [--prefix=PREFIX] [--exec_prefix=EXPREFIX]'
+ echo ' [--libdir=LIBDIR] [--includedir=INCLUDEDIR]'
+ exit 0;;
+ -p*=* | --p*=*) prefix=`echo $1 | sed 's/[-a-z_]*=//'`; shift;;
+ -e*=* | --e*=*) exec_prefix=`echo $1 | sed 's/[-a-z_]*=//'`; shift;;
+ -l*=* | --libdir=*) libdir=`echo $1 | sed 's/[-a-z_]*=//'`; shift;;
+ -i*=* | --includedir=*) includedir=`echo $1 | sed 's/[-a-z_]*=//'`;shift;;
+ -p* | --p*) prefix="$2"; shift; shift;;
+ -e* | --e*) exec_prefix="$2"; shift; shift;;
+ -l* | --l*) libdir="$2"; shift; shift;;
+ -i* | --i*) includedir="$2"; shift; shift;;
+ -s* | --s*) shared=1; shift;;
+ esac
+done
-test -z "$CC" && echo Checking for gcc...
test=ztest$$
cat > $test.c <<EOF
-int hello() { printf("hello\n"); }
+extern int getchar();
+int hello() {return getchar();}
EOF
-if test -z "$CC" && (gcc -c -O3 $test.c) 2>/dev/null; then
- CC=gcc
+
+test -z "$CC" && echo Checking for gcc...
+cc=${CC-gcc}
+cflags=${CFLAGS-"-O3"}
+# to force the asm version use: CFLAGS="-O3 -DASMV" ./configure
+case "$cc" in
+ *gcc*) gcc=1;;
+esac
+
+if test "$gcc" -eq 1 && ($cc -c $cflags $test.c) 2>/dev/null; then
+ CC="$cc"
SFLAGS=${CFLAGS-"-fPIC -O3"}
- CFLAGS=${CFLAGS-"-O3"}
- LDSHARED=${LDSHARED-"gcc -shared"}
+ CFLAGS="$cflags"
+ case `(uname -s || echo unknown) 2>/dev/null` in
+ Linux | linux) LDSHARED=${LDSHARED-"gcc -shared -Wl,-soname,libz.so.1"};;
+ *) LDSHARED=${LDSHARED-"gcc -shared"};;
+ esac
else
# find system name and corresponding cc options
CC=${CC-cc}
case `(uname -sr || echo unknown) 2>/dev/null` in
- SunOS\ 5*) SFLAGS=${CFLAGS-"-fast -xcg89 -KPIC -R."}
- CFLAGS=${CFLAGS-"-fast -xcg89"}
- LDSHARED=${LDSHARED-"cc -G"};;
- SunOS\ 4*) SFLAGS=${CFLAGS-"-O2 -PIC"}
- CFLAGS=${CFLAGS-"-O2"}
- LDSHARED=${LDSHARED-"ld"};;
+ HP-UX*) SFLAGS=${CFLAGS-"-O +z"}
+ CFLAGS=${CFLAGS-"-O"}
+# LDSHARED=${LDSHARED-"ld -b +vnocompatwarnings"}
+ LDSHARED=${LDSHARED-"ld -b"}
+ shared_ext='.sl'
+ SHAREDLIB='libz.sl';;
IRIX*) SFLAGS=${CFLAGS-"-ansi -O2 -rpath ."}
CFLAGS=${CFLAGS-"-ansi -O2"}
LDSHARED=${LDSHARED-"cc -shared"};;
+ OSF1\ V4*) SFLAGS=${CFLAGS-"-O -std1"}
+ CFLAGS=${CFLAGS-"-O -std1"}
+ LDSHARED=${LDSHARED-"cc -shared -Wl,-soname,$SHAREDLIB -Wl,-msym -Wl,-rpath,$(libdir) -Wl,-set_version,${VER}:1.0"};;
+ OSF1*) SFLAGS=${CFLAGS-"-O -std1"}
+ CFLAGS=${CFLAGS-"-O -std1"}
+ LDSHARED=${LDSHARED-"cc -shared"};;
QNX*) SFLAGS=${CFLAGS-"-4 -O"}
CFLAGS=${CFLAGS-"-4 -O"}
LDSHARED=${LDSHARED-"cc"}
@@ -48,39 +102,111 @@ else
SCO_SV\ 3.2*) SFLAGS=${CFLAGS-"-O3 -dy -KPIC "}
CFLAGS=${CFLAGS-"-O3"}
LDSHARED=${LDSHARED-"cc -dy -KPIC -G"};;
- HP-UX*) SFLAGS=${CFLAGS-"-O +z"}
+ SunOS\ 5*) SFLAGS=${CFLAGS-"-fast -xcg89 -KPIC -R."}
+ CFLAGS=${CFLAGS-"-fast -xcg89"}
+ LDSHARED=${LDSHARED-"cc -G"};;
+ SunOS\ 4*) SFLAGS=${CFLAGS-"-O2 -PIC"}
+ CFLAGS=${CFLAGS-"-O2"}
+ LDSHARED=${LDSHARED-"ld"};;
+ UNIX_System_V\ 4.2.0)
+ SFLAGS=${CFLAGS-"-KPIC -O"}
CFLAGS=${CFLAGS-"-O"}
- LDSHARED=${LDSHARED-"ld -b"}
- SHAREDLIBS='libz.sl';;
- # send working options for other systems to gzip@prep.ai.mit.edu
+ LDSHARED=${LDSHARED-"cc -G"};;
+ UNIX_SV\ 4.2MP)
+ SFLAGS=${CFLAGS-"-Kconform_pic -O"}
+ CFLAGS=${CFLAGS-"-O"}
+ LDSHARED=${LDSHARED-"cc -G"};;
+ # send working options for other systems to support@gzip.org
*) SFLAGS=${CFLAGS-"-O"}
CFLAGS=${CFLAGS-"-O"}
LDSHARED=${LDSHARED-"cc -shared"};;
esac
fi
-echo Checking for shared library support...
-# we must test in two steps (cc then ld), required at least on SunOS 4.x
-if test "`($CC -c $SFLAGS $test.c) 2>&1`" = "" &&
- test "`($LDSHARED -o $test.so $test.o) 2>&1`" = ""; then
- CFLAGS="$SFLAGS"
- LIBS='libz.so.$(VER)'
- echo Building shared library libz.so.$VER with $CC.
-else
+if test $shared -eq 1; then
+ echo Checking for shared library support...
+ # we must test in two steps (cc then ld), required at least on SunOS 4.x
+ if test "`($CC -c $SFLAGS $test.c) 2>&1`" = "" &&
+ test "`($LDSHARED -o $test$shared_ext $test.o) 2>&1`" = ""; then
+ CFLAGS="$SFLAGS"
+ LIBS="$SHAREDLIB.$VER"
+ echo Building shared library $SHAREDLIB.$VER with $CC.
+ elif test -z "$old_cc" -a -z "$old_cflags"; then
+ echo No shared library suppport.
+ shared=0;
+ else
+ echo 'No shared library suppport; try without defining CC and CFLAGS'
+ shared=0;
+ fi
+fi
+if test $shared -eq 0; then
LDSHARED="$CC"
echo Building static library $LIBS version $VER with $CC.
fi
-rm -f $test.[co] $test.so
+
+cat > $test.c <<EOF
+#include <unistd.h>
+int main() { return 0; }
+EOF
+if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
+ CFLAGS="$CFLAGS -DHAVE_UNISTD_H"
+ echo "Checking for unistd.h... Yes."
+else
+ echo "Checking for unistd.h... No."
+fi
+
+cat > $test.c <<EOF
+#include <errno.h>
+int main() { return 0; }
+EOF
+if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
+ echo "Checking for errno.h... Yes."
+else
+ echo "Checking for errno.h... No."
+ CFLAGS="$CFLAGS -DNO_ERRNO_H"
+fi
+
+cat > $test.c <<EOF
+#include <sys/types.h>
+#include <sys/mman.h>
+#include <sys/stat.h>
+caddr_t hello() {
+ return mmap((caddr_t)0, (off_t)0, PROT_READ, MAP_SHARED, 0, (off_t)0);
+}
+EOF
+if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
+ CFLAGS="$CFLAGS -DUSE_MMAP"
+ echo Checking for mmap support... Yes.
+else
+ echo Checking for mmap support... No.
+fi
+
+CPP=${CPP-"$CC -E"}
+case $CFLAGS in
+ *ASMV*)
+ if test "`nm $test.o | grep _hello`" = ""; then
+ CPP="$CPP -DNO_UNDERLINE"
+ echo Checking for underline in external names... No.
+ else
+ echo Checking for underline in external names... Yes.
+ fi;;
+esac
+
+rm -f $test.[co] $test$shared_ext
# udpate Makefile
sed < Makefile.in "
-/^CC *=/s/=.*/=$CC/
-/^CFLAGS *=/s/=.*/=$CFLAGS/
-/^LDSHARED *=/s/=.*/=$LDSHARED/
-/^LIBS *=/s,=.*,=$LIBS,
-/^AR *=/s/=.*/=$AR/
-/^RANLIB *=/s,=.*,=$RANLIB,
-/^VER *=/s/=.*/=$VER/
-/^prefix *=/s,=.*,=$prefix,
-/^exec_prefix *=/s,=.*,=$exec_prefix,
+/^CC *=/s%=.*%=$CC%
+/^CFLAGS *=/s%=.*%=$CFLAGS%
+/^CPP *=/s%=.*%=$CPP%
+/^LDSHARED *=/s%=.*%=$LDSHARED%
+/^LIBS *=/s%=.*%=$LIBS%
+/^SHAREDLIB *=/s%=.*%=$SHAREDLIB%
+/^AR *=/s%=.*%=$AR%
+/^RANLIB *=/s%=.*%=$RANLIB%
+/^VER *=/s%=.*%=$VER%
+/^prefix *=/s%=.*%=$prefix%
+/^exec_prefix *=/s%=.*%=$exec_prefix%
+/^libdir *=/s%=.*%=$libdir%
+/^includedir *=/s%=.*%=$includedir%
" > Makefile
diff --git a/gnu/usr.bin/cvs/zlib/contrib/README.contrib b/gnu/usr.bin/cvs/zlib/contrib/README.contrib
new file mode 100644
index 00000000000..7ad191cf598
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/contrib/README.contrib
@@ -0,0 +1,34 @@
+All files under this contrib directory are UNSUPPORTED. There were
+provided by users of zlib and were not tested by the authors of zlib.
+Use at your own risk. Please contact the authors of the contributions
+for help about these, not the zlib authors. Thanks.
+
+
+asm386/ by Gilles Vollant <info@winimage.com>
+ 386 asm code replacing longest_match(), for Visual C++ 4.2 and ML 6.11c
+
+asm586/ and asm686/ by Brian Raiter <breadbox@muppetlabs.com>
+ asm code for Pentium and Pentium Pro
+ See http://www.muppetlabs.com/~breadbox/software/assembly.html
+
+delphi/ by Bob Dellaca <bobdl@xtra.co.nz>
+ Support for Delphi
+
+delphi2/ by Davide Moretti <dave@rimini.com>
+ Another support for C++Builder and Delphi
+
+minizip/ by Gilles Vollant <info@winimage.com>
+ Mini zip and unzip based on zlib
+ See http://www.winimage.com/zLibDll/unzip.html
+
+iostream/ by Kevin Ruland <kevin@rodin.wustl.edu>
+ A C++ I/O streams interface to the zlib gz* functions
+
+iostream2/ by Tyge Løvset <Tyge.Lovset@cmr.no>
+ Another C++ I/O streams interface
+
+untgz/ by "Pedro A. Aranda Guti\irrez" <paag@tid.es>
+ A very simple tar.gz file extractor using zlib
+
+visual-basic.txt by Carlos Rios <c_rios@sonda.cl>
+ How to use compress(), uncompress() and the gz* functions from VB.
diff --git a/gnu/usr.bin/cvs/zlib/contrib/asm386/gvmat32.asm b/gnu/usr.bin/cvs/zlib/contrib/asm386/gvmat32.asm
new file mode 100644
index 00000000000..28d527f47f8
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/contrib/asm386/gvmat32.asm
@@ -0,0 +1,559 @@
+;
+; gvmat32.asm -- Asm portion of the optimized longest_match for 32 bits x86
+; Copyright (C) 1995-1996 Jean-loup Gailly and Gilles Vollant.
+; File written by Gilles Vollant, by modifiying the longest_match
+; from Jean-loup Gailly in deflate.c
+; It need wmask == 0x7fff
+; (assembly code is faster with a fixed wmask)
+;
+; For Visual C++ 4.2 and ML 6.11c (version in directory \MASM611C of Win95 DDK)
+; I compile with : "ml /coff /Zi /c gvmat32.asm"
+;
+
+;uInt longest_match_7fff(s, cur_match)
+; deflate_state *s;
+; IPos cur_match; /* current match */
+
+ NbStack equ 76
+ cur_match equ dword ptr[esp+NbStack-0]
+ str_s equ dword ptr[esp+NbStack-4]
+; 5 dword on top (ret,ebp,esi,edi,ebx)
+ adrret equ dword ptr[esp+NbStack-8]
+ pushebp equ dword ptr[esp+NbStack-12]
+ pushedi equ dword ptr[esp+NbStack-16]
+ pushesi equ dword ptr[esp+NbStack-20]
+ pushebx equ dword ptr[esp+NbStack-24]
+
+ chain_length equ dword ptr [esp+NbStack-28]
+ limit equ dword ptr [esp+NbStack-32]
+ best_len equ dword ptr [esp+NbStack-36]
+ window equ dword ptr [esp+NbStack-40]
+ prev equ dword ptr [esp+NbStack-44]
+ scan_start equ word ptr [esp+NbStack-48]
+ wmask equ dword ptr [esp+NbStack-52]
+ match_start_ptr equ dword ptr [esp+NbStack-56]
+ nice_match equ dword ptr [esp+NbStack-60]
+ scan equ dword ptr [esp+NbStack-64]
+
+ windowlen equ dword ptr [esp+NbStack-68]
+ match_start equ dword ptr [esp+NbStack-72]
+ strend equ dword ptr [esp+NbStack-76]
+ NbStackAdd equ (NbStack-24)
+
+ .386p
+
+ name gvmatch
+ .MODEL FLAT
+
+
+
+; all the +4 offsets are due to the addition of pending_buf_size (in zlib
+; in the deflate_state structure since the asm code was first written
+; (if you compile with zlib 1.0.4 or older, remove the +4).
+; Note : these value are good with a 8 bytes boundary pack structure
+ dep_chain_length equ 70h+4
+ dep_window equ 2ch+4
+ dep_strstart equ 60h+4
+ dep_prev_length equ 6ch+4
+ dep_nice_match equ 84h+4
+ dep_w_size equ 20h+4
+ dep_prev equ 34h+4
+ dep_w_mask equ 28h+4
+ dep_good_match equ 80h+4
+ dep_match_start equ 64h+4
+ dep_lookahead equ 68h+4
+
+
+_TEXT segment
+
+IFDEF NOUNDERLINE
+ public longest_match_7fff
+; public match_init
+ELSE
+ public _longest_match_7fff
+; public _match_init
+ENDIF
+
+ MAX_MATCH equ 258
+ MIN_MATCH equ 3
+ MIN_LOOKAHEAD equ (MAX_MATCH+MIN_MATCH+1)
+
+
+
+IFDEF NOUNDERLINE
+;match_init proc near
+; ret
+;match_init endp
+ELSE
+;_match_init proc near
+; ret
+;_match_init endp
+ENDIF
+
+
+IFDEF NOUNDERLINE
+longest_match_7fff proc near
+ELSE
+_longest_match_7fff proc near
+ENDIF
+
+ mov edx,[esp+4]
+
+
+
+ push ebp
+ push edi
+ push esi
+ push ebx
+
+ sub esp,NbStackAdd
+
+; initialize or check the variables used in match.asm.
+ mov ebp,edx
+
+; chain_length = s->max_chain_length
+; if (prev_length>=good_match) chain_length >>= 2
+ mov edx,[ebp+dep_chain_length]
+ mov ebx,[ebp+dep_prev_length]
+ cmp [ebp+dep_good_match],ebx
+ ja noshr
+ shr edx,2
+noshr:
+; we increment chain_length because in the asm, the --chain_lenght is in the beginning of the loop
+ inc edx
+ mov edi,[ebp+dep_nice_match]
+ mov chain_length,edx
+ mov eax,[ebp+dep_lookahead]
+ cmp eax,edi
+; if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead;
+ jae nolookaheadnicematch
+ mov edi,eax
+nolookaheadnicematch:
+; best_len = s->prev_length
+ mov best_len,ebx
+
+; window = s->window
+ mov esi,[ebp+dep_window]
+ mov ecx,[ebp+dep_strstart]
+ mov window,esi
+
+ mov nice_match,edi
+; scan = window + strstart
+ add esi,ecx
+ mov scan,esi
+; dx = *window
+ mov dx,word ptr [esi]
+; bx = *(window+best_len-1)
+ mov bx,word ptr [esi+ebx-1]
+ add esi,MAX_MATCH-1
+; scan_start = *scan
+ mov scan_start,dx
+; strend = scan + MAX_MATCH-1
+ mov strend,esi
+; bx = scan_end = *(window+best_len-1)
+
+; IPos limit = s->strstart > (IPos)MAX_DIST(s) ?
+; s->strstart - (IPos)MAX_DIST(s) : NIL;
+
+ mov esi,[ebp+dep_w_size]
+ sub esi,MIN_LOOKAHEAD
+; here esi = MAX_DIST(s)
+ sub ecx,esi
+ ja nodist
+ xor ecx,ecx
+nodist:
+ mov limit,ecx
+
+; prev = s->prev
+ mov edx,[ebp+dep_prev]
+ mov prev,edx
+
+;
+ mov edx,dword ptr [ebp+dep_match_start]
+ mov bp,scan_start
+ mov eax,cur_match
+ mov match_start,edx
+
+ mov edx,window
+ mov edi,edx
+ add edi,best_len
+ mov esi,prev
+ dec edi
+; windowlen = window + best_len -1
+ mov windowlen,edi
+
+ jmp beginloop2
+ align 4
+
+; here, in the loop
+; eax = ax = cur_match
+; ecx = limit
+; bx = scan_end
+; bp = scan_start
+; edi = windowlen (window + best_len -1)
+; esi = prev
+
+
+;// here; chain_length <=16
+normalbeg0add16:
+ add chain_length,16
+ jz exitloop
+normalbeg0:
+ cmp word ptr[edi+eax],bx
+ je normalbeg2noroll
+rcontlabnoroll:
+; cur_match = prev[cur_match & wmask]
+ and eax,7fffh
+ mov ax,word ptr[esi+eax*2]
+; if cur_match > limit, go to exitloop
+ cmp ecx,eax
+ jnb exitloop
+; if --chain_length != 0, go to exitloop
+ dec chain_length
+ jnz normalbeg0
+ jmp exitloop
+
+normalbeg2noroll:
+; if (scan_start==*(cur_match+window)) goto normalbeg2
+ cmp bp,word ptr[edx+eax]
+ jne rcontlabnoroll
+ jmp normalbeg2
+
+contloop3:
+ mov edi,windowlen
+
+; cur_match = prev[cur_match & wmask]
+ and eax,7fffh
+ mov ax,word ptr[esi+eax*2]
+; if cur_match > limit, go to exitloop
+ cmp ecx,eax
+jnbexitloopshort1:
+ jnb exitloop
+; if --chain_length != 0, go to exitloop
+
+
+; begin the main loop
+beginloop2:
+ sub chain_length,16+1
+; if chain_length <=16, don't use the unrolled loop
+ jna normalbeg0add16
+
+do16:
+ cmp word ptr[edi+eax],bx
+ je normalbeg2dc0
+
+maccn MACRO lab
+ and eax,7fffh
+ mov ax,word ptr[esi+eax*2]
+ cmp ecx,eax
+ jnb exitloop
+ cmp word ptr[edi+eax],bx
+ je lab
+ ENDM
+
+rcontloop0:
+ maccn normalbeg2dc1
+
+rcontloop1:
+ maccn normalbeg2dc2
+
+rcontloop2:
+ maccn normalbeg2dc3
+
+rcontloop3:
+ maccn normalbeg2dc4
+
+rcontloop4:
+ maccn normalbeg2dc5
+
+rcontloop5:
+ maccn normalbeg2dc6
+
+rcontloop6:
+ maccn normalbeg2dc7
+
+rcontloop7:
+ maccn normalbeg2dc8
+
+rcontloop8:
+ maccn normalbeg2dc9
+
+rcontloop9:
+ maccn normalbeg2dc10
+
+rcontloop10:
+ maccn short normalbeg2dc11
+
+rcontloop11:
+ maccn short normalbeg2dc12
+
+rcontloop12:
+ maccn short normalbeg2dc13
+
+rcontloop13:
+ maccn short normalbeg2dc14
+
+rcontloop14:
+ maccn short normalbeg2dc15
+
+rcontloop15:
+ and eax,7fffh
+ mov ax,word ptr[esi+eax*2]
+ cmp ecx,eax
+ jnb exitloop
+
+ sub chain_length,16
+ ja do16
+ jmp normalbeg0add16
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+normbeg MACRO rcontlab,valsub
+; if we are here, we know that *(match+best_len-1) == scan_end
+ cmp bp,word ptr[edx+eax]
+; if (match != scan_start) goto rcontlab
+ jne rcontlab
+; calculate the good chain_length, and we'll compare scan and match string
+ add chain_length,16-valsub
+ jmp iseq
+ ENDM
+
+
+normalbeg2dc11:
+ normbeg rcontloop11,11
+
+normalbeg2dc12:
+ normbeg short rcontloop12,12
+
+normalbeg2dc13:
+ normbeg short rcontloop13,13
+
+normalbeg2dc14:
+ normbeg short rcontloop14,14
+
+normalbeg2dc15:
+ normbeg short rcontloop15,15
+
+normalbeg2dc10:
+ normbeg rcontloop10,10
+
+normalbeg2dc9:
+ normbeg rcontloop9,9
+
+normalbeg2dc8:
+ normbeg rcontloop8,8
+
+normalbeg2dc7:
+ normbeg rcontloop7,7
+
+normalbeg2dc6:
+ normbeg rcontloop6,6
+
+normalbeg2dc5:
+ normbeg rcontloop5,5
+
+normalbeg2dc4:
+ normbeg rcontloop4,4
+
+normalbeg2dc3:
+ normbeg rcontloop3,3
+
+normalbeg2dc2:
+ normbeg rcontloop2,2
+
+normalbeg2dc1:
+ normbeg rcontloop1,1
+
+normalbeg2dc0:
+ normbeg rcontloop0,0
+
+
+; we go in normalbeg2 because *(ushf*)(match+best_len-1) == scan_end
+
+normalbeg2:
+ mov edi,window
+
+ cmp bp,word ptr[edi+eax]
+ jne contloop3 ; if *(ushf*)match != scan_start, continue
+
+iseq:
+; if we are here, we know that *(match+best_len-1) == scan_end
+; and (match == scan_start)
+
+ mov edi,edx
+ mov esi,scan ; esi = scan
+ add edi,eax ; edi = window + cur_match = match
+
+ mov edx,[esi+3] ; compare manually dword at match+3
+ xor edx,[edi+3] ; and scan +3
+
+ jz begincompare ; if equal, go to long compare
+
+; we will determine the unmatch byte and calculate len (in esi)
+ or dl,dl
+ je eq1rr
+ mov esi,3
+ jmp trfinval
+eq1rr:
+ or dx,dx
+ je eq1
+
+ mov esi,4
+ jmp trfinval
+eq1:
+ and edx,0ffffffh
+ jz eq11
+ mov esi,5
+ jmp trfinval
+eq11:
+ mov esi,6
+ jmp trfinval
+
+begincompare:
+ ; here we now scan and match begin same
+ add edi,6
+ add esi,6
+ mov ecx,(MAX_MATCH-(2+4))/4 ; scan for at most MAX_MATCH bytes
+ repe cmpsd ; loop until mismatch
+
+ je trfin ; go to trfin if not unmatch
+; we determine the unmatch byte
+ sub esi,4
+ mov edx,[edi-4]
+ xor edx,[esi]
+
+ or dl,dl
+ jnz trfin
+ inc esi
+
+ or dx,dx
+ jnz trfin
+ inc esi
+
+ and edx,0ffffffh
+ jnz trfin
+ inc esi
+
+trfin:
+ sub esi,scan ; esi = len
+trfinval:
+; here we have finised compare, and esi contain len of equal string
+ cmp esi,best_len ; if len > best_len, go newbestlen
+ ja short newbestlen
+; now we restore edx, ecx and esi, for the big loop
+ mov esi,prev
+ mov ecx,limit
+ mov edx,window
+ jmp contloop3
+
+newbestlen:
+ mov best_len,esi ; len become best_len
+
+ mov match_start,eax ; save new position as match_start
+ cmp esi,nice_match ; if best_len >= nice_match, exit
+ jae exitloop
+ mov ecx,scan
+ mov edx,window ; restore edx=window
+ add ecx,esi
+ add esi,edx
+
+ dec esi
+ mov windowlen,esi ; windowlen = window + best_len-1
+ mov bx,[ecx-1] ; bx = *(scan+best_len-1) = scan_end
+
+; now we restore ecx and esi, for the big loop :
+ mov esi,prev
+ mov ecx,limit
+ jmp contloop3
+
+exitloop:
+; exit : s->match_start=match_start
+ mov ebx,match_start
+ mov ebp,str_s
+ mov ecx,best_len
+ mov dword ptr [ebp+dep_match_start],ebx
+ mov eax,dword ptr [ebp+dep_lookahead]
+ cmp ecx,eax
+ ja minexlo
+ mov eax,ecx
+minexlo:
+; return min(best_len,s->lookahead)
+
+; restore stack and register ebx,esi,edi,ebp
+ add esp,NbStackAdd
+
+ pop ebx
+ pop esi
+ pop edi
+ pop ebp
+ ret
+InfoAuthor:
+; please don't remove this string !
+; Your are free use gvmat32 in any fre or commercial apps if you don't remove the string in the binary!
+ db 0dh,0ah,"GVMat32 optimised assembly code written 1996-98 by Gilles Vollant",0dh,0ah
+
+
+
+IFDEF NOUNDERLINE
+longest_match_7fff endp
+ELSE
+_longest_match_7fff endp
+ENDIF
+
+
+IFDEF NOUNDERLINE
+cpudetect32 proc near
+ELSE
+_cpudetect32 proc near
+ENDIF
+
+
+ pushfd ; push original EFLAGS
+ pop eax ; get original EFLAGS
+ mov ecx, eax ; save original EFLAGS
+ xor eax, 40000h ; flip AC bit in EFLAGS
+ push eax ; save new EFLAGS value on stack
+ popfd ; replace current EFLAGS value
+ pushfd ; get new EFLAGS
+ pop eax ; store new EFLAGS in EAX
+ xor eax, ecx ; can’t toggle AC bit, processor=80386
+ jz end_cpu_is_386 ; jump if 80386 processor
+ push ecx
+ popfd ; restore AC bit in EFLAGS first
+
+ pushfd
+ pushfd
+ pop ecx
+
+ mov eax, ecx ; get original EFLAGS
+ xor eax, 200000h ; flip ID bit in EFLAGS
+ push eax ; save new EFLAGS value on stack
+ popfd ; replace current EFLAGS value
+ pushfd ; get new EFLAGS
+ pop eax ; store new EFLAGS in EAX
+ popfd ; restore original EFLAGS
+ xor eax, ecx ; can’t toggle ID bit,
+ je is_old_486 ; processor=old
+
+ mov eax,1
+ db 0fh,0a2h ;CPUID
+
+exitcpudetect:
+ ret
+
+end_cpu_is_386:
+ mov eax,0300h
+ jmp exitcpudetect
+
+is_old_486:
+ mov eax,0400h
+ jmp exitcpudetect
+
+IFDEF NOUNDERLINE
+cpudetect32 endp
+ELSE
+_cpudetect32 endp
+ENDIF
+
+_TEXT ends
+end
diff --git a/gnu/usr.bin/cvs/zlib/contrib/asm386/gvmat32c.c b/gnu/usr.bin/cvs/zlib/contrib/asm386/gvmat32c.c
new file mode 100644
index 00000000000..d853bb7ce8a
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/contrib/asm386/gvmat32c.c
@@ -0,0 +1,200 @@
+/* gvmat32.c -- C portion of the optimized longest_match for 32 bits x86
+ * Copyright (C) 1995-1996 Jean-loup Gailly and Gilles Vollant.
+ * File written by Gilles Vollant, by modifiying the longest_match
+ * from Jean-loup Gailly in deflate.c
+ * it prepare all parameters and call the assembly longest_match_gvasm
+ * longest_match execute standard C code is wmask != 0x7fff
+ * (assembly code is faster with a fixed wmask)
+ *
+ */
+
+#include "deflate.h"
+
+#undef FAR
+#include <windows.h>
+
+#ifdef ASMV
+#define NIL 0
+
+#define UNALIGNED_OK
+
+
+/* if your C compiler don't add underline before function name,
+ define ADD_UNDERLINE_ASMFUNC */
+#ifdef ADD_UNDERLINE_ASMFUNC
+#define longest_match_7fff _longest_match_7fff
+#endif
+
+
+
+void match_init()
+{
+}
+
+unsigned long cpudetect32();
+
+uInt longest_match_c(
+ deflate_state *s,
+ IPos cur_match); /* current match */
+
+
+uInt longest_match_7fff(
+ deflate_state *s,
+ IPos cur_match); /* current match */
+
+uInt longest_match(
+ deflate_state *s,
+ IPos cur_match) /* current match */
+{
+ static uInt iIsPPro=2;
+
+ if ((s->w_mask == 0x7fff) && (iIsPPro==0))
+ return longest_match_7fff(s,cur_match);
+
+ if (iIsPPro==2)
+ iIsPPro = (((cpudetect32()/0x100)&0xf)>=6) ? 1 : 0;
+
+ return longest_match_c(s,cur_match);
+}
+
+
+
+uInt longest_match_c(s, cur_match)
+ deflate_state *s;
+ IPos cur_match; /* current match */
+{
+ unsigned chain_length = s->max_chain_length;/* max hash chain length */
+ register Bytef *scan = s->window + s->strstart; /* current string */
+ register Bytef *match; /* matched string */
+ register int len; /* length of current match */
+ int best_len = s->prev_length; /* best match length so far */
+ int nice_match = s->nice_match; /* stop if match long enough */
+ IPos limit = s->strstart > (IPos)MAX_DIST(s) ?
+ s->strstart - (IPos)MAX_DIST(s) : NIL;
+ /* Stop when cur_match becomes <= limit. To simplify the code,
+ * we prevent matches with the string of window index 0.
+ */
+ Posf *prev = s->prev;
+ uInt wmask = s->w_mask;
+
+#ifdef UNALIGNED_OK
+ /* Compare two bytes at a time. Note: this is not always beneficial.
+ * Try with and without -DUNALIGNED_OK to check.
+ */
+ register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1;
+ register ush scan_start = *(ushf*)scan;
+ register ush scan_end = *(ushf*)(scan+best_len-1);
+#else
+ register Bytef *strend = s->window + s->strstart + MAX_MATCH;
+ register Byte scan_end1 = scan[best_len-1];
+ register Byte scan_end = scan[best_len];
+#endif
+
+ /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
+ * It is easy to get rid of this optimization if necessary.
+ */
+ Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
+
+ /* Do not waste too much time if we already have a good match: */
+ if (s->prev_length >= s->good_match) {
+ chain_length >>= 2;
+ }
+ /* Do not look for matches beyond the end of the input. This is necessary
+ * to make deflate deterministic.
+ */
+ if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead;
+
+ Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
+
+ do {
+ Assert(cur_match < s->strstart, "no future");
+ match = s->window + cur_match;
+
+ /* Skip to next match if the match length cannot increase
+ * or if the match length is less than 2:
+ */
+#if (defined(UNALIGNED_OK) && MAX_MATCH == 258)
+ /* This code assumes sizeof(unsigned short) == 2. Do not use
+ * UNALIGNED_OK if your compiler uses a different size.
+ */
+ if (*(ushf*)(match+best_len-1) != scan_end ||
+ *(ushf*)match != scan_start) continue;
+
+ /* It is not necessary to compare scan[2] and match[2] since they are
+ * always equal when the other bytes match, given that the hash keys
+ * are equal and that HASH_BITS >= 8. Compare 2 bytes at a time at
+ * strstart+3, +5, ... up to strstart+257. We check for insufficient
+ * lookahead only every 4th comparison; the 128th check will be made
+ * at strstart+257. If MAX_MATCH-2 is not a multiple of 8, it is
+ * necessary to put more guard bytes at the end of the window, or
+ * to check more often for insufficient lookahead.
+ */
+ Assert(scan[2] == match[2], "scan[2]?");
+ scan++, match++;
+ do {
+ } while (*(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
+ *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
+ *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
+ *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
+ scan < strend);
+ /* The funny "do {}" generates better code on most compilers */
+
+ /* Here, scan <= window+strstart+257 */
+ Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
+ if (*scan == *match) scan++;
+
+ len = (MAX_MATCH - 1) - (int)(strend-scan);
+ scan = strend - (MAX_MATCH-1);
+
+#else /* UNALIGNED_OK */
+
+ if (match[best_len] != scan_end ||
+ match[best_len-1] != scan_end1 ||
+ *match != *scan ||
+ *++match != scan[1]) continue;
+
+ /* The check at best_len-1 can be removed because it will be made
+ * again later. (This heuristic is not always a win.)
+ * It is not necessary to compare scan[2] and match[2] since they
+ * are always equal when the other bytes match, given that
+ * the hash keys are equal and that HASH_BITS >= 8.
+ */
+ scan += 2, match++;
+ Assert(*scan == *match, "match[2]?");
+
+ /* We check for insufficient lookahead only every 8th comparison;
+ * the 256th check will be made at strstart+258.
+ */
+ do {
+ } while (*++scan == *++match && *++scan == *++match &&
+ *++scan == *++match && *++scan == *++match &&
+ *++scan == *++match && *++scan == *++match &&
+ *++scan == *++match && *++scan == *++match &&
+ scan < strend);
+
+ Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
+
+ len = MAX_MATCH - (int)(strend - scan);
+ scan = strend - MAX_MATCH;
+
+#endif /* UNALIGNED_OK */
+
+ if (len > best_len) {
+ s->match_start = cur_match;
+ best_len = len;
+ if (len >= nice_match) break;
+#ifdef UNALIGNED_OK
+ scan_end = *(ushf*)(scan+best_len-1);
+#else
+ scan_end1 = scan[best_len-1];
+ scan_end = scan[best_len];
+#endif
+ }
+ } while ((cur_match = prev[cur_match & wmask]) > limit
+ && --chain_length != 0);
+
+ if ((uInt)best_len <= s->lookahead) return (uInt)best_len;
+ return s->lookahead;
+}
+
+#endif /* ASMV */
diff --git a/gnu/usr.bin/cvs/zlib/contrib/asm386/mkgvmt32.bat b/gnu/usr.bin/cvs/zlib/contrib/asm386/mkgvmt32.bat
new file mode 100644
index 00000000000..6c5ffd7a024
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/contrib/asm386/mkgvmt32.bat
@@ -0,0 +1 @@
+c:\masm611\bin\ml /coff /Zi /c /Flgvmat32.lst gvmat32.asm
diff --git a/gnu/usr.bin/cvs/zlib/contrib/asm386/zlibvc.def b/gnu/usr.bin/cvs/zlib/contrib/asm386/zlibvc.def
new file mode 100644
index 00000000000..7e9d60d55d9
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/contrib/asm386/zlibvc.def
@@ -0,0 +1,74 @@
+LIBRARY "zlib"
+
+DESCRIPTION '"""zlib data compression library"""'
+
+
+VERSION 1.11
+
+
+HEAPSIZE 1048576,8192
+
+EXPORTS
+ adler32 @1
+ compress @2
+ crc32 @3
+ deflate @4
+ deflateCopy @5
+ deflateEnd @6
+ deflateInit2_ @7
+ deflateInit_ @8
+ deflateParams @9
+ deflateReset @10
+ deflateSetDictionary @11
+ gzclose @12
+ gzdopen @13
+ gzerror @14
+ gzflush @15
+ gzopen @16
+ gzread @17
+ gzwrite @18
+ inflate @19
+ inflateEnd @20
+ inflateInit2_ @21
+ inflateInit_ @22
+ inflateReset @23
+ inflateSetDictionary @24
+ inflateSync @25
+ uncompress @26
+ zlibVersion @27
+ gzprintf @28
+ gzputc @29
+ gzgetc @30
+ gzseek @31
+ gzrewind @32
+ gztell @33
+ gzeof @34
+ gzsetparams @35
+ zError @36
+ inflateSyncPoint @37
+ get_crc_table @38
+ compress2 @39
+ gzputs @40
+ gzgets @41
+
+ unzOpen @61
+ unzClose @62
+ unzGetGlobalInfo @63
+ unzGetCurrentFileInfo @64
+ unzGoToFirstFile @65
+ unzGoToNextFile @66
+ unzOpenCurrentFile @67
+ unzReadCurrentFile @68
+ unztell @70
+ unzeof @71
+ unzCloseCurrentFile @72
+ unzGetGlobalComment @73
+ unzStringFileNameCompare @74
+ unzLocateFile @75
+ unzGetLocalExtrafield @76
+
+ zipOpen @80
+ zipOpenNewFileInZip @81
+ zipWriteInFileInZip @82
+ zipCloseFileInZip @83
+ zipClose @84
diff --git a/gnu/usr.bin/cvs/zlib/contrib/asm386/zlibvc.dsp b/gnu/usr.bin/cvs/zlib/contrib/asm386/zlibvc.dsp
new file mode 100644
index 00000000000..a70d4d4a6b0
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/contrib/asm386/zlibvc.dsp
@@ -0,0 +1,651 @@
+# Microsoft Developer Studio Project File - Name="zlibvc" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+# TARGTYPE "Win32 (ALPHA) Dynamic-Link Library" 0x0602
+
+CFG=zlibvc - Win32 Release
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "zlibvc.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "zlibvc.mak" CFG="zlibvc - Win32 Release"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "zlibvc - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "zlibvc - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "zlibvc - Win32 ReleaseAxp" (based on\
+ "Win32 (ALPHA) Dynamic-Link Library")
+!MESSAGE "zlibvc - Win32 ReleaseWithoutAsm" (based on\
+ "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "zlibvc - Win32 ReleaseWithoutCrtdll" (based on\
+ "Win32 (x86) Dynamic-Link Library")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir ".\Release"
+# PROP BASE Intermediate_Dir ".\Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir ".\Release"
+# PROP Intermediate_Dir ".\Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+CPP=cl.exe
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /D "ASMV" /FAcs /FR /FD /c
+# SUBTRACT CPP /YX
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+RSC=rc.exe
+# ADD BASE RSC /l 0x40c /d "NDEBUG"
+# ADD RSC /l 0x40c /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
+# ADD LINK32 gvmat32.obj kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib crtdll.lib /nologo /subsystem:windows /dll /map /machine:I386 /nodefaultlib /out:".\Release\zlib.dll"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir ".\Debug"
+# PROP BASE Intermediate_Dir ".\Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir ".\Debug"
+# PROP Intermediate_Dir ".\Debug"
+# PROP Target_Dir ""
+CPP=cl.exe
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /FD /c
+# SUBTRACT CPP /YX
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "_DEBUG" /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+RSC=rc.exe
+# ADD BASE RSC /l 0x40c /d "_DEBUG"
+# ADD RSC /l 0x40c /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:".\Debug\zlib.dll"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "zlibvc__"
+# PROP BASE Intermediate_Dir "zlibvc__"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "zlibvc__"
+# PROP Intermediate_Dir "zlibvc__"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+CPP=cl.exe
+# ADD BASE CPP /nologo /MT /Gt0 /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /FAcs /FR /YX /FD /c
+# ADD CPP /nologo /MT /Gt0 /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /FAcs /FR /FD /c
+# SUBTRACT CPP /YX
+RSC=rc.exe
+# ADD BASE RSC /l 0x40c /d "NDEBUG"
+# ADD RSC /l 0x40c /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 crtdll.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /map /machine:ALPHA /nodefaultlib /out:".\Release\zlib.dll"
+# SUBTRACT BASE LINK32 /pdb:none
+# ADD LINK32 crtdll.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /map /machine:ALPHA /nodefaultlib /out:"zlibvc__\zlib.dll"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "zlibvc_0"
+# PROP BASE Intermediate_Dir "zlibvc_0"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "zlibvc_0"
+# PROP Intermediate_Dir "zlibvc_0"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+CPP=cl.exe
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /FAcs /FR /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /FAcs /FR /FD /c
+# SUBTRACT CPP /YX
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+RSC=rc.exe
+# ADD BASE RSC /l 0x40c /d "NDEBUG"
+# ADD RSC /l 0x40c /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib crtdll.lib /nologo /subsystem:windows /dll /map /machine:I386 /nodefaultlib /out:".\Release\zlib.dll"
+# SUBTRACT BASE LINK32 /pdb:none
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib crtdll.lib /nologo /subsystem:windows /dll /map /machine:I386 /nodefaultlib /out:".\zlibvc_0\zlib.dll"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "zlibvc_1"
+# PROP BASE Intermediate_Dir "zlibvc_1"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "zlibvc_1"
+# PROP Intermediate_Dir "zlibvc_1"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+CPP=cl.exe
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /D "ASMV" /FAcs /FR /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /D "ASMV" /FAcs /FR /FD /c
+# SUBTRACT CPP /YX
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+RSC=rc.exe
+# ADD BASE RSC /l 0x40c /d "NDEBUG"
+# ADD RSC /l 0x40c /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 gvmat32.obj kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib crtdll.lib /nologo /subsystem:windows /dll /map /machine:I386 /nodefaultlib /out:".\Release\zlib.dll"
+# SUBTRACT BASE LINK32 /pdb:none
+# ADD LINK32 gvmat32.obj kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib crtdll.lib /nologo /subsystem:windows /dll /map /machine:I386 /nodefaultlib /out:".\zlibvc_1\zlib.dll"
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF
+
+# Begin Target
+
+# Name "zlibvc - Win32 Release"
+# Name "zlibvc - Win32 Debug"
+# Name "zlibvc - Win32 ReleaseAxp"
+# Name "zlibvc - Win32 ReleaseWithoutAsm"
+# Name "zlibvc - Win32 ReleaseWithoutCrtdll"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90"
+# Begin Source File
+
+SOURCE=.\adler32.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_ADLER=\
+ ".\zconf.h"\
+ ".\zlib.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\compress.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_COMPR=\
+ ".\zconf.h"\
+ ".\zlib.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\crc32.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_CRC32=\
+ ".\zconf.h"\
+ ".\zlib.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\deflate.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_DEFLA=\
+ ".\deflate.h"\
+ ".\zconf.h"\
+ ".\zlib.h"\
+ ".\zutil.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\gvmat32c.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\gzio.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_GZIO_=\
+ ".\zconf.h"\
+ ".\zlib.h"\
+ ".\zutil.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\infblock.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_INFBL=\
+ ".\infblock.h"\
+ ".\infcodes.h"\
+ ".\inftrees.h"\
+ ".\infutil.h"\
+ ".\zconf.h"\
+ ".\zlib.h"\
+ ".\zutil.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\infcodes.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_INFCO=\
+ ".\infblock.h"\
+ ".\infcodes.h"\
+ ".\inffast.h"\
+ ".\inftrees.h"\
+ ".\infutil.h"\
+ ".\zconf.h"\
+ ".\zlib.h"\
+ ".\zutil.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\inffast.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_INFFA=\
+ ".\infblock.h"\
+ ".\infcodes.h"\
+ ".\inffast.h"\
+ ".\inftrees.h"\
+ ".\infutil.h"\
+ ".\zconf.h"\
+ ".\zlib.h"\
+ ".\zutil.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\inflate.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_INFLA=\
+ ".\infblock.h"\
+ ".\zconf.h"\
+ ".\zlib.h"\
+ ".\zutil.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\inftrees.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_INFTR=\
+ ".\inftrees.h"\
+ ".\zconf.h"\
+ ".\zlib.h"\
+ ".\zutil.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\infutil.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_INFUT=\
+ ".\infblock.h"\
+ ".\infcodes.h"\
+ ".\inftrees.h"\
+ ".\infutil.h"\
+ ".\zconf.h"\
+ ".\zlib.h"\
+ ".\zutil.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\trees.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_TREES=\
+ ".\deflate.h"\
+ ".\zconf.h"\
+ ".\zlib.h"\
+ ".\zutil.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\uncompr.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_UNCOM=\
+ ".\zconf.h"\
+ ".\zlib.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\unzip.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\zip.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\zlib.rc
+# End Source File
+# Begin Source File
+
+SOURCE=.\zlibvc.def
+# End Source File
+# Begin Source File
+
+SOURCE=.\zutil.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_ZUTIL=\
+ ".\zconf.h"\
+ ".\zlib.h"\
+ ".\zutil.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd"
+# Begin Source File
+
+SOURCE=.\deflate.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\infblock.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\infcodes.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inffast.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inftrees.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\infutil.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\zconf.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\zlib.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\zutil.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/gnu/usr.bin/cvs/zlib/contrib/asm386/zlibvc.dsw b/gnu/usr.bin/cvs/zlib/contrib/asm386/zlibvc.dsw
new file mode 100644
index 00000000000..493cd870365
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/contrib/asm386/zlibvc.dsw
@@ -0,0 +1,41 @@
+Microsoft Developer Studio Workspace File, Format Version 5.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "zlibstat"=.\zlibstat.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "zlibvc"=.\zlibvc.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/gnu/usr.bin/cvs/zlib/contrib/asm586/README.586 b/gnu/usr.bin/cvs/zlib/contrib/asm586/README.586
new file mode 100644
index 00000000000..6bb78f32069
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/contrib/asm586/README.586
@@ -0,0 +1,43 @@
+This is a patched version of zlib modified to use
+Pentium-optimized assembly code in the deflation algorithm. The files
+changed/added by this patch are:
+
+README.586
+match.S
+
+The effectiveness of these modifications is a bit marginal, as the the
+program's bottleneck seems to be mostly L1-cache contention, for which
+there is no real way to work around without rewriting the basic
+algorithm. The speedup on average is around 5-10% (which is generally
+less than the amount of variance between subsequent executions).
+However, when used at level 9 compression, the cache contention can
+drop enough for the assembly version to achieve 10-20% speedup (and
+sometimes more, depending on the amount of overall redundancy in the
+files). Even here, though, cache contention can still be the limiting
+factor, depending on the nature of the program using the zlib library.
+This may also mean that better improvements will be seen on a Pentium
+with MMX, which suffers much less from L1-cache contention, but I have
+not yet verified this.
+
+Note that this code has been tailored for the Pentium in particular,
+and will not perform well on the Pentium Pro (due to the use of a
+partial register in the inner loop).
+
+If you are using an assembler other than GNU as, you will have to
+translate match.S to use your assembler's syntax. (Have fun.)
+
+Brian Raiter
+breadbox@muppetlabs.com
+April, 1998
+
+
+Added for zlib 1.1.3:
+
+The patches come from
+http://www.muppetlabs.com/~breadbox/software/assembly.html
+
+To compile zlib with this asm file, copy match.S to the zlib directory
+then do:
+
+CFLAGS="-O3 -DASMV" ./configure
+make OBJA=match.o
diff --git a/gnu/usr.bin/cvs/zlib/contrib/asm586/match.S b/gnu/usr.bin/cvs/zlib/contrib/asm586/match.S
new file mode 100644
index 00000000000..8f1614078f8
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/contrib/asm586/match.S
@@ -0,0 +1,354 @@
+/* match.s -- Pentium-optimized version of longest_match()
+ * Written for zlib 1.1.2
+ * Copyright (C) 1998 Brian Raiter <breadbox@muppetlabs.com>
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License.
+ */
+
+#ifndef NO_UNDERLINE
+#define match_init _match_init
+#define longest_match _longest_match
+#endif
+
+#define MAX_MATCH (258)
+#define MIN_MATCH (3)
+#define MIN_LOOKAHEAD (MAX_MATCH + MIN_MATCH + 1)
+#define MAX_MATCH_8 ((MAX_MATCH + 7) & ~7)
+
+/* stack frame offsets */
+
+#define wmask 0 /* local copy of s->wmask */
+#define window 4 /* local copy of s->window */
+#define windowbestlen 8 /* s->window + bestlen */
+#define chainlenscanend 12 /* high word: current chain len */
+ /* low word: last bytes sought */
+#define scanstart 16 /* first two bytes of string */
+#define scanalign 20 /* dword-misalignment of string */
+#define nicematch 24 /* a good enough match size */
+#define bestlen 28 /* size of best match so far */
+#define scan 32 /* ptr to string wanting match */
+
+#define LocalVarsSize (36)
+/* saved ebx 36 */
+/* saved edi 40 */
+/* saved esi 44 */
+/* saved ebp 48 */
+/* return address 52 */
+#define deflatestate 56 /* the function arguments */
+#define curmatch 60
+
+/* Offsets for fields in the deflate_state structure. These numbers
+ * are calculated from the definition of deflate_state, with the
+ * assumption that the compiler will dword-align the fields. (Thus,
+ * changing the definition of deflate_state could easily cause this
+ * program to crash horribly, without so much as a warning at
+ * compile time. Sigh.)
+ */
+#define dsWSize 36
+#define dsWMask 44
+#define dsWindow 48
+#define dsPrev 56
+#define dsMatchLen 88
+#define dsPrevMatch 92
+#define dsStrStart 100
+#define dsMatchStart 104
+#define dsLookahead 108
+#define dsPrevLen 112
+#define dsMaxChainLen 116
+#define dsGoodMatch 132
+#define dsNiceMatch 136
+
+
+.file "match.S"
+
+.globl match_init, longest_match
+
+.text
+
+/* uInt longest_match(deflate_state *deflatestate, IPos curmatch) */
+
+longest_match:
+
+/* Save registers that the compiler may be using, and adjust %esp to */
+/* make room for our stack frame. */
+
+ pushl %ebp
+ pushl %edi
+ pushl %esi
+ pushl %ebx
+ subl $LocalVarsSize, %esp
+
+/* Retrieve the function arguments. %ecx will hold cur_match */
+/* throughout the entire function. %edx will hold the pointer to the */
+/* deflate_state structure during the function's setup (before */
+/* entering the main loop). */
+
+ movl deflatestate(%esp), %edx
+ movl curmatch(%esp), %ecx
+
+/* if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead; */
+
+ movl dsNiceMatch(%edx), %eax
+ movl dsLookahead(%edx), %ebx
+ cmpl %eax, %ebx
+ jl LookaheadLess
+ movl %eax, %ebx
+LookaheadLess: movl %ebx, nicematch(%esp)
+
+/* register Bytef *scan = s->window + s->strstart; */
+
+ movl dsWindow(%edx), %esi
+ movl %esi, window(%esp)
+ movl dsStrStart(%edx), %ebp
+ lea (%esi,%ebp), %edi
+ movl %edi, scan(%esp)
+
+/* Determine how many bytes the scan ptr is off from being */
+/* dword-aligned. */
+
+ movl %edi, %eax
+ negl %eax
+ andl $3, %eax
+ movl %eax, scanalign(%esp)
+
+/* IPos limit = s->strstart > (IPos)MAX_DIST(s) ? */
+/* s->strstart - (IPos)MAX_DIST(s) : NIL; */
+
+ movl dsWSize(%edx), %eax
+ subl $MIN_LOOKAHEAD, %eax
+ subl %eax, %ebp
+ jg LimitPositive
+ xorl %ebp, %ebp
+LimitPositive:
+
+/* unsigned chain_length = s->max_chain_length; */
+/* if (s->prev_length >= s->good_match) { */
+/* chain_length >>= 2; */
+/* } */
+
+ movl dsPrevLen(%edx), %eax
+ movl dsGoodMatch(%edx), %ebx
+ cmpl %ebx, %eax
+ movl dsMaxChainLen(%edx), %ebx
+ jl LastMatchGood
+ shrl $2, %ebx
+LastMatchGood:
+
+/* chainlen is decremented once beforehand so that the function can */
+/* use the sign flag instead of the zero flag for the exit test. */
+/* It is then shifted into the high word, to make room for the scanend */
+/* scanend value, which it will always accompany. */
+
+ decl %ebx
+ shll $16, %ebx
+
+/* int best_len = s->prev_length; */
+
+ movl dsPrevLen(%edx), %eax
+ movl %eax, bestlen(%esp)
+
+/* Store the sum of s->window + best_len in %esi locally, and in %esi. */
+
+ addl %eax, %esi
+ movl %esi, windowbestlen(%esp)
+
+/* register ush scan_start = *(ushf*)scan; */
+/* register ush scan_end = *(ushf*)(scan+best_len-1); */
+
+ movw (%edi), %bx
+ movw %bx, scanstart(%esp)
+ movw -1(%edi,%eax), %bx
+ movl %ebx, chainlenscanend(%esp)
+
+/* Posf *prev = s->prev; */
+/* uInt wmask = s->w_mask; */
+
+ movl dsPrev(%edx), %edi
+ movl dsWMask(%edx), %edx
+ mov %edx, wmask(%esp)
+
+/* Jump into the main loop. */
+
+ jmp LoopEntry
+
+.balign 16
+
+/* do {
+ * match = s->window + cur_match;
+ * if (*(ushf*)(match+best_len-1) != scan_end ||
+ * *(ushf*)match != scan_start) continue;
+ * [...]
+ * } while ((cur_match = prev[cur_match & wmask]) > limit
+ * && --chain_length != 0);
+ *
+ * Here is the inner loop of the function. The function will spend the
+ * majority of its time in this loop, and majority of that time will
+ * be spent in the first ten instructions.
+ *
+ * Within this loop:
+ * %ebx = chainlenscanend - i.e., ((chainlen << 16) | scanend)
+ * %ecx = curmatch
+ * %edx = curmatch & wmask
+ * %esi = windowbestlen - i.e., (window + bestlen)
+ * %edi = prev
+ * %ebp = limit
+ *
+ * Two optimization notes on the choice of instructions:
+ *
+ * The first instruction uses a 16-bit address, which costs an extra,
+ * unpairable cycle. This is cheaper than doing a 32-bit access and
+ * zeroing the high word, due to the 3-cycle misalignment penalty which
+ * would occur half the time. This also turns out to be cheaper than
+ * doing two separate 8-bit accesses, as the memory is so rarely in the
+ * L1 cache.
+ *
+ * The window buffer, however, apparently spends a lot of time in the
+ * cache, and so it is faster to retrieve the word at the end of the
+ * match string with two 8-bit loads. The instructions that test the
+ * word at the beginning of the match string, however, are executed
+ * much less frequently, and there it was cheaper to use 16-bit
+ * instructions, which avoided the necessity of saving off and
+ * subsequently reloading one of the other registers.
+ */
+LookupLoop:
+ /* 1 U & V */
+ movw (%edi,%edx,2), %cx /* 2 U pipe */
+ movl wmask(%esp), %edx /* 2 V pipe */
+ cmpl %ebp, %ecx /* 3 U pipe */
+ jbe LeaveNow /* 3 V pipe */
+ subl $0x00010000, %ebx /* 4 U pipe */
+ js LeaveNow /* 4 V pipe */
+LoopEntry: movb -1(%esi,%ecx), %al /* 5 U pipe */
+ andl %ecx, %edx /* 5 V pipe */
+ cmpb %bl, %al /* 6 U pipe */
+ jnz LookupLoop /* 6 V pipe */
+ movb (%esi,%ecx), %ah
+ cmpb %bh, %ah
+ jnz LookupLoop
+ movl window(%esp), %eax
+ movw (%eax,%ecx), %ax
+ cmpw scanstart(%esp), %ax
+ jnz LookupLoop
+
+/* Store the current value of chainlen. */
+
+ movl %ebx, chainlenscanend(%esp)
+
+/* Point %edi to the string under scrutiny, and %esi to the string we */
+/* are hoping to match it up with. In actuality, %esi and %edi are */
+/* both pointed (MAX_MATCH_8 - scanalign) bytes ahead, and %edx is */
+/* initialized to -(MAX_MATCH_8 - scanalign). */
+
+ movl window(%esp), %esi
+ movl scan(%esp), %edi
+ addl %ecx, %esi
+ movl scanalign(%esp), %eax
+ movl $(-MAX_MATCH_8), %edx
+ lea MAX_MATCH_8(%edi,%eax), %edi
+ lea MAX_MATCH_8(%esi,%eax), %esi
+
+/* Test the strings for equality, 8 bytes at a time. At the end,
+ * adjust %edx so that it is offset to the exact byte that mismatched.
+ *
+ * We already know at this point that the first three bytes of the
+ * strings match each other, and they can be safely passed over before
+ * starting the compare loop. So what this code does is skip over 0-3
+ * bytes, as much as necessary in order to dword-align the %edi
+ * pointer. (%esi will still be misaligned three times out of four.)
+ *
+ * It should be confessed that this loop usually does not represent
+ * much of the total running time. Replacing it with a more
+ * straightforward "rep cmpsb" would not drastically degrade
+ * performance.
+ */
+LoopCmps:
+ movl (%esi,%edx), %eax
+ movl (%edi,%edx), %ebx
+ xorl %ebx, %eax
+ jnz LeaveLoopCmps
+ movl 4(%esi,%edx), %eax
+ movl 4(%edi,%edx), %ebx
+ xorl %ebx, %eax
+ jnz LeaveLoopCmps4
+ addl $8, %edx
+ jnz LoopCmps
+ jmp LenMaximum
+LeaveLoopCmps4: addl $4, %edx
+LeaveLoopCmps: testl $0x0000FFFF, %eax
+ jnz LenLower
+ addl $2, %edx
+ shrl $16, %eax
+LenLower: subb $1, %al
+ adcl $0, %edx
+
+/* Calculate the length of the match. If it is longer than MAX_MATCH, */
+/* then automatically accept it as the best possible match and leave. */
+
+ lea (%edi,%edx), %eax
+ movl scan(%esp), %edi
+ subl %edi, %eax
+ cmpl $MAX_MATCH, %eax
+ jge LenMaximum
+
+/* If the length of the match is not longer than the best match we */
+/* have so far, then forget it and return to the lookup loop. */
+
+ movl deflatestate(%esp), %edx
+ movl bestlen(%esp), %ebx
+ cmpl %ebx, %eax
+ jg LongerMatch
+ movl chainlenscanend(%esp), %ebx
+ movl windowbestlen(%esp), %esi
+ movl dsPrev(%edx), %edi
+ movl wmask(%esp), %edx
+ andl %ecx, %edx
+ jmp LookupLoop
+
+/* s->match_start = cur_match; */
+/* best_len = len; */
+/* if (len >= nice_match) break; */
+/* scan_end = *(ushf*)(scan+best_len-1); */
+
+LongerMatch: movl nicematch(%esp), %ebx
+ movl %eax, bestlen(%esp)
+ movl %ecx, dsMatchStart(%edx)
+ cmpl %ebx, %eax
+ jge LeaveNow
+ movl window(%esp), %esi
+ addl %eax, %esi
+ movl %esi, windowbestlen(%esp)
+ movl chainlenscanend(%esp), %ebx
+ movw -1(%edi,%eax), %bx
+ movl dsPrev(%edx), %edi
+ movl %ebx, chainlenscanend(%esp)
+ movl wmask(%esp), %edx
+ andl %ecx, %edx
+ jmp LookupLoop
+
+/* Accept the current string, with the maximum possible length. */
+
+LenMaximum: movl deflatestate(%esp), %edx
+ movl $MAX_MATCH, bestlen(%esp)
+ movl %ecx, dsMatchStart(%edx)
+
+/* if ((uInt)best_len <= s->lookahead) return (uInt)best_len; */
+/* return s->lookahead; */
+
+LeaveNow:
+ movl deflatestate(%esp), %edx
+ movl bestlen(%esp), %ebx
+ movl dsLookahead(%edx), %eax
+ cmpl %eax, %ebx
+ jg LookaheadRet
+ movl %ebx, %eax
+LookaheadRet:
+
+/* Restore the stack and return from whence we came. */
+
+ addl $LocalVarsSize, %esp
+ popl %ebx
+ popl %esi
+ popl %edi
+ popl %ebp
+match_init: ret
diff --git a/gnu/usr.bin/cvs/zlib/contrib/asm686/README.686 b/gnu/usr.bin/cvs/zlib/contrib/asm686/README.686
new file mode 100644
index 00000000000..a593f23afd6
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/contrib/asm686/README.686
@@ -0,0 +1,34 @@
+This is a patched version of zlib, modified to use
+Pentium-Pro-optimized assembly code in the deflation algorithm. The
+files changed/added by this patch are:
+
+README.686
+match.S
+
+The speedup that this patch provides varies, depending on whether the
+compiler used to build the original version of zlib falls afoul of the
+PPro's speed traps. My own tests show a speedup of around 10-20% at
+the default compression level, and 20-30% using -9, against a version
+compiled using gcc 2.7.2.3. Your mileage may vary.
+
+Note that this code has been tailored for the PPro/PII in particular,
+and will not perform particuarly well on a Pentium.
+
+If you are using an assembler other than GNU as, you will have to
+translate match.S to use your assembler's syntax. (Have fun.)
+
+Brian Raiter
+breadbox@muppetlabs.com
+April, 1998
+
+
+Added for zlib 1.1.3:
+
+The patches come from
+http://www.muppetlabs.com/~breadbox/software/assembly.html
+
+To compile zlib with this asm file, copy match.S to the zlib directory
+then do:
+
+CFLAGS="-O3 -DASMV" ./configure
+make OBJA=match.o
diff --git a/gnu/usr.bin/cvs/zlib/contrib/asm686/match.S b/gnu/usr.bin/cvs/zlib/contrib/asm686/match.S
new file mode 100644
index 00000000000..8e86c33c288
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/contrib/asm686/match.S
@@ -0,0 +1,327 @@
+/* match.s -- Pentium-Pro-optimized version of longest_match()
+ * Written for zlib 1.1.2
+ * Copyright (C) 1998 Brian Raiter <breadbox@muppetlabs.com>
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License.
+ */
+
+#ifndef NO_UNDERLINE
+#define match_init _match_init
+#define longest_match _longest_match
+#endif
+
+#define MAX_MATCH (258)
+#define MIN_MATCH (3)
+#define MIN_LOOKAHEAD (MAX_MATCH + MIN_MATCH + 1)
+#define MAX_MATCH_8 ((MAX_MATCH + 7) & ~7)
+
+/* stack frame offsets */
+
+#define chainlenwmask 0 /* high word: current chain len */
+ /* low word: s->wmask */
+#define window 4 /* local copy of s->window */
+#define windowbestlen 8 /* s->window + bestlen */
+#define scanstart 16 /* first two bytes of string */
+#define scanend 12 /* last two bytes of string */
+#define scanalign 20 /* dword-misalignment of string */
+#define nicematch 24 /* a good enough match size */
+#define bestlen 28 /* size of best match so far */
+#define scan 32 /* ptr to string wanting match */
+
+#define LocalVarsSize (36)
+/* saved ebx 36 */
+/* saved edi 40 */
+/* saved esi 44 */
+/* saved ebp 48 */
+/* return address 52 */
+#define deflatestate 56 /* the function arguments */
+#define curmatch 60
+
+/* Offsets for fields in the deflate_state structure. These numbers
+ * are calculated from the definition of deflate_state, with the
+ * assumption that the compiler will dword-align the fields. (Thus,
+ * changing the definition of deflate_state could easily cause this
+ * program to crash horribly, without so much as a warning at
+ * compile time. Sigh.)
+ */
+#define dsWSize 36
+#define dsWMask 44
+#define dsWindow 48
+#define dsPrev 56
+#define dsMatchLen 88
+#define dsPrevMatch 92
+#define dsStrStart 100
+#define dsMatchStart 104
+#define dsLookahead 108
+#define dsPrevLen 112
+#define dsMaxChainLen 116
+#define dsGoodMatch 132
+#define dsNiceMatch 136
+
+
+.file "match.S"
+
+.globl match_init, longest_match
+
+.text
+
+/* uInt longest_match(deflate_state *deflatestate, IPos curmatch) */
+
+longest_match:
+
+/* Save registers that the compiler may be using, and adjust %esp to */
+/* make room for our stack frame. */
+
+ pushl %ebp
+ pushl %edi
+ pushl %esi
+ pushl %ebx
+ subl $LocalVarsSize, %esp
+
+/* Retrieve the function arguments. %ecx will hold cur_match */
+/* throughout the entire function. %edx will hold the pointer to the */
+/* deflate_state structure during the function's setup (before */
+/* entering the main loop). */
+
+ movl deflatestate(%esp), %edx
+ movl curmatch(%esp), %ecx
+
+/* uInt wmask = s->w_mask; */
+/* unsigned chain_length = s->max_chain_length; */
+/* if (s->prev_length >= s->good_match) { */
+/* chain_length >>= 2; */
+/* } */
+
+ movl dsPrevLen(%edx), %eax
+ movl dsGoodMatch(%edx), %ebx
+ cmpl %ebx, %eax
+ movl dsWMask(%edx), %eax
+ movl dsMaxChainLen(%edx), %ebx
+ jl LastMatchGood
+ shrl $2, %ebx
+LastMatchGood:
+
+/* chainlen is decremented once beforehand so that the function can */
+/* use the sign flag instead of the zero flag for the exit test. */
+/* It is then shifted into the high word, to make room for the wmask */
+/* value, which it will always accompany. */
+
+ decl %ebx
+ shll $16, %ebx
+ orl %eax, %ebx
+ movl %ebx, chainlenwmask(%esp)
+
+/* if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead; */
+
+ movl dsNiceMatch(%edx), %eax
+ movl dsLookahead(%edx), %ebx
+ cmpl %eax, %ebx
+ jl LookaheadLess
+ movl %eax, %ebx
+LookaheadLess: movl %ebx, nicematch(%esp)
+
+/* register Bytef *scan = s->window + s->strstart; */
+
+ movl dsWindow(%edx), %esi
+ movl %esi, window(%esp)
+ movl dsStrStart(%edx), %ebp
+ lea (%esi,%ebp), %edi
+ movl %edi, scan(%esp)
+
+/* Determine how many bytes the scan ptr is off from being */
+/* dword-aligned. */
+
+ movl %edi, %eax
+ negl %eax
+ andl $3, %eax
+ movl %eax, scanalign(%esp)
+
+/* IPos limit = s->strstart > (IPos)MAX_DIST(s) ? */
+/* s->strstart - (IPos)MAX_DIST(s) : NIL; */
+
+ movl dsWSize(%edx), %eax
+ subl $MIN_LOOKAHEAD, %eax
+ subl %eax, %ebp
+ jg LimitPositive
+ xorl %ebp, %ebp
+LimitPositive:
+
+/* int best_len = s->prev_length; */
+
+ movl dsPrevLen(%edx), %eax
+ movl %eax, bestlen(%esp)
+
+/* Store the sum of s->window + best_len in %esi locally, and in %esi. */
+
+ addl %eax, %esi
+ movl %esi, windowbestlen(%esp)
+
+/* register ush scan_start = *(ushf*)scan; */
+/* register ush scan_end = *(ushf*)(scan+best_len-1); */
+/* Posf *prev = s->prev; */
+
+ movzwl (%edi), %ebx
+ movl %ebx, scanstart(%esp)
+ movzwl -1(%edi,%eax), %ebx
+ movl %ebx, scanend(%esp)
+ movl dsPrev(%edx), %edi
+
+/* Jump into the main loop. */
+
+ movl chainlenwmask(%esp), %edx
+ jmp LoopEntry
+
+.balign 16
+
+/* do {
+ * match = s->window + cur_match;
+ * if (*(ushf*)(match+best_len-1) != scan_end ||
+ * *(ushf*)match != scan_start) continue;
+ * [...]
+ * } while ((cur_match = prev[cur_match & wmask]) > limit
+ * && --chain_length != 0);
+ *
+ * Here is the inner loop of the function. The function will spend the
+ * majority of its time in this loop, and majority of that time will
+ * be spent in the first ten instructions.
+ *
+ * Within this loop:
+ * %ebx = scanend
+ * %ecx = curmatch
+ * %edx = chainlenwmask - i.e., ((chainlen << 16) | wmask)
+ * %esi = windowbestlen - i.e., (window + bestlen)
+ * %edi = prev
+ * %ebp = limit
+ */
+LookupLoop:
+ andl %edx, %ecx
+ movzwl (%edi,%ecx,2), %ecx
+ cmpl %ebp, %ecx
+ jbe LeaveNow
+ subl $0x00010000, %edx
+ js LeaveNow
+LoopEntry: movzwl -1(%esi,%ecx), %eax
+ cmpl %ebx, %eax
+ jnz LookupLoop
+ movl window(%esp), %eax
+ movzwl (%eax,%ecx), %eax
+ cmpl scanstart(%esp), %eax
+ jnz LookupLoop
+
+/* Store the current value of chainlen. */
+
+ movl %edx, chainlenwmask(%esp)
+
+/* Point %edi to the string under scrutiny, and %esi to the string we */
+/* are hoping to match it up with. In actuality, %esi and %edi are */
+/* both pointed (MAX_MATCH_8 - scanalign) bytes ahead, and %edx is */
+/* initialized to -(MAX_MATCH_8 - scanalign). */
+
+ movl window(%esp), %esi
+ movl scan(%esp), %edi
+ addl %ecx, %esi
+ movl scanalign(%esp), %eax
+ movl $(-MAX_MATCH_8), %edx
+ lea MAX_MATCH_8(%edi,%eax), %edi
+ lea MAX_MATCH_8(%esi,%eax), %esi
+
+/* Test the strings for equality, 8 bytes at a time. At the end,
+ * adjust %edx so that it is offset to the exact byte that mismatched.
+ *
+ * We already know at this point that the first three bytes of the
+ * strings match each other, and they can be safely passed over before
+ * starting the compare loop. So what this code does is skip over 0-3
+ * bytes, as much as necessary in order to dword-align the %edi
+ * pointer. (%esi will still be misaligned three times out of four.)
+ *
+ * It should be confessed that this loop usually does not represent
+ * much of the total running time. Replacing it with a more
+ * straightforward "rep cmpsb" would not drastically degrade
+ * performance.
+ */
+LoopCmps:
+ movl (%esi,%edx), %eax
+ xorl (%edi,%edx), %eax
+ jnz LeaveLoopCmps
+ movl 4(%esi,%edx), %eax
+ xorl 4(%edi,%edx), %eax
+ jnz LeaveLoopCmps4
+ addl $8, %edx
+ jnz LoopCmps
+ jmp LenMaximum
+LeaveLoopCmps4: addl $4, %edx
+LeaveLoopCmps: testl $0x0000FFFF, %eax
+ jnz LenLower
+ addl $2, %edx
+ shrl $16, %eax
+LenLower: subb $1, %al
+ adcl $0, %edx
+
+/* Calculate the length of the match. If it is longer than MAX_MATCH, */
+/* then automatically accept it as the best possible match and leave. */
+
+ lea (%edi,%edx), %eax
+ movl scan(%esp), %edi
+ subl %edi, %eax
+ cmpl $MAX_MATCH, %eax
+ jge LenMaximum
+
+/* If the length of the match is not longer than the best match we */
+/* have so far, then forget it and return to the lookup loop. */
+
+ movl deflatestate(%esp), %edx
+ movl bestlen(%esp), %ebx
+ cmpl %ebx, %eax
+ jg LongerMatch
+ movl windowbestlen(%esp), %esi
+ movl dsPrev(%edx), %edi
+ movl scanend(%esp), %ebx
+ movl chainlenwmask(%esp), %edx
+ jmp LookupLoop
+
+/* s->match_start = cur_match; */
+/* best_len = len; */
+/* if (len >= nice_match) break; */
+/* scan_end = *(ushf*)(scan+best_len-1); */
+
+LongerMatch: movl nicematch(%esp), %ebx
+ movl %eax, bestlen(%esp)
+ movl %ecx, dsMatchStart(%edx)
+ cmpl %ebx, %eax
+ jge LeaveNow
+ movl window(%esp), %esi
+ addl %eax, %esi
+ movl %esi, windowbestlen(%esp)
+ movzwl -1(%edi,%eax), %ebx
+ movl dsPrev(%edx), %edi
+ movl %ebx, scanend(%esp)
+ movl chainlenwmask(%esp), %edx
+ jmp LookupLoop
+
+/* Accept the current string, with the maximum possible length. */
+
+LenMaximum: movl deflatestate(%esp), %edx
+ movl $MAX_MATCH, bestlen(%esp)
+ movl %ecx, dsMatchStart(%edx)
+
+/* if ((uInt)best_len <= s->lookahead) return (uInt)best_len; */
+/* return s->lookahead; */
+
+LeaveNow:
+ movl deflatestate(%esp), %edx
+ movl bestlen(%esp), %ebx
+ movl dsLookahead(%edx), %eax
+ cmpl %eax, %ebx
+ jg LookaheadRet
+ movl %ebx, %eax
+LookaheadRet:
+
+/* Restore the stack and return from whence we came. */
+
+ addl $LocalVarsSize, %esp
+ popl %ebx
+ popl %esi
+ popl %edi
+ popl %ebp
+match_init: ret
diff --git a/gnu/usr.bin/cvs/zlib/contrib/delphi/zlib.mak b/gnu/usr.bin/cvs/zlib/contrib/delphi/zlib.mak
new file mode 100644
index 00000000000..ba557e2b977
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/contrib/delphi/zlib.mak
@@ -0,0 +1,36 @@
+# Makefile for zlib32bd.lib
+# ------------- Borland C++ 4.5 -------------
+
+# The (32-bit) zlib32bd.lib made with this makefile is intended for use
+# in making the (32-bit) DLL, png32bd.dll. It uses the "stdcall" calling
+# convention.
+
+CFLAGS= -ps -O2 -C -K -N- -k- -d -3 -r- -w-par -w-aus -WDE
+CC=f:\bc45\bin\bcc32
+LIBFLAGS= /C
+LIB=f:\bc45\bin\tlib
+ZLIB=zlib32bd.lib
+
+.autodepend
+.c.obj:
+ $(CC) -c $(CFLAGS) $<
+
+OBJ1=adler32.obj compress.obj crc32.obj deflate.obj gzio.obj infblock.obj
+OBJ2=infcodes.obj inflate.obj inftrees.obj infutil.obj inffast.obj
+OBJ3=trees.obj uncompr.obj zutil.obj
+pOBJ1=+adler32.obj+compress.obj+crc32.obj+deflate.obj+gzio.obj+infblock.obj
+pOBJ2=+infcodes.obj+inflate.obj+inftrees.obj+infutil.obj+inffast.obj
+pOBJ3=+trees.obj+uncompr.obj+zutil.obj
+
+all: $(ZLIB)
+
+$(ZLIB): $(OBJ1) $(OBJ2) $(OBJ3)
+ @if exist $@ del $@
+ $(LIB) @&&|
+$@ $(LIBFLAGS) &
+$(pOBJ1) &
+$(pOBJ2) &
+$(pOBJ3)
+|
+
+# End of makefile for zlib32bd.lib
diff --git a/gnu/usr.bin/cvs/zlib/contrib/delphi/zlibdef.pas b/gnu/usr.bin/cvs/zlib/contrib/delphi/zlibdef.pas
new file mode 100644
index 00000000000..4f96b7d2c50
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/contrib/delphi/zlibdef.pas
@@ -0,0 +1,169 @@
+unit zlibdef;
+
+interface
+
+uses
+ Windows;
+
+const
+ ZLIB_VERSION = '1.1.3';
+
+type
+ voidpf = Pointer;
+ int = Integer;
+ uInt = Cardinal;
+ pBytef = PChar;
+ uLong = Cardinal;
+
+ alloc_func = function(opaque: voidpf; items, size: uInt): voidpf;
+ stdcall;
+ free_func = procedure(opaque, address: voidpf);
+ stdcall;
+
+ internal_state = Pointer;
+
+ z_streamp = ^z_stream;
+ z_stream = packed record
+ next_in: pBytef; // next input byte
+ avail_in: uInt; // number of bytes available at next_in
+ total_in: uLong; // total nb of input bytes read so far
+
+ next_out: pBytef; // next output byte should be put there
+ avail_out: uInt; // remaining free space at next_out
+ total_out: uLong; // total nb of bytes output so far
+
+ msg: PChar; // last error message, NULL if no error
+ state: internal_state; // not visible by applications
+
+ zalloc: alloc_func; // used to allocate the internal state
+ zfree: free_func; // used to free the internal state
+ opaque: voidpf; // private data object passed to zalloc and zfree
+
+ data_type: int; // best guess about the data type: ascii or binary
+ adler: uLong; // adler32 value of the uncompressed data
+ reserved: uLong; // reserved for future use
+ end;
+
+const
+ Z_NO_FLUSH = 0;
+ Z_SYNC_FLUSH = 2;
+ Z_FULL_FLUSH = 3;
+ Z_FINISH = 4;
+
+ Z_OK = 0;
+ Z_STREAM_END = 1;
+
+ Z_NO_COMPRESSION = 0;
+ Z_BEST_SPEED = 1;
+ Z_BEST_COMPRESSION = 9;
+ Z_DEFAULT_COMPRESSION = -1;
+
+ Z_FILTERED = 1;
+ Z_HUFFMAN_ONLY = 2;
+ Z_DEFAULT_STRATEGY = 0;
+
+ Z_BINARY = 0;
+ Z_ASCII = 1;
+ Z_UNKNOWN = 2;
+
+ Z_DEFLATED = 8;
+
+ MAX_MEM_LEVEL = 9;
+
+function adler32(adler: uLong; const buf: pBytef; len: uInt): uLong;
+ stdcall;
+function crc32(crc: uLong; const buf: pBytef; len: uInt): uLong;
+ stdcall;
+function deflate(strm: z_streamp; flush: int): int;
+ stdcall;
+function deflateCopy(dest, source: z_streamp): int;
+ stdcall;
+function deflateEnd(strm: z_streamp): int;
+ stdcall;
+function deflateInit2_(strm: z_streamp; level, method,
+ windowBits, memLevel, strategy: int;
+ const version: PChar; stream_size: int): int;
+ stdcall;
+function deflateInit_(strm: z_streamp; level: int;
+ const version: PChar; stream_size: int): int;
+ stdcall;
+function deflateParams(strm: z_streamp; level, strategy: int): int;
+ stdcall;
+function deflateReset(strm: z_streamp): int;
+ stdcall;
+function deflateSetDictionary(strm: z_streamp;
+ const dictionary: pBytef;
+ dictLength: uInt): int;
+ stdcall;
+function inflate(strm: z_streamp; flush: int): int;
+ stdcall;
+function inflateEnd(strm: z_streamp): int;
+ stdcall;
+function inflateInit2_(strm: z_streamp; windowBits: int;
+ const version: PChar; stream_size: int): int;
+ stdcall;
+function inflateInit_(strm: z_streamp; const version: PChar;
+ stream_size: int): int;
+ stdcall;
+function inflateReset(strm: z_streamp): int;
+ stdcall;
+function inflateSetDictionary(strm: z_streamp;
+ const dictionary: pBytef;
+ dictLength: uInt): int;
+ stdcall;
+function inflateSync(strm: z_streamp): int;
+ stdcall;
+
+function deflateInit(strm: z_streamp; level: int): int;
+function deflateInit2(strm: z_streamp; level, method, windowBits,
+ memLevel, strategy: int): int;
+function inflateInit(strm: z_streamp): int;
+function inflateInit2(strm: z_streamp; windowBits: int): int;
+
+implementation
+
+function deflateInit(strm: z_streamp; level: int): int;
+begin
+ Result := deflateInit_(strm, level, ZLIB_VERSION, sizeof(z_stream));
+end;
+
+function deflateInit2(strm: z_streamp; level, method, windowBits,
+ memLevel, strategy: int): int;
+begin
+ Result := deflateInit2_(strm, level, method, windowBits, memLevel,
+ strategy, ZLIB_VERSION, sizeof(z_stream));
+end;
+
+function inflateInit(strm: z_streamp): int;
+begin
+ Result := inflateInit_(strm, ZLIB_VERSION, sizeof(z_stream));
+end;
+
+function inflateInit2(strm: z_streamp; windowBits: int): int;
+begin
+ Result := inflateInit2_(strm, windowBits, ZLIB_VERSION,
+ sizeof(z_stream));
+end;
+
+const
+ zlibDLL = 'png32bd.dll';
+
+function adler32; external zlibDLL;
+function crc32; external zlibDLL;
+function deflate; external zlibDLL;
+function deflateCopy; external zlibDLL;
+function deflateEnd; external zlibDLL;
+function deflateInit2_; external zlibDLL;
+function deflateInit_; external zlibDLL;
+function deflateParams; external zlibDLL;
+function deflateReset; external zlibDLL;
+function deflateSetDictionary; external zlibDLL;
+function inflate; external zlibDLL;
+function inflateEnd; external zlibDLL;
+function inflateInit2_; external zlibDLL;
+function inflateInit_; external zlibDLL;
+function inflateReset; external zlibDLL;
+function inflateSetDictionary; external zlibDLL;
+function inflateSync; external zlibDLL;
+
+end.
diff --git a/gnu/usr.bin/cvs/zlib/contrib/delphi2/d_zlib.bpr b/gnu/usr.bin/cvs/zlib/contrib/delphi2/d_zlib.bpr
new file mode 100644
index 00000000000..78bb254088a
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/contrib/delphi2/d_zlib.bpr
@@ -0,0 +1,224 @@
+# ---------------------------------------------------------------------------
+!if !$d(BCB)
+BCB = $(MAKEDIR)\..
+!endif
+
+# ---------------------------------------------------------------------------
+# IDE SECTION
+# ---------------------------------------------------------------------------
+# The following section of the project makefile is managed by the BCB IDE.
+# It is recommended to use the IDE to change any of the values in this
+# section.
+# ---------------------------------------------------------------------------
+
+VERSION = BCB.03
+# ---------------------------------------------------------------------------
+PROJECT = d_zlib.lib
+OBJFILES = d_zlib.obj adler32.obj deflate.obj infblock.obj infcodes.obj inffast.obj \
+ inflate.obj inftrees.obj infutil.obj trees.obj
+RESFILES =
+RESDEPEN = $(RESFILES)
+LIBFILES =
+LIBRARIES = VCL35.lib
+SPARELIBS = VCL35.lib
+DEFFILE =
+PACKAGES = VCLX35.bpi VCL35.bpi VCLDB35.bpi VCLDBX35.bpi ibsmp35.bpi bcbsmp35.bpi \
+ dclocx35.bpi QRPT35.bpi TEEUI35.bpi TEEDB35.bpi TEE35.bpi DSS35.bpi \
+ NMFAST35.bpi INETDB35.bpi INET35.bpi VCLMID35.bpi
+# ---------------------------------------------------------------------------
+PATHCPP = .;
+PATHASM = .;
+PATHPAS = .;
+PATHRC = .;
+DEBUGLIBPATH = $(BCB)\lib\debug
+RELEASELIBPATH = $(BCB)\lib\release
+# ---------------------------------------------------------------------------
+CFLAG1 = -O2 -Ve -d -k- -vi
+CFLAG2 = -I$(BCB)\include;$(BCB)\include\vcl -H=$(BCB)\lib\vcl35.csm
+CFLAG3 = -ff -pr -5
+PFLAGS = -U;$(DEBUGLIBPATH) -I$(BCB)\include;$(BCB)\include\vcl -H -W -$I- -v -JPHN -M
+RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl
+AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn
+LFLAGS =
+IFLAGS = -g -Gn
+# ---------------------------------------------------------------------------
+ALLOBJ = c0w32.obj $(OBJFILES)
+ALLRES = $(RESFILES)
+ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mt.lib
+# ---------------------------------------------------------------------------
+!!ifdef IDEOPTIONS
+
+[Version Info]
+IncludeVerInfo=0
+AutoIncBuild=0
+MajorVer=1
+MinorVer=0
+Release=0
+Build=0
+Debug=0
+PreRelease=0
+Special=0
+Private=0
+DLL=0
+Locale=1040
+CodePage=1252
+
+[Version Info Keys]
+CompanyName=
+FileDescription=
+FileVersion=1.0.0.0
+InternalName=
+LegalCopyright=
+LegalTrademarks=
+OriginalFilename=
+ProductName=
+ProductVersion=1.0.0.0
+Comments=
+
+[HistoryLists\hlIncludePath]
+Count=2
+Item0=$(BCB)\include
+Item1=$(BCB)\include;$(BCB)\include\vcl
+
+[HistoryLists\hlLibraryPath]
+Count=1
+Item0=$(BCB)\lib\obj;$(BCB)\lib
+
+[HistoryLists\hlDebugSourcePath]
+Count=1
+Item0=$(BCB)\source\vcl
+
+[Debugging]
+DebugSourceDirs=
+
+[Parameters]
+RunParams=
+HostApplication=
+
+!endif
+
+ ---------------------------------------------------------------------------
+# MAKE SECTION
+# ---------------------------------------------------------------------------
+# This section of the project file is not used by the BCB IDE. It is for
+# the benefit of building from the command-line using the MAKE utility.
+# ---------------------------------------------------------------------------
+
+.autodepend
+# ---------------------------------------------------------------------------
+!if !$d(BCC32)
+BCC32 = bcc32
+!endif
+
+!if !$d(DCC32)
+DCC32 = dcc32
+!endif
+
+!if !$d(TASM32)
+TASM32 = tasm32
+!endif
+
+!if !$d(LINKER)
+LINKER = TLib
+!endif
+
+!if !$d(BRCC32)
+BRCC32 = brcc32
+!endif
+# ---------------------------------------------------------------------------
+!if $d(PATHCPP)
+.PATH.CPP = $(PATHCPP)
+.PATH.C = $(PATHCPP)
+!endif
+
+!if $d(PATHPAS)
+.PATH.PAS = $(PATHPAS)
+!endif
+
+!if $d(PATHASM)
+.PATH.ASM = $(PATHASM)
+!endif
+
+!if $d(PATHRC)
+.PATH.RC = $(PATHRC)
+!endif
+# ---------------------------------------------------------------------------
+!ifdef IDEOPTIONS
+
+[Version Info]
+IncludeVerInfo=0
+AutoIncBuild=0
+MajorVer=1
+MinorVer=0
+Release=0
+Build=0
+Debug=0
+PreRelease=0
+Special=0
+Private=0
+DLL=0
+Locale=1040
+CodePage=1252
+
+[Version Info Keys]
+CompanyName=
+FileDescription=
+FileVersion=1.0.0.0
+InternalName=
+LegalCopyright=
+LegalTrademarks=
+OriginalFilename=
+ProductName=
+ProductVersion=1.0.0.0
+Comments=
+
+[HistoryLists\hlIncludePath]
+Count=2
+Item0=$(BCB)\include;$(BCB)\include\vcl
+Item1=$(BCB)\include
+
+[HistoryLists\hlLibraryPath]
+Count=1
+Item0=$(BCB)\lib\obj;$(BCB)\lib
+
+[HistoryLists\hlDebugSourcePath]
+Count=1
+Item0=$(BCB)\source\vcl
+
+[Debugging]
+DebugSourceDirs=
+
+[Parameters]
+RunParams=
+HostApplication=
+
+!endif
+
+$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE)
+ $(BCB)\BIN\$(LINKER) @&&!
+ $(LFLAGS) $(IFLAGS) +
+ $(ALLOBJ), +
+ $(PROJECT),, +
+ $(ALLLIB), +
+ $(DEFFILE), +
+ $(ALLRES)
+!
+# ---------------------------------------------------------------------------
+.pas.hpp:
+ $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< }
+
+.pas.obj:
+ $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< }
+
+.cpp.obj:
+ $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< }
+
+.c.obj:
+ $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< }
+
+.asm.obj:
+ $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@
+
+.rc.res:
+ $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $<
+# ---------------------------------------------------------------------------
diff --git a/gnu/usr.bin/cvs/zlib/contrib/delphi2/d_zlib.cpp b/gnu/usr.bin/cvs/zlib/contrib/delphi2/d_zlib.cpp
new file mode 100644
index 00000000000..f5dea59b762
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/contrib/delphi2/d_zlib.cpp
@@ -0,0 +1,17 @@
+#include <condefs.h>
+#pragma hdrstop
+//---------------------------------------------------------------------------
+USEUNIT("adler32.c");
+USEUNIT("deflate.c");
+USEUNIT("infblock.c");
+USEUNIT("infcodes.c");
+USEUNIT("inffast.c");
+USEUNIT("inflate.c");
+USEUNIT("inftrees.c");
+USEUNIT("infutil.c");
+USEUNIT("trees.c");
+//---------------------------------------------------------------------------
+#define Library
+
+// To add a file to the library use the Project menu 'Add to Project'.
+
diff --git a/gnu/usr.bin/cvs/zlib/contrib/delphi2/readme.txt b/gnu/usr.bin/cvs/zlib/contrib/delphi2/readme.txt
new file mode 100644
index 00000000000..cbd31620d87
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/contrib/delphi2/readme.txt
@@ -0,0 +1,17 @@
+These are files used to compile zlib under Borland C++ Builder 3.
+
+zlib.bpg is the main project group that can be loaded in the BCB IDE and
+loads all other *.bpr projects
+
+zlib.bpr is a project used to create a static zlib.lib library with C calling
+convention for functions.
+
+zlib32.bpr creates a zlib32.dll dynamic link library with Windows standard
+calling convention.
+
+d_zlib.bpr creates a set of .obj files with register calling convention.
+These files are used by zlib.pas to create a Delphi unit containing zlib.
+The d_zlib.lib file generated isn't useful and can be deleted.
+
+zlib.cpp, zlib32.cpp and d_zlib.cpp are used by the above projects.
+
diff --git a/gnu/usr.bin/cvs/zlib/contrib/delphi2/zlib.bpg b/gnu/usr.bin/cvs/zlib/contrib/delphi2/zlib.bpg
new file mode 100644
index 00000000000..b6c9acdf8c9
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/contrib/delphi2/zlib.bpg
@@ -0,0 +1,26 @@
+#------------------------------------------------------------------------------
+VERSION = BWS.01
+#------------------------------------------------------------------------------
+!ifndef ROOT
+ROOT = $(MAKEDIR)\..
+!endif
+#------------------------------------------------------------------------------
+MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$**
+DCC = $(ROOT)\bin\dcc32.exe $**
+BRCC = $(ROOT)\bin\brcc32.exe $**
+#------------------------------------------------------------------------------
+PROJECTS = zlib zlib32 d_zlib
+#------------------------------------------------------------------------------
+default: $(PROJECTS)
+#------------------------------------------------------------------------------
+
+zlib: zlib.bpr
+ $(MAKE)
+
+zlib32: zlib32.bpr
+ $(MAKE)
+
+d_zlib: d_zlib.bpr
+ $(MAKE)
+
+
diff --git a/gnu/usr.bin/cvs/zlib/contrib/delphi2/zlib.bpr b/gnu/usr.bin/cvs/zlib/contrib/delphi2/zlib.bpr
new file mode 100644
index 00000000000..cf3945b2523
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/contrib/delphi2/zlib.bpr
@@ -0,0 +1,225 @@
+# ---------------------------------------------------------------------------
+!if !$d(BCB)
+BCB = $(MAKEDIR)\..
+!endif
+
+# ---------------------------------------------------------------------------
+# IDE SECTION
+# ---------------------------------------------------------------------------
+# The following section of the project makefile is managed by the BCB IDE.
+# It is recommended to use the IDE to change any of the values in this
+# section.
+# ---------------------------------------------------------------------------
+
+VERSION = BCB.03
+# ---------------------------------------------------------------------------
+PROJECT = zlib.lib
+OBJFILES = zlib.obj adler32.obj compress.obj crc32.obj deflate.obj gzio.obj infblock.obj \
+ infcodes.obj inffast.obj inflate.obj inftrees.obj infutil.obj trees.obj \
+ uncompr.obj zutil.obj
+RESFILES =
+RESDEPEN = $(RESFILES)
+LIBFILES =
+LIBRARIES = VCL35.lib
+SPARELIBS = VCL35.lib
+DEFFILE =
+PACKAGES = VCLX35.bpi VCL35.bpi VCLDB35.bpi VCLDBX35.bpi ibsmp35.bpi bcbsmp35.bpi \
+ dclocx35.bpi QRPT35.bpi TEEUI35.bpi TEEDB35.bpi TEE35.bpi DSS35.bpi \
+ NMFAST35.bpi INETDB35.bpi INET35.bpi VCLMID35.bpi
+# ---------------------------------------------------------------------------
+PATHCPP = .;
+PATHASM = .;
+PATHPAS = .;
+PATHRC = .;
+DEBUGLIBPATH = $(BCB)\lib\debug
+RELEASELIBPATH = $(BCB)\lib\release
+# ---------------------------------------------------------------------------
+CFLAG1 = -O2 -Ve -d -k- -vi
+CFLAG2 = -I$(BCB)\include;$(BCB)\include\vcl -H=$(BCB)\lib\vcl35.csm
+CFLAG3 = -ff -5
+PFLAGS = -U;$(DEBUGLIBPATH) -I$(BCB)\include;$(BCB)\include\vcl -H -W -$I- -v -JPHN -M
+RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl
+AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn
+LFLAGS =
+IFLAGS = -g -Gn
+# ---------------------------------------------------------------------------
+ALLOBJ = c0w32.obj $(OBJFILES)
+ALLRES = $(RESFILES)
+ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mt.lib
+# ---------------------------------------------------------------------------
+!!ifdef IDEOPTIONS
+
+[Version Info]
+IncludeVerInfo=0
+AutoIncBuild=0
+MajorVer=1
+MinorVer=0
+Release=0
+Build=0
+Debug=0
+PreRelease=0
+Special=0
+Private=0
+DLL=0
+Locale=1040
+CodePage=1252
+
+[Version Info Keys]
+CompanyName=
+FileDescription=
+FileVersion=1.0.0.0
+InternalName=
+LegalCopyright=
+LegalTrademarks=
+OriginalFilename=
+ProductName=
+ProductVersion=1.0.0.0
+Comments=
+
+[HistoryLists\hlIncludePath]
+Count=2
+Item0=$(BCB)\include
+Item1=$(BCB)\include;$(BCB)\include\vcl
+
+[HistoryLists\hlLibraryPath]
+Count=1
+Item0=$(BCB)\lib\obj;$(BCB)\lib
+
+[HistoryLists\hlDebugSourcePath]
+Count=1
+Item0=$(BCB)\source\vcl
+
+[Debugging]
+DebugSourceDirs=
+
+[Parameters]
+RunParams=
+HostApplication=
+
+!endif
+
+ ---------------------------------------------------------------------------
+# MAKE SECTION
+# ---------------------------------------------------------------------------
+# This section of the project file is not used by the BCB IDE. It is for
+# the benefit of building from the command-line using the MAKE utility.
+# ---------------------------------------------------------------------------
+
+.autodepend
+# ---------------------------------------------------------------------------
+!if !$d(BCC32)
+BCC32 = bcc32
+!endif
+
+!if !$d(DCC32)
+DCC32 = dcc32
+!endif
+
+!if !$d(TASM32)
+TASM32 = tasm32
+!endif
+
+!if !$d(LINKER)
+LINKER = TLib
+!endif
+
+!if !$d(BRCC32)
+BRCC32 = brcc32
+!endif
+# ---------------------------------------------------------------------------
+!if $d(PATHCPP)
+.PATH.CPP = $(PATHCPP)
+.PATH.C = $(PATHCPP)
+!endif
+
+!if $d(PATHPAS)
+.PATH.PAS = $(PATHPAS)
+!endif
+
+!if $d(PATHASM)
+.PATH.ASM = $(PATHASM)
+!endif
+
+!if $d(PATHRC)
+.PATH.RC = $(PATHRC)
+!endif
+# ---------------------------------------------------------------------------
+!ifdef IDEOPTIONS
+
+[Version Info]
+IncludeVerInfo=0
+AutoIncBuild=0
+MajorVer=1
+MinorVer=0
+Release=0
+Build=0
+Debug=0
+PreRelease=0
+Special=0
+Private=0
+DLL=0
+Locale=1040
+CodePage=1252
+
+[Version Info Keys]
+CompanyName=
+FileDescription=
+FileVersion=1.0.0.0
+InternalName=
+LegalCopyright=
+LegalTrademarks=
+OriginalFilename=
+ProductName=
+ProductVersion=1.0.0.0
+Comments=
+
+[HistoryLists\hlIncludePath]
+Count=2
+Item0=$(BCB)\include;$(BCB)\include\vcl
+Item1=$(BCB)\include
+
+[HistoryLists\hlLibraryPath]
+Count=1
+Item0=$(BCB)\lib\obj;$(BCB)\lib
+
+[HistoryLists\hlDebugSourcePath]
+Count=1
+Item0=$(BCB)\source\vcl
+
+[Debugging]
+DebugSourceDirs=
+
+[Parameters]
+RunParams=
+HostApplication=
+
+!endif
+
+$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE)
+ $(BCB)\BIN\$(LINKER) @&&!
+ $(LFLAGS) $(IFLAGS) +
+ $(ALLOBJ), +
+ $(PROJECT),, +
+ $(ALLLIB), +
+ $(DEFFILE), +
+ $(ALLRES)
+!
+# ---------------------------------------------------------------------------
+.pas.hpp:
+ $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< }
+
+.pas.obj:
+ $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< }
+
+.cpp.obj:
+ $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< }
+
+.c.obj:
+ $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< }
+
+.asm.obj:
+ $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@
+
+.rc.res:
+ $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $<
+# ---------------------------------------------------------------------------
diff --git a/gnu/usr.bin/cvs/zlib/contrib/delphi2/zlib.cpp b/gnu/usr.bin/cvs/zlib/contrib/delphi2/zlib.cpp
new file mode 100644
index 00000000000..bf6953ba198
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/contrib/delphi2/zlib.cpp
@@ -0,0 +1,22 @@
+#include <condefs.h>
+#pragma hdrstop
+//---------------------------------------------------------------------------
+USEUNIT("adler32.c");
+USEUNIT("compress.c");
+USEUNIT("crc32.c");
+USEUNIT("deflate.c");
+USEUNIT("gzio.c");
+USEUNIT("infblock.c");
+USEUNIT("infcodes.c");
+USEUNIT("inffast.c");
+USEUNIT("inflate.c");
+USEUNIT("inftrees.c");
+USEUNIT("infutil.c");
+USEUNIT("trees.c");
+USEUNIT("uncompr.c");
+USEUNIT("zutil.c");
+//---------------------------------------------------------------------------
+#define Library
+
+// To add a file to the library use the Project menu 'Add to Project'.
+
diff --git a/gnu/usr.bin/cvs/zlib/contrib/delphi2/zlib.pas b/gnu/usr.bin/cvs/zlib/contrib/delphi2/zlib.pas
new file mode 100644
index 00000000000..10ae4cae256
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/contrib/delphi2/zlib.pas
@@ -0,0 +1,534 @@
+{*******************************************************}
+{ }
+{ Delphi Supplemental Components }
+{ ZLIB Data Compression Interface Unit }
+{ }
+{ Copyright (c) 1997 Borland International }
+{ }
+{*******************************************************}
+
+{ Modified for zlib 1.1.3 by Davide Moretti <dave@rimini.com }
+
+unit zlib;
+
+interface
+
+uses Sysutils, Classes;
+
+type
+ TAlloc = function (AppData: Pointer; Items, Size: Integer): Pointer;
+ TFree = procedure (AppData, Block: Pointer);
+
+ // Internal structure. Ignore.
+ TZStreamRec = packed record
+ next_in: PChar; // next input byte
+ avail_in: Integer; // number of bytes available at next_in
+ total_in: Integer; // total nb of input bytes read so far
+
+ next_out: PChar; // next output byte should be put here
+ avail_out: Integer; // remaining free space at next_out
+ total_out: Integer; // total nb of bytes output so far
+
+ msg: PChar; // last error message, NULL if no error
+ internal: Pointer; // not visible by applications
+
+ zalloc: TAlloc; // used to allocate the internal state
+ zfree: TFree; // used to free the internal state
+ AppData: Pointer; // private data object passed to zalloc and zfree
+
+ data_type: Integer; // best guess about the data type: ascii or binary
+ adler: Integer; // adler32 value of the uncompressed data
+ reserved: Integer; // reserved for future use
+ end;
+
+ // Abstract ancestor class
+ TCustomZlibStream = class(TStream)
+ private
+ FStrm: TStream;
+ FStrmPos: Integer;
+ FOnProgress: TNotifyEvent;
+ FZRec: TZStreamRec;
+ FBuffer: array [Word] of Char;
+ protected
+ procedure Progress(Sender: TObject); dynamic;
+ property OnProgress: TNotifyEvent read FOnProgress write FOnProgress;
+ constructor Create(Strm: TStream);
+ end;
+
+{ TCompressionStream compresses data on the fly as data is written to it, and
+ stores the compressed data to another stream.
+
+ TCompressionStream is write-only and strictly sequential. Reading from the
+ stream will raise an exception. Using Seek to move the stream pointer
+ will raise an exception.
+
+ Output data is cached internally, written to the output stream only when
+ the internal output buffer is full. All pending output data is flushed
+ when the stream is destroyed.
+
+ The Position property returns the number of uncompressed bytes of
+ data that have been written to the stream so far.
+
+ CompressionRate returns the on-the-fly percentage by which the original
+ data has been compressed: (1 - (CompressedBytes / UncompressedBytes)) * 100
+ If raw data size = 100 and compressed data size = 25, the CompressionRate
+ is 75%
+
+ The OnProgress event is called each time the output buffer is filled and
+ written to the output stream. This is useful for updating a progress
+ indicator when you are writing a large chunk of data to the compression
+ stream in a single call.}
+
+
+ TCompressionLevel = (clNone, clFastest, clDefault, clMax);
+
+ TCompressionStream = class(TCustomZlibStream)
+ private
+ function GetCompressionRate: Single;
+ public
+ constructor Create(CompressionLevel: TCompressionLevel; Dest: TStream);
+ destructor Destroy; override;
+ function Read(var Buffer; Count: Longint): Longint; override;
+ function Write(const Buffer; Count: Longint): Longint; override;
+ function Seek(Offset: Longint; Origin: Word): Longint; override;
+ property CompressionRate: Single read GetCompressionRate;
+ property OnProgress;
+ end;
+
+{ TDecompressionStream decompresses data on the fly as data is read from it.
+
+ Compressed data comes from a separate source stream. TDecompressionStream
+ is read-only and unidirectional; you can seek forward in the stream, but not
+ backwards. The special case of setting the stream position to zero is
+ allowed. Seeking forward decompresses data until the requested position in
+ the uncompressed data has been reached. Seeking backwards, seeking relative
+ to the end of the stream, requesting the size of the stream, and writing to
+ the stream will raise an exception.
+
+ The Position property returns the number of bytes of uncompressed data that
+ have been read from the stream so far.
+
+ The OnProgress event is called each time the internal input buffer of
+ compressed data is exhausted and the next block is read from the input stream.
+ This is useful for updating a progress indicator when you are reading a
+ large chunk of data from the decompression stream in a single call.}
+
+ TDecompressionStream = class(TCustomZlibStream)
+ public
+ constructor Create(Source: TStream);
+ destructor Destroy; override;
+ function Read(var Buffer; Count: Longint): Longint; override;
+ function Write(const Buffer; Count: Longint): Longint; override;
+ function Seek(Offset: Longint; Origin: Word): Longint; override;
+ property OnProgress;
+ end;
+
+
+
+{ CompressBuf compresses data, buffer to buffer, in one call.
+ In: InBuf = ptr to compressed data
+ InBytes = number of bytes in InBuf
+ Out: OutBuf = ptr to newly allocated buffer containing decompressed data
+ OutBytes = number of bytes in OutBuf }
+procedure CompressBuf(const InBuf: Pointer; InBytes: Integer;
+ out OutBuf: Pointer; out OutBytes: Integer);
+
+
+{ DecompressBuf decompresses data, buffer to buffer, in one call.
+ In: InBuf = ptr to compressed data
+ InBytes = number of bytes in InBuf
+ OutEstimate = zero, or est. size of the decompressed data
+ Out: OutBuf = ptr to newly allocated buffer containing decompressed data
+ OutBytes = number of bytes in OutBuf }
+procedure DecompressBuf(const InBuf: Pointer; InBytes: Integer;
+ OutEstimate: Integer; out OutBuf: Pointer; out OutBytes: Integer);
+
+const
+ zlib_version = '1.1.3';
+
+type
+ EZlibError = class(Exception);
+ ECompressionError = class(EZlibError);
+ EDecompressionError = class(EZlibError);
+
+function adler32(adler: Integer; buf: PChar; len: Integer): Integer;
+
+implementation
+
+const
+ Z_NO_FLUSH = 0;
+ Z_PARTIAL_FLUSH = 1;
+ Z_SYNC_FLUSH = 2;
+ Z_FULL_FLUSH = 3;
+ Z_FINISH = 4;
+
+ Z_OK = 0;
+ Z_STREAM_END = 1;
+ Z_NEED_DICT = 2;
+ Z_ERRNO = (-1);
+ Z_STREAM_ERROR = (-2);
+ Z_DATA_ERROR = (-3);
+ Z_MEM_ERROR = (-4);
+ Z_BUF_ERROR = (-5);
+ Z_VERSION_ERROR = (-6);
+
+ Z_NO_COMPRESSION = 0;
+ Z_BEST_SPEED = 1;
+ Z_BEST_COMPRESSION = 9;
+ Z_DEFAULT_COMPRESSION = (-1);
+
+ Z_FILTERED = 1;
+ Z_HUFFMAN_ONLY = 2;
+ Z_DEFAULT_STRATEGY = 0;
+
+ Z_BINARY = 0;
+ Z_ASCII = 1;
+ Z_UNKNOWN = 2;
+
+ Z_DEFLATED = 8;
+
+ _z_errmsg: array[0..9] of PChar = (
+ 'need dictionary', // Z_NEED_DICT (2)
+ 'stream end', // Z_STREAM_END (1)
+ '', // Z_OK (0)
+ 'file error', // Z_ERRNO (-1)
+ 'stream error', // Z_STREAM_ERROR (-2)
+ 'data error', // Z_DATA_ERROR (-3)
+ 'insufficient memory', // Z_MEM_ERROR (-4)
+ 'buffer error', // Z_BUF_ERROR (-5)
+ 'incompatible version', // Z_VERSION_ERROR (-6)
+ ''
+ );
+
+{$L deflate.obj}
+{$L inflate.obj}
+{$L inftrees.obj}
+{$L trees.obj}
+{$L adler32.obj}
+{$L infblock.obj}
+{$L infcodes.obj}
+{$L infutil.obj}
+{$L inffast.obj}
+
+procedure _tr_init; external;
+procedure _tr_tally; external;
+procedure _tr_flush_block; external;
+procedure _tr_align; external;
+procedure _tr_stored_block; external;
+function adler32; external;
+procedure inflate_blocks_new; external;
+procedure inflate_blocks; external;
+procedure inflate_blocks_reset; external;
+procedure inflate_blocks_free; external;
+procedure inflate_set_dictionary; external;
+procedure inflate_trees_bits; external;
+procedure inflate_trees_dynamic; external;
+procedure inflate_trees_fixed; external;
+procedure inflate_codes_new; external;
+procedure inflate_codes; external;
+procedure inflate_codes_free; external;
+procedure _inflate_mask; external;
+procedure inflate_flush; external;
+procedure inflate_fast; external;
+
+procedure _memset(P: Pointer; B: Byte; count: Integer);cdecl;
+begin
+ FillChar(P^, count, B);
+end;
+
+procedure _memcpy(dest, source: Pointer; count: Integer);cdecl;
+begin
+ Move(source^, dest^, count);
+end;
+
+
+
+// deflate compresses data
+function deflateInit_(var strm: TZStreamRec; level: Integer; version: PChar;
+ recsize: Integer): Integer; external;
+function deflate(var strm: TZStreamRec; flush: Integer): Integer; external;
+function deflateEnd(var strm: TZStreamRec): Integer; external;
+
+// inflate decompresses data
+function inflateInit_(var strm: TZStreamRec; version: PChar;
+ recsize: Integer): Integer; external;
+function inflate(var strm: TZStreamRec; flush: Integer): Integer; external;
+function inflateEnd(var strm: TZStreamRec): Integer; external;
+function inflateReset(var strm: TZStreamRec): Integer; external;
+
+
+function zcalloc(AppData: Pointer; Items, Size: Integer): Pointer;
+begin
+ GetMem(Result, Items*Size);
+end;
+
+procedure zcfree(AppData, Block: Pointer);
+begin
+ FreeMem(Block);
+end;
+
+function zlibCheck(code: Integer): Integer;
+begin
+ Result := code;
+ if code < 0 then
+ raise EZlibError.Create('error'); //!!
+end;
+
+function CCheck(code: Integer): Integer;
+begin
+ Result := code;
+ if code < 0 then
+ raise ECompressionError.Create('error'); //!!
+end;
+
+function DCheck(code: Integer): Integer;
+begin
+ Result := code;
+ if code < 0 then
+ raise EDecompressionError.Create('error'); //!!
+end;
+
+procedure CompressBuf(const InBuf: Pointer; InBytes: Integer;
+ out OutBuf: Pointer; out OutBytes: Integer);
+var
+ strm: TZStreamRec;
+ P: Pointer;
+begin
+ FillChar(strm, sizeof(strm), 0);
+ OutBytes := ((InBytes + (InBytes div 10) + 12) + 255) and not 255;
+ GetMem(OutBuf, OutBytes);
+ try
+ strm.next_in := InBuf;
+ strm.avail_in := InBytes;
+ strm.next_out := OutBuf;
+ strm.avail_out := OutBytes;
+ CCheck(deflateInit_(strm, Z_BEST_COMPRESSION, zlib_version, sizeof(strm)));
+ try
+ while CCheck(deflate(strm, Z_FINISH)) <> Z_STREAM_END do
+ begin
+ P := OutBuf;
+ Inc(OutBytes, 256);
+ ReallocMem(OutBuf, OutBytes);
+ strm.next_out := PChar(Integer(OutBuf) + (Integer(strm.next_out) - Integer(P)));
+ strm.avail_out := 256;
+ end;
+ finally
+ CCheck(deflateEnd(strm));
+ end;
+ ReallocMem(OutBuf, strm.total_out);
+ OutBytes := strm.total_out;
+ except
+ FreeMem(OutBuf);
+ raise
+ end;
+end;
+
+
+procedure DecompressBuf(const InBuf: Pointer; InBytes: Integer;
+ OutEstimate: Integer; out OutBuf: Pointer; out OutBytes: Integer);
+var
+ strm: TZStreamRec;
+ P: Pointer;
+ BufInc: Integer;
+begin
+ FillChar(strm, sizeof(strm), 0);
+ BufInc := (InBytes + 255) and not 255;
+ if OutEstimate = 0 then
+ OutBytes := BufInc
+ else
+ OutBytes := OutEstimate;
+ GetMem(OutBuf, OutBytes);
+ try
+ strm.next_in := InBuf;
+ strm.avail_in := InBytes;
+ strm.next_out := OutBuf;
+ strm.avail_out := OutBytes;
+ DCheck(inflateInit_(strm, zlib_version, sizeof(strm)));
+ try
+ while DCheck(inflate(strm, Z_FINISH)) <> Z_STREAM_END do
+ begin
+ P := OutBuf;
+ Inc(OutBytes, BufInc);
+ ReallocMem(OutBuf, OutBytes);
+ strm.next_out := PChar(Integer(OutBuf) + (Integer(strm.next_out) - Integer(P)));
+ strm.avail_out := BufInc;
+ end;
+ finally
+ DCheck(inflateEnd(strm));
+ end;
+ ReallocMem(OutBuf, strm.total_out);
+ OutBytes := strm.total_out;
+ except
+ FreeMem(OutBuf);
+ raise
+ end;
+end;
+
+
+// TCustomZlibStream
+
+constructor TCustomZLibStream.Create(Strm: TStream);
+begin
+ inherited Create;
+ FStrm := Strm;
+ FStrmPos := Strm.Position;
+end;
+
+procedure TCustomZLibStream.Progress(Sender: TObject);
+begin
+ if Assigned(FOnProgress) then FOnProgress(Sender);
+end;
+
+
+// TCompressionStream
+
+constructor TCompressionStream.Create(CompressionLevel: TCompressionLevel;
+ Dest: TStream);
+const
+ Levels: array [TCompressionLevel] of ShortInt =
+ (Z_NO_COMPRESSION, Z_BEST_SPEED, Z_DEFAULT_COMPRESSION, Z_BEST_COMPRESSION);
+begin
+ inherited Create(Dest);
+ FZRec.next_out := FBuffer;
+ FZRec.avail_out := sizeof(FBuffer);
+ CCheck(deflateInit_(FZRec, Levels[CompressionLevel], zlib_version, sizeof(FZRec)));
+end;
+
+destructor TCompressionStream.Destroy;
+begin
+ FZRec.next_in := nil;
+ FZRec.avail_in := 0;
+ try
+ if FStrm.Position <> FStrmPos then FStrm.Position := FStrmPos;
+ while (CCheck(deflate(FZRec, Z_FINISH)) <> Z_STREAM_END)
+ and (FZRec.avail_out = 0) do
+ begin
+ FStrm.WriteBuffer(FBuffer, sizeof(FBuffer));
+ FZRec.next_out := FBuffer;
+ FZRec.avail_out := sizeof(FBuffer);
+ end;
+ if FZRec.avail_out < sizeof(FBuffer) then
+ FStrm.WriteBuffer(FBuffer, sizeof(FBuffer) - FZRec.avail_out);
+ finally
+ deflateEnd(FZRec);
+ end;
+ inherited Destroy;
+end;
+
+function TCompressionStream.Read(var Buffer; Count: Longint): Longint;
+begin
+ raise ECompressionError.Create('Invalid stream operation');
+end;
+
+function TCompressionStream.Write(const Buffer; Count: Longint): Longint;
+begin
+ FZRec.next_in := @Buffer;
+ FZRec.avail_in := Count;
+ if FStrm.Position <> FStrmPos then FStrm.Position := FStrmPos;
+ while (FZRec.avail_in > 0) do
+ begin
+ CCheck(deflate(FZRec, 0));
+ if FZRec.avail_out = 0 then
+ begin
+ FStrm.WriteBuffer(FBuffer, sizeof(FBuffer));
+ FZRec.next_out := FBuffer;
+ FZRec.avail_out := sizeof(FBuffer);
+ FStrmPos := FStrm.Position;
+ Progress(Self);
+ end;
+ end;
+ Result := Count;
+end;
+
+function TCompressionStream.Seek(Offset: Longint; Origin: Word): Longint;
+begin
+ if (Offset = 0) and (Origin = soFromCurrent) then
+ Result := FZRec.total_in
+ else
+ raise ECompressionError.Create('Invalid stream operation');
+end;
+
+function TCompressionStream.GetCompressionRate: Single;
+begin
+ if FZRec.total_in = 0 then
+ Result := 0
+ else
+ Result := (1.0 - (FZRec.total_out / FZRec.total_in)) * 100.0;
+end;
+
+
+// TDecompressionStream
+
+constructor TDecompressionStream.Create(Source: TStream);
+begin
+ inherited Create(Source);
+ FZRec.next_in := FBuffer;
+ FZRec.avail_in := 0;
+ DCheck(inflateInit_(FZRec, zlib_version, sizeof(FZRec)));
+end;
+
+destructor TDecompressionStream.Destroy;
+begin
+ inflateEnd(FZRec);
+ inherited Destroy;
+end;
+
+function TDecompressionStream.Read(var Buffer; Count: Longint): Longint;
+begin
+ FZRec.next_out := @Buffer;
+ FZRec.avail_out := Count;
+ if FStrm.Position <> FStrmPos then FStrm.Position := FStrmPos;
+ while (FZRec.avail_out > 0) do
+ begin
+ if FZRec.avail_in = 0 then
+ begin
+ FZRec.avail_in := FStrm.Read(FBuffer, sizeof(FBuffer));
+ if FZRec.avail_in = 0 then
+ begin
+ Result := Count - FZRec.avail_out;
+ Exit;
+ end;
+ FZRec.next_in := FBuffer;
+ FStrmPos := FStrm.Position;
+ Progress(Self);
+ end;
+ DCheck(inflate(FZRec, 0));
+ end;
+ Result := Count;
+end;
+
+function TDecompressionStream.Write(const Buffer; Count: Longint): Longint;
+begin
+ raise EDecompressionError.Create('Invalid stream operation');
+end;
+
+function TDecompressionStream.Seek(Offset: Longint; Origin: Word): Longint;
+var
+ I: Integer;
+ Buf: array [0..4095] of Char;
+begin
+ if (Offset = 0) and (Origin = soFromBeginning) then
+ begin
+ DCheck(inflateReset(FZRec));
+ FZRec.next_in := FBuffer;
+ FZRec.avail_in := 0;
+ FStrm.Position := 0;
+ FStrmPos := 0;
+ end
+ else if ( (Offset >= 0) and (Origin = soFromCurrent)) or
+ ( ((Offset - FZRec.total_out) > 0) and (Origin = soFromBeginning)) then
+ begin
+ if Origin = soFromBeginning then Dec(Offset, FZRec.total_out);
+ if Offset > 0 then
+ begin
+ for I := 1 to Offset div sizeof(Buf) do
+ ReadBuffer(Buf, sizeof(Buf));
+ ReadBuffer(Buf, Offset mod sizeof(Buf));
+ end;
+ end
+ else
+ raise EDecompressionError.Create('Invalid stream operation');
+ Result := FZRec.total_out;
+end;
+
+end.
diff --git a/gnu/usr.bin/cvs/zlib/contrib/delphi2/zlib32.bpr b/gnu/usr.bin/cvs/zlib/contrib/delphi2/zlib32.bpr
new file mode 100644
index 00000000000..cabcec44947
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/contrib/delphi2/zlib32.bpr
@@ -0,0 +1,174 @@
+# ---------------------------------------------------------------------------
+!if !$d(BCB)
+BCB = $(MAKEDIR)\..
+!endif
+
+# ---------------------------------------------------------------------------
+# IDE SECTION
+# ---------------------------------------------------------------------------
+# The following section of the project makefile is managed by the BCB IDE.
+# It is recommended to use the IDE to change any of the values in this
+# section.
+# ---------------------------------------------------------------------------
+
+VERSION = BCB.03
+# ---------------------------------------------------------------------------
+PROJECT = zlib32.dll
+OBJFILES = zlib32.obj adler32.obj compress.obj crc32.obj deflate.obj gzio.obj infblock.obj \
+ infcodes.obj inffast.obj inflate.obj inftrees.obj infutil.obj trees.obj \
+ uncompr.obj zutil.obj
+RESFILES =
+RESDEPEN = $(RESFILES)
+LIBFILES =
+LIBRARIES =
+SPARELIBS =
+DEFFILE =
+PACKAGES = VCLX35.bpi VCL35.bpi VCLDB35.bpi VCLDBX35.bpi ibsmp35.bpi bcbsmp35.bpi \
+ dclocx35.bpi QRPT35.bpi TEEUI35.bpi TEEDB35.bpi TEE35.bpi DSS35.bpi \
+ NMFAST35.bpi INETDB35.bpi INET35.bpi VCLMID35.bpi
+# ---------------------------------------------------------------------------
+PATHCPP = .;
+PATHASM = .;
+PATHPAS = .;
+PATHRC = .;
+DEBUGLIBPATH = $(BCB)\lib\debug
+RELEASELIBPATH = $(BCB)\lib\release
+# ---------------------------------------------------------------------------
+CFLAG1 = -WD -O2 -Ve -d -k- -vi -c -tWD
+CFLAG2 = -D_NO_VCL;ZLIB_DLL -I$(BCB)\include
+CFLAG3 = -ff -5
+PFLAGS = -D_NO_VCL;ZLIB_DLL -U$(BCB)\lib;$(RELEASELIBPATH) -I$(BCB)\include -$I- -v \
+ -JPHN -M
+RFLAGS = -D_NO_VCL;ZLIB_DLL -i$(BCB)\include
+AFLAGS = /i$(BCB)\include /d_NO_VCL /dZLIB_DLL /mx /w2 /zn
+LFLAGS = -L$(BCB)\lib;$(RELEASELIBPATH) -aa -Tpd -x -Gi
+IFLAGS = -Gn -g
+# ---------------------------------------------------------------------------
+ALLOBJ = c0d32.obj $(OBJFILES)
+ALLRES = $(RESFILES)
+ALLLIB = $(LIBFILES) import32.lib cw32mt.lib
+# ---------------------------------------------------------------------------
+!ifdef IDEOPTIONS
+
+[Version Info]
+IncludeVerInfo=0
+AutoIncBuild=0
+MajorVer=1
+MinorVer=0
+Release=0
+Build=0
+Debug=0
+PreRelease=0
+Special=0
+Private=0
+DLL=1
+Locale=1040
+CodePage=1252
+
+[Version Info Keys]
+CompanyName=
+FileDescription=DLL (GUI)
+FileVersion=1.0.0.0
+InternalName=
+LegalCopyright=
+LegalTrademarks=
+OriginalFilename=
+ProductName=
+ProductVersion=1.0.0.0
+Comments=
+
+[HistoryLists\hlIncludePath]
+Count=1
+Item0=$(BCB)\include
+
+[HistoryLists\hlLibraryPath]
+Count=1
+Item0=$(BCB)\lib
+
+[HistoryLists\hlConditionals]
+Count=1
+Item0=_NO_VCL;ZLIB_DLL
+
+[Debugging]
+DebugSourceDirs=
+
+[Parameters]
+RunParams=
+HostApplication=
+
+!endif
+
+# ---------------------------------------------------------------------------
+# MAKE SECTION
+# ---------------------------------------------------------------------------
+# This section of the project file is not used by the BCB IDE. It is for
+# the benefit of building from the command-line using the MAKE utility.
+# ---------------------------------------------------------------------------
+
+.autodepend
+# ---------------------------------------------------------------------------
+!if !$d(BCC32)
+BCC32 = bcc32
+!endif
+
+!if !$d(DCC32)
+DCC32 = dcc32
+!endif
+
+!if !$d(TASM32)
+TASM32 = tasm32
+!endif
+
+!if !$d(LINKER)
+LINKER = ilink32
+!endif
+
+!if !$d(BRCC32)
+BRCC32 = brcc32
+!endif
+# ---------------------------------------------------------------------------
+!if $d(PATHCPP)
+.PATH.CPP = $(PATHCPP)
+.PATH.C = $(PATHCPP)
+!endif
+
+!if $d(PATHPAS)
+.PATH.PAS = $(PATHPAS)
+!endif
+
+!if $d(PATHASM)
+.PATH.ASM = $(PATHASM)
+!endif
+
+!if $d(PATHRC)
+.PATH.RC = $(PATHRC)
+!endif
+# ---------------------------------------------------------------------------
+$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE)
+ $(BCB)\BIN\$(LINKER) @&&!
+ $(LFLAGS) $(IFLAGS) +
+ $(ALLOBJ), +
+ $(PROJECT),, +
+ $(ALLLIB), +
+ $(DEFFILE), +
+ $(ALLRES)
+!
+# ---------------------------------------------------------------------------
+.pas.hpp:
+ $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< }
+
+.pas.obj:
+ $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< }
+
+.cpp.obj:
+ $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< }
+
+.c.obj:
+ $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< }
+
+.asm.obj:
+ $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@
+
+.rc.res:
+ $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $<
+# ---------------------------------------------------------------------------
diff --git a/gnu/usr.bin/cvs/zlib/contrib/delphi2/zlib32.cpp b/gnu/usr.bin/cvs/zlib/contrib/delphi2/zlib32.cpp
new file mode 100644
index 00000000000..7372f6b985f
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/contrib/delphi2/zlib32.cpp
@@ -0,0 +1,42 @@
+
+#include <windows.h>
+#pragma hdrstop
+#include <condefs.h>
+
+
+//---------------------------------------------------------------------------
+// Important note about DLL memory management in a VCL DLL:
+//
+//
+//
+// If your DLL uses VCL and exports any functions that pass VCL String objects
+// (or structs/classes containing nested Strings) as parameter or function
+// results, you will need to build both your DLL project and any EXE projects
+// that use your DLL with the dynamic RTL (the RTL DLL). This will change your
+// DLL and its calling EXE's to use BORLNDMM.DLL as their memory manager. In
+// these cases, the file BORLNDMM.DLL should be deployed along with your DLL
+// and the RTL DLL (CP3240MT.DLL). To avoid the requiring BORLNDMM.DLL in
+// these situations, pass string information using "char *" or ShortString
+// parameters and then link with the static RTL.
+//
+//---------------------------------------------------------------------------
+USEUNIT("adler32.c");
+USEUNIT("compress.c");
+USEUNIT("crc32.c");
+USEUNIT("deflate.c");
+USEUNIT("gzio.c");
+USEUNIT("infblock.c");
+USEUNIT("infcodes.c");
+USEUNIT("inffast.c");
+USEUNIT("inflate.c");
+USEUNIT("inftrees.c");
+USEUNIT("infutil.c");
+USEUNIT("trees.c");
+USEUNIT("uncompr.c");
+USEUNIT("zutil.c");
+//---------------------------------------------------------------------------
+#pragma argsused
+int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*)
+{
+ return 1;
+}
diff --git a/gnu/usr.bin/cvs/zlib/contrib/iostream/test.cpp b/gnu/usr.bin/cvs/zlib/contrib/iostream/test.cpp
new file mode 100644
index 00000000000..7d265b3b5c0
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/contrib/iostream/test.cpp
@@ -0,0 +1,24 @@
+
+#include "zfstream.h"
+
+int main() {
+
+ // Construct a stream object with this filebuffer. Anything sent
+ // to this stream will go to standard out.
+ gzofstream os( 1, ios::out );
+
+ // This text is getting compressed and sent to stdout.
+ // To prove this, run 'test | zcat'.
+ os << "Hello, Mommy" << endl;
+
+ os << setcompressionlevel( Z_NO_COMPRESSION );
+ os << "hello, hello, hi, ho!" << endl;
+
+ setcompressionlevel( os, Z_DEFAULT_COMPRESSION )
+ << "I'm compressing again" << endl;
+
+ os.close();
+
+ return 0;
+
+}
diff --git a/gnu/usr.bin/cvs/zlib/contrib/iostream/zfstream.cpp b/gnu/usr.bin/cvs/zlib/contrib/iostream/zfstream.cpp
new file mode 100644
index 00000000000..a690bbefceb
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/contrib/iostream/zfstream.cpp
@@ -0,0 +1,329 @@
+
+#include <memory.h>
+#include "zfstream.h"
+
+gzfilebuf::gzfilebuf() :
+ file(NULL),
+ mode(0),
+ own_file_descriptor(0)
+{ }
+
+gzfilebuf::~gzfilebuf() {
+
+ sync();
+ if ( own_file_descriptor )
+ close();
+
+}
+
+gzfilebuf *gzfilebuf::open( const char *name,
+ int io_mode ) {
+
+ if ( is_open() )
+ return NULL;
+
+ char char_mode[10];
+ char *p;
+ memset(char_mode,'\0',10);
+ p = char_mode;
+
+ if ( io_mode & ios::in ) {
+ mode = ios::in;
+ *p++ = 'r';
+ } else if ( io_mode & ios::app ) {
+ mode = ios::app;
+ *p++ = 'a';
+ } else {
+ mode = ios::out;
+ *p++ = 'w';
+ }
+
+ if ( io_mode & ios::binary ) {
+ mode |= ios::binary;
+ *p++ = 'b';
+ }
+
+ // Hard code the compression level
+ if ( io_mode & (ios::out|ios::app )) {
+ *p++ = '9';
+ }
+
+ if ( (file = gzopen(name, char_mode)) == NULL )
+ return NULL;
+
+ own_file_descriptor = 1;
+
+ return this;
+
+}
+
+gzfilebuf *gzfilebuf::attach( int file_descriptor,
+ int io_mode ) {
+
+ if ( is_open() )
+ return NULL;
+
+ char char_mode[10];
+ char *p;
+ memset(char_mode,'\0',10);
+ p = char_mode;
+
+ if ( io_mode & ios::in ) {
+ mode = ios::in;
+ *p++ = 'r';
+ } else if ( io_mode & ios::app ) {
+ mode = ios::app;
+ *p++ = 'a';
+ } else {
+ mode = ios::out;
+ *p++ = 'w';
+ }
+
+ if ( io_mode & ios::binary ) {
+ mode |= ios::binary;
+ *p++ = 'b';
+ }
+
+ // Hard code the compression level
+ if ( io_mode & (ios::out|ios::app )) {
+ *p++ = '9';
+ }
+
+ if ( (file = gzdopen(file_descriptor, char_mode)) == NULL )
+ return NULL;
+
+ own_file_descriptor = 0;
+
+ return this;
+
+}
+
+gzfilebuf *gzfilebuf::close() {
+
+ if ( is_open() ) {
+
+ sync();
+ gzclose( file );
+ file = NULL;
+
+ }
+
+ return this;
+
+}
+
+int gzfilebuf::setcompressionlevel( short comp_level ) {
+
+ return gzsetparams(file, comp_level, -2);
+
+}
+
+int gzfilebuf::setcompressionstrategy( short comp_strategy ) {
+
+ return gzsetparams(file, -2, comp_strategy);
+
+}
+
+
+streampos gzfilebuf::seekoff( streamoff off, ios::seek_dir dir, int which ) {
+
+ return streampos(EOF);
+
+}
+
+int gzfilebuf::underflow() {
+
+ // If the file hasn't been opened for reading, error.
+ if ( !is_open() || !(mode & ios::in) )
+ return EOF;
+
+ // if a buffer doesn't exists, allocate one.
+ if ( !base() ) {
+
+ if ( (allocate()) == EOF )
+ return EOF;
+ setp(0,0);
+
+ } else {
+
+ if ( in_avail() )
+ return (unsigned char) *gptr();
+
+ if ( out_waiting() ) {
+ if ( flushbuf() == EOF )
+ return EOF;
+ }
+
+ }
+
+ // Attempt to fill the buffer.
+
+ int result = fillbuf();
+ if ( result == EOF ) {
+ // disable get area
+ setg(0,0,0);
+ return EOF;
+ }
+
+ return (unsigned char) *gptr();
+
+}
+
+int gzfilebuf::overflow( int c ) {
+
+ if ( !is_open() || !(mode & ios::out) )
+ return EOF;
+
+ if ( !base() ) {
+ if ( allocate() == EOF )
+ return EOF;
+ setg(0,0,0);
+ } else {
+ if (in_avail()) {
+ return EOF;
+ }
+ if (out_waiting()) {
+ if (flushbuf() == EOF)
+ return EOF;
+ }
+ }
+
+ int bl = blen();
+ setp( base(), base() + bl);
+
+ if ( c != EOF ) {
+
+ *pptr() = c;
+ pbump(1);
+
+ }
+
+ return 0;
+
+}
+
+int gzfilebuf::sync() {
+
+ if ( !is_open() )
+ return EOF;
+
+ if ( out_waiting() )
+ return flushbuf();
+
+ return 0;
+
+}
+
+int gzfilebuf::flushbuf() {
+
+ int n;
+ char *q;
+
+ q = pbase();
+ n = pptr() - q;
+
+ if ( gzwrite( file, q, n) < n )
+ return EOF;
+
+ setp(0,0);
+
+ return 0;
+
+}
+
+int gzfilebuf::fillbuf() {
+
+ int required;
+ char *p;
+
+ p = base();
+
+ required = blen();
+
+ int t = gzread( file, p, required );
+
+ if ( t <= 0) return EOF;
+
+ setg( base(), base(), base()+t);
+
+ return t;
+
+}
+
+gzfilestream_common::gzfilestream_common() :
+ ios( gzfilestream_common::rdbuf() )
+{ }
+
+gzfilestream_common::~gzfilestream_common()
+{ }
+
+void gzfilestream_common::attach( int fd, int io_mode ) {
+
+ if ( !buffer.attach( fd, io_mode) )
+ clear( ios::failbit | ios::badbit );
+ else
+ clear();
+
+}
+
+void gzfilestream_common::open( const char *name, int io_mode ) {
+
+ if ( !buffer.open( name, io_mode ) )
+ clear( ios::failbit | ios::badbit );
+ else
+ clear();
+
+}
+
+void gzfilestream_common::close() {
+
+ if ( !buffer.close() )
+ clear( ios::failbit | ios::badbit );
+
+}
+
+gzfilebuf *gzfilestream_common::rdbuf() {
+
+ return &buffer;
+
+}
+
+gzifstream::gzifstream() :
+ ios( gzfilestream_common::rdbuf() )
+{
+ clear( ios::badbit );
+}
+
+gzifstream::gzifstream( const char *name, int io_mode ) :
+ ios( gzfilestream_common::rdbuf() )
+{
+ gzfilestream_common::open( name, io_mode );
+}
+
+gzifstream::gzifstream( int fd, int io_mode ) :
+ ios( gzfilestream_common::rdbuf() )
+{
+ gzfilestream_common::attach( fd, io_mode );
+}
+
+gzifstream::~gzifstream() { }
+
+gzofstream::gzofstream() :
+ ios( gzfilestream_common::rdbuf() )
+{
+ clear( ios::badbit );
+}
+
+gzofstream::gzofstream( const char *name, int io_mode ) :
+ ios( gzfilestream_common::rdbuf() )
+{
+ gzfilestream_common::open( name, io_mode );
+}
+
+gzofstream::gzofstream( int fd, int io_mode ) :
+ ios( gzfilestream_common::rdbuf() )
+{
+ gzfilestream_common::attach( fd, io_mode );
+}
+
+gzofstream::~gzofstream() { }
diff --git a/gnu/usr.bin/cvs/zlib/contrib/iostream/zfstream.h b/gnu/usr.bin/cvs/zlib/contrib/iostream/zfstream.h
new file mode 100644
index 00000000000..c87fa08e9d1
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/contrib/iostream/zfstream.h
@@ -0,0 +1,142 @@
+
+#ifndef _zfstream_h
+#define _zfstream_h
+
+#include <fstream.h>
+#include "zlib.h"
+
+class gzfilebuf : public streambuf {
+
+public:
+
+ gzfilebuf( );
+ virtual ~gzfilebuf();
+
+ gzfilebuf *open( const char *name, int io_mode );
+ gzfilebuf *attach( int file_descriptor, int io_mode );
+ gzfilebuf *close();
+
+ int setcompressionlevel( short comp_level );
+ int setcompressionstrategy( short comp_strategy );
+
+ inline int is_open() const { return (file !=NULL); }
+
+ virtual streampos seekoff( streamoff, ios::seek_dir, int );
+
+ virtual int sync();
+
+protected:
+
+ virtual int underflow();
+ virtual int overflow( int = EOF );
+
+private:
+
+ gzFile file;
+ short mode;
+ short own_file_descriptor;
+
+ int flushbuf();
+ int fillbuf();
+
+};
+
+class gzfilestream_common : virtual public ios {
+
+ friend class gzifstream;
+ friend class gzofstream;
+ friend gzofstream &setcompressionlevel( gzofstream &, int );
+ friend gzofstream &setcompressionstrategy( gzofstream &, int );
+
+public:
+ virtual ~gzfilestream_common();
+
+ void attach( int fd, int io_mode );
+ void open( const char *name, int io_mode );
+ void close();
+
+protected:
+ gzfilestream_common();
+
+private:
+ gzfilebuf *rdbuf();
+
+ gzfilebuf buffer;
+
+};
+
+class gzifstream : public gzfilestream_common, public istream {
+
+public:
+
+ gzifstream();
+ gzifstream( const char *name, int io_mode = ios::in );
+ gzifstream( int fd, int io_mode = ios::in );
+
+ virtual ~gzifstream();
+
+};
+
+class gzofstream : public gzfilestream_common, public ostream {
+
+public:
+
+ gzofstream();
+ gzofstream( const char *name, int io_mode = ios::out );
+ gzofstream( int fd, int io_mode = ios::out );
+
+ virtual ~gzofstream();
+
+};
+
+template<class T> class gzomanip {
+ friend gzofstream &operator<<(gzofstream &, const gzomanip<T> &);
+public:
+ gzomanip(gzofstream &(*f)(gzofstream &, T), T v) : func(f), val(v) { }
+private:
+ gzofstream &(*func)(gzofstream &, T);
+ T val;
+};
+
+template<class T> gzofstream &operator<<(gzofstream &s,
+ const gzomanip<T> &m) {
+ return (*m.func)(s, m.val);
+
+}
+
+inline gzofstream &setcompressionlevel( gzofstream &s, int l ) {
+ (s.rdbuf())->setcompressionlevel(l);
+ return s;
+}
+
+inline gzofstream &setcompressionstrategy( gzofstream &s, int l ) {
+ (s.rdbuf())->setcompressionstrategy(l);
+ return s;
+}
+
+inline gzomanip<int> setcompressionlevel(int l)
+{
+ return gzomanip<int>(&setcompressionlevel,l);
+}
+
+inline gzomanip<int> setcompressionstrategy(int l)
+{
+ return gzomanip<int>(&setcompressionstrategy,l);
+}
+
+#endif
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/gnu/usr.bin/cvs/zlib/contrib/iostream2/zstream.h b/gnu/usr.bin/cvs/zlib/contrib/iostream2/zstream.h
new file mode 100644
index 00000000000..ac252d94164
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/contrib/iostream2/zstream.h
@@ -0,0 +1,307 @@
+/*
+ *
+ * Copyright (c) 1997
+ * Christian Michelsen Research AS
+ * Advanced Computing
+ * Fantoftvegen 38, 5036 BERGEN, Norway
+ * http://www.cmr.no
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Christian Michelsen Research AS makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ */
+
+#ifndef ZSTREAM__H
+#define ZSTREAM__H
+
+/*
+ * zstream.h - C++ interface to the 'zlib' general purpose compression library
+ * $Id: zstream.h,v 1.1.1.1 2001/09/28 22:45:41 tholo Exp $
+ */
+
+#include <strstream.h>
+#include <string.h>
+#include <stdio.h>
+#include "zlib.h"
+
+#if defined(_WIN32)
+# include <fcntl.h>
+# include <io.h>
+# define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY)
+#else
+# define SET_BINARY_MODE(file)
+#endif
+
+class zstringlen {
+public:
+ zstringlen(class izstream&);
+ zstringlen(class ozstream&, const char*);
+ size_t value() const { return val.word; }
+private:
+ struct Val { unsigned char byte; size_t word; } val;
+};
+
+// ----------------------------- izstream -----------------------------
+
+class izstream
+{
+ public:
+ izstream() : m_fp(0) {}
+ izstream(FILE* fp) : m_fp(0) { open(fp); }
+ izstream(const char* name) : m_fp(0) { open(name); }
+ ~izstream() { close(); }
+
+ /* Opens a gzip (.gz) file for reading.
+ * open() can be used to read a file which is not in gzip format;
+ * in this case read() will directly read from the file without
+ * decompression. errno can be checked to distinguish two error
+ * cases (if errno is zero, the zlib error is Z_MEM_ERROR).
+ */
+ void open(const char* name) {
+ if (m_fp) close();
+ m_fp = ::gzopen(name, "rb");
+ }
+
+ void open(FILE* fp) {
+ SET_BINARY_MODE(fp);
+ if (m_fp) close();
+ m_fp = ::gzdopen(fileno(fp), "rb");
+ }
+
+ /* Flushes all pending input if necessary, closes the compressed file
+ * and deallocates all the (de)compression state. The return value is
+ * the zlib error number (see function error() below).
+ */
+ int close() {
+ int r = ::gzclose(m_fp);
+ m_fp = 0; return r;
+ }
+
+ /* Binary read the given number of bytes from the compressed file.
+ */
+ int read(void* buf, size_t len) {
+ return ::gzread(m_fp, buf, len);
+ }
+
+ /* Returns the error message for the last error which occurred on the
+ * given compressed file. errnum is set to zlib error number. If an
+ * error occurred in the file system and not in the compression library,
+ * errnum is set to Z_ERRNO and the application may consult errno
+ * to get the exact error code.
+ */
+ const char* error(int* errnum) {
+ return ::gzerror(m_fp, errnum);
+ }
+
+ gzFile fp() { return m_fp; }
+
+ private:
+ gzFile m_fp;
+};
+
+/*
+ * Binary read the given (array of) object(s) from the compressed file.
+ * If the input file was not in gzip format, read() copies the objects number
+ * of bytes into the buffer.
+ * returns the number of uncompressed bytes actually read
+ * (0 for end of file, -1 for error).
+ */
+template <class T, class Items>
+inline int read(izstream& zs, T* x, Items items) {
+ return ::gzread(zs.fp(), x, items*sizeof(T));
+}
+
+/*
+ * Binary input with the '>' operator.
+ */
+template <class T>
+inline izstream& operator>(izstream& zs, T& x) {
+ ::gzread(zs.fp(), &x, sizeof(T));
+ return zs;
+}
+
+
+inline zstringlen::zstringlen(izstream& zs) {
+ zs > val.byte;
+ if (val.byte == 255) zs > val.word;
+ else val.word = val.byte;
+}
+
+/*
+ * Read length of string + the string with the '>' operator.
+ */
+inline izstream& operator>(izstream& zs, char* x) {
+ zstringlen len(zs);
+ ::gzread(zs.fp(), x, len.value());
+ x[len.value()] = '\0';
+ return zs;
+}
+
+inline char* read_string(izstream& zs) {
+ zstringlen len(zs);
+ char* x = new char[len.value()+1];
+ ::gzread(zs.fp(), x, len.value());
+ x[len.value()] = '\0';
+ return x;
+}
+
+// ----------------------------- ozstream -----------------------------
+
+class ozstream
+{
+ public:
+ ozstream() : m_fp(0), m_os(0) {
+ }
+ ozstream(FILE* fp, int level = Z_DEFAULT_COMPRESSION)
+ : m_fp(0), m_os(0) {
+ open(fp, level);
+ }
+ ozstream(const char* name, int level = Z_DEFAULT_COMPRESSION)
+ : m_fp(0), m_os(0) {
+ open(name, level);
+ }
+ ~ozstream() {
+ close();
+ }
+
+ /* Opens a gzip (.gz) file for writing.
+ * The compression level parameter should be in 0..9
+ * errno can be checked to distinguish two error cases
+ * (if errno is zero, the zlib error is Z_MEM_ERROR).
+ */
+ void open(const char* name, int level = Z_DEFAULT_COMPRESSION) {
+ char mode[4] = "wb\0";
+ if (level != Z_DEFAULT_COMPRESSION) mode[2] = '0'+level;
+ if (m_fp) close();
+ m_fp = ::gzopen(name, mode);
+ }
+
+ /* open from a FILE pointer.
+ */
+ void open(FILE* fp, int level = Z_DEFAULT_COMPRESSION) {
+ SET_BINARY_MODE(fp);
+ char mode[4] = "wb\0";
+ if (level != Z_DEFAULT_COMPRESSION) mode[2] = '0'+level;
+ if (m_fp) close();
+ m_fp = ::gzdopen(fileno(fp), mode);
+ }
+
+ /* Flushes all pending output if necessary, closes the compressed file
+ * and deallocates all the (de)compression state. The return value is
+ * the zlib error number (see function error() below).
+ */
+ int close() {
+ if (m_os) {
+ ::gzwrite(m_fp, m_os->str(), m_os->pcount());
+ delete[] m_os->str(); delete m_os; m_os = 0;
+ }
+ int r = ::gzclose(m_fp); m_fp = 0; return r;
+ }
+
+ /* Binary write the given number of bytes into the compressed file.
+ */
+ int write(const void* buf, size_t len) {
+ return ::gzwrite(m_fp, (voidp) buf, len);
+ }
+
+ /* Flushes all pending output into the compressed file. The parameter
+ * _flush is as in the deflate() function. The return value is the zlib
+ * error number (see function gzerror below). flush() returns Z_OK if
+ * the flush_ parameter is Z_FINISH and all output could be flushed.
+ * flush() should be called only when strictly necessary because it can
+ * degrade compression.
+ */
+ int flush(int _flush) {
+ os_flush();
+ return ::gzflush(m_fp, _flush);
+ }
+
+ /* Returns the error message for the last error which occurred on the
+ * given compressed file. errnum is set to zlib error number. If an
+ * error occurred in the file system and not in the compression library,
+ * errnum is set to Z_ERRNO and the application may consult errno
+ * to get the exact error code.
+ */
+ const char* error(int* errnum) {
+ return ::gzerror(m_fp, errnum);
+ }
+
+ gzFile fp() { return m_fp; }
+
+ ostream& os() {
+ if (m_os == 0) m_os = new ostrstream;
+ return *m_os;
+ }
+
+ void os_flush() {
+ if (m_os && m_os->pcount()>0) {
+ ostrstream* oss = new ostrstream;
+ oss->fill(m_os->fill());
+ oss->flags(m_os->flags());
+ oss->precision(m_os->precision());
+ oss->width(m_os->width());
+ ::gzwrite(m_fp, m_os->str(), m_os->pcount());
+ delete[] m_os->str(); delete m_os; m_os = oss;
+ }
+ }
+
+ private:
+ gzFile m_fp;
+ ostrstream* m_os;
+};
+
+/*
+ * Binary write the given (array of) object(s) into the compressed file.
+ * returns the number of uncompressed bytes actually written
+ * (0 in case of error).
+ */
+template <class T, class Items>
+inline int write(ozstream& zs, const T* x, Items items) {
+ return ::gzwrite(zs.fp(), (voidp) x, items*sizeof(T));
+}
+
+/*
+ * Binary output with the '<' operator.
+ */
+template <class T>
+inline ozstream& operator<(ozstream& zs, const T& x) {
+ ::gzwrite(zs.fp(), (voidp) &x, sizeof(T));
+ return zs;
+}
+
+inline zstringlen::zstringlen(ozstream& zs, const char* x) {
+ val.byte = 255; val.word = ::strlen(x);
+ if (val.word < 255) zs < (val.byte = val.word);
+ else zs < val;
+}
+
+/*
+ * Write length of string + the string with the '<' operator.
+ */
+inline ozstream& operator<(ozstream& zs, const char* x) {
+ zstringlen len(zs, x);
+ ::gzwrite(zs.fp(), (voidp) x, len.value());
+ return zs;
+}
+
+#ifdef _MSC_VER
+inline ozstream& operator<(ozstream& zs, char* const& x) {
+ return zs < (const char*) x;
+}
+#endif
+
+/*
+ * Ascii write with the << operator;
+ */
+template <class T>
+inline ostream& operator<<(ozstream& zs, const T& x) {
+ zs.os_flush();
+ return zs.os() << x;
+}
+
+#endif
diff --git a/gnu/usr.bin/cvs/zlib/contrib/iostream2/zstream_test.cpp b/gnu/usr.bin/cvs/zlib/contrib/iostream2/zstream_test.cpp
new file mode 100644
index 00000000000..5bbd56c3ad8
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/contrib/iostream2/zstream_test.cpp
@@ -0,0 +1,25 @@
+#include "zstream.h"
+#include <math.h>
+#include <stdlib.h>
+#include <iomanip.h>
+
+void main() {
+ char h[256] = "Hello";
+ char* g = "Goodbye";
+ ozstream out("temp.gz");
+ out < "This works well" < h < g;
+ out.close();
+
+ izstream in("temp.gz"); // read it back
+ char *x = read_string(in), *y = new char[256], z[256];
+ in > y > z;
+ in.close();
+ cout << x << endl << y << endl << z << endl;
+
+ out.open("temp.gz"); // try ascii output; zcat temp.gz to see the results
+ out << setw(50) << setfill('#') << setprecision(20) << x << endl << y << endl << z << endl;
+ out << z << endl << y << endl << x << endl;
+ out << 1.1234567890123456789 << endl;
+
+ delete[] x; delete[] y;
+}
diff --git a/gnu/usr.bin/cvs/zlib/contrib/minizip/ChangeLogUnzip b/gnu/usr.bin/cvs/zlib/contrib/minizip/ChangeLogUnzip
new file mode 100644
index 00000000000..9987c543cdc
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/contrib/minizip/ChangeLogUnzip
@@ -0,0 +1,38 @@
+Change in 0.15: (19 Mar 98)
+- fix memory leak in minizip.c
+
+Change in 0.14: (10 Mar 98)
+- fix bugs in minizip.c sample for zipping big file
+- fix problem in month in date handling
+- fix bug in unzlocal_GetCurrentFileInfoInternal in unzip.c for
+ comment handling
+
+Change in 0.13: (6 Mar 98)
+- fix bugs in zip.c
+- add real minizip sample
+
+Change in 0.12: (4 Mar 98)
+- add zip.c and zip.h for creates .zip file
+- fix change_file_date in miniunz.c for Unix (Jean-loup Gailly)
+- fix miniunz.c for file without specific record for directory
+
+Change in 0.11: (3 Mar 98)
+- fix bug in unzGetCurrentFileInfo for get extra field and comment
+- enhance miniunz sample, remove the bad unztst.c sample
+
+Change in 0.10: (2 Mar 98)
+- fix bug in unzReadCurrentFile
+- rename unzip* to unz* function and structure
+- remove Windows-like hungary notation variable name
+- modify some structure in unzip.h
+- add somes comment in source
+- remove unzipGetcCurrentFile function
+- replace ZUNZEXPORT by ZEXPORT
+- add unzGetLocalExtrafield for get the local extrafield info
+- add a new sample, miniunz.c
+
+Change in 0.4: (25 Feb 98)
+- suppress the type unzipFileInZip.
+ Only on file in the zipfile can be open at the same time
+- fix somes typo in code
+- added tm_unz structure in unzip_file_info (date/time in readable format)
diff --git a/gnu/usr.bin/cvs/zlib/contrib/minizip/Makefile b/gnu/usr.bin/cvs/zlib/contrib/minizip/Makefile
new file mode 100644
index 00000000000..a1dfc161437
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/contrib/minizip/Makefile
@@ -0,0 +1,25 @@
+CC=cc
+CFLAGS=-O -I../..
+
+UNZ_OBJS = miniunz.o unzip.o ../../libz.a
+ZIP_OBJS = minizip.o zip.o ../../libz.a
+
+.c.o:
+ $(CC) -c $(CFLAGS) $*.c
+
+all: miniunz minizip
+
+miniunz: $(UNZ_OBJS)
+ $(CC) $(CFLAGS) -o $@ $(UNZ_OBJS)
+
+minizip: $(ZIP_OBJS)
+ $(CC) $(CFLAGS) -o $@ $(ZIP_OBJS)
+
+test: miniunz minizip
+ ./minizip test readme.txt
+ ./miniunz -l test.zip
+ mv readme.txt readme.old
+ ./miniunz test.zip
+
+clean:
+ /bin/rm -f *.o *~ minizip miniunz
diff --git a/gnu/usr.bin/cvs/zlib/contrib/minizip/miniunz.c b/gnu/usr.bin/cvs/zlib/contrib/minizip/miniunz.c
new file mode 100644
index 00000000000..f3b7832878f
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/contrib/minizip/miniunz.c
@@ -0,0 +1,508 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <errno.h>
+#include <fcntl.h>
+
+#ifdef unix
+# include <unistd.h>
+# include <utime.h>
+#else
+# include <direct.h>
+# include <io.h>
+#endif
+
+#include "unzip.h"
+
+#define CASESENSITIVITY (0)
+#define WRITEBUFFERSIZE (8192)
+
+/*
+ mini unzip, demo of unzip package
+
+ usage :
+ Usage : miniunz [-exvlo] file.zip [file_to_extract]
+
+ list the file in the zipfile, and print the content of FILE_ID.ZIP or README.TXT
+ if it exists
+*/
+
+
+/* change_file_date : change the date/time of a file
+ filename : the filename of the file where date/time must be modified
+ dosdate : the new date at the MSDos format (4 bytes)
+ tmu_date : the SAME new date at the tm_unz format */
+void change_file_date(filename,dosdate,tmu_date)
+ const char *filename;
+ uLong dosdate;
+ tm_unz tmu_date;
+{
+#ifdef WIN32
+ HANDLE hFile;
+ FILETIME ftm,ftLocal,ftCreate,ftLastAcc,ftLastWrite;
+
+ hFile = CreateFile(filename,GENERIC_READ | GENERIC_WRITE,
+ 0,NULL,OPEN_EXISTING,0,NULL);
+ GetFileTime(hFile,&ftCreate,&ftLastAcc,&ftLastWrite);
+ DosDateTimeToFileTime((WORD)(dosdate>>16),(WORD)dosdate,&ftLocal);
+ LocalFileTimeToFileTime(&ftLocal,&ftm);
+ SetFileTime(hFile,&ftm,&ftLastAcc,&ftm);
+ CloseHandle(hFile);
+#else
+#ifdef unix
+ struct utimbuf ut;
+ struct tm newdate;
+ newdate.tm_sec = tmu_date.tm_sec;
+ newdate.tm_min=tmu_date.tm_min;
+ newdate.tm_hour=tmu_date.tm_hour;
+ newdate.tm_mday=tmu_date.tm_mday;
+ newdate.tm_mon=tmu_date.tm_mon;
+ if (tmu_date.tm_year > 1900)
+ newdate.tm_year=tmu_date.tm_year - 1900;
+ else
+ newdate.tm_year=tmu_date.tm_year ;
+ newdate.tm_isdst=-1;
+
+ ut.actime=ut.modtime=mktime(&newdate);
+ utime(filename,&ut);
+#endif
+#endif
+}
+
+
+/* mymkdir and change_file_date are not 100 % portable
+ As I don't know well Unix, I wait feedback for the unix portion */
+
+int mymkdir(dirname)
+ const char* dirname;
+{
+ int ret=0;
+#ifdef WIN32
+ ret = mkdir(dirname);
+#else
+#ifdef unix
+ ret = mkdir (dirname,0775);
+#endif
+#endif
+ return ret;
+}
+
+int makedir (newdir)
+ char *newdir;
+{
+ char *buffer ;
+ char *p;
+ int len = strlen(newdir);
+
+ if (len <= 0)
+ return 0;
+
+ buffer = (char*)malloc(len+1);
+ strcpy(buffer,newdir);
+
+ if (buffer[len-1] == '/') {
+ buffer[len-1] = '\0';
+ }
+ if (mymkdir(buffer) == 0)
+ {
+ free(buffer);
+ return 1;
+ }
+
+ p = buffer+1;
+ while (1)
+ {
+ char hold;
+
+ while(*p && *p != '\\' && *p != '/')
+ p++;
+ hold = *p;
+ *p = 0;
+ if ((mymkdir(buffer) == -1) && (errno == ENOENT))
+ {
+ printf("couldn't create directory %s\n",buffer);
+ free(buffer);
+ return 0;
+ }
+ if (hold == 0)
+ break;
+ *p++ = hold;
+ }
+ free(buffer);
+ return 1;
+}
+
+void do_banner()
+{
+ printf("MiniUnz 0.15, demo of zLib + Unz package written by Gilles Vollant\n");
+ printf("more info at http://wwww.winimage/zLibDll/unzip.htm\n\n");
+}
+
+void do_help()
+{
+ printf("Usage : miniunz [-exvlo] file.zip [file_to_extract]\n\n") ;
+}
+
+
+int do_list(uf)
+ unzFile uf;
+{
+ uLong i;
+ unz_global_info gi;
+ int err;
+
+ err = unzGetGlobalInfo (uf,&gi);
+ if (err!=UNZ_OK)
+ printf("error %d with zipfile in unzGetGlobalInfo \n",err);
+ printf(" Length Method Size Ratio Date Time CRC-32 Name\n");
+ printf(" ------ ------ ---- ----- ---- ---- ------ ----\n");
+ for (i=0;i<gi.number_entry;i++)
+ {
+ char filename_inzip[256];
+ unz_file_info file_info;
+ uLong ratio=0;
+ const char *string_method;
+ err = unzGetCurrentFileInfo(uf,&file_info,filename_inzip,sizeof(filename_inzip),NULL,0,NULL,0);
+ if (err!=UNZ_OK)
+ {
+ printf("error %d with zipfile in unzGetCurrentFileInfo\n",err);
+ break;
+ }
+ if (file_info.uncompressed_size>0)
+ ratio = (file_info.compressed_size*100)/file_info.uncompressed_size;
+
+ if (file_info.compression_method==0)
+ string_method="Stored";
+ else
+ if (file_info.compression_method==Z_DEFLATED)
+ {
+ uInt iLevel=(uInt)((file_info.flag & 0x6)/2);
+ if (iLevel==0)
+ string_method="Defl:N";
+ else if (iLevel==1)
+ string_method="Defl:X";
+ else if ((iLevel==2) || (iLevel==3))
+ string_method="Defl:F"; /* 2:fast , 3 : extra fast*/
+ }
+ else
+ string_method="Unkn. ";
+
+ printf("%7lu %6s %7lu %3lu%% %2.2lu-%2.2lu-%2.2lu %2.2lu:%2.2lu %8.8lx %s\n",
+ file_info.uncompressed_size,string_method,file_info.compressed_size,
+ ratio,
+ (uLong)file_info.tmu_date.tm_mon + 1,
+ (uLong)file_info.tmu_date.tm_mday,
+ (uLong)file_info.tmu_date.tm_year % 100,
+ (uLong)file_info.tmu_date.tm_hour,(uLong)file_info.tmu_date.tm_min,
+ (uLong)file_info.crc,filename_inzip);
+ if ((i+1)<gi.number_entry)
+ {
+ err = unzGoToNextFile(uf);
+ if (err!=UNZ_OK)
+ {
+ printf("error %d with zipfile in unzGoToNextFile\n",err);
+ break;
+ }
+ }
+ }
+
+ return 0;
+}
+
+
+int do_extract_currentfile(uf,popt_extract_without_path,popt_overwrite)
+ unzFile uf;
+ const int* popt_extract_without_path;
+ int* popt_overwrite;
+{
+ char filename_inzip[256];
+ char* filename_withoutpath;
+ char* p;
+ int err=UNZ_OK;
+ FILE *fout=NULL;
+ void* buf;
+ uInt size_buf;
+
+ unz_file_info file_info;
+ uLong ratio=0;
+ err = unzGetCurrentFileInfo(uf,&file_info,filename_inzip,sizeof(filename_inzip),NULL,0,NULL,0);
+
+ if (err!=UNZ_OK)
+ {
+ printf("error %d with zipfile in unzGetCurrentFileInfo\n",err);
+ return err;
+ }
+
+ size_buf = WRITEBUFFERSIZE;
+ buf = (void*)malloc(size_buf);
+ if (buf==NULL)
+ {
+ printf("Error allocating memory\n");
+ return UNZ_INTERNALERROR;
+ }
+
+ p = filename_withoutpath = filename_inzip;
+ while ((*p) != '\0')
+ {
+ if (((*p)=='/') || ((*p)=='\\'))
+ filename_withoutpath = p+1;
+ p++;
+ }
+
+ if ((*filename_withoutpath)=='\0')
+ {
+ if ((*popt_extract_without_path)==0)
+ {
+ printf("creating directory: %s\n",filename_inzip);
+ mymkdir(filename_inzip);
+ }
+ }
+ else
+ {
+ const char* write_filename;
+ int skip=0;
+
+ if ((*popt_extract_without_path)==0)
+ write_filename = filename_inzip;
+ else
+ write_filename = filename_withoutpath;
+
+ err = unzOpenCurrentFile(uf);
+ if (err!=UNZ_OK)
+ {
+ printf("error %d with zipfile in unzOpenCurrentFile\n",err);
+ }
+
+ if (((*popt_overwrite)==0) && (err==UNZ_OK))
+ {
+ char rep;
+ FILE* ftestexist;
+ ftestexist = fopen(write_filename,"rb");
+ if (ftestexist!=NULL)
+ {
+ fclose(ftestexist);
+ do
+ {
+ char answer[128];
+ printf("The file %s exist. Overwrite ? [y]es, [n]o, [A]ll: ",write_filename);
+ scanf("%1s",answer);
+ rep = answer[0] ;
+ if ((rep>='a') && (rep<='z'))
+ rep -= 0x20;
+ }
+ while ((rep!='Y') && (rep!='N') && (rep!='A'));
+ }
+
+ if (rep == 'N')
+ skip = 1;
+
+ if (rep == 'A')
+ *popt_overwrite=1;
+ }
+
+ if ((skip==0) && (err==UNZ_OK))
+ {
+ fout=fopen(write_filename,"wb");
+
+ /* some zipfile don't contain directory alone before file */
+ if ((fout==NULL) && ((*popt_extract_without_path)==0) &&
+ (filename_withoutpath!=(char*)filename_inzip))
+ {
+ char c=*(filename_withoutpath-1);
+ *(filename_withoutpath-1)='\0';
+ makedir(write_filename);
+ *(filename_withoutpath-1)=c;
+ fout=fopen(write_filename,"wb");
+ }
+
+ if (fout==NULL)
+ {
+ printf("error opening %s\n",write_filename);
+ }
+ }
+
+ if (fout!=NULL)
+ {
+ printf(" extracting: %s\n",write_filename);
+
+ do
+ {
+ err = unzReadCurrentFile(uf,buf,size_buf);
+ if (err<0)
+ {
+ printf("error %d with zipfile in unzReadCurrentFile\n",err);
+ break;
+ }
+ if (err>0)
+ if (fwrite(buf,err,1,fout)!=1)
+ {
+ printf("error in writing extracted file\n");
+ err=UNZ_ERRNO;
+ break;
+ }
+ }
+ while (err>0);
+ fclose(fout);
+ if (err==0)
+ change_file_date(write_filename,file_info.dosDate,
+ file_info.tmu_date);
+ }
+
+ if (err==UNZ_OK)
+ {
+ err = unzCloseCurrentFile (uf);
+ if (err!=UNZ_OK)
+ {
+ printf("error %d with zipfile in unzCloseCurrentFile\n",err);
+ }
+ }
+ else
+ unzCloseCurrentFile(uf); /* don't lose the error */
+ }
+
+ free(buf);
+ return err;
+}
+
+
+int do_extract(uf,opt_extract_without_path,opt_overwrite)
+ unzFile uf;
+ int opt_extract_without_path;
+ int opt_overwrite;
+{
+ uLong i;
+ unz_global_info gi;
+ int err;
+ FILE* fout=NULL;
+
+ err = unzGetGlobalInfo (uf,&gi);
+ if (err!=UNZ_OK)
+ printf("error %d with zipfile in unzGetGlobalInfo \n",err);
+
+ for (i=0;i<gi.number_entry;i++)
+ {
+ if (do_extract_currentfile(uf,&opt_extract_without_path,
+ &opt_overwrite) != UNZ_OK)
+ break;
+
+ if ((i+1)<gi.number_entry)
+ {
+ err = unzGoToNextFile(uf);
+ if (err!=UNZ_OK)
+ {
+ printf("error %d with zipfile in unzGoToNextFile\n",err);
+ break;
+ }
+ }
+ }
+
+ return 0;
+}
+
+int do_extract_onefile(uf,filename,opt_extract_without_path,opt_overwrite)
+ unzFile uf;
+ const char* filename;
+ int opt_extract_without_path;
+ int opt_overwrite;
+{
+ int err = UNZ_OK;
+ if (unzLocateFile(uf,filename,CASESENSITIVITY)!=UNZ_OK)
+ {
+ printf("file %s not found in the zipfile\n",filename);
+ return 2;
+ }
+
+ if (do_extract_currentfile(uf,&opt_extract_without_path,
+ &opt_overwrite) == UNZ_OK)
+ return 0;
+ else
+ return 1;
+}
+
+
+int main(argc,argv)
+ int argc;
+ char *argv[];
+{
+ const char *zipfilename=NULL;
+ const char *filename_to_extract=NULL;
+ int i;
+ int opt_do_list=0;
+ int opt_do_extract=1;
+ int opt_do_extract_withoutpath=0;
+ int opt_overwrite=0;
+ char filename_try[512];
+ unzFile uf=NULL;
+
+ do_banner();
+ if (argc==1)
+ {
+ do_help();
+ exit(0);
+ }
+ else
+ {
+ for (i=1;i<argc;i++)
+ {
+ if ((*argv[i])=='-')
+ {
+ const char *p=argv[i]+1;
+
+ while ((*p)!='\0')
+ {
+ char c=*(p++);;
+ if ((c=='l') || (c=='L'))
+ opt_do_list = 1;
+ if ((c=='v') || (c=='V'))
+ opt_do_list = 1;
+ if ((c=='x') || (c=='X'))
+ opt_do_extract = 1;
+ if ((c=='e') || (c=='E'))
+ opt_do_extract = opt_do_extract_withoutpath = 1;
+ if ((c=='o') || (c=='O'))
+ opt_overwrite=1;
+ }
+ }
+ else
+ {
+ if (zipfilename == NULL)
+ zipfilename = argv[i];
+ else if (filename_to_extract==NULL)
+ filename_to_extract = argv[i] ;
+ }
+ }
+ }
+
+ if (zipfilename!=NULL)
+ {
+ strcpy(filename_try,zipfilename);
+ uf = unzOpen(zipfilename);
+ if (uf==NULL)
+ {
+ strcat(filename_try,".zip");
+ uf = unzOpen(filename_try);
+ }
+ }
+
+ if (uf==NULL)
+ {
+ printf("Cannot open %s or %s.zip\n",zipfilename,zipfilename);
+ exit (1);
+ }
+ printf("%s opened\n",filename_try);
+
+ if (opt_do_list==1)
+ return do_list(uf);
+ else if (opt_do_extract==1)
+ {
+ if (filename_to_extract == NULL)
+ return do_extract(uf,opt_do_extract_withoutpath,opt_overwrite);
+ else
+ return do_extract_onefile(uf,filename_to_extract,
+ opt_do_extract_withoutpath,opt_overwrite);
+ }
+ unzCloseCurrentFile(uf);
+
+ return 0; /* to avoid warning */
+}
diff --git a/gnu/usr.bin/cvs/zlib/contrib/minizip/minizip.c b/gnu/usr.bin/cvs/zlib/contrib/minizip/minizip.c
new file mode 100644
index 00000000000..5e492d209b1
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/contrib/minizip/minizip.c
@@ -0,0 +1,302 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <errno.h>
+#include <fcntl.h>
+
+#ifdef unix
+# include <unistd.h>
+# include <utime.h>
+# include <sys/types.h>
+# include <sys/stat.h>
+#else
+# include <direct.h>
+# include <io.h>
+#endif
+
+#include "zip.h"
+
+
+#define WRITEBUFFERSIZE (16384)
+#define MAXFILENAME (256)
+
+#ifdef WIN32
+uLong filetime(f, tmzip, dt)
+ char *f; /* name of file to get info on */
+ tm_zip *tmzip; /* return value: access, modific. and creation times */
+ uLong *dt; /* dostime */
+{
+ int ret = 0;
+ {
+ FILETIME ftLocal;
+ HANDLE hFind;
+ WIN32_FIND_DATA ff32;
+
+ hFind = FindFirstFile(f,&ff32);
+ if (hFind != INVALID_HANDLE_VALUE)
+ {
+ FileTimeToLocalFileTime(&(ff32.ftLastWriteTime),&ftLocal);
+ FileTimeToDosDateTime(&ftLocal,((LPWORD)dt)+1,((LPWORD)dt)+0);
+ FindClose(hFind);
+ ret = 1;
+ }
+ }
+ return ret;
+}
+#else
+#ifdef unix
+uLong filetime(f, tmzip, dt)
+ char *f; /* name of file to get info on */
+ tm_zip *tmzip; /* return value: access, modific. and creation times */
+ uLong *dt; /* dostime */
+{
+ int ret=0;
+ struct stat s; /* results of stat() */
+ struct tm* filedate;
+ time_t tm_t=0;
+
+ if (strcmp(f,"-")!=0)
+ {
+ char name[MAXFILENAME];
+ int len = strlen(f);
+ strcpy(name, f);
+ if (name[len - 1] == '/')
+ name[len - 1] = '\0';
+ /* not all systems allow stat'ing a file with / appended */
+ if (stat(name,&s)==0)
+ {
+ tm_t = s.st_mtime;
+ ret = 1;
+ }
+ }
+ filedate = localtime(&tm_t);
+
+ tmzip->tm_sec = filedate->tm_sec;
+ tmzip->tm_min = filedate->tm_min;
+ tmzip->tm_hour = filedate->tm_hour;
+ tmzip->tm_mday = filedate->tm_mday;
+ tmzip->tm_mon = filedate->tm_mon ;
+ tmzip->tm_year = filedate->tm_year;
+
+ return ret;
+}
+#else
+uLong filetime(f, tmzip, dt)
+ char *f; /* name of file to get info on */
+ tm_zip *tmzip; /* return value: access, modific. and creation times */
+ uLong *dt; /* dostime */
+{
+ return 0;
+}
+#endif
+#endif
+
+
+
+
+int check_exist_file(filename)
+ const char* filename;
+{
+ FILE* ftestexist;
+ int ret = 1;
+ ftestexist = fopen(filename,"rb");
+ if (ftestexist==NULL)
+ ret = 0;
+ else
+ fclose(ftestexist);
+ return ret;
+}
+
+void do_banner()
+{
+ printf("MiniZip 0.15, demo of zLib + Zip package written by Gilles Vollant\n");
+ printf("more info at http://wwww.winimage/zLibDll/unzip.htm\n\n");
+}
+
+void do_help()
+{
+ printf("Usage : minizip [-o] file.zip [files_to_add]\n\n") ;
+}
+
+int main(argc,argv)
+ int argc;
+ char *argv[];
+{
+ int i;
+ int opt_overwrite=0;
+ int opt_compress_level=Z_DEFAULT_COMPRESSION;
+ int zipfilenamearg = 0;
+ char filename_try[MAXFILENAME];
+ int zipok;
+ int err=0;
+ int size_buf=0;
+ void* buf=NULL,
+
+
+ do_banner();
+ if (argc==1)
+ {
+ do_help();
+ exit(0);
+ return 0;
+ }
+ else
+ {
+ for (i=1;i<argc;i++)
+ {
+ if ((*argv[i])=='-')
+ {
+ const char *p=argv[i]+1;
+
+ while ((*p)!='\0')
+ {
+ char c=*(p++);;
+ if ((c=='o') || (c=='O'))
+ opt_overwrite = 1;
+ if ((c>='0') && (c<='9'))
+ opt_compress_level = c-'0';
+ }
+ }
+ else
+ if (zipfilenamearg == 0)
+ zipfilenamearg = i ;
+ }
+ }
+
+ size_buf = WRITEBUFFERSIZE;
+ buf = (void*)malloc(size_buf);
+ if (buf==NULL)
+ {
+ printf("Error allocating memory\n");
+ return ZIP_INTERNALERROR;
+ }
+
+ if (zipfilenamearg==0)
+ zipok=0;
+ else
+ {
+ int i,len;
+ int dot_found=0;
+
+ zipok = 1 ;
+ strcpy(filename_try,argv[zipfilenamearg]);
+ len=strlen(filename_try);
+ for (i=0;i<len;i++)
+ if (filename_try[i]=='.')
+ dot_found=1;
+
+ if (dot_found==0)
+ strcat(filename_try,".zip");
+
+ if (opt_overwrite==0)
+ if (check_exist_file(filename_try)!=0)
+ {
+ char rep;
+ do
+ {
+ char answer[128];
+ printf("The file %s exist. Overwrite ? [y]es, [n]o : ",filename_try);
+ scanf("%1s",answer);
+ rep = answer[0] ;
+ if ((rep>='a') && (rep<='z'))
+ rep -= 0x20;
+ }
+ while ((rep!='Y') && (rep!='N'));
+ if (rep=='N')
+ zipok = 0;
+ }
+ }
+
+ if (zipok==1)
+ {
+ zipFile zf;
+ int errclose;
+ zf = zipOpen(filename_try,0);
+ if (zf == NULL)
+ {
+ printf("error opening %s\n",filename_try);
+ err= ZIP_ERRNO;
+ }
+ else
+ printf("creating %s\n",filename_try);
+
+ for (i=zipfilenamearg+1;(i<argc) && (err==ZIP_OK);i++)
+ {
+ if (((*(argv[i]))!='-') && ((*(argv[i]))!='/'))
+ {
+ FILE * fin;
+ int size_read;
+ const char* filenameinzip = argv[i];
+ zip_fileinfo zi;
+
+ zi.tmz_date.tm_sec = zi.tmz_date.tm_min = zi.tmz_date.tm_hour =
+ zi.tmz_date.tm_mday = zi.tmz_date.tm_min = zi.tmz_date.tm_year = 0;
+ zi.dosDate = 0;
+ zi.internal_fa = 0;
+ zi.external_fa = 0;
+ filetime(filenameinzip,&zi.tmz_date,&zi.dosDate);
+
+
+ err = zipOpenNewFileInZip(zf,filenameinzip,&zi,
+ NULL,0,NULL,0,NULL /* comment*/,
+ (opt_compress_level != 0) ? Z_DEFLATED : 0,
+ opt_compress_level);
+
+ if (err != ZIP_OK)
+ printf("error in opening %s in zipfile\n",filenameinzip);
+ else
+ {
+ fin = fopen(filenameinzip,"rb");
+ if (fin==NULL)
+ {
+ err=ZIP_ERRNO;
+ printf("error in opening %s for reading\n",filenameinzip);
+ }
+ }
+
+ if (err == ZIP_OK)
+ do
+ {
+ err = ZIP_OK;
+ size_read = fread(buf,1,size_buf,fin);
+ if (size_read < size_buf)
+ if (feof(fin)==0)
+ {
+ printf("error in reading %s\n",filenameinzip);
+ err = ZIP_ERRNO;
+ }
+
+ if (size_read>0)
+ {
+ err = zipWriteInFileInZip (zf,buf,size_read);
+ if (err<0)
+ {
+ printf("error in writing %s in the zipfile\n",
+ filenameinzip);
+ }
+
+ }
+ } while ((err == ZIP_OK) && (size_read>0));
+
+ fclose(fin);
+ if (err<0)
+ err=ZIP_ERRNO;
+ else
+ {
+ err = zipCloseFileInZip(zf);
+ if (err!=ZIP_OK)
+ printf("error in closing %s in the zipfile\n",
+ filenameinzip);
+ }
+ }
+ }
+ errclose = zipClose(zf,NULL);
+ if (errclose != ZIP_OK)
+ printf("error in closing %s\n",filename_try);
+ }
+
+ free(buf);
+ exit(0);
+ return 0; /* to avoid warning */
+}
diff --git a/gnu/usr.bin/cvs/zlib/contrib/minizip/readme.txt b/gnu/usr.bin/cvs/zlib/contrib/minizip/readme.txt
new file mode 100644
index 00000000000..1fc023c720b
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/contrib/minizip/readme.txt
@@ -0,0 +1,37 @@
+
+UnZip 0.15 additionnal library
+
+
+ This unzip package allow extract file from .ZIP file, compatible with
+PKZip 2.04g, WinZip, InfoZip tools and compatible.
+
+ Multi volume ZipFile (span) are not supported, and old compression used by old
+PKZip 1.x are not supported.
+
+See probdesc.zip from PKWare for specification of .ZIP format.
+
+What is Unzip
+ The Zlib library support the deflate compression and the creation of gzip (.gz)
+file. Zlib is free and small.
+ The .Zip format, which can contain several compressed files (.gz can containt
+only one file) is a very popular format. This is why I've written a package for reading file compressed in Zipfile.
+
+Using Unzip package
+
+You need source of Zlib (get zlib111.zip and read zlib.h).
+Get unzlb015.zip and read unzip.h (whith documentation of unzip functions)
+
+The Unzip package is only two file : unzip.h and unzip.c. But it use the Zlib
+ files.
+unztst.c is a simple sample program, which list file in a zipfile and display
+ README.TXT or FILE_ID.DIZ (if these files are found).
+miniunz.c is a mini unzip program.
+
+I'm also currenlyt writing a zipping portion (zip.h, zip.c and test with minizip.c)
+
+Please email me for feedback.
+I hope my source is compatible with Unix system, but I need your help for be sure
+
+Latest revision : Mar 04th, 1998
+
+Check http://www.winimage.com/zLibDll/unzip.html for up to date info.
diff --git a/gnu/usr.bin/cvs/zlib/contrib/minizip/unzip.c b/gnu/usr.bin/cvs/zlib/contrib/minizip/unzip.c
new file mode 100644
index 00000000000..ff71a474da1
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/contrib/minizip/unzip.c
@@ -0,0 +1,1294 @@
+/* unzip.c -- IO on .zip files using zlib
+ Version 0.15 beta, Mar 19th, 1998,
+
+ Read unzip.h for more info
+*/
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "zlib.h"
+#include "unzip.h"
+
+#ifdef STDC
+# include <stddef.h>
+# include <string.h>
+# include <stdlib.h>
+#endif
+#ifdef NO_ERRNO_H
+ extern int errno;
+#else
+# include <errno.h>
+#endif
+
+
+#ifndef local
+# define local static
+#endif
+/* compile with -Dlocal if your debugger can't find static symbols */
+
+
+
+#if !defined(unix) && !defined(CASESENSITIVITYDEFAULT_YES) && \
+ !defined(CASESENSITIVITYDEFAULT_NO)
+#define CASESENSITIVITYDEFAULT_NO
+#endif
+
+
+#ifndef UNZ_BUFSIZE
+#define UNZ_BUFSIZE (16384)
+#endif
+
+#ifndef UNZ_MAXFILENAMEINZIP
+#define UNZ_MAXFILENAMEINZIP (256)
+#endif
+
+#ifndef ALLOC
+# define ALLOC(size) (malloc(size))
+#endif
+#ifndef TRYFREE
+# define TRYFREE(p) {if (p) free(p);}
+#endif
+
+#define SIZECENTRALDIRITEM (0x2e)
+#define SIZEZIPLOCALHEADER (0x1e)
+
+
+/* I've found an old Unix (a SunOS 4.1.3_U1) without all SEEK_* defined.... */
+
+#ifndef SEEK_CUR
+#define SEEK_CUR 1
+#endif
+
+#ifndef SEEK_END
+#define SEEK_END 2
+#endif
+
+#ifndef SEEK_SET
+#define SEEK_SET 0
+#endif
+
+const char unz_copyright[] =
+ " unzip 0.15 Copyright 1998 Gilles Vollant ";
+
+/* unz_file_info_interntal contain internal info about a file in zipfile*/
+typedef struct unz_file_info_internal_s
+{
+ uLong offset_curfile;/* relative offset of local header 4 bytes */
+} unz_file_info_internal;
+
+
+/* file_in_zip_read_info_s contain internal information about a file in zipfile,
+ when reading and decompress it */
+typedef struct
+{
+ char *read_buffer; /* internal buffer for compressed data */
+ z_stream stream; /* zLib stream structure for inflate */
+
+ uLong pos_in_zipfile; /* position in byte on the zipfile, for fseek*/
+ uLong stream_initialised; /* flag set if stream structure is initialised*/
+
+ uLong offset_local_extrafield;/* offset of the local extra field */
+ uInt size_local_extrafield;/* size of the local extra field */
+ uLong pos_local_extrafield; /* position in the local extra field in read*/
+
+ uLong crc32; /* crc32 of all data uncompressed */
+ uLong crc32_wait; /* crc32 we must obtain after decompress all */
+ uLong rest_read_compressed; /* number of byte to be decompressed */
+ uLong rest_read_uncompressed;/*number of byte to be obtained after decomp*/
+ FILE* file; /* io structore of the zipfile */
+ uLong compression_method; /* compression method (0==store) */
+ uLong byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/
+} file_in_zip_read_info_s;
+
+
+/* unz_s contain internal information about the zipfile
+*/
+typedef struct
+{
+ FILE* file; /* io structore of the zipfile */
+ unz_global_info gi; /* public global information */
+ uLong byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/
+ uLong num_file; /* number of the current file in the zipfile*/
+ uLong pos_in_central_dir; /* pos of the current file in the central dir*/
+ uLong current_file_ok; /* flag about the usability of the current file*/
+ uLong central_pos; /* position of the beginning of the central dir*/
+
+ uLong size_central_dir; /* size of the central directory */
+ uLong offset_central_dir; /* offset of start of central directory with
+ respect to the starting disk number */
+
+ unz_file_info cur_file_info; /* public info about the current file in zip*/
+ unz_file_info_internal cur_file_info_internal; /* private info about it*/
+ file_in_zip_read_info_s* pfile_in_zip_read; /* structure about the current
+ file if we are decompressing it */
+} unz_s;
+
+
+/* ===========================================================================
+ Read a byte from a gz_stream; update next_in and avail_in. Return EOF
+ for end of file.
+ IN assertion: the stream s has been sucessfully opened for reading.
+*/
+
+
+local int unzlocal_getByte(fin,pi)
+ FILE *fin;
+ int *pi;
+{
+ unsigned char c;
+ int err = fread(&c, 1, 1, fin);
+ if (err==1)
+ {
+ *pi = (int)c;
+ return UNZ_OK;
+ }
+ else
+ {
+ if (ferror(fin))
+ return UNZ_ERRNO;
+ else
+ return UNZ_EOF;
+ }
+}
+
+
+/* ===========================================================================
+ Reads a long in LSB order from the given gz_stream. Sets
+*/
+local int unzlocal_getShort (fin,pX)
+ FILE* fin;
+ uLong *pX;
+{
+ uLong x ;
+ int i;
+ int err;
+
+ err = unzlocal_getByte(fin,&i);
+ x = (uLong)i;
+
+ if (err==UNZ_OK)
+ err = unzlocal_getByte(fin,&i);
+ x += ((uLong)i)<<8;
+
+ if (err==UNZ_OK)
+ *pX = x;
+ else
+ *pX = 0;
+ return err;
+}
+
+local int unzlocal_getLong (fin,pX)
+ FILE* fin;
+ uLong *pX;
+{
+ uLong x ;
+ int i;
+ int err;
+
+ err = unzlocal_getByte(fin,&i);
+ x = (uLong)i;
+
+ if (err==UNZ_OK)
+ err = unzlocal_getByte(fin,&i);
+ x += ((uLong)i)<<8;
+
+ if (err==UNZ_OK)
+ err = unzlocal_getByte(fin,&i);
+ x += ((uLong)i)<<16;
+
+ if (err==UNZ_OK)
+ err = unzlocal_getByte(fin,&i);
+ x += ((uLong)i)<<24;
+
+ if (err==UNZ_OK)
+ *pX = x;
+ else
+ *pX = 0;
+ return err;
+}
+
+
+/* My own strcmpi / strcasecmp */
+local int strcmpcasenosensitive_internal (fileName1,fileName2)
+ const char* fileName1;
+ const char* fileName2;
+{
+ for (;;)
+ {
+ char c1=*(fileName1++);
+ char c2=*(fileName2++);
+ if ((c1>='a') && (c1<='z'))
+ c1 -= 0x20;
+ if ((c2>='a') && (c2<='z'))
+ c2 -= 0x20;
+ if (c1=='\0')
+ return ((c2=='\0') ? 0 : -1);
+ if (c2=='\0')
+ return 1;
+ if (c1<c2)
+ return -1;
+ if (c1>c2)
+ return 1;
+ }
+}
+
+
+#ifdef CASESENSITIVITYDEFAULT_NO
+#define CASESENSITIVITYDEFAULTVALUE 2
+#else
+#define CASESENSITIVITYDEFAULTVALUE 1
+#endif
+
+#ifndef STRCMPCASENOSENTIVEFUNCTION
+#define STRCMPCASENOSENTIVEFUNCTION strcmpcasenosensitive_internal
+#endif
+
+/*
+ Compare two filename (fileName1,fileName2).
+ If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp)
+ If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi
+ or strcasecmp)
+ If iCaseSenisivity = 0, case sensitivity is defaut of your operating system
+ (like 1 on Unix, 2 on Windows)
+
+*/
+extern int ZEXPORT unzStringFileNameCompare (fileName1,fileName2,iCaseSensitivity)
+ const char* fileName1;
+ const char* fileName2;
+ int iCaseSensitivity;
+{
+ if (iCaseSensitivity==0)
+ iCaseSensitivity=CASESENSITIVITYDEFAULTVALUE;
+
+ if (iCaseSensitivity==1)
+ return strcmp(fileName1,fileName2);
+
+ return STRCMPCASENOSENTIVEFUNCTION(fileName1,fileName2);
+}
+
+#define BUFREADCOMMENT (0x400)
+
+/*
+ Locate the Central directory of a zipfile (at the end, just before
+ the global comment)
+*/
+local uLong unzlocal_SearchCentralDir(fin)
+ FILE *fin;
+{
+ unsigned char* buf;
+ uLong uSizeFile;
+ uLong uBackRead;
+ uLong uMaxBack=0xffff; /* maximum size of global comment */
+ uLong uPosFound=0;
+
+ if (fseek(fin,0,SEEK_END) != 0)
+ return 0;
+
+
+ uSizeFile = ftell( fin );
+
+ if (uMaxBack>uSizeFile)
+ uMaxBack = uSizeFile;
+
+ buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4);
+ if (buf==NULL)
+ return 0;
+
+ uBackRead = 4;
+ while (uBackRead<uMaxBack)
+ {
+ uLong uReadSize,uReadPos ;
+ int i;
+ if (uBackRead+BUFREADCOMMENT>uMaxBack)
+ uBackRead = uMaxBack;
+ else
+ uBackRead+=BUFREADCOMMENT;
+ uReadPos = uSizeFile-uBackRead ;
+
+ uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ?
+ (BUFREADCOMMENT+4) : (uSizeFile-uReadPos);
+ if (fseek(fin,uReadPos,SEEK_SET)!=0)
+ break;
+
+ if (fread(buf,(uInt)uReadSize,1,fin)!=1)
+ break;
+
+ for (i=(int)uReadSize-3; (i--)>0;)
+ if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) &&
+ ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06))
+ {
+ uPosFound = uReadPos+i;
+ break;
+ }
+
+ if (uPosFound!=0)
+ break;
+ }
+ TRYFREE(buf);
+ return uPosFound;
+}
+
+/*
+ Open a Zip file. path contain the full pathname (by example,
+ on a Windows NT computer "c:\\test\\zlib109.zip" or on an Unix computer
+ "zlib/zlib109.zip".
+ If the zipfile cannot be opened (file don't exist or in not valid), the
+ return value is NULL.
+ Else, the return value is a unzFile Handle, usable with other function
+ of this unzip package.
+*/
+extern unzFile ZEXPORT unzOpen (path)
+ const char *path;
+{
+ unz_s us;
+ unz_s *s;
+ uLong central_pos,uL;
+ FILE * fin ;
+
+ uLong number_disk; /* number of the current dist, used for
+ spaning ZIP, unsupported, always 0*/
+ uLong number_disk_with_CD; /* number the the disk with central dir, used
+ for spaning ZIP, unsupported, always 0*/
+ uLong number_entry_CD; /* total number of entries in
+ the central dir
+ (same than number_entry on nospan) */
+
+ int err=UNZ_OK;
+
+ if (unz_copyright[0]!=' ')
+ return NULL;
+
+ fin=fopen(path,"rb");
+ if (fin==NULL)
+ return NULL;
+
+ central_pos = unzlocal_SearchCentralDir(fin);
+ if (central_pos==0)
+ err=UNZ_ERRNO;
+
+ if (fseek(fin,central_pos,SEEK_SET)!=0)
+ err=UNZ_ERRNO;
+
+ /* the signature, already checked */
+ if (unzlocal_getLong(fin,&uL)!=UNZ_OK)
+ err=UNZ_ERRNO;
+
+ /* number of this disk */
+ if (unzlocal_getShort(fin,&number_disk)!=UNZ_OK)
+ err=UNZ_ERRNO;
+
+ /* number of the disk with the start of the central directory */
+ if (unzlocal_getShort(fin,&number_disk_with_CD)!=UNZ_OK)
+ err=UNZ_ERRNO;
+
+ /* total number of entries in the central dir on this disk */
+ if (unzlocal_getShort(fin,&us.gi.number_entry)!=UNZ_OK)
+ err=UNZ_ERRNO;
+
+ /* total number of entries in the central dir */
+ if (unzlocal_getShort(fin,&number_entry_CD)!=UNZ_OK)
+ err=UNZ_ERRNO;
+
+ if ((number_entry_CD!=us.gi.number_entry) ||
+ (number_disk_with_CD!=0) ||
+ (number_disk!=0))
+ err=UNZ_BADZIPFILE;
+
+ /* size of the central directory */
+ if (unzlocal_getLong(fin,&us.size_central_dir)!=UNZ_OK)
+ err=UNZ_ERRNO;
+
+ /* offset of start of central directory with respect to the
+ starting disk number */
+ if (unzlocal_getLong(fin,&us.offset_central_dir)!=UNZ_OK)
+ err=UNZ_ERRNO;
+
+ /* zipfile comment length */
+ if (unzlocal_getShort(fin,&us.gi.size_comment)!=UNZ_OK)
+ err=UNZ_ERRNO;
+
+ if ((central_pos<us.offset_central_dir+us.size_central_dir) &&
+ (err==UNZ_OK))
+ err=UNZ_BADZIPFILE;
+
+ if (err!=UNZ_OK)
+ {
+ fclose(fin);
+ return NULL;
+ }
+
+ us.file=fin;
+ us.byte_before_the_zipfile = central_pos -
+ (us.offset_central_dir+us.size_central_dir);
+ us.central_pos = central_pos;
+ us.pfile_in_zip_read = NULL;
+
+
+ s=(unz_s*)ALLOC(sizeof(unz_s));
+ *s=us;
+ unzGoToFirstFile((unzFile)s);
+ return (unzFile)s;
+}
+
+
+/*
+ Close a ZipFile opened with unzipOpen.
+ If there is files inside the .Zip opened with unzipOpenCurrentFile (see later),
+ these files MUST be closed with unzipCloseCurrentFile before call unzipClose.
+ return UNZ_OK if there is no problem. */
+extern int ZEXPORT unzClose (file)
+ unzFile file;
+{
+ unz_s* s;
+ if (file==NULL)
+ return UNZ_PARAMERROR;
+ s=(unz_s*)file;
+
+ if (s->pfile_in_zip_read!=NULL)
+ unzCloseCurrentFile(file);
+
+ fclose(s->file);
+ TRYFREE(s);
+ return UNZ_OK;
+}
+
+
+/*
+ Write info about the ZipFile in the *pglobal_info structure.
+ No preparation of the structure is needed
+ return UNZ_OK if there is no problem. */
+extern int ZEXPORT unzGetGlobalInfo (file,pglobal_info)
+ unzFile file;
+ unz_global_info *pglobal_info;
+{
+ unz_s* s;
+ if (file==NULL)
+ return UNZ_PARAMERROR;
+ s=(unz_s*)file;
+ *pglobal_info=s->gi;
+ return UNZ_OK;
+}
+
+
+/*
+ Translate date/time from Dos format to tm_unz (readable more easilty)
+*/
+local void unzlocal_DosDateToTmuDate (ulDosDate, ptm)
+ uLong ulDosDate;
+ tm_unz* ptm;
+{
+ uLong uDate;
+ uDate = (uLong)(ulDosDate>>16);
+ ptm->tm_mday = (uInt)(uDate&0x1f) ;
+ ptm->tm_mon = (uInt)((((uDate)&0x1E0)/0x20)-1) ;
+ ptm->tm_year = (uInt)(((uDate&0x0FE00)/0x0200)+1980) ;
+
+ ptm->tm_hour = (uInt) ((ulDosDate &0xF800)/0x800);
+ ptm->tm_min = (uInt) ((ulDosDate&0x7E0)/0x20) ;
+ ptm->tm_sec = (uInt) (2*(ulDosDate&0x1f)) ;
+}
+
+/*
+ Get Info about the current file in the zipfile, with internal only info
+*/
+local int unzlocal_GetCurrentFileInfoInternal OF((unzFile file,
+ unz_file_info *pfile_info,
+ unz_file_info_internal
+ *pfile_info_internal,
+ char *szFileName,
+ uLong fileNameBufferSize,
+ void *extraField,
+ uLong extraFieldBufferSize,
+ char *szComment,
+ uLong commentBufferSize));
+
+local int unzlocal_GetCurrentFileInfoInternal (file,
+ pfile_info,
+ pfile_info_internal,
+ szFileName, fileNameBufferSize,
+ extraField, extraFieldBufferSize,
+ szComment, commentBufferSize)
+ unzFile file;
+ unz_file_info *pfile_info;
+ unz_file_info_internal *pfile_info_internal;
+ char *szFileName;
+ uLong fileNameBufferSize;
+ void *extraField;
+ uLong extraFieldBufferSize;
+ char *szComment;
+ uLong commentBufferSize;
+{
+ unz_s* s;
+ unz_file_info file_info;
+ unz_file_info_internal file_info_internal;
+ int err=UNZ_OK;
+ uLong uMagic;
+ long lSeek=0;
+
+ if (file==NULL)
+ return UNZ_PARAMERROR;
+ s=(unz_s*)file;
+ if (fseek(s->file,s->pos_in_central_dir+s->byte_before_the_zipfile,SEEK_SET)!=0)
+ err=UNZ_ERRNO;
+
+
+ /* we check the magic */
+ if (err==UNZ_OK)
+ if (unzlocal_getLong(s->file,&uMagic) != UNZ_OK)
+ err=UNZ_ERRNO;
+ else if (uMagic!=0x02014b50)
+ err=UNZ_BADZIPFILE;
+
+ if (unzlocal_getShort(s->file,&file_info.version) != UNZ_OK)
+ err=UNZ_ERRNO;
+
+ if (unzlocal_getShort(s->file,&file_info.version_needed) != UNZ_OK)
+ err=UNZ_ERRNO;
+
+ if (unzlocal_getShort(s->file,&file_info.flag) != UNZ_OK)
+ err=UNZ_ERRNO;
+
+ if (unzlocal_getShort(s->file,&file_info.compression_method) != UNZ_OK)
+ err=UNZ_ERRNO;
+
+ if (unzlocal_getLong(s->file,&file_info.dosDate) != UNZ_OK)
+ err=UNZ_ERRNO;
+
+ unzlocal_DosDateToTmuDate(file_info.dosDate,&file_info.tmu_date);
+
+ if (unzlocal_getLong(s->file,&file_info.crc) != UNZ_OK)
+ err=UNZ_ERRNO;
+
+ if (unzlocal_getLong(s->file,&file_info.compressed_size) != UNZ_OK)
+ err=UNZ_ERRNO;
+
+ if (unzlocal_getLong(s->file,&file_info.uncompressed_size) != UNZ_OK)
+ err=UNZ_ERRNO;
+
+ if (unzlocal_getShort(s->file,&file_info.size_filename) != UNZ_OK)
+ err=UNZ_ERRNO;
+
+ if (unzlocal_getShort(s->file,&file_info.size_file_extra) != UNZ_OK)
+ err=UNZ_ERRNO;
+
+ if (unzlocal_getShort(s->file,&file_info.size_file_comment) != UNZ_OK)
+ err=UNZ_ERRNO;
+
+ if (unzlocal_getShort(s->file,&file_info.disk_num_start) != UNZ_OK)
+ err=UNZ_ERRNO;
+
+ if (unzlocal_getShort(s->file,&file_info.internal_fa) != UNZ_OK)
+ err=UNZ_ERRNO;
+
+ if (unzlocal_getLong(s->file,&file_info.external_fa) != UNZ_OK)
+ err=UNZ_ERRNO;
+
+ if (unzlocal_getLong(s->file,&file_info_internal.offset_curfile) != UNZ_OK)
+ err=UNZ_ERRNO;
+
+ lSeek+=file_info.size_filename;
+ if ((err==UNZ_OK) && (szFileName!=NULL))
+ {
+ uLong uSizeRead ;
+ if (file_info.size_filename<fileNameBufferSize)
+ {
+ *(szFileName+file_info.size_filename)='\0';
+ uSizeRead = file_info.size_filename;
+ }
+ else
+ uSizeRead = fileNameBufferSize;
+
+ if ((file_info.size_filename>0) && (fileNameBufferSize>0))
+ if (fread(szFileName,(uInt)uSizeRead,1,s->file)!=1)
+ err=UNZ_ERRNO;
+ lSeek -= uSizeRead;
+ }
+
+
+ if ((err==UNZ_OK) && (extraField!=NULL))
+ {
+ uLong uSizeRead ;
+ if (file_info.size_file_extra<extraFieldBufferSize)
+ uSizeRead = file_info.size_file_extra;
+ else
+ uSizeRead = extraFieldBufferSize;
+
+ if (lSeek!=0)
+ if (fseek(s->file,lSeek,SEEK_CUR)==0)
+ lSeek=0;
+ else
+ err=UNZ_ERRNO;
+ if ((file_info.size_file_extra>0) && (extraFieldBufferSize>0))
+ if (fread(extraField,(uInt)uSizeRead,1,s->file)!=1)
+ err=UNZ_ERRNO;
+ lSeek += file_info.size_file_extra - uSizeRead;
+ }
+ else
+ lSeek+=file_info.size_file_extra;
+
+
+ if ((err==UNZ_OK) && (szComment!=NULL))
+ {
+ uLong uSizeRead ;
+ if (file_info.size_file_comment<commentBufferSize)
+ {
+ *(szComment+file_info.size_file_comment)='\0';
+ uSizeRead = file_info.size_file_comment;
+ }
+ else
+ uSizeRead = commentBufferSize;
+
+ if (lSeek!=0)
+ if (fseek(s->file,lSeek,SEEK_CUR)==0)
+ lSeek=0;
+ else
+ err=UNZ_ERRNO;
+ if ((file_info.size_file_comment>0) && (commentBufferSize>0))
+ if (fread(szComment,(uInt)uSizeRead,1,s->file)!=1)
+ err=UNZ_ERRNO;
+ lSeek+=file_info.size_file_comment - uSizeRead;
+ }
+ else
+ lSeek+=file_info.size_file_comment;
+
+ if ((err==UNZ_OK) && (pfile_info!=NULL))
+ *pfile_info=file_info;
+
+ if ((err==UNZ_OK) && (pfile_info_internal!=NULL))
+ *pfile_info_internal=file_info_internal;
+
+ return err;
+}
+
+
+
+/*
+ Write info about the ZipFile in the *pglobal_info structure.
+ No preparation of the structure is needed
+ return UNZ_OK if there is no problem.
+*/
+extern int ZEXPORT unzGetCurrentFileInfo (file,
+ pfile_info,
+ szFileName, fileNameBufferSize,
+ extraField, extraFieldBufferSize,
+ szComment, commentBufferSize)
+ unzFile file;
+ unz_file_info *pfile_info;
+ char *szFileName;
+ uLong fileNameBufferSize;
+ void *extraField;
+ uLong extraFieldBufferSize;
+ char *szComment;
+ uLong commentBufferSize;
+{
+ return unzlocal_GetCurrentFileInfoInternal(file,pfile_info,NULL,
+ szFileName,fileNameBufferSize,
+ extraField,extraFieldBufferSize,
+ szComment,commentBufferSize);
+}
+
+/*
+ Set the current file of the zipfile to the first file.
+ return UNZ_OK if there is no problem
+*/
+extern int ZEXPORT unzGoToFirstFile (file)
+ unzFile file;
+{
+ int err=UNZ_OK;
+ unz_s* s;
+ if (file==NULL)
+ return UNZ_PARAMERROR;
+ s=(unz_s*)file;
+ s->pos_in_central_dir=s->offset_central_dir;
+ s->num_file=0;
+ err=unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info,
+ &s->cur_file_info_internal,
+ NULL,0,NULL,0,NULL,0);
+ s->current_file_ok = (err == UNZ_OK);
+ return err;
+}
+
+
+/*
+ Set the current file of the zipfile to the next file.
+ return UNZ_OK if there is no problem
+ return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest.
+*/
+extern int ZEXPORT unzGoToNextFile (file)
+ unzFile file;
+{
+ unz_s* s;
+ int err;
+
+ if (file==NULL)
+ return UNZ_PARAMERROR;
+ s=(unz_s*)file;
+ if (!s->current_file_ok)
+ return UNZ_END_OF_LIST_OF_FILE;
+ if (s->num_file+1==s->gi.number_entry)
+ return UNZ_END_OF_LIST_OF_FILE;
+
+ s->pos_in_central_dir += SIZECENTRALDIRITEM + s->cur_file_info.size_filename +
+ s->cur_file_info.size_file_extra + s->cur_file_info.size_file_comment ;
+ s->num_file++;
+ err = unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info,
+ &s->cur_file_info_internal,
+ NULL,0,NULL,0,NULL,0);
+ s->current_file_ok = (err == UNZ_OK);
+ return err;
+}
+
+
+/*
+ Try locate the file szFileName in the zipfile.
+ For the iCaseSensitivity signification, see unzipStringFileNameCompare
+
+ return value :
+ UNZ_OK if the file is found. It becomes the current file.
+ UNZ_END_OF_LIST_OF_FILE if the file is not found
+*/
+extern int ZEXPORT unzLocateFile (file, szFileName, iCaseSensitivity)
+ unzFile file;
+ const char *szFileName;
+ int iCaseSensitivity;
+{
+ unz_s* s;
+ int err;
+
+
+ uLong num_fileSaved;
+ uLong pos_in_central_dirSaved;
+
+
+ if (file==NULL)
+ return UNZ_PARAMERROR;
+
+ if (strlen(szFileName)>=UNZ_MAXFILENAMEINZIP)
+ return UNZ_PARAMERROR;
+
+ s=(unz_s*)file;
+ if (!s->current_file_ok)
+ return UNZ_END_OF_LIST_OF_FILE;
+
+ num_fileSaved = s->num_file;
+ pos_in_central_dirSaved = s->pos_in_central_dir;
+
+ err = unzGoToFirstFile(file);
+
+ while (err == UNZ_OK)
+ {
+ char szCurrentFileName[UNZ_MAXFILENAMEINZIP+1];
+ unzGetCurrentFileInfo(file,NULL,
+ szCurrentFileName,sizeof(szCurrentFileName)-1,
+ NULL,0,NULL,0);
+ if (unzStringFileNameCompare(szCurrentFileName,
+ szFileName,iCaseSensitivity)==0)
+ return UNZ_OK;
+ err = unzGoToNextFile(file);
+ }
+
+ s->num_file = num_fileSaved ;
+ s->pos_in_central_dir = pos_in_central_dirSaved ;
+ return err;
+}
+
+
+/*
+ Read the local header of the current zipfile
+ Check the coherency of the local header and info in the end of central
+ directory about this file
+ store in *piSizeVar the size of extra info in local header
+ (filename and size of extra field data)
+*/
+local int unzlocal_CheckCurrentFileCoherencyHeader (s,piSizeVar,
+ poffset_local_extrafield,
+ psize_local_extrafield)
+ unz_s* s;
+ uInt* piSizeVar;
+ uLong *poffset_local_extrafield;
+ uInt *psize_local_extrafield;
+{
+ uLong uMagic,uData,uFlags;
+ uLong size_filename;
+ uLong size_extra_field;
+ int err=UNZ_OK;
+
+ *piSizeVar = 0;
+ *poffset_local_extrafield = 0;
+ *psize_local_extrafield = 0;
+
+ if (fseek(s->file,s->cur_file_info_internal.offset_curfile +
+ s->byte_before_the_zipfile,SEEK_SET)!=0)
+ return UNZ_ERRNO;
+
+
+ if (err==UNZ_OK)
+ if (unzlocal_getLong(s->file,&uMagic) != UNZ_OK)
+ err=UNZ_ERRNO;
+ else if (uMagic!=0x04034b50)
+ err=UNZ_BADZIPFILE;
+
+ if (unzlocal_getShort(s->file,&uData) != UNZ_OK)
+ err=UNZ_ERRNO;
+/*
+ else if ((err==UNZ_OK) && (uData!=s->cur_file_info.wVersion))
+ err=UNZ_BADZIPFILE;
+*/
+ if (unzlocal_getShort(s->file,&uFlags) != UNZ_OK)
+ err=UNZ_ERRNO;
+
+ if (unzlocal_getShort(s->file,&uData) != UNZ_OK)
+ err=UNZ_ERRNO;
+ else if ((err==UNZ_OK) && (uData!=s->cur_file_info.compression_method))
+ err=UNZ_BADZIPFILE;
+
+ if ((err==UNZ_OK) && (s->cur_file_info.compression_method!=0) &&
+ (s->cur_file_info.compression_method!=Z_DEFLATED))
+ err=UNZ_BADZIPFILE;
+
+ if (unzlocal_getLong(s->file,&uData) != UNZ_OK) /* date/time */
+ err=UNZ_ERRNO;
+
+ if (unzlocal_getLong(s->file,&uData) != UNZ_OK) /* crc */
+ err=UNZ_ERRNO;
+ else if ((err==UNZ_OK) && (uData!=s->cur_file_info.crc) &&
+ ((uFlags & 8)==0))
+ err=UNZ_BADZIPFILE;
+
+ if (unzlocal_getLong(s->file,&uData) != UNZ_OK) /* size compr */
+ err=UNZ_ERRNO;
+ else if ((err==UNZ_OK) && (uData!=s->cur_file_info.compressed_size) &&
+ ((uFlags & 8)==0))
+ err=UNZ_BADZIPFILE;
+
+ if (unzlocal_getLong(s->file,&uData) != UNZ_OK) /* size uncompr */
+ err=UNZ_ERRNO;
+ else if ((err==UNZ_OK) && (uData!=s->cur_file_info.uncompressed_size) &&
+ ((uFlags & 8)==0))
+ err=UNZ_BADZIPFILE;
+
+
+ if (unzlocal_getShort(s->file,&size_filename) != UNZ_OK)
+ err=UNZ_ERRNO;
+ else if ((err==UNZ_OK) && (size_filename!=s->cur_file_info.size_filename))
+ err=UNZ_BADZIPFILE;
+
+ *piSizeVar += (uInt)size_filename;
+
+ if (unzlocal_getShort(s->file,&size_extra_field) != UNZ_OK)
+ err=UNZ_ERRNO;
+ *poffset_local_extrafield= s->cur_file_info_internal.offset_curfile +
+ SIZEZIPLOCALHEADER + size_filename;
+ *psize_local_extrafield = (uInt)size_extra_field;
+
+ *piSizeVar += (uInt)size_extra_field;
+
+ return err;
+}
+
+/*
+ Open for reading data the current file in the zipfile.
+ If there is no error and the file is opened, the return value is UNZ_OK.
+*/
+extern int ZEXPORT unzOpenCurrentFile (file)
+ unzFile file;
+{
+ int err=UNZ_OK;
+ int Store;
+ uInt iSizeVar;
+ unz_s* s;
+ file_in_zip_read_info_s* pfile_in_zip_read_info;
+ uLong offset_local_extrafield; /* offset of the local extra field */
+ uInt size_local_extrafield; /* size of the local extra field */
+
+ if (file==NULL)
+ return UNZ_PARAMERROR;
+ s=(unz_s*)file;
+ if (!s->current_file_ok)
+ return UNZ_PARAMERROR;
+
+ if (s->pfile_in_zip_read != NULL)
+ unzCloseCurrentFile(file);
+
+ if (unzlocal_CheckCurrentFileCoherencyHeader(s,&iSizeVar,
+ &offset_local_extrafield,&size_local_extrafield)!=UNZ_OK)
+ return UNZ_BADZIPFILE;
+
+ pfile_in_zip_read_info = (file_in_zip_read_info_s*)
+ ALLOC(sizeof(file_in_zip_read_info_s));
+ if (pfile_in_zip_read_info==NULL)
+ return UNZ_INTERNALERROR;
+
+ pfile_in_zip_read_info->read_buffer=(char*)ALLOC(UNZ_BUFSIZE);
+ pfile_in_zip_read_info->offset_local_extrafield = offset_local_extrafield;
+ pfile_in_zip_read_info->size_local_extrafield = size_local_extrafield;
+ pfile_in_zip_read_info->pos_local_extrafield=0;
+
+ if (pfile_in_zip_read_info->read_buffer==NULL)
+ {
+ TRYFREE(pfile_in_zip_read_info);
+ return UNZ_INTERNALERROR;
+ }
+
+ pfile_in_zip_read_info->stream_initialised=0;
+
+ if ((s->cur_file_info.compression_method!=0) &&
+ (s->cur_file_info.compression_method!=Z_DEFLATED))
+ err=UNZ_BADZIPFILE;
+ Store = s->cur_file_info.compression_method==0;
+
+ pfile_in_zip_read_info->crc32_wait=s->cur_file_info.crc;
+ pfile_in_zip_read_info->crc32=0;
+ pfile_in_zip_read_info->compression_method =
+ s->cur_file_info.compression_method;
+ pfile_in_zip_read_info->file=s->file;
+ pfile_in_zip_read_info->byte_before_the_zipfile=s->byte_before_the_zipfile;
+
+ pfile_in_zip_read_info->stream.total_out = 0;
+
+ if (!Store)
+ {
+ pfile_in_zip_read_info->stream.zalloc = (alloc_func)0;
+ pfile_in_zip_read_info->stream.zfree = (free_func)0;
+ pfile_in_zip_read_info->stream.opaque = (voidpf)0;
+
+ err=inflateInit2(&pfile_in_zip_read_info->stream, -MAX_WBITS);
+ if (err == Z_OK)
+ pfile_in_zip_read_info->stream_initialised=1;
+ /* windowBits is passed < 0 to tell that there is no zlib header.
+ * Note that in this case inflate *requires* an extra "dummy" byte
+ * after the compressed stream in order to complete decompression and
+ * return Z_STREAM_END.
+ * In unzip, i don't wait absolutely Z_STREAM_END because I known the
+ * size of both compressed and uncompressed data
+ */
+ }
+ pfile_in_zip_read_info->rest_read_compressed =
+ s->cur_file_info.compressed_size ;
+ pfile_in_zip_read_info->rest_read_uncompressed =
+ s->cur_file_info.uncompressed_size ;
+
+
+ pfile_in_zip_read_info->pos_in_zipfile =
+ s->cur_file_info_internal.offset_curfile + SIZEZIPLOCALHEADER +
+ iSizeVar;
+
+ pfile_in_zip_read_info->stream.avail_in = (uInt)0;
+
+
+ s->pfile_in_zip_read = pfile_in_zip_read_info;
+ return UNZ_OK;
+}
+
+
+/*
+ Read bytes from the current file.
+ buf contain buffer where data must be copied
+ len the size of buf.
+
+ return the number of byte copied if somes bytes are copied
+ return 0 if the end of file was reached
+ return <0 with error code if there is an error
+ (UNZ_ERRNO for IO error, or zLib error for uncompress error)
+*/
+extern int ZEXPORT unzReadCurrentFile (file, buf, len)
+ unzFile file;
+ voidp buf;
+ unsigned len;
+{
+ int err=UNZ_OK;
+ uInt iRead = 0;
+ unz_s* s;
+ file_in_zip_read_info_s* pfile_in_zip_read_info;
+ if (file==NULL)
+ return UNZ_PARAMERROR;
+ s=(unz_s*)file;
+ pfile_in_zip_read_info=s->pfile_in_zip_read;
+
+ if (pfile_in_zip_read_info==NULL)
+ return UNZ_PARAMERROR;
+
+
+ if ((pfile_in_zip_read_info->read_buffer == NULL))
+ return UNZ_END_OF_LIST_OF_FILE;
+ if (len==0)
+ return 0;
+
+ pfile_in_zip_read_info->stream.next_out = (Bytef*)buf;
+
+ pfile_in_zip_read_info->stream.avail_out = (uInt)len;
+
+ if (len>pfile_in_zip_read_info->rest_read_uncompressed)
+ pfile_in_zip_read_info->stream.avail_out =
+ (uInt)pfile_in_zip_read_info->rest_read_uncompressed;
+
+ while (pfile_in_zip_read_info->stream.avail_out>0)
+ {
+ if ((pfile_in_zip_read_info->stream.avail_in==0) &&
+ (pfile_in_zip_read_info->rest_read_compressed>0))
+ {
+ uInt uReadThis = UNZ_BUFSIZE;
+ if (pfile_in_zip_read_info->rest_read_compressed<uReadThis)
+ uReadThis = (uInt)pfile_in_zip_read_info->rest_read_compressed;
+ if (uReadThis == 0)
+ return UNZ_EOF;
+ if (fseek(pfile_in_zip_read_info->file,
+ pfile_in_zip_read_info->pos_in_zipfile +
+ pfile_in_zip_read_info->byte_before_the_zipfile,SEEK_SET)!=0)
+ return UNZ_ERRNO;
+ if (fread(pfile_in_zip_read_info->read_buffer,uReadThis,1,
+ pfile_in_zip_read_info->file)!=1)
+ return UNZ_ERRNO;
+ pfile_in_zip_read_info->pos_in_zipfile += uReadThis;
+
+ pfile_in_zip_read_info->rest_read_compressed-=uReadThis;
+
+ pfile_in_zip_read_info->stream.next_in =
+ (Bytef*)pfile_in_zip_read_info->read_buffer;
+ pfile_in_zip_read_info->stream.avail_in = (uInt)uReadThis;
+ }
+
+ if (pfile_in_zip_read_info->compression_method==0)
+ {
+ uInt uDoCopy,i ;
+ if (pfile_in_zip_read_info->stream.avail_out <
+ pfile_in_zip_read_info->stream.avail_in)
+ uDoCopy = pfile_in_zip_read_info->stream.avail_out ;
+ else
+ uDoCopy = pfile_in_zip_read_info->stream.avail_in ;
+
+ for (i=0;i<uDoCopy;i++)
+ *(pfile_in_zip_read_info->stream.next_out+i) =
+ *(pfile_in_zip_read_info->stream.next_in+i);
+
+ pfile_in_zip_read_info->crc32 = crc32(pfile_in_zip_read_info->crc32,
+ pfile_in_zip_read_info->stream.next_out,
+ uDoCopy);
+ pfile_in_zip_read_info->rest_read_uncompressed-=uDoCopy;
+ pfile_in_zip_read_info->stream.avail_in -= uDoCopy;
+ pfile_in_zip_read_info->stream.avail_out -= uDoCopy;
+ pfile_in_zip_read_info->stream.next_out += uDoCopy;
+ pfile_in_zip_read_info->stream.next_in += uDoCopy;
+ pfile_in_zip_read_info->stream.total_out += uDoCopy;
+ iRead += uDoCopy;
+ }
+ else
+ {
+ uLong uTotalOutBefore,uTotalOutAfter;
+ const Bytef *bufBefore;
+ uLong uOutThis;
+ int flush=Z_SYNC_FLUSH;
+
+ uTotalOutBefore = pfile_in_zip_read_info->stream.total_out;
+ bufBefore = pfile_in_zip_read_info->stream.next_out;
+
+ /*
+ if ((pfile_in_zip_read_info->rest_read_uncompressed ==
+ pfile_in_zip_read_info->stream.avail_out) &&
+ (pfile_in_zip_read_info->rest_read_compressed == 0))
+ flush = Z_FINISH;
+ */
+ err=inflate(&pfile_in_zip_read_info->stream,flush);
+
+ uTotalOutAfter = pfile_in_zip_read_info->stream.total_out;
+ uOutThis = uTotalOutAfter-uTotalOutBefore;
+
+ pfile_in_zip_read_info->crc32 =
+ crc32(pfile_in_zip_read_info->crc32,bufBefore,
+ (uInt)(uOutThis));
+
+ pfile_in_zip_read_info->rest_read_uncompressed -=
+ uOutThis;
+
+ iRead += (uInt)(uTotalOutAfter - uTotalOutBefore);
+
+ if (err==Z_STREAM_END)
+ return (iRead==0) ? UNZ_EOF : iRead;
+ if (err!=Z_OK)
+ break;
+ }
+ }
+
+ if (err==Z_OK)
+ return iRead;
+ return err;
+}
+
+
+/*
+ Give the current position in uncompressed data
+*/
+extern z_off_t ZEXPORT unztell (file)
+ unzFile file;
+{
+ unz_s* s;
+ file_in_zip_read_info_s* pfile_in_zip_read_info;
+ if (file==NULL)
+ return UNZ_PARAMERROR;
+ s=(unz_s*)file;
+ pfile_in_zip_read_info=s->pfile_in_zip_read;
+
+ if (pfile_in_zip_read_info==NULL)
+ return UNZ_PARAMERROR;
+
+ return (z_off_t)pfile_in_zip_read_info->stream.total_out;
+}
+
+
+/*
+ return 1 if the end of file was reached, 0 elsewhere
+*/
+extern int ZEXPORT unzeof (file)
+ unzFile file;
+{
+ unz_s* s;
+ file_in_zip_read_info_s* pfile_in_zip_read_info;
+ if (file==NULL)
+ return UNZ_PARAMERROR;
+ s=(unz_s*)file;
+ pfile_in_zip_read_info=s->pfile_in_zip_read;
+
+ if (pfile_in_zip_read_info==NULL)
+ return UNZ_PARAMERROR;
+
+ if (pfile_in_zip_read_info->rest_read_uncompressed == 0)
+ return 1;
+ else
+ return 0;
+}
+
+
+
+/*
+ Read extra field from the current file (opened by unzOpenCurrentFile)
+ This is the local-header version of the extra field (sometimes, there is
+ more info in the local-header version than in the central-header)
+
+ if buf==NULL, it return the size of the local extra field that can be read
+
+ if buf!=NULL, len is the size of the buffer, the extra header is copied in
+ buf.
+ the return value is the number of bytes copied in buf, or (if <0)
+ the error code
+*/
+extern int ZEXPORT unzGetLocalExtrafield (file,buf,len)
+ unzFile file;
+ voidp buf;
+ unsigned len;
+{
+ unz_s* s;
+ file_in_zip_read_info_s* pfile_in_zip_read_info;
+ uInt read_now;
+ uLong size_to_read;
+
+ if (file==NULL)
+ return UNZ_PARAMERROR;
+ s=(unz_s*)file;
+ pfile_in_zip_read_info=s->pfile_in_zip_read;
+
+ if (pfile_in_zip_read_info==NULL)
+ return UNZ_PARAMERROR;
+
+ size_to_read = (pfile_in_zip_read_info->size_local_extrafield -
+ pfile_in_zip_read_info->pos_local_extrafield);
+
+ if (buf==NULL)
+ return (int)size_to_read;
+
+ if (len>size_to_read)
+ read_now = (uInt)size_to_read;
+ else
+ read_now = (uInt)len ;
+
+ if (read_now==0)
+ return 0;
+
+ if (fseek(pfile_in_zip_read_info->file,
+ pfile_in_zip_read_info->offset_local_extrafield +
+ pfile_in_zip_read_info->pos_local_extrafield,SEEK_SET)!=0)
+ return UNZ_ERRNO;
+
+ if (fread(buf,(uInt)size_to_read,1,pfile_in_zip_read_info->file)!=1)
+ return UNZ_ERRNO;
+
+ return (int)read_now;
+}
+
+/*
+ Close the file in zip opened with unzipOpenCurrentFile
+ Return UNZ_CRCERROR if all the file was read but the CRC is not good
+*/
+extern int ZEXPORT unzCloseCurrentFile (file)
+ unzFile file;
+{
+ int err=UNZ_OK;
+
+ unz_s* s;
+ file_in_zip_read_info_s* pfile_in_zip_read_info;
+ if (file==NULL)
+ return UNZ_PARAMERROR;
+ s=(unz_s*)file;
+ pfile_in_zip_read_info=s->pfile_in_zip_read;
+
+ if (pfile_in_zip_read_info==NULL)
+ return UNZ_PARAMERROR;
+
+
+ if (pfile_in_zip_read_info->rest_read_uncompressed == 0)
+ {
+ if (pfile_in_zip_read_info->crc32 != pfile_in_zip_read_info->crc32_wait)
+ err=UNZ_CRCERROR;
+ }
+
+
+ TRYFREE(pfile_in_zip_read_info->read_buffer);
+ pfile_in_zip_read_info->read_buffer = NULL;
+ if (pfile_in_zip_read_info->stream_initialised)
+ inflateEnd(&pfile_in_zip_read_info->stream);
+
+ pfile_in_zip_read_info->stream_initialised = 0;
+ TRYFREE(pfile_in_zip_read_info);
+
+ s->pfile_in_zip_read=NULL;
+
+ return err;
+}
+
+
+/*
+ Get the global comment string of the ZipFile, in the szComment buffer.
+ uSizeBuf is the size of the szComment buffer.
+ return the number of byte copied or an error code <0
+*/
+extern int ZEXPORT unzGetGlobalComment (file, szComment, uSizeBuf)
+ unzFile file;
+ char *szComment;
+ uLong uSizeBuf;
+{
+ int err=UNZ_OK;
+ unz_s* s;
+ uLong uReadThis ;
+ if (file==NULL)
+ return UNZ_PARAMERROR;
+ s=(unz_s*)file;
+
+ uReadThis = uSizeBuf;
+ if (uReadThis>s->gi.size_comment)
+ uReadThis = s->gi.size_comment;
+
+ if (fseek(s->file,s->central_pos+22,SEEK_SET)!=0)
+ return UNZ_ERRNO;
+
+ if (uReadThis>0)
+ {
+ *szComment='\0';
+ if (fread(szComment,(uInt)uReadThis,1,s->file)!=1)
+ return UNZ_ERRNO;
+ }
+
+ if ((szComment != NULL) && (uSizeBuf > s->gi.size_comment))
+ *(szComment+s->gi.size_comment)='\0';
+ return (int)uReadThis;
+}
diff --git a/gnu/usr.bin/cvs/zlib/contrib/minizip/unzip.def b/gnu/usr.bin/cvs/zlib/contrib/minizip/unzip.def
new file mode 100644
index 00000000000..f6ede89bc96
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/contrib/minizip/unzip.def
@@ -0,0 +1,15 @@
+ unzOpen @61
+ unzClose @62
+ unzGetGlobalInfo @63
+ unzGetCurrentFileInfo @64
+ unzGoToFirstFile @65
+ unzGoToNextFile @66
+ unzOpenCurrentFile @67
+ unzReadCurrentFile @68
+ unztell @70
+ unzeof @71
+ unzCloseCurrentFile @72
+ unzGetGlobalComment @73
+ unzStringFileNameCompare @74
+ unzLocateFile @75
+ unzGetLocalExtrafield @76
diff --git a/gnu/usr.bin/cvs/zlib/contrib/minizip/unzip.h b/gnu/usr.bin/cvs/zlib/contrib/minizip/unzip.h
new file mode 100644
index 00000000000..76692cb703c
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/contrib/minizip/unzip.h
@@ -0,0 +1,275 @@
+/* unzip.h -- IO for uncompress .zip files using zlib
+ Version 0.15 beta, Mar 19th, 1998,
+
+ Copyright (C) 1998 Gilles Vollant
+
+ This unzip package allow extract file from .ZIP file, compatible with PKZip 2.04g
+ WinZip, InfoZip tools and compatible.
+ Encryption and multi volume ZipFile (span) are not supported.
+ Old compressions used by old PKZip 1.x are not supported
+
+ THIS IS AN ALPHA VERSION. AT THIS STAGE OF DEVELOPPEMENT, SOMES API OR STRUCTURE
+ CAN CHANGE IN FUTURE VERSION !!
+ I WAIT FEEDBACK at mail info@winimage.com
+ Visit also http://www.winimage.com/zLibDll/unzip.htm for evolution
+
+ Condition of use and distribution are the same than zlib :
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+
+*/
+/* for more info about .ZIP format, see
+ ftp://ftp.cdrom.com/pub/infozip/doc/appnote-970311-iz.zip
+ PkWare has also a specification at :
+ ftp://ftp.pkware.com/probdesc.zip */
+
+#ifndef _unz_H
+#define _unz_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _ZLIB_H
+#include "zlib.h"
+#endif
+
+#if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP)
+/* like the STRICT of WIN32, we define a pointer that cannot be converted
+ from (void*) without cast */
+typedef struct TagunzFile__ { int unused; } unzFile__;
+typedef unzFile__ *unzFile;
+#else
+typedef voidp unzFile;
+#endif
+
+
+#define UNZ_OK (0)
+#define UNZ_END_OF_LIST_OF_FILE (-100)
+#define UNZ_ERRNO (Z_ERRNO)
+#define UNZ_EOF (0)
+#define UNZ_PARAMERROR (-102)
+#define UNZ_BADZIPFILE (-103)
+#define UNZ_INTERNALERROR (-104)
+#define UNZ_CRCERROR (-105)
+
+/* tm_unz contain date/time info */
+typedef struct tm_unz_s
+{
+ uInt tm_sec; /* seconds after the minute - [0,59] */
+ uInt tm_min; /* minutes after the hour - [0,59] */
+ uInt tm_hour; /* hours since midnight - [0,23] */
+ uInt tm_mday; /* day of the month - [1,31] */
+ uInt tm_mon; /* months since January - [0,11] */
+ uInt tm_year; /* years - [1980..2044] */
+} tm_unz;
+
+/* unz_global_info structure contain global data about the ZIPfile
+ These data comes from the end of central dir */
+typedef struct unz_global_info_s
+{
+ uLong number_entry; /* total number of entries in
+ the central dir on this disk */
+ uLong size_comment; /* size of the global comment of the zipfile */
+} unz_global_info;
+
+
+/* unz_file_info contain information about a file in the zipfile */
+typedef struct unz_file_info_s
+{
+ uLong version; /* version made by 2 bytes */
+ uLong version_needed; /* version needed to extract 2 bytes */
+ uLong flag; /* general purpose bit flag 2 bytes */
+ uLong compression_method; /* compression method 2 bytes */
+ uLong dosDate; /* last mod file date in Dos fmt 4 bytes */
+ uLong crc; /* crc-32 4 bytes */
+ uLong compressed_size; /* compressed size 4 bytes */
+ uLong uncompressed_size; /* uncompressed size 4 bytes */
+ uLong size_filename; /* filename length 2 bytes */
+ uLong size_file_extra; /* extra field length 2 bytes */
+ uLong size_file_comment; /* file comment length 2 bytes */
+
+ uLong disk_num_start; /* disk number start 2 bytes */
+ uLong internal_fa; /* internal file attributes 2 bytes */
+ uLong external_fa; /* external file attributes 4 bytes */
+
+ tm_unz tmu_date;
+} unz_file_info;
+
+extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1,
+ const char* fileName2,
+ int iCaseSensitivity));
+/*
+ Compare two filename (fileName1,fileName2).
+ If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp)
+ If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi
+ or strcasecmp)
+ If iCaseSenisivity = 0, case sensitivity is defaut of your operating system
+ (like 1 on Unix, 2 on Windows)
+*/
+
+
+extern unzFile ZEXPORT unzOpen OF((const char *path));
+/*
+ Open a Zip file. path contain the full pathname (by example,
+ on a Windows NT computer "c:\\zlib\\zlib111.zip" or on an Unix computer
+ "zlib/zlib111.zip".
+ If the zipfile cannot be opened (file don't exist or in not valid), the
+ return value is NULL.
+ Else, the return value is a unzFile Handle, usable with other function
+ of this unzip package.
+*/
+
+extern int ZEXPORT unzClose OF((unzFile file));
+/*
+ Close a ZipFile opened with unzipOpen.
+ If there is files inside the .Zip opened with unzOpenCurrentFile (see later),
+ these files MUST be closed with unzipCloseCurrentFile before call unzipClose.
+ return UNZ_OK if there is no problem. */
+
+extern int ZEXPORT unzGetGlobalInfo OF((unzFile file,
+ unz_global_info *pglobal_info));
+/*
+ Write info about the ZipFile in the *pglobal_info structure.
+ No preparation of the structure is needed
+ return UNZ_OK if there is no problem. */
+
+
+extern int ZEXPORT unzGetGlobalComment OF((unzFile file,
+ char *szComment,
+ uLong uSizeBuf));
+/*
+ Get the global comment string of the ZipFile, in the szComment buffer.
+ uSizeBuf is the size of the szComment buffer.
+ return the number of byte copied or an error code <0
+*/
+
+
+/***************************************************************************/
+/* Unzip package allow you browse the directory of the zipfile */
+
+extern int ZEXPORT unzGoToFirstFile OF((unzFile file));
+/*
+ Set the current file of the zipfile to the first file.
+ return UNZ_OK if there is no problem
+*/
+
+extern int ZEXPORT unzGoToNextFile OF((unzFile file));
+/*
+ Set the current file of the zipfile to the next file.
+ return UNZ_OK if there is no problem
+ return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest.
+*/
+
+extern int ZEXPORT unzLocateFile OF((unzFile file,
+ const char *szFileName,
+ int iCaseSensitivity));
+/*
+ Try locate the file szFileName in the zipfile.
+ For the iCaseSensitivity signification, see unzStringFileNameCompare
+
+ return value :
+ UNZ_OK if the file is found. It becomes the current file.
+ UNZ_END_OF_LIST_OF_FILE if the file is not found
+*/
+
+
+extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file,
+ unz_file_info *pfile_info,
+ char *szFileName,
+ uLong fileNameBufferSize,
+ void *extraField,
+ uLong extraFieldBufferSize,
+ char *szComment,
+ uLong commentBufferSize));
+/*
+ Get Info about the current file
+ if pfile_info!=NULL, the *pfile_info structure will contain somes info about
+ the current file
+ if szFileName!=NULL, the filemane string will be copied in szFileName
+ (fileNameBufferSize is the size of the buffer)
+ if extraField!=NULL, the extra field information will be copied in extraField
+ (extraFieldBufferSize is the size of the buffer).
+ This is the Central-header version of the extra field
+ if szComment!=NULL, the comment string of the file will be copied in szComment
+ (commentBufferSize is the size of the buffer)
+*/
+
+/***************************************************************************/
+/* for reading the content of the current zipfile, you can open it, read data
+ from it, and close it (you can close it before reading all the file)
+ */
+
+extern int ZEXPORT unzOpenCurrentFile OF((unzFile file));
+/*
+ Open for reading data the current file in the zipfile.
+ If there is no error, the return value is UNZ_OK.
+*/
+
+extern int ZEXPORT unzCloseCurrentFile OF((unzFile file));
+/*
+ Close the file in zip opened with unzOpenCurrentFile
+ Return UNZ_CRCERROR if all the file was read but the CRC is not good
+*/
+
+
+extern int ZEXPORT unzReadCurrentFile OF((unzFile file,
+ voidp buf,
+ unsigned len));
+/*
+ Read bytes from the current file (opened by unzOpenCurrentFile)
+ buf contain buffer where data must be copied
+ len the size of buf.
+
+ return the number of byte copied if somes bytes are copied
+ return 0 if the end of file was reached
+ return <0 with error code if there is an error
+ (UNZ_ERRNO for IO error, or zLib error for uncompress error)
+*/
+
+extern z_off_t ZEXPORT unztell OF((unzFile file));
+/*
+ Give the current position in uncompressed data
+*/
+
+extern int ZEXPORT unzeof OF((unzFile file));
+/*
+ return 1 if the end of file was reached, 0 elsewhere
+*/
+
+extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file,
+ voidp buf,
+ unsigned len));
+/*
+ Read extra field from the current file (opened by unzOpenCurrentFile)
+ This is the local-header version of the extra field (sometimes, there is
+ more info in the local-header version than in the central-header)
+
+ if buf==NULL, it return the size of the local extra field
+
+ if buf!=NULL, len is the size of the buffer, the extra header is copied in
+ buf.
+ the return value is the number of bytes copied in buf, or (if <0)
+ the error code
+*/
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _unz_H */
diff --git a/gnu/usr.bin/cvs/zlib/contrib/minizip/zip.c b/gnu/usr.bin/cvs/zlib/contrib/minizip/zip.c
new file mode 100644
index 00000000000..0cae64ab7b1
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/contrib/minizip/zip.c
@@ -0,0 +1,718 @@
+/* zip.c -- IO on .zip files using zlib
+ Version 0.15 beta, Mar 19th, 1998,
+
+ Read zip.h for more info
+*/
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "zlib.h"
+#include "zip.h"
+
+#ifdef STDC
+# include <stddef.h>
+# include <string.h>
+# include <stdlib.h>
+#endif
+#ifdef NO_ERRNO_H
+ extern int errno;
+#else
+# include <errno.h>
+#endif
+
+
+#ifndef local
+# define local static
+#endif
+/* compile with -Dlocal if your debugger can't find static symbols */
+
+#ifndef VERSIONMADEBY
+# define VERSIONMADEBY (0x0) /* platform depedent */
+#endif
+
+#ifndef Z_BUFSIZE
+#define Z_BUFSIZE (16384)
+#endif
+
+#ifndef Z_MAXFILENAMEINZIP
+#define Z_MAXFILENAMEINZIP (256)
+#endif
+
+#ifndef ALLOC
+# define ALLOC(size) (malloc(size))
+#endif
+#ifndef TRYFREE
+# define TRYFREE(p) {if (p) free(p);}
+#endif
+
+/*
+#define SIZECENTRALDIRITEM (0x2e)
+#define SIZEZIPLOCALHEADER (0x1e)
+*/
+
+/* I've found an old Unix (a SunOS 4.1.3_U1) without all SEEK_* defined.... */
+
+#ifndef SEEK_CUR
+#define SEEK_CUR 1
+#endif
+
+#ifndef SEEK_END
+#define SEEK_END 2
+#endif
+
+#ifndef SEEK_SET
+#define SEEK_SET 0
+#endif
+
+const char zip_copyright[] =
+ " zip 0.15 Copyright 1998 Gilles Vollant ";
+
+
+#define SIZEDATA_INDATABLOCK (4096-(4*4))
+
+#define LOCALHEADERMAGIC (0x04034b50)
+#define CENTRALHEADERMAGIC (0x02014b50)
+#define ENDHEADERMAGIC (0x06054b50)
+
+#define FLAG_LOCALHEADER_OFFSET (0x06)
+#define CRC_LOCALHEADER_OFFSET (0x0e)
+
+#define SIZECENTRALHEADER (0x2e) /* 46 */
+
+typedef struct linkedlist_datablock_internal_s
+{
+ struct linkedlist_datablock_internal_s* next_datablock;
+ uLong avail_in_this_block;
+ uLong filled_in_this_block;
+ uLong unused; /* for future use and alignement */
+ unsigned char data[SIZEDATA_INDATABLOCK];
+} linkedlist_datablock_internal;
+
+typedef struct linkedlist_data_s
+{
+ linkedlist_datablock_internal* first_block;
+ linkedlist_datablock_internal* last_block;
+} linkedlist_data;
+
+
+typedef struct
+{
+ z_stream stream; /* zLib stream structure for inflate */
+ int stream_initialised; /* 1 is stream is initialised */
+ uInt pos_in_buffered_data; /* last written byte in buffered_data */
+
+ uLong pos_local_header; /* offset of the local header of the file
+ currenty writing */
+ char* central_header; /* central header data for the current file */
+ uLong size_centralheader; /* size of the central header for cur file */
+ uLong flag; /* flag of the file currently writing */
+
+ int method; /* compression method of file currenty wr.*/
+ Byte buffered_data[Z_BUFSIZE];/* buffer contain compressed data to be writ*/
+ uLong dosDate;
+ uLong crc32;
+} curfile_info;
+
+typedef struct
+{
+ FILE * filezip;
+ linkedlist_data central_dir;/* datablock with central dir in construction*/
+ int in_opened_file_inzip; /* 1 if a file in the zip is currently writ.*/
+ curfile_info ci; /* info on the file curretly writing */
+
+ uLong begin_pos; /* position of the beginning of the zipfile */
+ uLong number_entry;
+} zip_internal;
+
+local linkedlist_datablock_internal* allocate_new_datablock()
+{
+ linkedlist_datablock_internal* ldi;
+ ldi = (linkedlist_datablock_internal*)
+ ALLOC(sizeof(linkedlist_datablock_internal));
+ if (ldi!=NULL)
+ {
+ ldi->next_datablock = NULL ;
+ ldi->filled_in_this_block = 0 ;
+ ldi->avail_in_this_block = SIZEDATA_INDATABLOCK ;
+ }
+ return ldi;
+}
+
+local void free_datablock(ldi)
+ linkedlist_datablock_internal* ldi;
+{
+ while (ldi!=NULL)
+ {
+ linkedlist_datablock_internal* ldinext = ldi->next_datablock;
+ TRYFREE(ldi);
+ ldi = ldinext;
+ }
+}
+
+local void init_linkedlist(ll)
+ linkedlist_data* ll;
+{
+ ll->first_block = ll->last_block = NULL;
+}
+
+local void free_linkedlist(ll)
+ linkedlist_data* ll;
+{
+ free_datablock(ll->first_block);
+ ll->first_block = ll->last_block = NULL;
+}
+
+
+local int add_data_in_datablock(ll,buf,len)
+ linkedlist_data* ll;
+ const void* buf;
+ uLong len;
+{
+ linkedlist_datablock_internal* ldi;
+ const unsigned char* from_copy;
+
+ if (ll==NULL)
+ return ZIP_INTERNALERROR;
+
+ if (ll->last_block == NULL)
+ {
+ ll->first_block = ll->last_block = allocate_new_datablock();
+ if (ll->first_block == NULL)
+ return ZIP_INTERNALERROR;
+ }
+
+ ldi = ll->last_block;
+ from_copy = (unsigned char*)buf;
+
+ while (len>0)
+ {
+ uInt copy_this;
+ uInt i;
+ unsigned char* to_copy;
+
+ if (ldi->avail_in_this_block==0)
+ {
+ ldi->next_datablock = allocate_new_datablock();
+ if (ldi->next_datablock == NULL)
+ return ZIP_INTERNALERROR;
+ ldi = ldi->next_datablock ;
+ ll->last_block = ldi;
+ }
+
+ if (ldi->avail_in_this_block < len)
+ copy_this = (uInt)ldi->avail_in_this_block;
+ else
+ copy_this = (uInt)len;
+
+ to_copy = &(ldi->data[ldi->filled_in_this_block]);
+
+ for (i=0;i<copy_this;i++)
+ *(to_copy+i)=*(from_copy+i);
+
+ ldi->filled_in_this_block += copy_this;
+ ldi->avail_in_this_block -= copy_this;
+ from_copy += copy_this ;
+ len -= copy_this;
+ }
+ return ZIP_OK;
+}
+
+
+local int write_datablock(fout,ll)
+ FILE * fout;
+ linkedlist_data* ll;
+{
+ linkedlist_datablock_internal* ldi;
+ ldi = ll->first_block;
+ while (ldi!=NULL)
+ {
+ if (ldi->filled_in_this_block > 0)
+ if (fwrite(ldi->data,(uInt)ldi->filled_in_this_block,1,fout)!=1)
+ return ZIP_ERRNO;
+ ldi = ldi->next_datablock;
+ }
+ return ZIP_OK;
+}
+
+/****************************************************************************/
+
+/* ===========================================================================
+ Outputs a long in LSB order to the given file
+ nbByte == 1, 2 or 4 (byte, short or long)
+*/
+
+local int ziplocal_putValue OF((FILE *file, uLong x, int nbByte));
+local int ziplocal_putValue (file, x, nbByte)
+ FILE *file;
+ uLong x;
+ int nbByte;
+{
+ unsigned char buf[4];
+ int n;
+ for (n = 0; n < nbByte; n++) {
+ buf[n] = (unsigned char)(x & 0xff);
+ x >>= 8;
+ }
+ if (fwrite(buf,nbByte,1,file)!=1)
+ return ZIP_ERRNO;
+ else
+ return ZIP_OK;
+}
+
+local void ziplocal_putValue_inmemory OF((void* dest, uLong x, int nbByte));
+local void ziplocal_putValue_inmemory (dest, x, nbByte)
+ void* dest;
+ uLong x;
+ int nbByte;
+{
+ unsigned char* buf=(unsigned char*)dest;
+ int n;
+ for (n = 0; n < nbByte; n++) {
+ buf[n] = (unsigned char)(x & 0xff);
+ x >>= 8;
+ }
+}
+/****************************************************************************/
+
+
+local uLong ziplocal_TmzDateToDosDate(ptm,dosDate)
+ tm_zip* ptm;
+ uLong dosDate;
+{
+ uLong year = (uLong)ptm->tm_year;
+ if (year>1980)
+ year-=1980;
+ else if (year>80)
+ year-=80;
+ return
+ (uLong) (((ptm->tm_mday) + (32 * (ptm->tm_mon+1)) + (512 * year)) << 16) |
+ ((ptm->tm_sec/2) + (32* ptm->tm_min) + (2048 * (uLong)ptm->tm_hour));
+}
+
+
+/****************************************************************************/
+
+extern zipFile ZEXPORT zipOpen (pathname, append)
+ const char *pathname;
+ int append;
+{
+ zip_internal ziinit;
+ zip_internal* zi;
+
+ ziinit.filezip = fopen(pathname,(append == 0) ? "wb" : "ab");
+ if (ziinit.filezip == NULL)
+ return NULL;
+ ziinit.begin_pos = ftell(ziinit.filezip);
+ ziinit.in_opened_file_inzip = 0;
+ ziinit.ci.stream_initialised = 0;
+ ziinit.number_entry = 0;
+ init_linkedlist(&(ziinit.central_dir));
+
+
+ zi = (zip_internal*)ALLOC(sizeof(zip_internal));
+ if (zi==NULL)
+ {
+ fclose(ziinit.filezip);
+ return NULL;
+ }
+
+ *zi = ziinit;
+ return (zipFile)zi;
+}
+
+extern int ZEXPORT zipOpenNewFileInZip (file, filename, zipfi,
+ extrafield_local, size_extrafield_local,
+ extrafield_global, size_extrafield_global,
+ comment, method, level)
+ zipFile file;
+ const char* filename;
+ const zip_fileinfo* zipfi;
+ const void* extrafield_local;
+ uInt size_extrafield_local;
+ const void* extrafield_global;
+ uInt size_extrafield_global;
+ const char* comment;
+ int method;
+ int level;
+{
+ zip_internal* zi;
+ uInt size_filename;
+ uInt size_comment;
+ uInt i;
+ int err = ZIP_OK;
+
+ if (file == NULL)
+ return ZIP_PARAMERROR;
+ if ((method!=0) && (method!=Z_DEFLATED))
+ return ZIP_PARAMERROR;
+
+ zi = (zip_internal*)file;
+
+ if (zi->in_opened_file_inzip == 1)
+ {
+ err = zipCloseFileInZip (file);
+ if (err != ZIP_OK)
+ return err;
+ }
+
+
+ if (filename==NULL)
+ filename="-";
+
+ if (comment==NULL)
+ size_comment = 0;
+ else
+ size_comment = strlen(comment);
+
+ size_filename = strlen(filename);
+
+ if (zipfi == NULL)
+ zi->ci.dosDate = 0;
+ else
+ {
+ if (zipfi->dosDate != 0)
+ zi->ci.dosDate = zipfi->dosDate;
+ else zi->ci.dosDate = ziplocal_TmzDateToDosDate(&zipfi->tmz_date,zipfi->dosDate);
+ }
+
+ zi->ci.flag = 0;
+ if ((level==8) || (level==9))
+ zi->ci.flag |= 2;
+ if ((level==2))
+ zi->ci.flag |= 4;
+ if ((level==1))
+ zi->ci.flag |= 6;
+
+ zi->ci.crc32 = 0;
+ zi->ci.method = method;
+ zi->ci.stream_initialised = 0;
+ zi->ci.pos_in_buffered_data = 0;
+ zi->ci.pos_local_header = ftell(zi->filezip);
+ zi->ci.size_centralheader = SIZECENTRALHEADER + size_filename +
+ size_extrafield_global + size_comment;
+ zi->ci.central_header = (char*)ALLOC((uInt)zi->ci.size_centralheader);
+
+ ziplocal_putValue_inmemory(zi->ci.central_header,(uLong)CENTRALHEADERMAGIC,4);
+ /* version info */
+ ziplocal_putValue_inmemory(zi->ci.central_header+4,(uLong)VERSIONMADEBY,2);
+ ziplocal_putValue_inmemory(zi->ci.central_header+6,(uLong)20,2);
+ ziplocal_putValue_inmemory(zi->ci.central_header+8,(uLong)zi->ci.flag,2);
+ ziplocal_putValue_inmemory(zi->ci.central_header+10,(uLong)zi->ci.method,2);
+ ziplocal_putValue_inmemory(zi->ci.central_header+12,(uLong)zi->ci.dosDate,4);
+ ziplocal_putValue_inmemory(zi->ci.central_header+16,(uLong)0,4); /*crc*/
+ ziplocal_putValue_inmemory(zi->ci.central_header+20,(uLong)0,4); /*compr size*/
+ ziplocal_putValue_inmemory(zi->ci.central_header+24,(uLong)0,4); /*uncompr size*/
+ ziplocal_putValue_inmemory(zi->ci.central_header+28,(uLong)size_filename,2);
+ ziplocal_putValue_inmemory(zi->ci.central_header+30,(uLong)size_extrafield_global,2);
+ ziplocal_putValue_inmemory(zi->ci.central_header+32,(uLong)size_comment,2);
+ ziplocal_putValue_inmemory(zi->ci.central_header+34,(uLong)0,2); /*disk nm start*/
+
+ if (zipfi==NULL)
+ ziplocal_putValue_inmemory(zi->ci.central_header+36,(uLong)0,2);
+ else
+ ziplocal_putValue_inmemory(zi->ci.central_header+36,(uLong)zipfi->internal_fa,2);
+
+ if (zipfi==NULL)
+ ziplocal_putValue_inmemory(zi->ci.central_header+38,(uLong)0,4);
+ else
+ ziplocal_putValue_inmemory(zi->ci.central_header+38,(uLong)zipfi->external_fa,4);
+
+ ziplocal_putValue_inmemory(zi->ci.central_header+42,(uLong)zi->ci.pos_local_header,4);
+
+ for (i=0;i<size_filename;i++)
+ *(zi->ci.central_header+SIZECENTRALHEADER+i) = *(filename+i);
+
+ for (i=0;i<size_extrafield_global;i++)
+ *(zi->ci.central_header+SIZECENTRALHEADER+size_filename+i) =
+ *(((const char*)extrafield_global)+i);
+
+ for (i=0;i<size_comment;i++)
+ *(zi->ci.central_header+SIZECENTRALHEADER+size_filename+
+ size_extrafield_global+i) = *(filename+i);
+ if (zi->ci.central_header == NULL)
+ return ZIP_INTERNALERROR;
+
+ /* write the local header */
+ err = ziplocal_putValue(zi->filezip,(uLong)LOCALHEADERMAGIC,4);
+
+ if (err==ZIP_OK)
+ err = ziplocal_putValue(zi->filezip,(uLong)20,2);/* version needed to extract */
+ if (err==ZIP_OK)
+ err = ziplocal_putValue(zi->filezip,(uLong)zi->ci.flag,2);
+
+ if (err==ZIP_OK)
+ err = ziplocal_putValue(zi->filezip,(uLong)zi->ci.method,2);
+
+ if (err==ZIP_OK)
+ err = ziplocal_putValue(zi->filezip,(uLong)zi->ci.dosDate,4);
+
+ if (err==ZIP_OK)
+ err = ziplocal_putValue(zi->filezip,(uLong)0,4); /* crc 32, unknown */
+ if (err==ZIP_OK)
+ err = ziplocal_putValue(zi->filezip,(uLong)0,4); /* compressed size, unknown */
+ if (err==ZIP_OK)
+ err = ziplocal_putValue(zi->filezip,(uLong)0,4); /* uncompressed size, unknown */
+
+ if (err==ZIP_OK)
+ err = ziplocal_putValue(zi->filezip,(uLong)size_filename,2);
+
+ if (err==ZIP_OK)
+ err = ziplocal_putValue(zi->filezip,(uLong)size_extrafield_local,2);
+
+ if ((err==ZIP_OK) && (size_filename>0))
+ if (fwrite(filename,(uInt)size_filename,1,zi->filezip)!=1)
+ err = ZIP_ERRNO;
+
+ if ((err==ZIP_OK) && (size_extrafield_local>0))
+ if (fwrite(extrafield_local,(uInt)size_extrafield_local,1,zi->filezip)
+ !=1)
+ err = ZIP_ERRNO;
+
+ zi->ci.stream.avail_in = (uInt)0;
+ zi->ci.stream.avail_out = (uInt)Z_BUFSIZE;
+ zi->ci.stream.next_out = zi->ci.buffered_data;
+ zi->ci.stream.total_in = 0;
+ zi->ci.stream.total_out = 0;
+
+ if ((err==ZIP_OK) && (zi->ci.method == Z_DEFLATED))
+ {
+ zi->ci.stream.zalloc = (alloc_func)0;
+ zi->ci.stream.zfree = (free_func)0;
+ zi->ci.stream.opaque = (voidpf)0;
+
+ err = deflateInit2(&zi->ci.stream, level,
+ Z_DEFLATED, -MAX_WBITS, DEF_MEM_LEVEL, 0);
+
+ if (err==Z_OK)
+ zi->ci.stream_initialised = 1;
+ }
+
+
+ if (err==Z_OK)
+ zi->in_opened_file_inzip = 1;
+ return err;
+}
+
+extern int ZEXPORT zipWriteInFileInZip (file, buf, len)
+ zipFile file;
+ const voidp buf;
+ unsigned len;
+{
+ zip_internal* zi;
+ int err=ZIP_OK;
+
+ if (file == NULL)
+ return ZIP_PARAMERROR;
+ zi = (zip_internal*)file;
+
+ if (zi->in_opened_file_inzip == 0)
+ return ZIP_PARAMERROR;
+
+ zi->ci.stream.next_in = buf;
+ zi->ci.stream.avail_in = len;
+ zi->ci.crc32 = crc32(zi->ci.crc32,buf,len);
+
+ while ((err==ZIP_OK) && (zi->ci.stream.avail_in>0))
+ {
+ if (zi->ci.stream.avail_out == 0)
+ {
+ if (fwrite(zi->ci.buffered_data,(uInt)zi->ci.pos_in_buffered_data,1,zi->filezip)
+ !=1)
+ err = ZIP_ERRNO;
+ zi->ci.pos_in_buffered_data = 0;
+ zi->ci.stream.avail_out = (uInt)Z_BUFSIZE;
+ zi->ci.stream.next_out = zi->ci.buffered_data;
+ }
+
+ if (zi->ci.method == Z_DEFLATED)
+ {
+ uLong uTotalOutBefore = zi->ci.stream.total_out;
+ err=deflate(&zi->ci.stream, Z_NO_FLUSH);
+ zi->ci.pos_in_buffered_data += (uInt)(zi->ci.stream.total_out - uTotalOutBefore) ;
+
+ }
+ else
+ {
+ uInt copy_this,i;
+ if (zi->ci.stream.avail_in < zi->ci.stream.avail_out)
+ copy_this = zi->ci.stream.avail_in;
+ else
+ copy_this = zi->ci.stream.avail_out;
+ for (i=0;i<copy_this;i++)
+ *(((char*)zi->ci.stream.next_out)+i) =
+ *(((const char*)zi->ci.stream.next_in)+i);
+ {
+ zi->ci.stream.avail_in -= copy_this;
+ zi->ci.stream.avail_out-= copy_this;
+ zi->ci.stream.next_in+= copy_this;
+ zi->ci.stream.next_out+= copy_this;
+ zi->ci.stream.total_in+= copy_this;
+ zi->ci.stream.total_out+= copy_this;
+ zi->ci.pos_in_buffered_data += copy_this;
+ }
+ }
+ }
+
+ return 0;
+}
+
+extern int ZEXPORT zipCloseFileInZip (file)
+ zipFile file;
+{
+ zip_internal* zi;
+ int err=ZIP_OK;
+
+ if (file == NULL)
+ return ZIP_PARAMERROR;
+ zi = (zip_internal*)file;
+
+ if (zi->in_opened_file_inzip == 0)
+ return ZIP_PARAMERROR;
+ zi->ci.stream.avail_in = 0;
+
+ if (zi->ci.method == Z_DEFLATED)
+ while (err==ZIP_OK)
+ {
+ uLong uTotalOutBefore;
+ if (zi->ci.stream.avail_out == 0)
+ {
+ if (fwrite(zi->ci.buffered_data,(uInt)zi->ci.pos_in_buffered_data,1,zi->filezip)
+ !=1)
+ err = ZIP_ERRNO;
+ zi->ci.pos_in_buffered_data = 0;
+ zi->ci.stream.avail_out = (uInt)Z_BUFSIZE;
+ zi->ci.stream.next_out = zi->ci.buffered_data;
+ }
+ uTotalOutBefore = zi->ci.stream.total_out;
+ err=deflate(&zi->ci.stream, Z_FINISH);
+ zi->ci.pos_in_buffered_data += (uInt)(zi->ci.stream.total_out - uTotalOutBefore) ;
+ }
+
+ if (err==Z_STREAM_END)
+ err=ZIP_OK; /* this is normal */
+
+ if ((zi->ci.pos_in_buffered_data>0) && (err==ZIP_OK))
+ if (fwrite(zi->ci.buffered_data,(uInt)zi->ci.pos_in_buffered_data,1,zi->filezip)
+ !=1)
+ err = ZIP_ERRNO;
+
+ if ((zi->ci.method == Z_DEFLATED) && (err==ZIP_OK))
+ {
+ err=deflateEnd(&zi->ci.stream);
+ zi->ci.stream_initialised = 0;
+ }
+
+ ziplocal_putValue_inmemory(zi->ci.central_header+16,(uLong)zi->ci.crc32,4); /*crc*/
+ ziplocal_putValue_inmemory(zi->ci.central_header+20,
+ (uLong)zi->ci.stream.total_out,4); /*compr size*/
+ ziplocal_putValue_inmemory(zi->ci.central_header+24,
+ (uLong)zi->ci.stream.total_in,4); /*uncompr size*/
+
+ if (err==ZIP_OK)
+ err = add_data_in_datablock(&zi->central_dir,zi->ci.central_header,
+ (uLong)zi->ci.size_centralheader);
+ free(zi->ci.central_header);
+
+ if (err==ZIP_OK)
+ {
+ long cur_pos_inzip = ftell(zi->filezip);
+ if (fseek(zi->filezip,
+ zi->ci.pos_local_header + 14,SEEK_SET)!=0)
+ err = ZIP_ERRNO;
+
+ if (err==ZIP_OK)
+ err = ziplocal_putValue(zi->filezip,(uLong)zi->ci.crc32,4); /* crc 32, unknown */
+
+ if (err==ZIP_OK) /* compressed size, unknown */
+ err = ziplocal_putValue(zi->filezip,(uLong)zi->ci.stream.total_out,4);
+
+ if (err==ZIP_OK) /* uncompressed size, unknown */
+ err = ziplocal_putValue(zi->filezip,(uLong)zi->ci.stream.total_in,4);
+
+ if (fseek(zi->filezip,
+ cur_pos_inzip,SEEK_SET)!=0)
+ err = ZIP_ERRNO;
+ }
+
+ zi->number_entry ++;
+ zi->in_opened_file_inzip = 0;
+
+ return err;
+}
+
+extern int ZEXPORT zipClose (file, global_comment)
+ zipFile file;
+ const char* global_comment;
+{
+ zip_internal* zi;
+ int err = 0;
+ uLong size_centraldir = 0;
+ uLong centraldir_pos_inzip ;
+ uInt size_global_comment;
+ if (file == NULL)
+ return ZIP_PARAMERROR;
+ zi = (zip_internal*)file;
+
+ if (zi->in_opened_file_inzip == 1)
+ {
+ err = zipCloseFileInZip (file);
+ }
+
+ if (global_comment==NULL)
+ size_global_comment = 0;
+ else
+ size_global_comment = strlen(global_comment);
+
+
+ centraldir_pos_inzip = ftell(zi->filezip);
+ if (err==ZIP_OK)
+ {
+ linkedlist_datablock_internal* ldi = zi->central_dir.first_block ;
+ while (ldi!=NULL)
+ {
+ if ((err==ZIP_OK) && (ldi->filled_in_this_block>0))
+ if (fwrite(ldi->data,(uInt)ldi->filled_in_this_block,
+ 1,zi->filezip) !=1 )
+ err = ZIP_ERRNO;
+
+ size_centraldir += ldi->filled_in_this_block;
+ ldi = ldi->next_datablock;
+ }
+ }
+ free_datablock(zi->central_dir.first_block);
+
+ if (err==ZIP_OK) /* Magic End */
+ err = ziplocal_putValue(zi->filezip,(uLong)ENDHEADERMAGIC,4);
+
+ if (err==ZIP_OK) /* number of this disk */
+ err = ziplocal_putValue(zi->filezip,(uLong)0,2);
+
+ if (err==ZIP_OK) /* number of the disk with the start of the central directory */
+ err = ziplocal_putValue(zi->filezip,(uLong)0,2);
+
+ if (err==ZIP_OK) /* total number of entries in the central dir on this disk */
+ err = ziplocal_putValue(zi->filezip,(uLong)zi->number_entry,2);
+
+ if (err==ZIP_OK) /* total number of entries in the central dir */
+ err = ziplocal_putValue(zi->filezip,(uLong)zi->number_entry,2);
+
+ if (err==ZIP_OK) /* size of the central directory */
+ err = ziplocal_putValue(zi->filezip,(uLong)size_centraldir,4);
+
+ if (err==ZIP_OK) /* offset of start of central directory with respect to the
+ starting disk number */
+ err = ziplocal_putValue(zi->filezip,(uLong)centraldir_pos_inzip ,4);
+
+ if (err==ZIP_OK) /* zipfile comment length */
+ err = ziplocal_putValue(zi->filezip,(uLong)size_global_comment,2);
+
+ if ((err==ZIP_OK) && (size_global_comment>0))
+ if (fwrite(global_comment,(uInt)size_global_comment,1,zi->filezip) !=1 )
+ err = ZIP_ERRNO;
+ fclose(zi->filezip);
+ TRYFREE(zi);
+
+ return err;
+}
diff --git a/gnu/usr.bin/cvs/zlib/contrib/minizip/zip.def b/gnu/usr.bin/cvs/zlib/contrib/minizip/zip.def
new file mode 100644
index 00000000000..5d5079fbcee
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/contrib/minizip/zip.def
@@ -0,0 +1,5 @@
+ zipOpen @80
+ zipOpenNewFileInZip @81
+ zipWriteInFileInZip @82
+ zipCloseFileInZip @83
+ zipClose @84
diff --git a/gnu/usr.bin/cvs/zlib/contrib/minizip/zip.h b/gnu/usr.bin/cvs/zlib/contrib/minizip/zip.h
new file mode 100644
index 00000000000..678260b330b
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/contrib/minizip/zip.h
@@ -0,0 +1,150 @@
+/* zip.h -- IO for compress .zip files using zlib
+ Version 0.15 alpha, Mar 19th, 1998,
+
+ Copyright (C) 1998 Gilles Vollant
+
+ This unzip package allow creates .ZIP file, compatible with PKZip 2.04g
+ WinZip, InfoZip tools and compatible.
+ Encryption and multi volume ZipFile (span) are not supported.
+ Old compressions used by old PKZip 1.x are not supported
+
+ For uncompress .zip file, look at unzip.h
+
+ THIS IS AN ALPHA VERSION. AT THIS STAGE OF DEVELOPPEMENT, SOMES API OR STRUCTURE
+ CAN CHANGE IN FUTURE VERSION !!
+ I WAIT FEEDBACK at mail info@winimage.com
+ Visit also http://www.winimage.com/zLibDll/zip.htm for evolution
+
+ Condition of use and distribution are the same than zlib :
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+
+*/
+
+/* for more info about .ZIP format, see
+ ftp://ftp.cdrom.com/pub/infozip/doc/appnote-970311-iz.zip
+ PkWare has also a specification at :
+ ftp://ftp.pkware.com/probdesc.zip
+*/
+
+#ifndef _zip_H
+#define _zip_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _ZLIB_H
+#include "zlib.h"
+#endif
+
+#if defined(STRICTZIP) || defined(STRICTZIPUNZIP)
+/* like the STRICT of WIN32, we define a pointer that cannot be converted
+ from (void*) without cast */
+typedef struct TagzipFile__ { int unused; } zipFile__;
+typedef zipFile__ *zipFile;
+#else
+typedef voidp zipFile;
+#endif
+
+#define ZIP_OK (0)
+#define ZIP_ERRNO (Z_ERRNO)
+#define ZIP_PARAMERROR (-102)
+#define ZIP_INTERNALERROR (-104)
+
+/* tm_zip contain date/time info */
+typedef struct tm_zip_s
+{
+ uInt tm_sec; /* seconds after the minute - [0,59] */
+ uInt tm_min; /* minutes after the hour - [0,59] */
+ uInt tm_hour; /* hours since midnight - [0,23] */
+ uInt tm_mday; /* day of the month - [1,31] */
+ uInt tm_mon; /* months since January - [0,11] */
+ uInt tm_year; /* years - [1980..2044] */
+} tm_zip;
+
+typedef struct
+{
+ tm_zip tmz_date; /* date in understandable format */
+ uLong dosDate; /* if dos_date == 0, tmu_date is used */
+/* uLong flag; */ /* general purpose bit flag 2 bytes */
+
+ uLong internal_fa; /* internal file attributes 2 bytes */
+ uLong external_fa; /* external file attributes 4 bytes */
+} zip_fileinfo;
+
+extern zipFile ZEXPORT zipOpen OF((const char *pathname, int append));
+/*
+ Create a zipfile.
+ pathname contain on Windows NT a filename like "c:\\zlib\\zlib111.zip" or on
+ an Unix computer "zlib/zlib111.zip".
+ if the file pathname exist and append=1, the zip will be created at the end
+ of the file. (useful if the file contain a self extractor code)
+ If the zipfile cannot be opened, the return value is NULL.
+ Else, the return value is a zipFile Handle, usable with other function
+ of this zip package.
+
+
+*/
+
+extern int ZEXPORT zipOpenNewFileInZip OF((zipFile file,
+ const char* filename,
+ const zip_fileinfo* zipfi,
+ const void* extrafield_local,
+ uInt size_extrafield_local,
+ const void* extrafield_global,
+ uInt size_extrafield_global,
+ const char* comment,
+ int method,
+ int level));
+/*
+ Open a file in the ZIP for writing.
+ filename : the filename in zip (if NULL, '-' without quote will be used
+ *zipfi contain supplemental information
+ if extrafield_local!=NULL and size_extrafield_local>0, extrafield_local
+ contains the extrafield data the the local header
+ if extrafield_global!=NULL and size_extrafield_global>0, extrafield_global
+ contains the extrafield data the the local header
+ if comment != NULL, comment contain the comment string
+ method contain the compression method (0 for store, Z_DEFLATED for deflate)
+ level contain the level of compression (can be Z_DEFAULT_COMPRESSION)
+*/
+
+extern int ZEXPORT zipWriteInFileInZip OF((zipFile file,
+ const voidp buf,
+ unsigned len));
+/*
+ Write data in the zipfile
+*/
+
+extern int ZEXPORT zipCloseFileInZip OF((zipFile file));
+/*
+ Close the current file in the zipfile
+*/
+
+extern int ZEXPORT zipClose OF((zipFile file,
+ const char* global_comment));
+/*
+ Close the zipfile
+*/
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _zip_H */
diff --git a/gnu/usr.bin/cvs/zlib/contrib/minizip/zlibvc.def b/gnu/usr.bin/cvs/zlib/contrib/minizip/zlibvc.def
new file mode 100644
index 00000000000..7e9d60d55d9
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/contrib/minizip/zlibvc.def
@@ -0,0 +1,74 @@
+LIBRARY "zlib"
+
+DESCRIPTION '"""zlib data compression library"""'
+
+
+VERSION 1.11
+
+
+HEAPSIZE 1048576,8192
+
+EXPORTS
+ adler32 @1
+ compress @2
+ crc32 @3
+ deflate @4
+ deflateCopy @5
+ deflateEnd @6
+ deflateInit2_ @7
+ deflateInit_ @8
+ deflateParams @9
+ deflateReset @10
+ deflateSetDictionary @11
+ gzclose @12
+ gzdopen @13
+ gzerror @14
+ gzflush @15
+ gzopen @16
+ gzread @17
+ gzwrite @18
+ inflate @19
+ inflateEnd @20
+ inflateInit2_ @21
+ inflateInit_ @22
+ inflateReset @23
+ inflateSetDictionary @24
+ inflateSync @25
+ uncompress @26
+ zlibVersion @27
+ gzprintf @28
+ gzputc @29
+ gzgetc @30
+ gzseek @31
+ gzrewind @32
+ gztell @33
+ gzeof @34
+ gzsetparams @35
+ zError @36
+ inflateSyncPoint @37
+ get_crc_table @38
+ compress2 @39
+ gzputs @40
+ gzgets @41
+
+ unzOpen @61
+ unzClose @62
+ unzGetGlobalInfo @63
+ unzGetCurrentFileInfo @64
+ unzGoToFirstFile @65
+ unzGoToNextFile @66
+ unzOpenCurrentFile @67
+ unzReadCurrentFile @68
+ unztell @70
+ unzeof @71
+ unzCloseCurrentFile @72
+ unzGetGlobalComment @73
+ unzStringFileNameCompare @74
+ unzLocateFile @75
+ unzGetLocalExtrafield @76
+
+ zipOpen @80
+ zipOpenNewFileInZip @81
+ zipWriteInFileInZip @82
+ zipCloseFileInZip @83
+ zipClose @84
diff --git a/gnu/usr.bin/cvs/zlib/contrib/minizip/zlibvc.dsp b/gnu/usr.bin/cvs/zlib/contrib/minizip/zlibvc.dsp
new file mode 100644
index 00000000000..a70d4d4a6b0
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/contrib/minizip/zlibvc.dsp
@@ -0,0 +1,651 @@
+# Microsoft Developer Studio Project File - Name="zlibvc" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+# TARGTYPE "Win32 (ALPHA) Dynamic-Link Library" 0x0602
+
+CFG=zlibvc - Win32 Release
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "zlibvc.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "zlibvc.mak" CFG="zlibvc - Win32 Release"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "zlibvc - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "zlibvc - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "zlibvc - Win32 ReleaseAxp" (based on\
+ "Win32 (ALPHA) Dynamic-Link Library")
+!MESSAGE "zlibvc - Win32 ReleaseWithoutAsm" (based on\
+ "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "zlibvc - Win32 ReleaseWithoutCrtdll" (based on\
+ "Win32 (x86) Dynamic-Link Library")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir ".\Release"
+# PROP BASE Intermediate_Dir ".\Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir ".\Release"
+# PROP Intermediate_Dir ".\Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+CPP=cl.exe
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /D "ASMV" /FAcs /FR /FD /c
+# SUBTRACT CPP /YX
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+RSC=rc.exe
+# ADD BASE RSC /l 0x40c /d "NDEBUG"
+# ADD RSC /l 0x40c /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
+# ADD LINK32 gvmat32.obj kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib crtdll.lib /nologo /subsystem:windows /dll /map /machine:I386 /nodefaultlib /out:".\Release\zlib.dll"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir ".\Debug"
+# PROP BASE Intermediate_Dir ".\Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir ".\Debug"
+# PROP Intermediate_Dir ".\Debug"
+# PROP Target_Dir ""
+CPP=cl.exe
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /FD /c
+# SUBTRACT CPP /YX
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "_DEBUG" /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+RSC=rc.exe
+# ADD BASE RSC /l 0x40c /d "_DEBUG"
+# ADD RSC /l 0x40c /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:".\Debug\zlib.dll"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "zlibvc__"
+# PROP BASE Intermediate_Dir "zlibvc__"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "zlibvc__"
+# PROP Intermediate_Dir "zlibvc__"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+CPP=cl.exe
+# ADD BASE CPP /nologo /MT /Gt0 /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /FAcs /FR /YX /FD /c
+# ADD CPP /nologo /MT /Gt0 /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /FAcs /FR /FD /c
+# SUBTRACT CPP /YX
+RSC=rc.exe
+# ADD BASE RSC /l 0x40c /d "NDEBUG"
+# ADD RSC /l 0x40c /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 crtdll.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /map /machine:ALPHA /nodefaultlib /out:".\Release\zlib.dll"
+# SUBTRACT BASE LINK32 /pdb:none
+# ADD LINK32 crtdll.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /map /machine:ALPHA /nodefaultlib /out:"zlibvc__\zlib.dll"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "zlibvc_0"
+# PROP BASE Intermediate_Dir "zlibvc_0"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "zlibvc_0"
+# PROP Intermediate_Dir "zlibvc_0"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+CPP=cl.exe
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /FAcs /FR /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /FAcs /FR /FD /c
+# SUBTRACT CPP /YX
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+RSC=rc.exe
+# ADD BASE RSC /l 0x40c /d "NDEBUG"
+# ADD RSC /l 0x40c /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib crtdll.lib /nologo /subsystem:windows /dll /map /machine:I386 /nodefaultlib /out:".\Release\zlib.dll"
+# SUBTRACT BASE LINK32 /pdb:none
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib crtdll.lib /nologo /subsystem:windows /dll /map /machine:I386 /nodefaultlib /out:".\zlibvc_0\zlib.dll"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "zlibvc_1"
+# PROP BASE Intermediate_Dir "zlibvc_1"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "zlibvc_1"
+# PROP Intermediate_Dir "zlibvc_1"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+CPP=cl.exe
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /D "ASMV" /FAcs /FR /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /D "ASMV" /FAcs /FR /FD /c
+# SUBTRACT CPP /YX
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+RSC=rc.exe
+# ADD BASE RSC /l 0x40c /d "NDEBUG"
+# ADD RSC /l 0x40c /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 gvmat32.obj kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib crtdll.lib /nologo /subsystem:windows /dll /map /machine:I386 /nodefaultlib /out:".\Release\zlib.dll"
+# SUBTRACT BASE LINK32 /pdb:none
+# ADD LINK32 gvmat32.obj kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib crtdll.lib /nologo /subsystem:windows /dll /map /machine:I386 /nodefaultlib /out:".\zlibvc_1\zlib.dll"
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF
+
+# Begin Target
+
+# Name "zlibvc - Win32 Release"
+# Name "zlibvc - Win32 Debug"
+# Name "zlibvc - Win32 ReleaseAxp"
+# Name "zlibvc - Win32 ReleaseWithoutAsm"
+# Name "zlibvc - Win32 ReleaseWithoutCrtdll"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90"
+# Begin Source File
+
+SOURCE=.\adler32.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_ADLER=\
+ ".\zconf.h"\
+ ".\zlib.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\compress.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_COMPR=\
+ ".\zconf.h"\
+ ".\zlib.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\crc32.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_CRC32=\
+ ".\zconf.h"\
+ ".\zlib.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\deflate.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_DEFLA=\
+ ".\deflate.h"\
+ ".\zconf.h"\
+ ".\zlib.h"\
+ ".\zutil.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\gvmat32c.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\gzio.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_GZIO_=\
+ ".\zconf.h"\
+ ".\zlib.h"\
+ ".\zutil.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\infblock.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_INFBL=\
+ ".\infblock.h"\
+ ".\infcodes.h"\
+ ".\inftrees.h"\
+ ".\infutil.h"\
+ ".\zconf.h"\
+ ".\zlib.h"\
+ ".\zutil.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\infcodes.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_INFCO=\
+ ".\infblock.h"\
+ ".\infcodes.h"\
+ ".\inffast.h"\
+ ".\inftrees.h"\
+ ".\infutil.h"\
+ ".\zconf.h"\
+ ".\zlib.h"\
+ ".\zutil.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\inffast.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_INFFA=\
+ ".\infblock.h"\
+ ".\infcodes.h"\
+ ".\inffast.h"\
+ ".\inftrees.h"\
+ ".\infutil.h"\
+ ".\zconf.h"\
+ ".\zlib.h"\
+ ".\zutil.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\inflate.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_INFLA=\
+ ".\infblock.h"\
+ ".\zconf.h"\
+ ".\zlib.h"\
+ ".\zutil.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\inftrees.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_INFTR=\
+ ".\inftrees.h"\
+ ".\zconf.h"\
+ ".\zlib.h"\
+ ".\zutil.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\infutil.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_INFUT=\
+ ".\infblock.h"\
+ ".\infcodes.h"\
+ ".\inftrees.h"\
+ ".\infutil.h"\
+ ".\zconf.h"\
+ ".\zlib.h"\
+ ".\zutil.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\trees.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_TREES=\
+ ".\deflate.h"\
+ ".\zconf.h"\
+ ".\zlib.h"\
+ ".\zutil.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\uncompr.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_UNCOM=\
+ ".\zconf.h"\
+ ".\zlib.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\unzip.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\zip.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\zlib.rc
+# End Source File
+# Begin Source File
+
+SOURCE=.\zlibvc.def
+# End Source File
+# Begin Source File
+
+SOURCE=.\zutil.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_ZUTIL=\
+ ".\zconf.h"\
+ ".\zlib.h"\
+ ".\zutil.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd"
+# Begin Source File
+
+SOURCE=.\deflate.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\infblock.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\infcodes.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inffast.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inftrees.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\infutil.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\zconf.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\zlib.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\zutil.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/gnu/usr.bin/cvs/zlib/contrib/minizip/zlibvc.dsw b/gnu/usr.bin/cvs/zlib/contrib/minizip/zlibvc.dsw
new file mode 100644
index 00000000000..493cd870365
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/contrib/minizip/zlibvc.dsw
@@ -0,0 +1,41 @@
+Microsoft Developer Studio Workspace File, Format Version 5.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "zlibstat"=.\zlibstat.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "zlibvc"=.\zlibvc.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/gnu/usr.bin/cvs/zlib/contrib/untgz/Makefile b/gnu/usr.bin/cvs/zlib/contrib/untgz/Makefile
new file mode 100644
index 00000000000..409b4bdeaae
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/contrib/untgz/Makefile
@@ -0,0 +1,14 @@
+CC=cc
+CFLAGS=-g
+
+untgz: untgz.o ../../libz.a
+ $(CC) $(CFLAGS) -o untgz untgz.o -L../.. -lz
+
+untgz.o: untgz.c ../../zlib.h
+ $(CC) $(CFLAGS) -c -I../.. untgz.c
+
+../../libz.a:
+ cd ../..; make
+
+clean:
+ rm -f untgz untgz.o *~
diff --git a/gnu/usr.bin/cvs/zlib/contrib/untgz/makefile.w32 b/gnu/usr.bin/cvs/zlib/contrib/untgz/makefile.w32
new file mode 100644
index 00000000000..c99dc28cf55
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/contrib/untgz/makefile.w32
@@ -0,0 +1,63 @@
+# Makefile for zlib. Modified for mingw32
+# For conditions of distribution and use, see copyright notice in zlib.h
+
+# To compile,
+#
+# make -fmakefile.w32
+#
+
+CC=gcc
+
+# Generate dependencies (see end of the file)
+
+CPPFLAGS=-MMD
+
+#CFLAGS=-MMD -O
+#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
+#CFLAGS=-MMD -g -DDEBUG
+CFLAGS=-O3 $(BUTT) -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
+ -Wstrict-prototypes -Wmissing-prototypes
+
+# If cp.exe is not found, replace with copy /Y .
+CP=cp -f
+
+# The default value of RM is "rm -f."
+# If "rm.exe" is not found, uncomment:
+# RM=del
+
+LD=gcc
+LDLIBS=-L. -lz
+LDFLAGS=-s
+
+
+INCL=zlib.h zconf.h
+LIBS=libz.a
+
+AR=ar rcs
+
+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
+
+TEST_OBJS = minigzip.o untgz.o
+
+all: minigzip.exe untgz.exe
+
+rebuild: clean all
+
+libz.a: $(OBJS)
+ $(AR) $@ $(OBJS)
+
+%.exe : %.o $(LIBS)
+ $(LD) $(LDFLAGS) -o $@ $< $(LDLIBS)
+
+.PHONY : clean
+
+clean:
+ $(RM) *.d *.o *.exe libz.a foo.gz
+
+DEPS := $(wildcard *.d)
+ifneq ($(DEPS),)
+include $(DEPS)
+endif
+
diff --git a/gnu/usr.bin/cvs/zlib/contrib/untgz/untgz.c b/gnu/usr.bin/cvs/zlib/contrib/untgz/untgz.c
new file mode 100644
index 00000000000..4a431ff3163
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/contrib/untgz/untgz.c
@@ -0,0 +1,522 @@
+/*
+ * untgz.c -- Display contents and/or extract file from
+ * a gzip'd TAR file
+ * written by "Pedro A. Aranda Guti\irrez" <paag@tid.es>
+ * adaptation to Unix by Jean-loup Gailly <jloup@gzip.org>
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <errno.h>
+#include <fcntl.h>
+#ifdef unix
+# include <unistd.h>
+#else
+# include <direct.h>
+# include <io.h>
+#endif
+
+#include "zlib.h"
+
+#ifdef WIN32
+# ifndef F_OK
+# define F_OK (0)
+# endif
+# ifdef _MSC_VER
+# define mkdir(dirname,mode) _mkdir(dirname)
+# define strdup(str) _strdup(str)
+# define unlink(fn) _unlink(fn)
+# define access(path,mode) _access(path,mode)
+# else
+# define mkdir(dirname,mode) _mkdir(dirname)
+# endif
+#else
+# include <utime.h>
+#endif
+
+
+/* Values used in typeflag field. */
+
+#define REGTYPE '0' /* regular file */
+#define AREGTYPE '\0' /* regular file */
+#define LNKTYPE '1' /* link */
+#define SYMTYPE '2' /* reserved */
+#define CHRTYPE '3' /* character special */
+#define BLKTYPE '4' /* block special */
+#define DIRTYPE '5' /* directory */
+#define FIFOTYPE '6' /* FIFO special */
+#define CONTTYPE '7' /* reserved */
+
+#define BLOCKSIZE 512
+
+struct tar_header
+{ /* byte offset */
+ char name[100]; /* 0 */
+ char mode[8]; /* 100 */
+ char uid[8]; /* 108 */
+ char gid[8]; /* 116 */
+ char size[12]; /* 124 */
+ char mtime[12]; /* 136 */
+ char chksum[8]; /* 148 */
+ char typeflag; /* 156 */
+ char linkname[100]; /* 157 */
+ char magic[6]; /* 257 */
+ char version[2]; /* 263 */
+ char uname[32]; /* 265 */
+ char gname[32]; /* 297 */
+ char devmajor[8]; /* 329 */
+ char devminor[8]; /* 337 */
+ char prefix[155]; /* 345 */
+ /* 500 */
+};
+
+union tar_buffer {
+ char buffer[BLOCKSIZE];
+ struct tar_header header;
+};
+
+enum { TGZ_EXTRACT = 0, TGZ_LIST };
+
+static char *TGZfname OF((const char *));
+void TGZnotfound OF((const char *));
+
+int getoct OF((char *, int));
+char *strtime OF((time_t *));
+int ExprMatch OF((char *,char *));
+
+int makedir OF((char *));
+int matchname OF((int,int,char **,char *));
+
+void error OF((const char *));
+int tar OF((gzFile, int, int, int, char **));
+
+void help OF((int));
+int main OF((int, char **));
+
+char *prog;
+
+/* This will give a benign warning */
+
+static char *TGZprefix[] = { "\0", ".tgz", ".tar.gz", ".tar", NULL };
+
+/* Return the real name of the TGZ archive */
+/* or NULL if it does not exist. */
+
+static char *TGZfname OF((const char *fname))
+{
+ static char buffer[1024];
+ int origlen,i;
+
+ strcpy(buffer,fname);
+ origlen = strlen(buffer);
+
+ for (i=0; TGZprefix[i]; i++)
+ {
+ strcpy(buffer+origlen,TGZprefix[i]);
+ if (access(buffer,F_OK) == 0)
+ return buffer;
+ }
+ return NULL;
+}
+
+/* error message for the filename */
+
+void TGZnotfound OF((const char *fname))
+{
+ int i;
+
+ fprintf(stderr,"%s : couldn't find ",prog);
+ for (i=0;TGZprefix[i];i++)
+ fprintf(stderr,(TGZprefix[i+1]) ? "%s%s, " : "or %s%s\n",
+ fname,
+ TGZprefix[i]);
+ exit(1);
+}
+
+
+/* help functions */
+
+int getoct(char *p,int width)
+{
+ int result = 0;
+ char c;
+
+ while (width --)
+ {
+ c = *p++;
+ if (c == ' ')
+ continue;
+ if (c == 0)
+ break;
+ result = result * 8 + (c - '0');
+ }
+ return result;
+}
+
+char *strtime (time_t *t)
+{
+ struct tm *local;
+ static char result[32];
+
+ local = localtime(t);
+ sprintf(result,"%2d/%02d/%4d %02d:%02d:%02d",
+ local->tm_mday, local->tm_mon+1, local->tm_year+1900,
+ local->tm_hour, local->tm_min, local->tm_sec);
+ return result;
+}
+
+
+/* regular expression matching */
+
+#define ISSPECIAL(c) (((c) == '*') || ((c) == '/'))
+
+int ExprMatch(char *string,char *expr)
+{
+ while (1)
+ {
+ if (ISSPECIAL(*expr))
+ {
+ if (*expr == '/')
+ {
+ if (*string != '\\' && *string != '/')
+ return 0;
+ string ++; expr++;
+ }
+ else if (*expr == '*')
+ {
+ if (*expr ++ == 0)
+ return 1;
+ while (*++string != *expr)
+ if (*string == 0)
+ return 0;
+ }
+ }
+ else
+ {
+ if (*string != *expr)
+ return 0;
+ if (*expr++ == 0)
+ return 1;
+ string++;
+ }
+ }
+}
+
+/* recursive make directory */
+/* abort if you get an ENOENT errno somewhere in the middle */
+/* e.g. ignore error "mkdir on existing directory" */
+/* */
+/* return 1 if OK */
+/* 0 on error */
+
+int makedir (char *newdir)
+{
+ char *buffer = strdup(newdir);
+ char *p;
+ int len = strlen(buffer);
+
+ if (len <= 0) {
+ free(buffer);
+ return 0;
+ }
+ if (buffer[len-1] == '/') {
+ buffer[len-1] = '\0';
+ }
+ if (mkdir(buffer, 0775) == 0)
+ {
+ free(buffer);
+ return 1;
+ }
+
+ p = buffer+1;
+ while (1)
+ {
+ char hold;
+
+ while(*p && *p != '\\' && *p != '/')
+ p++;
+ hold = *p;
+ *p = 0;
+ if ((mkdir(buffer, 0775) == -1) && (errno == ENOENT))
+ {
+ fprintf(stderr,"%s: couldn't create directory %s\n",prog,buffer);
+ free(buffer);
+ return 0;
+ }
+ if (hold == 0)
+ break;
+ *p++ = hold;
+ }
+ free(buffer);
+ return 1;
+}
+
+int matchname (int arg,int argc,char **argv,char *fname)
+{
+ if (arg == argc) /* no arguments given (untgz tgzarchive) */
+ return 1;
+
+ while (arg < argc)
+ if (ExprMatch(fname,argv[arg++]))
+ return 1;
+
+ return 0; /* ignore this for the moment being */
+}
+
+
+/* Tar file list or extract */
+
+int tar (gzFile in,int action,int arg,int argc,char **argv)
+{
+ union tar_buffer buffer;
+ int len;
+ int err;
+ int getheader = 1;
+ int remaining = 0;
+ FILE *outfile = NULL;
+ char fname[BLOCKSIZE];
+ time_t tartime;
+
+ if (action == TGZ_LIST)
+ printf(" day time size file\n"
+ " ---------- -------- --------- -------------------------------------\n");
+ while (1)
+ {
+ len = gzread(in, &buffer, BLOCKSIZE);
+ if (len < 0)
+ error (gzerror(in, &err));
+ /*
+ * Always expect complete blocks to process
+ * the tar information.
+ */
+ if (len != BLOCKSIZE)
+ error("gzread: incomplete block read");
+
+ /*
+ * If we have to get a tar header
+ */
+ if (getheader == 1)
+ {
+ /*
+ * if we met the end of the tar
+ * or the end-of-tar block,
+ * we are done
+ */
+ if ((len == 0) || (buffer.header.name[0]== 0)) break;
+
+ tartime = (time_t)getoct(buffer.header.mtime,12);
+ strcpy(fname,buffer.header.name);
+
+ switch (buffer.header.typeflag)
+ {
+ case DIRTYPE:
+ if (action == TGZ_LIST)
+ printf(" %s <dir> %s\n",strtime(&tartime),fname);
+ if (action == TGZ_EXTRACT)
+ makedir(fname);
+ break;
+ case REGTYPE:
+ case AREGTYPE:
+ remaining = getoct(buffer.header.size,12);
+ if (action == TGZ_LIST)
+ printf(" %s %9d %s\n",strtime(&tartime),remaining,fname);
+ if (action == TGZ_EXTRACT)
+ {
+ if ((remaining) && (matchname(arg,argc,argv,fname)))
+ {
+ outfile = fopen(fname,"wb");
+ if (outfile == NULL) {
+ /* try creating directory */
+ char *p = strrchr(fname, '/');
+ if (p != NULL) {
+ *p = '\0';
+ makedir(fname);
+ *p = '/';
+ outfile = fopen(fname,"wb");
+ }
+ }
+ fprintf(stderr,
+ "%s %s\n",
+ (outfile) ? "Extracting" : "Couldn't create",
+ fname);
+ }
+ else
+ outfile = NULL;
+ }
+ /*
+ * could have no contents
+ */
+ getheader = (remaining) ? 0 : 1;
+ break;
+ default:
+ if (action == TGZ_LIST)
+ printf(" %s <---> %s\n",strtime(&tartime),fname);
+ break;
+ }
+ }
+ else
+ {
+ unsigned int bytes = (remaining > BLOCKSIZE) ? BLOCKSIZE : remaining;
+
+ if ((action == TGZ_EXTRACT) && (outfile != NULL))
+ {
+ if (fwrite(&buffer,sizeof(char),bytes,outfile) != bytes)
+ {
+ fprintf(stderr,"%s : error writing %s skipping...\n",prog,fname);
+ fclose(outfile);
+ unlink(fname);
+ }
+ }
+ remaining -= bytes;
+ if (remaining == 0)
+ {
+ getheader = 1;
+ if ((action == TGZ_EXTRACT) && (outfile != NULL))
+ {
+#ifdef WIN32
+ HANDLE hFile;
+ FILETIME ftm,ftLocal;
+ SYSTEMTIME st;
+ struct tm localt;
+
+ fclose(outfile);
+
+ localt = *localtime(&tartime);
+
+ hFile = CreateFile(fname, GENERIC_READ | GENERIC_WRITE,
+ 0, NULL, OPEN_EXISTING, 0, NULL);
+
+ st.wYear = (WORD)localt.tm_year+1900;
+ st.wMonth = (WORD)localt.tm_mon;
+ st.wDayOfWeek = (WORD)localt.tm_wday;
+ st.wDay = (WORD)localt.tm_mday;
+ st.wHour = (WORD)localt.tm_hour;
+ st.wMinute = (WORD)localt.tm_min;
+ st.wSecond = (WORD)localt.tm_sec;
+ st.wMilliseconds = 0;
+ SystemTimeToFileTime(&st,&ftLocal);
+ LocalFileTimeToFileTime(&ftLocal,&ftm);
+ SetFileTime(hFile,&ftm,NULL,&ftm);
+ CloseHandle(hFile);
+
+ outfile = NULL;
+#else
+ struct utimbuf settime;
+
+ settime.actime = settime.modtime = tartime;
+
+ fclose(outfile);
+ outfile = NULL;
+ utime(fname,&settime);
+#endif
+ }
+ }
+ }
+ }
+
+ if (gzclose(in) != Z_OK)
+ error("failed gzclose");
+
+ return 0;
+}
+
+
+/* =========================================================== */
+
+void help(int exitval)
+{
+ fprintf(stderr,
+ "untgz v 0.1\n"
+ " an sample application of zlib 1.0.4\n\n"
+ "Usage : untgz TGZfile to extract all files\n"
+ " untgz TGZfile fname ... to extract selected files\n"
+ " untgz -l TGZfile to list archive contents\n"
+ " untgz -h to display this help\n\n");
+ exit(exitval);
+}
+
+void error(const char *msg)
+{
+ fprintf(stderr, "%s: %s\n", prog, msg);
+ exit(1);
+}
+
+
+/* ====================================================================== */
+
+int _CRT_glob = 0; /* disable globbing of the arguments */
+
+int main(int argc,char **argv)
+{
+ int action = TGZ_EXTRACT;
+ int arg = 1;
+ char *TGZfile;
+ gzFile *f;
+
+
+ prog = strrchr(argv[0],'\\');
+ if (prog == NULL)
+ {
+ prog = strrchr(argv[0],'/');
+ if (prog == NULL)
+ {
+ prog = strrchr(argv[0],':');
+ if (prog == NULL)
+ prog = argv[0];
+ else
+ prog++;
+ }
+ else
+ prog++;
+ }
+ else
+ prog++;
+
+ if (argc == 1)
+ help(0);
+
+ if (strcmp(argv[arg],"-l") == 0)
+ {
+ action = TGZ_LIST;
+ if (argc == ++arg)
+ help(0);
+ }
+ else if (strcmp(argv[arg],"-h") == 0)
+ {
+ help(0);
+ }
+
+ if ((TGZfile = TGZfname(argv[arg])) == NULL)
+ TGZnotfound(argv[arg]);
+
+ ++arg;
+ if ((action == TGZ_LIST) && (arg != argc))
+ help(1);
+
+/*
+ * Process the TGZ file
+ */
+ switch(action)
+ {
+ case TGZ_LIST:
+ case TGZ_EXTRACT:
+ f = gzopen(TGZfile,"rb");
+ if (f == NULL)
+ {
+ fprintf(stderr,"%s: Couldn't gzopen %s\n",
+ prog,
+ TGZfile);
+ return 1;
+ }
+ exit(tar(f, action, arg, argc, argv));
+ break;
+
+ default:
+ error("Unknown option!");
+ exit(1);
+ }
+
+ return 0;
+}
diff --git a/gnu/usr.bin/cvs/zlib/contrib/visual-basic.txt b/gnu/usr.bin/cvs/zlib/contrib/visual-basic.txt
new file mode 100644
index 00000000000..10fb44bc593
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/contrib/visual-basic.txt
@@ -0,0 +1,69 @@
+See below some functions declarations for Visual Basic.
+
+Frequently Asked Question:
+
+Q: Each time I use the compress function I get the -5 error (not enough
+ room in the output buffer).
+
+A: Make sure that the length of the compressed buffer is passed by
+ reference ("as any"), not by value ("as long"). Also check that
+ before the call of compress this length is equal to the total size of
+ the compressed buffer and not zero.
+
+
+From: "Jon Caruana" <jon-net@usa.net>
+Subject: Re: How to port zlib declares to vb?
+Date: Mon, 28 Oct 1996 18:33:03 -0600
+
+Got the answer! (I haven't had time to check this but it's what I got, and
+looks correct):
+
+He has the following routines working:
+ compress
+ uncompress
+ gzopen
+ gzwrite
+ gzread
+ gzclose
+
+Declares follow: (Quoted from Carlos Rios <c_rios@sonda.cl>, in Vb4 form)
+
+#If Win16 Then 'Use Win16 calls.
+Declare Function compress Lib "ZLIB.DLL" (ByVal compr As
+ String, comprLen As Any, ByVal buf As String, ByVal buflen
+ As Long) As Integer
+Declare Function uncompress Lib "ZLIB.DLL" (ByVal uncompr
+ As String, uncomprLen As Any, ByVal compr As String, ByVal
+ lcompr As Long) As Integer
+Declare Function gzopen Lib "ZLIB.DLL" (ByVal filePath As
+ String, ByVal mode As String) As Long
+Declare Function gzread Lib "ZLIB.DLL" (ByVal file As
+ Long, ByVal uncompr As String, ByVal uncomprLen As Integer)
+ As Integer
+Declare Function gzwrite Lib "ZLIB.DLL" (ByVal file As
+ Long, ByVal uncompr As String, ByVal uncomprLen As Integer)
+ As Integer
+Declare Function gzclose Lib "ZLIB.DLL" (ByVal file As
+ Long) As Integer
+#Else
+Declare Function compress Lib "ZLIB32.DLL"
+ (ByVal compr As String, comprLen As Any, ByVal buf As
+ String, ByVal buflen As Long) As Integer
+Declare Function uncompress Lib "ZLIB32.DLL"
+ (ByVal uncompr As String, uncomprLen As Any, ByVal compr As
+ String, ByVal lcompr As Long) As Long
+Declare Function gzopen Lib "ZLIB32.DLL"
+ (ByVal file As String, ByVal mode As String) As Long
+Declare Function gzread Lib "ZLIB32.DLL"
+ (ByVal file As Long, ByVal uncompr As String, ByVal
+ uncomprLen As Long) As Long
+Declare Function gzwrite Lib "ZLIB32.DLL"
+ (ByVal file As Long, ByVal uncompr As String, ByVal
+ uncomprLen As Long) As Long
+Declare Function gzclose Lib "ZLIB32.DLL"
+ (ByVal file As Long) As Long
+#End If
+
+-Jon Caruana
+jon-net@usa.net
+Microsoft Sitebuilder Network Level 1 Member - HTML Writer's Guild Member
diff --git a/gnu/usr.bin/cvs/zlib/crc32.c b/gnu/usr.bin/cvs/zlib/crc32.c
index 57f40c7dd9b..45b5d9fb179 100644
--- a/gnu/usr.bin/cvs/zlib/crc32.c
+++ b/gnu/usr.bin/cvs/zlib/crc32.c
@@ -1,9 +1,9 @@
/* crc32.c -- compute the CRC-32 of a data stream
- * Copyright (C) 1995-1996 Mark Adler
+ * Copyright (C) 1995-1998 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
-/* $Id: crc32.c,v 1.1.1.1 1996/10/18 03:35:04 tholo Exp $ */
+/* @(#) $Id: crc32.c,v 1.1.1.2 2001/09/28 22:45:40 tholo Exp $ */
#include "zlib.h"
@@ -45,7 +45,7 @@ local void make_crc_table()
int n, k;
uLong poly; /* polynomial exclusive-or pattern */
/* terms of polynomial defining this crc (except x^32): */
- static Byte p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26};
+ static const Byte p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26};
/* make exclusive-or pattern from polynomial (0xedb88320L) */
poly = 0L;
@@ -65,7 +65,7 @@ local void make_crc_table()
/* ========================================================================
* Table of CRC-32's of all single-byte values (made by make_crc_table)
*/
-local uLongf crc_table[256] = {
+local const uLongf crc_table[256] = {
0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L,
0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L,
0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L,
@@ -124,12 +124,12 @@ local uLongf crc_table[256] = {
/* =========================================================================
* This function can be used by asm versions of crc32()
*/
-uLongf *get_crc_table()
+const uLongf * ZEXPORT get_crc_table()
{
#ifdef DYNAMIC_CRC_TABLE
if (crc_table_empty) make_crc_table();
#endif
- return (uLongf *)crc_table;
+ return (const uLongf *)crc_table;
}
/* ========================================================================= */
@@ -139,7 +139,7 @@ uLongf *get_crc_table()
#define DO8(buf) DO4(buf); DO4(buf);
/* ========================================================================= */
-uLong crc32(crc, buf, len)
+uLong ZEXPORT crc32(crc, buf, len)
uLong crc;
const Bytef *buf;
uInt len;
diff --git a/gnu/usr.bin/cvs/zlib/deflate.c b/gnu/usr.bin/cvs/zlib/deflate.c
index 4f19327ac0f..4d83e321b63 100644
--- a/gnu/usr.bin/cvs/zlib/deflate.c
+++ b/gnu/usr.bin/cvs/zlib/deflate.c
@@ -1,5 +1,5 @@
/* deflate.c -- compress data using the deflation algorithm
- * Copyright (C) 1995-1996 Jean-loup Gailly.
+ * Copyright (C) 1995-1998 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -36,8 +36,8 @@
*
* REFERENCES
*
- * Deutsch, L.P.,"'Deflate' Compressed Data Format Specification".
- * Available in ftp.uu.net:/pub/archiving/zip/doc/deflate-1.1.doc
+ * Deutsch, L.P.,"DEFLATE Compressed Data Format Specification".
+ * Available in ftp://ds.internic.net/rfc/rfc1951.txt
*
* A description of the Rabin and Karp algorithm is given in the book
* "Algorithms" by R. Sedgewick, Addison-Wesley, p252.
@@ -47,11 +47,12 @@
*
*/
-/* $Id: deflate.c,v 1.1.1.1 1996/10/18 03:35:04 tholo Exp $ */
+/* @(#) $Id: deflate.c,v 1.1.1.2 2001/09/28 22:45:40 tholo Exp $ */
#include "deflate.h"
-char deflate_copyright[] = " deflate 1.0.4 Copyright 1995-1996 Jean-loup Gailly ";
+const char deflate_copyright[] =
+ " deflate 1.1.3 Copyright 1995-1998 Jean-loup Gailly ";
/*
If you use the zlib library in a product, an acknowledgment is welcome
in the documentation of your product. If for some reason you cannot
@@ -77,12 +78,14 @@ local block_state deflate_stored OF((deflate_state *s, int flush));
local block_state deflate_fast OF((deflate_state *s, int flush));
local block_state deflate_slow OF((deflate_state *s, int flush));
local void lm_init OF((deflate_state *s));
-local uInt longest_match OF((deflate_state *s, IPos cur_match));
local void putShortMSB OF((deflate_state *s, uInt b));
local void flush_pending OF((z_streamp strm));
-local int read_buf OF((z_streamp strm, charf *buf, unsigned size));
+local int read_buf OF((z_streamp strm, Bytef *buf, unsigned size));
#ifdef ASMV
void match_init OF((void)); /* asm code initialization */
+ uInt longest_match OF((deflate_state *s, IPos cur_match));
+#else
+local uInt longest_match OF((deflate_state *s, IPos cur_match));
#endif
#ifdef DEBUG
@@ -120,7 +123,7 @@ typedef struct config_s {
compress_func func;
} config;
-local config configuration_table[10] = {
+local const config configuration_table[10] = {
/* good lazy nice chain */
/* 0 */ {0, 0, 0, 0, deflate_stored}, /* store only */
/* 1 */ {4, 4, 8, 4, deflate_fast}, /* maximum speed, no lazy matches */
@@ -157,14 +160,23 @@ struct static_tree_desc_s {int dummy;}; /* for buggy compilers */
* Insert string str in the dictionary and set match_head to the previous head
* of the hash chain (the most recent string with same hash key). Return
* the previous length of the hash chain.
+ * If this file is compiled with -DFASTEST, the compression level is forced
+ * to 1, and no hash chains are maintained.
* IN assertion: all calls to to INSERT_STRING are made with consecutive
* input characters and the first MIN_MATCH bytes of str are valid
* (except for the last MIN_MATCH-1 bytes of the input file).
*/
+#ifdef FASTEST
+#define INSERT_STRING(s, str, match_head) \
+ (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \
+ match_head = s->head[s->ins_h], \
+ s->head[s->ins_h] = (Pos)(str))
+#else
#define INSERT_STRING(s, str, match_head) \
(UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \
s->prev[(str) & s->w_mask] = match_head = s->head[s->ins_h], \
s->head[s->ins_h] = (Pos)(str))
+#endif
/* ===========================================================================
* Initialize the hash table (avoiding 64K overflow for 16 bit systems).
@@ -172,10 +184,10 @@ struct static_tree_desc_s {int dummy;}; /* for buggy compilers */
*/
#define CLEAR_HASH(s) \
s->head[s->hash_size-1] = NIL; \
- zmemzero((charf *)s->head, (unsigned)(s->hash_size-1)*sizeof(*s->head));
+ zmemzero((Bytef *)s->head, (unsigned)(s->hash_size-1)*sizeof(*s->head));
/* ========================================================================= */
-int deflateInit_(strm, level, version, stream_size)
+int ZEXPORT deflateInit_(strm, level, version, stream_size)
z_streamp strm;
int level;
const char *version;
@@ -187,7 +199,7 @@ int deflateInit_(strm, level, version, stream_size)
}
/* ========================================================================= */
-int deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
+int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
version, stream_size)
z_streamp strm;
int level;
@@ -200,13 +212,14 @@ int deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
{
deflate_state *s;
int noheader = 0;
+ static const char* my_version = ZLIB_VERSION;
ushf *overlay;
/* We overlay pending_buf and d_buf+l_buf. This works since the average
* output size for (length,distance) codes is <= 24 bits.
*/
- if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
+ if (version == Z_NULL || version[0] != my_version[0] ||
stream_size != sizeof(z_stream)) {
return Z_VERSION_ERROR;
}
@@ -220,6 +233,9 @@ int deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
if (strm->zfree == Z_NULL) strm->zfree = zcfree;
if (level == Z_DEFAULT_COMPRESSION) level = 6;
+#ifdef FASTEST
+ level = 1;
+#endif
if (windowBits < 0) { /* undocumented feature: suppress zlib header */
noheader = 1;
@@ -253,6 +269,7 @@ int deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);
s->pending_buf = (uchf *) overlay;
+ s->pending_buf_size = (ulg)s->lit_bufsize * (sizeof(ush)+2L);
if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL ||
s->pending_buf == Z_NULL) {
@@ -271,7 +288,7 @@ int deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
}
/* ========================================================================= */
-int deflateSetDictionary (strm, dictionary, dictLength)
+int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength)
z_streamp strm;
const Bytef *dictionary;
uInt dictLength;
@@ -290,9 +307,11 @@ int deflateSetDictionary (strm, dictionary, dictLength)
if (length < MIN_MATCH) return Z_OK;
if (length > MAX_DIST(s)) {
length = MAX_DIST(s);
- dictionary += dictLength - length;
+#ifndef USE_DICT_HEAD
+ dictionary += dictLength - length; /* use the tail of the dictionary */
+#endif
}
- zmemcpy((charf *)s->window, dictionary, length);
+ zmemcpy(s->window, dictionary, length);
s->strstart = length;
s->block_start = (long)length;
@@ -310,7 +329,7 @@ int deflateSetDictionary (strm, dictionary, dictLength)
}
/* ========================================================================= */
-int deflateReset (strm)
+int ZEXPORT deflateReset (strm)
z_streamp strm;
{
deflate_state *s;
@@ -340,7 +359,7 @@ int deflateReset (strm)
}
/* ========================================================================= */
-int deflateParams(strm, level, strategy)
+int ZEXPORT deflateParams(strm, level, strategy)
z_streamp strm;
int level;
int strategy;
@@ -414,7 +433,7 @@ local void flush_pending(strm)
}
/* ========================================================================= */
-int deflate (strm, flush)
+int ZEXPORT deflate (strm, flush)
z_streamp strm;
int flush;
{
@@ -548,42 +567,87 @@ int deflate (strm, flush)
}
/* ========================================================================= */
-int deflateEnd (strm)
+int ZEXPORT deflateEnd (strm)
z_streamp strm;
{
int status;
if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+ status = strm->state->status;
+ if (status != INIT_STATE && status != BUSY_STATE &&
+ status != FINISH_STATE) {
+ return Z_STREAM_ERROR;
+ }
+
/* Deallocate in reverse order of allocations: */
TRY_FREE(strm, strm->state->pending_buf);
TRY_FREE(strm, strm->state->head);
TRY_FREE(strm, strm->state->prev);
TRY_FREE(strm, strm->state->window);
- status = strm->state->status;
ZFREE(strm, strm->state);
strm->state = Z_NULL;
return status == BUSY_STATE ? Z_DATA_ERROR : Z_OK;
}
-/* ========================================================================= */
-int deflateCopy (dest, source)
+/* =========================================================================
+ * Copy the source state to the destination state.
+ * To simplify the source, this is not supported for 16-bit MSDOS (which
+ * doesn't have enough memory anyway to duplicate compression states).
+ */
+int ZEXPORT deflateCopy (dest, source)
z_streamp dest;
z_streamp source;
{
+#ifdef MAXSEG_64K
+ return Z_STREAM_ERROR;
+#else
+ deflate_state *ds;
+ deflate_state *ss;
+ ushf *overlay;
+
+
if (source == Z_NULL || dest == Z_NULL || source->state == Z_NULL) {
return Z_STREAM_ERROR;
}
+
+ ss = source->state;
+
*dest = *source;
- return Z_STREAM_ERROR; /* to be implemented */
-#if 0
- dest->state = (struct internal_state FAR *)
- (*dest->zalloc)(1, sizeof(deflate_state));
- if (dest->state == Z_NULL) return Z_MEM_ERROR;
- *(dest->state) = *(source->state);
+ ds = (deflate_state *) ZALLOC(dest, 1, sizeof(deflate_state));
+ if (ds == Z_NULL) return Z_MEM_ERROR;
+ dest->state = (struct internal_state FAR *) ds;
+ *ds = *ss;
+ ds->strm = dest;
+
+ ds->window = (Bytef *) ZALLOC(dest, ds->w_size, 2*sizeof(Byte));
+ ds->prev = (Posf *) ZALLOC(dest, ds->w_size, sizeof(Pos));
+ ds->head = (Posf *) ZALLOC(dest, ds->hash_size, sizeof(Pos));
+ overlay = (ushf *) ZALLOC(dest, ds->lit_bufsize, sizeof(ush)+2);
+ ds->pending_buf = (uchf *) overlay;
+
+ if (ds->window == Z_NULL || ds->prev == Z_NULL || ds->head == Z_NULL ||
+ ds->pending_buf == Z_NULL) {
+ deflateEnd (dest);
+ return Z_MEM_ERROR;
+ }
+ /* following zmemcpy do not work for 16-bit MSDOS */
+ zmemcpy(ds->window, ss->window, ds->w_size * 2 * sizeof(Byte));
+ zmemcpy(ds->prev, ss->prev, ds->w_size * sizeof(Pos));
+ zmemcpy(ds->head, ss->head, ds->hash_size * sizeof(Pos));
+ zmemcpy(ds->pending_buf, ss->pending_buf, (uInt)ds->pending_buf_size);
+
+ ds->pending_out = ds->pending_buf + (ss->pending_out - ss->pending_buf);
+ ds->d_buf = overlay + ds->lit_bufsize/sizeof(ush);
+ ds->l_buf = ds->pending_buf + (1+sizeof(ush))*ds->lit_bufsize;
+
+ ds->l_desc.dyn_tree = ds->dyn_ltree;
+ ds->d_desc.dyn_tree = ds->dyn_dtree;
+ ds->bl_desc.dyn_tree = ds->bl_tree;
+
return Z_OK;
#endif
}
@@ -597,7 +661,7 @@ int deflateCopy (dest, source)
*/
local int read_buf(strm, buf, size)
z_streamp strm;
- charf *buf;
+ Bytef *buf;
unsigned size;
{
unsigned len = strm->avail_in;
@@ -658,6 +722,7 @@ local void lm_init (s)
/* For 80x86 and 680x0, an optimized version will be provided in match.asm or
* match.S. The code will be functionally equivalent.
*/
+#ifndef FASTEST
local uInt longest_match(s, cur_match)
deflate_state *s;
IPos cur_match; /* current match */
@@ -792,9 +857,67 @@ local uInt longest_match(s, cur_match)
} while ((cur_match = prev[cur_match & wmask]) > limit
&& --chain_length != 0);
- if ((uInt)best_len <= s->lookahead) return best_len;
+ if ((uInt)best_len <= s->lookahead) return (uInt)best_len;
return s->lookahead;
}
+
+#else /* FASTEST */
+/* ---------------------------------------------------------------------------
+ * Optimized version for level == 1 only
+ */
+local uInt longest_match(s, cur_match)
+ deflate_state *s;
+ IPos cur_match; /* current match */
+{
+ register Bytef *scan = s->window + s->strstart; /* current string */
+ register Bytef *match; /* matched string */
+ register int len; /* length of current match */
+ register Bytef *strend = s->window + s->strstart + MAX_MATCH;
+
+ /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
+ * It is easy to get rid of this optimization if necessary.
+ */
+ Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
+
+ Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
+
+ Assert(cur_match < s->strstart, "no future");
+
+ match = s->window + cur_match;
+
+ /* Return failure if the match length is less than 2:
+ */
+ if (match[0] != scan[0] || match[1] != scan[1]) return MIN_MATCH-1;
+
+ /* The check at best_len-1 can be removed because it will be made
+ * again later. (This heuristic is not always a win.)
+ * It is not necessary to compare scan[2] and match[2] since they
+ * are always equal when the other bytes match, given that
+ * the hash keys are equal and that HASH_BITS >= 8.
+ */
+ scan += 2, match += 2;
+ Assert(*scan == *match, "match[2]?");
+
+ /* We check for insufficient lookahead only every 8th comparison;
+ * the 256th check will be made at strstart+258.
+ */
+ do {
+ } while (*++scan == *++match && *++scan == *++match &&
+ *++scan == *++match && *++scan == *++match &&
+ *++scan == *++match && *++scan == *++match &&
+ *++scan == *++match && *++scan == *++match &&
+ scan < strend);
+
+ Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
+
+ len = MAX_MATCH - (int)(strend - scan);
+
+ if (len < MIN_MATCH) return MIN_MATCH - 1;
+
+ s->match_start = cur_match;
+ return len <= s->lookahead ? len : s->lookahead;
+}
+#endif /* FASTEST */
#endif /* ASMV */
#ifdef DEBUG
@@ -807,8 +930,8 @@ local void check_match(s, start, match, length)
int length;
{
/* check that the match is indeed a match */
- if (zmemcmp((charf *)s->window + match,
- (charf *)s->window + start, length) != EQUAL) {
+ if (zmemcmp(s->window + match,
+ s->window + start, length) != EQUAL) {
fprintf(stderr, " start %u, match %u, length %d\n",
start, match, length);
do {
@@ -816,7 +939,7 @@ local void check_match(s, start, match, length)
} while (--length != 0);
z_error("invalid match");
}
- if (verbose > 1) {
+ if (z_verbose > 1) {
fprintf(stderr,"\\[%d,%d]", start-match, length);
do { putc(s->window[start++], stderr); } while (--length != 0);
}
@@ -861,33 +984,35 @@ local void fill_window(s)
*/
} else if (s->strstart >= wsize+MAX_DIST(s)) {
- zmemcpy((charf *)s->window, (charf *)s->window+wsize,
- (unsigned)wsize);
+ zmemcpy(s->window, s->window+wsize, (unsigned)wsize);
s->match_start -= wsize;
s->strstart -= wsize; /* we now have strstart >= MAX_DIST */
-
s->block_start -= (long) wsize;
/* Slide the hash table (could be avoided with 32 bit values
- at the expense of memory usage):
+ at the expense of memory usage). We slide even when level == 0
+ to keep the hash table consistent if we switch back to level > 0
+ later. (Using level 0 permanently is not an optimal usage of
+ zlib, so we don't care about this pathological case.)
*/
- n = s->hash_size;
- p = &s->head[n];
- do {
- m = *--p;
- *p = (Pos)(m >= wsize ? m-wsize : NIL);
- } while (--n);
-
- n = wsize;
- p = &s->prev[n];
- do {
- m = *--p;
- *p = (Pos)(m >= wsize ? m-wsize : NIL);
- /* If n is not on any hash chain, prev[n] is garbage but
- * its value will never be used.
- */
- } while (--n);
-
+ n = s->hash_size;
+ p = &s->head[n];
+ do {
+ m = *--p;
+ *p = (Pos)(m >= wsize ? m-wsize : NIL);
+ } while (--n);
+
+ n = wsize;
+#ifndef FASTEST
+ p = &s->prev[n];
+ do {
+ m = *--p;
+ *p = (Pos)(m >= wsize ? m-wsize : NIL);
+ /* If n is not on any hash chain, prev[n] is garbage but
+ * its value will never be used.
+ */
+ } while (--n);
+#endif
more += wsize;
}
if (s->strm->avail_in == 0) return;
@@ -905,8 +1030,7 @@ local void fill_window(s)
*/
Assert(more >= 2, "more < 2");
- n = read_buf(s->strm, (charf *)s->window + s->strstart + s->lookahead,
- more);
+ n = read_buf(s->strm, s->window + s->strstart + s->lookahead, more);
s->lookahead += n;
/* Initialize the hash value now that we have some input: */
@@ -951,12 +1075,24 @@ local void fill_window(s)
* This function does not insert new strings in the dictionary since
* uncompressible data is probably not useful. This function is used
* only for the level=0 compression option.
- * NOTE: this function should be optimized to avoid extra copying.
+ * NOTE: this function should be optimized to avoid extra copying from
+ * window to pending_buf.
*/
local block_state deflate_stored(s, flush)
deflate_state *s;
int flush;
{
+ /* Stored blocks are limited to 0xffff bytes, pending_buf is limited
+ * to pending_buf_size, and each stored block has a 5 byte header:
+ */
+ ulg max_block_size = 0xffff;
+ ulg max_start;
+
+ if (max_block_size > s->pending_buf_size - 5) {
+ max_block_size = s->pending_buf_size - 5;
+ }
+
+ /* Copy as much as possible from input to output: */
for (;;) {
/* Fill the window as much as possible: */
if (s->lookahead <= 1) {
@@ -974,14 +1110,17 @@ local block_state deflate_stored(s, flush)
s->strstart += s->lookahead;
s->lookahead = 0;
- /* Stored blocks are limited to 0xffff bytes: */
- if (s->strstart == 0 || s->strstart > 0xfffe) {
+ /* Emit a stored block if pending_buf will be full: */
+ max_start = s->block_start + max_block_size;
+ if (s->strstart == 0 || (ulg)s->strstart >= max_start) {
/* strstart == 0 is possible when wraparound on 16-bit machine */
- s->lookahead = s->strstart - 0xffff;
- s->strstart = 0xffff;
+ s->lookahead = (uInt)(s->strstart - max_start);
+ s->strstart = (uInt)max_start;
+ FLUSH_BLOCK(s, 0);
}
-
- /* Emit a stored block if it is large enough: */
+ /* Flush if we may have to slide, otherwise block_start may become
+ * negative and the data will be gone:
+ */
if (s->strstart - (uInt)s->block_start >= MAX_DIST(s)) {
FLUSH_BLOCK(s, 0);
}
@@ -1041,14 +1180,15 @@ local block_state deflate_fast(s, flush)
if (s->match_length >= MIN_MATCH) {
check_match(s, s->strstart, s->match_start, s->match_length);
- bflush = _tr_tally(s, s->strstart - s->match_start,
- s->match_length - MIN_MATCH);
+ _tr_tally_dist(s, s->strstart - s->match_start,
+ s->match_length - MIN_MATCH, bflush);
s->lookahead -= s->match_length;
/* Insert new strings in the hash table only if the match length
* is not too large. This saves time but degrades compression.
*/
+#ifndef FASTEST
if (s->match_length <= s->max_insert_length &&
s->lookahead >= MIN_MATCH) {
s->match_length--; /* string at strstart already in hash table */
@@ -1060,7 +1200,9 @@ local block_state deflate_fast(s, flush)
*/
} while (--s->match_length != 0);
s->strstart++;
- } else {
+ } else
+#endif
+ {
s->strstart += s->match_length;
s->match_length = 0;
s->ins_h = s->window[s->strstart];
@@ -1075,7 +1217,7 @@ local block_state deflate_fast(s, flush)
} else {
/* No match, output a literal byte */
Tracevv((stderr,"%c", s->window[s->strstart]));
- bflush = _tr_tally (s, 0, s->window[s->strstart]);
+ _tr_tally_lit (s, s->window[s->strstart], bflush);
s->lookahead--;
s->strstart++;
}
@@ -1154,8 +1296,8 @@ local block_state deflate_slow(s, flush)
check_match(s, s->strstart-1, s->prev_match, s->prev_length);
- bflush = _tr_tally(s, s->strstart -1 - s->prev_match,
- s->prev_length - MIN_MATCH);
+ _tr_tally_dist(s, s->strstart -1 - s->prev_match,
+ s->prev_length - MIN_MATCH, bflush);
/* Insert in hash table all strings up to the end of the match.
* strstart-1 and strstart are already inserted. If there is not
@@ -1181,7 +1323,8 @@ local block_state deflate_slow(s, flush)
* is longer, truncate the previous match to a single literal.
*/
Tracevv((stderr,"%c", s->window[s->strstart-1]));
- if (_tr_tally (s, 0, s->window[s->strstart-1])) {
+ _tr_tally_lit(s, s->window[s->strstart-1], bflush);
+ if (bflush) {
FLUSH_BLOCK_ONLY(s, 0);
}
s->strstart++;
@@ -1199,7 +1342,7 @@ local block_state deflate_slow(s, flush)
Assert (flush != Z_NO_FLUSH, "no flush?");
if (s->match_available) {
Tracevv((stderr,"%c", s->window[s->strstart-1]));
- _tr_tally (s, 0, s->window[s->strstart-1]);
+ _tr_tally_lit(s, s->window[s->strstart-1], bflush);
s->match_available = 0;
}
FLUSH_BLOCK(s, flush == Z_FINISH);
diff --git a/gnu/usr.bin/cvs/zlib/deflate.h b/gnu/usr.bin/cvs/zlib/deflate.h
index 9aed780d1d4..ce7754a64e3 100644
--- a/gnu/usr.bin/cvs/zlib/deflate.h
+++ b/gnu/usr.bin/cvs/zlib/deflate.h
@@ -1,5 +1,5 @@
/* deflate.h -- internal compression state
- * Copyright (C) 1995-1996 Jean-loup Gailly
+ * Copyright (C) 1995-1998 Jean-loup Gailly
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -8,7 +8,7 @@
subject to change. Applications should only use zlib.h.
*/
-/* $Id: deflate.h,v 1.1.1.1 1996/10/18 03:35:04 tholo Exp $ */
+/* @(#) $Id: deflate.h,v 1.1.1.2 2001/09/28 22:45:40 tholo Exp $ */
#ifndef _DEFLATE_H
#define _DEFLATE_H
@@ -83,6 +83,7 @@ typedef struct internal_state {
z_streamp strm; /* pointer back to this zlib stream */
int status; /* as the name implies */
Bytef *pending_buf; /* output still pending */
+ ulg pending_buf_size; /* size of pending_buf */
Bytef *pending_out; /* next pending byte to output to the stream */
int pending; /* nb of bytes in the pending buffer */
int noheader; /* suppress zlib header and adler32 */
@@ -229,12 +230,12 @@ typedef struct internal_state {
ulg opt_len; /* bit length of current block with optimal trees */
ulg static_len; /* bit length of current block with static trees */
- ulg compressed_len; /* total bit length of compressed file */
uInt matches; /* number of string matches in current block */
int last_eob_len; /* bit length of EOB code for last block */
#ifdef DEBUG
- ulg bits_sent; /* bit length of the compressed data */
+ ulg compressed_len; /* total bit length of compressed file mod 2^32 */
+ ulg bits_sent; /* bit length of compressed data sent mod 2^32 */
#endif
ush bi_buf;
@@ -267,9 +268,51 @@ typedef struct internal_state {
/* in trees.c */
void _tr_init OF((deflate_state *s));
int _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc));
-ulg _tr_flush_block OF((deflate_state *s, charf *buf, ulg stored_len,
+void _tr_flush_block OF((deflate_state *s, charf *buf, ulg stored_len,
int eof));
void _tr_align OF((deflate_state *s));
void _tr_stored_block OF((deflate_state *s, charf *buf, ulg stored_len,
int eof));
+
+#define d_code(dist) \
+ ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])
+/* Mapping from a distance to a distance code. dist is the distance - 1 and
+ * must not have side effects. _dist_code[256] and _dist_code[257] are never
+ * used.
+ */
+
+#ifndef DEBUG
+/* Inline versions of _tr_tally for speed: */
+
+#if defined(GEN_TREES_H) || !defined(STDC)
+ extern uch _length_code[];
+ extern uch _dist_code[];
+#else
+ extern const uch _length_code[];
+ extern const uch _dist_code[];
+#endif
+
+# define _tr_tally_lit(s, c, flush) \
+ { uch cc = (c); \
+ s->d_buf[s->last_lit] = 0; \
+ s->l_buf[s->last_lit++] = cc; \
+ s->dyn_ltree[cc].Freq++; \
+ flush = (s->last_lit == s->lit_bufsize-1); \
+ }
+# define _tr_tally_dist(s, distance, length, flush) \
+ { uch len = (length); \
+ ush dist = (distance); \
+ s->d_buf[s->last_lit] = dist; \
+ s->l_buf[s->last_lit++] = len; \
+ dist--; \
+ s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
+ s->dyn_dtree[d_code(dist)].Freq++; \
+ flush = (s->last_lit == s->lit_bufsize-1); \
+ }
+#else
+# define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c)
+# define _tr_tally_dist(s, distance, length, flush) \
+ flush = _tr_tally(s, distance, length)
+#endif
+
#endif
diff --git a/gnu/usr.bin/cvs/zlib/example.c b/gnu/usr.bin/cvs/zlib/example.c
index 4a025240c28..2f0e1973752 100644
--- a/gnu/usr.bin/cvs/zlib/example.c
+++ b/gnu/usr.bin/cvs/zlib/example.c
@@ -1,9 +1,9 @@
/* example.c -- usage example of the zlib compression library
- * Copyright (C) 1995-1996 Jean-loup Gailly.
+ * Copyright (C) 1995-1998 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
-/* $Id: example.c,v 1.1.1.1 1996/10/18 03:35:04 tholo Exp $ */
+/* @(#) $Id: example.c,v 1.1.1.2 2001/09/28 22:45:40 tholo Exp $ */
#include <stdio.h>
#include "zlib.h"
@@ -15,6 +15,12 @@
extern void exit OF((int));
#endif
+#if defined(VMS) || defined(RISCOS)
+# define TESTFILE "foo-gz"
+#else
+# define TESTFILE "foo.gz"
+#endif
+
#define CHECK_ERR(err, msg) { \
if (err != Z_OK) { \
fprintf(stderr, "%s error: %d\n", msg, err); \
@@ -41,7 +47,7 @@ void test_large_deflate OF((Byte *compr, uLong comprLen,
Byte *uncompr, uLong uncomprLen));
void test_large_inflate OF((Byte *compr, uLong comprLen,
Byte *uncompr, uLong uncomprLen));
-void test_flush OF((Byte *compr, uLong comprLen));
+void test_flush OF((Byte *compr, uLong *comprLen));
void test_sync OF((Byte *compr, uLong comprLen,
Byte *uncompr, uLong uncomprLen));
void test_dict_deflate OF((Byte *compr, uLong comprLen));
@@ -69,8 +75,9 @@ void test_compress(compr, comprLen, uncompr, uncomprLen)
if (strcmp((char*)uncompr, hello)) {
fprintf(stderr, "bad uncompress\n");
+ exit(1);
} else {
- printf("uncompress(): %s\n", uncompr);
+ printf("uncompress(): %s\n", (char *)uncompr);
}
}
@@ -78,24 +85,31 @@ void test_compress(compr, comprLen, uncompr, uncomprLen)
* Test read/write of .gz files
*/
void test_gzio(out, in, uncompr, uncomprLen)
- const char *out; /* output file */
- const char *in; /* input file */
+ const char *out; /* compressed output file */
+ const char *in; /* compressed input file */
Byte *uncompr;
int uncomprLen;
{
int err;
int len = strlen(hello)+1;
gzFile file;
+ z_off_t pos;
file = gzopen(out, "wb");
if (file == NULL) {
fprintf(stderr, "gzopen error\n");
exit(1);
}
-
- if (gzwrite(file, (const voidp)hello, (unsigned)len) != len) {
- fprintf(stderr, "gzwrite err: %s\n", gzerror(file, &err));
+ gzputc(file, 'h');
+ if (gzputs(file, "ello") != 4) {
+ fprintf(stderr, "gzputs err: %s\n", gzerror(file, &err));
+ exit(1);
+ }
+ if (gzprintf(file, ", %s!", "hello") != 8) {
+ fprintf(stderr, "gzprintf err: %s\n", gzerror(file, &err));
+ exit(1);
}
+ gzseek(file, 1L, SEEK_CUR); /* add one zero byte */
gzclose(file);
file = gzopen(in, "rb");
@@ -107,14 +121,41 @@ void test_gzio(out, in, uncompr, uncomprLen)
uncomprLen = gzread(file, uncompr, (unsigned)uncomprLen);
if (uncomprLen != len) {
fprintf(stderr, "gzread err: %s\n", gzerror(file, &err));
+ exit(1);
}
- gzclose(file);
-
if (strcmp((char*)uncompr, hello)) {
- fprintf(stderr, "bad gzread\n");
+ fprintf(stderr, "bad gzread: %s\n", (char*)uncompr);
+ exit(1);
+ } else {
+ printf("gzread(): %s\n", (char *)uncompr);
+ }
+
+ pos = gzseek(file, -8L, SEEK_CUR);
+ if (pos != 6 || gztell(file) != pos) {
+ fprintf(stderr, "gzseek error, pos=%ld, gztell=%ld\n",
+ (long)pos, (long)gztell(file));
+ exit(1);
+ }
+
+ if (gzgetc(file) != ' ') {
+ fprintf(stderr, "gzgetc error\n");
+ exit(1);
+ }
+
+ gzgets(file, (char*)uncompr, uncomprLen);
+ uncomprLen = strlen((char*)uncompr);
+ if (uncomprLen != 6) { /* "hello!" */
+ fprintf(stderr, "gzgets err after gzseek: %s\n", gzerror(file, &err));
+ exit(1);
+ }
+ if (strcmp((char*)uncompr, hello+7)) {
+ fprintf(stderr, "bad gzgets after gzseek\n");
+ exit(1);
} else {
- printf("gzread(): %s\n", uncompr);
+ printf("gzgets() after gzseek: %s\n", (char *)uncompr);
}
+
+ gzclose(file);
}
/* ===========================================================================
@@ -171,12 +212,13 @@ void test_inflate(compr, comprLen, uncompr, uncomprLen)
d_stream.zfree = (free_func)0;
d_stream.opaque = (voidpf)0;
- err = inflateInit(&d_stream);
- CHECK_ERR(err, "inflateInit");
-
d_stream.next_in = compr;
+ d_stream.avail_in = 0;
d_stream.next_out = uncompr;
+ err = inflateInit(&d_stream);
+ CHECK_ERR(err, "inflateInit");
+
while (d_stream.total_out < uncomprLen && d_stream.total_in < comprLen) {
d_stream.avail_in = d_stream.avail_out = 1; /* force small buffers */
err = inflate(&d_stream, Z_NO_FLUSH);
@@ -189,8 +231,9 @@ void test_inflate(compr, comprLen, uncompr, uncomprLen)
if (strcmp((char*)uncompr, hello)) {
fprintf(stderr, "bad inflate\n");
+ exit(1);
} else {
- printf("inflate(): %s\n", uncompr);
+ printf("inflate(): %s\n", (char *)uncompr);
}
}
@@ -223,6 +266,7 @@ void test_large_deflate(compr, comprLen, uncompr, uncomprLen)
CHECK_ERR(err, "deflate");
if (c_stream.avail_in != 0) {
fprintf(stderr, "deflate not greedy\n");
+ exit(1);
}
/* Feed in already compressed data and switch to no compression: */
@@ -242,6 +286,7 @@ void test_large_deflate(compr, comprLen, uncompr, uncomprLen)
err = deflate(&c_stream, Z_FINISH);
if (err != Z_STREAM_END) {
fprintf(stderr, "deflate should report Z_STREAM_END\n");
+ exit(1);
}
err = deflateEnd(&c_stream);
CHECK_ERR(err, "deflateEnd");
@@ -263,12 +308,12 @@ void test_large_inflate(compr, comprLen, uncompr, uncomprLen)
d_stream.zfree = (free_func)0;
d_stream.opaque = (voidpf)0;
- err = inflateInit(&d_stream);
- CHECK_ERR(err, "inflateInit");
-
d_stream.next_in = compr;
d_stream.avail_in = (uInt)comprLen;
+ err = inflateInit(&d_stream);
+ CHECK_ERR(err, "inflateInit");
+
for (;;) {
d_stream.next_out = uncompr; /* discard the output */
d_stream.avail_out = (uInt)uncomprLen;
@@ -282,6 +327,7 @@ void test_large_inflate(compr, comprLen, uncompr, uncomprLen)
if (d_stream.total_out != 2*uncomprLen + comprLen/2) {
fprintf(stderr, "bad large inflate: %ld\n", d_stream.total_out);
+ exit(1);
} else {
printf("large_inflate(): OK\n");
}
@@ -292,7 +338,7 @@ void test_large_inflate(compr, comprLen, uncompr, uncomprLen)
*/
void test_flush(compr, comprLen)
Byte *compr;
- uLong comprLen;
+ uLong *comprLen;
{
z_stream c_stream; /* compression stream */
int err;
@@ -308,7 +354,7 @@ void test_flush(compr, comprLen)
c_stream.next_in = (Bytef*)hello;
c_stream.next_out = compr;
c_stream.avail_in = 3;
- c_stream.avail_out = (uInt)comprLen;
+ c_stream.avail_out = (uInt)*comprLen;
err = deflate(&c_stream, Z_FULL_FLUSH);
CHECK_ERR(err, "deflate");
@@ -321,6 +367,8 @@ void test_flush(compr, comprLen)
}
err = deflateEnd(&c_stream);
CHECK_ERR(err, "deflateEnd");
+
+ *comprLen = c_stream.total_out;
}
/* ===========================================================================
@@ -339,12 +387,13 @@ void test_sync(compr, comprLen, uncompr, uncomprLen)
d_stream.zfree = (free_func)0;
d_stream.opaque = (voidpf)0;
+ d_stream.next_in = compr;
+ d_stream.avail_in = 2; /* just read the zlib header */
+
err = inflateInit(&d_stream);
CHECK_ERR(err, "inflateInit");
- d_stream.next_in = compr;
d_stream.next_out = uncompr;
- d_stream.avail_in = 2; /* just read the zlib header */
d_stream.avail_out = (uInt)uncomprLen;
inflate(&d_stream, Z_NO_FLUSH);
@@ -358,11 +407,12 @@ void test_sync(compr, comprLen, uncompr, uncomprLen)
if (err != Z_DATA_ERROR) {
fprintf(stderr, "inflate should report DATA_ERROR\n");
/* Because of incorrect adler32 */
+ exit(1);
}
err = inflateEnd(&d_stream);
CHECK_ERR(err, "inflateEnd");
- printf("after inflateSync(): hel%s\n", uncompr);
+ printf("after inflateSync(): hel%s\n", (char *)uncompr);
}
/* ===========================================================================
@@ -396,6 +446,7 @@ void test_dict_deflate(compr, comprLen)
err = deflate(&c_stream, Z_FINISH);
if (err != Z_STREAM_END) {
fprintf(stderr, "deflate should report Z_STREAM_END\n");
+ exit(1);
}
err = deflateEnd(&c_stream);
CHECK_ERR(err, "deflateEnd");
@@ -417,12 +468,12 @@ void test_dict_inflate(compr, comprLen, uncompr, uncomprLen)
d_stream.zfree = (free_func)0;
d_stream.opaque = (voidpf)0;
- err = inflateInit(&d_stream);
- CHECK_ERR(err, "inflateInit");
-
d_stream.next_in = compr;
d_stream.avail_in = (uInt)comprLen;
+ err = inflateInit(&d_stream);
+ CHECK_ERR(err, "inflateInit");
+
d_stream.next_out = uncompr;
d_stream.avail_out = (uInt)uncomprLen;
@@ -445,8 +496,9 @@ void test_dict_inflate(compr, comprLen, uncompr, uncomprLen)
if (strcmp((char*)uncompr, hello)) {
fprintf(stderr, "bad inflate with dict\n");
+ exit(1);
} else {
- printf("inflate with dictionary: %s\n", uncompr);
+ printf("inflate with dictionary: %s\n", (char *)uncompr);
}
}
@@ -461,8 +513,9 @@ int main(argc, argv)
Byte *compr, *uncompr;
uLong comprLen = 10000*sizeof(int); /* don't overflow on MSDOS */
uLong uncomprLen = comprLen;
+ static const char* myVersion = ZLIB_VERSION;
- if (zlibVersion()[0] != ZLIB_VERSION[0]) {
+ if (zlibVersion()[0] != myVersion[0]) {
fprintf(stderr, "incompatible zlib version\n");
exit(1);
@@ -479,11 +532,10 @@ int main(argc, argv)
printf("out of memory\n");
exit(1);
}
-
test_compress(compr, comprLen, uncompr, uncomprLen);
- test_gzio((argc > 1 ? argv[1] : "foo.gz"),
- (argc > 2 ? argv[2] : "foo.gz"),
+ test_gzio((argc > 1 ? argv[1] : TESTFILE),
+ (argc > 2 ? argv[2] : TESTFILE),
uncompr, (int)uncomprLen);
test_deflate(compr, comprLen);
@@ -492,8 +544,9 @@ int main(argc, argv)
test_large_deflate(compr, comprLen, uncompr, uncomprLen);
test_large_inflate(compr, comprLen, uncompr, uncomprLen);
- test_flush(compr, comprLen);
+ test_flush(compr, &comprLen);
test_sync(compr, comprLen, uncompr, uncomprLen);
+ comprLen = uncomprLen;
test_dict_deflate(compr, comprLen);
test_dict_inflate(compr, comprLen, uncompr, uncomprLen);
diff --git a/gnu/usr.bin/cvs/zlib/infblock.c b/gnu/usr.bin/cvs/zlib/infblock.c
index cc2e6745a78..f4920faa5ea 100644
--- a/gnu/usr.bin/cvs/zlib/infblock.c
+++ b/gnu/usr.bin/cvs/zlib/infblock.c
@@ -1,5 +1,5 @@
/* infblock.c -- interpret and process block types to last block
- * Copyright (C) 1995-1996 Mark Adler
+ * Copyright (C) 1995-1998 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -11,8 +11,12 @@
struct inflate_codes_state {int dummy;}; /* for buggy compilers */
+/* simplify the use of the inflate_huft type with some defines */
+#define exop word.what.Exop
+#define bits word.what.Bits
+
/* Table for deflate from PKZIP's appnote.txt. */
-local uInt border[] = { /* Order of the bit length code lengths */
+local const uInt border[] = { /* Order of the bit length code lengths */
16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
/*
@@ -66,23 +70,19 @@ inflate_blocks_statef *s;
z_streamp z;
uLongf *c;
{
- if (s->checkfn != Z_NULL)
+ if (c != Z_NULL)
*c = s->check;
if (s->mode == BTREE || s->mode == DTREE)
ZFREE(z, s->sub.trees.blens);
if (s->mode == CODES)
- {
inflate_codes_free(s->sub.decode.codes, z);
- inflate_trees_free(s->sub.decode.td, z);
- inflate_trees_free(s->sub.decode.tl, z);
- }
s->mode = TYPE;
s->bitk = 0;
s->bitb = 0;
s->read = s->write = s->window;
if (s->checkfn != Z_NULL)
- z->adler = s->check = (*s->checkfn)(0L, Z_NULL, 0);
- Trace((stderr, "inflate: blocks reset\n"));
+ z->adler = s->check = (*s->checkfn)(0L, (const Bytef *)Z_NULL, 0);
+ Tracev((stderr, "inflate: blocks reset\n"));
}
@@ -96,23 +96,27 @@ uInt w;
if ((s = (inflate_blocks_statef *)ZALLOC
(z,1,sizeof(struct inflate_blocks_state))) == Z_NULL)
return s;
+ if ((s->hufts =
+ (inflate_huft *)ZALLOC(z, sizeof(inflate_huft), MANY)) == Z_NULL)
+ {
+ ZFREE(z, s);
+ return Z_NULL;
+ }
if ((s->window = (Bytef *)ZALLOC(z, 1, w)) == Z_NULL)
{
+ ZFREE(z, s->hufts);
ZFREE(z, s);
return Z_NULL;
}
s->end = s->window + w;
s->checkfn = c;
s->mode = TYPE;
- Trace((stderr, "inflate: blocks allocated\n"));
- inflate_blocks_reset(s, z, &s->check);
+ Tracev((stderr, "inflate: blocks allocated\n"));
+ inflate_blocks_reset(s, z, Z_NULL);
return s;
}
-#ifdef DEBUG
- extern uInt inflate_hufts;
-#endif
int inflate_blocks(s, z, r)
inflate_blocks_statef *s;
z_streamp z;
@@ -139,7 +143,7 @@ int r;
switch (t >> 1)
{
case 0: /* stored */
- Trace((stderr, "inflate: stored block%s\n",
+ Tracev((stderr, "inflate: stored block%s\n",
s->last ? " (last)" : ""));
DUMPBITS(3)
t = k & 7; /* go to byte boundary */
@@ -147,27 +151,25 @@ int r;
s->mode = LENS; /* get length of stored block */
break;
case 1: /* fixed */
- Trace((stderr, "inflate: fixed codes block%s\n",
+ Tracev((stderr, "inflate: fixed codes block%s\n",
s->last ? " (last)" : ""));
{
uInt bl, bd;
inflate_huft *tl, *td;
- inflate_trees_fixed(&bl, &bd, &tl, &td);
+ inflate_trees_fixed(&bl, &bd, &tl, &td, z);
s->sub.decode.codes = inflate_codes_new(bl, bd, tl, td, z);
if (s->sub.decode.codes == Z_NULL)
{
r = Z_MEM_ERROR;
LEAVE
}
- s->sub.decode.tl = Z_NULL; /* don't try to free these */
- s->sub.decode.td = Z_NULL;
}
DUMPBITS(3)
s->mode = CODES;
break;
case 2: /* dynamic */
- Trace((stderr, "inflate: dynamic codes block%s\n",
+ Tracev((stderr, "inflate: dynamic codes block%s\n",
s->last ? " (last)" : ""));
DUMPBITS(3)
s->mode = TABLE;
@@ -224,8 +226,6 @@ int r;
}
#endif
t = 258 + (t & 0x1f) + ((t >> 5) & 0x1f);
- if (t < 19)
- t = 19;
if ((s->sub.trees.blens = (uIntf*)ZALLOC(z, t, sizeof(uInt))) == Z_NULL)
{
r = Z_MEM_ERROR;
@@ -246,9 +246,10 @@ int r;
s->sub.trees.blens[border[s->sub.trees.index++]] = 0;
s->sub.trees.bb = 7;
t = inflate_trees_bits(s->sub.trees.blens, &s->sub.trees.bb,
- &s->sub.trees.tb, z);
+ &s->sub.trees.tb, s->hufts, z);
if (t != Z_OK)
{
+ ZFREE(z, s->sub.trees.blens);
r = t;
if (r == Z_DATA_ERROR)
s->mode = BAD;
@@ -267,8 +268,8 @@ int r;
t = s->sub.trees.bb;
NEEDBITS(t)
h = s->sub.trees.tb + ((uInt)b & inflate_mask[t]);
- t = h->word.what.Bits;
- c = h->more.Base;
+ t = h->bits;
+ c = h->base;
if (c < 16)
{
DUMPBITS(t)
@@ -287,6 +288,7 @@ int r;
if (i + j > 258 + (t & 0x1f) + ((t >> 5) & 0x1f) ||
(c == 16 && i < 1))
{
+ ZFREE(z, s->sub.trees.blens);
s->mode = BAD;
z->msg = (char*)"invalid bit length repeat";
r = Z_DATA_ERROR;
@@ -299,7 +301,6 @@ int r;
s->sub.trees.index = i;
}
}
- inflate_trees_free(s->sub.trees.tb, z);
s->sub.trees.tb = Z_NULL;
{
uInt bl, bd;
@@ -309,11 +310,10 @@ int r;
bl = 9; /* must be <= 9 for lookahead assumptions */
bd = 6; /* must be <= 9 for lookahead assumptions */
t = s->sub.trees.table;
-#ifdef DEBUG
- inflate_hufts = 0;
-#endif
t = inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f),
- s->sub.trees.blens, &bl, &bd, &tl, &td, z);
+ s->sub.trees.blens, &bl, &bd, &tl, &td,
+ s->hufts, z);
+ ZFREE(z, s->sub.trees.blens);
if (t != Z_OK)
{
if (t == (uInt)Z_DATA_ERROR)
@@ -321,19 +321,13 @@ int r;
r = t;
LEAVE
}
- Tracev((stderr, "inflate: trees ok, %d * %d bytes used\n",
- inflate_hufts, sizeof(inflate_huft)));
+ Tracev((stderr, "inflate: trees ok\n"));
if ((c = inflate_codes_new(bl, bd, tl, td, z)) == Z_NULL)
{
- inflate_trees_free(td, z);
- inflate_trees_free(tl, z);
r = Z_MEM_ERROR;
LEAVE
}
- ZFREE(z, s->sub.trees.blens);
s->sub.decode.codes = c;
- s->sub.decode.tl = tl;
- s->sub.decode.td = td;
}
s->mode = CODES;
case CODES:
@@ -342,8 +336,6 @@ int r;
return inflate_flush(s, z, r);
r = Z_OK;
inflate_codes_free(s->sub.decode.codes, z);
- inflate_trees_free(s->sub.decode.td, z);
- inflate_trees_free(s->sub.decode.tl, z);
LOAD
Tracev((stderr, "inflate: codes end, %lu total out\n",
z->total_out + (q >= s->read ? q - s->read :
@@ -353,13 +345,6 @@ int r;
s->mode = TYPE;
break;
}
- if (k > 7) /* return unused byte, if any */
- {
- Assert(k < 16, "inflate_codes grabbed too many bytes")
- k -= 8;
- n++;
- p--; /* can always return one */
- }
s->mode = DRY;
case DRY:
FLUSH
@@ -379,15 +364,15 @@ int r;
}
-int inflate_blocks_free(s, z, c)
+int inflate_blocks_free(s, z)
inflate_blocks_statef *s;
z_streamp z;
-uLongf *c;
{
- inflate_blocks_reset(s, z, c);
+ inflate_blocks_reset(s, z, Z_NULL);
ZFREE(z, s->window);
+ ZFREE(z, s->hufts);
ZFREE(z, s);
- Trace((stderr, "inflate: blocks freed\n"));
+ Tracev((stderr, "inflate: blocks freed\n"));
return Z_OK;
}
@@ -397,6 +382,17 @@ inflate_blocks_statef *s;
const Bytef *d;
uInt n;
{
- zmemcpy((charf *)s->window, d, n);
+ zmemcpy(s->window, d, n);
s->read = s->write = s->window + n;
}
+
+
+/* Returns true if inflate is currently at the end of a block generated
+ * by Z_SYNC_FLUSH or Z_FULL_FLUSH.
+ * IN assertion: s != Z_NULL
+ */
+int inflate_blocks_sync_point(s)
+inflate_blocks_statef *s;
+{
+ return s->mode == LENS;
+}
diff --git a/gnu/usr.bin/cvs/zlib/infblock.h b/gnu/usr.bin/cvs/zlib/infblock.h
index 3ecd50cd3a6..bd25c807536 100644
--- a/gnu/usr.bin/cvs/zlib/infblock.h
+++ b/gnu/usr.bin/cvs/zlib/infblock.h
@@ -1,5 +1,5 @@
/* infblock.h -- header to use infblock.c
- * Copyright (C) 1995-1996 Mark Adler
+ * Copyright (C) 1995-1998 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -28,10 +28,12 @@ extern void inflate_blocks_reset OF((
extern int inflate_blocks_free OF((
inflate_blocks_statef *,
- z_streamp ,
- uLongf *)); /* check value on output */
+ z_streamp));
extern void inflate_set_dictionary OF((
inflate_blocks_statef *s,
const Bytef *d, /* dictionary */
uInt n)); /* dictionary length */
+
+extern int inflate_blocks_sync_point OF((
+ inflate_blocks_statef *s));
diff --git a/gnu/usr.bin/cvs/zlib/infcodes.c b/gnu/usr.bin/cvs/zlib/infcodes.c
index 3ae3818a194..d4e5ee9a554 100644
--- a/gnu/usr.bin/cvs/zlib/infcodes.c
+++ b/gnu/usr.bin/cvs/zlib/infcodes.c
@@ -1,5 +1,5 @@
/* infcodes.c -- process literals and length/distance pairs
- * Copyright (C) 1995-1996 Mark Adler
+ * Copyright (C) 1995-1998 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -11,16 +11,10 @@
#include "inffast.h"
/* simplify the use of the inflate_huft type with some defines */
-#define base more.Base
-#define next more.Next
#define exop word.what.Exop
#define bits word.what.Bits
-/* inflate codes private state */
-struct inflate_codes_state {
-
- /* mode */
- enum { /* waiting for "i:"=input, "o:"=output, "x:"=nothing */
+typedef enum { /* waiting for "i:"=input, "o:"=output, "x:"=nothing */
START, /* x: set up for LEN */
LEN, /* i: get length/literal/eob next */
LENEXT, /* i: getting length extra (have base) */
@@ -31,7 +25,13 @@ struct inflate_codes_state {
WASH, /* o: got eob, possibly still output waiting */
END, /* x: got eob and all data flushed */
BADCODE} /* x: got error */
- mode; /* current inflate_codes mode */
+inflate_codes_mode;
+
+/* inflate codes private state */
+struct inflate_codes_state {
+
+ /* mode */
+ inflate_codes_mode mode; /* current inflate_codes mode */
/* mode dependent information */
uInt len;
@@ -143,7 +143,7 @@ int r;
if ((e & 64) == 0) /* next table */
{
c->sub.code.need = e;
- c->sub.code.tree = t->next;
+ c->sub.code.tree = t + t->base;
break;
}
if (e & 32) /* end of block */
@@ -181,7 +181,7 @@ int r;
if ((e & 64) == 0) /* next table */
{
c->sub.code.need = e;
- c->sub.code.tree = t->next;
+ c->sub.code.tree = t + t->base;
break;
}
c->mode = BADCODE; /* invalid code */
@@ -221,6 +221,13 @@ int r;
c->mode = START;
break;
case WASH: /* o: got eob, possibly more output */
+ if (k > 7) /* return unused byte, if any */
+ {
+ Assert(k < 16, "inflate_codes grabbed too many bytes")
+ k -= 8;
+ n++;
+ p--; /* can always return one */
+ }
FLUSH
if (s->read != s->write)
LEAVE
@@ -235,6 +242,9 @@ int r;
r = Z_STREAM_ERROR;
LEAVE
}
+#ifdef NEED_DUMMY_RETURN
+ return Z_STREAM_ERROR; /* Some dumb compilers complain without this */
+#endif
}
diff --git a/gnu/usr.bin/cvs/zlib/infcodes.h b/gnu/usr.bin/cvs/zlib/infcodes.h
index c2c38df2c06..6c750d896f9 100644
--- a/gnu/usr.bin/cvs/zlib/infcodes.h
+++ b/gnu/usr.bin/cvs/zlib/infcodes.h
@@ -1,5 +1,5 @@
/* infcodes.h -- header to use infcodes.c
- * Copyright (C) 1995-1996 Mark Adler
+ * Copyright (C) 1995-1998 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
diff --git a/gnu/usr.bin/cvs/zlib/inffast.c b/gnu/usr.bin/cvs/zlib/inffast.c
index 86eee4a2992..61a78ee933f 100644
--- a/gnu/usr.bin/cvs/zlib/inffast.c
+++ b/gnu/usr.bin/cvs/zlib/inffast.c
@@ -1,5 +1,5 @@
/* inffast.c -- process literals and length/distance pairs fast
- * Copyright (C) 1995-1996 Mark Adler
+ * Copyright (C) 1995-1998 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -13,14 +13,12 @@
struct inflate_codes_state {int dummy;}; /* for buggy compilers */
/* simplify the use of the inflate_huft type with some defines */
-#define base more.Base
-#define next more.Next
#define exop word.what.Exop
#define bits word.what.Bits
/* macros for bit input with no checking and for returning unused bytes */
#define GRABBITS(j) {while(k<(j)){b|=((uLong)NEXTBYTE)<<k;k+=8;}}
-#define UNGRAB {n+=(c=k>>3);p-=c;k&=7;}
+#define UNGRAB {c=z->avail_in-n;c=(k>>3)<c?k>>3:c;n+=c;p-=c;k-=c<<3;}
/* Called with number of bytes left to write in window at least 258
(the maximum string length) and number of input bytes available
@@ -120,7 +118,10 @@ z_streamp z;
break;
}
else if ((e & 64) == 0)
- e = (t = t->next + ((uInt)b & inflate_mask[e]))->exop;
+ {
+ t += t->base;
+ e = (t += ((uInt)b & inflate_mask[e]))->exop;
+ }
else
{
z->msg = (char*)"invalid distance code";
@@ -133,7 +134,8 @@ z_streamp z;
}
if ((e & 64) == 0)
{
- if ((e = (t = t->next + ((uInt)b & inflate_mask[e]))->exop) == 0)
+ t += t->base;
+ if ((e = (t += ((uInt)b & inflate_mask[e]))->exop) == 0)
{
DUMPBITS(t->bits)
Tracevv((stderr, t->base >= 0x20 && t->base < 0x7f ?
diff --git a/gnu/usr.bin/cvs/zlib/inffast.h b/gnu/usr.bin/cvs/zlib/inffast.h
index 8cc644efb1f..8facec55314 100644
--- a/gnu/usr.bin/cvs/zlib/inffast.h
+++ b/gnu/usr.bin/cvs/zlib/inffast.h
@@ -1,5 +1,5 @@
/* inffast.h -- header to use inffast.c
- * Copyright (C) 1995-1996 Mark Adler
+ * Copyright (C) 1995-1998 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
diff --git a/gnu/usr.bin/cvs/zlib/inffixed.h b/gnu/usr.bin/cvs/zlib/inffixed.h
new file mode 100644
index 00000000000..77f7e763145
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/inffixed.h
@@ -0,0 +1,151 @@
+/* inffixed.h -- table for decoding fixed codes
+ * Generated automatically by the maketree.c program
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+ */
+
+local uInt fixed_bl = 9;
+local uInt fixed_bd = 5;
+local inflate_huft fixed_tl[] = {
+ {{{96,7}},256}, {{{0,8}},80}, {{{0,8}},16}, {{{84,8}},115},
+ {{{82,7}},31}, {{{0,8}},112}, {{{0,8}},48}, {{{0,9}},192},
+ {{{80,7}},10}, {{{0,8}},96}, {{{0,8}},32}, {{{0,9}},160},
+ {{{0,8}},0}, {{{0,8}},128}, {{{0,8}},64}, {{{0,9}},224},
+ {{{80,7}},6}, {{{0,8}},88}, {{{0,8}},24}, {{{0,9}},144},
+ {{{83,7}},59}, {{{0,8}},120}, {{{0,8}},56}, {{{0,9}},208},
+ {{{81,7}},17}, {{{0,8}},104}, {{{0,8}},40}, {{{0,9}},176},
+ {{{0,8}},8}, {{{0,8}},136}, {{{0,8}},72}, {{{0,9}},240},
+ {{{80,7}},4}, {{{0,8}},84}, {{{0,8}},20}, {{{85,8}},227},
+ {{{83,7}},43}, {{{0,8}},116}, {{{0,8}},52}, {{{0,9}},200},
+ {{{81,7}},13}, {{{0,8}},100}, {{{0,8}},36}, {{{0,9}},168},
+ {{{0,8}},4}, {{{0,8}},132}, {{{0,8}},68}, {{{0,9}},232},
+ {{{80,7}},8}, {{{0,8}},92}, {{{0,8}},28}, {{{0,9}},152},
+ {{{84,7}},83}, {{{0,8}},124}, {{{0,8}},60}, {{{0,9}},216},
+ {{{82,7}},23}, {{{0,8}},108}, {{{0,8}},44}, {{{0,9}},184},
+ {{{0,8}},12}, {{{0,8}},140}, {{{0,8}},76}, {{{0,9}},248},
+ {{{80,7}},3}, {{{0,8}},82}, {{{0,8}},18}, {{{85,8}},163},
+ {{{83,7}},35}, {{{0,8}},114}, {{{0,8}},50}, {{{0,9}},196},
+ {{{81,7}},11}, {{{0,8}},98}, {{{0,8}},34}, {{{0,9}},164},
+ {{{0,8}},2}, {{{0,8}},130}, {{{0,8}},66}, {{{0,9}},228},
+ {{{80,7}},7}, {{{0,8}},90}, {{{0,8}},26}, {{{0,9}},148},
+ {{{84,7}},67}, {{{0,8}},122}, {{{0,8}},58}, {{{0,9}},212},
+ {{{82,7}},19}, {{{0,8}},106}, {{{0,8}},42}, {{{0,9}},180},
+ {{{0,8}},10}, {{{0,8}},138}, {{{0,8}},74}, {{{0,9}},244},
+ {{{80,7}},5}, {{{0,8}},86}, {{{0,8}},22}, {{{192,8}},0},
+ {{{83,7}},51}, {{{0,8}},118}, {{{0,8}},54}, {{{0,9}},204},
+ {{{81,7}},15}, {{{0,8}},102}, {{{0,8}},38}, {{{0,9}},172},
+ {{{0,8}},6}, {{{0,8}},134}, {{{0,8}},70}, {{{0,9}},236},
+ {{{80,7}},9}, {{{0,8}},94}, {{{0,8}},30}, {{{0,9}},156},
+ {{{84,7}},99}, {{{0,8}},126}, {{{0,8}},62}, {{{0,9}},220},
+ {{{82,7}},27}, {{{0,8}},110}, {{{0,8}},46}, {{{0,9}},188},
+ {{{0,8}},14}, {{{0,8}},142}, {{{0,8}},78}, {{{0,9}},252},
+ {{{96,7}},256}, {{{0,8}},81}, {{{0,8}},17}, {{{85,8}},131},
+ {{{82,7}},31}, {{{0,8}},113}, {{{0,8}},49}, {{{0,9}},194},
+ {{{80,7}},10}, {{{0,8}},97}, {{{0,8}},33}, {{{0,9}},162},
+ {{{0,8}},1}, {{{0,8}},129}, {{{0,8}},65}, {{{0,9}},226},
+ {{{80,7}},6}, {{{0,8}},89}, {{{0,8}},25}, {{{0,9}},146},
+ {{{83,7}},59}, {{{0,8}},121}, {{{0,8}},57}, {{{0,9}},210},
+ {{{81,7}},17}, {{{0,8}},105}, {{{0,8}},41}, {{{0,9}},178},
+ {{{0,8}},9}, {{{0,8}},137}, {{{0,8}},73}, {{{0,9}},242},
+ {{{80,7}},4}, {{{0,8}},85}, {{{0,8}},21}, {{{80,8}},258},
+ {{{83,7}},43}, {{{0,8}},117}, {{{0,8}},53}, {{{0,9}},202},
+ {{{81,7}},13}, {{{0,8}},101}, {{{0,8}},37}, {{{0,9}},170},
+ {{{0,8}},5}, {{{0,8}},133}, {{{0,8}},69}, {{{0,9}},234},
+ {{{80,7}},8}, {{{0,8}},93}, {{{0,8}},29}, {{{0,9}},154},
+ {{{84,7}},83}, {{{0,8}},125}, {{{0,8}},61}, {{{0,9}},218},
+ {{{82,7}},23}, {{{0,8}},109}, {{{0,8}},45}, {{{0,9}},186},
+ {{{0,8}},13}, {{{0,8}},141}, {{{0,8}},77}, {{{0,9}},250},
+ {{{80,7}},3}, {{{0,8}},83}, {{{0,8}},19}, {{{85,8}},195},
+ {{{83,7}},35}, {{{0,8}},115}, {{{0,8}},51}, {{{0,9}},198},
+ {{{81,7}},11}, {{{0,8}},99}, {{{0,8}},35}, {{{0,9}},166},
+ {{{0,8}},3}, {{{0,8}},131}, {{{0,8}},67}, {{{0,9}},230},
+ {{{80,7}},7}, {{{0,8}},91}, {{{0,8}},27}, {{{0,9}},150},
+ {{{84,7}},67}, {{{0,8}},123}, {{{0,8}},59}, {{{0,9}},214},
+ {{{82,7}},19}, {{{0,8}},107}, {{{0,8}},43}, {{{0,9}},182},
+ {{{0,8}},11}, {{{0,8}},139}, {{{0,8}},75}, {{{0,9}},246},
+ {{{80,7}},5}, {{{0,8}},87}, {{{0,8}},23}, {{{192,8}},0},
+ {{{83,7}},51}, {{{0,8}},119}, {{{0,8}},55}, {{{0,9}},206},
+ {{{81,7}},15}, {{{0,8}},103}, {{{0,8}},39}, {{{0,9}},174},
+ {{{0,8}},7}, {{{0,8}},135}, {{{0,8}},71}, {{{0,9}},238},
+ {{{80,7}},9}, {{{0,8}},95}, {{{0,8}},31}, {{{0,9}},158},
+ {{{84,7}},99}, {{{0,8}},127}, {{{0,8}},63}, {{{0,9}},222},
+ {{{82,7}},27}, {{{0,8}},111}, {{{0,8}},47}, {{{0,9}},190},
+ {{{0,8}},15}, {{{0,8}},143}, {{{0,8}},79}, {{{0,9}},254},
+ {{{96,7}},256}, {{{0,8}},80}, {{{0,8}},16}, {{{84,8}},115},
+ {{{82,7}},31}, {{{0,8}},112}, {{{0,8}},48}, {{{0,9}},193},
+ {{{80,7}},10}, {{{0,8}},96}, {{{0,8}},32}, {{{0,9}},161},
+ {{{0,8}},0}, {{{0,8}},128}, {{{0,8}},64}, {{{0,9}},225},
+ {{{80,7}},6}, {{{0,8}},88}, {{{0,8}},24}, {{{0,9}},145},
+ {{{83,7}},59}, {{{0,8}},120}, {{{0,8}},56}, {{{0,9}},209},
+ {{{81,7}},17}, {{{0,8}},104}, {{{0,8}},40}, {{{0,9}},177},
+ {{{0,8}},8}, {{{0,8}},136}, {{{0,8}},72}, {{{0,9}},241},
+ {{{80,7}},4}, {{{0,8}},84}, {{{0,8}},20}, {{{85,8}},227},
+ {{{83,7}},43}, {{{0,8}},116}, {{{0,8}},52}, {{{0,9}},201},
+ {{{81,7}},13}, {{{0,8}},100}, {{{0,8}},36}, {{{0,9}},169},
+ {{{0,8}},4}, {{{0,8}},132}, {{{0,8}},68}, {{{0,9}},233},
+ {{{80,7}},8}, {{{0,8}},92}, {{{0,8}},28}, {{{0,9}},153},
+ {{{84,7}},83}, {{{0,8}},124}, {{{0,8}},60}, {{{0,9}},217},
+ {{{82,7}},23}, {{{0,8}},108}, {{{0,8}},44}, {{{0,9}},185},
+ {{{0,8}},12}, {{{0,8}},140}, {{{0,8}},76}, {{{0,9}},249},
+ {{{80,7}},3}, {{{0,8}},82}, {{{0,8}},18}, {{{85,8}},163},
+ {{{83,7}},35}, {{{0,8}},114}, {{{0,8}},50}, {{{0,9}},197},
+ {{{81,7}},11}, {{{0,8}},98}, {{{0,8}},34}, {{{0,9}},165},
+ {{{0,8}},2}, {{{0,8}},130}, {{{0,8}},66}, {{{0,9}},229},
+ {{{80,7}},7}, {{{0,8}},90}, {{{0,8}},26}, {{{0,9}},149},
+ {{{84,7}},67}, {{{0,8}},122}, {{{0,8}},58}, {{{0,9}},213},
+ {{{82,7}},19}, {{{0,8}},106}, {{{0,8}},42}, {{{0,9}},181},
+ {{{0,8}},10}, {{{0,8}},138}, {{{0,8}},74}, {{{0,9}},245},
+ {{{80,7}},5}, {{{0,8}},86}, {{{0,8}},22}, {{{192,8}},0},
+ {{{83,7}},51}, {{{0,8}},118}, {{{0,8}},54}, {{{0,9}},205},
+ {{{81,7}},15}, {{{0,8}},102}, {{{0,8}},38}, {{{0,9}},173},
+ {{{0,8}},6}, {{{0,8}},134}, {{{0,8}},70}, {{{0,9}},237},
+ {{{80,7}},9}, {{{0,8}},94}, {{{0,8}},30}, {{{0,9}},157},
+ {{{84,7}},99}, {{{0,8}},126}, {{{0,8}},62}, {{{0,9}},221},
+ {{{82,7}},27}, {{{0,8}},110}, {{{0,8}},46}, {{{0,9}},189},
+ {{{0,8}},14}, {{{0,8}},142}, {{{0,8}},78}, {{{0,9}},253},
+ {{{96,7}},256}, {{{0,8}},81}, {{{0,8}},17}, {{{85,8}},131},
+ {{{82,7}},31}, {{{0,8}},113}, {{{0,8}},49}, {{{0,9}},195},
+ {{{80,7}},10}, {{{0,8}},97}, {{{0,8}},33}, {{{0,9}},163},
+ {{{0,8}},1}, {{{0,8}},129}, {{{0,8}},65}, {{{0,9}},227},
+ {{{80,7}},6}, {{{0,8}},89}, {{{0,8}},25}, {{{0,9}},147},
+ {{{83,7}},59}, {{{0,8}},121}, {{{0,8}},57}, {{{0,9}},211},
+ {{{81,7}},17}, {{{0,8}},105}, {{{0,8}},41}, {{{0,9}},179},
+ {{{0,8}},9}, {{{0,8}},137}, {{{0,8}},73}, {{{0,9}},243},
+ {{{80,7}},4}, {{{0,8}},85}, {{{0,8}},21}, {{{80,8}},258},
+ {{{83,7}},43}, {{{0,8}},117}, {{{0,8}},53}, {{{0,9}},203},
+ {{{81,7}},13}, {{{0,8}},101}, {{{0,8}},37}, {{{0,9}},171},
+ {{{0,8}},5}, {{{0,8}},133}, {{{0,8}},69}, {{{0,9}},235},
+ {{{80,7}},8}, {{{0,8}},93}, {{{0,8}},29}, {{{0,9}},155},
+ {{{84,7}},83}, {{{0,8}},125}, {{{0,8}},61}, {{{0,9}},219},
+ {{{82,7}},23}, {{{0,8}},109}, {{{0,8}},45}, {{{0,9}},187},
+ {{{0,8}},13}, {{{0,8}},141}, {{{0,8}},77}, {{{0,9}},251},
+ {{{80,7}},3}, {{{0,8}},83}, {{{0,8}},19}, {{{85,8}},195},
+ {{{83,7}},35}, {{{0,8}},115}, {{{0,8}},51}, {{{0,9}},199},
+ {{{81,7}},11}, {{{0,8}},99}, {{{0,8}},35}, {{{0,9}},167},
+ {{{0,8}},3}, {{{0,8}},131}, {{{0,8}},67}, {{{0,9}},231},
+ {{{80,7}},7}, {{{0,8}},91}, {{{0,8}},27}, {{{0,9}},151},
+ {{{84,7}},67}, {{{0,8}},123}, {{{0,8}},59}, {{{0,9}},215},
+ {{{82,7}},19}, {{{0,8}},107}, {{{0,8}},43}, {{{0,9}},183},
+ {{{0,8}},11}, {{{0,8}},139}, {{{0,8}},75}, {{{0,9}},247},
+ {{{80,7}},5}, {{{0,8}},87}, {{{0,8}},23}, {{{192,8}},0},
+ {{{83,7}},51}, {{{0,8}},119}, {{{0,8}},55}, {{{0,9}},207},
+ {{{81,7}},15}, {{{0,8}},103}, {{{0,8}},39}, {{{0,9}},175},
+ {{{0,8}},7}, {{{0,8}},135}, {{{0,8}},71}, {{{0,9}},239},
+ {{{80,7}},9}, {{{0,8}},95}, {{{0,8}},31}, {{{0,9}},159},
+ {{{84,7}},99}, {{{0,8}},127}, {{{0,8}},63}, {{{0,9}},223},
+ {{{82,7}},27}, {{{0,8}},111}, {{{0,8}},47}, {{{0,9}},191},
+ {{{0,8}},15}, {{{0,8}},143}, {{{0,8}},79}, {{{0,9}},255}
+ };
+local inflate_huft fixed_td[] = {
+ {{{80,5}},1}, {{{87,5}},257}, {{{83,5}},17}, {{{91,5}},4097},
+ {{{81,5}},5}, {{{89,5}},1025}, {{{85,5}},65}, {{{93,5}},16385},
+ {{{80,5}},3}, {{{88,5}},513}, {{{84,5}},33}, {{{92,5}},8193},
+ {{{82,5}},9}, {{{90,5}},2049}, {{{86,5}},129}, {{{192,5}},24577},
+ {{{80,5}},2}, {{{87,5}},385}, {{{83,5}},25}, {{{91,5}},6145},
+ {{{81,5}},7}, {{{89,5}},1537}, {{{85,5}},97}, {{{93,5}},24577},
+ {{{80,5}},4}, {{{88,5}},769}, {{{84,5}},49}, {{{92,5}},12289},
+ {{{82,5}},13}, {{{90,5}},3073}, {{{86,5}},193}, {{{192,5}},24577}
+ };
diff --git a/gnu/usr.bin/cvs/zlib/inflate.c b/gnu/usr.bin/cvs/zlib/inflate.c
index 74cc69c8684..32e9b8de679 100644
--- a/gnu/usr.bin/cvs/zlib/inflate.c
+++ b/gnu/usr.bin/cvs/zlib/inflate.c
@@ -1,5 +1,5 @@
/* inflate.c -- zlib interface to inflate modules
- * Copyright (C) 1995-1996 Mark Adler
+ * Copyright (C) 1995-1998 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -8,11 +8,7 @@
struct inflate_blocks_state {int dummy;}; /* for buggy compilers */
-/* inflate private state */
-struct internal_state {
-
- /* mode */
- enum {
+typedef enum {
METHOD, /* waiting for method byte */
FLAG, /* waiting for flag byte */
DICT4, /* four dictionary check bytes to go */
@@ -27,7 +23,13 @@ struct internal_state {
CHECK1, /* one check byte to go */
DONE, /* finished check, done */
BAD} /* got an error--stay here */
- mode; /* current inflate mode */
+inflate_mode;
+
+/* inflate private state */
+struct internal_state {
+
+ /* mode */
+ inflate_mode mode; /* current inflate mode */
/* mode dependent information */
union {
@@ -48,39 +50,35 @@ struct internal_state {
};
-int inflateReset(z)
+int ZEXPORT inflateReset(z)
z_streamp z;
{
- uLong c;
-
if (z == Z_NULL || z->state == Z_NULL)
return Z_STREAM_ERROR;
z->total_in = z->total_out = 0;
z->msg = Z_NULL;
z->state->mode = z->state->nowrap ? BLOCKS : METHOD;
- inflate_blocks_reset(z->state->blocks, z, &c);
- Trace((stderr, "inflate: reset\n"));
+ inflate_blocks_reset(z->state->blocks, z, Z_NULL);
+ Tracev((stderr, "inflate: reset\n"));
return Z_OK;
}
-int inflateEnd(z)
+int ZEXPORT inflateEnd(z)
z_streamp z;
{
- uLong c;
-
if (z == Z_NULL || z->state == Z_NULL || z->zfree == Z_NULL)
return Z_STREAM_ERROR;
if (z->state->blocks != Z_NULL)
- inflate_blocks_free(z->state->blocks, z, &c);
+ inflate_blocks_free(z->state->blocks, z);
ZFREE(z, z->state);
z->state = Z_NULL;
- Trace((stderr, "inflate: end\n"));
+ Tracev((stderr, "inflate: end\n"));
return Z_OK;
}
-int inflateInit2_(z, w, version, stream_size)
+int ZEXPORT inflateInit2_(z, w, version, stream_size)
z_streamp z;
int w;
const char *version;
@@ -129,7 +127,7 @@ int stream_size;
inflateEnd(z);
return Z_MEM_ERROR;
}
- Trace((stderr, "inflate: allocated\n"));
+ Tracev((stderr, "inflate: allocated\n"));
/* reset state */
inflateReset(z);
@@ -137,7 +135,7 @@ int stream_size;
}
-int inflateInit_(z, version, stream_size)
+int ZEXPORT inflateInit_(z, version, stream_size)
z_streamp z;
const char *version;
int stream_size;
@@ -146,18 +144,19 @@ int stream_size;
}
-#define NEEDBYTE {if(z->avail_in==0)return r;r=Z_OK;}
+#define NEEDBYTE {if(z->avail_in==0)return r;r=f;}
#define NEXTBYTE (z->avail_in--,z->total_in++,*z->next_in++)
-int inflate(z, f)
+int ZEXPORT inflate(z, f)
z_streamp z;
int f;
{
int r;
uInt b;
- if (z == Z_NULL || z->state == Z_NULL || z->next_in == Z_NULL || f < 0)
+ if (z == Z_NULL || z->state == Z_NULL || z->next_in == Z_NULL)
return Z_STREAM_ERROR;
+ f = f == Z_FINISH ? Z_BUF_ERROR : Z_OK;
r = Z_BUF_ERROR;
while (1) switch (z->state->mode)
{
@@ -188,11 +187,11 @@ int f;
z->state->sub.marker = 5; /* can't try inflateSync */
break;
}
- Trace((stderr, "inflate: zlib header ok\n"));
+ Tracev((stderr, "inflate: zlib header ok\n"));
if (!(b & PRESET_DICT))
{
z->state->mode = BLOCKS;
- break;
+ break;
}
z->state->mode = DICT4;
case DICT4:
@@ -226,9 +225,11 @@ int f;
z->state->sub.marker = 0; /* can try inflateSync */
break;
}
+ if (r == Z_OK)
+ r = f;
if (r != Z_STREAM_END)
return r;
- r = Z_OK;
+ r = f;
inflate_blocks_reset(z->state->blocks, z, &z->state->sub.check.was);
if (z->state->nowrap)
{
@@ -259,7 +260,7 @@ int f;
z->state->sub.marker = 5; /* can't try inflateSync */
break;
}
- Trace((stderr, "inflate: zlib check ok\n"));
+ Tracev((stderr, "inflate: zlib check ok\n"));
z->state->mode = DONE;
case DONE:
return Z_STREAM_END;
@@ -268,10 +269,13 @@ int f;
default:
return Z_STREAM_ERROR;
}
+#ifdef NEED_DUMMY_RETURN
+ return Z_STREAM_ERROR; /* Some dumb compilers complain without this */
+#endif
}
-int inflateSetDictionary(z, dictionary, dictLength)
+int ZEXPORT inflateSetDictionary(z, dictionary, dictLength)
z_streamp z;
const Bytef *dictionary;
uInt dictLength;
@@ -295,7 +299,7 @@ uInt dictLength;
}
-int inflateSync(z)
+int ZEXPORT inflateSync(z)
z_streamp z;
{
uInt n; /* number of bytes to look at */
@@ -319,7 +323,8 @@ z_streamp z;
/* search */
while (n && m < 4)
{
- if (*p == (Byte)(m < 2 ? 0 : 0xff))
+ static const Byte mark[4] = {0, 0, 0xff, 0xff};
+ if (*p == mark[m])
m++;
else if (*p)
m = 0;
@@ -343,3 +348,19 @@ z_streamp z;
z->state->mode = BLOCKS;
return Z_OK;
}
+
+
+/* Returns true if inflate is currently at the end of a block generated
+ * by Z_SYNC_FLUSH or Z_FULL_FLUSH. This function is used by one PPP
+ * implementation to provide an additional safety check. PPP uses Z_SYNC_FLUSH
+ * but removes the length bytes of the resulting empty stored block. When
+ * decompressing, PPP checks that at the end of input packet, inflate is
+ * waiting for these length bytes.
+ */
+int ZEXPORT inflateSyncPoint(z)
+z_streamp z;
+{
+ if (z == Z_NULL || z->state == Z_NULL || z->state->blocks == Z_NULL)
+ return Z_STREAM_ERROR;
+ return inflate_blocks_sync_point(z->state->blocks);
+}
diff --git a/gnu/usr.bin/cvs/zlib/inftrees.c b/gnu/usr.bin/cvs/zlib/inftrees.c
index 90205bd1e57..ef1e0b6b873 100644
--- a/gnu/usr.bin/cvs/zlib/inftrees.c
+++ b/gnu/usr.bin/cvs/zlib/inftrees.c
@@ -1,12 +1,17 @@
/* inftrees.c -- generate Huffman trees for efficient decoding
- * Copyright (C) 1995-1996 Mark Adler
+ * Copyright (C) 1995-1998 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
#include "zutil.h"
#include "inftrees.h"
-char inflate_copyright[] = " inflate 1.0.4 Copyright 1995-1996 Mark Adler ";
+#if !defined(BUILDFIXED) && !defined(STDC)
+# define BUILDFIXED /* non ANSI compilers may not accept inffixed.h */
+#endif
+
+const char inflate_copyright[] =
+ " inflate 1.1.3 Copyright 1995-1998 Mark Adler ";
/*
If you use the zlib library in a product, an acknowledgment is welcome
in the documentation of your product. If for some reason you cannot
@@ -16,8 +21,6 @@ char inflate_copyright[] = " inflate 1.0.4 Copyright 1995-1996 Mark Adler ";
struct internal_state {int dummy;}; /* for buggy compilers */
/* simplify the use of the inflate_huft type with some defines */
-#define base more.Base
-#define next more.Next
#define exop word.what.Exop
#define bits word.what.Bits
@@ -26,30 +29,27 @@ local int huft_build OF((
uIntf *, /* code lengths in bits */
uInt, /* number of codes */
uInt, /* number of "simple" codes */
- uIntf *, /* list of base values for non-simple codes */
- uIntf *, /* list of extra bits for non-simple codes */
+ const uIntf *, /* list of base values for non-simple codes */
+ const uIntf *, /* list of extra bits for non-simple codes */
inflate_huft * FAR*,/* result: starting table */
uIntf *, /* maximum lookup bits (returns actual) */
- z_streamp )); /* for zalloc function */
-
-local voidpf falloc OF((
- voidpf, /* opaque pointer (not used) */
- uInt, /* number of items */
- uInt)); /* size of item */
+ inflate_huft *, /* space for trees */
+ uInt *, /* hufts used in space */
+ uIntf * )); /* space for values */
/* Tables for deflate from PKZIP's appnote.txt. */
-local uInt cplens[31] = { /* Copy lengths for literal codes 257..285 */
+local const uInt cplens[31] = { /* Copy lengths for literal codes 257..285 */
3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
- /* actually lengths - 2; also see note #13 above about 258 */
-local uInt cplext[31] = { /* Extra bits for literal codes 257..285 */
+ /* see note #13 above about 258 */
+local const uInt cplext[31] = { /* Extra bits for literal codes 257..285 */
0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2,
- 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 192, 192}; /* 192==invalid */
-local uInt cpdist[30] = { /* Copy offsets for distance codes 0..29 */
+ 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 112, 112}; /* 112==invalid */
+local const uInt cpdist[30] = { /* Copy offsets for distance codes 0..29 */
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
8193, 12289, 16385, 24577};
-local uInt cpdext[30] = { /* Extra bits for distance codes */
+local const uInt cpdext[30] = { /* Extra bits for distance codes */
0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6,
7, 7, 8, 8, 9, 9, 10, 10, 11, 11,
12, 12, 13, 13};
@@ -89,26 +89,23 @@ local uInt cpdext[30] = { /* Extra bits for distance codes */
/* If BMAX needs to be larger than 16, then h and x[] should be uLong. */
#define BMAX 15 /* maximum bit length of any code */
-#define N_MAX 288 /* maximum number of codes in any set */
-
-#ifdef DEBUG
- uInt inflate_hufts;
-#endif
-local int huft_build(b, n, s, d, e, t, m, zs)
+local int huft_build(b, n, s, d, e, t, m, hp, hn, v)
uIntf *b; /* code lengths in bits (all assumed <= BMAX) */
-uInt n; /* number of codes (assumed <= N_MAX) */
+uInt n; /* number of codes (assumed <= 288) */
uInt s; /* number of simple-valued codes (0..s-1) */
-uIntf *d; /* list of base values for non-simple codes */
-uIntf *e; /* list of extra bits for non-simple codes */
+const uIntf *d; /* list of base values for non-simple codes */
+const uIntf *e; /* list of extra bits for non-simple codes */
inflate_huft * FAR *t; /* result: starting table */
uIntf *m; /* maximum lookup bits, returns actual */
-z_streamp zs; /* for zalloc function */
+inflate_huft *hp; /* space for trees */
+uInt *hn; /* hufts used in space */
+uIntf *v; /* working area: values in order of bit length */
/* Given a list of code lengths and a maximum table size, make a set of
tables to decode that set of codes. Return Z_OK on success, Z_BUF_ERROR
if the given code set is incomplete (the tables are still built in this
- case), Z_DATA_ERROR if the input is invalid (all zero length codes or an
- over-subscribed set of lengths), or Z_MEM_ERROR if not enough memory. */
+ case), Z_DATA_ERROR if the input is invalid (an over-subscribed set of
+ lengths), or Z_MEM_ERROR if not enough memory. */
{
uInt a; /* counter for codes of length k */
@@ -120,11 +117,11 @@ z_streamp zs; /* for zalloc function */
register uInt j; /* counter */
register int k; /* number of bits in current code */
int l; /* bits per table (returned in m) */
+ uInt mask; /* (1 << w) - 1, to avoid cc -O bug on HP */
register uIntf *p; /* pointer into c[], b[], or v[] */
inflate_huft *q; /* points to current table */
struct inflate_huft_s r; /* table entry for structure assignment */
inflate_huft *u[BMAX]; /* table stack */
- uInt v[N_MAX]; /* values in order of bit length */
register int w; /* bits before this table == (l * h) */
uInt x[BMAX+1]; /* bit offsets, then code stack */
uIntf *xp; /* pointer into x */
@@ -190,6 +187,7 @@ z_streamp zs; /* for zalloc function */
if ((j = *p++) != 0)
v[x[j]++] = i;
} while (++i < n);
+ n = x[g]; /* set n to length of v */
/* Generate the Huffman codes and for each, make the table entries */
@@ -231,20 +229,11 @@ z_streamp zs; /* for zalloc function */
}
z = 1 << j; /* table entries for j-bit table */
- /* allocate and link in new table */
- if ((q = (inflate_huft *)ZALLOC
- (zs,z + 1,sizeof(inflate_huft))) == Z_NULL)
- {
- if (h)
- inflate_trees_free(u[0], zs);
+ /* allocate new table */
+ if (*hn + z > MANY) /* (note: doesn't matter for fixed) */
return Z_MEM_ERROR; /* not enough memory */
- }
-#ifdef DEBUG
- inflate_hufts += z + 1;
-#endif
- *t = q + 1; /* link to list for huft_free() */
- *(t = &(q->next)) = Z_NULL;
- u[h] = ++q; /* table starts after link */
+ u[h] = q = hp + *hn;
+ *hn += z;
/* connect to last table, if there is one */
if (h)
@@ -252,10 +241,12 @@ z_streamp zs; /* for zalloc function */
x[h] = i; /* save pattern for backing up */
r.bits = (Byte)l; /* bits to dump before this table */
r.exop = (Byte)j; /* bits in this table */
- r.next = q; /* pointer to this table */
- j = i >> (w - l); /* (get around Turbo C bug) */
+ j = i >> (w - l);
+ r.base = (uInt)(q - u[h-1] - j); /* offset to this table */
u[h-1][j] = r; /* connect to last table */
}
+ else
+ *t = q; /* first table is returned result */
}
/* set up table entry in r */
@@ -284,10 +275,12 @@ z_streamp zs; /* for zalloc function */
i ^= j;
/* backup over finished tables */
- while ((i & ((1 << w) - 1)) != x[h])
+ mask = (1 << w) - 1; /* needed on HP, cc -O bug */
+ while ((i & mask) != x[h])
{
h--; /* don't need to update q */
w -= l;
+ mask = (1 << w) - 1;
}
}
}
@@ -298,28 +291,34 @@ z_streamp zs; /* for zalloc function */
}
-int inflate_trees_bits(c, bb, tb, z)
+int inflate_trees_bits(c, bb, tb, hp, z)
uIntf *c; /* 19 code lengths */
uIntf *bb; /* bits tree desired/actual depth */
inflate_huft * FAR *tb; /* bits tree result */
-z_streamp z; /* for zfree function */
+inflate_huft *hp; /* space for trees */
+z_streamp z; /* for messages */
{
int r;
+ uInt hn = 0; /* hufts used in space */
+ uIntf *v; /* work area for huft_build */
- r = huft_build(c, 19, 19, (uIntf*)Z_NULL, (uIntf*)Z_NULL, tb, bb, z);
+ if ((v = (uIntf*)ZALLOC(z, 19, sizeof(uInt))) == Z_NULL)
+ return Z_MEM_ERROR;
+ r = huft_build(c, 19, 19, (uIntf*)Z_NULL, (uIntf*)Z_NULL,
+ tb, bb, hp, &hn, v);
if (r == Z_DATA_ERROR)
z->msg = (char*)"oversubscribed dynamic bit lengths tree";
- else if (r == Z_BUF_ERROR)
+ else if (r == Z_BUF_ERROR || *bb == 0)
{
- inflate_trees_free(*tb, z);
z->msg = (char*)"incomplete dynamic bit lengths tree";
r = Z_DATA_ERROR;
}
+ ZFREE(z, v);
return r;
}
-int inflate_trees_dynamic(nl, nd, c, bl, bd, tl, td, z)
+int inflate_trees_dynamic(nl, nd, c, bl, bd, tl, td, hp, z)
uInt nl; /* number of literal/length codes */
uInt nd; /* number of distance codes */
uIntf *c; /* that many (total) code lengths */
@@ -327,88 +326,100 @@ uIntf *bl; /* literal desired/actual bit depth */
uIntf *bd; /* distance desired/actual bit depth */
inflate_huft * FAR *tl; /* literal/length tree result */
inflate_huft * FAR *td; /* distance tree result */
-z_streamp z; /* for zfree function */
+inflate_huft *hp; /* space for trees */
+z_streamp z; /* for messages */
{
int r;
+ uInt hn = 0; /* hufts used in space */
+ uIntf *v; /* work area for huft_build */
+
+ /* allocate work area */
+ if ((v = (uIntf*)ZALLOC(z, 288, sizeof(uInt))) == Z_NULL)
+ return Z_MEM_ERROR;
/* build literal/length tree */
- if ((r = huft_build(c, nl, 257, cplens, cplext, tl, bl, z)) != Z_OK)
+ r = huft_build(c, nl, 257, cplens, cplext, tl, bl, hp, &hn, v);
+ if (r != Z_OK || *bl == 0)
{
if (r == Z_DATA_ERROR)
z->msg = (char*)"oversubscribed literal/length tree";
- else if (r == Z_BUF_ERROR)
+ else if (r != Z_MEM_ERROR)
{
- inflate_trees_free(*tl, z);
z->msg = (char*)"incomplete literal/length tree";
r = Z_DATA_ERROR;
}
+ ZFREE(z, v);
return r;
}
/* build distance tree */
- if ((r = huft_build(c + nl, nd, 0, cpdist, cpdext, td, bd, z)) != Z_OK)
+ r = huft_build(c + nl, nd, 0, cpdist, cpdext, td, bd, hp, &hn, v);
+ if (r != Z_OK || (*bd == 0 && nl > 257))
{
if (r == Z_DATA_ERROR)
- z->msg = (char*)"oversubscribed literal/length tree";
+ z->msg = (char*)"oversubscribed distance tree";
else if (r == Z_BUF_ERROR) {
#ifdef PKZIP_BUG_WORKAROUND
r = Z_OK;
}
#else
- inflate_trees_free(*td, z);
- z->msg = (char*)"incomplete literal/length tree";
+ z->msg = (char*)"incomplete distance tree";
+ r = Z_DATA_ERROR;
+ }
+ else if (r != Z_MEM_ERROR)
+ {
+ z->msg = (char*)"empty distance tree with lengths";
r = Z_DATA_ERROR;
}
- inflate_trees_free(*tl, z);
+ ZFREE(z, v);
return r;
#endif
}
/* done */
+ ZFREE(z, v);
return Z_OK;
}
/* build fixed tables only once--keep them here */
+#ifdef BUILDFIXED
local int fixed_built = 0;
-#define FIXEDH 530 /* number of hufts used by fixed tables */
+#define FIXEDH 544 /* number of hufts used by fixed tables */
local inflate_huft fixed_mem[FIXEDH];
local uInt fixed_bl;
local uInt fixed_bd;
local inflate_huft *fixed_tl;
local inflate_huft *fixed_td;
+#else
+#include "inffixed.h"
+#endif
-local voidpf falloc(q, n, s)
-voidpf q; /* opaque pointer */
-uInt n; /* number of items */
-uInt s; /* size of item */
-{
- Assert(s == sizeof(inflate_huft) && n <= *(intf *)q,
- "inflate_trees falloc overflow");
- *(intf *)q -= n+s-s; /* s-s to avoid warning */
- return (voidpf)(fixed_mem + *(intf *)q);
-}
-
-
-int inflate_trees_fixed(bl, bd, tl, td)
+int inflate_trees_fixed(bl, bd, tl, td, z)
uIntf *bl; /* literal desired/actual bit depth */
uIntf *bd; /* distance desired/actual bit depth */
inflate_huft * FAR *tl; /* literal/length tree result */
inflate_huft * FAR *td; /* distance tree result */
+z_streamp z; /* for memory allocation */
{
- /* build fixed tables if not already (multiple overlapped executions ok) */
+#ifdef BUILDFIXED
+ /* build fixed tables if not already */
if (!fixed_built)
{
int k; /* temporary variable */
- unsigned c[288]; /* length list for huft_build */
- z_stream z; /* for falloc function */
- int f = FIXEDH; /* number of hufts left in fixed_mem */
-
- /* set up fake z_stream for memory routines */
- z.zalloc = falloc;
- z.zfree = Z_NULL;
- z.opaque = (voidpf)&f;
+ uInt f = 0; /* number of hufts used in fixed_mem */
+ uIntf *c; /* length list for huft_build */
+ uIntf *v; /* work area for huft_build */
+
+ /* allocate memory */
+ if ((c = (uIntf*)ZALLOC(z, 288, sizeof(uInt))) == Z_NULL)
+ return Z_MEM_ERROR;
+ if ((v = (uIntf*)ZALLOC(z, 288, sizeof(uInt))) == Z_NULL)
+ {
+ ZFREE(z, c);
+ return Z_MEM_ERROR;
+ }
/* literal table */
for (k = 0; k < 144; k++)
@@ -419,52 +430,26 @@ inflate_huft * FAR *td; /* distance tree result */
c[k] = 7;
for (; k < 288; k++)
c[k] = 8;
- fixed_bl = 7;
- huft_build(c, 288, 257, cplens, cplext, &fixed_tl, &fixed_bl, &z);
+ fixed_bl = 9;
+ huft_build(c, 288, 257, cplens, cplext, &fixed_tl, &fixed_bl,
+ fixed_mem, &f, v);
/* distance table */
for (k = 0; k < 30; k++)
c[k] = 5;
fixed_bd = 5;
- huft_build(c, 30, 0, cpdist, cpdext, &fixed_td, &fixed_bd, &z);
+ huft_build(c, 30, 0, cpdist, cpdext, &fixed_td, &fixed_bd,
+ fixed_mem, &f, v);
/* done */
- Assert(f == 0, "invalid build of fixed tables");
+ ZFREE(z, v);
+ ZFREE(z, c);
fixed_built = 1;
}
+#endif
*bl = fixed_bl;
*bd = fixed_bd;
*tl = fixed_tl;
*td = fixed_td;
return Z_OK;
}
-
-
-int inflate_trees_free(t, z)
-inflate_huft *t; /* table to free */
-z_streamp z; /* for zfree function */
-/* Free the malloc'ed tables built by huft_build(), which makes a linked
- list of the tables it made, with the links in a dummy first entry of
- each table. */
-{
- register inflate_huft *p, *q, *r;
-
- /* Reverse linked list */
- p = Z_NULL;
- q = t;
- while (q != Z_NULL)
- {
- r = (q - 1)->next;
- (q - 1)->next = p;
- p = q;
- q = r;
- }
- /* Go through linked list, freeing from the malloced (t[-1]) address. */
- while (p != Z_NULL)
- {
- q = (--p)->next;
- ZFREE(z,p);
- p = q;
- }
- return Z_OK;
-}
diff --git a/gnu/usr.bin/cvs/zlib/inftrees.h b/gnu/usr.bin/cvs/zlib/inftrees.h
index b06613ddd3f..85853e097b3 100644
--- a/gnu/usr.bin/cvs/zlib/inftrees.h
+++ b/gnu/usr.bin/cvs/zlib/inftrees.h
@@ -1,5 +1,5 @@
/* inftrees.h -- header to use inftrees.c
- * Copyright (C) 1995-1996 Mark Adler
+ * Copyright (C) 1995-1998 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -19,23 +19,25 @@ struct inflate_huft_s {
Byte Exop; /* number of extra bits or operation */
Byte Bits; /* number of bits in this code or subcode */
} what;
- Bytef *pad; /* pad structure to a power of 2 (4 bytes for */
- } word; /* 16-bit, 8 bytes for 32-bit machines) */
- union {
- uInt Base; /* literal, length base, or distance base */
- inflate_huft *Next; /* pointer to next level of table */
- } more;
+ uInt pad; /* pad structure to a power of 2 (4 bytes for */
+ } word; /* 16-bit, 8 bytes for 32-bit int's) */
+ uInt base; /* literal, length base, distance base,
+ or table offset */
};
-#ifdef DEBUG
- extern uInt inflate_hufts;
-#endif
+/* Maximum size of dynamic tree. The maximum found in a long but non-
+ exhaustive search was 1004 huft structures (850 for length/literals
+ and 154 for distances, the latter actually the result of an
+ exhaustive search). The actual maximum is not known, but the
+ value below is more than safe. */
+#define MANY 1440
extern int inflate_trees_bits OF((
uIntf *, /* 19 code lengths */
uIntf *, /* bits tree desired/actual depth */
inflate_huft * FAR *, /* bits tree result */
- z_streamp )); /* for zalloc, zfree functions */
+ inflate_huft *, /* space for trees */
+ z_streamp)); /* for messages */
extern int inflate_trees_dynamic OF((
uInt, /* number of literal/length codes */
@@ -45,15 +47,12 @@ extern int inflate_trees_dynamic OF((
uIntf *, /* distance desired/actual bit depth */
inflate_huft * FAR *, /* literal/length tree result */
inflate_huft * FAR *, /* distance tree result */
- z_streamp )); /* for zalloc, zfree functions */
+ inflate_huft *, /* space for trees */
+ z_streamp)); /* for messages */
extern int inflate_trees_fixed OF((
uIntf *, /* literal desired/actual bit depth */
uIntf *, /* distance desired/actual bit depth */
inflate_huft * FAR *, /* literal/length tree result */
- inflate_huft * FAR *)); /* distance tree result */
-
-extern int inflate_trees_free OF((
- inflate_huft *, /* tables to free */
- z_streamp )); /* for zfree function */
-
+ inflate_huft * FAR *, /* distance tree result */
+ z_streamp)); /* for memory allocation */
diff --git a/gnu/usr.bin/cvs/zlib/infutil.c b/gnu/usr.bin/cvs/zlib/infutil.c
index eb21199c350..824dab57128 100644
--- a/gnu/usr.bin/cvs/zlib/infutil.c
+++ b/gnu/usr.bin/cvs/zlib/infutil.c
@@ -1,5 +1,5 @@
/* inflate_util.c -- data and routines common to blocks and codes
- * Copyright (C) 1995-1996 Mark Adler
+ * Copyright (C) 1995-1998 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
diff --git a/gnu/usr.bin/cvs/zlib/infutil.h b/gnu/usr.bin/cvs/zlib/infutil.h
index 702cd290c37..99d1135d06a 100644
--- a/gnu/usr.bin/cvs/zlib/infutil.h
+++ b/gnu/usr.bin/cvs/zlib/infutil.h
@@ -1,5 +1,5 @@
/* infutil.h -- types and macros common to blocks and codes
- * Copyright (C) 1995-1996 Mark Adler
+ * Copyright (C) 1995-1998 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -41,8 +41,6 @@ struct inflate_blocks_state {
inflate_huft *tb; /* bit length decoding tree */
} trees; /* if DTREE, decoding info for trees */
struct {
- inflate_huft *tl;
- inflate_huft *td; /* trees to free */
inflate_codes_statef
*codes;
} decode; /* if CODES, current state */
@@ -52,6 +50,7 @@ struct inflate_blocks_state {
/* mode independent information */
uInt bitk; /* bits in bit buffer */
uLong bitb; /* bit buffer */
+ inflate_huft *hufts; /* single malloc for tree space */
Bytef *window; /* sliding window */
Bytef *end; /* one byte after sliding window */
Bytef *read; /* window read pointer */
diff --git a/gnu/usr.bin/cvs/zlib/maketree.c b/gnu/usr.bin/cvs/zlib/maketree.c
new file mode 100644
index 00000000000..949d7864185
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/maketree.c
@@ -0,0 +1,85 @@
+/* maketree.c -- make inffixed.h table for decoding fixed codes
+ * Copyright (C) 1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+ */
+
+/* This program is included in the distribution for completeness.
+ You do not need to compile or run this program since inffixed.h
+ is already included in the distribution. To use this program
+ you need to compile zlib with BUILDFIXED defined and then compile
+ and link this program with the zlib library. Then the output of
+ this program can be piped to inffixed.h. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "zutil.h"
+#include "inftrees.h"
+
+/* simplify the use of the inflate_huft type with some defines */
+#define exop word.what.Exop
+#define bits word.what.Bits
+
+/* generate initialization table for an inflate_huft structure array */
+void maketree(uInt b, inflate_huft *t)
+{
+ int i, e;
+
+ i = 0;
+ while (1)
+ {
+ e = t[i].exop;
+ if (e && (e & (16+64)) == 0) /* table pointer */
+ {
+ fprintf(stderr, "maketree: cannot initialize sub-tables!\n");
+ exit(1);
+ }
+ if (i % 4 == 0)
+ printf("\n ");
+ printf(" {{{%u,%u}},%u}", t[i].exop, t[i].bits, t[i].base);
+ if (++i == (1<<b))
+ break;
+ putchar(',');
+ }
+ puts("");
+}
+
+/* create the fixed tables in C initialization syntax */
+void main(void)
+{
+ int r;
+ uInt bl, bd;
+ inflate_huft *tl, *td;
+ z_stream z;
+
+ z.zalloc = zcalloc;
+ z.opaque = (voidpf)0;
+ z.zfree = zcfree;
+ r = inflate_trees_fixed(&bl, &bd, &tl, &td, &z);
+ if (r)
+ {
+ fprintf(stderr, "inflate_trees_fixed error %d\n", r);
+ return;
+ }
+ puts("/* inffixed.h -- table for decoding fixed codes");
+ puts(" * Generated automatically by the maketree.c program");
+ puts(" */");
+ puts("");
+ puts("/* WARNING: this file should *not* be used by applications. It is");
+ puts(" part of the implementation of the compression library and is");
+ puts(" subject to change. Applications should only use zlib.h.");
+ puts(" */");
+ puts("");
+ printf("local uInt fixed_bl = %d;\n", bl);
+ printf("local uInt fixed_bd = %d;\n", bd);
+ printf("local inflate_huft fixed_tl[] = {");
+ maketree(bl, tl);
+ puts(" };");
+ printf("local inflate_huft fixed_td[] = {");
+ maketree(bd, td);
+ puts(" };");
+}
diff --git a/gnu/usr.bin/cvs/zlib/minigzip.c b/gnu/usr.bin/cvs/zlib/minigzip.c
index 5770ea7cff6..c5a3ef1cd6b 100644
--- a/gnu/usr.bin/cvs/zlib/minigzip.c
+++ b/gnu/usr.bin/cvs/zlib/minigzip.c
@@ -1,5 +1,5 @@
/* minigzip.c -- simulate gzip using the zlib compression library
- * Copyright (C) 1995-1996 Jean-loup Gailly.
+ * Copyright (C) 1995-1998 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -13,7 +13,7 @@
* or in pipe mode.
*/
-/* $Id: minigzip.c,v 1.1.1.1 1996/10/18 03:35:05 tholo Exp $ */
+/* @(#) $Id: minigzip.c,v 1.1.1.2 2001/09/28 22:45:40 tholo Exp $ */
#include <stdio.h>
#include "zlib.h"
@@ -25,6 +25,11 @@
extern void exit OF((int));
#endif
+#ifdef USE_MMAP
+# include <sys/types.h>
+# include <sys/mman.h>
+# include <sys/stat.h>
+#endif
#if defined(MSDOS) || defined(OS2) || defined(WIN32)
# include <fcntl.h>
@@ -43,31 +48,40 @@
# define GZ_SUFFIX "-gz"
# define fileno(file) file->__file
#endif
+#if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
+# include <unix.h> /* for fileno */
+#endif
+
+#ifndef WIN32 /* unlink already in stdio.h for WIN32 */
+ extern int unlink OF((const char *));
+#endif
#ifndef GZ_SUFFIX
# define GZ_SUFFIX ".gz"
#endif
-#define SUFFIX_LEN sizeof(GZ_SUFFIX)
+#define SUFFIX_LEN (sizeof(GZ_SUFFIX)-1)
-extern int unlink OF((const char *));
-
-#define BUFLEN 4096
+#define BUFLEN 16384
#define MAX_NAME_LEN 1024
-#define local static
-/* For MSDOS and other systems with limitation on stack size. For Unix,
- #define local
- works also.
- */
+#ifdef MAXSEG_64K
+# define local static
+ /* Needed for systems with limitation on stack size. */
+#else
+# define local
+#endif
char *prog;
-void error OF((const char *msg));
-void gz_compress OF((FILE *in, gzFile out));
-void gz_uncompress OF((gzFile in, FILE *out));
-void file_compress OF((char *file));
-void file_uncompress OF((char *file));
-int main OF((int argc, char *argv[]));
+void error OF((const char *msg));
+void gz_compress OF((FILE *in, gzFile out));
+#ifdef USE_MMAP
+int gz_compress_mmap OF((FILE *in, gzFile out));
+#endif
+void gz_uncompress OF((gzFile in, FILE *out));
+void file_compress OF((char *file, char *mode));
+void file_uncompress OF((char *file));
+int main OF((int argc, char *argv[]));
/* ===========================================================================
* Display error message and exit
@@ -82,6 +96,7 @@ void error(msg)
/* ===========================================================================
* Compress input to output then close both files.
*/
+
void gz_compress(in, out)
FILE *in;
gzFile out;
@@ -90,6 +105,12 @@ void gz_compress(in, out)
int len;
int err;
+#ifdef USE_MMAP
+ /* Try first compressing with mmap. If mmap fails (minigzip used in a
+ * pipe), use the normal fread loop.
+ */
+ if (gz_compress_mmap(in, out) == Z_OK) return;
+#endif
for (;;) {
len = fread(buf, 1, sizeof(buf), in);
if (ferror(in)) {
@@ -104,6 +125,43 @@ void gz_compress(in, out)
if (gzclose(out) != Z_OK) error("failed gzclose");
}
+#ifdef USE_MMAP /* MMAP version, Miguel Albrecht <malbrech@eso.org> */
+
+/* Try compressing the input file at once using mmap. Return Z_OK if
+ * if success, Z_ERRNO otherwise.
+ */
+int gz_compress_mmap(in, out)
+ FILE *in;
+ gzFile out;
+{
+ int len;
+ int err;
+ int ifd = fileno(in);
+ caddr_t buf; /* mmap'ed buffer for the entire input file */
+ off_t buf_len; /* length of the input file */
+ struct stat sb;
+
+ /* Determine the size of the file, needed for mmap: */
+ if (fstat(ifd, &sb) < 0) return Z_ERRNO;
+ buf_len = sb.st_size;
+ if (buf_len <= 0) return Z_ERRNO;
+
+ /* Now do the actual mmap: */
+ buf = mmap((caddr_t) 0, buf_len, PROT_READ, MAP_SHARED, ifd, (off_t)0);
+ if (buf == (caddr_t)(-1)) return Z_ERRNO;
+
+ /* Compress the whole file at once: */
+ len = gzwrite(out, (char *)buf, (unsigned)buf_len);
+
+ if (len != (int)buf_len) error(gzerror(out, &err));
+
+ munmap(buf, buf_len);
+ fclose(in);
+ if (gzclose(out) != Z_OK) error("failed gzclose");
+ return Z_OK;
+}
+#endif /* USE_MMAP */
+
/* ===========================================================================
* Uncompress input to output then close both files.
*/
@@ -134,8 +192,9 @@ void gz_uncompress(in, out)
* Compress the given file: create a corresponding .gz file and remove the
* original.
*/
-void file_compress(file)
+void file_compress(file, mode)
char *file;
+ char *mode;
{
local char outfile[MAX_NAME_LEN];
FILE *in;
@@ -149,7 +208,7 @@ void file_compress(file)
perror(file);
exit(1);
}
- out = gzopen(outfile, "wb"); /* use "wb9" for maximal compression */
+ out = gzopen(outfile, mode);
if (out == NULL) {
fprintf(stderr, "%s: can't gzopen %s\n", prog, outfile);
exit(1);
@@ -201,7 +260,11 @@ void file_uncompress(file)
/* ===========================================================================
- * Usage: minigzip [-d] [files...]
+ * Usage: minigzip [-d] [-f] [-h] [-1 to -9] [files...]
+ * -d : decompress
+ * -f : compress with Z_FILTERED
+ * -h : compress with Z_HUFFMAN_ONLY
+ * -1 to -9 : compression level
*/
int main(argc, argv)
@@ -210,15 +273,26 @@ int main(argc, argv)
{
int uncompr = 0;
gzFile file;
+ char outmode[20];
+
+ strcpy(outmode, "wb6 ");
prog = argv[0];
argc--, argv++;
- if (argc > 0) {
- uncompr = (strcmp(*argv, "-d") == 0);
- if (uncompr) {
- argc--, argv++;
- }
+ while (argc > 0) {
+ if (strcmp(*argv, "-d") == 0)
+ uncompr = 1;
+ else if (strcmp(*argv, "-f") == 0)
+ outmode[3] = 'f';
+ else if (strcmp(*argv, "-h") == 0)
+ outmode[3] = 'h';
+ else if ((*argv)[0] == '-' && (*argv)[1] >= '1' && (*argv)[1] <= '9' &&
+ (*argv)[2] == 0)
+ outmode[2] = (*argv)[1];
+ else
+ break;
+ argc--, argv++;
}
if (argc == 0) {
SET_BINARY_MODE(stdin);
@@ -228,7 +302,7 @@ int main(argc, argv)
if (file == NULL) error("can't gzdopen stdin");
gz_uncompress(file, stdout);
} else {
- file = gzdopen(fileno(stdout), "wb"); /* "wb9" for max compr. */
+ file = gzdopen(fileno(stdout), outmode);
if (file == NULL) error("can't gzdopen stdout");
gz_compress(stdin, file);
}
@@ -237,7 +311,7 @@ int main(argc, argv)
if (uncompr) {
file_uncompress(*argv);
} else {
- file_compress(*argv);
+ file_compress(*argv, outmode);
}
} while (argv++, --argc);
}
diff --git a/gnu/usr.bin/cvs/zlib/msdos/Makefile.b32 b/gnu/usr.bin/cvs/zlib/msdos/Makefile.b32
new file mode 100644
index 00000000000..f476da91649
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/msdos/Makefile.b32
@@ -0,0 +1,104 @@
+# Makefile for zlib
+# Borland C++
+
+# This version of the zlib makefile was adapted by Chris Young for use
+# with Borland C 4.5x with the Dos Power Pack for a 32-bit protected mode
+# flat memory model. It was created for use with POV-Ray ray tracer and
+# you may choose to edit the CFLAGS to suit your needs but the
+# switches -WX and -DMSDOS are required.
+# -- Chris Young 76702.1655@compuserve.com
+
+# To use, do "make -fmakefile.b32"
+
+# See zconf.h for details about the memory requirements.
+
+# ------------- Borland C++ -------------
+MODEL=-WX
+CFLAGS= $(MODEL) -P-C -K -N- -k- -d -3 -r- -v- -f -DMSDOS
+CC=bcc32
+LD=bcc32
+LIB=tlib
+LDFLAGS= $(MODEL)
+O=.obj
+
+# variables
+OBJ1 = adler32$(O) compress$(O) crc32$(O) gzio$(O) uncompr$(O) deflate$(O) \
+ trees$(O)
+OBJP1 = adler32$(O)+compress$(O)+crc32$(O)+gzio$(O)+uncompr$(O)+deflate$(O)+\
+ trees$(O)
+OBJ2 = zutil$(O) inflate$(O) infblock$(O) inftrees$(O) infcodes$(O) \
+ infutil$(O) inffast$(O)
+OBJP2 = zutil$(O)+inflate$(O)+infblock$(O)+inftrees$(O)+infcodes$(O)+\
+ infutil$(O)+inffast$(O)
+
+all: test
+
+adler32.obj: adler32.c zlib.h zconf.h
+ $(CC) -c $(CFLAGS) $*.c
+
+compress.obj: compress.c zlib.h zconf.h
+ $(CC) -c $(CFLAGS) $*.c
+
+crc32.obj: crc32.c zlib.h zconf.h
+ $(CC) -c $(CFLAGS) $*.c
+
+deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h
+ $(CC) -c $(CFLAGS) $*.c
+
+gzio.obj: gzio.c zutil.h zlib.h zconf.h
+ $(CC) -c $(CFLAGS) $*.c
+
+infblock.obj: infblock.c zutil.h zlib.h zconf.h infblock.h inftrees.h\
+ infcodes.h infutil.h
+ $(CC) -c $(CFLAGS) $*.c
+
+infcodes.obj: infcodes.c zutil.h zlib.h zconf.h inftrees.h infutil.h\
+ infcodes.h inffast.h
+ $(CC) -c $(CFLAGS) $*.c
+
+inflate.obj: inflate.c zutil.h zlib.h zconf.h infblock.h
+ $(CC) -c $(CFLAGS) $*.c
+
+inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h
+ $(CC) -c $(CFLAGS) $*.c
+
+infutil.obj: infutil.c zutil.h zlib.h zconf.h inftrees.h infutil.h
+ $(CC) -c $(CFLAGS) $*.c
+
+inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h infutil.h inffast.h
+ $(CC) -c $(CFLAGS) $*.c
+
+trees.obj: trees.c deflate.h zutil.h zlib.h zconf.h
+ $(CC) -c $(CFLAGS) $*.c
+
+uncompr.obj: uncompr.c zlib.h zconf.h
+ $(CC) -c $(CFLAGS) $*.c
+
+zutil.obj: zutil.c zutil.h zlib.h zconf.h
+ $(CC) -c $(CFLAGS) $*.c
+
+example.obj: example.c zlib.h zconf.h
+ $(CC) -c $(CFLAGS) $*.c
+
+minigzip.obj: minigzip.c zlib.h zconf.h
+ $(CC) -c $(CFLAGS) $*.c
+
+# we must cut the command line to fit in the MS/DOS 128 byte limit:
+zlib.lib: $(OBJ1) $(OBJ2)
+ del zlib.lib
+ $(LIB) zlib +$(OBJP1)
+ $(LIB) zlib +$(OBJP2)
+
+example.exe: example.obj zlib.lib
+ $(LD) $(LDFLAGS) example.obj zlib.lib
+
+minigzip.exe: minigzip.obj zlib.lib
+ $(LD) $(LDFLAGS) minigzip.obj zlib.lib
+
+test: example.exe minigzip.exe
+ example
+ echo hello world | minigzip | minigzip -d
+
+#clean:
+# del *.obj
+# del *.exe
diff --git a/gnu/usr.bin/cvs/zlib/msdos/Makefile.bor b/gnu/usr.bin/cvs/zlib/msdos/Makefile.bor
new file mode 100644
index 00000000000..f5651b40fec
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/msdos/Makefile.bor
@@ -0,0 +1,125 @@
+# Makefile for zlib
+# Borland C++ ************ UNTESTED ***********
+
+# To use, do "make -fmakefile.bor"
+# To compile in small model, set below: MODEL=s
+
+# WARNING: the small model is supported but only for small values of
+# MAX_WBITS and MAX_MEM_LEVEL. For example:
+# -DMAX_WBITS=11 -DDEF_WBITS=11 -DMAX_MEM_LEVEL=3
+# If you wish to reduce the memory requirements (default 256K for big
+# objects plus a few K), you can add to the LOC macro below:
+# -DMAX_MEM_LEVEL=7 -DMAX_WBITS=14
+# See zconf.h for details about the memory requirements.
+
+# ------------- Turbo C++, Borland C++ -------------
+
+# Optional nonstandard preprocessor flags (e.g. -DMAX_MEM_LEVEL=7)
+# should be added to the environment via "set LOCAL_ZLIB=-DFOO" or added
+# to the declaration of LOC here:
+LOC = $(LOCAL_ZLIB)
+
+# Type for CPU required: 0: 8086, 1: 80186, 2: 80286, 3: 80386, etc.
+CPU_TYP = 0
+
+# Memory model: one of s, m, c, l (small, medium, compact, large)
+MODEL=l
+
+CC=bcc
+# replace bcc with tcc for Turbo C++ 1.0, with bcc32 for the 32 bit version
+LD=$(CC)
+AR=tlib
+
+# compiler flags
+CFLAGS=-O2 -Z -m$(MODEL) $(LOC)
+# replace "-O2" by "-O -G -a -d" for Turbo C++ 1.0
+
+LDFLAGS=-m$(MODEL)
+
+O=.obj
+
+# variables
+OBJ1 = adler32$(O) compress$(O) crc32$(O) gzio$(O) uncompr$(O) deflate$(O) \
+ trees$(O)
+OBJP1 = adler32$(O)+compress$(O)+crc32$(O)+gzio$(O)+uncompr$(O)+deflate$(O)+\
+ trees$(O)
+OBJ2 = zutil$(O) inflate$(O) infblock$(O) inftrees$(O) infcodes$(O) \
+ infutil$(O) inffast$(O)
+OBJP2 = zutil$(O)+inflate$(O)+infblock$(O)+inftrees$(O)+infcodes$(O)+\
+ infutil$(O)+inffast$(O)
+
+ZLIB_H = zlib.h zconf.h
+ZUTIL_H = zutil.h $(ZLIB_H)
+
+ZLIB_LIB = zlib_$(MODEL).lib
+
+all: test
+
+# individual dependencies and action rules:
+adler32.obj: adler32.c $(ZLIB_H)
+ $(CC) -c $(CFLAGS) $*.c
+
+compress.obj: compress.c $(ZLIB_H)
+ $(CC) -c $(CFLAGS) $*.c
+
+crc32.obj: crc32.c $(ZLIB_H)
+ $(CC) -c $(CFLAGS) $*.c
+
+deflate.obj: deflate.c deflate.h $(ZUTIL_H)
+ $(CC) -c $(CFLAGS) $*.c
+
+gzio.obj: gzio.c $(ZUTIL_H)
+ $(CC) -c $(CFLAGS) $*.c
+
+infblock.obj: infblock.c $(ZUTIL_H) infblock.h inftrees.h infcodes.h infutil.h
+ $(CC) -c $(CFLAGS) $*.c
+
+infcodes.obj: infcodes.c $(ZUTIL_H) inftrees.h infutil.h infcodes.h inffast.h
+ $(CC) -c $(CFLAGS) $*.c
+
+inflate.obj: inflate.c $(ZUTIL_H) infblock.h
+ $(CC) -c $(CFLAGS) $*.c
+
+inftrees.obj: inftrees.c $(ZUTIL_H) inftrees.h
+ $(CC) -c $(CFLAGS) $*.c
+
+infutil.obj: infutil.c $(ZUTIL_H) inftrees.h infutil.h
+ $(CC) -c $(CFLAGS) $*.c
+
+inffast.obj: inffast.c $(ZUTIL_H) inftrees.h infutil.h inffast.h
+ $(CC) -c $(CFLAGS) $*.c
+
+trees.obj: trees.c deflate.h $(ZUTIL_H)
+ $(CC) -c $(CFLAGS) $*.c
+
+uncompr.obj: uncompr.c $(ZLIB_H)
+ $(CC) -c $(CFLAGS) $*.c
+
+zutil.obj: zutil.c $(ZUTIL_H)
+ $(CC) -c $(CFLAGS) $*.c
+
+example.obj: example.c $(ZLIB_H)
+ $(CC) -c $(CFLAGS) $*.c
+
+minigzip.obj: minigzip.c $(ZLIB_H)
+ $(CC) -c $(CFLAGS) $*.c
+
+# we must cut the command line to fit in the MS/DOS 128 byte limit:
+$(ZLIB_LIB): $(OBJ1) $(OBJ2)
+ del $(ZLIB_LIB)
+ $(AR) $(ZLIB_LIB) +$(OBJP1)
+ $(AR) $(ZLIB_LIB) +$(OBJP2)
+
+example.exe: example.obj $(ZLIB_LIB)
+ $(LD) $(LDFLAGS) example.obj $(ZLIB_LIB)
+
+minigzip.exe: minigzip.obj $(ZLIB_LIB)
+ $(LD) $(LDFLAGS) minigzip.obj $(ZLIB_LIB)
+
+test: example.exe minigzip.exe
+ example
+ echo hello world | minigzip | minigzip -d
+
+#clean:
+# del *.obj
+# del *.exe
diff --git a/gnu/usr.bin/cvs/zlib/msdos/Makefile.dj2 b/gnu/usr.bin/cvs/zlib/msdos/Makefile.dj2
new file mode 100644
index 00000000000..0ab431c8a11
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/msdos/Makefile.dj2
@@ -0,0 +1,100 @@
+# Makefile for zlib. Modified for djgpp v2.0 by F. J. Donahoe, 3/15/96.
+# Copyright (C) 1995-1998 Jean-loup Gailly.
+# For conditions of distribution and use, see copyright notice in zlib.h
+
+# To compile, or to compile and test, type:
+#
+# make -fmakefile.dj2; make test -fmakefile.dj2
+#
+# To install libz.a, zconf.h and zlib.h in the djgpp directories, type:
+#
+# make install -fmakefile.dj2
+#
+# after first defining LIBRARY_PATH and INCLUDE_PATH in djgpp.env as
+# in the sample below if the pattern of the DJGPP distribution is to
+# be followed. Remember that, while <sp>'es around <=> are ignored in
+# makefiles, they are *not* in batch files or in djgpp.env.
+# - - - - -
+# [make]
+# INCLUDE_PATH=%\>;INCLUDE_PATH%%\DJDIR%\include
+# LIBRARY_PATH=%\>;LIBRARY_PATH%%\DJDIR%\lib
+# BUTT=-m486
+# - - - - -
+# Alternately, these variables may be defined below, overriding the values
+# in djgpp.env, as
+# INCLUDE_PATH=c:\usr\include
+# LIBRARY_PATH=c:\usr\lib
+
+CC=gcc
+
+#CFLAGS=-MMD -O
+#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
+#CFLAGS=-MMD -g -DDEBUG
+CFLAGS=-MMD -O3 $(BUTT) -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
+ -Wstrict-prototypes -Wmissing-prototypes
+
+# If cp.exe is available, replace "copy /Y" with "cp -fp" .
+CP=copy /Y
+# If gnu install.exe is available, replace $(CP) with ginstall.
+INSTALL=$(CP)
+# The default value of RM is "rm -f." If "rm.exe" is found, comment out:
+RM=del
+LDLIBS=-L. -lz
+LD=$(CC) -s -o
+LDSHARED=$(CC)
+
+INCL=zlib.h zconf.h
+LIBS=libz.a
+
+AR=ar rcs
+
+prefix=/usr/local
+exec_prefix = $(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
+
+TEST_OBJS = example.o minigzip.o
+
+all: example.exe minigzip.exe
+
+test: all
+ ./example
+ echo hello world | .\minigzip | .\minigzip -d
+
+%.o : %.c
+ $(CC) $(CFLAGS) -c $< -o $@
+
+libz.a: $(OBJS)
+ $(AR) $@ $(OBJS)
+
+%.exe : %.o $(LIBS)
+ $(LD) $@ $< $(LDLIBS)
+
+# INCLUDE_PATH and LIBRARY_PATH were set for [make] in djgpp.env .
+
+.PHONY : uninstall clean
+
+install: $(INCL) $(LIBS)
+ -@if not exist $(INCLUDE_PATH)\nul mkdir $(INCLUDE_PATH)
+ -@if not exist $(LIBRARY_PATH)\nul mkdir $(LIBRARY_PATH)
+ $(INSTALL) zlib.h $(INCLUDE_PATH)
+ $(INSTALL) zconf.h $(INCLUDE_PATH)
+ $(INSTALL) libz.a $(LIBRARY_PATH)
+
+uninstall:
+ $(RM) $(INCLUDE_PATH)\zlib.h
+ $(RM) $(INCLUDE_PATH)\zconf.h
+ $(RM) $(LIBRARY_PATH)\libz.a
+
+clean:
+ $(RM) *.d
+ $(RM) *.o
+ $(RM) *.exe
+ $(RM) libz.a
+ $(RM) foo.gz
+
+DEPS := $(wildcard *.d)
+ifneq ($(DEPS),)
+include $(DEPS)
+endif
diff --git a/gnu/usr.bin/cvs/zlib/msdos/Makefile.emx b/gnu/usr.bin/cvs/zlib/msdos/Makefile.emx
new file mode 100644
index 00000000000..0e5e5cc4338
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/msdos/Makefile.emx
@@ -0,0 +1,69 @@
+# Makefile for zlib. Modified for emx 0.9c by Chr. Spieler, 6/17/98.
+# Copyright (C) 1995-1998 Jean-loup Gailly.
+# For conditions of distribution and use, see copyright notice in zlib.h
+
+# To compile, or to compile and test, type:
+#
+# make -fmakefile.emx; make test -fmakefile.emx
+#
+
+CC=gcc
+
+#CFLAGS=-MMD -O
+#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
+#CFLAGS=-MMD -g -DDEBUG
+CFLAGS=-MMD -O3 $(BUTT) -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
+ -Wstrict-prototypes -Wmissing-prototypes
+
+# If cp.exe is available, replace "copy /Y" with "cp -fp" .
+CP=copy /Y
+# If gnu install.exe is available, replace $(CP) with ginstall.
+INSTALL=$(CP)
+# The default value of RM is "rm -f." If "rm.exe" is found, comment out:
+RM=del
+LDLIBS=-L. -lzlib
+LD=$(CC) -s -o
+LDSHARED=$(CC)
+
+INCL=zlib.h zconf.h
+LIBS=zlib.a
+
+AR=ar rcs
+
+prefix=/usr/local
+exec_prefix = $(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
+
+TEST_OBJS = example.o minigzip.o
+
+all: example.exe minigzip.exe
+
+test: all
+ ./example
+ echo hello world | .\minigzip | .\minigzip -d
+
+%.o : %.c
+ $(CC) $(CFLAGS) -c $< -o $@
+
+zlib.a: $(OBJS)
+ $(AR) $@ $(OBJS)
+
+%.exe : %.o $(LIBS)
+ $(LD) $@ $< $(LDLIBS)
+
+
+.PHONY : clean
+
+clean:
+ $(RM) *.d
+ $(RM) *.o
+ $(RM) *.exe
+ $(RM) zlib.a
+ $(RM) foo.gz
+
+DEPS := $(wildcard *.d)
+ifneq ($(DEPS),)
+include $(DEPS)
+endif
diff --git a/gnu/usr.bin/cvs/zlib/msdos/Makefile.msc b/gnu/usr.bin/cvs/zlib/msdos/Makefile.msc
new file mode 100644
index 00000000000..562201d87ea
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/msdos/Makefile.msc
@@ -0,0 +1,121 @@
+# Makefile for zlib
+# Microsoft C 5.1 or later
+
+# To use, do "make makefile.msc"
+# To compile in small model, set below: MODEL=S
+
+# If you wish to reduce the memory requirements (default 256K for big
+# objects plus a few K), you can add to the LOC macro below:
+# -DMAX_MEM_LEVEL=7 -DMAX_WBITS=14
+# See zconf.h for details about the memory requirements.
+
+# ------------- Microsoft C 5.1 and later -------------
+
+# Optional nonstandard preprocessor flags (e.g. -DMAX_MEM_LEVEL=7)
+# should be added to the environment via "set LOCAL_ZLIB=-DFOO" or added
+# to the declaration of LOC here:
+LOC = $(LOCAL_ZLIB)
+
+# Type for CPU required: 0: 8086, 1: 80186, 2: 80286, 3: 80386, etc.
+CPU_TYP = 0
+
+# Memory model: one of S, M, C, L (small, medium, compact, large)
+MODEL=L
+
+CC=cl
+CFLAGS=-nologo -A$(MODEL) -G$(CPU_TYP) -W3 -Oait -Gs $(LOC)
+#-Ox generates bad code with MSC 5.1
+LIB_CFLAGS=-Zl $(CFLAGS)
+
+LD=link
+LDFLAGS=/noi/e/st:0x1500/noe/farcall/packcode
+# "/farcall/packcode" are only useful for `large code' memory models
+# but should be a "no-op" for small code models.
+
+O=.obj
+
+# variables
+OBJ1 = adler32$(O) compress$(O) crc32$(O) gzio$(O) uncompr$(O) deflate$(O) \
+ trees$(O)
+OBJP1 = adler32$(O)+compress$(O)+crc32$(O)+gzio$(O)+uncompr$(O)+deflate$(O)+\
+ trees$(O)
+OBJ2 = zutil$(O) inflate$(O) infblock$(O) inftrees$(O) infcodes$(O) \
+ infutil$(O) inffast$(O)
+OBJP2 = zutil$(O)+inflate$(O)+infblock$(O)+inftrees$(O)+infcodes$(O)+\
+ infutil$(O)+inffast$(O)
+
+ZLIB_H = zlib.h zconf.h
+ZUTIL_H = zutil.h $(ZLIB_H)
+
+ZLIB_LIB = zlib_$(MODEL).lib
+
+all: $(ZLIB_LIB) example.exe minigzip.exe
+
+# individual dependencies and action rules:
+adler32.obj: adler32.c $(ZLIB_H)
+ $(CC) -c $(LIB_CFLAGS) $*.c
+
+compress.obj: compress.c $(ZLIB_H)
+ $(CC) -c $(LIB_CFLAGS) $*.c
+
+crc32.obj: crc32.c $(ZLIB_H)
+ $(CC) -c $(LIB_CFLAGS) $*.c
+
+deflate.obj: deflate.c deflate.h $(ZUTIL_H)
+ $(CC) -c $(LIB_CFLAGS) $*.c
+
+gzio.obj: gzio.c $(ZUTIL_H)
+ $(CC) -c $(LIB_CFLAGS) $*.c
+
+infblock.obj: infblock.c $(ZUTIL_H) infblock.h inftrees.h infcodes.h infutil.h
+ $(CC) -c $(LIB_CFLAGS) $*.c
+
+infcodes.obj: infcodes.c $(ZUTIL_H) inftrees.h infutil.h infcodes.h inffast.h
+ $(CC) -c $(LIB_CFLAGS) $*.c
+
+inflate.obj: inflate.c $(ZUTIL_H) infblock.h
+ $(CC) -c $(LIB_CFLAGS) $*.c
+
+inftrees.obj: inftrees.c $(ZUTIL_H) inftrees.h
+ $(CC) -c $(LIB_CFLAGS) $*.c
+
+infutil.obj: infutil.c $(ZUTIL_H) inftrees.h infutil.h
+ $(CC) -c $(LIB_CFLAGS) $*.c
+
+inffast.obj: inffast.c $(ZUTIL_H) inftrees.h infutil.h inffast.h
+ $(CC) -c $(LIB_CFLAGS) $*.c
+
+trees.obj: trees.c deflate.h $(ZUTIL_H)
+ $(CC) -c $(LIB_CFLAGS) $*.c
+
+uncompr.obj: uncompr.c $(ZLIB_H)
+ $(CC) -c $(LIB_CFLAGS) $*.c
+
+zutil.obj: zutil.c $(ZUTIL_H)
+ $(CC) -c $(LIB_CFLAGS) $*.c
+
+example.obj: example.c $(ZLIB_H)
+ $(CC) -c $(CFLAGS) $*.c
+
+minigzip.obj: minigzip.c $(ZLIB_H)
+ $(CC) -c $(CFLAGS) $*.c
+
+# we must cut the command line to fit in the MS/DOS 128 byte limit:
+$(ZLIB_LIB): $(OBJ1) $(OBJ2)
+ if exist $(ZLIB_LIB) del $(ZLIB_LIB)
+ lib $(ZLIB_LIB) $(OBJ1);
+ lib $(ZLIB_LIB) $(OBJ2);
+
+example.exe: example.obj $(ZLIB_LIB)
+ $(LD) $(LDFLAGS) example.obj,,,$(ZLIB_LIB);
+
+minigzip.exe: minigzip.obj $(ZLIB_LIB)
+ $(LD) $(LDFLAGS) minigzip.obj,,,$(ZLIB_LIB);
+
+test: example.exe minigzip.exe
+ example
+ echo hello world | minigzip | minigzip -d
+
+#clean:
+# del *.obj
+# del *.exe
diff --git a/gnu/usr.bin/cvs/zlib/msdos/Makefile.tc b/gnu/usr.bin/cvs/zlib/msdos/Makefile.tc
new file mode 100644
index 00000000000..63e0550359f
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/msdos/Makefile.tc
@@ -0,0 +1,108 @@
+# Makefile for zlib
+# TurboC 2.0
+
+# To use, do "make -fmakefile.tc"
+# To compile in small model, set below: MODEL=-ms
+
+# WARNING: the small model is supported but only for small values of
+# MAX_WBITS and MAX_MEM_LEVEL. For example:
+# -DMAX_WBITS=11 -DMAX_MEM_LEVEL=3
+# If you wish to reduce the memory requirements (default 256K for big
+# objects plus a few K), you can add to CFLAGS below:
+# -DMAX_MEM_LEVEL=7 -DMAX_WBITS=14
+# See zconf.h for details about the memory requirements.
+
+# ------------- Turbo C 2.0 -------------
+MODEL=l
+# CFLAGS=-O2 -G -Z -m$(MODEL) -DMAX_WBITS=11 -DMAX_MEM_LEVEL=3
+CFLAGS=-O2 -G -Z -m$(MODEL)
+CC=tcc -I\tc\include
+LD=tcc -L\tc\lib
+AR=tlib
+LDFLAGS=-m$(MODEL) -f-
+O=.obj
+
+# variables
+OBJ1 = adler32$(O) compress$(O) crc32$(O) gzio$(O) uncompr$(O) deflate$(O) \
+ trees$(O)
+OBJP1 = adler32$(O)+compress$(O)+crc32$(O)+gzio$(O)+uncompr$(O)+deflate$(O)+\
+ trees$(O)
+OBJ2 = zutil$(O) inflate$(O) infblock$(O) inftrees$(O) infcodes$(O) \
+ infutil$(O) inffast$(O)
+OBJP2 = zutil$(O)+inflate$(O)+infblock$(O)+inftrees$(O)+infcodes$(O)+\
+ infutil$(O)+inffast$(O)
+
+ZLIB_H = zlib.h zconf.h
+ZUTIL_H = zutil.h $(ZLIB_H)
+
+ZLIB_LIB = zlib_$(MODEL).lib
+
+all: test
+
+adler32.obj: adler32.c $(ZLIB_H)
+ $(CC) -c $(CFLAGS) $*.c
+
+compress.obj: compress.c $(ZLIB_H)
+ $(CC) -c $(CFLAGS) $*.c
+
+crc32.obj: crc32.c $(ZLIB_H)
+ $(CC) -c $(CFLAGS) $*.c
+
+deflate.obj: deflate.c deflate.h $(ZUTIL_H)
+ $(CC) -c $(CFLAGS) $*.c
+
+gzio.obj: gzio.c $(ZUTIL_H)
+ $(CC) -c $(CFLAGS) $*.c
+
+infblock.obj: infblock.c $(ZUTIL_H) infblock.h inftrees.h infcodes.h infutil.h
+ $(CC) -c $(CFLAGS) $*.c
+
+infcodes.obj: infcodes.c $(ZUTIL_H) inftrees.h infutil.h infcodes.h inffast.h
+ $(CC) -c $(CFLAGS) $*.c
+
+inflate.obj: inflate.c $(ZUTIL_H) infblock.h
+ $(CC) -c $(CFLAGS) $*.c
+
+inftrees.obj: inftrees.c $(ZUTIL_H) inftrees.h
+ $(CC) -c $(CFLAGS) $*.c
+
+infutil.obj: infutil.c $(ZUTIL_H) inftrees.h infutil.h
+ $(CC) -c $(CFLAGS) $*.c
+
+inffast.obj: inffast.c $(ZUTIL_H) inftrees.h infutil.h inffast.h
+ $(CC) -c $(CFLAGS) $*.c
+
+trees.obj: trees.c deflate.h $(ZUTIL_H)
+ $(CC) -c $(CFLAGS) $*.c
+
+uncompr.obj: uncompr.c $(ZLIB_H)
+ $(CC) -c $(CFLAGS) $*.c
+
+zutil.obj: zutil.c $(ZUTIL_H)
+ $(CC) -c $(CFLAGS) $*.c
+
+example.obj: example.c $(ZLIB_H)
+ $(CC) -c $(CFLAGS) $*.c
+
+minigzip.obj: minigzip.c $(ZLIB_H)
+ $(CC) -c $(CFLAGS) $*.c
+
+# we must cut the command line to fit in the MS/DOS 128 byte limit:
+$(ZLIB_LIB): $(OBJ1) $(OBJ2)
+ del $(ZLIB_LIB)
+ $(AR) $(ZLIB_LIB) +$(OBJP1)
+ $(AR) $(ZLIB_LIB) +$(OBJP2)
+
+example.exe: example.obj $(ZLIB_LIB)
+ $(LD) $(LDFLAGS) -eexample.exe example.obj $(ZLIB_LIB)
+
+minigzip.exe: minigzip.obj $(ZLIB_LIB)
+ $(LD) $(LDFLAGS) -eminigzip.exe minigzip.obj $(ZLIB_LIB)
+
+test: example.exe minigzip.exe
+ example
+ echo hello world | minigzip | minigzip -d
+
+#clean:
+# del *.obj
+# del *.exe
diff --git a/gnu/usr.bin/cvs/zlib/msdos/Makefile.w32 b/gnu/usr.bin/cvs/zlib/msdos/Makefile.w32
new file mode 100644
index 00000000000..0a05fa9a469
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/msdos/Makefile.w32
@@ -0,0 +1,97 @@
+# Makefile for zlib
+# Microsoft 32-bit Visual C++ 4.0 or later (may work on earlier versions)
+
+# To use, do "nmake /f makefile.w32"
+
+# If you wish to reduce the memory requirements (default 256K for big
+# objects plus a few K), you can add to CFLAGS below:
+# -DMAX_MEM_LEVEL=7 -DMAX_WBITS=14
+# See zconf.h for details about the memory requirements.
+
+# ------------- Microsoft Visual C++ 4.0 and later -------------
+MODEL=
+CFLAGS=-Ox -GA3s -nologo -W3
+CC=cl
+LD=link
+LDFLAGS=
+O=.obj
+
+# variables
+OBJ1 = adler32$(O) compress$(O) crc32$(O) gzio$(O) uncompr$(O) deflate$(O) \
+ trees$(O)
+OBJP1 = adler32$(O)+compress$(O)+crc32$(O)+gzio$(O)+uncompr$(O)+deflate$(O)+\
+ trees$(O)
+OBJ2 = zutil$(O) inflate$(O) infblock$(O) inftrees$(O) infcodes$(O) \
+ infutil$(O) inffast$(O)
+OBJP2 = zutil$(O)+inflate$(O)+infblock$(O)+inftrees$(O)+infcodes$(O)+\
+ infutil$(O)+inffast$(O)
+
+all: zlib.lib example.exe minigzip.exe
+
+adler32.obj: adler32.c zlib.h zconf.h
+ $(CC) -c $(CFLAGS) $*.c
+
+compress.obj: compress.c zlib.h zconf.h
+ $(CC) -c $(CFLAGS) $*.c
+
+crc32.obj: crc32.c zlib.h zconf.h
+ $(CC) -c $(CFLAGS) $*.c
+
+deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h
+ $(CC) -c $(CFLAGS) $*.c
+
+gzio.obj: gzio.c zutil.h zlib.h zconf.h
+ $(CC) -c $(CFLAGS) $*.c
+
+infblock.obj: infblock.c zutil.h zlib.h zconf.h infblock.h inftrees.h\
+ infcodes.h infutil.h
+ $(CC) -c $(CFLAGS) $*.c
+
+infcodes.obj: infcodes.c zutil.h zlib.h zconf.h inftrees.h infutil.h\
+ infcodes.h inffast.h
+ $(CC) -c $(CFLAGS) $*.c
+
+inflate.obj: inflate.c zutil.h zlib.h zconf.h infblock.h
+ $(CC) -c $(CFLAGS) $*.c
+
+inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h
+ $(CC) -c $(CFLAGS) $*.c
+
+infutil.obj: infutil.c zutil.h zlib.h zconf.h inftrees.h infutil.h
+ $(CC) -c $(CFLAGS) $*.c
+
+inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h infutil.h inffast.h
+ $(CC) -c $(CFLAGS) $*.c
+
+trees.obj: trees.c deflate.h zutil.h zlib.h zconf.h
+ $(CC) -c $(CFLAGS) $*.c
+
+uncompr.obj: uncompr.c zlib.h zconf.h
+ $(CC) -c $(CFLAGS) $*.c
+
+zutil.obj: zutil.c zutil.h zlib.h zconf.h
+ $(CC) -c $(CFLAGS) $*.c
+
+example.obj: example.c zlib.h zconf.h
+ $(CC) -c $(CFLAGS) $*.c
+
+minigzip.obj: minigzip.c zlib.h zconf.h
+ $(CC) -c $(CFLAGS) $*.c
+
+zlib.lib: $(OBJ1) $(OBJ2)
+ if exist zlib.lib del zlib.lib
+ lib /OUT:zlib.lib $(OBJ1) $(OBJ2)
+
+example.exe: example.obj zlib.lib
+ $(LD) $(LDFLAGS) example.obj zlib.lib /OUT:example.exe /SUBSYSTEM:CONSOLE
+
+minigzip.exe: minigzip.obj zlib.lib
+ $(LD) $(LDFLAGS) minigzip.obj zlib.lib /OUT:minigzip.exe /SUBSYSTEM:CONSOLE
+
+test: example.exe minigzip.exe
+ example
+ echo hello world | minigzip | minigzip -d
+
+#clean:
+# del *.obj
+# del *.exe
diff --git a/gnu/usr.bin/cvs/zlib/msdos/Makefile.wat b/gnu/usr.bin/cvs/zlib/msdos/Makefile.wat
new file mode 100644
index 00000000000..44bf8607f6f
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/msdos/Makefile.wat
@@ -0,0 +1,103 @@
+# Makefile for zlib
+# Watcom 10a
+
+# This version of the zlib makefile was adapted by Chris Young for use
+# with Watcom 10a 32-bit protected mode flat memory model. It was created
+# for use with POV-Ray ray tracer and you may choose to edit the CFLAGS to
+# suit your needs but the -DMSDOS is required.
+# -- Chris Young 76702.1655@compuserve.com
+
+# To use, do "wmake -f makefile.wat"
+
+# See zconf.h for details about the memory requirements.
+
+# ------------- Watcom 10a -------------
+MODEL=-mf
+CFLAGS= $(MODEL) -fpi87 -fp5 -zp4 -5r -w5 -oneatx -DMSDOS
+CC=wcc386
+LD=wcl386
+LIB=wlib -b -c
+LDFLAGS=
+O=.obj
+
+# variables
+OBJ1=adler32$(O) compress$(O) crc32$(O) gzio$(O) uncompr$(O) deflate$(O)
+OBJ2=trees$(O) zutil$(O) inflate$(O) infblock$(O) inftrees$(O) infcodes$(O)
+OBJ3=infutil$(O) inffast$(O)
+OBJP1=adler32$(O)+compress$(O)+crc32$(O)+gzio$(O)+uncompr$(O)+deflate$(O)
+OBJP2=trees$(O)+zutil$(O)+inflate$(O)+infblock$(O)+inftrees$(O)+infcodes$(O)
+OBJP3=infutil$(O)+inffast$(O)
+
+all: test
+
+adler32.obj: adler32.c zlib.h zconf.h
+ $(CC) $(CFLAGS) $*.c
+
+compress.obj: compress.c zlib.h zconf.h
+ $(CC) $(CFLAGS) $*.c
+
+crc32.obj: crc32.c zlib.h zconf.h
+ $(CC) $(CFLAGS) $*.c
+
+deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h
+ $(CC) $(CFLAGS) $*.c
+
+gzio.obj: gzio.c zutil.h zlib.h zconf.h
+ $(CC) $(CFLAGS) $*.c
+
+infblock.obj: infblock.c zutil.h zlib.h zconf.h infblock.h inftrees.h &
+ infcodes.h infutil.h
+ $(CC) $(CFLAGS) $*.c
+
+infcodes.obj: infcodes.c zutil.h zlib.h zconf.h inftrees.h infutil.h &
+ infcodes.h inffast.h
+ $(CC) $(CFLAGS) $*.c
+
+inflate.obj: inflate.c zutil.h zlib.h zconf.h infblock.h
+ $(CC) $(CFLAGS) $*.c
+
+inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h
+ $(CC) $(CFLAGS) $*.c
+
+infutil.obj: infutil.c zutil.h zlib.h zconf.h inftrees.h infutil.h
+ $(CC) $(CFLAGS) $*.c
+
+inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h infutil.h inffast.h
+ $(CC) $(CFLAGS) $*.c
+
+trees.obj: trees.c deflate.h zutil.h zlib.h zconf.h
+ $(CC) $(CFLAGS) $*.c
+
+uncompr.obj: uncompr.c zlib.h zconf.h
+ $(CC) $(CFLAGS) $*.c
+
+zutil.obj: zutil.c zutil.h zlib.h zconf.h
+ $(CC) $(CFLAGS) $*.c
+
+example.obj: example.c zlib.h zconf.h
+ $(CC) $(CFLAGS) $*.c
+
+minigzip.obj: minigzip.c zlib.h zconf.h
+ $(CC) $(CFLAGS) $*.c
+
+# we must cut the command line to fit in the MS/DOS 128 byte limit:
+zlib.lib: $(OBJ1) $(OBJ2) $(OBJ3)
+ del zlib.lib
+ $(LIB) zlib.lib +$(OBJP1)
+ $(LIB) zlib.lib +$(OBJP2)
+ $(LIB) zlib.lib +$(OBJP3)
+
+example.exe: example.obj zlib.lib
+ $(LD) $(LDFLAGS) example.obj zlib.lib
+
+minigzip.exe: minigzip.obj zlib.lib
+ $(LD) $(LDFLAGS) minigzip.obj zlib.lib
+
+test: minigzip.exe example.exe
+ example
+ echo hello world | minigzip | minigzip -d >test
+ type test
+
+#clean:
+# del *.obj
+# del *.exe
diff --git a/gnu/usr.bin/cvs/zlib/msdos/zlib.def b/gnu/usr.bin/cvs/zlib/msdos/zlib.def
new file mode 100644
index 00000000000..6c04412f9b0
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/msdos/zlib.def
@@ -0,0 +1,60 @@
+LIBRARY "zlib"
+
+DESCRIPTION '"""zlib data compression library"""'
+
+EXETYPE NT
+
+SUBSYSTEM WINDOWS
+
+STUB 'WINSTUB.EXE'
+
+VERSION 1.13
+
+CODE EXECUTE READ
+
+DATA READ WRITE
+
+HEAPSIZE 1048576,4096
+
+EXPORTS
+ adler32 @1
+ compress @2
+ crc32 @3
+ deflate @4
+ deflateCopy @5
+ deflateEnd @6
+ deflateInit2_ @7
+ deflateInit_ @8
+ deflateParams @9
+ deflateReset @10
+ deflateSetDictionary @11
+ gzclose @12
+ gzdopen @13
+ gzerror @14
+ gzflush @15
+ gzopen @16
+ gzread @17
+ gzwrite @18
+ inflate @19
+ inflateEnd @20
+ inflateInit2_ @21
+ inflateInit_ @22
+ inflateReset @23
+ inflateSetDictionary @24
+ inflateSync @25
+ uncompress @26
+ zlibVersion @27
+ gzprintf @28
+ gzputc @29
+ gzgetc @30
+ gzseek @31
+ gzrewind @32
+ gztell @33
+ gzeof @34
+ gzsetparams @35
+ zError @36
+ inflateSyncPoint @37
+ get_crc_table @38
+ compress2 @39
+ gzputs @40
+ gzgets @41
diff --git a/gnu/usr.bin/cvs/zlib/msdos/zlib.rc b/gnu/usr.bin/cvs/zlib/msdos/zlib.rc
new file mode 100644
index 00000000000..556d4ff950a
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/msdos/zlib.rc
@@ -0,0 +1,32 @@
+#include <windows.h>
+
+#define IDR_VERSION1 1
+IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE
+ FILEVERSION 1,1,3,0
+ PRODUCTVERSION 1,1,3,0
+ FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
+ FILEFLAGS 0
+ FILEOS VOS_DOS_WINDOWS32
+ FILETYPE VFT_DLL
+ FILESUBTYPE 0 // not used
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904E4"
+ //language ID = U.S. English, char set = Windows, Multilingual
+
+ BEGIN
+ VALUE "FileDescription", "zlib data compression library\0"
+ VALUE "FileVersion", "1.1.3\0"
+ VALUE "InternalName", "zlib\0"
+ VALUE "OriginalFilename", "zlib.dll\0"
+ VALUE "ProductName", "ZLib.DLL\0"
+ VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0"
+ VALUE "LegalCopyright", "(C) 1995-1998 Jean-loup Gailly & Mark Adler\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x0409, 1252
+ END
+END
diff --git a/gnu/usr.bin/cvs/zlib/nt/Makefile.emx b/gnu/usr.bin/cvs/zlib/nt/Makefile.emx
new file mode 100644
index 00000000000..2d475b1847e
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/nt/Makefile.emx
@@ -0,0 +1,138 @@
+# Makefile for zlib. Modified for emx/rsxnt by Chr. Spieler, 6/16/98.
+# Copyright (C) 1995-1998 Jean-loup Gailly.
+# For conditions of distribution and use, see copyright notice in zlib.h
+
+# To compile, or to compile and test, type:
+#
+# make -fmakefile.emx; make test -fmakefile.emx
+#
+
+CC=gcc -Zwin32
+
+#CFLAGS=-MMD -O
+#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
+#CFLAGS=-MMD -g -DDEBUG
+CFLAGS=-MMD -O3 $(BUTT) -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
+ -Wstrict-prototypes -Wmissing-prototypes
+
+# If cp.exe is available, replace "copy /Y" with "cp -fp" .
+CP=copy /Y
+# If gnu install.exe is available, replace $(CP) with ginstall.
+INSTALL=$(CP)
+# The default value of RM is "rm -f." If "rm.exe" is found, comment out:
+RM=del
+LDLIBS=-L. -lzlib
+LD=$(CC) -s -o
+LDSHARED=$(CC)
+
+INCL=zlib.h zconf.h
+LIBS=zlib.a
+
+AR=ar rcs
+
+prefix=/usr/local
+exec_prefix = $(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
+
+TEST_OBJS = example.o minigzip.o
+
+all: example.exe minigzip.exe
+
+test: all
+ ./example
+ echo hello world | .\minigzip | .\minigzip -d
+
+%.o : %.c
+ $(CC) $(CFLAGS) -c $< -o $@
+
+zlib.a: $(OBJS)
+ $(AR) $@ $(OBJS)
+
+%.exe : %.o $(LIBS)
+ $(LD) $@ $< $(LDLIBS)
+
+
+.PHONY : clean
+
+clean:
+ $(RM) *.d
+ $(RM) *.o
+ $(RM) *.exe
+ $(RM) zlib.a
+ $(RM) foo.gz
+
+DEPS := $(wildcard *.d)
+ifneq ($(DEPS),)
+include $(DEPS)
+endif
+# Makefile for zlib. Modified for emx 0.9c by Chr. Spieler, 6/17/98.
+# Copyright (C) 1995-1998 Jean-loup Gailly.
+# For conditions of distribution and use, see copyright notice in zlib.h
+
+# To compile, or to compile and test, type:
+#
+# make -fmakefile.emx; make test -fmakefile.emx
+#
+
+CC=gcc
+
+#CFLAGS=-MMD -O
+#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
+#CFLAGS=-MMD -g -DDEBUG
+CFLAGS=-MMD -O3 $(BUTT) -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
+ -Wstrict-prototypes -Wmissing-prototypes
+
+# If cp.exe is available, replace "copy /Y" with "cp -fp" .
+CP=copy /Y
+# If gnu install.exe is available, replace $(CP) with ginstall.
+INSTALL=$(CP)
+# The default value of RM is "rm -f." If "rm.exe" is found, comment out:
+RM=del
+LDLIBS=-L. -lzlib
+LD=$(CC) -s -o
+LDSHARED=$(CC)
+
+INCL=zlib.h zconf.h
+LIBS=zlib.a
+
+AR=ar rcs
+
+prefix=/usr/local
+exec_prefix = $(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
+
+TEST_OBJS = example.o minigzip.o
+
+all: example.exe minigzip.exe
+
+test: all
+ ./example
+ echo hello world | .\minigzip | .\minigzip -d
+
+%.o : %.c
+ $(CC) $(CFLAGS) -c $< -o $@
+
+zlib.a: $(OBJS)
+ $(AR) $@ $(OBJS)
+
+%.exe : %.o $(LIBS)
+ $(LD) $@ $< $(LDLIBS)
+
+
+.PHONY : clean
+
+clean:
+ $(RM) *.d
+ $(RM) *.o
+ $(RM) *.exe
+ $(RM) zlib.a
+ $(RM) foo.gz
+
+DEPS := $(wildcard *.d)
+ifneq ($(DEPS),)
+include $(DEPS)
+endif
diff --git a/gnu/usr.bin/cvs/zlib/nt/Makefile.gcc b/gnu/usr.bin/cvs/zlib/nt/Makefile.gcc
new file mode 100644
index 00000000000..cdd652f2360
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/nt/Makefile.gcc
@@ -0,0 +1,87 @@
+# Makefile for zlib. Modified for mingw32 by C. Spieler, 6/16/98.
+# (This Makefile is directly derived from Makefile.dj2)
+# Copyright (C) 1995-1998 Jean-loup Gailly.
+# For conditions of distribution and use, see copyright notice in zlib.h
+
+# To compile, or to compile and test, type:
+#
+# make -fmakefile.gcc; make test -fmakefile.gcc
+#
+# To install libz.a, zconf.h and zlib.h in the mingw32 directories, type:
+#
+# make install -fmakefile.gcc
+#
+
+CC=gcc
+
+#CFLAGS=-MMD -O
+#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
+#CFLAGS=-MMD -g -DDEBUG
+CFLAGS=-MMD -O3 $(BUTT) -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
+ -Wstrict-prototypes -Wmissing-prototypes
+
+# If cp.exe is available, replace "copy /Y" with "cp -fp" .
+CP=copy /Y
+# If gnu install.exe is available, replace $(CP) with ginstall.
+INSTALL=$(CP)
+# The default value of RM is "rm -f." If "rm.exe" is found, comment out:
+RM=del
+LDLIBS=-L. -lz
+LD=$(CC) -s -o
+LDSHARED=$(CC)
+
+INCL=zlib.h zconf.h
+LIBS=libz.a
+
+AR=ar rcs
+
+prefix=/usr/local
+exec_prefix = $(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
+
+TEST_OBJS = example.o minigzip.o
+
+all: example.exe minigzip.exe
+
+test: all
+ ./example
+ echo hello world | .\minigzip | .\minigzip -d
+
+%.o : %.c
+ $(CC) $(CFLAGS) -c $< -o $@
+
+libz.a: $(OBJS)
+ $(AR) $@ $(OBJS)
+
+%.exe : %.o $(LIBS)
+ $(LD) $@ $< $(LDLIBS)
+
+# INCLUDE_PATH and LIBRARY_PATH were set for [make] in djgpp.env .
+
+.PHONY : uninstall clean
+
+install: $(INCL) $(LIBS)
+ -@if not exist $(INCLUDE_PATH)\nul mkdir $(INCLUDE_PATH)
+ -@if not exist $(LIBRARY_PATH)\nul mkdir $(LIBRARY_PATH)
+ $(INSTALL) zlib.h $(INCLUDE_PATH)
+ $(INSTALL) zconf.h $(INCLUDE_PATH)
+ $(INSTALL) libz.a $(LIBRARY_PATH)
+
+uninstall:
+ $(RM) $(INCLUDE_PATH)\zlib.h
+ $(RM) $(INCLUDE_PATH)\zconf.h
+ $(RM) $(LIBRARY_PATH)\libz.a
+
+clean:
+ $(RM) *.d
+ $(RM) *.o
+ $(RM) *.exe
+ $(RM) libz.a
+ $(RM) foo.gz
+
+DEPS := $(wildcard *.d)
+ifneq ($(DEPS),)
+include $(DEPS)
+endif
diff --git a/gnu/usr.bin/cvs/zlib/nt/Makefile.nt b/gnu/usr.bin/cvs/zlib/nt/Makefile.nt
new file mode 100644
index 00000000000..b250f2ac7d2
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/nt/Makefile.nt
@@ -0,0 +1,88 @@
+# Makefile for zlib
+
+!include <ntwin32.mak>
+
+CC=cl
+LD=link
+CFLAGS=-O -nologo
+LDFLAGS=
+O=.obj
+
+# variables
+OBJ1 = adler32$(O) compress$(O) crc32$(O) gzio$(O) uncompr$(O) deflate$(O) \
+ trees$(O)
+OBJ2 = zutil$(O) inflate$(O) infblock$(O) inftrees$(O) infcodes$(O) \
+ infutil$(O) inffast$(O)
+
+all: zlib.dll example.exe minigzip.exe
+
+adler32.obj: adler32.c zutil.h zlib.h zconf.h
+ $(CC) -c $(cvarsdll) $(CFLAGS) $*.c
+
+compress.obj: compress.c zlib.h zconf.h
+ $(CC) -c $(cvarsdll) $(CFLAGS) $*.c
+
+crc32.obj: crc32.c zutil.h zlib.h zconf.h
+ $(CC) -c $(cvarsdll) $(CFLAGS) $*.c
+
+deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h
+ $(CC) -c $(cvarsdll) $(CFLAGS) $*.c
+
+gzio.obj: gzio.c zutil.h zlib.h zconf.h
+ $(CC) -c $(cvarsdll) $(CFLAGS) $*.c
+
+infblock.obj: infblock.c zutil.h zlib.h zconf.h infblock.h inftrees.h\
+ infcodes.h infutil.h
+ $(CC) -c $(cvarsdll) $(CFLAGS) $*.c
+
+infcodes.obj: infcodes.c zutil.h zlib.h zconf.h inftrees.h infutil.h\
+ infcodes.h inffast.h
+ $(CC) -c $(cvarsdll) $(CFLAGS) $*.c
+
+inflate.obj: inflate.c zutil.h zlib.h zconf.h infblock.h
+ $(CC) -c $(cvarsdll) $(CFLAGS) $*.c
+
+inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h
+ $(CC) -c $(cvarsdll) $(CFLAGS) $*.c
+
+infutil.obj: infutil.c zutil.h zlib.h zconf.h inftrees.h infutil.h
+ $(CC) -c $(cvarsdll) $(CFLAGS) $*.c
+
+inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h infutil.h inffast.h
+ $(CC) -c $(cvarsdll) $(CFLAGS) $*.c
+
+trees.obj: trees.c deflate.h zutil.h zlib.h zconf.h
+ $(CC) -c $(cvarsdll) $(CFLAGS) $*.c
+
+uncompr.obj: uncompr.c zlib.h zconf.h
+ $(CC) -c $(cvarsdll) $(CFLAGS) $*.c
+
+zutil.obj: zutil.c zutil.h zlib.h zconf.h
+ $(CC) -c $(cvarsdll) $(CFLAGS) $*.c
+
+example.obj: example.c zlib.h zconf.h
+ $(CC) -c $(cvarsdll) $(CFLAGS) $*.c
+
+minigzip.obj: minigzip.c zlib.h zconf.h
+ $(CC) -c $(cvarsdll) $(CFLAGS) $*.c
+
+zlib.dll: $(OBJ1) $(OBJ2) zlib.dnt
+ link $(dlllflags) -out:$@ -def:zlib.dnt $(OBJ1) $(OBJ2) $(guilibsdll)
+
+zlib.lib: zlib.dll
+
+example.exe: example.obj zlib.lib
+ $(LD) $(LDFLAGS) example.obj zlib.lib
+
+minigzip.exe: minigzip.obj zlib.lib
+ $(LD) $(LDFLAGS) minigzip.obj zlib.lib
+
+test: example.exe minigzip.exe
+ example
+ echo hello world | minigzip | minigzip -d
+
+clean:
+ del *.obj
+ del *.exe
+ del *.dll
+ del *.lib
diff --git a/gnu/usr.bin/cvs/zlib/nt/zlib.dnt b/gnu/usr.bin/cvs/zlib/nt/zlib.dnt
new file mode 100644
index 00000000000..7f9475cfb0e
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/nt/zlib.dnt
@@ -0,0 +1,47 @@
+LIBRARY zlib.dll
+EXETYPE WINDOWS
+CODE PRELOAD MOVEABLE DISCARDABLE
+DATA PRELOAD MOVEABLE MULTIPLE
+
+EXPORTS
+ adler32 @1
+ compress @2
+ crc32 @3
+ deflate @4
+ deflateCopy @5
+ deflateEnd @6
+ deflateInit2_ @7
+ deflateInit_ @8
+ deflateParams @9
+ deflateReset @10
+ deflateSetDictionary @11
+ gzclose @12
+ gzdopen @13
+ gzerror @14
+ gzflush @15
+ gzopen @16
+ gzread @17
+ gzwrite @18
+ inflate @19
+ inflateEnd @20
+ inflateInit2_ @21
+ inflateInit_ @22
+ inflateReset @23
+ inflateSetDictionary @24
+ inflateSync @25
+ uncompress @26
+ zlibVersion @27
+ gzprintf @28
+ gzputc @29
+ gzgetc @30
+ gzseek @31
+ gzrewind @32
+ gztell @33
+ gzeof @34
+ gzsetparams @35
+ zError @36
+ inflateSyncPoint @37
+ get_crc_table @38
+ compress2 @39
+ gzputs @40
+ gzgets @41
diff --git a/gnu/usr.bin/cvs/zlib/os2/Makefile.os2 b/gnu/usr.bin/cvs/zlib/os2/Makefile.os2
new file mode 100644
index 00000000000..4f569471eca
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/os2/Makefile.os2
@@ -0,0 +1,136 @@
+# Makefile for zlib under OS/2 using GCC (PGCC)
+# For conditions of distribution and use, see copyright notice in zlib.h
+
+# To compile and test, type:
+# cp Makefile.os2 ..
+# cd ..
+# make -f Makefile.os2 test
+
+# This makefile will build a static library z.lib, a shared library
+# z.dll and a import library zdll.lib. You can use either z.lib or
+# zdll.lib by specifying either -lz or -lzdll on gcc's command line
+
+CC=gcc -Zomf -s
+
+CFLAGS=-O6 -Wall
+#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
+#CFLAGS=-g -DDEBUG
+#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
+# -Wstrict-prototypes -Wmissing-prototypes
+
+#################### BUG WARNING: #####################
+## infcodes.c hits a bug in pgcc-1.0, so you have to use either
+## -O# where # <= 4 or one of (-fno-ommit-frame-pointer or -fno-force-mem)
+## This bug is reportedly fixed in pgcc >1.0, but this was not tested
+CFLAGS+=-fno-force-mem
+
+LDFLAGS=-s -L. -lzdll -Zcrtdll
+LDSHARED=$(CC) -s -Zomf -Zdll -Zcrtdll
+
+VER=1.1.0
+ZLIB=z.lib
+SHAREDLIB=z.dll
+SHAREDLIBIMP=zdll.lib
+LIBS=$(ZLIB) $(SHAREDLIB) $(SHAREDLIBIMP)
+
+AR=emxomfar cr
+IMPLIB=emximp
+RANLIB=echo
+TAR=tar
+SHELL=bash
+
+prefix=/usr/local
+exec_prefix = $(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
+
+TEST_OBJS = example.o minigzip.o
+
+DISTFILES = README INDEX ChangeLog configure Make*[a-z0-9] *.[ch] descrip.mms \
+ algorithm.txt zlib.3 msdos/Make*[a-z0-9] msdos/zlib.def msdos/zlib.rc \
+ nt/Makefile.nt nt/zlib.dnt contrib/README.contrib contrib/*.txt \
+ contrib/asm386/*.asm contrib/asm386/*.c \
+ contrib/asm386/*.bat contrib/asm386/zlibvc.d?? contrib/iostream/*.cpp \
+ contrib/iostream/*.h contrib/iostream2/*.h contrib/iostream2/*.cpp \
+ contrib/untgz/Makefile contrib/untgz/*.c contrib/untgz/*.w32
+
+all: example.exe minigzip.exe
+
+test: all
+ @LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
+ echo hello world | ./minigzip | ./minigzip -d || \
+ echo ' *** minigzip test FAILED ***' ; \
+ if ./example; then \
+ echo ' *** zlib test OK ***'; \
+ else \
+ echo ' *** zlib test FAILED ***'; \
+ fi
+
+$(ZLIB): $(OBJS)
+ $(AR) $@ $(OBJS)
+ -@ ($(RANLIB) $@ || true) >/dev/null 2>&1
+
+$(SHAREDLIB): $(OBJS) os2/z.def
+ $(LDSHARED) -o $@ $^
+
+$(SHAREDLIBIMP): os2/z.def
+ $(IMPLIB) -o $@ $^
+
+example.exe: example.o $(LIBS)
+ $(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS)
+
+minigzip.exe: minigzip.o $(LIBS)
+ $(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS)
+
+clean:
+ rm -f *.o *~ example minigzip libz.a libz.so* foo.gz
+
+distclean: clean
+
+zip:
+ mv Makefile Makefile~; cp -p Makefile.in Makefile
+ rm -f test.c ztest*.c
+ v=`sed -n -e 's/\.//g' -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
+ zip -ul9 zlib$$v $(DISTFILES)
+ mv Makefile~ Makefile
+
+dist:
+ mv Makefile Makefile~; cp -p Makefile.in Makefile
+ rm -f test.c ztest*.c
+ d=zlib-`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
+ rm -f $$d.tar.gz; \
+ if test ! -d ../$$d; then rm -f ../$$d; ln -s `pwd` ../$$d; fi; \
+ files=""; \
+ for f in $(DISTFILES); do files="$$files $$d/$$f"; done; \
+ cd ..; \
+ GZIP=-9 $(TAR) chofz $$d/$$d.tar.gz $$files; \
+ if test ! -d $$d; then rm -f $$d; fi
+ mv Makefile~ Makefile
+
+tags:
+ etags *.[ch]
+
+depend:
+ makedepend -- $(CFLAGS) -- *.[ch]
+
+# DO NOT DELETE THIS LINE -- make depend depends on it.
+
+adler32.o: zlib.h zconf.h
+compress.o: zlib.h zconf.h
+crc32.o: zlib.h zconf.h
+deflate.o: deflate.h zutil.h zlib.h zconf.h
+example.o: zlib.h zconf.h
+gzio.o: zutil.h zlib.h zconf.h
+infblock.o: infblock.h inftrees.h infcodes.h infutil.h zutil.h zlib.h zconf.h
+infcodes.o: zutil.h zlib.h zconf.h
+infcodes.o: inftrees.h infblock.h infcodes.h infutil.h inffast.h
+inffast.o: zutil.h zlib.h zconf.h inftrees.h
+inffast.o: infblock.h infcodes.h infutil.h inffast.h
+inflate.o: zutil.h zlib.h zconf.h infblock.h
+inftrees.o: zutil.h zlib.h zconf.h inftrees.h
+infutil.o: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h
+minigzip.o: zlib.h zconf.h
+trees.o: deflate.h zutil.h zlib.h zconf.h trees.h
+uncompr.o: zlib.h zconf.h
+zutil.o: zutil.h zlib.h zconf.h
diff --git a/gnu/usr.bin/cvs/zlib/os2/zlib.def b/gnu/usr.bin/cvs/zlib/os2/zlib.def
new file mode 100644
index 00000000000..4c753f1a3b9
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/os2/zlib.def
@@ -0,0 +1,51 @@
+;
+; Slightly modified version of ../nt/zlib.dnt :-)
+;
+
+LIBRARY Z
+DESCRIPTION "Zlib compression library for OS/2"
+CODE PRELOAD MOVEABLE DISCARDABLE
+DATA PRELOAD MOVEABLE MULTIPLE
+
+EXPORTS
+ adler32
+ compress
+ crc32
+ deflate
+ deflateCopy
+ deflateEnd
+ deflateInit2_
+ deflateInit_
+ deflateParams
+ deflateReset
+ deflateSetDictionary
+ gzclose
+ gzdopen
+ gzerror
+ gzflush
+ gzopen
+ gzread
+ gzwrite
+ inflate
+ inflateEnd
+ inflateInit2_
+ inflateInit_
+ inflateReset
+ inflateSetDictionary
+ inflateSync
+ uncompress
+ zlibVersion
+ gzprintf
+ gzputc
+ gzgetc
+ gzseek
+ gzrewind
+ gztell
+ gzeof
+ gzsetparams
+ zError
+ inflateSyncPoint
+ get_crc_table
+ compress2
+ gzputs
+ gzgets
diff --git a/gnu/usr.bin/cvs/zlib/trees.c b/gnu/usr.bin/cvs/zlib/trees.c
index 76cc62c8e38..3667a68d150 100644
--- a/gnu/usr.bin/cvs/zlib/trees.c
+++ b/gnu/usr.bin/cvs/zlib/trees.c
@@ -1,5 +1,5 @@
/* trees.c -- output deflated data using Huffman coding
- * Copyright (C) 1995-1996 Jean-loup Gailly
+ * Copyright (C) 1995-1998 Jean-loup Gailly
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -29,7 +29,9 @@
* Addison-Wesley, 1983. ISBN 0-201-06672-6.
*/
-/* $Id: trees.c,v 1.1.1.1 1996/10/18 03:35:05 tholo Exp $ */
+/* @(#) $Id: trees.c,v 1.1.1.2 2001/09/28 22:45:40 tholo Exp $ */
+
+/* #define GEN_TREES_H */
#include "deflate.h"
@@ -56,16 +58,16 @@
#define REPZ_11_138 18
/* repeat a zero length 11-138 times (7 bits of repeat count) */
-local int extra_lbits[LENGTH_CODES] /* extra bits for each length code */
+local const int extra_lbits[LENGTH_CODES] /* extra bits for each length code */
= {0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0};
-local int extra_dbits[D_CODES] /* extra bits for each distance code */
+local const int extra_dbits[D_CODES] /* extra bits for each distance code */
= {0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13};
-local int extra_blbits[BL_CODES]/* extra bits for each bit length code */
+local const int extra_blbits[BL_CODES]/* extra bits for each bit length code */
= {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7};
-local uch bl_order[BL_CODES]
+local const uch bl_order[BL_CODES]
= {16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15};
/* The lengths of the bit length codes are sent in order of decreasing
* probability, to avoid transmitting the lengths for unused bit length codes.
@@ -80,6 +82,11 @@ local uch bl_order[BL_CODES]
* Local data. These are initialized only once.
*/
+#define DIST_CODE_LEN 512 /* see definition of array dist_code below */
+
+#if defined(GEN_TREES_H) || !defined(STDC)
+/* non ANSI compilers may not accept trees.h */
+
local ct_data static_ltree[L_CODES+2];
/* The static literal tree. Since the bit lengths are imposed, there is no
* need for the L_CODES extra codes used during heap construction. However
@@ -92,13 +99,13 @@ local ct_data static_dtree[D_CODES];
* 5 bits.)
*/
-local uch dist_code[512];
-/* distance codes. The first 256 values correspond to the distances
+uch _dist_code[DIST_CODE_LEN];
+/* Distance codes. The first 256 values correspond to the distances
* 3 .. 258, the last 256 values correspond to the top 8 bits of
* the 15 bit distances.
*/
-local uch length_code[MAX_MATCH-MIN_MATCH+1];
+uch _length_code[MAX_MATCH-MIN_MATCH+1];
/* length code for each normalized match length (0 == MIN_MATCH) */
local int base_length[LENGTH_CODES];
@@ -107,9 +114,13 @@ local int base_length[LENGTH_CODES];
local int base_dist[D_CODES];
/* First normalized distance for each code (0 = distance of 1) */
+#else
+# include "trees.h"
+#endif /* GEN_TREES_H */
+
struct static_tree_desc_s {
- ct_data *static_tree; /* static tree or NULL */
- intf *extra_bits; /* extra bits for each code or NULL */
+ const ct_data *static_tree; /* static tree or NULL */
+ const intf *extra_bits; /* extra bits for each code or NULL */
int extra_base; /* base index for extra_bits */
int elems; /* max number of elements in the tree */
int max_length; /* max bit length for the codes */
@@ -122,7 +133,7 @@ local static_tree_desc static_d_desc =
{static_dtree, extra_dbits, 0, D_CODES, MAX_BITS};
local static_tree_desc static_bl_desc =
-{(ct_data *)0, extra_blbits, 0, BL_CODES, MAX_BL_BITS};
+{(const ct_data *)0, extra_blbits, 0, BL_CODES, MAX_BL_BITS};
/* ===========================================================================
* Local (static) routines in this file.
@@ -148,23 +159,20 @@ local void bi_flush OF((deflate_state *s));
local void copy_block OF((deflate_state *s, charf *buf, unsigned len,
int header));
+#ifdef GEN_TREES_H
+local void gen_trees_header OF((void));
+#endif
+
#ifndef DEBUG
# define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
/* Send a code of the given tree. c and tree must not have side effects */
#else /* DEBUG */
# define send_code(s, c, tree) \
- { if (verbose>2) fprintf(stderr,"\ncd %3d ",(c)); \
+ { if (z_verbose>2) fprintf(stderr,"\ncd %3d ",(c)); \
send_bits(s, tree[c].Code, tree[c].Len); }
#endif
-#define d_code(dist) \
- ((dist) < 256 ? dist_code[dist] : dist_code[256+((dist)>>7)])
-/* Mapping from a distance to a distance code. dist is the distance - 1 and
- * must not have side effects. dist_code[256] and dist_code[257] are never
- * used.
- */
-
/* ===========================================================================
* Output a short LSB first on the stream.
* IN assertion: there is enough room in pendingBuf.
@@ -226,12 +234,11 @@ local void send_bits(s, value, length)
/* the arguments must not have side effects */
/* ===========================================================================
- * Initialize the various 'constant' tables. In a multi-threaded environment,
- * this function may be called by two threads concurrently, but this is
- * harmless since both invocations do exactly the same thing.
+ * Initialize the various 'constant' tables.
*/
local void tr_static_init()
{
+#if defined(GEN_TREES_H) || !defined(STDC)
static int static_init_done = 0;
int n; /* iterates over tree elements */
int bits; /* bit counter */
@@ -243,12 +250,19 @@ local void tr_static_init()
if (static_init_done) return;
+ /* For some embedded targets, global variables are not initialized: */
+ static_l_desc.static_tree = static_ltree;
+ static_l_desc.extra_bits = extra_lbits;
+ static_d_desc.static_tree = static_dtree;
+ static_d_desc.extra_bits = extra_dbits;
+ static_bl_desc.extra_bits = extra_blbits;
+
/* Initialize the mapping length (0..255) -> length code (0..28) */
length = 0;
for (code = 0; code < LENGTH_CODES-1; code++) {
base_length[code] = length;
for (n = 0; n < (1<<extra_lbits[code]); n++) {
- length_code[length++] = (uch)code;
+ _length_code[length++] = (uch)code;
}
}
Assert (length == 256, "tr_static_init: length != 256");
@@ -256,14 +270,14 @@ local void tr_static_init()
* in two different ways: code 284 + 5 bits or code 285, so we
* overwrite length_code[255] to use the best encoding:
*/
- length_code[length-1] = (uch)code;
+ _length_code[length-1] = (uch)code;
/* Initialize the mapping dist (0..32K) -> dist code (0..29) */
dist = 0;
for (code = 0 ; code < 16; code++) {
base_dist[code] = dist;
for (n = 0; n < (1<<extra_dbits[code]); n++) {
- dist_code[dist++] = (uch)code;
+ _dist_code[dist++] = (uch)code;
}
}
Assert (dist == 256, "tr_static_init: dist != 256");
@@ -271,7 +285,7 @@ local void tr_static_init()
for ( ; code < D_CODES; code++) {
base_dist[code] = dist << 7;
for (n = 0; n < (1<<(extra_dbits[code]-7)); n++) {
- dist_code[256 + dist++] = (uch)code;
+ _dist_code[256 + dist++] = (uch)code;
}
}
Assert (dist == 256, "tr_static_init: 256+dist != 512");
@@ -295,9 +309,75 @@ local void tr_static_init()
static_dtree[n].Code = bi_reverse((unsigned)n, 5);
}
static_init_done = 1;
+
+# ifdef GEN_TREES_H
+ gen_trees_header();
+# endif
+#endif /* defined(GEN_TREES_H) || !defined(STDC) */
}
/* ===========================================================================
+ * Genererate the file trees.h describing the static trees.
+ */
+#ifdef GEN_TREES_H
+# ifndef DEBUG
+# include <stdio.h>
+# endif
+
+# define SEPARATOR(i, last, width) \
+ ((i) == (last)? "\n};\n\n" : \
+ ((i) % (width) == (width)-1 ? ",\n" : ", "))
+
+void gen_trees_header()
+{
+ FILE *header = fopen("trees.h", "w");
+ int i;
+
+ Assert (header != NULL, "Can't open trees.h");
+ fprintf(header,
+ "/* header created automatically with -DGEN_TREES_H */\n\n");
+
+ fprintf(header, "local const ct_data static_ltree[L_CODES+2] = {\n");
+ for (i = 0; i < L_CODES+2; i++) {
+ fprintf(header, "{{%3u},{%3u}}%s", static_ltree[i].Code,
+ static_ltree[i].Len, SEPARATOR(i, L_CODES+1, 5));
+ }
+
+ fprintf(header, "local const ct_data static_dtree[D_CODES] = {\n");
+ for (i = 0; i < D_CODES; i++) {
+ fprintf(header, "{{%2u},{%2u}}%s", static_dtree[i].Code,
+ static_dtree[i].Len, SEPARATOR(i, D_CODES-1, 5));
+ }
+
+ fprintf(header, "const uch _dist_code[DIST_CODE_LEN] = {\n");
+ for (i = 0; i < DIST_CODE_LEN; i++) {
+ fprintf(header, "%2u%s", _dist_code[i],
+ SEPARATOR(i, DIST_CODE_LEN-1, 20));
+ }
+
+ fprintf(header, "const uch _length_code[MAX_MATCH-MIN_MATCH+1]= {\n");
+ for (i = 0; i < MAX_MATCH-MIN_MATCH+1; i++) {
+ fprintf(header, "%2u%s", _length_code[i],
+ SEPARATOR(i, MAX_MATCH-MIN_MATCH, 20));
+ }
+
+ fprintf(header, "local const int base_length[LENGTH_CODES] = {\n");
+ for (i = 0; i < LENGTH_CODES; i++) {
+ fprintf(header, "%1u%s", base_length[i],
+ SEPARATOR(i, LENGTH_CODES-1, 20));
+ }
+
+ fprintf(header, "local const int base_dist[D_CODES] = {\n");
+ for (i = 0; i < D_CODES; i++) {
+ fprintf(header, "%5u%s", base_dist[i],
+ SEPARATOR(i, D_CODES-1, 10));
+ }
+
+ fclose(header);
+}
+#endif /* GEN_TREES_H */
+
+/* ===========================================================================
* Initialize the tree data structures for a new zlib stream.
*/
void _tr_init(s)
@@ -305,8 +385,6 @@ void _tr_init(s)
{
tr_static_init();
- s->compressed_len = 0L;
-
s->l_desc.dyn_tree = s->dyn_ltree;
s->l_desc.stat_desc = &static_l_desc;
@@ -320,6 +398,7 @@ void _tr_init(s)
s->bi_valid = 0;
s->last_eob_len = 8; /* enough lookahead for inflate */
#ifdef DEBUG
+ s->compressed_len = 0L;
s->bits_sent = 0L;
#endif
@@ -413,12 +492,12 @@ local void gen_bitlen(s, desc)
deflate_state *s;
tree_desc *desc; /* the tree descriptor */
{
- ct_data *tree = desc->dyn_tree;
- int max_code = desc->max_code;
- ct_data *stree = desc->stat_desc->static_tree;
- intf *extra = desc->stat_desc->extra_bits;
- int base = desc->stat_desc->extra_base;
- int max_length = desc->stat_desc->max_length;
+ ct_data *tree = desc->dyn_tree;
+ int max_code = desc->max_code;
+ const ct_data *stree = desc->stat_desc->static_tree;
+ const intf *extra = desc->stat_desc->extra_bits;
+ int base = desc->stat_desc->extra_base;
+ int max_length = desc->stat_desc->max_length;
int h; /* heap index */
int n, m; /* iterate over the tree elements */
int bits; /* bit length */
@@ -542,9 +621,9 @@ local void build_tree(s, desc)
deflate_state *s;
tree_desc *desc; /* the tree descriptor */
{
- ct_data *tree = desc->dyn_tree;
- ct_data *stree = desc->stat_desc->static_tree;
- int elems = desc->stat_desc->elems;
+ ct_data *tree = desc->dyn_tree;
+ const ct_data *stree = desc->stat_desc->static_tree;
+ int elems = desc->stat_desc->elems;
int n, m; /* iterate over heap elements */
int max_code = -1; /* largest code with non zero frequency */
int node; /* new node being created */
@@ -792,9 +871,10 @@ void _tr_stored_block(s, buf, stored_len, eof)
int eof; /* true if this is the last block for a file */
{
send_bits(s, (STORED_BLOCK<<1)+eof, 3); /* send block type */
+#ifdef DEBUG
s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L;
s->compressed_len += (stored_len + 4) << 3;
-
+#endif
copy_block(s, buf, (unsigned)stored_len, 1); /* with header */
}
@@ -814,7 +894,9 @@ void _tr_align(s)
{
send_bits(s, STATIC_TREES<<1, 3);
send_code(s, END_BLOCK, static_ltree);
+#ifdef DEBUG
s->compressed_len += 10L; /* 3 for block type, 7 for EOB */
+#endif
bi_flush(s);
/* Of the 10 bits for the empty block, we have already sent
* (10 - bi_valid) bits. The lookahead for the last real code (before
@@ -824,7 +906,9 @@ void _tr_align(s)
if (1 + s->last_eob_len + 10 - s->bi_valid < 9) {
send_bits(s, STATIC_TREES<<1, 3);
send_code(s, END_BLOCK, static_ltree);
+#ifdef DEBUG
s->compressed_len += 10L;
+#endif
bi_flush(s);
}
s->last_eob_len = 7;
@@ -832,10 +916,9 @@ void _tr_align(s)
/* ===========================================================================
* Determine the best encoding for the current block: dynamic trees, static
- * trees or store, and output the encoded block to the zip file. This function
- * returns the total compressed length for the file so far.
+ * trees or store, and output the encoded block to the zip file.
*/
-ulg _tr_flush_block(s, buf, stored_len, eof)
+void _tr_flush_block(s, buf, stored_len, eof)
deflate_state *s;
charf *buf; /* input block, or NULL if too old */
ulg stored_len; /* length of input block */
@@ -882,25 +965,6 @@ ulg _tr_flush_block(s, buf, stored_len, eof)
opt_lenb = static_lenb = stored_len + 5; /* force a stored block */
}
- /* If compression failed and this is the first and last block,
- * and if the .zip file can be seeked (to rewrite the local header),
- * the whole file is transformed into a stored file:
- */
-#ifdef STORED_FILE_OK
-# ifdef FORCE_STORED_FILE
- if (eof && s->compressed_len == 0L) { /* force stored file */
-# else
- if (stored_len <= opt_lenb && eof && s->compressed_len==0L && seekable()) {
-# endif
- /* Since LIT_BUFSIZE <= 2*WSIZE, the input data must be there: */
- if (buf == (charf*)0) error ("block vanished");
-
- copy_block(buf, (unsigned)stored_len, 0); /* without header */
- s->compressed_len = stored_len << 3;
- s->method = STORED;
- } else
-#endif /* STORED_FILE_OK */
-
#ifdef FORCE_STORED
if (buf != (char*)0) { /* force stored block */
#else
@@ -922,25 +986,32 @@ ulg _tr_flush_block(s, buf, stored_len, eof)
#endif
send_bits(s, (STATIC_TREES<<1)+eof, 3);
compress_block(s, (ct_data *)static_ltree, (ct_data *)static_dtree);
+#ifdef DEBUG
s->compressed_len += 3 + s->static_len;
+#endif
} else {
send_bits(s, (DYN_TREES<<1)+eof, 3);
send_all_trees(s, s->l_desc.max_code+1, s->d_desc.max_code+1,
max_blindex+1);
compress_block(s, (ct_data *)s->dyn_ltree, (ct_data *)s->dyn_dtree);
+#ifdef DEBUG
s->compressed_len += 3 + s->opt_len;
+#endif
}
Assert (s->compressed_len == s->bits_sent, "bad compressed size");
+ /* The above check is made mod 2^32, for files larger than 512 MB
+ * and uLong implemented on 32 bits.
+ */
init_block(s);
if (eof) {
bi_windup(s);
+#ifdef DEBUG
s->compressed_len += 7; /* align on byte boundary */
+#endif
}
Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3,
s->compressed_len-7*eof));
-
- return s->compressed_len >> 3;
}
/* ===========================================================================
@@ -965,12 +1036,13 @@ int _tr_tally (s, dist, lc)
(ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&
(ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match");
- s->dyn_ltree[length_code[lc]+LITERALS+1].Freq++;
+ s->dyn_ltree[_length_code[lc]+LITERALS+1].Freq++;
s->dyn_dtree[d_code(dist)].Freq++;
}
+#ifdef TRUNCATE_BLOCK
/* Try to guess if it is profitable to stop the current block here */
- if (s->level > 2 && (s->last_lit & 0xfff) == 0) {
+ if ((s->last_lit & 0x1fff) == 0 && s->level > 2) {
/* Compute an upper bound for the compressed length */
ulg out_length = (ulg)s->last_lit*8L;
ulg in_length = (ulg)((long)s->strstart - s->block_start);
@@ -985,6 +1057,7 @@ int _tr_tally (s, dist, lc)
100L - out_length*100L/in_length));
if (s->matches < s->last_lit/2 && out_length < in_length/2) return 1;
}
+#endif
return (s->last_lit == s->lit_bufsize-1);
/* We avoid equality with lit_bufsize because of wraparound at 64K
* on 16 bit machines and because stored blocks are restricted to
@@ -1014,7 +1087,7 @@ local void compress_block(s, ltree, dtree)
Tracecv(isgraph(lc), (stderr," '%c' ", lc));
} else {
/* Here, lc is the match length - MIN_MATCH */
- code = length_code[lc];
+ code = _length_code[lc];
send_code(s, code+LITERALS+1, ltree); /* send the length code */
extra = extra_lbits[code];
if (extra != 0) {
diff --git a/gnu/usr.bin/cvs/zlib/trees.h b/gnu/usr.bin/cvs/zlib/trees.h
new file mode 100644
index 00000000000..72facf900f7
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/trees.h
@@ -0,0 +1,128 @@
+/* header created automatically with -DGEN_TREES_H */
+
+local const ct_data static_ltree[L_CODES+2] = {
+{{ 12},{ 8}}, {{140},{ 8}}, {{ 76},{ 8}}, {{204},{ 8}}, {{ 44},{ 8}},
+{{172},{ 8}}, {{108},{ 8}}, {{236},{ 8}}, {{ 28},{ 8}}, {{156},{ 8}},
+{{ 92},{ 8}}, {{220},{ 8}}, {{ 60},{ 8}}, {{188},{ 8}}, {{124},{ 8}},
+{{252},{ 8}}, {{ 2},{ 8}}, {{130},{ 8}}, {{ 66},{ 8}}, {{194},{ 8}},
+{{ 34},{ 8}}, {{162},{ 8}}, {{ 98},{ 8}}, {{226},{ 8}}, {{ 18},{ 8}},
+{{146},{ 8}}, {{ 82},{ 8}}, {{210},{ 8}}, {{ 50},{ 8}}, {{178},{ 8}},
+{{114},{ 8}}, {{242},{ 8}}, {{ 10},{ 8}}, {{138},{ 8}}, {{ 74},{ 8}},
+{{202},{ 8}}, {{ 42},{ 8}}, {{170},{ 8}}, {{106},{ 8}}, {{234},{ 8}},
+{{ 26},{ 8}}, {{154},{ 8}}, {{ 90},{ 8}}, {{218},{ 8}}, {{ 58},{ 8}},
+{{186},{ 8}}, {{122},{ 8}}, {{250},{ 8}}, {{ 6},{ 8}}, {{134},{ 8}},
+{{ 70},{ 8}}, {{198},{ 8}}, {{ 38},{ 8}}, {{166},{ 8}}, {{102},{ 8}},
+{{230},{ 8}}, {{ 22},{ 8}}, {{150},{ 8}}, {{ 86},{ 8}}, {{214},{ 8}},
+{{ 54},{ 8}}, {{182},{ 8}}, {{118},{ 8}}, {{246},{ 8}}, {{ 14},{ 8}},
+{{142},{ 8}}, {{ 78},{ 8}}, {{206},{ 8}}, {{ 46},{ 8}}, {{174},{ 8}},
+{{110},{ 8}}, {{238},{ 8}}, {{ 30},{ 8}}, {{158},{ 8}}, {{ 94},{ 8}},
+{{222},{ 8}}, {{ 62},{ 8}}, {{190},{ 8}}, {{126},{ 8}}, {{254},{ 8}},
+{{ 1},{ 8}}, {{129},{ 8}}, {{ 65},{ 8}}, {{193},{ 8}}, {{ 33},{ 8}},
+{{161},{ 8}}, {{ 97},{ 8}}, {{225},{ 8}}, {{ 17},{ 8}}, {{145},{ 8}},
+{{ 81},{ 8}}, {{209},{ 8}}, {{ 49},{ 8}}, {{177},{ 8}}, {{113},{ 8}},
+{{241},{ 8}}, {{ 9},{ 8}}, {{137},{ 8}}, {{ 73},{ 8}}, {{201},{ 8}},
+{{ 41},{ 8}}, {{169},{ 8}}, {{105},{ 8}}, {{233},{ 8}}, {{ 25},{ 8}},
+{{153},{ 8}}, {{ 89},{ 8}}, {{217},{ 8}}, {{ 57},{ 8}}, {{185},{ 8}},
+{{121},{ 8}}, {{249},{ 8}}, {{ 5},{ 8}}, {{133},{ 8}}, {{ 69},{ 8}},
+{{197},{ 8}}, {{ 37},{ 8}}, {{165},{ 8}}, {{101},{ 8}}, {{229},{ 8}},
+{{ 21},{ 8}}, {{149},{ 8}}, {{ 85},{ 8}}, {{213},{ 8}}, {{ 53},{ 8}},
+{{181},{ 8}}, {{117},{ 8}}, {{245},{ 8}}, {{ 13},{ 8}}, {{141},{ 8}},
+{{ 77},{ 8}}, {{205},{ 8}}, {{ 45},{ 8}}, {{173},{ 8}}, {{109},{ 8}},
+{{237},{ 8}}, {{ 29},{ 8}}, {{157},{ 8}}, {{ 93},{ 8}}, {{221},{ 8}},
+{{ 61},{ 8}}, {{189},{ 8}}, {{125},{ 8}}, {{253},{ 8}}, {{ 19},{ 9}},
+{{275},{ 9}}, {{147},{ 9}}, {{403},{ 9}}, {{ 83},{ 9}}, {{339},{ 9}},
+{{211},{ 9}}, {{467},{ 9}}, {{ 51},{ 9}}, {{307},{ 9}}, {{179},{ 9}},
+{{435},{ 9}}, {{115},{ 9}}, {{371},{ 9}}, {{243},{ 9}}, {{499},{ 9}},
+{{ 11},{ 9}}, {{267},{ 9}}, {{139},{ 9}}, {{395},{ 9}}, {{ 75},{ 9}},
+{{331},{ 9}}, {{203},{ 9}}, {{459},{ 9}}, {{ 43},{ 9}}, {{299},{ 9}},
+{{171},{ 9}}, {{427},{ 9}}, {{107},{ 9}}, {{363},{ 9}}, {{235},{ 9}},
+{{491},{ 9}}, {{ 27},{ 9}}, {{283},{ 9}}, {{155},{ 9}}, {{411},{ 9}},
+{{ 91},{ 9}}, {{347},{ 9}}, {{219},{ 9}}, {{475},{ 9}}, {{ 59},{ 9}},
+{{315},{ 9}}, {{187},{ 9}}, {{443},{ 9}}, {{123},{ 9}}, {{379},{ 9}},
+{{251},{ 9}}, {{507},{ 9}}, {{ 7},{ 9}}, {{263},{ 9}}, {{135},{ 9}},
+{{391},{ 9}}, {{ 71},{ 9}}, {{327},{ 9}}, {{199},{ 9}}, {{455},{ 9}},
+{{ 39},{ 9}}, {{295},{ 9}}, {{167},{ 9}}, {{423},{ 9}}, {{103},{ 9}},
+{{359},{ 9}}, {{231},{ 9}}, {{487},{ 9}}, {{ 23},{ 9}}, {{279},{ 9}},
+{{151},{ 9}}, {{407},{ 9}}, {{ 87},{ 9}}, {{343},{ 9}}, {{215},{ 9}},
+{{471},{ 9}}, {{ 55},{ 9}}, {{311},{ 9}}, {{183},{ 9}}, {{439},{ 9}},
+{{119},{ 9}}, {{375},{ 9}}, {{247},{ 9}}, {{503},{ 9}}, {{ 15},{ 9}},
+{{271},{ 9}}, {{143},{ 9}}, {{399},{ 9}}, {{ 79},{ 9}}, {{335},{ 9}},
+{{207},{ 9}}, {{463},{ 9}}, {{ 47},{ 9}}, {{303},{ 9}}, {{175},{ 9}},
+{{431},{ 9}}, {{111},{ 9}}, {{367},{ 9}}, {{239},{ 9}}, {{495},{ 9}},
+{{ 31},{ 9}}, {{287},{ 9}}, {{159},{ 9}}, {{415},{ 9}}, {{ 95},{ 9}},
+{{351},{ 9}}, {{223},{ 9}}, {{479},{ 9}}, {{ 63},{ 9}}, {{319},{ 9}},
+{{191},{ 9}}, {{447},{ 9}}, {{127},{ 9}}, {{383},{ 9}}, {{255},{ 9}},
+{{511},{ 9}}, {{ 0},{ 7}}, {{ 64},{ 7}}, {{ 32},{ 7}}, {{ 96},{ 7}},
+{{ 16},{ 7}}, {{ 80},{ 7}}, {{ 48},{ 7}}, {{112},{ 7}}, {{ 8},{ 7}},
+{{ 72},{ 7}}, {{ 40},{ 7}}, {{104},{ 7}}, {{ 24},{ 7}}, {{ 88},{ 7}},
+{{ 56},{ 7}}, {{120},{ 7}}, {{ 4},{ 7}}, {{ 68},{ 7}}, {{ 36},{ 7}},
+{{100},{ 7}}, {{ 20},{ 7}}, {{ 84},{ 7}}, {{ 52},{ 7}}, {{116},{ 7}},
+{{ 3},{ 8}}, {{131},{ 8}}, {{ 67},{ 8}}, {{195},{ 8}}, {{ 35},{ 8}},
+{{163},{ 8}}, {{ 99},{ 8}}, {{227},{ 8}}
+};
+
+local const ct_data static_dtree[D_CODES] = {
+{{ 0},{ 5}}, {{16},{ 5}}, {{ 8},{ 5}}, {{24},{ 5}}, {{ 4},{ 5}},
+{{20},{ 5}}, {{12},{ 5}}, {{28},{ 5}}, {{ 2},{ 5}}, {{18},{ 5}},
+{{10},{ 5}}, {{26},{ 5}}, {{ 6},{ 5}}, {{22},{ 5}}, {{14},{ 5}},
+{{30},{ 5}}, {{ 1},{ 5}}, {{17},{ 5}}, {{ 9},{ 5}}, {{25},{ 5}},
+{{ 5},{ 5}}, {{21},{ 5}}, {{13},{ 5}}, {{29},{ 5}}, {{ 3},{ 5}},
+{{19},{ 5}}, {{11},{ 5}}, {{27},{ 5}}, {{ 7},{ 5}}, {{23},{ 5}}
+};
+
+const uch _dist_code[DIST_CODE_LEN] = {
+ 0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8,
+ 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10,
+10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
+11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13,
+13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
+14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
+14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
+14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15,
+15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
+15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
+15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 16, 17,
+18, 18, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22,
+23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
+26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27,
+27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
+29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
+29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
+29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29
+};
+
+const uch _length_code[MAX_MATCH-MIN_MATCH+1]= {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12,
+13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16,
+17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19,
+19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22,
+22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23,
+23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
+25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26,
+26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28
+};
+
+local const int base_length[LENGTH_CODES] = {
+0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56,
+64, 80, 96, 112, 128, 160, 192, 224, 0
+};
+
+local const int base_dist[D_CODES] = {
+ 0, 1, 2, 3, 4, 6, 8, 12, 16, 24,
+ 32, 48, 64, 96, 128, 192, 256, 384, 512, 768,
+ 1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576
+};
+
diff --git a/gnu/usr.bin/cvs/zlib/uncompr.c b/gnu/usr.bin/cvs/zlib/uncompr.c
index 4c9dcebb090..1ae733836e8 100644
--- a/gnu/usr.bin/cvs/zlib/uncompr.c
+++ b/gnu/usr.bin/cvs/zlib/uncompr.c
@@ -1,9 +1,9 @@
/* uncompr.c -- decompress a memory buffer
- * Copyright (C) 1995-1996 Jean-loup Gailly.
+ * Copyright (C) 1995-1998 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
-/* $Id: uncompr.c,v 1.1.1.1 1996/10/18 03:35:06 tholo Exp $ */
+/* @(#) $Id: uncompr.c,v 1.1.1.2 2001/09/28 22:45:40 tholo Exp $ */
#include "zlib.h"
@@ -22,7 +22,7 @@
enough memory, Z_BUF_ERROR if there was not enough room in the output
buffer, or Z_DATA_ERROR if the input data was corrupted.
*/
-int uncompress (dest, destLen, source, sourceLen)
+int ZEXPORT uncompress (dest, destLen, source, sourceLen)
Bytef *dest;
uLongf *destLen;
const Bytef *source;
@@ -49,7 +49,7 @@ int uncompress (dest, destLen, source, sourceLen)
err = inflate(&stream, Z_FINISH);
if (err != Z_STREAM_END) {
inflateEnd(&stream);
- return err;
+ return err == Z_OK ? Z_BUF_ERROR : err;
}
*destLen = stream.total_out;
diff --git a/gnu/usr.bin/cvs/zlib/zconf.h b/gnu/usr.bin/cvs/zlib/zconf.h
index c4be0e8ad1a..ea9193dd8ee 100644
--- a/gnu/usr.bin/cvs/zlib/zconf.h
+++ b/gnu/usr.bin/cvs/zlib/zconf.h
@@ -1,9 +1,9 @@
/* zconf.h -- configuration of the zlib compression library
- * Copyright (C) 1995-1996 Jean-loup Gailly.
+ * Copyright (C) 1995-1998 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
-/* $Id: zconf.h,v 1.1.1.1 1996/10/18 03:35:06 tholo Exp $ */
+/* @(#) $Id: zconf.h,v 1.1.1.2 2001/09/28 22:45:40 tholo Exp $ */
#ifndef _ZCONF_H
#define _ZCONF_H
@@ -27,8 +27,10 @@
# define inflateInit2_ z_inflateInit2_
# define inflateSetDictionary z_inflateSetDictionary
# define inflateSync z_inflateSync
+# define inflateSyncPoint z_inflateSyncPoint
# define inflateReset z_inflateReset
# define compress z_compress
+# define compress2 z_compress2
# define uncompress z_uncompress
# define adler32 z_adler32
# define crc32 z_crc32
@@ -72,8 +74,10 @@
#if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32)) && !defined(STDC)
# define STDC
#endif
-#if (defined(__STDC__) || defined(__cplusplus)) && !defined(STDC)
-# define STDC
+#if defined(__STDC__) || defined(__cplusplus) || defined(__OS2__)
+# ifndef STDC
+# define STDC
+# endif
#endif
#ifndef STDC
@@ -87,6 +91,12 @@
# define NO_DUMMY_DECL
#endif
+/* Old Borland C incorrectly complains about missing returns: */
+#if defined(__BORLANDC__) && (__BORLANDC__ < 0x500)
+# define NEED_DUMMY_RETURN
+#endif
+
+
/* Maximum value for memLevel in deflateInit2 */
#ifndef MAX_MEM_LEVEL
# ifdef MAXSEG_64K
@@ -96,13 +106,17 @@
# endif
#endif
-/* Maximum value for windowBits in deflateInit2 and inflateInit2 */
+/* Maximum value for windowBits in deflateInit2 and inflateInit2.
+ * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
+ * created by gzip. (Files created by minigzip can still be extracted by
+ * gzip.)
+ */
#ifndef MAX_WBITS
# define MAX_WBITS 15 /* 32K LZ77 window */
#endif
/* The memory requirements for deflate are (in bytes):
- 1 << (windowBits+2) + 1 << (memLevel+9)
+ (1 << (windowBits+2)) + (1 << (memLevel+9))
that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
plus a few kilobytes for small objects. For example, if you want to reduce
the default memory requirements from 256K to 128K, compile with
@@ -134,7 +148,7 @@
/* MSC small or medium model */
# define SMALL_MEDIUM
# ifdef _MSC_VER
-# define FAR __far
+# define FAR _far
# else
# define FAR far
# endif
@@ -142,19 +156,68 @@
#if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__))
# ifndef __32BIT__
# define SMALL_MEDIUM
-# define FAR __far
+# define FAR _far
+# endif
+#endif
+
+/* Compile with -DZLIB_DLL for Windows DLL support */
+#if defined(ZLIB_DLL)
+# if defined(_WINDOWS) || defined(WINDOWS)
+# ifdef FAR
+# undef FAR
+# endif
+# include <windows.h>
+# define ZEXPORT WINAPI
+# ifdef WIN32
+# define ZEXPORTVA WINAPIV
+# else
+# define ZEXPORTVA FAR _cdecl _export
+# endif
+# endif
+# if defined (__BORLANDC__)
+# if (__BORLANDC__ >= 0x0500) && defined (WIN32)
+# include <windows.h>
+# define ZEXPORT __declspec(dllexport) WINAPI
+# define ZEXPORTRVA __declspec(dllexport) WINAPIV
+# else
+# if defined (_Windows) && defined (__DLL__)
+# define ZEXPORT _export
+# define ZEXPORTVA _export
+# endif
+# endif
+# endif
+#endif
+
+#if defined (__BEOS__)
+# if defined (ZLIB_DLL)
+# define ZEXTERN extern __declspec(dllexport)
+# else
+# define ZEXTERN extern __declspec(dllimport)
# endif
#endif
+
+#ifndef ZEXPORT
+# define ZEXPORT
+#endif
+#ifndef ZEXPORTVA
+# define ZEXPORTVA
+#endif
+#ifndef ZEXTERN
+# define ZEXTERN extern
+#endif
+
#ifndef FAR
# define FAR
#endif
+#if !defined(MACOS) && !defined(TARGET_OS_MAC)
typedef unsigned char Byte; /* 8 bits */
+#endif
typedef unsigned int uInt; /* 16 bits or more */
typedef unsigned long uLong; /* 32 bits or more */
-#if defined(__BORLANDC__) && defined(SMALL_MEDIUM)
- /* Borland C/C++ ignores FAR inside typedef */
+#ifdef SMALL_MEDIUM
+ /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
# define Bytef Byte FAR
#else
typedef Byte FAR Bytef;
@@ -172,13 +235,45 @@ typedef uLong FAR uLongf;
typedef Byte *voidp;
#endif
+#ifdef HAVE_UNISTD_H
+# include <sys/types.h> /* for off_t */
+# include <unistd.h> /* for SEEK_* and off_t */
+# define z_off_t off_t
+#endif
+#ifndef SEEK_SET
+# define SEEK_SET 0 /* Seek from beginning of file. */
+# define SEEK_CUR 1 /* Seek from current position. */
+# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
+#endif
+#ifndef z_off_t
+# define z_off_t long
+#endif
-/* Compile with -DZLIB_DLL for Windows DLL support */
-#if (defined(_WINDOWS) || defined(WINDOWS)) && defined(ZLIB_DLL)
-# include <windows.h>
-# define EXPORT WINAPI
-#else
-# define EXPORT
+/* MVS linker does not support external names larger than 8 bytes */
+#if defined(__MVS__)
+# pragma map(deflateInit_,"DEIN")
+# pragma map(deflateInit2_,"DEIN2")
+# pragma map(deflateEnd,"DEEND")
+# pragma map(inflateInit_,"ININ")
+# pragma map(inflateInit2_,"ININ2")
+# pragma map(inflateEnd,"INEND")
+# pragma map(inflateSync,"INSY")
+# pragma map(inflateSetDictionary,"INSEDI")
+# pragma map(inflate_blocks,"INBL")
+# pragma map(inflate_blocks_new,"INBLNE")
+# pragma map(inflate_blocks_free,"INBLFR")
+# pragma map(inflate_blocks_reset,"INBLRE")
+# pragma map(inflate_codes_free,"INCOFR")
+# pragma map(inflate_codes,"INCO")
+# pragma map(inflate_fast,"INFA")
+# pragma map(inflate_flush,"INFLU")
+# pragma map(inflate_mask,"INMA")
+# pragma map(inflate_set_dictionary,"INSEDI2")
+# pragma map(inflate_copyright,"INCOPY")
+# pragma map(inflate_trees_bits,"INTRBI")
+# pragma map(inflate_trees_dynamic,"INTRDY")
+# pragma map(inflate_trees_fixed,"INTRFI")
+# pragma map(inflate_trees_free,"INTRFR")
#endif
#endif /* _ZCONF_H */
diff --git a/gnu/usr.bin/cvs/zlib/zlib.3 b/gnu/usr.bin/cvs/zlib/zlib.3
new file mode 100644
index 00000000000..25c8495d25f
--- /dev/null
+++ b/gnu/usr.bin/cvs/zlib/zlib.3
@@ -0,0 +1,107 @@
+.TH ZLIB 3 "9 July 1998"
+.SH NAME
+zlib \- compression/decompression library
+.SH SYNOPSIS
+[see
+.I zlib.h
+for full description]
+.SH DESCRIPTION
+The
+.I zlib
+library is a general purpose data compression library.
+The code is thread safe.
+It provides in-memory compression and decompression functions,
+including integrity checks of the uncompressed data.
+This version of the library supports only one compression method (deflation)
+but other algorithms will be added later and will have the same stream interface.
+.LP
+Compression can be done in a single step if the buffers are large enough
+(for example if an input file is mmap'ed),
+or can be done by repeated calls of the compression function.
+In the latter case,
+the application must provide more input and/or consume the output
+(providing more output space) before each call.
+.LP
+The library also supports reading and writing files in
+.I gzip
+(.gz) format
+with an interface similar to that of stdio.
+.LP
+The library does not install any signal handler. The decoder checks
+the consistency of the compressed data, so the library should never
+crash even in case of corrupted input.
+.LP
+All functions of the compression library are documented in the file
+.IR zlib.h.
+The distribution source includes examples of use of the library
+the files
+.I example.c
+and
+.IR minigzip.c .
+.LP
+A Java implementation of
+.IR zlib
+is available in the Java Development Kit 1.1
+.IP
+http://www.javasoft.com/products/JDK/1.1/docs/api/Package-java.util.zip.html
+.LP
+A Perl interface to
+.IR zlib ,
+written by Paul Marquess (pmarquess@bfsec.bt.co.uk)
+is available at CPAN (Comprehensive Perl Archive Network) sites,
+such as:
+.IP
+ftp://ftp.cis.ufl.edu/pub/perl/CPAN/modules/by-module/Compress/Compress-Zlib*
+.LP
+A Python interface to
+.IR zlib
+written by A.M. Kuchling <amk@magnet.com>
+is available from the Python Software Association sites, such as:
+.IP
+ftp://ftp.python.org/pub/python/contrib/Encoding/zlib*.tar.gz
+.SH "SEE ALSO"
+Questions about zlib should be sent to:
+.IP
+zlib@quest.jpl.nasa.gov
+or, if this fails, to the author addresses given below.
+The zlib home page is:
+.IP
+http://www.cdrom.com/pub/infozip/zlib/
+.LP
+The data format used by the zlib library is described by RFC
+(Request for Comments) 1950 to 1952 in the files:
+.IP
+ftp://ds.internic.net/rfc/rfc1950.txt (zlib format)
+.br
+rfc1951.txt (deflate format)
+.br
+rfc1952.txt (gzip format)
+.LP
+These documents are also available in other formats from:
+.IP
+ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html
+.SH AUTHORS
+Version 1.1.3
+Copyright (C) 1995-1998 Jean-loup Gailly (jloup@gzip.org)
+and Mark Adler (madler@alumni.caltech.edu).
+.LP
+This software is provided "as-is,"
+without any express or implied warranty.
+In no event will the authors be held liable for any damages
+arising from the use of this software.
+See the distribution directory with respect to requirements
+governing redistribution.
+The deflate format used by
+.I zlib
+was defined by Phil Katz.
+The deflate and
+.I zlib
+specifications were written by L. Peter Deutsch.
+Thanks to all the people who reported problems and suggested various
+improvements in
+.IR zlib ;
+who are too numerous to cite here.
+.LP
+UNIX manual page by R. P. C. Rodgers,
+U.S. National Library of Medicine (rodgers@nlm.nih.gov).
+.\" end of man page
diff --git a/gnu/usr.bin/cvs/zlib/zlib.h b/gnu/usr.bin/cvs/zlib/zlib.h
index 337fe9fe8a3..49f56b43bc6 100644
--- a/gnu/usr.bin/cvs/zlib/zlib.h
+++ b/gnu/usr.bin/cvs/zlib/zlib.h
@@ -1,7 +1,7 @@
/* zlib.h -- interface of the 'zlib' general purpose compression library
- version 1.0.4, Jul 24th, 1996.
+ version 1.1.3, July 9th, 1998
- Copyright (C) 1995-1996 Jean-loup Gailly and Mark Adler
+ Copyright (C) 1995-1998 Jean-loup Gailly and Mark Adler
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -20,7 +20,7 @@
3. This notice may not be removed or altered from any source distribution.
Jean-loup Gailly Mark Adler
- gzip@prep.ai.mit.edu madler@alumni.caltech.edu
+ jloup@gzip.org madler@alumni.caltech.edu
The data format used by the zlib library is described by RFCs (Request for
@@ -31,36 +31,33 @@
#ifndef _ZLIB_H
#define _ZLIB_H
+#include "zconf.h"
+
#ifdef __cplusplus
extern "C" {
#endif
-#include "zconf.h"
-
-#define ZLIB_VERSION "1.0.4"
+#define ZLIB_VERSION "1.1.3"
/*
The 'zlib' compression library provides in-memory compression and
decompression functions, including integrity checks of the uncompressed
data. This version of the library supports only one compression method
- (deflation) but other algorithms may be added later and will have the same
+ (deflation) but other algorithms will be added later and will have the same
stream interface.
- For compression the application must provide the output buffer and
- may optionally provide the input buffer for optimization. For decompression,
- the application must provide the input buffer and may optionally provide
- the output buffer for optimization.
-
Compression can be done in a single step if the buffers are large
enough (for example if an input file is mmap'ed), or can be done by
repeated calls of the compression function. In the latter case, the
application must provide more input and/or consume the output
(providing more output space) before each call.
- The library does not install any signal handler. It is recommended to
- add at least a handler for SIGSEGV when decompressing; the library checks
- the consistency of the input data whenever possible but may go nuts
- for some forms of corrupted input.
+ The library also supports reading and writing files in gzip (.gz) format
+ with an interface similar to that of stdio.
+
+ The library does not install any signal handler. The decoder checks
+ the consistency of the compressed data, so the library should never
+ crash even in case of corrupted input.
*/
typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
@@ -104,6 +101,9 @@ typedef z_stream FAR *z_streamp;
opaque value.
zalloc must return Z_NULL if there is not enough memory for the object.
+ If zlib is used in a multi-threaded application, zalloc and zfree must be
+ thread safe.
+
On 16-bit systems, the functions zalloc and zfree must be able to allocate
exactly 65536 bytes, but will not be required to allocate more than this
if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS,
@@ -123,7 +123,7 @@ typedef z_stream FAR *z_streamp;
/* constants */
#define Z_NO_FLUSH 0
-#define Z_PARTIAL_FLUSH 1
+#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */
#define Z_SYNC_FLUSH 2
#define Z_FULL_FLUSH 3
#define Z_FINISH 4
@@ -168,7 +168,7 @@ typedef z_stream FAR *z_streamp;
/* basic functions */
-extern const char * EXPORT zlibVersion OF((void));
+ZEXTERN const char * ZEXPORT zlibVersion OF((void));
/* The application can compare zlibVersion and ZLIB_VERSION for consistency.
If the first character differs, the library code actually used is
not compatible with the zlib.h header file used by the application.
@@ -176,7 +176,7 @@ extern const char * EXPORT zlibVersion OF((void));
*/
/*
-extern int EXPORT deflateInit OF((z_streamp strm, int level));
+ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
Initializes the internal stream state for compression. The fields
zalloc, zfree and opaque must be initialized before by the caller.
@@ -198,9 +198,15 @@ extern int EXPORT deflateInit OF((z_streamp strm, int level));
*/
-extern int EXPORT deflate OF((z_streamp strm, int flush));
+ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
/*
- Performs one or both of the following actions:
+ deflate compresses as much data as possible, and stops when the input
+ buffer becomes empty or the output buffer becomes full. It may introduce some
+ output latency (reading input without producing any output) except when
+ forced to flush.
+
+ The detailed semantics are as follows. deflate performs one or both of the
+ following actions:
- Compress more input starting at next_in and update next_in and avail_in
accordingly. If not all input can be processed (because there is not
@@ -222,24 +228,23 @@ extern int EXPORT deflate OF((z_streamp strm, int flush));
and with zero avail_out, it must be called again after making room in the
output buffer because there might be more output pending.
- If the parameter flush is set to Z_PARTIAL_FLUSH, the current compression
- block is terminated and flushed to the output buffer so that the
- decompressor can get all input data available so far. For method 9, a future
- variant on method 8, the current block will be flushed but not terminated.
- Z_SYNC_FLUSH has the same effect as partial flush except that the compressed
- output is byte aligned (the compressor can clear its internal bit buffer)
- and the current block is always terminated; this can be useful if the
- compressor has to be restarted from scratch after an interruption (in which
- case the internal state of the compressor may be lost).
- If flush is set to Z_FULL_FLUSH, the compression block is terminated, a
- special marker is output and the compression dictionary is discarded; this
- is useful to allow the decompressor to synchronize if one compressed block
- has been damaged (see inflateSync below). Flushing degrades compression and
- so should be used only when necessary. Using Z_FULL_FLUSH too often can
- seriously degrade the compression. If deflate returns with avail_out == 0,
- this function must be called again with the same value of the flush
- parameter and more output space (updated avail_out), until the flush is
- complete (deflate returns with non-zero avail_out).
+ If the parameter flush is set to Z_SYNC_FLUSH, all pending output is
+ flushed to the output buffer and the output is aligned on a byte boundary, so
+ that the decompressor can get all input data available so far. (In particular
+ avail_in is zero after the call if enough output space has been provided
+ before the call.) Flushing may degrade compression for some compression
+ algorithms and so it should be used only when necessary.
+
+ If flush is set to Z_FULL_FLUSH, all output is flushed as with
+ Z_SYNC_FLUSH, and the compression state is reset so that decompression can
+ restart from this point if previous compressed data has been damaged or if
+ random access is desired. Using Z_FULL_FLUSH too often can seriously degrade
+ the compression.
+
+ If deflate returns with avail_out == 0, this function must be called again
+ with the same value of the flush parameter and more output space (updated
+ avail_out), until the flush is complete (deflate returns with non-zero
+ avail_out).
If the parameter flush is set to Z_FINISH, pending input is processed,
pending output is flushed and deflate returns with Z_STREAM_END if there
@@ -254,6 +259,9 @@ extern int EXPORT deflate OF((z_streamp strm, int flush));
0.1% larger than avail_in plus 12 bytes. If deflate does not return
Z_STREAM_END, then it must be called again as described above.
+ deflate() sets strm->adler to the adler32 checksum of all input read
+ so far (that is, total_in bytes).
+
deflate() may update data_type if it can make a good guess about
the input data type (Z_ASCII or Z_BINARY). In doubt, the data is considered
binary. This field is only for information purposes and does not affect
@@ -263,11 +271,12 @@ extern int EXPORT deflate OF((z_streamp strm, int flush));
processed or more output produced), Z_STREAM_END if all input has been
consumed and all output has been produced (only when flush is set to
Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example
- if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible.
+ if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible
+ (for example avail_in or avail_out was zero).
*/
-extern int EXPORT deflateEnd OF((z_streamp strm));
+ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
/*
All dynamically allocated data structures for this stream are freed.
This function discards any unprocessed input and does not flush any
@@ -282,24 +291,35 @@ extern int EXPORT deflateEnd OF((z_streamp strm));
/*
-extern int EXPORT inflateInit OF((z_streamp strm));
+ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
Initializes the internal stream state for decompression. The fields
- zalloc, zfree and opaque must be initialized before by the caller. If
- zalloc and zfree are set to Z_NULL, inflateInit updates them to use default
- allocation functions.
+ next_in, avail_in, zalloc, zfree and opaque must be initialized before by
+ the caller. If next_in is not Z_NULL and avail_in is large enough (the exact
+ value depends on the compression method), inflateInit determines the
+ compression method from the zlib header and allocates all data structures
+ accordingly; otherwise the allocation will be deferred to the first call of
+ inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to
+ use default allocation functions.
- inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not
- enough memory, Z_VERSION_ERROR if the zlib library version is incompatible
- with the version assumed by the caller. msg is set to null if there is no
- error message. inflateInit does not perform any decompression: this will be
- done by inflate().
+ inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
+ version assumed by the caller. msg is set to null if there is no error
+ message. inflateInit does not perform any decompression apart from reading
+ the zlib header if present: this will be done by inflate(). (So next_in and
+ avail_in may be modified, but next_out and avail_out are unchanged.)
*/
-extern int EXPORT inflate OF((z_streamp strm, int flush));
+ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
/*
- Performs one or both of the following actions:
+ inflate decompresses as much data as possible, and stops when the input
+ buffer becomes empty or the output buffer becomes full. It may some
+ introduce some output latency (reading input without producing any output)
+ except when forced to flush.
+
+ The detailed semantics are as follows. inflate performs one or both of the
+ following actions:
- Decompress more input starting at next_in and update next_in and avail_in
accordingly. If not all input can be processed (because there is not
@@ -320,9 +340,9 @@ extern int EXPORT inflate OF((z_streamp strm, int flush));
must be called again after making room in the output buffer because there
might be more output pending.
- If the parameter flush is set to Z_PARTIAL_FLUSH, inflate flushes as much
+ If the parameter flush is set to Z_SYNC_FLUSH, inflate flushes as much
output as possible to the output buffer. The flushing behavior of inflate is
- not specified for values of the flush parameter other than Z_PARTIAL_FLUSH
+ not specified for values of the flush parameter other than Z_SYNC_FLUSH
and Z_FINISH, but the current implementation actually flushes as much output
as possible anyway.
@@ -337,22 +357,30 @@ extern int EXPORT inflate OF((z_streamp strm, int flush));
is never required, but can be used to inform inflate that a faster routine
may be used for the single inflate() call.
- inflate() returns Z_OK if some progress has been made (more input
- processed or more output produced), Z_STREAM_END if the end of the
- compressed data has been reached and all uncompressed output has been
- produced, Z_NEED_DICT if a preset dictionary is needed at this point (see
- inflateSetDictionary below), Z_DATA_ERROR if the input data was corrupted,
- Z_STREAM_ERROR if the stream structure was inconsistent (for example if
- next_in or next_out was NULL), Z_MEM_ERROR if there was not enough memory,
- Z_BUF_ERROR if no progress is possible or if there was not enough room in
- the output buffer when Z_FINISH is used. In the Z_DATA_ERROR case, the
- application may then call inflateSync to look for a good compression block.
- In the Z_NEED_DICT case, strm->adler is set to the Adler32 value of the
- dictionary chosen by the compressor.
+ If a preset dictionary is needed at this point (see inflateSetDictionary
+ below), inflate sets strm-adler to the adler32 checksum of the
+ dictionary chosen by the compressor and returns Z_NEED_DICT; otherwise
+ it sets strm->adler to the adler32 checksum of all output produced
+ so far (that is, total_out bytes) and returns Z_OK, Z_STREAM_END or
+ an error code as described below. At the end of the stream, inflate()
+ checks that its computed adler32 checksum is equal to that saved by the
+ compressor and returns Z_STREAM_END only if the checksum is correct.
+
+ inflate() returns Z_OK if some progress has been made (more input processed
+ or more output produced), Z_STREAM_END if the end of the compressed data has
+ been reached and all uncompressed output has been produced, Z_NEED_DICT if a
+ preset dictionary is needed at this point, Z_DATA_ERROR if the input data was
+ corrupted (input stream not conforming to the zlib format or incorrect
+ adler32 checksum), Z_STREAM_ERROR if the stream structure was inconsistent
+ (for example if next_in or next_out was NULL), Z_MEM_ERROR if there was not
+ enough memory, Z_BUF_ERROR if no progress is possible or if there was not
+ enough room in the output buffer when Z_FINISH is used. In the Z_DATA_ERROR
+ case, the application may then call inflateSync to look for a good
+ compression block.
*/
-extern int EXPORT inflateEnd OF((z_streamp strm));
+ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
/*
All dynamically allocated data structures for this stream are freed.
This function discards any unprocessed input and does not flush any
@@ -370,26 +398,25 @@ extern int EXPORT inflateEnd OF((z_streamp strm));
*/
/*
-extern int EXPORT deflateInit2 OF((z_streamp strm,
- int level,
- int method,
- int windowBits,
- int memLevel,
- int strategy));
+ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
+ int level,
+ int method,
+ int windowBits,
+ int memLevel,
+ int strategy));
This is another version of deflateInit with more compression options. The
fields next_in, zalloc, zfree and opaque must be initialized before by
the caller.
The method parameter is the compression method. It must be Z_DEFLATED in
- this version of the library. (Method 9 will allow a 64K history buffer and
- partial block flushes.)
+ this version of the library.
The windowBits parameter is the base two logarithm of the window size
(the size of the history buffer). It should be in the range 8..15 for this
- version of the library (the value 16 will be allowed for method 9). Larger
- values of this parameter result in better compression at the expense of
- memory usage. The default value is 15 if deflateInit is used instead.
+ version of the library. Larger values of this parameter result in better
+ compression at the expense of memory usage. The default value is 15 if
+ deflateInit is used instead.
The memLevel parameter specifies how much memory should be allocated
for the internal compression state. memLevel=1 uses minimum memory but
@@ -408,42 +435,35 @@ extern int EXPORT deflateInit2 OF((z_streamp strm,
the compression ratio but not the correctness of the compressed output even
if it is not set appropriately.
- If next_in is not null, the library will use this buffer to hold also
- some history information; the buffer must either hold the entire input
- data, or have at least 1<<(windowBits+1) bytes and be writable. If next_in
- is null, the library will allocate its own history buffer (and leave next_in
- null). next_out need not be provided here but must be provided by the
- application for the next call of deflate().
-
- If the history buffer is provided by the application, next_in must
- must never be changed by the application since the compressor maintains
- information inside this buffer from call to call; the application
- must provide more input only by increasing avail_in. next_in is always
- reset by the library in this case.
-
- deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was
- not enough memory, Z_STREAM_ERROR if a parameter is invalid (such as
- an invalid method). msg is set to null if there is no error message.
- deflateInit2 does not perform any compression: this will be done by
- deflate().
+ deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid
+ method). msg is set to null if there is no error message. deflateInit2 does
+ not perform any compression: this will be done by deflate().
*/
-extern int EXPORT deflateSetDictionary OF((z_streamp strm,
- const Bytef *dictionary,
- uInt dictLength));
-/*
- Initializes the compression dictionary (history buffer) from the given
- byte sequence without producing any compressed output. This function must
- be called immediately after deflateInit or deflateInit2, before any call
- of deflate. The compressor and decompressor must use exactly the same
+ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
+ const Bytef *dictionary,
+ uInt dictLength));
+/*
+ Initializes the compression dictionary from the given byte sequence
+ without producing any compressed output. This function must be called
+ immediately after deflateInit, deflateInit2 or deflateReset, before any
+ call of deflate. The compressor and decompressor must use exactly the same
dictionary (see inflateSetDictionary).
+
The dictionary should consist of strings (byte sequences) that are likely
to be encountered later in the data to be compressed, with the most commonly
used strings preferably put towards the end of the dictionary. Using a
- dictionary is most useful when the data to be compressed is short and
- can be predicted with good accuracy; the data can then be compressed better
- than with the default empty dictionary. In this version of the library,
- only the last 32K bytes of the dictionary are used.
+ dictionary is most useful when the data to be compressed is short and can be
+ predicted with good accuracy; the data can then be compressed better than
+ with the default empty dictionary.
+
+ Depending on the size of the compression data structures selected by
+ deflateInit or deflateInit2, a part of the dictionary may in effect be
+ discarded, for example if the dictionary is larger than the window size in
+ deflate or deflate2. Thus the strings most likely to be useful should be
+ put at the end of the dictionary, not at the front.
+
Upon return of this function, strm->adler is set to the Adler32 value
of the dictionary; the decompressor may later use this value to determine
which dictionary has been used by the compressor. (The Adler32 value
@@ -451,21 +471,16 @@ extern int EXPORT deflateSetDictionary OF((z_streamp strm,
actually used by the compressor.)
deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a
- parameter is invalid (such as NULL dictionary) or the stream state
- is inconsistent (for example if deflate has already been called for this
- stream). deflateSetDictionary does not perform any compression: this will
- be done by deflate().
+ parameter is invalid (such as NULL dictionary) or the stream state is
+ inconsistent (for example if deflate has already been called for this stream
+ or if the compression method is bsort). deflateSetDictionary does not
+ perform any compression: this will be done by deflate().
*/
-extern int EXPORT deflateCopy OF((z_streamp dest,
- z_streamp source));
+ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
+ z_streamp source));
/*
- Sets the destination stream as a complete copy of the source stream. If
- the source stream is using an application-supplied history buffer, a new
- buffer is allocated for the destination stream. The compressed output
- buffer is always application-supplied. It's the responsibility of the
- application to provide the correct values of next_out and avail_out for the
- next call of deflate.
+ Sets the destination stream as a complete copy of the source stream.
This function can be useful when several compression strategies will be
tried, for example when there are several ways of pre-processing the input
@@ -480,7 +495,7 @@ extern int EXPORT deflateCopy OF((z_streamp dest,
destination.
*/
-extern int EXPORT deflateReset OF((z_streamp strm));
+ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm));
/*
This function is equivalent to deflateEnd followed by deflateInit,
but does not free and reallocate all the internal compression state.
@@ -491,14 +506,17 @@ extern int EXPORT deflateReset OF((z_streamp strm));
stream state was inconsistent (such as zalloc or state being NULL).
*/
-extern int EXPORT deflateParams OF((z_streamp strm, int level, int strategy));
+ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
+ int level,
+ int strategy));
/*
- Dynamically update the compression level and compression strategy.
- This can be used to switch between compression and straight copy of
- the input data, or to switch to a different kind of input data requiring
- a different strategy. If the compression level is changed, the input
- available so far is compressed with the old level (and may be flushed);
- the new level will take effect only at the next call of deflate().
+ Dynamically update the compression level and compression strategy. The
+ interpretation of level and strategy is as in deflateInit2. This can be
+ used to switch between compression and straight copy of the input data, or
+ to switch to a different kind of input data requiring a different
+ strategy. If the compression level is changed, the input available so far
+ is compressed with the old level (and may be flushed); the new level will
+ take effect only at the next call of deflate().
Before the call of deflateParams, the stream state must be set as for
a call of deflate(), since the currently available input may have to
@@ -510,49 +528,37 @@ extern int EXPORT deflateParams OF((z_streamp strm, int level, int strategy));
*/
/*
-extern int EXPORT inflateInit2 OF((z_streamp strm,
- int windowBits));
+ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
+ int windowBits));
- This is another version of inflateInit with more compression options. The
- fields next_out, zalloc, zfree and opaque must be initialized before by
- the caller.
+ This is another version of inflateInit with an extra parameter. The
+ fields next_in, avail_in, zalloc, zfree and opaque must be initialized
+ before by the caller.
The windowBits parameter is the base two logarithm of the maximum window
size (the size of the history buffer). It should be in the range 8..15 for
- this version of the library (the value 16 will be allowed soon). The
- default value is 15 if inflateInit is used instead. If a compressed stream
- with a larger window size is given as input, inflate() will return with
- the error code Z_DATA_ERROR instead of trying to allocate a larger window.
-
- If next_out is not null, the library will use this buffer for the history
- buffer; the buffer must either be large enough to hold the entire output
- data, or have at least 1<<windowBits bytes. If next_out is null, the
- library will allocate its own buffer (and leave next_out null). next_in
- need not be provided here but must be provided by the application for the
- next call of inflate().
-
- If the history buffer is provided by the application, next_out must
- never be changed by the application since the decompressor maintains
- history information inside this buffer from call to call; the application
- can only reset next_out to the beginning of the history buffer when
- avail_out is zero and all output has been consumed.
-
- inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was
- not enough memory, Z_STREAM_ERROR if a parameter is invalid (such as
- windowBits < 8). msg is set to null if there is no error message.
- inflateInit2 does not perform any decompression: this will be done by
- inflate().
+ this version of the library. The default value is 15 if inflateInit is used
+ instead. If a compressed stream with a larger window size is given as
+ input, inflate() will return with the error code Z_DATA_ERROR instead of
+ trying to allocate a larger window.
+
+ inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_STREAM_ERROR if a parameter is invalid (such as a negative
+ memLevel). msg is set to null if there is no error message. inflateInit2
+ does not perform any decompression apart from reading the zlib header if
+ present: this will be done by inflate(). (So next_in and avail_in may be
+ modified, but next_out and avail_out are unchanged.)
*/
-extern int EXPORT inflateSetDictionary OF((z_streamp strm,
- const Bytef *dictionary,
- uInt dictLength));
+ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
+ const Bytef *dictionary,
+ uInt dictLength));
/*
- Initializes the decompression dictionary (history buffer) from the given
- uncompressed byte sequence. This function must be called immediately after
- a call of inflate if this call returned Z_NEED_DICT. The dictionary chosen
- by the compressor can be determined from the Adler32 value returned by this
- call of inflate. The compressor and decompressor must use exactly the same
+ Initializes the decompression dictionary from the given uncompressed byte
+ sequence. This function must be called immediately after a call of inflate
+ if this call returned Z_NEED_DICT. The dictionary chosen by the compressor
+ can be determined from the Adler32 value returned by this call of
+ inflate. The compressor and decompressor must use exactly the same
dictionary (see deflateSetDictionary).
inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
@@ -563,14 +569,14 @@ extern int EXPORT inflateSetDictionary OF((z_streamp strm,
inflate().
*/
-extern int EXPORT inflateSync OF((z_streamp strm));
+ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
/*
- Skips invalid compressed data until the special marker (see deflate()
- above) can be found, or until all available input is skipped. No output
- is provided.
+ Skips invalid compressed data until a full flush point (see above the
+ description of deflate with Z_FULL_FLUSH) can be found, or until all
+ available input is skipped. No output is provided.
- inflateSync returns Z_OK if the special marker has been found, Z_BUF_ERROR
- if no more input was provided, Z_DATA_ERROR if no marker has been found,
+ inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR
+ if no more input was provided, Z_DATA_ERROR if no flush point has been found,
or Z_STREAM_ERROR if the stream structure was inconsistent. In the success
case, the application may save the current current value of total_in which
indicates where valid compressed data was found. In the error case, the
@@ -578,7 +584,7 @@ extern int EXPORT inflateSync OF((z_streamp strm));
until success or end of the input data.
*/
-extern int EXPORT inflateReset OF((z_streamp strm));
+ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
/*
This function is equivalent to inflateEnd followed by inflateInit,
but does not free and reallocate all the internal decompression state.
@@ -594,13 +600,13 @@ extern int EXPORT inflateReset OF((z_streamp strm));
/*
The following utility functions are implemented on top of the
basic stream-oriented functions. To simplify the interface, some
- default options are assumed (compression level, window size,
+ default options are assumed (compression level and memory usage,
standard memory allocation functions). The source code of these
utility functions can easily be modified if you need special options.
*/
-extern int EXPORT compress OF((Bytef *dest, uLongf *destLen,
- const Bytef *source, uLong sourceLen));
+ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong sourceLen));
/*
Compresses the source buffer into the destination buffer. sourceLen is
the byte length of the source buffer. Upon entry, destLen is the total
@@ -614,8 +620,23 @@ extern int EXPORT compress OF((Bytef *dest, uLongf *destLen,
buffer.
*/
-extern int EXPORT uncompress OF((Bytef *dest, uLongf *destLen,
- const Bytef *source, uLong sourceLen));
+ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong sourceLen,
+ int level));
+/*
+ Compresses the source buffer into the destination buffer. The level
+ parameter has the same meaning as in deflateInit. sourceLen is the byte
+ length of the source buffer. Upon entry, destLen is the total size of the
+ destination buffer, which must be at least 0.1% larger than sourceLen plus
+ 12 bytes. Upon exit, destLen is the actual size of the compressed buffer.
+
+ compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_BUF_ERROR if there was not enough room in the output buffer,
+ Z_STREAM_ERROR if the level parameter is invalid.
+*/
+
+ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong sourceLen));
/*
Decompresses the source buffer into the destination buffer. sourceLen is
the byte length of the source buffer. Upon entry, destLen is the total
@@ -635,19 +656,23 @@ extern int EXPORT uncompress OF((Bytef *dest, uLongf *destLen,
typedef voidp gzFile;
-extern gzFile EXPORT gzopen OF((const char *path, const char *mode));
+ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
/*
Opens a gzip (.gz) file for reading or writing. The mode parameter
is as in fopen ("rb" or "wb") but can also include a compression level
- ("wb9"). gzopen can be used to read a file which is not in gzip format;
- in this case gzread will directly read from the file without decompression.
+ ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for
+ Huffman only compression as in "wb1h". (See the description
+ of deflateInit2 for more information about the strategy parameter.)
+
+ gzopen can be used to read a file which is not in gzip format; in this
+ case gzread will directly read from the file without decompression.
+
gzopen returns NULL if the file could not be opened or if there was
insufficient memory to allocate the (de)compression state; errno
can be checked to distinguish the two cases (if errno is zero, the
- zlib error is Z_MEM_ERROR).
-*/
+ zlib error is Z_MEM_ERROR). */
-extern gzFile EXPORT gzdopen OF((int fd, const char *mode));
+ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
/*
gzdopen() associates a gzFile with the file descriptor fd. File
descriptors are obtained from calls like open, dup, creat, pipe or
@@ -660,7 +685,15 @@ extern gzFile EXPORT gzdopen OF((int fd, const char *mode));
the (de)compression state.
*/
-extern int EXPORT gzread OF((gzFile file, voidp buf, unsigned len));
+ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
+/*
+ Dynamically update the compression level or strategy. See the description
+ of deflateInit2 for the meaning of these parameters.
+ gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not
+ opened for writing.
+*/
+
+ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
/*
Reads the given number of uncompressed bytes from the compressed file.
If the input file was not in gzip format, gzread copies the given number
@@ -668,14 +701,50 @@ extern int EXPORT gzread OF((gzFile file, voidp buf, unsigned len));
gzread returns the number of uncompressed bytes actually read (0 for
end of file, -1 for error). */
-extern int EXPORT gzwrite OF((gzFile file, const voidp buf, unsigned len));
+ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
+ const voidp buf, unsigned len));
/*
Writes the given number of uncompressed bytes into the compressed file.
gzwrite returns the number of uncompressed bytes actually written
(0 in case of error).
*/
-extern int EXPORT gzflush OF((gzFile file, int flush));
+ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...));
+/*
+ Converts, formats, and writes the args to the compressed file under
+ control of the format string, as in fprintf. gzprintf returns the number of
+ uncompressed bytes actually written (0 in case of error).
+*/
+
+ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
+/*
+ Writes the given null-terminated string to the compressed file, excluding
+ the terminating null character.
+ gzputs returns the number of characters written, or -1 in case of error.
+*/
+
+ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
+/*
+ Reads bytes from the compressed file until len-1 characters are read, or
+ a newline character is read and transferred to buf, or an end-of-file
+ condition is encountered. The string is then terminated with a null
+ character.
+ gzgets returns buf, or Z_NULL in case of error.
+*/
+
+ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
+/*
+ Writes c, converted to an unsigned char, into the compressed file.
+ gzputc returns the value that was written, or -1 in case of error.
+*/
+
+ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
+/*
+ Reads one byte from the compressed file. gzgetc returns this byte
+ or -1 in case of end of file or error.
+*/
+
+ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
/*
Flushes all pending output into the compressed file. The parameter
flush is as in the deflate() function. The return value is the zlib
@@ -685,14 +754,54 @@ extern int EXPORT gzflush OF((gzFile file, int flush));
degrade compression.
*/
-extern int EXPORT gzclose OF((gzFile file));
+ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
+ z_off_t offset, int whence));
+/*
+ Sets the starting position for the next gzread or gzwrite on the
+ given compressed file. The offset represents a number of bytes in the
+ uncompressed data stream. The whence parameter is defined as in lseek(2);
+ the value SEEK_END is not supported.
+ If the file is opened for reading, this function is emulated but can be
+ extremely slow. If the file is opened for writing, only forward seeks are
+ supported; gzseek then compresses a sequence of zeroes up to the new
+ starting position.
+
+ gzseek returns the resulting offset location as measured in bytes from
+ the beginning of the uncompressed stream, or -1 in case of error, in
+ particular if the file is opened for writing and the new starting position
+ would be before the current position.
+*/
+
+ZEXTERN int ZEXPORT gzrewind OF((gzFile file));
+/*
+ Rewinds the given file. This function is supported only for reading.
+
+ gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
+*/
+
+ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
+/*
+ Returns the starting position for the next gzread or gzwrite on the
+ given compressed file. This position represents a number of bytes in the
+ uncompressed data stream.
+
+ gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
+*/
+
+ZEXTERN int ZEXPORT gzeof OF((gzFile file));
+/*
+ Returns 1 when EOF has previously been detected reading the given
+ input stream, otherwise zero.
+*/
+
+ZEXTERN int ZEXPORT gzclose OF((gzFile file));
/*
Flushes all pending output if necessary, closes the compressed file
and deallocates all the (de)compression state. The return value is the zlib
error number (see function gzerror below).
*/
-extern const char * EXPORT gzerror OF((gzFile file, int *errnum));
+ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
/*
Returns the error message for the last error which occurred on the
given compressed file. errnum is set to zlib error number. If an
@@ -709,7 +818,7 @@ extern const char * EXPORT gzerror OF((gzFile file, int *errnum));
compression library.
*/
-extern uLong EXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
+ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
/*
Update a running Adler-32 checksum with the bytes buf[0..len-1] and
@@ -726,7 +835,7 @@ extern uLong EXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
if (adler != original_adler) error();
*/
-extern uLong EXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
+ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
/*
Update a running crc with the bytes buf[0..len-1] and return the updated
crc. If buf is NULL, this function returns the required initial value
@@ -748,30 +857,34 @@ extern uLong EXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
/* deflateInit and inflateInit are macros to allow checking the zlib version
* and the compiler's view of z_stream:
*/
-extern int EXPORT deflateInit_ OF((z_streamp strm, int level,
- const char *version, int stream_size));
-extern int EXPORT inflateInit_ OF((z_streamp strm,
- const char *version, int stream_size));
-extern int EXPORT deflateInit2_ OF((z_streamp strm, int level, int method,
- int windowBits, int memLevel, int strategy,
- const char *version, int stream_size));
-extern int EXPORT inflateInit2_ OF((z_streamp strm, int windowBits,
- const char *version, int stream_size));
+ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level,
+ const char *version, int stream_size));
+ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm,
+ const char *version, int stream_size));
+ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method,
+ int windowBits, int memLevel,
+ int strategy, const char *version,
+ int stream_size));
+ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits,
+ const char *version, int stream_size));
#define deflateInit(strm, level) \
deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream))
#define inflateInit(strm) \
inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream))
#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
- (strategy), ZLIB_VERSION, sizeof(z_stream))
+ (strategy), ZLIB_VERSION, sizeof(z_stream))
#define inflateInit2(strm, windowBits) \
inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream))
+
#if !defined(_Z_UTIL_H) && !defined(NO_DUMMY_DECL)
struct internal_state {int dummy;}; /* hack for buggy compilers */
#endif
-uLongf *get_crc_table OF((void)); /* can be used by asm versions of crc32() */
+ZEXTERN const char * ZEXPORT zError OF((int err));
+ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp z));
+ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void));
#ifdef __cplusplus
}
diff --git a/gnu/usr.bin/cvs/zlib/zutil.c b/gnu/usr.bin/cvs/zlib/zutil.c
index 40a74162235..eb59e9d1d10 100644
--- a/gnu/usr.bin/cvs/zlib/zutil.c
+++ b/gnu/usr.bin/cvs/zlib/zutil.c
@@ -1,11 +1,9 @@
/* zutil.c -- target dependent utility functions for the compression library
- * Copyright (C) 1995-1996 Jean-loup Gailly.
+ * Copyright (C) 1995-1998 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
-/* $Id: zutil.c,v 1.1.1.1 1996/10/18 03:35:06 tholo Exp $ */
-
-#include <stdio.h>
+/* @(#) $Id: zutil.c,v 1.1.1.2 2001/09/28 22:45:40 tholo Exp $ */
#include "zutil.h"
@@ -28,12 +26,18 @@ const char *z_errmsg[10] = {
""};
-const char *zlibVersion()
+const char * ZEXPORT zlibVersion()
{
return ZLIB_VERSION;
}
#ifdef DEBUG
+
+# ifndef verbose
+# define verbose 0
+# endif
+int z_verbose = verbose;
+
void z_error (m)
char *m;
{
@@ -42,11 +46,21 @@ void z_error (m)
}
#endif
+/* exported to allow conversion of error code to string for compress() and
+ * uncompress()
+ */
+const char * ZEXPORT zError(err)
+ int err;
+{
+ return ERR_MSG(err);
+}
+
+
#ifndef HAVE_MEMCPY
void zmemcpy(dest, source, len)
Bytef* dest;
- Bytef* source;
+ const Bytef* source;
uInt len;
{
if (len == 0) return;
@@ -56,8 +70,8 @@ void zmemcpy(dest, source, len)
}
int zmemcmp(s1, s2, len)
- Bytef* s1;
- Bytef* s2;
+ const Bytef* s1;
+ const Bytef* s2;
uInt len;
{
uInt j;
@@ -164,7 +178,7 @@ void zcfree (voidpf opaque, voidpf ptr)
# define MY_ZCALLOC
-#if (!defined(_MSC_VER) || (_MSC_VER < 600))
+#if (!defined(_MSC_VER) || (_MSC_VER <= 600))
# define _halloc halloc
# define _hfree hfree
#endif
diff --git a/gnu/usr.bin/cvs/zlib/zutil.h b/gnu/usr.bin/cvs/zlib/zutil.h
index c0be7445d09..a5dee163197 100644
--- a/gnu/usr.bin/cvs/zlib/zutil.h
+++ b/gnu/usr.bin/cvs/zlib/zutil.h
@@ -1,5 +1,5 @@
/* zutil.h -- internal interface and configuration of the compression library
- * Copyright (C) 1995-1996 Jean-loup Gailly.
+ * Copyright (C) 1995-1998 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -8,23 +8,23 @@
subject to change. Applications should only use zlib.h.
*/
-/* $Id: zutil.h,v 1.1.1.1 1996/10/18 03:35:06 tholo Exp $ */
+/* @(#) $Id: zutil.h,v 1.1.1.2 2001/09/28 22:45:40 tholo Exp $ */
#ifndef _Z_UTIL_H
#define _Z_UTIL_H
#include "zlib.h"
-#if defined(MSDOS)||defined(VMS)||defined(CRAY)||defined(WIN32)||defined(RISCOS)
-# include <stddef.h>
-# include <errno.h>
-#else
- extern int errno;
-#endif
#ifdef STDC
+# include <stddef.h>
# include <string.h>
# include <stdlib.h>
#endif
+#ifdef NO_ERRNO_H
+ extern int errno;
+#else
+# include <errno.h>
+#endif
#ifndef local
# define local static
@@ -75,8 +75,14 @@ extern const char *z_errmsg[10]; /* indexed by 2-zlib_error */
#ifdef MSDOS
# define OS_CODE 0x00
-# ifdef __TURBOC__
-# include <alloc.h>
+# if defined(__TURBOC__) || defined(__BORLANDC__)
+# if(__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__))
+ /* Allow compilation with ANSI keywords only enabled */
+ void _Cdecl farfree( void *block );
+ void *_Cdecl farmalloc( unsigned long nbytes );
+# else
+# include <alloc.h>
+# endif
# else /* MSC or DJGPP */
# include <malloc.h>
# endif
@@ -92,7 +98,7 @@ extern const char *z_errmsg[10]; /* indexed by 2-zlib_error */
#if defined(VAXC) || defined(VMS)
# define OS_CODE 0x02
-# define FOPEN(name, mode) \
+# define F_OPEN(name, mode) \
fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512")
#endif
@@ -104,8 +110,15 @@ extern const char *z_errmsg[10]; /* indexed by 2-zlib_error */
# define OS_CODE 0x05
#endif
-#ifdef MACOS
+#if defined(MACOS) || defined(TARGET_OS_MAC)
# define OS_CODE 0x07
+# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
+# include <unix.h> /* for fdopen */
+# else
+# ifndef fdopen
+# define fdopen(fd,mode) NULL /* No fdopen() */
+# endif
+# endif
#endif
#ifdef __50SERIES /* Prime/PRIMOS */
@@ -120,14 +133,19 @@ extern const char *z_errmsg[10]; /* indexed by 2-zlib_error */
# define fdopen(fd,mode) NULL /* No fdopen() */
#endif
+#if (defined(_MSC_VER) && (_MSC_VER > 600))
+# define fdopen(fd,type) _fdopen(fd,type)
+#endif
+
+
/* Common defaults */
#ifndef OS_CODE
# define OS_CODE 0x03 /* assume Unix */
#endif
-#ifndef FOPEN
-# define FOPEN(name, mode) fopen((name), (mode))
+#ifndef F_OPEN
+# define F_OPEN(name, mode) fopen((name), (mode))
#endif
/* functions */
@@ -142,9 +160,10 @@ extern const char *z_errmsg[10]; /* indexed by 2-zlib_error */
#if defined(pyr)
# define NO_MEMCPY
#endif
-#if (defined(M_I86SM) || defined(M_I86MM)) && !defined(_MSC_VER)
+#if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__)
/* Use our own functions for small and medium model with MSC <= 5.0.
* You may have to use the same strategy for Borland C (untested).
+ * The __SC__ check is for Symantec.
*/
# define NO_MEMCPY
#endif
@@ -162,24 +181,22 @@ extern const char *z_errmsg[10]; /* indexed by 2-zlib_error */
# define zmemzero(dest, len) memset(dest, 0, len)
# endif
#else
- extern void zmemcpy OF((Bytef* dest, Bytef* source, uInt len));
- extern int zmemcmp OF((Bytef* s1, Bytef* s2, uInt len));
+ extern void zmemcpy OF((Bytef* dest, const Bytef* source, uInt len));
+ extern int zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len));
extern void zmemzero OF((Bytef* dest, uInt len));
#endif
/* Diagnostic functions */
#ifdef DEBUG
# include <stdio.h>
-# ifndef verbose
-# define verbose 0
-# endif
+ extern int z_verbose;
extern void z_error OF((char *m));
# define Assert(cond,msg) {if(!(cond)) z_error(msg);}
-# define Trace(x) fprintf x
-# define Tracev(x) {if (verbose) fprintf x ;}
-# define Tracevv(x) {if (verbose>1) fprintf x ;}
-# define Tracec(c,x) {if (verbose && (c)) fprintf x ;}
-# define Tracecv(c,x) {if (verbose>1 && (c)) fprintf x ;}
+# define Trace(x) {if (z_verbose>=0) fprintf x ;}
+# define Tracev(x) {if (z_verbose>0) fprintf x ;}
+# define Tracevv(x) {if (z_verbose>1) fprintf x ;}
+# define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;}
+# define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;}
#else
# define Assert(cond,msg)
# define Trace(x)
@@ -190,8 +207,8 @@ extern const char *z_errmsg[10]; /* indexed by 2-zlib_error */
#endif
-typedef uLong (*check_func) OF((uLong check, const Bytef *buf, uInt len));
-
+typedef uLong (ZEXPORT *check_func) OF((uLong check, const Bytef *buf,
+ uInt len));
voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size));
void zcfree OF((voidpf opaque, voidpf ptr));