aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>1997-06-22 10:55:49 +0000
committerPeter Wemm <peter@FreeBSD.org>1997-06-22 10:55:49 +0000
commit3398c9be05502e12d986ef6e89739df1dc9ba9e6 (patch)
tree8684660dbfd105deed9a44c9e97d4f56b231fac1
parentaa134866ad3127753d521cc9aca28a226d941aa4 (diff)
downloadsrc-3398c9be05502e12d986ef6e89739df1dc9ba9e6.tar.gz
src-3398c9be05502e12d986ef6e89739df1dc9ba9e6.zip
Import cvs-1.9.10
Notes
Notes: svn path=/vendor/cvs/dist/; revision=26801
-rw-r--r--contrib/cvs/ChangeLog21
-rw-r--r--contrib/cvs/DEVEL-CVS11
-rw-r--r--contrib/cvs/Makefile.in2
-rw-r--r--contrib/cvs/NEWS6
-rw-r--r--contrib/cvs/config.h.in3
-rwxr-xr-xcontrib/cvs/configure6
-rw-r--r--contrib/cvs/configure.in4
-rw-r--r--contrib/cvs/doc/ChangeLog58
-rw-r--r--contrib/cvs/doc/RCSFILES3
-rw-r--r--contrib/cvs/doc/cvs.texinfo190
-rw-r--r--contrib/cvs/doc/cvsclient.texi17
-rw-r--r--contrib/cvs/lib/ChangeLog8
-rw-r--r--contrib/cvs/lib/system.h9
-rw-r--r--contrib/cvs/src/ChangeLog123
-rw-r--r--contrib/cvs/src/checkout.c45
-rw-r--r--contrib/cvs/src/client.c58
-rw-r--r--contrib/cvs/src/cvs.h6
-rw-r--r--contrib/cvs/src/find_names.c4
-rw-r--r--contrib/cvs/src/ignore.c8
-rw-r--r--contrib/cvs/src/import.c142
-rw-r--r--contrib/cvs/src/lock.c2
-rw-r--r--contrib/cvs/src/main.c20
-rw-r--r--contrib/cvs/src/mkmodules.c24
-rw-r--r--contrib/cvs/src/patch.c8
-rw-r--r--contrib/cvs/src/rcs.c12
-rw-r--r--contrib/cvs/src/rcs.h4
-rw-r--r--contrib/cvs/src/rcscmds.c2
-rw-r--r--contrib/cvs/src/root.c80
-rw-r--r--contrib/cvs/src/run.c12
-rwxr-xr-xcontrib/cvs/src/sanity.sh450
-rw-r--r--contrib/cvs/src/server.c47
-rw-r--r--contrib/cvs/src/server.h9
-rw-r--r--contrib/cvs/src/subr.c22
-rw-r--r--contrib/cvs/src/update.c21
-rw-r--r--contrib/cvs/src/vers_ts.c25
-rw-r--r--contrib/cvs/src/version.c2
-rw-r--r--contrib/cvs/src/wrapper.c4
-rw-r--r--contrib/cvs/tools/pcl-cvs/INSTALL2
38 files changed, 1269 insertions, 201 deletions
diff --git a/contrib/cvs/ChangeLog b/contrib/cvs/ChangeLog
index 4009d133373b..af4807f67ce7 100644
--- a/contrib/cvs/ChangeLog
+++ b/contrib/cvs/ChangeLog
@@ -1,3 +1,24 @@
+Wed Jun 18 00:00:02 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * NEWS: Mention pserver --allow-root.
+
+Mon Jun 16 19:07:34 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * Makefile.in (SUBDIRS): Add emx.
+ * configure.in (AC_OUTPUT): Add emx.
+ * configure: Regenerated.
+
+Sun Jun 8 23:44:00 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * configure.in (AC_CHECK_FUNCS): Remove mkfifo; not used anywhere.
+ * configure, config.h.in: Regenerated.
+
+Thu May 29 15:53:06 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * DEVEL-CVS: Add "Policy regarding checkout-only access" to
+ replace parenthetical remark about checkout-only access. This is
+ more of a cosmetic/editorial change than a new policy.
+
Wed May 21 17:02:29 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
* BUGS: Add item about wrappers.
diff --git a/contrib/cvs/DEVEL-CVS b/contrib/cvs/DEVEL-CVS
index defbba510324..fe8a8632198b 100644
--- a/contrib/cvs/DEVEL-CVS
+++ b/contrib/cvs/DEVEL-CVS
@@ -43,8 +43,7 @@ distribution of such items under the terms of the GNU Public License.
----------------------------------------------------------------------
Procedure for dealing with people who want to be developers:
-People who want checkin access (checkout-only access is available primarily
-via snapshots, for technical reasons) are first requested to send
+People who want checkin access are first requested to send
patches and have them reviewed by a developer. If they submit some
good ones (preferably over a period of time, to demonstrate sustained
interest), then one of the developers can ask the devel-cvs mailing
@@ -52,3 +51,11 @@ list whether it is OK to make this person a developer (after first
sending the prospective developer a copy of this file and then having
the prospective developer say they want to be a developer). If there
are no objections, an account will be created.
+
+----------------------------------------------------------------------
+Policy regarding checkout-only access:
+
+Checkout-only access to the CVS repository is available to all, on an
+anonymous basis (no need for registration or other complications).
+The exact technical mechanisms by which it is available are not
+covered by this policy.
diff --git a/contrib/cvs/Makefile.in b/contrib/cvs/Makefile.in
index bbf197d65ab8..491097e4279f 100644
--- a/contrib/cvs/Makefile.in
+++ b/contrib/cvs/Makefile.in
@@ -97,7 +97,7 @@ DISTFILES = \
USOURCE_SUBDIRS = lib zlib src
# All other subdirs:
SUBDIRS = ${USOURCE_SUBDIRS} man doc contrib tools \
- windows-NT os2 macintosh vms
+ windows-NT os2 emx macintosh vms
# Only make TAGS/tags files in these directories.
TSUBDIRS= src lib
diff --git a/contrib/cvs/NEWS b/contrib/cvs/NEWS
index 46c78f7b7a31..b2827cfd21a4 100644
--- a/contrib/cvs/NEWS
+++ b/contrib/cvs/NEWS
@@ -1,5 +1,11 @@
Changes since 1.9:
+* When setting up the pserver server, one now must specify the
+allowable CVSROOT directories in inetd.conf. See the Password
+authentication server section of cvs.texinfo for details. Note that
+this implies that everyone who is running a pserver server must edit
+inetd.conf when upgrading their CVS.
+
* The client no longer needs an external patch program (assuming both
the client and the server have been updated to the new version).
diff --git a/contrib/cvs/config.h.in b/contrib/cvs/config.h.in
index c731d6d3a7db..ce5ee499762d 100644
--- a/contrib/cvs/config.h.in
+++ b/contrib/cvs/config.h.in
@@ -105,9 +105,6 @@
/* Define if you have the krb_get_err_text function. */
#undef HAVE_KRB_GET_ERR_TEXT
-/* Define if you have the mkfifo function. */
-#undef HAVE_MKFIFO
-
/* Define if you have the mktemp function. */
#undef HAVE_MKTEMP
diff --git a/contrib/cvs/configure b/contrib/cvs/configure
index d35580fd3b2b..660c226c5e6d 100755
--- a/contrib/cvs/configure
+++ b/contrib/cvs/configure
@@ -1797,7 +1797,7 @@ fi
done
-for ac_func in fchmod fsync ftime mkfifo mktemp putenv vfork vprintf ftruncate timezone getpagesize initgroups fchdir sigaction sigprocmask sigvec sigsetmask sigblock tempnam tzset readlink wait3
+for ac_func in fchmod fsync ftime mktemp putenv vfork vprintf ftruncate timezone getpagesize initgroups fchdir sigaction sigprocmask sigvec sigsetmask sigblock tempnam tzset readlink wait3
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
@@ -2928,7 +2928,7 @@ trap 'rm -fr `echo "Makefile lib/Makefile src/Makefile zlib/Makefile doc/Makefil
man/Makefile tools/Makefile tools/pcl-cvs/Makefile \
contrib/Makefile contrib/elib/Makefile \
windows-NT/Makefile windows-NT/SCC/Makefile \
- os2/Makefile macintosh/Makefile vms/Makefile \
+ os2/Makefile emx/Makefile macintosh/Makefile vms/Makefile \
stamp-h config.h src/options.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
EOF
cat >> $CONFIG_STATUS <<EOF
@@ -2981,7 +2981,7 @@ CONFIG_FILES=\${CONFIG_FILES-"Makefile lib/Makefile src/Makefile zlib/Makefile d
man/Makefile tools/Makefile tools/pcl-cvs/Makefile \
contrib/Makefile contrib/elib/Makefile \
windows-NT/Makefile windows-NT/SCC/Makefile \
- os2/Makefile macintosh/Makefile vms/Makefile \
+ os2/Makefile emx/Makefile macintosh/Makefile vms/Makefile \
stamp-h"}
EOF
cat >> $CONFIG_STATUS <<\EOF
diff --git a/contrib/cvs/configure.in b/contrib/cvs/configure.in
index 87f4b7d24a51..2b1b8ec52830 100644
--- a/contrib/cvs/configure.in
+++ b/contrib/cvs/configure.in
@@ -62,7 +62,7 @@ AC_TYPE_MODE_T
AC_TYPE_SIZE_T
AC_TYPE_PID_T
AC_REPLACE_FUNCS(getwd mkdir rename strdup strstr dup2 strerror valloc waitpid vasprintf strtoul)
-AC_CHECK_FUNCS(fchmod fsync ftime mkfifo mktemp putenv vfork vprintf ftruncate timezone getpagesize initgroups fchdir sigaction sigprocmask sigvec sigsetmask sigblock tempnam tzset readlink wait3)
+AC_CHECK_FUNCS(fchmod fsync ftime mktemp putenv vfork vprintf ftruncate timezone getpagesize initgroups fchdir sigaction sigprocmask sigvec sigsetmask sigblock tempnam tzset readlink wait3)
dnl
dnl Look for shadow password files before we go ahead and set getspnam.
@@ -266,5 +266,5 @@ AC_OUTPUT(Makefile lib/Makefile src/Makefile zlib/Makefile doc/Makefile \
man/Makefile tools/Makefile tools/pcl-cvs/Makefile \
contrib/Makefile contrib/elib/Makefile \
windows-NT/Makefile windows-NT/SCC/Makefile \
- os2/Makefile macintosh/Makefile vms/Makefile \
+ os2/Makefile emx/Makefile macintosh/Makefile vms/Makefile \
stamp-h)
diff --git a/contrib/cvs/doc/ChangeLog b/contrib/cvs/doc/ChangeLog
index a8cb3e20d383..c56c253aaaab 100644
--- a/contrib/cvs/doc/ChangeLog
+++ b/contrib/cvs/doc/ChangeLog
@@ -1,3 +1,61 @@
+Wed Jun 18 00:03:25 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * cvs.texinfo (Password authentication server): Document
+ --allow-root.
+
+Tue Jun 17 09:58:03 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * cvs.texinfo (Error messages): Add "unknown option" from RCS.
+
+Fri Jun 13 12:11:09 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * cvs.texinfo (Global options): Add note about how -n might affect
+ CVS's output.
+
+Thu Jun 12 09:33:40 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * cvs.texinfo (Other problems): New node. Add discussion of
+ problem with old rcsmerge.
+
+ * cvs.texinfo (Environment variables): Add CVSUMASK.
+
+Mon Jun 2 18:39:57 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * cvs.texinfo (Moving a repository): New node.
+
+Tue May 27 18:27:57 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * cvs.texinfo (Working directory storage): Add comment about
+ timestamps.
+ * cvsclient.texi (Responses): Add Mod-time.
+
+Mon May 26 10:04:32 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * cvs.texinfo (Wrappers): Add comment concerning -t/-f and
+ client/server.
+
+Sun May 25 00:08:39 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * cvs.texinfo (Multiple vendor branches): New node.
+ (First import, import options, Invoking CVS): xref to it.
+
+Sat May 24 23:47:47 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * cvs.texinfo (File permissions): Add comment about group
+ ownership in repository and setgid bit on directories.
+
+Fri May 23 17:14:05 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * RCSFILES: Fix typo in dead newphrase description ("an" -> "a").
+
+Fri May 23 16:33:38 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * RCSFILES: Mention dead as a newphrase.
+
+Fri May 23 09:45:39 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * cvs.texinfo (Builds): In comment, update URL of mk.
+
Thu May 22 09:25:56 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
* cvs.texinfo (Error messages): Add comment about yet another way
diff --git a/contrib/cvs/doc/RCSFILES b/contrib/cvs/doc/RCSFILES
index 90a023fcb73c..5d9c7f7b22e7 100644
--- a/contrib/cvs/doc/RCSFILES
+++ b/contrib/cvs/doc/RCSFILES
@@ -53,6 +53,9 @@ rules.
---------- -------
namespace RCS library done at Silicon Graphics Inc. (SGI) in 1996
(a modified RCS 5.7--not sure it has any other name).
+ dead A set of RCS patches developed by Rich Pixley at
+ Cygnus. These were for CVS, and predated the current
+ CVS death support, which does not require RCS changes.
The rules regarding keyword expansion are not documented along with
the rest of the RCS file format; they are documented in the co(1)
diff --git a/contrib/cvs/doc/cvs.texinfo b/contrib/cvs/doc/cvs.texinfo
index 43f66065db7c..b087f3f90b6a 100644
--- a/contrib/cvs/doc/cvs.texinfo
+++ b/contrib/cvs/doc/cvs.texinfo
@@ -980,6 +980,7 @@ user-defined modules.
* Multiple repositories:: Multiple repositories
* Creating a repository:: Creating a repository
* Backing up:: Backing up a repository
+* Moving a repository:: Moving a repository
* Remote repositories:: Accessing repositories on remote machines
* Read-only access:: Granting read-only access to the repository
* Server temporary directory:: The server creates temporary directories
@@ -1224,6 +1225,18 @@ typical for newly created files, except that sometimes
@sc{cvs} creates them read-only (see the sections on
watches, @ref{Setting a watch}; -r, @ref{Global
options}; or CVSREAD, @ref{Environment variables}).
+@c FIXME: Need more discussion of which users and
+@c groups should own the file in the repository.
+@c Include a somewhat detailed example of the usual
+@c case where CVSUMASK is 007, the developers are all
+@c in a group, and that group owns stuff in the
+@c repository. Need to talk about group ownership of
+@c newly-created directories/files (on some unices,
+@c such as SunOS4, setting the setgid bit on the
+@c directories will make files inherit the directory's
+@c group. On other unices, your mileage may vary. I
+@c can't remember what POSIX says about this, if
+@c anything).
Note that using the client/server @sc{cvs}
(@pxref{Remote repositories}), there is no good way to
@@ -1292,6 +1305,13 @@ non-@code{dead} state.
@node Working directory storage
@section How data is stored in the working directory
+@c FIXME: Somewhere we should discuss timestamps (test
+@c case "stamps" in sanity.sh). But not here. Maybe
+@c in some kind of "working directory" chapter which
+@c would encompass the "Builds" one? But I'm not sure
+@c whether that is a good organization (is it based on
+@c what the user wants to do?).
+
While we are discussing @sc{cvs} internals which may
become visible from time to time, we might as well talk
about what @sc{cvs} puts in the @file{CVS} directories
@@ -1756,6 +1776,41 @@ what has changed, and then when you are ready, commit
the changes into the repository.
@end itemize
+@node Moving a repository
+@section Moving a repository
+@cindex repository, moving
+@cindex moving a repository
+@cindex copying a repository
+
+Just as backing up the files in the repository is
+pretty much like backing up any other files, if you
+need to move a repository from one place to another it
+is also pretty much like just moving any other
+collection of files.
+
+The main thing to consider is that working directories
+point to the repository. The simplest way to deal with
+a moved repository is to just get a fresh working
+directory after the move. Of course, you'll want to
+make sure that the old working directory had been
+checked in before the move, or you figured out some
+other way to make sure that you don't lose any
+changes. If you really do want to reuse the existing
+working directory, it should be possible with manual
+surgery on the @file{CVS/Repository} files. You can
+see @ref{Working directory storage}, for information on
+the @file{CVS/Repository} and @file{CVS/Root} files, but
+unless you are sure you want to bother, it probably
+isn't worth it.
+@c FIXME: This should be made unnecessary by:
+@c 1) a new -d should affect CVS/Root files throughout
+@c the tree, not just at the top level.
+@c 2) the RELATIVE_REPOS code should be fixed and made the
+@c default. I think that CVS already reads
+@c CVS/Repository files which are absolute or
+@c relative. FIXME: needs more investigation and
+@c documentation in "Working directory storage".
+
@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@node Remote repositories
@section Remote repositories
@@ -1993,13 +2048,19 @@ single line in @file{inetd.conf}) should be sufficient:
@example
2401 stream tcp nowait root /usr/local/bin/cvs
-cvs -b /usr/local/bin pserver
+cvs -b /usr/local/bin --allow-root=/usr/cvsroot pserver
@end example
The @samp{-b} option specifies the directory which contains
the @sc{rcs} binaries on the server. You could also use the
@samp{-T} option to specify a temporary directory.
+The @samp{--allow-root} option specifies the allowable
+@sc{cvsroot} directory. Clients which attempt to use a
+different @sc{cvsroot} directory will not be allowed to
+connect. If there is more than one @sc{cvsroot}
+directory which you want to allow, repeat the option.
+
If your @code{inetd} wants a symbolic service
name instead of a raw port number, then put this in
@file{/etc/services}:
@@ -2108,6 +2169,8 @@ passwd} command.
@c would open up a can of worms in that the users next
@c questions are likely to be "where do I get it?" and
@c "how do I use it?"
+@c Also note that htpasswd, at least the version I had,
+@c likes to clobber the third field.
@node Password authentication client
@subsubsection Using the client with password authentication
@@ -4938,6 +5001,7 @@ revision.
* Reverting local changes:: Reverting a module to the latest vendor release
* Binary files in imports:: Binary files require special handling
* Keywords in imports:: Keyword substitution might be undesirable
+* Multiple vendor branches:: What if you get sources from several places?
@end menu
@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -4953,7 +5017,7 @@ command to track third-party sources, the @dfn{vendor
tag} and @dfn{release tags} are useful. The
@dfn{vendor tag} is a symbolic name for the branch
(which is always 1.1.1, unless you use the @samp{-b
-@var{branch}} flag---@xref{import options}.). The
+@var{branch}} flag---@xref{Multiple vendor branches}.). The
@dfn{release tags} are symbolic names for a particular
release, such as @samp{FSF_0_04}.
@@ -5085,6 +5149,58 @@ and use the @samp{-k} option to @code{cvs update} or
@c has no effect. Not clear to me whether it should
@c or not.
+@node Multiple vendor branches
+@section Multiple vendor branches
+
+All the examples so far assume that there is only one
+vendor from which you are getting sources. In some
+situations you might get sources from a variety of
+places. For example, suppose that you are dealing with
+a project where many different people and teams are
+modifying the software. There are a variety of ways to
+handle this, but in some cases you have a bunch of
+source trees lying around and what you want to do more
+than anything else is just to all put them in CVS so
+that you at least have them in one place.
+
+For handling situations in which there may be more than
+one vendor, you may specify the @samp{-b} option to
+@code{cvs import}. It takes as an argument the vendor
+branch to import to. The default is @samp{-b 1.1.1}.
+
+For example, suppose that there are two teams, the red
+team and the blue team, that are sending you sources.
+You want to import the red team's efforts to branch
+1.1.1 and use the vendor tag RED. You want to import
+the blue team's efforts to branch 1.1.3 and use the
+vendor tag BLUE. So the commands you might use are:
+
+@example
+$ cvs import dir RED RED_1-0
+$ cvs import -b 1.1.3 dir BLUE BLUE_1-5
+@end example
+
+Note that if your vendor tag does not match your
+@samp{-b} option, CVS will not detect this case! For
+example,
+
+@example
+$ cvs import -b 1.1.3 dir RED RED_1-0
+@end example
+
+@noindent
+Be careful; this kind of mismatch is sure to sow
+confusion or worse. I can't think of a useful purpose
+for the ability to specify a mismatch here, but if you
+discover such a use, don't. CVS is likely to make this
+an error in some future release.
+
+@c Probably should say more about the semantics of
+@c multiple branches. What about the default branch?
+@c What about joining (perhaps not as useful with
+@c multiple branches, or perhaps it is. Either way
+@c should be mentioned).
+
@c ---------------------------------------------------------------------
@node Moving files
@chapter Moving and renaming files
@@ -6062,8 +6178,11 @@ is Odin (see
@c Of course, many non-CVS systems have this kind of
@c functionality, for example OSF's ODE
@c (http://www.osf.org/ode/) or mk
-@c (http://www.io.org/~pzi/heading.html;
-@c ftp://ftp.interlog.com/pub/unix/mk is out of date). But I'm not sure
+@c (http://www.grin.net/~pzi/mk-3.18.4.docs/mk_toc.html
+@c He has changed providers in the past; a search engine search
+@c for "Peter Ziobrzynski" probably won't get too many
+@c spurious hits :-). A more stable URL might be
+@c ftp://ftp.uu.net/pub/cmvc/mk). But I'm not sure
@c there is any point in mentioning them here unless they
@c can work with CVS.
@@ -6380,6 +6499,10 @@ The available @samp{cvs_options} (that are given to the
left of @samp{cvs_command}) are:
@table @code
+@item --allow-root=@var{rootdir}
+Specify legal @sc{cvsroot} directory. See
+@ref{Password authentication server}.
+
@cindex RCSBIN, overriding
@cindex Overriding RCSBIN
@item -b @var{bindir}
@@ -6442,6 +6565,12 @@ Do not change any files. Attempt to execute the
@samp{cvs_command}, but only to issue reports; do not remove,
update, or merge any existing files, or create any new files.
+Note that @sc{cvs} will not necessarily produce exactly
+the same output as without @samp{-n}. In some cases
+the output will be the same, but in other cases
+@sc{cvs} will skip some of the processing that would
+have been required to produce the exact same output.
+
@item -Q
Cause the command to be really quiet; the command will only
generate output for serious problems.
@@ -8068,13 +8197,7 @@ There are three additional special options.
@table @code
@item -b @var{branch}
-Specify a first-level branch other than 1.1.1. Unless
-the @samp{-b @var{branch}} flag is given, revisions will
-@emph{always} be made to the branch 1.1.1---even if a
-@var{vendortag} that matches another branch is given!
-What happens in that case, is that the tag will be
-reset to 1.1.1. Warning: This behavior might change
-in the future.
+See @ref{Multiple vendor branches}.
@item -k @var{subst}
Indicate the RCS keyword expansion mode desired. This
@@ -9400,7 +9523,7 @@ Import files into CVS, using vendor branches. See
@table @code
@item -b @var{bra}
Import to vendor branch @var{bra}. See
-@ref{import options}.
+@ref{Multiple vendor branches}.
@item -d
Use the file's modification time as the time of
@@ -9957,6 +10080,10 @@ with the @code{-t} flag) and the other when the file is
checked out of the repository (this is denoted with the
@code{-f} flag). The @samp{-t}/@samp{-f} feature does
not work with client/server @sc{cvs}.
+@c I think maybe -t/-f works client/server if a single
+@c file converts to/from a single file, as opposed to
+@c the file<->directory case. Could use more
+@c investigation...
The @file{cvswrappers} also has a @samp{-m} option to
specify the merge methodology that should be used when
@@ -10902,6 +11029,10 @@ try hard to make the files in your working directory
read-only. When this is not set, the default behavior
is to permit modification of your working files.
+@item $CVSUMASK
+Controls permissions of files in the repository. See
+@ref{File permissions}.
+
@cindex CVSROOT
@item $CVSROOT
Should contain the full pathname to the root of the @sc{cvs}
@@ -11057,8 +11188,16 @@ argument lists of most @sc{rcs} commands.
@node Troubleshooting
@appendix Troubleshooting
+If you are having trouble with @sc{cvs}, this appendix
+may help. If there is a particular error message which
+you are seeing, then you can look up the message
+alphabetically. If not, you can look through the
+section on other problems to see if your problem is
+mentioned there.
+
@menu
* Error messages:: Partial list of CVS errors
+* Other problems:: Problems not readily listed by error message
@end menu
@ignore
@@ -11185,6 +11324,16 @@ every place it appears in your @code{modules}
file. For more information on the @code{modules} file,
see @ref{modules}.
+@item rcs error: Unknown option: -x,v/
+This message will be followed by a usage message for
+@sc{rcs}. It means that you have an old version of
+@sc{rcs} (probably supplied with your operating
+system). CVS only works with @sc{rcs} version 5 and
+later.
+@c For more information on installing @sc{cvs}, see
+@c (FIXME: where? it depends on whether you are
+@c getting binaries or sources or what).
+
@item cvs [server aborted]: received broken pipe signal
This message seems to be caused by a hard-to-track-down
bug in @sc{cvs} or the systems it runs on (we don't
@@ -11244,6 +11393,23 @@ exit 0
@c potentially confusing for the new user.
@end table
+@node Other problems
+@appendixsec Other common problems
+
+Here is a list of problems which cannot be readily
+looked up based on an error message. They are in no
+particular order.
+
+@itemize @bullet
+@item
+If @code{cvs update} finds a conflict and tries to
+merge, as described in @ref{Conflicts example}, but
+doesn't tell you there were conflicts, then you may
+have an old version of @sc{rcs}. For more information
+on how to set this up, see the @file{INSTALL} file in
+the @sc{cvs} source distribution.
+@end itemize
+
@c ---------------------------------------------------------------------
@node Copying
@appendix GNU GENERAL PUBLIC LICENSE
diff --git a/contrib/cvs/doc/cvsclient.texi b/contrib/cvs/doc/cvsclient.texi
index 0d80788560d5..d0aac359f9d6 100644
--- a/contrib/cvs/doc/cvsclient.texi
+++ b/contrib/cvs/doc/cvsclient.texi
@@ -1100,6 +1100,23 @@ This @var{mode} applies to the next file mentioned in
@code{Checked-in}, @code{New-entry}, @code{Updated}, @code{Merged}, or
@code{Patched} response.
+@item Mod-time @var{time} \n
+Set the modification time of the next file sent to @var{time}. Next
+file sent means sent by @code{Checked-in}, @code{Created}, etc. The
+@var{time} is in the format specified by RFC822 as modified by RFC1123.
+The server may specify any timezone it chooses; clients will want to
+convert that to their own timezone as appropriate. An example of this
+format is:
+
+@example
+26 May 1997 13:01:40 -0400
+@end example
+
+There is no requirement that the client and server clocks be
+synchronized. The server just sends its recommendation for a timestamp
+(based on its own clock, presumably), and the client should just believe
+it (this means that the time might be in the future, for example).
+
@item Checksum @var{checksum}\n
The @var{checksum} applies to the next file sent over via
@code{Updated}, @code{Merged}, or @code{Patched}. In the case of
diff --git a/contrib/cvs/lib/ChangeLog b/contrib/cvs/lib/ChangeLog
index 02750d388de0..02a0e1f7a33f 100644
--- a/contrib/cvs/lib/ChangeLog
+++ b/contrib/cvs/lib/ChangeLog
@@ -1,3 +1,11 @@
+Mon Jun 16 18:59:50 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * system.h: Add CVS_FNMATCH.
+
+Sun Jun 8 23:41:11 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * system.h (mkfifo): Remove; not used anywhere.
+
Thu Mar 6 17:14:49 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
* regex.c: Partial merge with version from emacs 19.34. I brought
diff --git a/contrib/cvs/lib/system.h b/contrib/cvs/lib/system.h
index 05025fe5655e..1a692ffa4a9a 100644
--- a/contrib/cvs/lib/system.h
+++ b/contrib/cvs/lib/system.h
@@ -104,10 +104,6 @@
# endif
#endif
-#if !defined(HAVE_MKFIFO)
-#define mkfifo(path, mode) (mknod ((path), (mode) | S_IFIFO, 0))
-#endif
-
#ifdef NEED_DECOY_PERMISSIONS /* OS/2, really */
#define S_IRUSR S_IREAD
@@ -469,6 +465,11 @@ char *getwd ();
#define CVS_UNLINK unlink
#endif
+/* Wildcard matcher. Should be case-insensitive if the system is. */
+#ifndef CVS_FNMATCH
+#define CVS_FNMATCH fnmatch
+#endif
+
/* Some file systems are case-insensitive. If FOLD_FN_CHAR is
#defined, it maps the character C onto its "canonical" form. In a
case-insensitive system, it would map all alphanumeric characters
diff --git a/contrib/cvs/src/ChangeLog b/contrib/cvs/src/ChangeLog
index 5f4f43e1f9db..0c8b0f609306 100644
--- a/contrib/cvs/src/ChangeLog
+++ b/contrib/cvs/src/ChangeLog
@@ -1,3 +1,126 @@
+Tue Jun 17 22:48:00 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * main.c (main): Add --allow-root=ROOT argument; call
+ root_allow_add for each time it is specified. Call
+ root_allow_free before exiting.
+ * root.c, cvs.h (root_allow_add, root_allow_free, root_allow_ok):
+ New function.
+ * server.c (pserver_authenticate_connection): If root_allow_ok
+ doesn't like the CVSROOT directory, don't allow access.
+
+Tue Jun 17 14:30:14 1997 Jim Kingdon (unknown@beezley)
+
+ * client.c: Add "copyright" notice. If NO_EXT_METHOD, omit
+ start_rsh_method.
+ * client.c (update_entries): Cast argument to MD5Update from
+ char * to unsigned char *.
+
+Mon Jun 16 16:46:28 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * run.c (piped_child, filter_stream_through_program):
+ If USE_SETMODE_BINARY, then put the pipes into binary mode.
+ * find_names.c, ignore.c, lock.c, wrapper.c: Change fnmatch to
+ CVS_FNMATCH.
+ * client.c (start_server): If NO_EXT_METHOD, then give a fatal
+ error on any use of :ext:.
+
+Sun Jun 15 22:30:27 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * sanity.sh (toplevel): Match U CVSROOT/* lines with DOTSTAR in
+ test toplevel-9.
+
+Thu Jun 12 10:27:51 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * sanity.sh (toplevel): Remove Emptydir before starting.
+
+ * sanity.sh: Change "rm -rf" to "rm -r" when deleting working
+ directories (except a few watches cases). Helps detect cases
+ where the testsuite has cd'd to somewhere other than where we
+ think it has.
+ (basic2): Remove "rm -r first-dir" between tests 49 and 50. The
+ directory was already deleted in test 45.5.
+ (rcs): Add "cd .." at end of tests.
+ (stamps): No longer cd to TESTDIR; shouldn't be necessary with
+ fix to "rcs" test.
+
+Wed Jun 11 22:28:38 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * sanity.sh (basicb): Also remove CVSROOT/Emptydir at end of
+ test. Otherwise it affects the toplevel-9 test for remote.
+
+Tue Jun 10 14:03:32 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * sanity.sh (toplevel): Change "update" and "checkout" to "[a-z]*"
+ as these read "server" instead for "make remotecheck". Change
+ expect strings for toplevel-9 to accept the behavior of remote CVS
+ (see comments for more discussion).
+
+ * sanity.sh: New tests stamps-9 through stamps-11 test timestamp
+ behavior on cvs update.
+
+Mon Jun 9 22:42:50 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * sanity.sh: Remove "#! /bin/zsh" line at end. I assume it was
+ added accidentally.
+
+Tue Jun 10 03:08:46 1997 Norbert Kiesel <nk@psycho.de>
+
+ * sanity.sh: new tests "toplevel" for the new toplevel CVS
+ directory creation (including one test which shows an error in
+ this area).
+
+Sun Jun 8 20:52:00 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * rcs.c (getrcsrev): Before printing error, check whether it was
+ feof or ferror.
+
+ * rcs.h, import.c (add_rcs_file): No longer static. New arguments
+ add_vbranch, add_vhead, and add_logfp replace access to static
+ variables vbranch, vhead, and logfp.
+ * mkmodules.c: Call it instead of RCS_CI.
+ * import.c (process_import_file): Adjust call to add_rcs_file.
+
+Tue Jun 3 10:18:33 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * sanity.sh (basicb): Match "." with "\." not ".".
+
+Tue Jun 3 13:02:37 1997 Norbert Kiesel <nk@cosa.de>
+
+ * checkout.c (checkout): Removed restriction of not sending -k in
+ remote export (I think this was introduced while the -k handling
+ was still broken in remote mode). Give better error texts
+ regarding -c and -s options. Use error() instead of usage() for
+ reporting errors in all places. Reindented some lines. Free
+ xmalloc'd space of options.
+
+Thu May 29 16:32:47 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * rcscmds.c (RCS_checkin), mkmodules.c (init): Pass -w option to
+ "ci", specifying getcaller ().
+ * server.h, server.c (CVS_Username): Now extern.
+ * subr.c (getcaller): Return CVS_Username if it is set.
+
+Wed May 28 22:31:38 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * update.c (update_fileproc): If wrap_merge_is_copy and we would
+ like to do a merge, give a fatal error. See comment for why.
+ * sanity.sh (mwrap): New tests, tests for above fix.
+
+Tue May 27 21:59:32 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * sanity.sh (stamps): cd to ${TESTDIR} before starting.
+
+Mon May 26 15:31:30 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * client.c (handle_mod_time): New function.
+ (responses): Add "Mod-time".
+ (stored_modtime_valid, stored_modtime): New variables.
+ (update_entries): If it is set, change the file's modtime.
+ * server.c, server.h (server_modtime): New function.
+ * vers_ts.c (Version_TS): Call it.
+ * patch.c (patch_fileproc): Add comment about why we don't.
+ * sanity.sh (stamps): Added, tests for above fix.
+
Fri May 16 13:14:30 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
* subr.c (free_names): Update documentation to reflect fact that
diff --git a/contrib/cvs/src/checkout.c b/contrib/cvs/src/checkout.c
index 82096012cd93..e36e729b8190 100644
--- a/contrib/cvs/src/checkout.c
+++ b/contrib/cvs/src/checkout.c
@@ -221,8 +221,11 @@ checkout (argc, argv)
if (shorten == -1)
shorten = 0;
- if ((!(cat + status) && argc == 0) || ((cat + status) && argc != 0))
- usage (valid_usage);
+ if ((cat || status) && argc != 0)
+ error (1, 0, "-c and -s must not get any arguments");
+
+ if (!(cat || status) && argc == 0)
+ error (1, 0, "must specify at least one module or directory");
if (where && pipeout)
error (1, 0, "-d and -p are mutually exclusive");
@@ -230,20 +233,10 @@ checkout (argc, argv)
if (strcmp (command_name, "export") == 0)
{
if (!tag && !date)
- {
- error (0, 0, "must specify a tag or date");
- usage (valid_usage);
- }
+ error (1, 0, "must specify a tag or date");
+
if (tag && isdigit (tag[0]))
error (1, 0, "tag `%s' must be a symbolic tag", tag);
-/*
- * mhy 950615: -kv doesn't work for binaries with RCS keywords.
- * Instead use the default provided in the RCS file (-ko for binaries).
- */
-#if 0
- if (!options)
- options = RCS_check_kflag ("v");/* -kv is default */
-#endif
}
if (!safe_location()) {
@@ -279,10 +272,14 @@ checkout (argc, argv)
client_expand_modules (argc, argv, local);
}
- if (!run_module_prog) send_arg ("-n");
- if (local) send_arg ("-l");
- if (pipeout) send_arg ("-p");
- if (!force_tag_match) send_arg ("-f");
+ if (!run_module_prog)
+ send_arg ("-n");
+ if (local)
+ send_arg ("-l");
+ if (pipeout)
+ send_arg ("-p");
+ if (!force_tag_match)
+ send_arg ("-f");
if (aflag)
send_arg("-A");
if (!shorten)
@@ -293,16 +290,10 @@ checkout (argc, argv)
if (cat)
send_arg("-c");
if (where != NULL)
- {
option_with_arg ("-d", where);
- }
if (status)
send_arg("-s");
- /* Why not send -k for export? This would appear to make
- remote export differ from local export. FIXME. */
- if (strcmp (command_name, "export") != 0
- && options != NULL
- && options[0] != '\0')
+ if (options != NULL && options[0] != '\0')
send_arg (options);
option_with_arg ("-r", tag);
if (date)
@@ -335,6 +326,8 @@ checkout (argc, argv)
if (cat || status)
{
cat_module (status);
+ if (options)
+ free (options);
return (0);
}
db = open_module ();
@@ -432,6 +425,8 @@ checkout (argc, argv)
where, shorten, local, run_module_prog,
(char *) NULL);
close_module (db);
+ if (options)
+ free (options);
return (err);
}
diff --git a/contrib/cvs/src/client.c b/contrib/cvs/src/client.c
index 49f7ac8af0e3..a1ed876c7555 100644
--- a/contrib/cvs/src/client.c
+++ b/contrib/cvs/src/client.c
@@ -1,4 +1,14 @@
-/* CVS client-related stuff. */
+/* CVS client-related stuff.
+
+ 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. */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -1303,7 +1313,28 @@ handle_mode (args, len)
stored_mode = xstrdup (args);
stored_mode_valid = 1;
}
+
+/* Nonzero if time was specified in Mod-time. */
+static int stored_modtime_valid;
+/* Time specified in Mod-time. */
+static time_t stored_modtime;
+static void handle_mod_time PROTO ((char *, int));
+
+static void
+handle_mod_time (args, len)
+ char *args;
+ int len;
+{
+ if (stored_modtime_valid)
+ error (0, 0, "protocol error: duplicate Mod-time");
+ stored_modtime = get_date (args, NULL);
+ if (stored_modtime == (time_t) -1)
+ error (0, 0, "protocol error: cannot parse date %s", args);
+ else
+ stored_modtime_valid = 1;
+}
+
/*
* If we receive a patch, but the patch program fails to apply it, we
* want to request the original file. We keep a list of files whose
@@ -1787,7 +1818,7 @@ update_entries (data_arg, ent_list, short_pathname, filename)
the file out, so that we don't have to read it
back in again. */
MD5Init (&context);
- MD5Update (&context, patchedbuf, patchedlen);
+ MD5Update (&context, (unsigned char *) patchedbuf, patchedlen);
MD5Final (checksum, &context);
if (memcmp (checksum, stored_checksum, 16) != 0)
{
@@ -1899,6 +1930,19 @@ update_entries (data_arg, ent_list, short_pathname, filename)
change_mode (filename, stored_mode);
stored_mode_valid = 0;
+ if (stored_modtime_valid)
+ {
+ struct utimbuf t;
+
+ memset (&t, 0, sizeof (t));
+ /* There is probably little point in trying to preserved the
+ actime (or is there? What about Checked-in?). */
+ t.modtime = t.actime = stored_modtime;
+ if (utime (filename, &t) < 0)
+ error (0, errno, "cannot set time on %s", filename);
+ stored_modtime_valid = 0;
+ }
+
/*
* Process the entries line. Do this after we've written the file,
* since we need the timestamp.
@@ -2869,6 +2913,7 @@ struct response responses[] =
RSP_LINE("Patched", handle_patched, response_type_normal, rs_optional),
RSP_LINE("Rcs-diff", handle_rcs_diff, response_type_normal, rs_optional),
RSP_LINE("Mode", handle_mode, response_type_normal, rs_optional),
+ RSP_LINE("Mod-time", handle_mod_time, response_type_normal, rs_optional),
RSP_LINE("Removed", handle_removed, response_type_normal, rs_essential),
RSP_LINE("Remove-entry", handle_remove_entry, response_type_normal,
rs_optional),
@@ -3564,7 +3609,12 @@ start_server ()
#endif
case ext_method:
+#if defined (NO_EXT_METHOD)
+ error (0, 0, ":ext: method not supported by this port of CVS");
+ error (1, 0, "try :server: instead");
+#else
start_rsh_server (&tofd, &fromfd);
+#endif
break;
case server_method:
@@ -3873,6 +3923,8 @@ the :server: access method is not supported by this port of CVS");
walklist (variable_list, send_variable_proc, NULL);
}
+#ifndef NO_EXT_METHOD
+
/* Contact the server by starting it with rsh. */
/* Right now, we have two different definitions for this function,
@@ -4039,6 +4091,8 @@ start_rsh_server (tofdp, fromfdp)
#endif /* START_RSH_WITH_POPEN_RW */
+#endif /* NO_EXT_METHOD */
+
/* Send an argument STRING. */
diff --git a/contrib/cvs/src/cvs.h b/contrib/cvs/src/cvs.h
index 81659f3fb01b..80bb46895ea2 100644
--- a/contrib/cvs/src/cvs.h
+++ b/contrib/cvs/src/cvs.h
@@ -418,10 +418,16 @@ void Subdir_Register PROTO((List *, const char *, const char *));
void Subdir_Deregister PROTO((List *, const char *, const char *));
char *Make_Date PROTO((char *rawdate));
char *Name_Repository PROTO((char *dir, char *update_dir));
+
+
char *Name_Root PROTO((char *dir, char *update_dir));
int parse_cvsroot PROTO((char *CVSroot));
void set_local_cvsroot PROTO((char *dir));
void Create_Root PROTO((char *dir, char *rootdir));
+void root_allow_add PROTO ((char *));
+void root_allow_free PROTO ((void));
+int root_allow_ok PROTO ((char *));
+
int same_directories PROTO((char *dir1, char *dir2));
char *Short_Repository PROTO((char *repository));
char *gca PROTO((char *rev1, char *rev2));
diff --git a/contrib/cvs/src/find_names.c b/contrib/cvs/src/find_names.c
index a7a91bbfd3ec..5d2a79e89b9f 100644
--- a/contrib/cvs/src/find_names.c
+++ b/contrib/cvs/src/find_names.c
@@ -256,7 +256,7 @@ find_rcs (dir, list)
/* read the dir, grabbing the ,v files */
while ((dp = readdir (dirp)) != NULL)
{
- if (fnmatch (RCSPAT, dp->d_name, 0) == 0)
+ if (CVS_FNMATCH (RCSPAT, dp->d_name, 0) == 0)
{
char *comma;
@@ -320,7 +320,7 @@ find_dirs (dir, list, checkadm, entries)
continue;
#endif
/* don't bother stating ,v files */
- if (fnmatch (RCSPAT, dp->d_name, 0) == 0)
+ if (CVS_FNMATCH (RCSPAT, dp->d_name, 0) == 0)
continue;
expand_string (&tmp,
diff --git a/contrib/cvs/src/ignore.c b/contrib/cvs/src/ignore.c
index 05e2f1f342d2..908b5de0e1c2 100644
--- a/contrib/cvs/src/ignore.c
+++ b/contrib/cvs/src/ignore.c
@@ -269,7 +269,9 @@ ign_name (name)
{
/* We do a case-insensitive match by calling fnmatch on copies of
the pattern and the name which have been converted to
- lowercase. */
+ lowercase. FIXME: would be much cleaner to just unify this
+ with the other case-insensitive fnmatch stuff (FOLD_FN_CHAR
+ in lib/fnmatch.c; os2_fnmatch in emx/system.c). */
char *name_lower;
char *pat_lower;
char *p;
@@ -282,7 +284,7 @@ ign_name (name)
pat_lower = xstrdup (*cpp++);
for (p = pat_lower; *p != '\0'; ++p)
*p = tolower (*p);
- if (fnmatch (pat_lower, name_lower, 0) == 0)
+ if (CVS_FNMATCH (pat_lower, name_lower, 0) == 0)
goto matched;
free (pat_lower);
}
@@ -296,7 +298,7 @@ ign_name (name)
else
{
while (*cpp)
- if (fnmatch (*cpp++, name, 0) == 0)
+ if (CVS_FNMATCH (*cpp++, name, 0) == 0)
return 1;
return 0;
}
diff --git a/contrib/cvs/src/import.c b/contrib/cvs/src/import.c
index c05fa0df5153..3243a960274f 100644
--- a/contrib/cvs/src/import.c
+++ b/contrib/cvs/src/import.c
@@ -18,12 +18,11 @@
#include "cvs.h"
#include "savecwd.h"
+#include <assert.h>
#define FILE_HOLDER ".#cvsxxx"
static char *get_comment PROTO((char *user));
-static int add_rcs_file PROTO((char *message, char *rcs, char *user, char *vtag,
- int targc, char *targv[]));
static int expand_at_signs PROTO((char *buf, off_t size, FILE *fp));
static int add_rev PROTO((char *message, RCSNode *rcs, char *vfile,
char *vers));
@@ -475,7 +474,8 @@ process_import_file (message, vfile, vtag, targc, targv)
* repository nor in the Attic -- create it anew.
*/
add_log ('N', vfile);
- retval = add_rcs_file (message, rcs, vfile, vtag, targc, targv);
+ retval = add_rcs_file (message, rcs, vfile, vhead, vbranch,
+ vtag, targc, targv, logfp);
free (rcs);
return retval;
}
@@ -876,14 +876,36 @@ get_comment (user)
return retval;
}
-static int
-add_rcs_file (message, rcs, user, vtag, targc, targv)
+/* Create a new RCS file from scratch.
+
+ This probably should be moved to rcs.c now that it is called from
+ places outside import.c. */
+int
+add_rcs_file (message, rcs, user, add_vhead, add_vbranch, vtag, targc, targv,
+ add_logfp)
+ /* Log message for the addition. */
char *message;
+ /* Filename of the RCS file to create. */
char *rcs;
+ /* Filename of the file to serve as the contents of the initial
+ revision. */
char *user;
+
+ /* Revision number of head that we are adding. Normally 1.1 but
+ could be another revision as long as ADD_VBRANCH is a branch
+ from it. */
+ char *add_vhead;
+
+ /* Vendor branch to import to, or NULL if none. If non-NULL, then
+ vtag should also be non-NULL. */
+ char *add_vbranch;
char *vtag;
int targc;
char *targv[];
+
+ /* Write errors to here as well as via error (), or NULL if we should
+ use only error (). */
+ FILE *add_logfp;
{
FILE *fprcs, *fpuser;
struct stat sb;
@@ -918,7 +940,7 @@ add_rcs_file (message, rcs, user, vtag, targc, targv)
if (fpuser == NULL)
{
/* not fatal, continue import */
- fperror (logfp, 0, errno, "ERROR: cannot read file %s", userfile);
+ fperror (add_logfp, 0, errno, "ERROR: cannot read file %s", userfile);
error (0, errno, "ERROR: cannot read file %s", userfile);
goto read_error;
}
@@ -932,20 +954,36 @@ add_rcs_file (message, rcs, user, vtag, targc, targv)
/*
* putadmin()
*/
- if (fprintf (fprcs, "head %s;\012", vhead) < 0 ||
- fprintf (fprcs, "branch %s;\012", vbranch) < 0 ||
- fprintf (fprcs, "access ;\012") < 0 ||
+ if (fprintf (fprcs, "head %s;\012", add_vhead) < 0)
+ goto write_error;
+ if (add_vbranch != NULL)
+ {
+ if (fprintf (fprcs, "branch %s;\012", add_vbranch) < 0)
+ goto write_error;
+ }
+ if (fprintf (fprcs, "access ;\012") < 0 ||
fprintf (fprcs, "symbols ") < 0)
{
goto write_error;
}
- for (i = targc - 1; i >= 0; i--) /* RCS writes the symbols backwards */
- if (fprintf (fprcs, "%s:%s.1 ", targv[i], vbranch) < 0)
+ for (i = targc - 1; i >= 0; i--)
+ {
+ /* RCS writes the symbols backwards */
+ assert (add_vbranch != NULL);
+ if (fprintf (fprcs, "%s:%s.1 ", targv[i], add_vbranch) < 0)
goto write_error;
+ }
+
+ if (add_vbranch != NULL)
+ {
+ if (fprintf (fprcs, "%s:%s", vtag, add_vbranch) < 0)
+ goto write_error;
+ }
+ if (fprintf (fprcs, ";\012") < 0)
+ goto write_error;
- if (fprintf (fprcs, "%s:%s;\012", vtag, vbranch) < 0 ||
- fprintf (fprcs, "locks ; strict;\012") < 0 ||
+ if (fprintf (fprcs, "locks ; strict;\012") < 0 ||
/* XXX - make sure @@ processing works in the RCS file */
fprintf (fprcs, "comment @%s@;\012", get_comment (user)) < 0)
{
@@ -997,16 +1035,33 @@ add_rcs_file (message, rcs, user, vtag, targc, targv)
#endif
author = getcaller ();
- if (fprintf (fprcs, "\012%s\012", vhead) < 0 ||
- fprintf (fprcs, "date %s; author %s; state Exp;\012",
- altdate1, author) < 0 ||
- fprintf (fprcs, "branches %s.1;\012", vbranch) < 0 ||
- fprintf (fprcs, "next ;\012") < 0 ||
- fprintf (fprcs, "\012%s.1\012", vbranch) < 0 ||
+ if (fprintf (fprcs, "\012%s\012", add_vhead) < 0 ||
fprintf (fprcs, "date %s; author %s; state Exp;\012",
- altdate2, author) < 0 ||
- fprintf (fprcs, "branches ;\012") < 0 ||
- fprintf (fprcs, "next ;\012\012") < 0 ||
+ altdate1, author) < 0)
+ goto write_error;
+
+ if (fprintf (fprcs, "branches") < 0)
+ goto write_error;
+ if (add_vbranch != NULL)
+ {
+ if (fprintf (fprcs, " %s.1", add_vbranch) < 0)
+ goto write_error;
+ }
+ if (fprintf (fprcs, ";\012") < 0)
+ goto write_error;
+
+ if (fprintf (fprcs, "next ;\012") < 0)
+ goto write_error;
+ if (add_vbranch != NULL)
+ {
+ if (fprintf (fprcs, "\012%s.1\012", add_vbranch) < 0 ||
+ fprintf (fprcs, "date %s; author %s; state Exp;\012",
+ altdate2, author) < 0 ||
+ fprintf (fprcs, "branches ;\012") < 0 ||
+ fprintf (fprcs, "next ;\012\012") < 0)
+ goto write_error;
+ }
+ if (
/*
* putdesc()
*/
@@ -1015,9 +1070,23 @@ add_rcs_file (message, rcs, user, vtag, targc, targv)
/*
* putdelta()
*/
- fprintf (fprcs, "\012%s\012", vhead) < 0 ||
- fprintf (fprcs, "log\012") < 0 ||
- fprintf (fprcs, "@Initial revision\012@\012") < 0 ||
+ fprintf (fprcs, "\012%s\012", add_vhead) < 0 ||
+ fprintf (fprcs, "log\012@") < 0)
+ goto write_error;
+ if (add_vbranch != NULL)
+ {
+ /* We are going to put the log message in the revision on the
+ branch. So putting it here too seems kind of redundant, I
+ guess (and that is what CVS has always done, anyway). */
+ if (fprintf (fprcs, "Initial revision\012") < 0)
+ goto write_error;
+ }
+ else
+ {
+ if (expand_at_signs (message, (off_t) strlen (message), fprcs) < 0)
+ goto write_error;
+ }
+ if (fprintf (fprcs, "@\012") < 0 ||
fprintf (fprcs, "text\012@") < 0)
{
goto write_error;
@@ -1041,15 +1110,18 @@ add_rcs_file (message, rcs, user, vtag, targc, targv)
goto write_error;
}
}
- if (fprintf (fprcs, "@\012\012") < 0 ||
- fprintf (fprcs, "\012%s.1\012", vbranch) < 0 ||
- fprintf (fprcs, "log\012@") < 0 ||
- expand_at_signs (message, (off_t) strlen (message), fprcs) < 0 ||
- fprintf (fprcs, "@\012text\012") < 0 ||
- fprintf (fprcs, "@@\012") < 0)
- {
+ if (fprintf (fprcs, "@\012\012") < 0)
goto write_error;
+ if (add_vbranch != NULL)
+ {
+ if (fprintf (fprcs, "\012%s.1\012", add_vbranch) < 0 ||
+ fprintf (fprcs, "log\012@") < 0 ||
+ expand_at_signs (message, (off_t) strlen (message), fprcs) < 0 ||
+ fprintf (fprcs, "@\012text\012") < 0 ||
+ fprintf (fprcs, "@@\012") < 0)
+ goto write_error;
}
+
if (fclose (fprcs) == EOF)
{
ierrno = errno;
@@ -1071,7 +1143,7 @@ add_rcs_file (message, rcs, user, vtag, targc, targv)
if (chmod (rcs, mode) < 0)
{
ierrno = errno;
- fperror (logfp, 0, ierrno,
+ fperror (add_logfp, 0, ierrno,
"WARNING: cannot change mode of file %s", rcs);
error (0, ierrno, "WARNING: cannot change mode of file %s", rcs);
err++;
@@ -1088,12 +1160,12 @@ write_error:
(void) fclose (fprcs);
write_error_noclose:
(void) fclose (fpuser);
- fperror (logfp, 0, ierrno, "ERROR: cannot write file %s", rcs);
+ fperror (add_logfp, 0, ierrno, "ERROR: cannot write file %s", rcs);
error (0, ierrno, "ERROR: cannot write file %s", rcs);
if (ierrno == ENOSPC)
{
(void) CVS_UNLINK (rcs);
- fperror (logfp, 0, 0, "ERROR: out of space - aborting");
+ fperror (add_logfp, 0, 0, "ERROR: out of space - aborting");
error (1, 0, "ERROR: out of space - aborting");
}
read_error:
diff --git a/contrib/cvs/src/lock.c b/contrib/cvs/src/lock.c
index f84eccf1852c..babadefafba6 100644
--- a/contrib/cvs/src/lock.c
+++ b/contrib/cvs/src/lock.c
@@ -485,7 +485,7 @@ again:
errno = 0;
while ((dp = readdir (dirp)) != NULL)
{
- if (fnmatch (CVSRFLPAT, dp->d_name, 0) == 0)
+ if (CVS_FNMATCH (CVSRFLPAT, dp->d_name, 0) == 0)
{
#ifdef CVS_FUDGELOCKS
time_t now;
diff --git a/contrib/cvs/src/main.c b/contrib/cvs/src/main.c
index fcb80a388ce6..3352f605efd7 100644
--- a/contrib/cvs/src/main.c
+++ b/contrib/cvs/src/main.c
@@ -338,13 +338,14 @@ main (argc, argv)
lets us support the `cvs -H cmd'
convention to give help for cmd. */
static struct option long_options[] =
- {
+ {
{"help", 0, NULL, 'H'},
{"version", 0, NULL, 'v'},
{"help-commands", 0, NULL, 1},
{"help-synonyms", 0, NULL, 2},
+ {"allow-root", required_argument, NULL, 3},
{0, 0, 0, 0}
- };
+ };
/* `getopt_long' stores the option index here, but right now we
don't use it. */
int option_index = 0;
@@ -435,9 +436,9 @@ main (argc, argv)
while ((c = getopt_long
(argc, argv, "+Qqrwtnlvb:T:e:d:Hfz:s:x", long_options, &option_index))
!= EOF)
- {
+ {
switch (c)
- {
+ {
case 1:
/* --help-commands */
usage (cmd_usage);
@@ -446,6 +447,10 @@ main (argc, argv)
/* --help-synonyms */
usage (cmd_synonyms());
break;
+ case 3:
+ /* --allow-root */
+ root_allow_add (optarg);
+ break;
case 'Q':
really_quiet = TRUE;
/* FALL THROUGH */
@@ -603,6 +608,12 @@ main (argc, argv)
#if defined(AUTH_SERVER_SUPPORT) && defined(SERVER_SUPPORT)
if (strcmp (command_name, "pserver") == 0)
{
+ /* The reason that --allow-root is not a command option
+ is mainly the comment in server() about how argc,argv
+ might be from .cvsrc. I'm not sure about that, and
+ I'm not sure it is only true of command options, but
+ it seems easier to make it a global option. */
+
/* Gets username and password from client, authenticates, then
switches to run as that user and sends an ACK back to the
client. */
@@ -878,6 +889,7 @@ main (argc, argv)
free (Tmpdir);
if (free_Rcsbin)
free (Rcsbin);
+ root_allow_free ();
#ifdef SYSTEM_CLEANUP
/* Hook for OS-specific behavior, for example socket subsystems on
diff --git a/contrib/cvs/src/mkmodules.c b/contrib/cvs/src/mkmodules.c
index cff993a6f2bc..ec5d7703f76e 100644
--- a/contrib/cvs/src/mkmodules.c
+++ b/contrib/cvs/src/mkmodules.c
@@ -708,6 +708,8 @@ init (argc, argv)
char *info;
/* Name of ,v file for this administrative file. */
char *info_v;
+ /* Exit status. */
+ int err;
const struct admin_file *fileptr;
@@ -739,7 +741,10 @@ init (argc, argv)
strcat (adm, CVSROOTADM);
mkdir_if_needed (adm);
- /* This is needed by the call to "ci" below. */
+ /* This is needed because we pass "fileptr->filename" not "info"
+ to add_rcs_file below. I think this would be easy to change,
+ thus nuking the need for CVS_CHDIR here, but I haven't looked
+ closely (e.g. see wrappers calls within add_rcs_file). */
if ( CVS_CHDIR (adm) < 0)
error (1, errno, "cannot change to directory %s", adm);
@@ -776,16 +781,15 @@ init (argc, argv)
if (fclose (fp) < 0)
error (1, errno, "cannot close %s", info);
}
- /* Now check the file in. FIXME: we could be using
- add_rcs_file from import.c which is faster (if it were
- tweaked slightly). */
- run_setup ("%s%s -x,v/ -q -u -t-", Rcsbin, RCS_CI);
- run_args ("-minitial checkin of %s", fileptr->filename);
- run_arg (fileptr->filename);
- retcode = run_exec (RUN_TTY, RUN_TTY, RUN_TTY, RUN_NORMAL);
+ /* The message used to say " of " and fileptr->filename after
+ "initial checkin" but I fail to see the point as we know what
+ file it is from the name. */
+ retcode = add_rcs_file ("initial checkin", info_v,
+ fileptr->filename, "1.1", NULL, NULL,
+ 0, NULL, NULL);
if (retcode != 0)
- error (1, retcode == -1 ? errno : 0,
- "failed to check in %s", info);
+ /* add_rcs_file already printed an error message. */
+ err = 1;
}
}
diff --git a/contrib/cvs/src/patch.c b/contrib/cvs/src/patch.c
index 1cf83971ed35..194999be6512 100644
--- a/contrib/cvs/src/patch.c
+++ b/contrib/cvs/src/patch.c
@@ -514,7 +514,9 @@ patch_fileproc (callerdat, finfo)
memset ((char *) &t, 0, sizeof (t));
if ((t.actime = t.modtime = RCS_getrevtime (rcsfile, vers_tag,
(char *) 0, 0)) != -1)
- (void) utime (tmpfile1, &t);
+ /* I believe this timestamp only affects the dates in our diffs,
+ and therefore should be on the server, not the client. */
+ (void) utime (tmpfile1, &t);
}
else if (toptwo_diffs)
{
@@ -536,7 +538,9 @@ patch_fileproc (callerdat, finfo)
}
if ((t.actime = t.modtime = RCS_getrevtime (rcsfile, vers_head,
(char *) 0, 0)) != -1)
- (void) utime (tmpfile2, &t);
+ /* I believe this timestamp only affects the dates in our diffs,
+ and therefore should be on the server, not the client. */
+ (void) utime (tmpfile2, &t);
}
run_setup ("%s -%c", DIFF, unidiff ? 'u' : 'c');
run_arg (tmpfile1);
diff --git a/contrib/cvs/src/rcs.c b/contrib/cvs/src/rcs.c
index 8be6ea4a612d..a49c44921750 100644
--- a/contrib/cvs/src/rcs.c
+++ b/contrib/cvs/src/rcs.c
@@ -1048,8 +1048,13 @@ getrcsrev (fp, revp)
do {
c = getc (fp);
if (c == EOF)
+ {
/* FIXME: should be including filename in error message. */
- error (1, errno, "cannot read rcs file");
+ if (ferror (fp))
+ error (1, errno, "cannot read rcs file");
+ else
+ error (1, 0, "unexpected end of file reading rcs file");
+ }
} while (whitespace (c));
if (!(isdigit (c) || c == '.'))
@@ -1073,7 +1078,10 @@ getrcsrev (fp, revp)
if (c == EOF)
{
/* FIXME: should be including filename in error message. */
- error (1, errno, "cannot read rcs file");
+ if (ferror (fp))
+ error (1, errno, "cannot read rcs file");
+ else
+ error (1, 0, "unexpected end of file reading rcs file");
}
}
diff --git a/contrib/cvs/src/rcs.h b/contrib/cvs/src/rcs.h
index 3de8c9120820..1855fb99c760 100644
--- a/contrib/cvs/src/rcs.h
+++ b/contrib/cvs/src/rcs.h
@@ -126,3 +126,7 @@ int RCS_lock PROTO ((RCSNode *, const char *, int));
int RCS_unlock PROTO ((RCSNode *, const char *, int));
int rcs_change_text PROTO ((const char *, char *, size_t, const char *,
size_t, char **, size_t *));
+
+/* From import.c. */
+extern int add_rcs_file PROTO ((char *, char *, char *, char *,
+ char *, char *, int, char **, FILE *));
diff --git a/contrib/cvs/src/rcscmds.c b/contrib/cvs/src/rcscmds.c
index 1f93fcfb94ee..1f356cfd8f8b 100644
--- a/contrib/cvs/src/rcscmds.c
+++ b/contrib/cvs/src/rcscmds.c
@@ -199,7 +199,7 @@ RCS_checkin (rcsfile, workfile, message, rev, flags)
if (!existence_error (errno))
error (0, errno, "warning: cannot stat %s", rcsfile);
}
- run_setup ("%s%s -x,v/ -f %s%s", Rcsbin, RCS_CI,
+ run_setup ("%s%s -x,v/ -w%s -f %s%s", Rcsbin, RCS_CI, getcaller (),
rev ? "-r" : "", rev ? rev : "");
if (flags & RCS_FLAGS_DEAD)
run_arg ("-sdead");
diff --git a/contrib/cvs/src/root.c b/contrib/cvs/src/root.c
index 26910328fe90..bf5c89e7a273 100644
--- a/contrib/cvs/src/root.c
+++ b/contrib/cvs/src/root.c
@@ -199,6 +199,86 @@ Create_Root (dir, rootdir)
#endif /* ! DEBUG */
+/* The root_allow_* stuff maintains a list of legal CVSROOT
+ directories. Then we can check against them when a remote user
+ hands us a CVSROOT directory. */
+
+static unsigned int root_allow_count;
+static char **root_allow_vector;
+static unsigned int root_allow_size;
+
+void
+root_allow_add (arg)
+ char *arg;
+{
+ char *p;
+
+ if (root_allow_size <= root_allow_count)
+ {
+ if (root_allow_size == 0)
+ {
+ root_allow_size = 1;
+ root_allow_vector =
+ (char **) malloc (root_allow_size * sizeof (char *));
+ }
+ else
+ {
+ root_allow_size *= 2;
+ root_allow_vector =
+ (char **) realloc (root_allow_vector,
+ root_allow_size * sizeof (char *));
+ }
+
+ if (root_allow_vector == NULL)
+ {
+ no_memory:
+ /* Strictly speaking, we're not supposed to output anything
+ now. But we're about to exit(), give it a try. */
+ printf ("E Fatal server error, aborting.\n\
+error ENOMEM Virtual memory exhausted.\n");
+
+ /* I'm doing this manually rather than via error_exit ()
+ because I'm not sure whether we want to call server_cleanup.
+ Needs more investigation.... */
+
+#ifdef SYSTEM_CLEANUP
+ /* Hook for OS-specific behavior, for example socket
+ subsystems on NT and OS2 or dealing with windows
+ and arguments on Mac. */
+ SYSTEM_CLEANUP ();
+#endif
+
+ exit (EXIT_FAILURE);
+ }
+ }
+ p = malloc (strlen (arg) + 1);
+ if (p == NULL)
+ goto no_memory;
+ strcpy (p, arg);
+ root_allow_vector[root_allow_count++] = p;
+}
+
+void
+root_allow_free ()
+{
+ if (root_allow_vector != NULL)
+ free (root_allow_vector);
+ root_allow_count = 0;
+ root_allow_size = 0;
+}
+
+int
+root_allow_ok (arg)
+ char *arg;
+{
+ unsigned int i;
+ for (i = 0; i < root_allow_count; ++i)
+ if (strcmp (root_allow_vector[i], arg) == 0)
+ return 1;
+ return 0;
+}
+
+
/* Parse a CVSROOT variable into its constituent parts -- method,
* username, hostname, directory. The prototypical CVSROOT variable
* looks like:
diff --git a/contrib/cvs/src/run.c b/contrib/cvs/src/run.c
index 74e418dc3edd..5b59bca98331 100644
--- a/contrib/cvs/src/run.c
+++ b/contrib/cvs/src/run.c
@@ -445,6 +445,13 @@ piped_child (command, tofdp, fromfdp)
if (pipe (from_child_pipe) < 0)
error (1, errno, "cannot create pipe");
+#ifdef USE_SETMODE_BINARY
+ setmode (to_child_pipe[0], O_BINARY);
+ setmode (to_child_pipe[1], O_BINARY);
+ setmode (from_child_pipe[0], O_BINARY);
+ setmode (from_child_pipe[1], O_BINARY);
+#endif
+
#ifdef HAVE_VFORK
pid = vfork ();
#else
@@ -506,6 +513,11 @@ filter_stream_through_program (oldfd, dir, prog, pidp)
if (pipe (p))
error (1, errno, "cannot create pipe");
+#ifdef USE_SETMODE_BINARY
+ setmode (p[0], O_BINARY);
+ setmode (p[1], O_BINARY);
+#endif
+
#ifdef HAVE_VFORK
newpid = vfork ();
#else
diff --git a/contrib/cvs/src/sanity.sh b/contrib/cvs/src/sanity.sh
index 38e32b46b3bf..a815fc0539cd 100755
--- a/contrib/cvs/src/sanity.sh
+++ b/contrib/cvs/src/sanity.sh
@@ -481,9 +481,9 @@ if test x"$*" = x; then
tests="basica basicb basic1 deep basic2 rdiff death death2 branches"
tests="${tests} multibranch import join new newb conflicts conflicts2"
tests="${tests} modules modules2 modules3 mflag errmsg1 devcom devcom2"
- tests="${tests} devcom3 ignore binfiles binfiles2 binwrap info"
- tests="${tests} serverpatch log log2 crerepos rcs big modes"
- tests="${tests} sticky keyword"
+ tests="${tests} devcom3 ignore binfiles binfiles2 binwrap mwrap info"
+ tests="${tests} serverpatch log log2 crerepos rcs big modes stamps"
+ tests="${tests} sticky keyword toplevel"
else
tests="$*"
fi
@@ -560,7 +560,7 @@ for what in $tests; do
dotest basica-0b "${testcvs} add first-dir" \
"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
cd ..
- rm -rf 1
+ rm -r 1
dotest basica-1 "${testcvs} -q co first-dir" ''
cd first-dir
@@ -716,21 +716,21 @@ diff -r1\.2 -r1\.3"
"${PROG} [a-z]*: scheduling file .topfile. for addition
${PROG} [a-z]*: use .cvs commit. to add this file permanently"
dotest basicb-0c "${testcvs} -q ci -m add-it topfile" \
-"RCS file: ${TESTDIR}/cvsroot/./topfile,v
+"RCS file: ${TESTDIR}/cvsroot/\./topfile,v
done
Checking in topfile;
-${TESTDIR}/cvsroot/./topfile,v <-- topfile
+${TESTDIR}/cvsroot/\./topfile,v <-- topfile
initial revision: 1\.1
done"
cd ..
- rm -rf 1
+ rm -r 1
mkdir 2; cd 2
dotest basicb-0d "${testcvs} -q co -l ." "U topfile"
mkdir first-dir
dotest basicb-0e "${testcvs} add first-dir" \
"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
cd ..
- rm -rf 2
+ rm -r 2
: mkdir ${CVSROOT_DIRNAME}/first-dir
dotest basicb-1 "${testcvs} -q co first-dir" ''
@@ -819,9 +819,9 @@ done"
dotest basicb-cod-1 "${testcvs} -q co -d first-dir1 first-dir" \
'U first-dir1/sdir1/sfile1
U first-dir1/sdir2/sfile2'
- rm -rf first-dir1
+ rm -r first-dir1
- rm -rf first-dir
+ rm -r first-dir
dotest basicb-9 \
"${testcvs} -q co -d newdir -r release-1 first-dir/sdir1 first-dir/sdir2" \
'U newdir/sdir1/sfile1
@@ -836,7 +836,7 @@ U newdir/sdir2/sfile2'
"sfile1 develops
sfile2 starts"
- rm -rf newdir
+ rm -r newdir
# Hmm, this might be a case for CVSNULLREPOS, but CVS doesn't
# seem to deal with it...
@@ -873,7 +873,7 @@ ${TESTDIR}/cvsroot/second-dir/aa,v <-- aa
initial revision: 1\.1
done"
cd ../..
- rm -rf 1
+ rm -r 1
# Now here is the kicker: note that the semantics of -d
# are fundamentally different if we specify two or more directories
# rather than one! I consider this to be seriously bogus,
@@ -914,10 +914,16 @@ done"
cd ..
rmdir 1
- rm -rf test2
+ if test "$keep" = yes; then
+ echo Keeping ${TESTDIR} and exiting due to --keep
+ exit 0
+ fi
+
+ rm -r test2
rm -rf ${CVSROOT_DIRNAME}/first-dir
rm -rf ${CVSROOT_DIRNAME}/second-dir
+ rm -rf ${CVSROOT_DIRNAME}/CVSROOT/Emptydir
rm -f ${CVSROOT_DIRNAME}/topfile,v
;;
@@ -1292,7 +1298,7 @@ done"
exit 0
fi
- rm -rf 1
+ rm -r 1
rm -rf ${CVSROOT_DIRNAME}/first-dir
;;
@@ -1384,7 +1390,7 @@ done"
# CVS *will* recreate it, and we might want to make it so
# that "cvs release -d" is the way to delete the directory
# and have it stay gone -kingdon, Oct1996).
- rm -rf dir6
+ rm -r dir6
dotest deep-4b1 "${testcvs} -q update" ''
dotest deep-4b2 "${testcvs} -q update -d -P" \
'U dir6/file1
@@ -1624,7 +1630,6 @@ done"
fi
# now export by rtagged-by-head and rtagged-by-tag and compare.
- rm -rf first-dir
if ${CVS} export -r rtagged-by-head first-dir ; then
echo "PASS: test 50" >>${LOGFILE}
else
@@ -1645,7 +1650,7 @@ done"
else
echo "PASS: test 52" >>${LOGFILE}
fi
- rm -rf 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
@@ -1704,9 +1709,9 @@ No conflicts created by this import"
echo "PASS: test 58" >>${LOGFILE}
fi
- rm -rf second-dir
+ rm -r second-dir
- rm -rf export-dir first-dir
+ rm -r export-dir first-dir
mkdir first-dir
(cd first-dir.cpy ; tar cf - . | (cd ../first-dir ; tar xf -))
@@ -1755,7 +1760,7 @@ No conflicts created by this import"
# else
# echo "PASS: test 63" >>${LOGFILE}
# fi
- rm -rf 1dir first-dir
+ rm -r 1dir first-dir
# Test the cvs history command.
@@ -1879,7 +1884,7 @@ File: foo Status: Up-to-date
TRDIFF (branch: 1\.1\.1)"
cd ..
- rm -rf trdiff
+ rm -r trdiff
dotest rdiff-8 \
"${testcvs} rdiff -r T1 -r local-v0 trdiff" \
@@ -1913,7 +1918,7 @@ diff -c /dev/null trdiff/new:1\.1
# fi
cd ..
- rm -rf testimport
+ rm -r testimport
rm -rf ${CVSROOT_DIRNAME}/trdiff
;;
@@ -2225,7 +2230,7 @@ done"
dotest 89a "${testcvs} -q co first-dir" 'U first-dir/file1
U first-dir/file3'
cd ..
- rm -rf 2
+ rm -r 2
cd first-dir
# remove first file.
@@ -3073,8 +3078,10 @@ import should not expand \$''Id: imported-f2,v 1\.1\.1\.2 [0-9/]* [0-9:]* [a-z0-
rev 2 of file 2
[>]>>>>>> 1\.1\.1\.2'
- cd .. ; rm -rf first-dir ${CVSROOT_DIRNAME}/first-dir
- rm -rf import-dir
+ cd ..
+ rm -r first-dir
+ rm -rf ${CVSROOT_DIRNAME}/first-dir
+ rm -r import-dir
;;
join)
@@ -3360,7 +3367,7 @@ M file4'
# revision which can be used as the source for files added
# on branches.
cd ../../3
- rm -rf first-dir
+ rm -r first-dir
dotest join-20 "${testcvs} -q co -jbranch first-dir" \
"U first-dir/file1
U first-dir/file2
@@ -3384,7 +3391,7 @@ R file3'
# Checkout the main line again.
cd ../../1
- rm -rf first-dir
+ rm -r first-dir
dotest join-22 "${testcvs} -q co first-dir" \
'U first-dir/file2
U first-dir/file3
@@ -3415,7 +3422,8 @@ R file3
M file4'
cd ../..
- rm -rf 1 2 3 ${CVSROOT_DIRNAME}/first-dir
+ rm -r 1 2 3
+ rm -rf ${CVSROOT_DIRNAME}/first-dir
;;
new) # look for stray "no longer pertinent" messages.
@@ -3468,7 +3476,9 @@ M file4'
echo "PASS: test 123" >>${LOGFILE}
fi
- cd .. ; rm -rf first-dir ; rm -rf ${CVSROOT_DIRNAME}/first-dir
+ cd ..
+ rm -r first-dir
+ rm -rf ${CVSROOT_DIRNAME}/first-dir
;;
newb)
@@ -3499,7 +3509,7 @@ done"
# Check out the branch.
cd ..
- rm -rf first-dir
+ rm -r first-dir
mkdir 1
cd 1
dotest newb-123e "${testcvs} -q co -r branch first-dir" \
@@ -3526,7 +3536,7 @@ done"
# that the file is not pertinent, but it should not
# say anything else.
cd ..
- rm -rf first-dir
+ rm -r first-dir
dotest newb-123i "${testcvs} -q co -r branch first-dir/a" \
"${PROG} [a-z]*: warning: first-dir/a is not (any longer) pertinent"
@@ -3555,7 +3565,8 @@ File: a Status: Needs \(Patch\|Checkout\)
fi
cd ../..
- rm -rf 1 2 ; rm -rf ${CVSROOT_DIRNAME}/first-dir
+ rm -r 1 2
+ rm -rf ${CVSROOT_DIRNAME}/first-dir
;;
conflicts)
@@ -3795,7 +3806,7 @@ File: a Status: Up-to-date
echo 'FAIL: test 142' | tee -a ${LOGFILE}
fi
cd ../..
- rm -rf 1 2 3 ; rm -rf ${CVSROOT_DIRNAME}/first-dir
+ rm -r 1 2 3 ; rm -rf ${CVSROOT_DIRNAME}/first-dir
;;
conflicts2)
@@ -3915,7 +3926,7 @@ C aa\.c"
fi
cd ../..
- rm -rf 1 2 ; rm -rf ${CVSROOT_DIRNAME}/first-dir
+ rm -r 1 2 ; rm -rf ${CVSROOT_DIRNAME}/first-dir
;;
modules)
@@ -4089,7 +4100,7 @@ realmodule NONE first-dir/subdir a'
else
echo 'PASS: test 150g2' >>${LOGFILE}
fi
- rm -rf dirmodule
+ rm -r dirmodule
# Now test that a module using -d checks out to the specified
# directory.
@@ -4141,7 +4152,7 @@ U nameddir/b'
fi
cd ..
- rm -rf 1
+ rm -r 1
mkdir 2
cd 2
@@ -4155,7 +4166,7 @@ U nameddir/b'
"CVS
first-dir"
cd ..
- rm -rf 2
+ rm -r 2
# Test checking out everything.
mkdir 1
@@ -4165,7 +4176,7 @@ first-dir"
U first-dir/subdir/a
U first-dir/subdir/b"
cd ..
- rm -rf 1
+ rm -r 1
# Test checking out a module which lists at least two
# specific files twice. At one time, this failed over
@@ -4198,13 +4209,13 @@ initial revision: 1\.1
done"
cd ..
- rm -rf first-dir
+ rm -r first-dir
dotest modules-155c4 "${testcvs} -q co topfiles" \
"U first-dir/file1
U first-dir/file2"
dotest modules-155c5 "${testcvs} -q co topfiles" ""
cd ..
- rm -rf 1
+ rm -r 1
rm -rf ${CVSROOT_DIRNAME}/first-dir
;;
@@ -4269,9 +4280,9 @@ ${PROG} [a-z]*: Rebuilding administrative file database"
${PROG} \[[a-z]* aborted\]: cannot expand modules"
# Clean up.
- rm -rf CVSROOT
+ rm -r CVSROOT
cd ..
- rm -rf 1
+ rm -r 1
rm -rf ${CVSROOT_DIRNAME}/first-dir
rm -rf ${CVSROOT_DIRNAME}/second-dir
;;
@@ -4322,7 +4333,7 @@ ${PROG} [a-z]*: Rebuilding administrative file database"
cd ..
dotest modules3-6 "${testcvs} -q co bigmod" ''
- rm -rf first-dir
+ rm -r first-dir
dotest modules3-7 "${testcvs} -q co bigmod" 'U first-dir/file1'
cd ..
rm -r 1
@@ -4481,7 +4492,7 @@ done"
exit 1
fi
# Test handling of -m during ci
- cd ..; rm -rf a-dir;
+ cd ..; rm -r a-dir
if ${testcvs} co a-dir >>${LOGFILE} 2>&1; then
echo 'PASS: test 158' >>${LOGFILE}
else
@@ -4511,7 +4522,9 @@ done"
exit 1
fi
# Clean up
- cd ..; rm -rf a-dir ${CVSROOT_DIRNAME}/a-dir
+ cd ..
+ rm -r a-dir
+ rm -rf ${CVSROOT_DIRNAME}/a-dir
done
;;
errmsg1)
@@ -4583,7 +4596,8 @@ EOF
cd ..
chmod u+w 1dir
cd ..
- rm -rf 1 2 ${CVSROOT_DIRNAME}/1dir
+ rm -r 1 2
+ rm -rf ${CVSROOT_DIRNAME}/1dir
;;
devcom)
@@ -4781,6 +4795,7 @@ T abc'
dotest devcom-t1 "${testcvs} -q co -rtag first-dir/abb" \
'U first-dir/abb'
cd ..
+ # Since first-dir/abb is readonly, use -f.
rm -rf 3
# Now remove all the file attributes
@@ -4806,7 +4821,9 @@ U first-dir/abc'
exit 0
fi
- rm -rf 1 2 3 ${CVSROOT_DIRNAME}/first-dir
+ # Use -f because of the readonly files.
+ rm -rf 1 2 3
+ rm -rf ${CVSROOT_DIRNAME}/first-dir
;;
devcom2)
@@ -4857,7 +4874,9 @@ U first-dir/w3'
dotest_fail devcom2-11 "test -w first-dir/w3" ''
cd ..
- rm -rf 1 2 ${CVSROOT_DIRNAME}/first-dir
+ # Use -f because of the readonly files.
+ rm -rf 1 2
+ rm -rf ${CVSROOT_DIRNAME}/first-dir
;;
devcom3)
@@ -4912,7 +4931,9 @@ G@#..!@#=&"
cd ../..
- rm -rf 1 ${CVSROOT_DIRNAME}/first-dir
+ # Use -f because of the readonly files.
+ rm -rf 1
+ rm -rf ${CVSROOT_DIRNAME}/first-dir
;;
ignore)
@@ -4976,7 +4997,7 @@ N second-dir/optig.c
No conflicts created by this import'
cd ..
- rm -rf dir-to-import
+ rm -r dir-to-import
mkdir 1
cd 1
@@ -5069,7 +5090,7 @@ Are you sure you want to release (and delete) directory .first-dir': "
You have \[1\] altered files in this repository.
Are you sure you want to release (and delete) directory .second-dir': "
cd ..
- rm -rf 1
+ rm -r 1
rm ${TESTDIR}/ignore.tmp
rm -rf ${CVSROOT_DIRNAME}/first-dir ${CVSROOT_DIRNAME}/second-dir
;;
@@ -5130,7 +5151,7 @@ File: binfile Status: Up-to-date
Sticky Date: (none)
Sticky Options: -kb"
cd ../..
- rm -rf 3
+ rm -r 3
cd 2/first-dir
cp ../../1/binfile2.dat binfile
@@ -5180,7 +5201,7 @@ done"
fi
cd ../..
- rm -rf 1
+ rm -r 1
mkdir 3
cd 3
@@ -5197,7 +5218,7 @@ File: binfile Status: Up-to-date
Sticky Date: (none)
Sticky Options: -kb"
cd ../..
- rm -rf 3
+ rm -r 3
cd 2/first-dir
echo 'this file is $''RCSfile$' >binfile
@@ -5348,7 +5369,7 @@ done"
fail binwrap-1
fi
cd ..
- rm -rf dir-to-import
+ rm -r dir-to-import
dotest binwrap-2 "${testcvs} -q co first-dir" 'U first-dir/foo.c
U first-dir/foo.exe'
dotest binwrap-3 "${testcvs} -q status first-dir" \
@@ -5369,7 +5390,75 @@ File: foo\.exe Status: Up-to-date
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: -kb"
- rm -rf first-dir ${CVSROOT_DIRNAME}/first-dir
+ rm -r first-dir
+ rm -rf ${CVSROOT_DIRNAME}/first-dir
+ ;;
+
+ mwrap)
+ # Tests relating to the -m wrappers options. -k tests are in
+ # binwrap and -t/-f tests haven't been written yet.
+ dotest mwrap-c1 "${testcvs} -q co CVSROOT" "[UP] CVSROOT${DOTSTAR}"
+ cd CVSROOT
+ echo "* -m 'COPY'" >>cvswrappers
+ dotest mwrap-c2 "${testcvs} -q ci -m wrapper-mod" \
+"Checking in cvswrappers;
+${TESTDIR}/cvsroot/CVSROOT/cvswrappers,v <-- cvswrappers
+new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
+done
+${PROG} [a-z]*: Rebuilding administrative file database"
+ cd ..
+ mkdir m1; cd m1
+ 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"
+ cd first-dir
+ touch aa
+ dotest mwrap-3 "${testcvs} add aa" \
+"${PROG} [a-z]*: scheduling file .aa. for addition
+${PROG} [a-z]*: use .cvs commit. to add this file permanently"
+ dotest mwrap-4 "${testcvs} -q ci -m add" \
+"RCS file: ${TESTDIR}/cvsroot/first-dir/aa,v
+done
+Checking in aa;
+${TESTDIR}/cvsroot/first-dir/aa,v <-- aa
+initial revision: 1\.1
+done"
+ cd ../..
+ mkdir m2; cd m2
+ dotest mwrap-5 "${testcvs} -q co first-dir" "U first-dir/aa"
+ cd first-dir
+ echo "changed in m2" >aa
+ dotest mwrap-6 "${testcvs} -q ci -m m2-mod" \
+"Checking in aa;
+${TESTDIR}/cvsroot/first-dir/aa,v <-- aa
+new revision: 1\.2; previous revision: 1\.1
+done"
+ cd ../..
+ cd m1/first-dir
+ echo "changed in m1" >aa
+ dotest_fail mwrap-7 "${testcvs} -nq update" "C aa"
+ dotest_fail mwrap-8 "${testcvs} -q update" \
+"${PROG} [a-z]*: A -m .COPY. wrapper is specified
+${PROG} [a-z]*: but file aa needs merge
+${PROG} \[[a-z]* aborted\]: You probably want to avoid -m .COPY. wrappers"
+ # Under the old, dangerous behavior, this would have been
+ # "changed in m2" -- that is, the changes in the working directory
+ # would have been clobbered (!).
+ dotest mwrap-9 "cat aa" "changed in m1"
+ cd ../..
+ cd CVSROOT
+ echo '# comment out' >cvswrappers
+ dotest mwrap-ce "${testcvs} -q ci -m wrapper-mod" \
+"Checking in cvswrappers;
+${TESTDIR}/cvsroot/CVSROOT/cvswrappers,v <-- cvswrappers
+new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
+done
+${PROG} [a-z]*: Rebuilding administrative file database"
+ cd ..
+ rm -r CVSROOT
+ rm -r m1 m2
+ rm -rf ${CVSROOT_DIRNAME}/first-dir
;;
info)
@@ -5571,7 +5660,8 @@ done"
U file1'
cd ../..
- rm -rf 1 2 ${CVSROOT_DIRNAME}/first-dir
+ rm -r 1 2
+ rm -rf ${CVSROOT_DIRNAME}/first-dir
;;
log)
@@ -5797,7 +5887,8 @@ ${log_rev1}
${log_trailer}"
cd ..
- rm -rf first-dir ${CVSROOT_DIRNAME}/first-dir
+ rm -r first-dir
+ rm -rf ${CVSROOT_DIRNAME}/first-dir
;;
log2)
@@ -5840,7 +5931,8 @@ date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
============================================================================="
cd ..
- rm -rf first-dir ${CVSROOT_DIRNAME}/first-dir
+ rm -r first-dir
+ rm -rf ${CVSROOT_DIRNAME}/first-dir
fi # end of tests skipped for remote
@@ -5886,7 +5978,7 @@ ${testcvs} -d ${TESTDIR}/crerepos release -d CVSROOT >>${LOGFILE}; then
else
fail crerepos-5
fi
- rm -rf CVS
+ rm -r CVS
cd ..
# The directory tmp should be empty
dotest crerepos-6 "rmdir tmp" ''
@@ -5905,13 +5997,13 @@ ${testcvs} -d ${TESTDIR}/crerepos release -d CVSROOT >>${LOGFILE}; then
dotest_fail crerepos-6a "${testcvs} -q -d ../crerepos get ." \
"${PROG} \[[a-z]* aborted\]: CVSROOT ../crerepos must be an absolute pathname"
cd ..
- rm -rf 1
+ 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"
cd ..
- rm -rf 1
+ rm -r 1
else # remote
# Test that CVS rejects a relative path in CVSROOT.
mkdir 1; cd 1
@@ -5919,14 +6011,14 @@ ${testcvs} -d ${TESTDIR}/crerepos release -d CVSROOT >>${LOGFILE}; then
"${testcvs} -q -d :ext:`hostname`:../crerepos get ." \
"Root ../crerepos must be an absolute pathname"
cd ..
- rm -rf 1
+ rm -r 1
mkdir 1; cd 1
dotest_fail crerepos-6b \
"${testcvs} -d :ext:`hostname`:crerepos init" \
"Root crerepos must be an absolute pathname"
cd ..
- rm -rf 1
+ rm -r 1
fi # end of tests to be skipped for remote
# CVS better not create a history file--if the administrator
@@ -6108,8 +6200,10 @@ add file1
else
fail rcs-4
fi
+ cd ..
- rm -rf first-dir ${CVSROOT_DIRNAME}/first-dir ${TESTDIR}/rcs4.tmp
+ rm -r first-dir ${TESTDIR}/rcs4.tmp
+ rm -rf ${CVSROOT_DIRNAME}/first-dir
;;
big)
@@ -6146,7 +6240,7 @@ ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
initial revision: 1\.1
done"
cd ..
- rm -rf first-dir
+ rm -r first-dir
dotest big-4 "${testcvs} -q get first-dir" "U first-dir/file1"
if test "$keep" = yes; then
@@ -6154,7 +6248,7 @@ done"
exit 0
fi
- rm -rf first-dir
+ rm -r first-dir
rm -rf ${CVSROOT_DIRNAME}/first-dir
;;
@@ -6276,11 +6370,152 @@ done"
fi
cd ../..
- rm -rf 1 ${CVSROOT_DIRNAME}/first-dir
+ rm -r 1
+ rm -rf ${CVSROOT_DIRNAME}/first-dir
# Perhaps should restore the umask and CVSUMASK. But the other
# tests "should" not care about them...
;;
+ stamps)
+ # Test timestamps.
+ mkdir 1; cd 1
+ 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"
+ cd first-dir
+ touch aa
+ echo '$''Id$' >kw
+ ls -l aa >${TESTDIR}/1/stamp.aa.touch
+ ls -l kw >${TESTDIR}/1/stamp.kw.touch
+ # "sleep 1" would suffice if we could assume ls --full-time, but
+ # that is as far as I know unique to GNU ls. Is there some POSIX.2
+ # way to get the timestamp of a file, including the seconds?
+ sleep 60
+ dotest stamps-3 "${testcvs} add aa kw" \
+"${PROG} [a-z]*: scheduling file .aa. for addition
+${PROG} [a-z]*: scheduling file .kw. for addition
+${PROG} [a-z]*: use .cvs commit. to add these files permanently"
+ ls -l aa >${TESTDIR}/1/stamp.aa.add
+ ls -l kw >${TESTDIR}/1/stamp.kw.add
+ # "cvs add" should not muck with the timestamp.
+ dotest stamps-4aa \
+"cmp ${TESTDIR}/1/stamp.aa.touch ${TESTDIR}/1/stamp.aa.add" ''
+ dotest stamps-4kw \
+"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
+done
+Checking in aa;
+${TESTDIR}/cvsroot/first-dir/aa,v <-- aa
+initial revision: 1\.1
+done
+RCS file: ${TESTDIR}/cvsroot/first-dir/kw,v
+done
+Checking in kw;
+${TESTDIR}/cvsroot/first-dir/kw,v <-- kw
+initial revision: 1\.1
+done"
+ ls -l aa >${TESTDIR}/1/stamp.aa.ci
+ ls -l kw >${TESTDIR}/1/stamp.kw.ci
+ # If there are no keywords, "cvs ci" leaves the timestamp alone
+ # If there are, it sets the timestamp to the date of the commit.
+ # I'm not sure how logical this is, but it is intentional.
+ # If we wanted to get fancy we would make sure the time as
+ # reported in "cvs log kw" matched stamp.kw.ci. But that would
+ # be a lot of work.
+ dotest stamps-6aa \
+ "cmp ${TESTDIR}/1/stamp.aa.add ${TESTDIR}/1/stamp.aa.ci" ''
+ if cmp ${TESTDIR}/1/stamp.kw.add ${TESTDIR}/1/stamp.kw.ci >/dev/null
+ then
+ fail stamps-6kw
+ else
+ pass stamps-6kw
+ fi
+ cd ../..
+ sleep 60
+ mkdir 2
+ cd 2
+ dotest stamps-7 "${testcvs} -q get first-dir" "U first-dir/aa
+U first-dir/kw"
+ cd first-dir
+ ls -l aa >${TESTDIR}/1/stamp.aa.get
+ ls -l kw >${TESTDIR}/1/stamp.kw.get
+ # On checkout, CVS should set the timestamp to the date that the
+ # file was committed. Could check that the time as reported in
+ # "cvs log aa" matches stamp.aa.get, but that would be a lot of
+ # work.
+ if cmp ${TESTDIR}/1/stamp.aa.ci ${TESTDIR}/1/stamp.aa.get >/dev/null
+ then
+ fail stamps-8aa
+ else
+ pass stamps-8aa
+ fi
+ dotest stamps-8kw \
+ "cmp ${TESTDIR}/1/stamp.kw.ci ${TESTDIR}/1/stamp.kw.get" ''
+
+ # Now we want to see what "cvs update" does.
+ sleep 60
+ echo add a line >>aa
+ echo add a line >>kw
+ dotest stamps-9 "${testcvs} -q ci -m change-them" \
+"Checking in aa;
+${TESTDIR}/cvsroot/first-dir/aa,v <-- aa
+new revision: 1\.2; previous revision: 1\.1
+done
+Checking in kw;
+${TESTDIR}/cvsroot/first-dir/kw,v <-- kw
+new revision: 1\.2; previous revision: 1\.1
+done"
+ ls -l aa >${TESTDIR}/1/stamp.aa.ci2
+ ls -l kw >${TESTDIR}/1/stamp.kw.ci2
+ cd ../..
+ cd 1/first-dir
+ sleep 60
+ dotest stamps-10 "${testcvs} -q update" '[UP] aa
+[UP] kw'
+ # this doesn't serve any function other than being able to
+ # look at it manually, as we have no machinery for dates being
+ # newer or older than other dates.
+ date >${TESTDIR}/1/stamp.debug.update
+ ls -l aa >${TESTDIR}/1/stamp.aa.update
+ ls -l kw >${TESTDIR}/1/stamp.kw.update
+ # stamp.aa.update and stamp.kw.update should both be approximately
+ # the same as stamp.debug.update. Perhaps we could be testing
+ # this in a more fancy fashion by "touch stamp.before" before
+ # stamps-10, "touch stamp.after" after, and then using ls -t
+ # to check them. But for now we just make sure that the *.update
+ # stamps differ from the *.ci2 ones.
+ # As for the rationale, this is so that if one updates and gets
+ # a new revision, then "make" will be sure to regard those files
+ # as newer than .o files which may be sitting around.
+ if cmp ${TESTDIR}/1/stamp.aa.update ${TESTDIR}/1/stamp.aa.ci2 \
+ >/dev/null
+ then
+ fail stamps-11aa
+ else
+ pass stamps-11aa
+ fi
+ if cmp ${TESTDIR}/1/stamp.kw.update ${TESTDIR}/1/stamp.kw.ci2 \
+ >/dev/null
+ then
+ fail stamps-11kw
+ else
+ pass stamps-11kw
+ fi
+
+ cd ../..
+
+ if test "$keep" = yes; then
+ echo Keeping ${TESTDIR} and exiting due to --keep
+ exit 0
+ fi
+
+ rm -r 1 2
+ rm -rf ${CVSROOT_DIRNAME}/first-dir
+ ;;
+
sticky)
# More tests of sticky tags, particularly non-branch sticky tags.
mkdir 1; cd 1
@@ -6323,7 +6558,8 @@ ${QUESTION} file2" "${QUESTION} file2
${PROG} [a-z]*: use .cvs commit. to add this file permanently"
cd ../..
- rm -rf 1 ${CVSROOT_DIRNAME}/first-dir
+ rm -r 1
+ rm -rf ${CVSROOT_DIRNAME}/first-dir
;;
keyword)
@@ -6494,7 +6730,7 @@ xx "'\$'"Log"'\$'
# This workaround should be removed when the bug is fixed.
if test "x$remote" = "xyes"; then
cd ..
- rm -rf first-dir
+ rm -r first-dir
dotest keyword-17 "${testcvs} -q co first-dir" "U first-dir/file1"
cd first-dir
else
@@ -6560,7 +6796,79 @@ xx
change"
cd ../..
- rm -rf 1 ${CVSROOT_DIRNAME}/first-dir
+ rm -r 1
+ rm -rf ${CVSROOT_DIRNAME}/first-dir
+ ;;
+
+ toplevel)
+ # test the feature that cvs creates a CVS subdir also for
+ # the toplevel directory
+
+ # Some test, somewhere, is creating Emptydir. That test
+ # should, perhaps, clean up for itself, but I don't know which
+ # one it is.
+ rm -rf ${CVSROOT_DIRNAME}/CVSROOT/Emptydir
+
+ mkdir 1; cd 1
+ dotest toplevel-1 "${testcvs} -q co -l ." ''
+ mkdir top-dir
+ dotest toplevel-2 "${testcvs} add top-dir" \
+"Directory ${TESTDIR}/cvsroot/top-dir added to the repository"
+ cd top-dir
+
+ touch file1
+ dotest toplevel-3 "${testcvs} add file1" \
+"${PROG} [a-z]*: scheduling file .file1. for addition
+${PROG} [a-z]*: use .cvs commit. to add this file permanently"
+ dotest toplevel-4 "${testcvs} -q ci -m add" \
+"RCS file: ${TESTDIR}/cvsroot/top-dir/file1,v
+done
+Checking in file1;
+${TESTDIR}/cvsroot/top-dir/file1,v <-- file1
+initial revision: 1\.1
+done"
+
+ cd ../..
+ rm -r 1; mkdir 1; cd 1
+ dotest toplevel-5 "${testcvs} co top-dir" \
+"${PROG} [a-z]*: Updating top-dir
+U top-dir/file1"
+
+ dotest toplevel-6 "${testcvs} update top-dir" \
+"${PROG} [a-z]*: Updating top-dir"
+ dotest toplevel-7 "${testcvs} update" \
+"${PROG} [a-z]*: Updating \.
+${PROG} [a-z]*: Updating top-dir"
+
+ dotest toplevel-8 "${testcvs} update -d top-dir" \
+"${PROG} [a-z]*: Updating top-dir"
+ # FIXME: This test fails in cvs starting from 1.9.2 because
+ # it updates "file1" in "1". Test modules3-7f also finds
+ # (and tolerates) this bug. The second expect string below
+ # should be removed when this is fixed. The first expect
+ # string is the behavior of remote CVS. There is some sentiment
+ # that
+ # "${PROG} [a-z]*: Updating \.
+ # ${PROG} [a-z]*: Updating top-dir"
+ # is correct but it isn't clear why that would be correct instead
+ # of the remote CVS behavior.
+ #
+ # The DOTSTAR matches of a bunch of lines like
+ # "U CVSROOT/checkoutlist". Trying to match them more precisely
+ # seemed to cause trouble. For example CVSROOT/cvsignore will
+ # be present or absent depending on whether we ran the "ignore"
+ # test or not.
+ dotest toplevel-9 "${testcvs} update -d" \
+"${PROG} [a-z]*: Updating \.
+${PROG} [a-z]*: Updating CVSROOT
+${DOTSTAR}
+${PROG} [a-z]*: Updating top-dir" \
+"${PROG} [a-z]*: Updating \.
+U file1
+${PROG} [a-z]*: Updating top-dir"
+
+ cd ..
+ rm -r 1
;;
*)
diff --git a/contrib/cvs/src/server.c b/contrib/cvs/src/server.c
index 65b1dd38a9b6..dece2ca6c132 100644
--- a/contrib/cvs/src/server.c
+++ b/contrib/cvs/src/server.c
@@ -89,7 +89,7 @@ static Key_schedule sched;
the same as the system username the server eventually switches to
run as. CVS_Username gets set iff password authentication is
successful. */
-static char *CVS_Username = NULL;
+char *CVS_Username = NULL;
/* Used to check that same repos is transmitted in pserver auth and in
later CVS protocol. Exported because root.c also uses. */
@@ -3073,6 +3073,42 @@ server_copy_file (file, update_dir, repository, newfile)
/* See server.h for description. */
void
+server_modtime (finfo, vers_ts)
+ struct file_info *finfo;
+ Vers_TS *vers_ts;
+{
+ char date[MAXDATELEN];
+ int year, month, day, hour, minute, second;
+ /* Note that these strings are specified in RFC822 and do not vary
+ according to locale. */
+ static const char *const month_names[] =
+ {"Jan", "Feb", "Mar", "Apr", "May", "Jun",
+ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
+
+ if (!supported_response ("Mod-time"))
+ return;
+
+ /* The only hard part about this routine is converting the date
+ formats. In terms of functionality it all boils down to the
+ call to RCS_getrevtime. */
+ if (RCS_getrevtime (finfo->rcs, vers_ts->vn_rcs, date, 0) == (time_t) -1)
+ /* FIXME? should we be printing some kind of warning? For one
+ thing I'm not 100% sure whether this happens in non-error
+ circumstances. */
+ return;
+
+ sscanf (date, SDATEFORM, &year, &month, &day, &hour, &minute, &second);
+ sprintf (date, "%d %s %d %d:%d:%d -0000", day,
+ month < 1 || month > 12 ? "???" : month_names[month - 1],
+ year, hour, minute, second);
+ buf_output0 (protocol, "Mod-time ");
+ buf_output0 (protocol, date);
+ buf_output0 (protocol, "\n");
+}
+
+/* See server.h for description. */
+
+void
server_updated (finfo, vers, updated, file_info, checksum)
struct file_info *finfo;
Vers_TS *vers;
@@ -4619,6 +4655,14 @@ pserver_authenticate_connection ()
{
error (1, 0, "bad auth protocol end: %s", tmp);
}
+ if (!root_allow_ok (repository))
+ /* At least for the moment I'm going to do the paranoid
+ security thing and not tell them how it failed. I'm not
+ sure that is a good idea; it is a real pain when one needs
+ to track down what is going on for legitimate reasons.
+ The other issue is that the protocol doesn't really have
+ a good way for anything other than I HATE YOU. */
+ goto i_hate_you;
/* We need the real cleartext before we hash it. */
descrambled_password = descramble (password);
@@ -4632,6 +4676,7 @@ pserver_authenticate_connection ()
}
else
{
+ i_hate_you:
printf ("I HATE YOU\n");
fflush (stdout);
/* I'm doing this manually rather than via error_exit ()
diff --git a/contrib/cvs/src/server.h b/contrib/cvs/src/server.h
index cbda7a5699d1..743f0901233a 100644
--- a/contrib/cvs/src/server.h
+++ b/contrib/cvs/src/server.h
@@ -29,6 +29,11 @@ extern void server_register
PROTO((char *name, char *version, char *timestamp,
char *options, char *tag, char *date, char *conflict));
+/* Set the modification time of the next file sent. This must be
+ followed by a call to server_updated on the same file. */
+extern void server_modtime PROTO ((struct file_info *finfo,
+ Vers_TS *vers_ts));
+
/*
* We want to nuke the Entries line for a file, and (unless
* server_scratch_entry_only is subsequently called) the file itself.
@@ -106,6 +111,10 @@ extern void server_cleanup PROTO((int sig));
extern void server_pause_check PROTO((void));
#endif /* SERVER_FLOWCONTROL */
+#ifdef AUTH_SERVER_SUPPORT
+extern char *CVS_Username;
+#endif /* AUTH_SERVER_SUPPORT */
+
#endif /* SERVER_SUPPORT */
/* Stuff shared with the client. */
diff --git a/contrib/cvs/src/subr.c b/contrib/cvs/src/subr.c
index a098123c80bb..d29942ba0dc7 100644
--- a/contrib/cvs/src/subr.c
+++ b/contrib/cvs/src/subr.c
@@ -234,11 +234,13 @@ numdots (s)
return (dots);
}
-/*
- * Get the caller's login from his uid. If the real uid is "root" try LOGNAME
- * USER or getlogin(). If getlogin() and getpwuid() both fail, return
- * the uid as a string.
- */
+/* Return the username by which the caller should be identified in
+ CVS, in contexts such as the author field of RCS files, various
+ logs, etc.
+
+ Returns a pointer to storage that we manage; it is good until the
+ next call to getcaller () (provided that the caller doesn't call
+ getlogin () or some such themself). */
char *
getcaller ()
{
@@ -247,6 +249,16 @@ getcaller ()
char *name;
uid_t uid;
+ /* If there is a CVS username, return it. */
+#ifdef AUTH_SERVER_SUPPORT
+ if (CVS_Username != NULL)
+ return CVS_Username;
+#endif
+
+ /* Get the caller's login from his uid. If the real uid is "root"
+ try LOGNAME USER or getlogin(). If getlogin() and getpwuid()
+ both fail, return the uid as a string. */
+
uid = getuid ();
if (uid == (uid_t) 0)
{
diff --git a/contrib/cvs/src/update.c b/contrib/cvs/src/update.c
index 1956c6fbca59..8196c1fd98dc 100644
--- a/contrib/cvs/src/update.c
+++ b/contrib/cvs/src/update.c
@@ -559,10 +559,31 @@ update_fileproc (callerdat, finfo)
else
{
if (wrap_merge_is_copy (finfo->file))
+#if 0
+ /* Look, we can't clobber the user's file. We
+ know it is modified and we're going to
+ overwrite their mod? Puh-leeze. The
+ correct behavior is probably something like
+ what merge_file does for -kb, which is to
+ give the users both files and tell them
+ what the two filenames are. Of course, -m
+ in wrappers needs to be documented *much*
+ better. Anyway, until then, make this a
+ fatal error. */
+
/* Should we be warning the user that we are
* overwriting the user's copy of the file? */
retval =
checkout_file (finfo, vers, 0);
+#else
+ {
+ error (0, 0, "A -m 'COPY' wrapper is specified");
+ error (0, 0, "but file %s needs merge",
+ finfo->fullname);
+ error (1, 0, "\
+You probably want to avoid -m 'COPY' wrappers");
+#endif
+ }
else
retval = merge_file (finfo, vers);
}
diff --git a/contrib/cvs/src/vers_ts.c b/contrib/cvs/src/vers_ts.c
index 03a0036202c3..613e52eb21e6 100644
--- a/contrib/cvs/src/vers_ts.c
+++ b/contrib/cvs/src/vers_ts.c
@@ -177,13 +177,26 @@ Version_TS (finfo, options, tag, date, force_tag_match, set_time)
*/
if (set_time)
{
- struct utimbuf t;
+#ifdef SERVER_SUPPORT
+ if (server_active)
+ server_modtime (finfo, vers_ts);
+ else
+#endif
+ {
+ struct utimbuf t;
- memset ((char *) &t, 0, sizeof (t));
- if (vers_ts->vn_rcs &&
- (t.actime = t.modtime = RCS_getrevtime (rcsdata,
- vers_ts->vn_rcs, (char *) 0, 0)) != -1)
- (void) utime (finfo->file, &t);
+ memset (&t, 0, sizeof (t));
+ if (vers_ts->vn_rcs)
+ {
+ t.modtime =
+ RCS_getrevtime (rcsdata, vers_ts->vn_rcs, 0, 0);
+ if (t.modtime != (time_t) -1)
+ {
+ t.actime = t.modtime;
+ (void) utime (finfo->file, &t);
+ }
+ }
+ }
}
}
diff --git a/contrib/cvs/src/version.c b/contrib/cvs/src/version.c
index 606c43d0f023..c44217985a35 100644
--- a/contrib/cvs/src/version.c
+++ b/contrib/cvs/src/version.c
@@ -12,7 +12,7 @@
#include "cvs.h"
-char *version_string = "\nConcurrent Versions System (CVS) 1.9.9";
+char *version_string = "\nConcurrent Versions System (CVS) 1.9.10";
#ifdef CLIENT_SUPPORT
#ifdef SERVER_SUPPORT
diff --git a/contrib/cvs/src/wrapper.c b/contrib/cvs/src/wrapper.c
index 13e7e43d1656..825cdcdeb7ae 100644
--- a/contrib/cvs/src/wrapper.c
+++ b/contrib/cvs/src/wrapper.c
@@ -387,7 +387,7 @@ wrap_name_has (name,has)
char *temp;
for(x=0;x<count;++x)
- if (fnmatch (wrap_list[x]->wildCard, name, 0) == 0){
+ if (CVS_FNMATCH (wrap_list[x]->wildCard, name, 0) == 0){
switch(has){
case WRAP_TOCVS:
temp=wrap_list[x]->tocvsFilter;
@@ -418,7 +418,7 @@ wrap_matching_entry (name)
int x,count=wrap_count+wrap_saved_count;
for(x=0;x<count;++x)
- if (fnmatch (wrap_list[x]->wildCard, name, 0) == 0)
+ if (CVS_FNMATCH (wrap_list[x]->wildCard, name, 0) == 0)
return wrap_list[x];
return (WrapperEntry *)NULL;
}
diff --git a/contrib/cvs/tools/pcl-cvs/INSTALL b/contrib/cvs/tools/pcl-cvs/INSTALL
index 56ff80d2f75c..c4cf8dc45936 100644
--- a/contrib/cvs/tools/pcl-cvs/INSTALL
+++ b/contrib/cvs/tools/pcl-cvs/INSTALL
@@ -91,4 +91,4 @@ from `pcl-cvs.texinfo'.
--
-#ident "@(#)cvs/contrib/pcl-cvs:$Name: $Id$"
+#ident "@(#)cvs/contrib/pcl-cvs:$Name: $Id: INSTALL,v 1.2 1996/04/15 06:33:16 kfogel Exp $"