This commit was generated by cvs2svn to compensate for changes in r12752,

which included commits to RCS files with non-trunk default branches.
This commit is contained in:
Peter Wemm 1995-12-10 22:31:58 +00:00
commit 271f76d028
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=12753
32 changed files with 6458 additions and 3295 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,11 @@
$CVSid: @(#)README 1.32 94/10/22 $
CVS Kit, Version 1.4 Alpha
CVS Kit
Copyright (c) 1993-1994 Brian Berliner
Copyright (c) 1992 Brian Berliner and Jeff Polk
Copyright (c) 1989-1992, Brian Berliner
All Rights Reserved
Copyright (c) 1993-1994 Brian Berliner
Copyright (c) 1992 Brian Berliner and Jeff Polk
Copyright (c) 1989-1992, Brian Berliner
All Rights Reserved
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
@ -23,9 +23,14 @@ $CVSid: @(#)README 1.32 94/10/22 $
-------------------------------------------------------------------------------
Welcome to the CVS 1.4 Alpha release! We thank you for taking the time to
test this (potentially unstable) release and report bugs (ideally, with
fixes). To report bugs, run the "cvsbug" program and fill out the template:
Welcome to CVS!
Bug reports are accepted, however note that someone may or may not
feel like taking care of your bug report. Support contracts are
available from Cyclic Software (http://www.cyclic.com).
To report bugs send mail to bug-cvs@prep.ai.mit.edu, or run the "cvsbug"
program and fill out the template:
$ cvsbug
@ -33,12 +38,11 @@ The "cvsbug" program is installed in the same location as the "cvs"
program. If your installation failed, you may need to run "cvsbug"
directly out of the "src" directory as "src/cvsbug.sh".
While we cannot promise to be responsive to said bugs, we do appreciate
your support through this Alpha process. Please consult the INSTALL file
for information on tested configurations. If you have a comment about an
already tested configuration, or have tried CVS on a new configuration,
please write to the above address and let us know! Free software only
works if we all help out.
Please consult the INSTALL file for information on tested
configurations. If you have a comment about an already tested
configuration, or have tried CVS on a new configuration, please write
to the above address and let us know! Free software only works if we
all help out.
Finally, we cannot guarantee that this release will not completely wipe out
all of your work from your system. We do some simple testing before each
@ -48,7 +52,7 @@ SOFTWARE IS SUPPLIED COMPLETELY "AS IS". NO WARRANTY....
Thanks for your support!
-The CVS Alpha Team
-The CVS Team, and the Cyclic CVS Hackers
-------------------------------------------------------------------------------
@ -78,14 +82,14 @@ Special note to current CVS 1.3 users:
--> You can skip this section and go straight to "Installation" if you <--
--> have not been running any previous releases of CVS. <--
See the ChangeLog file in this directory to find out what has changed from
CVS 1.3.
See the NEWS file for a description of features new in this version.
Some files have been renamed from the CVS 1.3 distribution. If you're not
careful, this can cause your build of CVS 1.4 to fail in strange ways. In
particular, be sure to remove the src/config.h file (which is now
src/options.h), as the correct config.h file is generated automatically by
the "configure" stage of installation (and installed in this directory).
Some files have been renamed from the CVS 1.3 distribution. If you're
not careful, this can cause your CVS build to fail in strange ways.
In particular, be sure to remove the src/config.h file (which is now
src/options.h), as the correct config.h file is generated
automatically by the "configure" stage of installation (and installed
in this directory).
-------------------------------------------------------------------------------
@ -95,31 +99,25 @@ Please read the INSTALL file for installation instructions. Brief summary:
$ ./configure
$ make
$ make check # optional, long-running, step
$ make install
$ cvsinit
-------------------------------------------------------------------------------
Mailing Lists:
* How do I get up-to-date information and information about other
versions of CVS?
I have setup the following mailing list for CVS users and other interested
parties. I have no idea what kind of volume will be generated on this
list. Nor can I guarantee to personally respond to questions posted to the
list. Anyway, the mailing list is:
On the web, http://www.winternet.com/~zoo/cvs/ or
http://www.loria.fr/~molli/cvs-index.html.
info-cvs-request@prep.ai.mit.edu
Requests for addition to or removal from the mailing list
must be sent to this address. Problems with the list
(like bounced mail) should also be sent here. Please be
specific about your email address.
The mailing list for CVS is info-cvs@prep.ai.mit.edu. Send
subscription and removal requests for that list to
info-cvs-requests@prep.ai.mit.edu.
info-cvs@prep.ai.mit.edu
Questions, bugs, porting problems, hints, or whatever
can be sent to this address. A Frequently Asked Questions
(FAQ) my be available from host "think.com" in the
"/pub/cvs" directory. Please consult the FAQ before
sending questions to info-cvs. DO NOT SEND ADDITION AND
REMOVAL REQUESTS TO THIS ALIAS.
[Historical note: info-cvs@prep.ai.mit.edu is now the union of
info-cvs@prep and cyclic-cvs@cyclic.com. Please use the prep
address.]
-------------------------------------------------------------------------------
@ -170,6 +168,9 @@ Paul Sander, HaL Computer Systems, Inc. <paul@hal.com> wrote and
contributed the code in lib/sighandle.c. I added support for POSIX, BSD,
and non-POSIX/non-BSD systems.
Jim Kingdon and others at Cygnus Support <info@cygnus.com> wrote the
remote repository access code.
In addition to the above contributors, the following Beta testers deserve
special mention for their support. If I have left off your name, I
apologize. Just write to me and let me know!
@ -203,5 +204,4 @@ contributed GNU Emacs CVS-mode in contrib/pcl-cvs.
-------------------------------------------------------------------------------
Brian Berliner
berliner@sun.com
Cyclic Software <info@cyclic.com>

View File

@ -1,11 +1,10 @@
$CVSid: @(#)TODO 1.26 94/09/21 $
01. testing. An automated testing enviroment would be a big win.
14. Pathname stripper, for checkout, as well as for writing the
Repository file.
[[ I have a simple one, but need to make sure to call it at all the
appropriate points ]]
(I'm not sure what this means -kingdon, Jun 1995).
16. List of current users of a directory needs to be maintained.
[[ sort of solved by history database ]]
@ -13,6 +12,8 @@ $CVSid: @(#)TODO 1.26 94/09/21 $
22. Catch signals for cleanup when "add"ing files.
24. Insist on a log message.
(This should be configurable via commitinfo or some new config file
-kingdon, Jun 1995).
30. Add "patch" program option to the modules database.
@ -37,11 +38,7 @@ $CVSid: @(#)TODO 1.26 94/09/21 $
file system directly, using special known command names?
49. cvs xxx commands should be able to deal with files in other
directories. I want to do a cvs ci foo/bar.c. This complicates things
a bit because one might specify files in different directories, but you
could just bucket sort them and do everything for each directory
together. Other than that, it's just a matter of using the adm
directory from the directory containing the file rather than the cwd.
directories. I want to do a cvs add foo/bar.c.
[[ most commands now use the generic recursion processor, but not all;
this note is left here to remind me to fix the others ]]
@ -85,11 +82,6 @@ $CVSid: @(#)TODO 1.26 94/09/21 $
that a merge will be necessary before their checkin can be
successful.
56. There should be a .cvsrc file that is sourced to customize various
variables. Perhaps there should be a system-wide .cvsrc file that is
sourced, then the one in one's home directory, then the environment
variables are checked for overriding values.
62. Consider using revision controlled files and directories to handle the
new module format -- consider a cvs command front-end to
add/delete/modify module contents, maybe.
@ -135,14 +127,6 @@ $CVSid: @(#)TODO 1.26 94/09/21 $
85. Add revision controlled symbolic links to CVS using one of the tag
fields in the RCS file.
87. Consider renaming directories and files.
88. Consider using mmap to read files on Sun systems and using a smaller
buffer to read files on other systems. A patch has been supplied.
89. Study the new Dick Grune version of CVS and port any new interesting
features to my version of CVS.
91. Better document the format of the source repository and how one might
convert their current SCCS or RCS files into CVS format.
@ -156,13 +140,6 @@ $CVSid: @(#)TODO 1.26 94/09/21 $
93. Need to think hard about release and development environments. Think
about execsets as well.
94. Need to think hard about remote source control and environments
together.
[[ a contributor has this working over Internet TCP links! ]]
97. Think about some way to undo a change. This looks hard given the
current framework of CVS.
98. If diff3 bombs out (too many differences) cvs then thinks that the file
has been updated and is OK to be commited even though the file
has not yet been merged.
@ -177,10 +154,8 @@ $CVSid: @(#)TODO 1.26 94/09/21 $
104. cvs should recover nicely on unreadable files/directories.
105. cvs should have administrative tools to allow for changing permissions
and modes and what not.
106. Need to figure out how to delete and rename directories from a release
and yet have old releases still be accessible.
and modes and what not. In particular, this would make cvs a
more attractive alternative to rdist.
107. It should be possible to specify a list of symbolic revisions to
checkout such that the list is processed in reverse order looking for
@ -213,17 +188,8 @@ $CVSid: @(#)TODO 1.26 94/09/21 $
error. I think a later cvs get sys seemed to work so perhaps
something is amiss in handling multiple arguments to cvs get?
112. When merging in changes (Glist) and the file ends up exactly as the
RCS revision, an "M" is displayed as the "cvs update" output. This
should really just be a "U". Just an optimization.
113. The "cvs update" command should tee its output to a log file in ".".
114. I wanted to check in my metapreen code tonight, which I had put into
a new file called preen.c. So, recalling your excellent instructions,
I typed "cvs add preen.c". However, cvs complained that there was
already a preen.c in /master/etc/fsck/Attic and therefore it wouldn't
take mine. Now what?
(why? What is wrong with piping stdout to "tee"? -kingdon, Jun 1995)
115. I still think "cvs modules" is a good idea.
Since everything else is inside cvs, "mkmodules" should be in there too:
@ -239,13 +205,6 @@ $CVSid: @(#)TODO 1.26 94/09/21 $
"mod -l module ..." Prints more info about relative filenames ("ls -l"?)
"mod -f file ..." Tells you what module(s) the filenames are in.
116. The first thing import did was to complain about a missing CVSROOT.adm.
How about having "import()" copy some "CVSROOT.adm/{loginfo,modules}"
templates into place if it discovers none pointed to by $CVSROOT? As it
stands, one has to hand-craft them. It would be real nice to have it
happen automatically.
[[ I hope to add a "cvsinit" command to the installation instructions ]]
119. Consider an option to have import checkout the RCS or SCCS files
if necessary.
@ -294,14 +253,6 @@ $CVSid: @(#)TODO 1.26 94/09/21 $
number of each file it is checking in.
[[ Sort of solved by contrib/log.pl, which does a good job of this ]]
136. Is it possible to specify a command to be run on each file when it is
checked out and another command to be run before it is checked in?
My idea of how this feature would be used:
On checkout:
run indent with user's preferred style
On checkin:
run indent with space-saving, style-free for checkin
137. Some sites might want CVS to fsync() the RCS ,v file to protect
against nasty hardware errors. There is a slight performance hit with
doing so, though, so it should be configurable in the .cvsrc file.
@ -313,14 +264,6 @@ $CVSid: @(#)TODO 1.26 94/09/21 $
variable to limit the amount of sources that need to be duplicated for
sites with giant source trees and no disk space.
139. murf@dingus.sps.mot.com (Steve Murphy) suggests adding a mode where
CVS can work across e-mail to a single repository located at some
"known" mail address. The update/commit operations would work through
email aliases, causing them to be slow, but would work nonetheless.
This could allow for very cheap remote development sites.
[[ We may get to TCP connections over the Internet for the next
release, but probably won't do an e-mail linkup right away ]]
141. Import should accept modules as its directory argument.
143. Update the documentation to show that the source repository is
@ -357,14 +300,8 @@ $CVSid: @(#)TODO 1.26 94/09/21 $
146. The merging of files should be controlled via a hook so that programs
other than "rcsmerge" can be used, like Sun's filemerge or emacs's
emerge.el.
148. It would be nice if cvs import (and perhaps commit when the rcs file
is created) would set the comment leader automagically to the prefix
string of $Log entry, if some option is given. For example, if a file
has a line `%*&# $Log...' the comment leader would be set to `%*&# '.
It would help a lot for unknown files with unknown suffix, and if the
comment leader is not standard. Perhaps for cvs 1.4.
emerge.el. (but be careful in making this work client/server--it means
doing the interactive merging at the end after the server is done).
149. On Sun, 2 Feb 92 22:01:38 EST, rouilj@dl5000.bc.edu (John P. Rouillard)
said:
@ -452,33 +389,15 @@ $CVSid: @(#)TODO 1.26 94/09/21 $
161. The date parser included with CVS (lib/getdate.y) does not support
such RCS-supported dates as "1992/03/07". It probably should.
162. We have had a number of cases where some idiot does a "cd" into $CVSROOT
and tries to run checkout. I suggest you make it impossible for someone
to check out anything directly into $CVSROOT. This works (though there
is no error checking):
getwd(curdir);
chdir(getenv("CVSROOT"));
getwd(cvsrootdir);
strcat(cvsrootdir, "/");
chdir(curdir);
if (!strncmp (curdir, cvsrootdir, strlen(cvsrootdir))) {
abort with a nasty message about writing into the repository.
}
(In other words, if the real path where $CVSROOT is stored is a parent of
the real pathname of your current directory, die horribly.)
163. The rtag/tag commands should have an option that removes the specified
tag from any file that is in the attic. This allows one to re-use a
tag (like "Mon", "Tue", ...) all the time and still have it tag the
real main-line code.
164. The rcsinfo file should be able to expand environment variables to
find the pathname to the template file. Perhaps it should just
popen("cat <line>"); and read the resulting output, to let the shell
do the dirty work.
164. The *info files should allow multiple ocurrences of $CVSROOT and/or
other cvs variables. They probably should *not* expand environment
variables, as their behavior probably should not depend on who is
running CVS.
165. The "import" command will create RCS files automatically, but will
screw-up when trying to create long file names on short file name
@ -500,37 +419,6 @@ $CVSid: @(#)TODO 1.26 94/09/21 $
where "C2" is a magic branch that resolves to 1.63.2 do not print the
same things. Sigh.
168. After making changes to a set of files, some of which were in
sub-directories, I wanted to build a patch file for the whole works:
cvs diff -c -rPROD-REL .
However, any diffs for files in sub-directories did not have relative
pathnames. For example, with local changes to perl's hints/aix_rs.sh:
===================================================================
RCS file: /local/src-CVS/misc/perl/hints/aix_rs.sh,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 aix_rs.sh
*** 1.1.1.1 1992/12/17 19:43:32
--- aix_rs.sh 1993/01/05 21:33:12
***************
*** 1,3 ****
It was easy enough to fix in this case, but I'd suggest that the file
name have the relative directory prepended and a proper patch "Index:"
line be added, such as this:
===================================================================
RCS file: /local/src-CVS/misc/perl/hints/aix_rs.sh,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 hints/aix_rs.sh
Index: hints/aix_rs.sh
*** 1.1.1.1 1992/12/17 19:43:32
--- hints/aix_rs.sh 1993/01/05 21:33:12
***************
*** 1,3 ****
169. We are using CVS as the configuration control for a software reuse library.
What we do is do system calls passing the needed arguments. In the next
release, it would be nice to see an option to put cvs .o files into a
@ -553,19 +441,6 @@ $CVSid: @(#)TODO 1.26 94/09/21 $
the checkout and update commands that could turn this invocation of the
script off, for mature users.
171. We have been actively using CVS since September, and we still have the
opinion that automerge is dangerous. We have been burned by it a
couple of times so far, when people missed the notification of a
conflict during an update, and then they committed the files with the
>>>>>>> and <<<<<<< reports in them. This kind of problem usually gets
noticed before commit in compiled files when the compiler croaks, but
we also maintain many documentation files in CVS, and in one case the
problem was not noticed until months later.
172. "cvs add foo/bar" doesn't work, but "cvs remove foo/bar" works. Maybe
"cvs add" should be rewritten to use the recursive directory code that
most of CVS uses.
173. We have a tagged branch in CVS. How do we get the version of that branch
(for an entire directory) that corresponds to the files on that branch on a
certain day? I'd like to specify BOTH -r and -D to 'cvs checkout', but I
@ -595,16 +470,5 @@ $CVSid: @(#)TODO 1.26 94/09/21 $
use "-I" to ignore the directory, as well as .cvsignore, but this
doesn't work.
178. At our site we tag all releases of the sw with
product name and version number, the tag is pretty
long and if you by accident write an old tag which
was in use on an old release, the default behaviour
of cvs is to change the old tag!!!
Could the CVS system reject to reuse an old tag?
You have the possibility to manually remove it,
but you will not have to be afraid of one tag
silently changing.
179. "cvs admin" does not log its actions with loginfo, nor does it check
whether the action is allowed with commitinfo. It should.

View File

@ -1,9 +1,9 @@
$CVSid: @(#)README 1.12 94/09/25 $
This "contrib" directory is a place holder for code/scripts sent to
me by contributors around the world. This READM file will be kept
me by contributors around the world. This README file will be kept
up-to-date from release to release. BUT, I must point out that these
contributions are really, REALLY UNSSUPPORTED. In fact, I probably
contributions are really, REALLY UNSUPPORTED. In fact, I probably
don't even know what they do. Nor do I guarantee to have tried them,
or ported them to work with this CVS distribution. If you have questions,
you might contact the author, but you should not necessarily expect
@ -12,7 +12,7 @@ a reply. USE AT YOUR OWN RISK -- and all that stuff.
Contents of this directory:
README This file.
log.pl A perl script suitable for including in your
log A perl script suitable for including in your
$CVSROOT/CVSROOT/loginfo file for logging commit
changes. Includes the RCS revision of the change
as part of the log.
@ -20,15 +20,15 @@ Contents of this directory:
pcl-cvs A directory that contains GNU Emacs lisp code which
implements a CVS-mode for emacs.
Contributed by Per Cederqvist <ceder@lysator.liu.se>.
commit_prep.pl A perl script, to be combined with log_accum.pl, to
log_accum.pl provide for a way to combine the individual log
commit_prep A perl script, to be combined with log_accum.pl, to
log_accum provide for a way to combine the individual log
messages of a multi-directory "commit" into a
single log message, and mail the result somewhere.
Also does other checks for $Id and that you are
Can also do other checks for $Id and that you are
committing the correct revision of the file.
Read the comments carefully.
Contributed by David Hampton <hampton@cisco.com>.
mfpipe.pl Another perl script for logging. Allows you to
mfpipe Another perl script for logging. Allows you to
pipe the log message to a file and/or send mail
to some alias.
Contributed by John Clyne <clyne@niwot.scd.ucar.edu>.
@ -46,12 +46,15 @@ Contents of this directory:
help your system support opendir/readdir/closedir,
if it does not already.
Copied from the C-News distribution.
rcslock.pl A perl script that can be added to your commitinfo
rcslock A perl script that can be added to your commitinfo
file that tries to determine if your RCS file is
currently locked by someone else, as might be the
case for a binary file.
Contributed by John Rouillard <rouilj@cs.umb.edu>.
cvs_acls.pl A perl script that implements Access Control Lists
ccvs-rsh A Perl script which allows "rsh pipelines" to
be built in order to use Cyclic CVS from
behind some varieties of firewall.
cvs_acls A perl script that implements Access Control Lists
by using the "commitinfo" hook provided with the
"cvs commit" command.
Contributed by David G. Grubbs <dgg@ksr.com>.
@ -62,7 +65,7 @@ Contents of this directory:
the commands are recursive. However, this may still
come in handy.
Contributed by Lowell Skoog <fluke!lowell@uunet.uu.net>
cln_hist.pl A perl script to compress your
cln_hist A perl script to compress your
$CVSROOT/CVSROOT/history file, as it can grow quite
large after extended use.
Contributed by David G. Grubbs <dgg@ksr.com>

View File

@ -1,6 +1,7 @@
#!/usr/bin/perl -- # -*-Perl-*-
#! xPERL_PATHx
# -*-Perl-*-
#
# $Id: cln_hist.pl,v 1.1 1992/04/10 03:04:15 berliner Exp $
# $Id: cln_hist.pl,v 1.2 1995/07/10 02:01:26 kfogel Exp $
# Contributed by David G. Grubbs <dgg@ksr.com>
#
# Clean up the history file. 10 Record types: MAR OFT WUCG

View File

@ -1,9 +1,11 @@
#!/usr/local/bin/perl -w
#! xPERL_PATHx
# -*-Perl-*-
#
#ident "@(#)cvs/contrib:$Name: $:$Id: commit_prep.pl,v 1.2 1995/07/10 02:01:29 kfogel Exp $"
#
# 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_accumulate script. For new file, it forcing the
# 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
@ -11,63 +13,62 @@
#
# 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.
# current year. [[ bad idea! -- woods ]]
#
#
# Contributed by David Hampton <hampton@cisco.com>
#
############################################################
#
# Configurable options
#
############################################################
#
# Check each file (except dot files) for an RCS "Id" keyword.
#
$check_id = 1;
# Hacked on lots by Greg A. Woods <woods@web.net>
#
# Record the directory for later use by the log_accumulate stript.
# Configurable options
#
$record_directory = 1;
############################################################
# Constants (remember to protect strings from RCS keyword substitution)
#
# Constants
#
############################################################
$LAST_FILE = "/tmp/#cvs.lastdir";
$LAST_FILE = "/tmp/#cvs.lastdir"; # must match name in log_accum.pl
$ENTRIES = "CVS/Entries";
$NoId = "
%s - Does not contain a line with the keyword \"Id:\".
Please see the template files for an example.\n";
# 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\\$\"";
# Protect string from substitution by RCS.
$NoName = "
%s - The ID line should contain only \"\$\I\d\:\ \$\" for a newly created file.\n";
%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";
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.\n";
%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
# Subroutines
#
############################################################
sub write_line {
local($filename, $line) = @_;
@ -80,58 +81,107 @@ sub check_version {
local($i, $id, $rname, $version);
local($filename, $cvsversion) = @_;
open(FILE, $filename) || die("Cannot open $filename, stopped");
for ($i = 1; $i < 10; $i++) {
$pos = -1;
last if eof(FILE);
$line = <FILE>;
$pos = index($line, "Id: ");
last if ($pos >= 0);
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 ($pos == -1) {
printf($NoId, $filename);
if (grep(/$LogString1/, @all_lines) || grep(/$LogString2/, @all_lines)) {
print STDERR sprintf($NoLog, $filename);
return(1);
}
($id, $rname, $version) = split(' ', substr($line, $pos));
if ($debug != 0) {
print STDERR sprintf("file = %s, version = %d.\n", $filename, $cvsversion{$filename});
}
if ($cvsversion{$filename} == 0) {
if ($rname ne "\$") {
printf($NoName, $filename);
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") {
printf($BadName, $filename, substr($rname, 0, length($rname)-2));
print STDERR sprintf($BadName, $filename, substr($rname, 0, length($rname)-2));
return(1);
}
if ($cvsversion{$filename} < $version) {
printf($BadVersion, $filename, $filename, $cvsversion{$filename},
"newer", $version, $filename);
print STDERR sprintf($BadVersion, $filename, $filename, $cvsversion{$filename},
"newer", $version, $filename);
return(1);
}
if ($cvsversion{$filename} > $version) {
printf($BadVersion, $filename, $filename, $cvsversion{$filename},
"older", $version, $filename);
print STDERR sprintf($BadVersion, $filename, $filename, $cvsversion{$filename},
"older", $version, $filename);
return(1);
}
return(0);
}
#############################################################
#
# Main Body
# Main Body
#
############################################################
$id = getpgrp();
#print("ARGV - ", join(":", @ARGV), "\n");
#print("id - ", id, "\n");
$id = getpgrp(); # You *must* use a shell that does setpgrp()!
# Check each file (except dot files) for an RCS "Id" keyword.
#
# Suck in the Entries file
$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>) {
@ -139,25 +189,23 @@ while (<ENTRIES>) {
$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;
$directory = $ARGV[0];
shift @ARGV;
foreach $arg (@ARGV) {
next if (index($arg, ".") == 0);
foreach $arg (@files) {
if (index($arg, ".") == 0) {
next;
}
$failed += &check_version($arg);
}
if ($failed) {
print "\n";
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.

View File

@ -1,6 +1,7 @@
#!/usr/bin/perl -- # -*-Perl-*-
#! xPERL_PATHx
# -*-Perl-*-
#
# $Id: cvs_acls.pl,v 1.2 1992/04/11 16:01:24 berliner Exp $
# $Id: cvs_acls.pl,v 1.2 1995/07/10 02:01:33 kfogel Exp $
#
# Access control lists for CVS. dgg@ksr.com (David G. Grubbs)
#

View File

@ -1,4 +1,4 @@
.\" $Id: cvscheck.man,v 1.1 1992/04/10 03:04:20 berliner Exp $
.\" $Id: cvscheck.man,v 1.1.1.3 1995/08/28 16:20:24 jimb Exp $
.\" Contributed by Lowell Skoog <fluke!lowell@uunet.uu.net>
.TH CVSCHECK LOCAL "4 March 1991" FLUKE
.SH NAME

View File

@ -1,4 +1,4 @@
.\" $Id: cvshelp.man,v 1.1 1992/04/10 03:04:21 berliner Exp $
.\" $Id: cvshelp.man,v 1.1.1.3 1995/08/28 16:20:28 jimb Exp $
.\" Contributed by Lowell Skoog <fluke!lowell@uunet.uu.net>
.\" Full space in nroff; half space in troff
.de SP

View File

@ -1,4 +1,4 @@
.\" $Id: descend.man,v 1.1 1992/04/03 05:22:53 berliner Exp $
.\" $Id: descend.man,v 1.1.1.3 1995/08/28 16:20:31 jimb Exp $
.TH DESCEND 1 "31 March 1992"
.SH NAME
descend \- walk directory tree and execute a command at each node

View File

@ -1,25 +1,31 @@
#! /local/bin/perl
#! xPERL_PATHx
# -*-Perl-*-
#
#ident "$CVSid$"
#
# XXX: FIXME: handle multiple '-f logfile' arguments
#
# XXX -- I HATE Perl! This *will* be re-written in shell/awk/sed soon!
#
# Modified by woods@web.apc.org to add support for mailing 3/29/93
# use '-m user' for each user to receive cvs log reports
# and use '-f logfile' for the logfile to append to
# Usage: log.pl [[-m user] ...] [-s] -f logfile 'dirname file ...'
#
# Modified by berliner@Sun.COM to add support for CVS 1.3 2/27/92
# -m user - for each user to receive cvs log reports
# (multiple -m's permitted)
# -s - to prevent "cvs status -v" messages
# -f logfile - for the logfile to append to (mandatory,
# but only one logfile can be specified).
# here is what the output looks like:
#
# Date: Tue, 6 Aug 91 13:27 EDT
# From: samborn@sunrise.com (Kevin Samborn)
# From: woods@kuma.domain.top
# Subject: CVS update: testmodule
#
# I revised the perl script I sent you yesterday to use the info you
# send in on stdin. (I am appending the newer script to the end)
# Date: Wednesday November 23, 1994 @ 14:15
# Author: woods
#
# now the output looks like this:
#
# **************************************
# Date: Tuesday, August 6, 1991 @ 13:17
# Author: samborn
#
# Update of /elmer/cvs/CVSROOT.adm
# In directory astro:/home/samborn/CVSROOT.adm
# Update of /local/src-CVS/testmodule
# In directory kuma:/home/kuma/woods/work.d/testmodule
#
# Modified Files:
# test3
@ -28,15 +34,24 @@
# Removed Files:
# test4
# Log Message:
# wow, what a test
#
# File: test.3 Status: Up-to-date
# Version: 1.4 Thu Apr 29 14:47:07 EDT 1993
# File: test6 Status: Up-to-date
# Version: 1.1 Thu Apr 29 14:47:33 EDT 1993
# File: test4 Status: Up-to-date
# Version: 1.1 Thu Apr 29 14:47:46 EDT 1993
# - 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)
$cvsroot = $ENV{'CVSROOT'};
@ -44,6 +59,8 @@ $cvsroot = $ENV{'CVSROOT'};
#
$) = $(;
$dostatus = 1;
# parse command line arguments
#
while (@ARGV) {
@ -54,6 +71,8 @@ while (@ARGV) {
} elsif ($arg eq '-f') {
($logfile) && die "Too many '-f' args";
$logfile = shift @ARGV;
} elsif ($arg eq '-s') {
$dostatus = 0;
} else {
($donefiles) && die "Too many arguments!\n";
$donefiles = 1;
@ -61,10 +80,13 @@ while (@ARGV) {
}
}
$srepos = shift @files;
$mailcmd = "| Mail -s 'CVS update: $srepos'";
# the first argument is the module location relative to $CVSROOT
#
$modulepath = shift @files;
# Some date and time arrays
$mailcmd = "| Mail -s 'CVS update: $modulepath'";
# Initialise some date and time arrays
#
@mos = (January,February,March,April,May,June,July,August,September,
October,November,December);
@ -72,13 +94,16 @@ $mailcmd = "| Mail -s 'CVS update: $srepos'";
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime;
# get login name
# get a login name for the guy doing the commit....
#
$login = getlogin || (getpwuid($<))[0] || "nobody";
# open log file for appending
#
open(OUT, ">>" . $logfile) || die "Could not open(" . $logfile . "): $!\n";
# send mail, if there's anyone to send to!
#
if ($users) {
$mailcmd = "$mailcmd $users";
open(MAIL, $mailcmd) || die "Could not Exec($mailcmd): $!\n";
@ -87,7 +112,7 @@ if ($users) {
# print out the log Header
#
print OUT "\n";
print OUT "**************************************\n";
print OUT "****************************************\n";
print OUT "Date:\t$days[$wday] $mos[$mon] $mday, 19$year @ $hour:" . sprintf("%02d", $min) . "\n";
print OUT "Author:\t$login\n\n";
@ -110,29 +135,27 @@ close(IN);
print OUT "\n";
# after log information, do an 'cvs -Qn status' on each file in the arguments.
# after log information, do an 'cvs -Qq status -v' on each file in the arguments.
#
while (@files) {
$file = shift @files;
if ($file eq "-") {
print OUT "[input file was '-']\n";
if (MAIL) {
print MAIL "[input file was '-']\n";
if ($dostatus != 0) {
while (@files) {
$file = shift @files;
if ($file eq "-") {
print OUT "[input file was '-']\n";
if (MAIL) {
print MAIL "[input file was '-']\n";
}
last;
}
last;
}
open(RCS, "-|") || exec 'cvs', '-Qn', 'status', $file;
while (<RCS>) {
if (/^[ \t]*Version/ || /^File:/) {
open(RCS, "-|") || exec 'cvs', '-nQq', 'status', '-v', $file;
while (<RCS>) {
print OUT;
if (MAIL) {
print MAIL;
}
}
close(RCS);
}
close(RCS);
}
close(OUT);
@ -141,8 +164,6 @@ die "Write to $logfile failed" if $?;
close(MAIL);
die "Pipe to $mailcmd failed" if $?;
## must exit cleanly
##
exit 0;
### Local Variables:
### eval: (fundamental-mode)
### End:

View File

@ -1,4 +1,5 @@
#!/usr/local/bin/perl -w
#! xPERL_PATHx
# -*-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
@ -10,27 +11,27 @@
#
# Contributed by David Hampton <hampton@cisco.com>
#
# hacked greatly by Greg A. Woods <woods@planix.com>
############################################################
#
# Configurable options
#
############################################################
#
# Do cisco Systems, Inc. specific nonsense.
#
$cisco_systems = 1;
# Usage: log_accum.pl [-d] [-s] [-M module] [[-m mailto] ...] [-f logfile]
# -d - turn on debugging
# -m mailto - send mail to "mailto" (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
#
# Recipient of all mail messages
# Configurable options
#
$mailto = "sw-notification@cisco.com";
############################################################
$MAILER = "Mail"; # set this to something that takes "-s"
#
# Constants
# End user configurable options.
#
# Constants (don't change these!)
#
############################################################
$STATE_NONE = 0;
$STATE_CHANGED = 1;
$STATE_ADDED = 2;
@ -38,82 +39,113 @@ $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";
$VERSION_FILE = "version";
$TRUNKREV_FILE = "TrunkRev";
$CHANGES_FILE = "Changes";
$CHANGES_TEMP = "Changes.tmp";
############################################################
#
# Subroutines
# Subroutines
#
############################################################
sub format_names {
local($dir, @files) = @_;
local(@lines);
$lines[0] = sprintf(" %-08s", $dir);
foreach $file (@files) {
if (length($lines[$#lines]) + length($file) > 60) {
$lines[++$#lines] = sprintf(" %8s", " ");
}
$lines[$#lines] .= " ".$file;
}
@lines;
}
sub cleanup_tmpfiles {
local($all) = @_;
local($wd, @files);
$wd = `pwd`;
chdir("/tmp");
chdir("/tmp") || die("Can't chdir('/tmp')\n");
opendir(DIR, ".");
if ($all == 1) {
push(@files, grep(/$id$/, readdir(DIR)));
} else {
push(@files, grep(/^$FILE_PREFIX.*$id$/, readdir(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");
open(FILE, ">$filename") || die("Cannot open log file $filename.\n");
print FILE join("\n", @lines), "\n";
close(FILE);
}
sub append_to_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) {
local(@lines) = &format_names($dir, @files);
open(FILE, ">>$filename") || die ("Cannot open file $filename.\n");
print(FILE join("\n", @lines), "\n");
open(FILE, ">>$filename") || die("Cannot open file $filename.\n");
print FILE $dir, "\n";
print FILE join("\n", @files), "\n";
close(FILE);
}
}
sub write_line {
local($filename, $line) = @_;
open(FILE, ">$filename") || die("Cannot open file $filename.\n");
print(FILE $line, "\n");
close(FILE);
}
sub read_line {
local($line);
local($filename) = @_;
open(FILE, "<$filename") || die("Cannot open file $filename.\n");
$line = <FILE>;
close(FILE);
@ -121,23 +153,11 @@ sub read_line {
$line;
}
sub read_file {
local(@text);
local($filename, $leader) = @_;
open(FILE, "<$filename") || return ();
while (<FILE>) {
chop;
push(@text, sprintf(" %-10s %s", $leader, $_));
$leader = "";
}
close(FILE);
@text;
}
sub read_logfile {
local(@text);
local($filename, $leader) = @_;
open(FILE, "<$filename") || die ("Cannot open log file $filename.\n");
open(FILE, "<$filename");
while (<FILE>) {
chop;
push(@text, $leader.$_);
@ -146,110 +166,179 @@ sub read_logfile {
@text;
}
sub bump_version {
local($trunkrev, $editnum, $version);
$trunkrev = &read_line("$ENV{'CVSROOT'}/$repository/$TRUNKREV_FILE");
$editnum = &read_line("$ENV{'CVSROOT'}/$repository/$VERSION_FILE");
&write_line("$ENV{'CVSROOT'}/$repository/$VERSION_FILE", $editnum+1);
$version = $trunkrev . "(" . $editnum . ")";
}
sub build_header {
local($version) = @_;
local($header);
local($sec,$min,$hour,$mday,$mon,$year) = localtime(time);
$header = sprintf("%-8s %s %02d/%02d/%02d %02d:%02d:%02d",
$login, $version, $year%100, $mon+1, $mday,
$hour, $min, $sec);
}
sub do_changes_file {
local($changes, $tmpchanges);
local(@text) = @_;
$changes = "$ENV{'CVSROOT'}/$repository/$CHANGES_FILE";
$tmpchanges = "$ENV{'CVSROOT'}/$repository/$CHANGES_TEMP";
if (rename($changes, $tmpchanges) != 1) {
die("Cannot rename $changes to $tmpchanges.\n");
}
open(CHANGES, ">$changes") || die("Cannot open $changes.\n");
open(TMPCHANGES, "<$tmpchanges") || die("Cannot open $tmpchanges.\n");
print(CHANGES join("\n", @text), "\n\n");
print(CHANGES <TMPCHANGES>);
close(CHANGES);
close(TMPCHANGES);
unlink($tmpchanges);
$header = sprintf("CVSROOT:\t%s\nModule name:\t%s\nChanges by:\t%s@%s\t%02d/%02d/%02d %02d:%02d:%02d",
$cvsroot,
$modulename,
$login, $hostdomain,
$year%100, $mon+1, $mday,
$hour, $min, $sec);
}
sub mail_notification {
local($name, @text) = @_;
open(MAIL, "| mail -s \"Source Repository Modification\" $name");
print(MAIL join("\n", @text));
open(MAIL, "| $MAILER -s \"CVS Update: " . $modulename . "\" " . $name);
print MAIL join("\n", @text), "\n";
close(MAIL);
}
#############################################################
#
# Main Body
#
############################################################
sub write_commitlog {
local($logfile, @text) = @_;
open(FILE, ">>$logfile");
print FILE join("\n", @text), "\n";
close(FILE);
}
#
# Main Body
#
# Initialize basic variables
#
$id = getpgrp();
$debug = 0;
$id = getpgrp(); # note, you *must* use a shell which does setpgrp()
$state = $STATE_NONE;
$login = getlogin || (getpwuid($<))[0] || die("Unknown user $<.\n");
@files = split(' ', $ARGV[0]);
$login = getlogin || (getpwuid($<))[0] || "nobody";
chop($hostname = `hostname`);
chop($domainname = `domainname`);
$hostdomain = $hostname . $domainname;
$cvsroot = $ENV{'CVSROOT'};
$do_status = 1;
$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') {
$mailto = "$mailto " . shift @ARGV;
} elsif ($arg eq '-M') {
$modulename = shift @ARGV;
} elsif ($arg eq '-s') {
$do_status = 0;
} 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);
}
}
($mailto) || die("No -m mail recipient specified\n");
# for now, the first "file" is the repository directory being committed,
# relative to the $CVSROOT location
#
@path = split('/', $files[0]);
$repository = @path[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.
#
if ($modulename eq "") {
$modulename = $path[0]; # I.e. the module name == top-level dir
}
if ($#path == 0) {
$dir = ".";
} else {
$dir = join('/', @path[1..$#path]);
$dir = join('/', @path);
}
#print("ARGV - ", join(":", @ARGV), "\n");
#print("files - ", join(":", @files), "\n");
#print("path - ", join(":", @path), "\n");
#print("dir - ", $dir, "\n");
#print("id - ", $id, "\n");
$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:
#
# Check for a new directory first. This will always appear as a
# single item in the argument list, and an empty log message.
# files[0] - "path/name/newdir"
# files[1] - "-"
# files[2] - "New"
# files[3] - "directory"
#
if ($ARGV[0] =~ /New directory/) {
$version = &bump_version if ($cisco_systems != 0);
$header = &build_header($version);
if ($files[2] =~ /New/ && $files[3] =~ /directory/) {
local(@text);
@text = ();
push(@text, $header);
push(@text, &build_header());
push(@text, "");
push(@text, " ".$ARGV[0]);
&do_changes_file(@text) if ($cisco_systems != 0);
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($mailto, @text);
exit 0;
}
# Iterate over the body of the message collecting information.
#
while (<STDIN>) {
chop; # Drop the newline
if (/^In directory/) {
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 space
s/[ \t\n]+$//; # delete trailing space
s/^[ \t\n]+//; # delete leading whitespace
s/[ \t\n]+$//; # delete trailing whitespace
push (@changed_files, split) if ($state == $STATE_CHANGED);
push (@added_files, split) if ($state == $STATE_ADDED);
push (@removed_files, split) if ($state == $STATE_REMOVED);
push (@log_lines, $_) if ($state == $STATE_LOG);
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.
@ -268,64 +357,140 @@ for ($i = $#log_lines; $i > 0; $i--) {
}
}
#
# Find the log file that matches this log message
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++) {
last if (! -e "$LOG_FILE.$i.$id");
local(@text);
last if (! -e "$LOG_FILE.$i.$id"); # the next available one
@text = &read_logfile("$LOG_FILE.$i.$id", "");
last if ($#text == -1);
last if (join(" ", @log_lines) eq join(" ", @text));
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], $_);
}
#
# Spit out the information gathered in this pass.
# End Of Commits!
#
&write_logfile("$LOG_FILE.$i.$id", @log_lines);
&append_to_file("$ADDED_FILE.$i.$id", $dir, @added_files);
&append_to_file("$CHANGED_FILE.$i.$id", $dir, @changed_files);
&append_to_file("$REMOVED_FILE.$i.$id", $dir, @removed_files);
#
# Check whether this is the last directory. If not, quit.
#
$_ = &read_line("$LAST_FILE.$id");
exit 0 if (! grep(/$files[0]$/, $_));
#
# 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.
#
# Get the full version number
#
$version = &bump_version if ($cisco_systems != 0);
$header = &build_header($version);
#
# Produce the final compilation of the log messages
#
@text = ();
push(@text, $header);
@status_txt = ();
push(@text, &build_header());
push(@text, "");
for ($i = 0; ; $i++) {
last if (! -e "$LOG_FILE.$i.$id");
push(@text, &read_file("$CHANGED_FILE.$i.$id", "Modified:"));
push(@text, &read_file("$ADDED_FILE.$i.$id", "Added:"));
push(@text, &read_file("$REMOVED_FILE.$i.$id", "Removed:"));
push(@text, " Log:");
push(@text, &read_logfile("$LOG_FILE.$i.$id", " "));
push(@text, "");
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, $_);
}
}
}
}
if ($cisco_systems != 0) {
@ddts = grep(/^CSCdi/, split(' ', join(" ", @text)));
$text[0] .= " " . join(" ", @ddts);
# Write to the commitlog file
#
if ($commitlog) {
&write_commitlog($commitlog, @text);
}
if ($#status_txt >= 0) {
push(@text, @status_txt);
}
# Mailout the notification.
#
# Put the log message at the beginning of the Changes file and mail
# out the notification.
#
&do_changes_file(@text) if ($cisco_systems != 0);
&mail_notification($mailto, @text);
&cleanup_tmpfiles(1);
# cleanup
#
if (! $debug) {
&cleanup_tmpfiles();
}
exit 0;

View File

@ -1,4 +1,5 @@
#!/usr/bin/perl
#! xPERL_PATHx
# -*-Perl-*-
#
# From: clyne@niwot.scd.ucar.EDU (John Clyne)
# Date: Fri, 28 Feb 92 09:54:21 MST
@ -11,7 +12,7 @@
# Especially if they regularly beat on the same directory. Anyway if you
# think anyone would be interested here it is.
#
# $Id: mfpipe.pl,v 1.1 1992/03/02 01:22:41 berliner Exp $
# $Id: mfpipe.pl,v 1.2 1995/07/10 02:01:57 kfogel Exp $
#
#
# File: mfpipe

View File

@ -1,3 +1,109 @@
Wed Nov 22 11:01:50 1995 Joshua Cowan <jcowan@hermit.reslife.okstate.edu>
* pcl-cvs.el (cvs-changelog-ours-p): use `user-full-name' if
`add-log-full-name' unbound, as not every uses the stuff in
add-log.el. Same with `add-log-mailing-address'.
(cvs-changelog-entries): change to `change-log-mode' unless
already in it.
Sun Jul 9 20:57:11 1995 Karl Fogel <kfogel@floss.cyclic.com>
* "/bin/rmdir" as default, not "/usr/local/bin/rmdir".
Fri Jun 16 15:24:34 1995 Jim Kingdon (kingdon@cyclic.com)
* pcl-cvs.elc, pcl-cvs-lucid.elc: Added.
* Makefile.in: Rename from Makefile and set srcdir.
Thu May 18 17:10:27 1995 Jim Blandy <jimb@totoro.bio.indiana.edu>
Automatically guess CVS log entries from ChangeLog contents.
* pcl-cvs.el (cvs-mode-changelog-commit): New command.
(cvs-changelog-full-paragraphs): New variable.
(cvs-changelog-name, cvs-narrow-changelog,
cvs-changelog-paragraph, cvs-changelog-subparagraph,
cvs-changelog-entry, cvs-changelog-ours-p, cvs-relative-path,
cvs-changelog-entries, cvs-changelog-insert-entries, cvs-union,
cvs-insert-changelog-entries, cvs-edit-delete-common-indentation):
New functions.
(cvs-mode-map): Bind 'C' to cvs-mode-changelog-commit.
(cvs-mode): Mention cvs-mode-changelog-commit in docstring.
Give the info files names ending in ".info".
* Makefile (INFOFILES, install_info): Change pcl-cvs to
pcl-cvs.info.
(pcl-cvs.info): Target renamed from pcl-cvs.
(DISTFILES): pcl-cvs removed; we handle the info files explicitly
in the dist-dir target.
(dist-dir): Depend on pcl-cvs.info. Distribute pcl-cvs.info*.
* pcl-cvs.texinfo: Change @setfilename appropriately.
* INSTALL: Updated.
* .cvsignore: Correctly ignore the info files.
* README: Note that pcl-cvs has been tested under 19.28, and that
the "cookie" naming conflict was resolved in 19.11.
* Makefile (pcl-cvs-lucid.elc): Changed this target from
pcl-cvs-lucid.el. That's a source file, for goodness' sake!
Tue May 9 13:56:50 1995 Jim Blandy <jimb@totoro.bio.indiana.edu>
* Change references to "Cygnus's remote CVS" to "Cyclic CVS".
Wed May 3 13:55:27 1995 Jim Blandy <jimb@totoro.bio.indiana.edu>
* pcl-cvs.el (cvs-parse-stderr): Handle colons after both
"rcsmerge" and "warning".
Fri Apr 28 22:38:14 1995 Jim Blandy <jimb@totoro.bio.indiana.edu>
* Makefile (ELFILES): Include pcl-cvs-startup.el.
(info, pcl-cvs): Call makeinfo appropriately for modern versions.
(pcl-cvs.aux): List dependency on pcl-cvs.texinfo.
(pcl-cvs.ps): New target.
(DVIPS): New variable.
(dist-dir): Renamed from dist, updated to accept DISTDIR value
passed from parent.
(DISTFILES): New varible.
(pcl-cvs.elc, pcl-cvs-lucid.elc): Add targets to elcfiles target.
Tue Apr 25 21:33:49 1995 Jim Blandy <jimb@totoro.bio.indiana.edu>
* pcl-cvs.el: (cvs-parse-stderr): Recognize "conflicts" as well as
"overlaps" before "during merge."
Thu Feb 16 12:17:20 1995 Jim Blandy <jimb@totoro.bio.indiana.edu>
* pcl-cvs.el (cvs-parse-stderr): Recognize "conflicts found in..."
messages attributed to "cvs server", as well as "cvs update".
Sat Feb 4 01:47:01 1995 Jim Blandy <jimb@totoro.bio.indiana.edu>
* pcl-cvs.el: Deal with the 'P' action, produced by remote CVS.
(cvs-parse-stdout): Treat 'P' like 'U' --- file is updated.
Tue Jan 31 23:31:39 1995 Jim Blandy <jimb@totoro.bio.indiana.edu>
* pcl-cvs.el (cvs-cvsroot-required): New variable.
(cvs-do-update): If cvs-cvsroot-required is not set, don't complain if
CVSROOT and cvs-cvsroot are both unset.
Sun Jan 22 21:22:22 1995 Jim Blandy <jimb@totoro.bio.indiana.edu>
* pcl-cvs.el (cvs-parse-stderr):
Some changes for Cygnus's Remote CVS. Treat
messages like "cvs server: Updating DIRECTORY" as we treat those like
"cvs update: Updating DIRECTORY". Ignore other messages starting with
"cvs server".
* pcl-cvs.el (cvs-parse-stderr): Re-indent.
* .cvsignore: Add ignore list for Texinfo litter.
* Makefile (lispdir): Set appropriately for totoro.
* pcl-cvs.el (cvs-program, cvs-diff-program, cvs-rmdir-program): Same.
Tue Jun 1 00:00:03 1993 Per Cederqvist (ceder@lysator.liu.se)
* Release 1.05. (This release was promised before the end of May,

View File

@ -51,22 +51,25 @@ Installation of the pcl-cvs program
Installation of the on-line manual.
===================================
1. Create the info file `pcl-cvs' from `pcl-cvs.texinfo' by typing
`make info'. If you don't have the program `makeinfo' you can
get it by anonymous ftp from e.g. `ftp.gnu.ai.mit.edu' as
1. Move the info file `pcl-cvs.info' to your standard info
directory. This might be called something like
`/usr/gnu/emacs/info'.
2. Edit the file `dir' in the info directory and enter one line to
contain a pointer to the info file `pcl-cvs.info'. The line can,
for instance, look like this:
* Pcl-cvs: (pcl-cvs.info). An Emacs front-end to CVS.
How to make the on-line manual from pcl-cvs.texinfo
===================================================
1. Create the info file `pcl-cvs.info' from `pcl-cvs.texinfo' by
typing `make info'. If you don't have the program `makeinfo' you
can get it by anonymous ftp from e.g. `ftp.gnu.ai.mit.edu' as
`pub/gnu/texinfo-2.14.tar.Z' (there might be a newer version
there when you read this), or you could use the preformatted
info file `pcl-cvs.info' that is included in the distribution
(type `cp pcl-cvs.info pcl-cvs').
2. Move the info file `pcl-cvs' to your standard info directory.
This might be called something like `/usr/gnu/emacs/info'.
3. Edit the file `dir' in the info directory and enter one line to
contain a pointer to the info file `pcl-cvs'. The line can, for
instance, look like this:
* Pcl-cvs: (pcl-cvs). An Emacs front-end to CVS.
there when you read this).
How to make typeset documentation from pcl-cvs.texinfo

View File

@ -19,10 +19,11 @@ If you have been using a previous version of pcl-cvs (for instance
1.02 which is distributed with CVS 1.3) you should read through the
file NEWS to see what has changed.
This release has been tested under Emacs 18.59, Emacs 19.10 and Lucid
This release has been tested under Emacs 18.59, Emacs 19.28 and Lucid
Emacs 19.6. Emacs 19.10 unfortunately has a file named cookie.el that
collides with the cookie.el that is distributed in Elib. We are
trying to find a solution to that problem. In the mean time, there is
collides with the cookie.el that is distributed in Elib. This
conflict was resolved in 19.11. For earlier versions, there are
instructions in Elib 0.07 for how to work around the problem.
Per Cederqvist
(updated by Jim Blandy)

View File

@ -37,13 +37,13 @@
;;; -------------------------------------------------------
;;; START OF THINGS TO CHECK WHEN INSTALLING
(defvar cvs-program "/usr/gnu/bin/cvs"
(defvar cvs-program "/usr/local/bin/cvs"
"*Full path to the cvs executable.")
(defvar cvs-diff-program "/usr/gnu/bin/diff"
(defvar cvs-diff-program "/usr/local/bin/diff"
"*Full path to the diff program.")
(defvar cvs-rmdir-program "/usr/gnu/bin/rmdir"
(defvar cvs-rmdir-program "/bin/rmdir"
"*Full path to the rmdir program. Typically /bin/rmdir.")
;; Uncomment the following line if you are running on 18.57 or earlier.
@ -64,6 +64,20 @@
Overrides the $CVSROOT variable by sending \" -d dir\" to all cvs commands.
This switch is useful if you have multiple CVS repositories.")
(defvar cvs-cvsroot-required t
"*Specifies whether CVS needs to be told where the repository is.
In CVS 1.3, if your CVSROOT environment variable is not set, and you
do not set the `cvs-cvsroot' lisp variable, CVS will have no idea
where to find the repository, and refuse to run. CVS 1.4 and later
store the repository path with the working directories, so most
operations don't need to be told where the repository is.
If you work with multiple repositories with CVS 1.4, it's probably
advisable to leave your CVSROOT environment variable unset, set this
variable to nil, and let CVS figure out where the repository is for
itself.")
(defvar cvs-stdout-file nil
"Name of the file that holds the output that CVS sends to stdout.
This variable is buffer local.")
@ -214,7 +228,7 @@ the process when a cvs update process is running.")
;;; slash.
;;; file-name The file name.
;;; base-revision The revision that the working file was based on.
;;; Onlyy valid for MERGED and CONFLICT files.
;;; Only valid for MERGED and CONFLICT files.
;;; cvs-diff-buffer A buffer that contains a 'cvs diff file'.
;;; backup-diff-buffer A buffer that contains a 'diff file backup-file'.
;;; full-log The output from cvs, unparsed.
@ -450,7 +464,8 @@ Both LOCAL and DONT-CHANGE-DISC may be non-nil simultaneously.
(if (not (file-exists-p cvs-program))
(error "%s: file not found (check setting of cvs-program)"
cvs-program))
(if (not (or (getenv "CVSROOT") cvs-cvsroot))
(if (and cvs-cvsroot-required
(not (or (getenv "CVSROOT") cvs-cvsroot)))
(error "Both cvs-cvsroot and environment variable CVSROOT unset."))
(let* ((this-dir (file-name-as-directory (expand-file-name directory)))
(update-buffer (generate-new-buffer
@ -571,6 +586,7 @@ Full documentation is in the Texinfo file. These are the most useful commands:
\\[cvs-mode-emerge] Run emerge on base revision/backup file.
\\[cvs-mode-acknowledge] Delete line from buffer. \\[cvs-mode-ignore] Add file to the .cvsignore file.
\\[cvs-mode-log] Run ``cvs log''. \\[cvs-mode-status] Run ``cvs status''.
\\[cvs-mode-changelog-commit] Like \\[cvs-mode-commit], but get default log text from ChangeLog.
\\[cvs-mode-undo-local-changes] Revert the last checked in version - discard your changes to the file.
Entry to this mode runs cvs-mode-hook.
@ -898,12 +914,12 @@ This function returns the last cons-cell in the list that is built."
;; End of RCVS stuff.
;; CVS is descending a subdirectory.
((looking-at "cvs update: Updating \\(.*\\)$")
;; (The "server" case is there to support Cyclic CVS.)
((looking-at "cvs \\(update\\|server\\): Updating \\(.*\\)$")
(setq current-dir
(cvs-get-current-dir
root-dir
(buffer-substring (match-beginning 1) (match-end 1))))
(buffer-substring (match-beginning 2) (match-end 2))))
(setcdr head (list (cvs-create-fileinfo
'DIRCHANGE current-dir
nil (buffer-substring (match-beginning 0)
@ -1010,98 +1026,102 @@ second party")
(buffer-substring start (point)))))
(setq head (cdr head))))
(t
;; Ignore other messages from Cyclic CVS.
((looking-at "cvs server:")
(forward-line 1))
;; CVS has decided to merge someone elses changes into this
;; document. This leads to a lot of garbage being printed.
;; First there is two lines that contains no information
;; that we skip (but we check that we recognize them).
(t
(let ((complex-start (point))
initial-revision filename)
;; CVS has decided to merge someone elses changes into this
;; document. This leads to a lot of garbage being printed.
;; First there is two lines that contains no information
;; that we skip (but we check that we recognize them).
(cvs-skip-line stdout-buffer stderr-buffer "^RCS file: .*$")
(setq initial-revision
(cvs-skip-line stdout-buffer stderr-buffer
"^retrieving revision \\(.*\\)$" 1))
(cvs-skip-line stdout-buffer stderr-buffer
"^retrieving revision .*$")
;; Get the file name from the next line.
(setq
filename
(cvs-skip-line
stdout-buffer stderr-buffer
"^Merging differences between [0-9.]+ and [0-9.]+ into \\(.*\\)$"
1))
(cond
;; Was it a conflict?
((looking-at
;; Allow both RCS 5.5 and 5.6. (5.6 prints "rcs" and " warning").
"^\\(rcs\\)?merge\\( warning\\)?: overlaps during merge$")
;; Yes, this is a conflict.
(cvs-skip-line
stdout-buffer stderr-buffer
"^\\(rcs\\)?merge\\( warning\\)?: overlaps during merge$")
(let ((complex-start (point))
initial-revision filename)
(cvs-skip-line stdout-buffer stderr-buffer "^RCS file: .*$")
(setq initial-revision
(cvs-skip-line stdout-buffer stderr-buffer
"^retrieving revision \\(.*\\)$" 1))
(cvs-skip-line stdout-buffer stderr-buffer
"^cvs update: conflicts found in ")
"^retrieving revision .*$")
(let ((fileinfo
(cvs-create-fileinfo
'CONFLICT current-dir
filename
(buffer-substring complex-start (point)))))
;; Get the file name from the next line.
(cvs-set-fileinfo->base-revision fileinfo initial-revision)
(setq
filename
(cvs-skip-line
stdout-buffer stderr-buffer
"^Merging differences between [0-9.]+ and [0-9.]+ into \\(.*\\)$"
1))
(setcdr head (list fileinfo))
(setq head (cdr head))))
(cond
;; Was it a conflict?
((looking-at
;; Allow both RCS 5.5 and 5.6. (5.6 prints "rcs" and " warning").
"^\\(rcs\\)?merge:?\\( warning\\)?: \\(overlaps\\|conflicts\\) during merge$")
;; Was it a conflict, and was RCS compiled without DIFF3_BIN?
;; Yes, this is a conflict.
(cvs-skip-line
stdout-buffer stderr-buffer
"^\\(rcs\\)?merge:?\\( warning\\)?: \\(overlaps\\|conflicts\\) during merge$")
((looking-at
;; Allow both RCS 5.5 and 5.6. (5.6 prints "rcs" and " warning").
"^\\(rcs\\)?merge\\( warning\\)?: overlaps or other probl\
(cvs-skip-line stdout-buffer stderr-buffer
"^cvs \\(update\\|server\\): conflicts found in ")
(let ((fileinfo
(cvs-create-fileinfo
'CONFLICT current-dir
filename
(buffer-substring complex-start (point)))))
(cvs-set-fileinfo->base-revision fileinfo initial-revision)
(setcdr head (list fileinfo))
(setq head (cdr head))))
;; Was it a conflict, and was RCS compiled without DIFF3_BIN?
((looking-at
;; Allow both RCS 5.5 and 5.6. (5.6 prints "rcs" and " warning").
"^\\(rcs\\)?merge\\( warning\\)?: overlaps or other probl\
ems during merge$")
;; Yes, this is a conflict.
(cvs-skip-line
stdout-buffer stderr-buffer
"^\\(rcs\\)?merge\\( warning\\)?: overlaps .*during merge$")
;; Yes, this is a conflict.
(cvs-skip-line
stdout-buffer stderr-buffer
"^\\(rcs\\)?merge\\( warning\\)?: overlaps .*during merge$")
(cvs-skip-line stdout-buffer stderr-buffer
"^cvs update: could not merge ")
(cvs-skip-line stdout-buffer stderr-buffer
"^cvs update: restoring .* from backup file ")
(cvs-skip-line stdout-buffer stderr-buffer
"^cvs update: could not merge ")
(cvs-skip-line stdout-buffer stderr-buffer
"^cvs update: restoring .* from backup file ")
(let ((fileinfo
(cvs-create-fileinfo
'CONFLICT current-dir
filename
(buffer-substring complex-start (point)))))
(let ((fileinfo
(cvs-create-fileinfo
'CONFLICT current-dir
filename
(buffer-substring complex-start (point)))))
(setcdr head (list fileinfo))
(setq head (cdr head))))
(setcdr head (list fileinfo))
(setq head (cdr head))))
(t
;; Not a conflict; it must be a succesful merge.
(let ((fileinfo
(cvs-create-fileinfo
'MERGED current-dir
filename
(buffer-substring complex-start (point)))))
(cvs-set-fileinfo->base-revision fileinfo initial-revision)
(setcdr head (list fileinfo))
(setq head (cdr head)))))))))))
(t
;; Not a conflict; it must be a succesful merge.
(let ((fileinfo
(cvs-create-fileinfo
'MERGED current-dir
filename
(buffer-substring complex-start (point)))))
(cvs-set-fileinfo->base-revision fileinfo initial-revision)
(setcdr head (list fileinfo))
(setq head (cdr head)))))))))))
head)
(defun cvs-parse-stdout (stdout-buffer stderr-buffer head root-dir)
"Parse the output from CVS that is written to stderr.
"Parse the output from CVS that is written to stdout.
Args: STDOUT-BUFFER STDERR-BUFFER HEAD ROOT-DIR
STDOUT-BUFFER is the buffer that holds the output to parse.
STDERR-BUFFER holds the output that cvs sent to stderr. It is only
@ -1121,11 +1141,11 @@ This function doesn't return anything particular."
;; A: The file is "cvs add"ed, but not "cvs ci"ed.
;; R: The file is "cvs remove"ed, but not "cvs ci"ed.
;; C: Conflict
;; U: The file is copied from the repository.
;; U, P: The file is copied from the repository.
;; ?: Unknown file.
((looking-at "\\([MARCU?]\\) \\(.*\\)$")
((looking-at "\\([MARCUP?]\\) \\(.*\\)$")
(let*
((c (char-after (match-beginning 1)))
(full-path
@ -1137,12 +1157,15 @@ This function doesn't return anything particular."
((eq c ?R) 'REMOVED)
((eq c ?C) 'CONFLICT)
((eq c ?U) 'UPDATED)
;; generated when Cyclic CVS sends a
;; patch instead of the full file:
((eq c ?P) 'UPDATED)
((eq c ??) 'UNKNOWN))
(substring (file-name-directory full-path) 0 -1)
(file-name-nondirectory full-path)
(buffer-substring (match-beginning 0) (match-end 0)))))
;; Updated files require no further action.
(if (eq c ?U)
(if (memq c '(?U ?P))
(cvs-set-fileinfo->handled fileinfo t))
;; Link this last on the list.
@ -1227,6 +1250,7 @@ For use by the cookie package."
(define-key cvs-mode-map "a" 'cvs-mode-add)
(define-key cvs-mode-map "b" 'cvs-mode-diff-backup)
(define-key cvs-mode-map "c" 'cvs-mode-commit)
(define-key cvs-mode-map "C" 'cvs-mode-changelog-commit)
(define-key cvs-mode-map "d" 'cvs-mode-diff-cvs)
(define-key cvs-mode-map "e" 'cvs-mode-emerge)
(define-key cvs-mode-map "f" 'cvs-mode-find-file)
@ -2204,3 +2228,266 @@ If second optional argument REVISION is given, retrieve that revision instead."
(progn
(autoload 'pcl-cvs-fontify "pcl-cvs-lucid")
(add-hook 'cvs-mode-hook 'pcl-cvs-fontify)))
(defvar cvs-changelog-full-paragraphs t
"If non-nil, include full ChangeLog paragraphs in the CVS log.
This may be set in the ``local variables'' section of a ChangeLog, to
indicate the policy for that ChangeLog.
A ChangeLog paragraph is a bunch of log text containing no blank lines;
a paragraph usually describes a set of changes with a single purpose,
but perhaps spanning several functions in several files. Changes in
different paragraphs are unrelated.
You could argue that the CVS log entry for a file should contain the
full ChangeLog paragraph mentioning the change to the file, even though
it may mention other files, because that gives you the full context you
need to understand the change. This is the behavior you get when this
variable is set to t.
On the other hand, you could argue that the CVS log entry for a change
should contain only the text for the changes which occurred in that
file, because the CVS log is per-file. This is the behavior you get
when this variable is set to nil.")
(defun cvs-changelog-name (directory)
"Return the name of the ChangeLog file that handles DIRECTORY.
This is in DIRECTORY or one of its parents.
Signal an error if we can't find an appropriate ChangeLog file."
(let ((dir (file-name-as-directory directory))
file)
(while (and dir
(not (file-exists-p
(setq file (expand-file-name "ChangeLog" dir)))))
(let ((last dir))
(setq dir (file-name-directory (directory-file-name dir)))
(if (equal last dir)
(setq dir nil))))
(or dir
(error "Can't find ChangeLog for %s" directory))
file))
(defun cvs-narrow-changelog ()
"Narrow to the top page of the current buffer, a ChangeLog file.
Actually, the narrowed region doesn't include the date line.
A \"page\" in a ChangeLog file is the area between two dates."
(or (eq major-mode 'change-log-mode)
(error "cvs-narrow-changelog: current buffer isn't a ChangeLog"))
(goto-char (point-min))
;; Skip date line and subsequent blank lines.
(forward-line 1)
(if (looking-at "[ \t\n]*\n")
(goto-char (match-end 0)))
(let ((start (point)))
(forward-page 1)
(narrow-to-region start (point))
(goto-char (point-min))))
(defun cvs-changelog-paragraph ()
"Return the bounds of the ChangeLog paragraph containing point.
If we are between paragraphs, return the previous paragraph."
(save-excursion
(beginning-of-line)
(if (looking-at "^[ \t]*$")
(skip-chars-backward " \t\n" (point-min)))
(list (progn
(if (re-search-backward "^[ \t]*\n" nil 'or-to-limit)
(goto-char (match-end 0)))
(point))
(if (re-search-forward "^[ \t\n]*$" nil t)
(match-beginning 0)
(point)))))
(defun cvs-changelog-subparagraph ()
"Return the bounds of the ChangeLog subparagraph containing point.
A subparagraph is a block of non-blank lines beginning with an asterisk.
If we are between subparagraphs, return the previous subparagraph."
(save-excursion
(end-of-line)
(if (search-backward "*" nil t)
(list (progn (beginning-of-line) (point))
(progn
(forward-line 1)
(if (re-search-forward "^[ \t]*[\n*]" nil t)
(match-beginning 0)
(point-max))))
(list (point) (point)))))
(defun cvs-changelog-entry ()
"Return the bounds of the ChangeLog entry containing point.
The variable `cvs-changelog-full-paragraphs' decides whether an
\"entry\" is a paragraph or a subparagraph; see its documentation string
for more details."
(if cvs-changelog-full-paragraphs
(cvs-changelog-paragraph)
(cvs-changelog-subparagraph)))
(defun cvs-changelog-ours-p ()
"See if ChangeLog entry at point is for the current user, today.
Return non-nil iff it is."
;; Code adapted from add-change-log-entry.
(looking-at (concat (regexp-quote (substring (current-time-string)
0 10))
".* "
(regexp-quote (substring (current-time-string) -4))
"[ \t]+"
(regexp-quote (if (boundp 'add-log-full-name)
add-log-full-name
user-full-name))
" <"
(regexp-quote
(if (boundp 'add-log-mailing-address)
add-log-mailing-address
user-mail-address)))))
(defun cvs-relative-path (base child)
"Return a directory path relative to BASE for CHILD.
If CHILD doesn't seem to be in a subdirectory of BASE, just return
the full path to CHILD."
(let ((base (file-name-as-directory (expand-file-name base)))
(child (expand-file-name child)))
(or (string= base (substring child 0 (length base)))
(error "cvs-relative-path: %s isn't in %s" child base))
(substring child (length base))))
(defun cvs-changelog-entries (file)
"Return the ChangeLog entries for FILE, and the ChangeLog they came from.
The return value looks like this:
(LOGBUFFER (ENTRYSTART . ENTRYEND) ...)
where LOGBUFFER is the name of the ChangeLog buffer, and each
\(ENTRYSTART . ENTRYEND\) pair is a buffer region."
(save-excursion
(set-buffer (find-file-noselect
(cvs-changelog-name
(file-name-directory
(expand-file-name file)))))
(or (eq major-mode 'change-log-mode)
(change-log-mode))
(goto-char (point-min))
(if (looking-at "[ \t\n]*\n")
(goto-char (match-end 0)))
(if (not (cvs-changelog-ours-p))
(list (current-buffer))
(save-restriction
(cvs-narrow-changelog)
(goto-char (point-min))
;; Search for the name of FILE relative to the ChangeLog. If that
;; doesn't occur anywhere, they're not using full relative
;; filenames in the ChangeLog, so just look for FILE; we'll accept
;; some false positives.
(let ((pattern (cvs-relative-path
(file-name-directory buffer-file-name) file)))
(if (or (string= pattern "")
(not (save-excursion
(search-forward pattern nil t))))
(setq pattern file))
(let (texts)
(while (search-forward pattern nil t)
(let ((entry (cvs-changelog-entry)))
(setq texts (cons entry texts))
(goto-char (elt entry 1))))
(cons (current-buffer) texts)))))))
(defun cvs-changelog-insert-entries (buffer regions)
"Insert those regions in BUFFER specified in REGIONS.
Sort REGIONS front-to-back first."
(let ((regions (sort regions 'car-less-than-car))
(last))
(while regions
(if (and last (< last (car (car regions))))
(newline))
(setq last (elt (car regions) 1))
(apply 'insert-buffer-substring buffer (car regions))
(setq regions (cdr regions)))))
(defun cvs-union (set1 set2)
"Return the union of SET1 and SET2, according to `equal'."
(while set2
(or (member (car set2) set1)
(setq set1 (cons (car set2) set1)))
(setq set2 (cdr set2)))
set1)
(defun cvs-insert-changelog-entries (files)
"Given a list of files FILES, insert the ChangeLog entries for them."
(let ((buffer-entries nil))
;; Add each buffer to buffer-entries, and associate it with the list
;; of entries we want from that file.
(while files
(let* ((entries (cvs-changelog-entries (car files)))
(pair (assq (car entries) buffer-entries)))
(if pair
(setcdr pair (cvs-union (cdr pair) (cdr entries)))
(setq buffer-entries (cons entries buffer-entries))))
(setq files (cdr files)))
;; Now map over each buffer in buffer-entries, sort the entries for
;; each buffer, and extract them as strings.
(while buffer-entries
(cvs-changelog-insert-entries (car (car buffer-entries))
(cdr (car buffer-entries)))
(if (and (cdr buffer-entries) (cdr (car buffer-entries)))
(newline))
(setq buffer-entries (cdr buffer-entries)))))
(defun cvs-edit-delete-common-indentation ()
"Unindent the current buffer rigidly until at least one line is flush left."
(save-excursion
(let ((common 100000))
(goto-char (point-min))
(while (< (point) (point-max))
(if (not (looking-at "^[ \t]*$"))
(setq common (min common (current-indentation))))
(forward-line 1))
(indent-rigidly (point-min) (point-max) (- common)))))
(defun cvs-mode-changelog-commit ()
"Check in all marked files, or the current file.
Ask the user for a log message in a buffer.
This is just like `\\[cvs-mode-commit]', except that it tries to provide
appropriate default log messages by looking at the ChangeLogs. The
idea is to write your ChangeLog entries first, and then use this
command to commit your changes.
To select default log text, we:
- find the ChangeLogs for the files to be checked in,
- verify that the top entry in the ChangeLog is on the current date
and by the current user; if not, we don't provide any default text,
- search the ChangeLog entry for paragraphs containing the names of
the files we're checking in, and finally
- use those paragraphs as the log text."
(interactive)
(let* ((cvs-buf (current-buffer))
(marked (cvs-filter (function cvs-committable)
(cvs-get-marked))))
(if (null marked)
(error "Nothing to commit!")
(pop-to-buffer (get-buffer-create cvs-commit-prompt-buffer))
(goto-char (point-min))
(erase-buffer)
(cvs-insert-changelog-entries
(mapcar (lambda (tin)
(let ((cookie (tin-cookie cvs-cookie-handle tin)))
(expand-file-name
(cvs-fileinfo->file-name cookie)
(cvs-fileinfo->dir cookie))))
marked))
(cvs-edit-delete-common-indentation)
(cvs-edit-mode)
(make-local-variable 'cvs-commit-list)
(setq cvs-commit-list marked)
(message "Press C-c C-c when you are done editing."))))

View File

@ -20,7 +20,7 @@
@comment along with pcl-cvs; see the file COPYING. If not, write to
@comment the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
@setfilename pcl-cvs
@setfilename pcl-cvs.info
@settitle Pcl-cvs - The Emacs Front-End to CVS
@setchapternewpage on

View File

@ -1,4 +1,5 @@
#!/usr/bin/perl
#! xPERL_PATHx
# -*-Perl-*-
# Author: John Rouillard (rouilj@cs.umb.edu)
# Supported: Yeah right. (Well what do you expect for 2 hours work?)

View File

@ -10,19 +10,23 @@ cvs \- Concurrent Versions System support files
.hy 0
.na
.TP
.B $CVSROOT/CVSROOT/modules,v
.TP
.B $CVSROOT/CVSROOT/commitinfo,v
.TP
.B $CVSROOT/CVSROOT/loginfo,v
.TP
.B $CVSROOT/CVSROOT/rcsinfo,v
.TP
.B $CVSROOT/CVSROOT/editinfo,v
.TP
.B $CVSROOT/CVSROOT/cvsignore,v
.TP
.B $CVSROOT/CVSROOT/cvswrappers,v
.TP
.B $CVSROOT/CVSROOT/editinfo,v
.TP
.B $CVSROOT/CVSROOT/history
.TP
.B $CVSROOT/CVSROOT/loginfo,v
.TP
.B $CVSROOT/CVSROOT/modules,v
.TP
.B $CVSROOT/CVSROOT/rcsinfo,v
.TP
.B $CVSROOT/CVSROOT/taginfo,v
.ad b
.hy 1
.SH DESCRIPTION
@ -67,6 +71,14 @@ source repository from a particular person or group.
Or, perhaps, to verify that the changed files conform to the site's
standards for coding practice.
.SP
You can use the `\|cvswrappers\|' file to record
.B cvs
wrapper commands to be used when checking files into and out of the
repository. Wrappers allow the file or directory to be processed
on the way in and out of CVS. The intended uses are many, one
possible use would be to reformat a C file before the file is checked
in, so all of the code in the repository looks the same.
.SP
You can use the `\|loginfo\|' file to define programs to execute after
any
.BR commit ,
@ -75,6 +87,14 @@ These logging programs might be used to append the log message to a file.
Or send the log message through electronic mail to a group of developers.
Or, perhaps, post the log message to a particular newsgroup.
.SP
You can use the `\|taginfo\|' file to define programs to execute after
any
.BR tag or rtag
operation. These programs might be used to append a message to a file
listing the new tag name and the programmer who created it, or send mail
to a group of developers, or, perhaps, post a message to a particular
newsgroup.
.SP
You can use the `\|rcsinfo\|' file to define forms for log messages.
.SP
You can use the `\|editinfo\|' file to define a program to execute for
@ -127,7 +147,7 @@ to get an editable copy of the file. You should define similar module
entries for the other configuration files described here (except
\&`\|history\|').
The
.BR cvsinit ( 1 )
.BR cvsinit ( 8 )
script will setup a smilar `\|modules\|' file for you automatically.
.SP
The `\|modules\|' file may contain blank lines and comments (lines
@ -210,6 +230,10 @@ source repository. The `\|commitinfo\|', `\|loginfo\|', and
to run whenever files in a module are checked out. \fIprog\fP runs
with a single argument, the module name.
.SP
`\|\fB\-e\fP \fIprog\fP\|' allows you to specify a program \fIprog\fP
to run whenever files in a module are exported. \fIprog\fP runs
with a single argument, the module name.
.SP
`\|\fB\-t\fP \fIprog\fP\|' allows you to specify a program \fIprog\fP
to run whenever files in a module are tagged. \fIprog\fP runs with two
arguments: the module name and the symbolic tag specified to \fBrtag\fP.
@ -241,6 +265,23 @@ repository where the change is being made.
The remaining arguments list the files that are being modified, added, or
removed by this \fBcommit\fP invocation.
.SP
For `\|taginfo\|', the rest of the
line is a command-line template to execute.
The arguments passed to the command are, in order, the
.I tagname ,
.I operation
(i.e.
.B add
for `tag',
.B mov
for `tag -F', and
.B del
for `tag -d`),
.I repository ,
and any remaining are pairs of
.B "filename revision" .
A non-zero exit of the filter program will cause the tag to be aborted.
.SP
For `\|commitinfo\|', the rest of the line is a command-line template to
execute.
The template can include not only a program name, but whatever

View File

@ -1 +1 @@
#define PATCHLEVEL 0
#define PATCHLEVEL 2

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
#
# $Id: commitinfo,v 1.2 1992/03/31 04:19:47 berliner Exp $
#ident "@(#)cvs/examples:$Name: $:$Id: commitinfo,v 1.3 1995/11/14 23:30:05 woods Exp $"
#
# The "commitinfo" file is used to control pre-commit checks.
# The filter on the right is invoked with the repository and a list
@ -7,15 +7,21 @@
# cause the commit to be aborted.
#
# The first entry on a line is a regular expression which is tested
# against the directory that the change is being committed to, relative to the
# $CVSROOT. If a match is found, then the remainder of the line is the
# name of the filter to run.
# against the directory that the change is being committed to, relative
# to the $CVSROOT. For the first match that is found, then the remainder
# of the line is the name of the filter to run.
#
# If the repository name does not match any of the regular expressions in this
# file, the "DEFAULT" line is used, if it is specified.
#
# If the name ALL appears as a regular expression it is always used
# in addition to the first matching regex or DEFAULT.
# If the name "ALL" appears as a regular expression it is always used
# in addition to the first matching regex or "DEFAULT".
#
^cvs checkforcvsid
DEFAULT checkforid
# NOTE: contrib/commit_prep usage:
# -r - record directories affected by commit for use with contrib/log_accum
# -c - check for things like "$Id" near head of file, no "$Log", etc.
#
^apc $CVSROOT/CVSROOT/commit_prep -r -c
^misc $CVSROOT/CVSROOT/commit_prep -r
CVSROOT $CVSROOT/CVSROOT/commit_prep -r -c
DEFAULT $CVSROOT/CVSROOT/commit_prep

View File

@ -1,5 +1,5 @@
#
# $Id: editinfo,v 1.1 1992/03/21 06:49:39 berliner Exp $
#ident "@(#)cvs/examples:$Name: $:$Id: editinfo,v 1.2 1995/11/14 23:30:07 woods Exp $"
#
# The "editinfo" file is used to allow verification of logging
# information. It works best when a template (as specified in the
@ -27,4 +27,6 @@
# supported. There can be only one entry that matches a given
# repository.
#
# Note there is no "edit" example script currently available....
#
DEFAULT $CVSROOT/CVSROOT/edit "%s"

View File

@ -1,20 +1,39 @@
#
# $CVSid: @(#)loginfo 1.5 92/03/31 $
#ident "@(#)cvs/examples:$Name: $:$Id: loginfo,v 1.4 1995/11/14 23:30:08 woods Exp $"
#
# The "loginfo" file is used to control where "cvs commit" log information
# is sent. The first entry on a line is a regular expression which is tested
# against the directory that the change is being made to, relative to the
# $CVSROOT. If a match is found, then the remainder of the line is a filter
# program that should expect log information on its standard input.
# $CVSROOT. For the first match that is found, then the remainder of the
# line is a filter program that should expect log information on its standard
# input.
#
# The filter program may use one and only one % modifier (ala printf). If
# %s is specified in the filter program, a brief title is included (enclosed
# in single quotes) showing the modified file names.
# If the repository name does not match any of the regular expressions in the
# first field of this file, the "DEFAULT" line is used, if it is specified.
#
# If the repository name does not match any of the regular expressions in this
# file, the "DEFAULT" line is used, if it is specified.
# If the name "ALL" appears as a regular expression it is always used
# in addition to the first matching regex or "DEFAULT".
#
# If the name ALL appears as a regular expression it is always used
# in addition to the first matching regex or DEFAULT.
# The filter program may use one and only one "%s" modifier (ala printf). If
# such a "%s" is specified in the filter program, a brief title is included
# (as one argument, enclosed in single quotes) showing the relative directory
# name and listing the modified file names.
#
DEFAULT $CVSROOT/CVSROOT/log.pl %s $CVSROOT/CVSROOT/commitlog
# NOTE: contrib/log usage: (currently requires perl)
# -d - turn debugging on....
# -m mailto - send mail to "mailto" (multiple -m's permitted)
# -f logfile - required arg: save messages to logfile
# %s - may follow other options at the end of the line
#
# NOTE: contrib/log_accum usage: (currently requires perl)
# (must have 'commit_prep -r' in commitinfo)
# -d - turn debugging on....
# -M modulename - use this as the module name (necessary for sub-dirs)
# -m mailto - send mail to "mailto" (multiple -m's permitted) [optional]
# -f logfile - save messages to logfile [optional]
# %s - must follow other options at the end of the line
#
# without perl you could do this:
#DEFAULT (echo ""; who am i; date; cat) >> $CVSROOT/CVSROOT/commitlog
#
DEFAULT $CVSROOT/CVSROOT/log -f $CVSROOT/CVSROOT/commitlog %s

View File

@ -1,6 +1,7 @@
#
# CVS Modules file for Prisma sources
# $CVSid: @(#)modules 1.5 92/03/31 $
# The CVS Modules File
#
#ident "@(#)cvs/examples:$Name: $:$Id: modules,v 1.4 1995/11/14 23:28:48 woods Exp $"
#
# Three different line formats are valid:
# key -a aliases...
@ -10,6 +11,7 @@
# Where "options" are composed of:
# -i prog Run "prog" on "cvs commit" from top-level of module.
# -o prog Run "prog" on "cvs checkout" of module.
# -e prog Run "prog" on "cvs export" of module.
# -t prog Run "prog" on "cvs rtag" of module.
# -u prog Run "prog" on "cvs update" of module.
# -d dir Place module in directory "dir" instead of module name.
@ -28,14 +30,27 @@
# Convenient aliases
world -a .
kernel -a sys lang/adb sparcsim
# CVSROOT support
CVSROOT -i /usr/local/bin/mkmodules CVSROOT
commitinfo -i /usr/local/bin/mkmodules CVSROOT commitinfo
cvswrappers -i /usr/local/bin/mkmodules CVSROOT cvswrappers
editinfo -i /usr/local/bin/mkmodules CVSROOT editinfo
modules -i /usr/local/bin/mkmodules CVSROOT modules
loginfo -i /usr/local/bin/mkmodules CVSROOT loginfo
commitinfo -i /usr/local/bin/mkmodules CVSROOT commitinfo
rcsinfo -i /usr/local/bin/mkmodules CVSROOT rcsinfo
rcstemplate -i /usr/local/bin/mkmodules CVSROOT rcstemplate
taginfo -i /usr/local/bin/mkmodules CVSROOT taginfo
# Add more modules here
#
# END_REQUIRED_CONTENT (this comment for cvsinit)
#
# The remainder was for the Prisma OS sources
#
# another convenient alias
kernel -a sys lang/adb sparcsim
# The "sys" entry exists only to make symbolic links after checkout
sys -o sys/tools/make_links sys

View File

@ -1,18 +1,18 @@
#
# $Id: rcsinfo,v 1.3 1992/04/10 18:59:14 berliner Exp $
#ident "@(#)cvs/examples:$Name: $:$Id: rcsinfo,v 1.3 1995/11/14 23:30:10 woods Exp $"
#
# The "rcsinfo" file is used to control templates with which the editor
# is invoked on commit and import.
#
# The first entry on a line is a regular expression which is tested
# against the directory that the change is being made to, relative to the
# $CVSROOT. If a match is found, then the remainder of the line is the
# name of the file that contains the template.
# $CVSROOT. For the first match that is found, then the remainder of the
# line is the name of the file that contains the template.
#
# If the repository name does not match any of the regular expressions in this
# file, the "DEFAULT" line is used, if it is specified.
#
# If the name ALL appears as a regular expression it is always used
# in addition to the first matching regex or DEFAULT.
# If the name "ALL" appears as a regular expression it is always used
# in addition to the first matching regex or "DEFAULT".
#
DEFAULT /src/master/CVSROOT/rcstemplate
DEFAULT $CVSROOT/CVSROOT/rcstemplate

View File

@ -1,11 +1,20 @@
/* config.h. Generated automatically by configure. */
/* config.h.in. Generated automatically from configure.in by autoheader. */
/* Define if on AIX 3.
System headers sometimes define this.
We just want to avoid a redefinition error message. */
#ifndef _ALL_SOURCE
/* #undef _ALL_SOURCE */
#endif
/* Define if using alloca.c. */
/* #undef C_ALLOCA */
/* Define if type char is unsigned and you are not using gcc. */
#ifndef __CHAR_UNSIGNED__
/* #undef __CHAR_UNSIGNED__ */
#endif
/* Define to empty if the keyword does not work. */
/* #undef const */
@ -17,21 +26,33 @@
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef gid_t */
/* Define if you have alloca, as a function or macro. */
#define HAVE_ALLOCA 1
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
/* #undef HAVE_ALLOCA_H */
/* Define if you support file names longer than 14 characters. */
#define HAVE_LONG_FILE_NAMES 1
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
#define HAVE_SYS_WAIT_H 1
/* Define if utime(file, NULL) sets file's timestamp to the present. */
#define HAVE_UTIME_NULL 1
/* Define as __inline if that's what the C compiler calls it. */
/* #undef inline */
/* Define if on MINIX. */
/* #undef _MINIX */
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef mode_t */
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef pid_t */
/* Define if the system does not provide POSIX.1 features except
with this defined. */
/* #undef _POSIX_1_SOURCE */
@ -54,15 +75,43 @@
*/
/* #undef STACK_DIRECTION */
/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
/* #undef STAT_MACROS_BROKEN */
/* Define if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Define if your <sys/time.h> declares struct tm. */
/* #undef TM_IN_SYS_TIME */
/* Define if you can safely include both <sys/time.h> and <time.h>. */
#define TIME_WITH_SYS_TIME 1
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef uid_t */
/* Define if you have MIT Kerberos version 4 available. */
/* #undef HAVE_KERBEROS */
/* Define if you want CVS to be able to be a remote repository client. */
#define CLIENT_SUPPORT 1
/* Define if you want CVS to be able to serve repositories to remote
clients. */
#define SERVER_SUPPORT 1
/* the path to the gnu diff program on your system */
#define DIFF "/usr/bin/diff -a"
/* The number of bytes in a int. */
#define SIZEOF_INT 4
/* The number of bytes in a long. */
#define SIZEOF_LONG 4
/* Define if you have the connect function. */
/* #undef HAVE_CONNECT */
/* Define if you have the fchdir function. */
#define HAVE_FCHDIR 1
/* Define if you have the fchmod function. */
#define HAVE_FCHMOD 1
@ -75,6 +124,12 @@
/* Define if you have the ftruncate function. */
#define HAVE_FTRUNCATE 1
/* Define if you have the getpagesize function. */
#define HAVE_GETPAGESIZE 1
/* Define if you have the krb_get_err_text function. */
/* #undef HAVE_KRB_GET_ERR_TEXT */
/* Define if you have the mkfifo function. */
#define HAVE_MKFIFO 1
@ -84,12 +139,33 @@
/* Define if you have the setvbuf function. */
#define HAVE_SETVBUF 1
/* Define if you have the sigaction function. */
#define HAVE_SIGACTION 1
/* Define if you have the sigblock function. */
#define HAVE_SIGBLOCK 1
/* Define if you have the sigprocmask function. */
#define HAVE_SIGPROCMASK 1
/* Define if you have the sigsetmask function. */
#define HAVE_SIGSETMASK 1
/* Define if you have the sigvec function. */
#define HAVE_SIGVEC 1
/* Define if you have the timezone function. */
#define HAVE_TIMEZONE 1
/* Define if you have the vfork function. */
#define HAVE_VFORK 1
/* Define if you have the vprintf function. */
#define HAVE_VPRINTF 1
/* Define if you have the <direct.h> header file. */
/* #undef HAVE_DIRECT_H */
/* Define if you have the <dirent.h> header file. */
#define HAVE_DIRENT_H 1
@ -99,6 +175,9 @@
/* Define if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
/* Define if you have the <io.h> header file. */
/* #undef HAVE_IO_H */
/* Define if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
@ -111,23 +190,44 @@
/* Define if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define if you have the <sys/bsdtypes.h> header file. */
/* #undef HAVE_SYS_BSDTYPES_H */
/* Define if you have the <sys/dir.h> header file. */
/* #undef HAVE_SYS_DIR_H */
/* Define if you have the <sys/ndir.h> header file. */
/* #undef HAVE_SYS_NDIR_H */
/* Define if you have the <sys/param.h> header file. */
#define HAVE_SYS_PARAM_H 1
/* Define if you have the <sys/resource.h> header file. */
#define HAVE_SYS_RESOURCE_H 1
/* Define if you have the <sys/select.h> header file. */
#define HAVE_SYS_SELECT_H 1
/* Define if you have the <sys/time.h> header file. */
#define HAVE_SYS_TIME_H 1
/* Define if you have the <sys/timeb.h> header file. */
#define HAVE_SYS_TIMEB_H 1
/* Define if you have the <sys/wait.h> header file. */
#define HAVE_SYS_WAIT_H 1
/* Define if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define if you have the <utime.h> header file. */
#define HAVE_UTIME_H 1
/* Define if you have the inet library (-linet). */
/* #undef HAVE_LIBINET */
/* Define if you have the nsl library (-lnsl). */
/* #undef HAVE_LIBNSL */
/* Define if you have the nsl_s library (-lnsl_s). */
/* #undef HAVE_LIBNSL_S */
/* Define if you have the socket library (-lsocket). */
/* #undef HAVE_LIBSOCKET */

View File

@ -18,26 +18,20 @@
/* David MacKenzie */
/* Brian Berliner added support for CVS */
#ifndef lint
static char rcsid[] = "$CVSid: @(#)error.c 1.13 94/09/30 $";
#endif /* not lint */
#include "cvs.h"
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifndef lint
static const char rcsid[] = "$CVSid: @(#)error.c 1.13 94/09/30 $";
USE(rcsid);
#endif /* not lint */
#include <stdio.h>
/* turn on CVS support by default, since this is the CVS distribution */
#define CVS_SUPPORT
#ifdef CVS_SUPPORT
#if __STDC__
void Lock_Cleanup(void);
#else
void Lock_Cleanup();
#endif /* __STDC__ */
#endif /* CVS_SUPPORT */
/* If non-zero, error will use the CVS protocol to stdout to report error
messages. This will only be set in the CVS server parent process;
most other code is run via do_cvs_command, which forks off a child
process and packages up its stderr in the protocol. */
int error_use_protocol;
#ifdef HAVE_VPRINTF
@ -74,6 +68,20 @@ void exit ();
extern char *strerror ();
typedef void (*fn_returning_void) ();
/* Function to call before exiting. */
static fn_returning_void cleanup_fn;
fn_returning_void
error_set_cleanup (arg)
fn_returning_void arg;
{
fn_returning_void retval = cleanup_fn;
cleanup_fn = arg;
return retval;
}
/* Print the program name and error message MESSAGE, which is a printf-style
format string with optional args.
If ERRNUM is nonzero, print its corresponding system error message.
@ -81,60 +89,58 @@ extern char *strerror ();
/* VARARGS */
void
#if defined (HAVE_VPRINTF) && __STDC__
error (int status, int errnum, char *message, ...)
error (int status, int errnum, const char *message, ...)
#else
error (status, errnum, message, va_alist)
int status;
int errnum;
char *message;
const char *message;
va_dcl
#endif
{
FILE *out = stderr;
extern char *program_name;
#ifdef CVS_SUPPORT
extern char *command_name;
#endif
#ifdef HAVE_VPRINTF
va_list args;
#endif
#ifdef CVS_SUPPORT
if (error_use_protocol)
{
out = stdout;
printf ("E ");
}
if (command_name && *command_name)
if (status)
fprintf (stderr, "%s [%s aborted]: ", program_name, command_name);
fprintf (out, "%s [%s aborted]: ", program_name, command_name);
else
fprintf (stderr, "%s %s: ", program_name, command_name);
fprintf (out, "%s %s: ", program_name, command_name);
else
fprintf (stderr, "%s: ", program_name);
#else
fprintf (stderr, "%s: ", program_name);
#endif
fprintf (out, "%s: ", program_name);
#ifdef HAVE_VPRINTF
VA_START (args, message);
vfprintf (stderr, message, args);
vfprintf (out, message, args);
va_end (args);
#else
#ifdef HAVE_DOPRNT
_doprnt (message, &args, stderr);
_doprnt (message, &args, out);
#else
fprintf (stderr, message, a1, a2, a3, a4, a5, a6, a7, a8);
fprintf (out, message, a1, a2, a3, a4, a5, a6, a7, a8);
#endif
#endif
if (errnum)
fprintf (stderr, ": %s", strerror (errnum));
putc ('\n', stderr);
fflush (stderr);
fprintf (out, ": %s", strerror (errnum));
putc ('\n', out);
fflush (out);
if (status)
{
#ifdef CVS_SUPPORT
Lock_Cleanup();
#endif
if (cleanup_fn)
(*cleanup_fn) ();
exit (status);
}
}
#ifdef CVS_SUPPORT
/* Print the program name and error message MESSAGE, which is a printf-style
format string with optional args to the file specified by FP.
If ERRNUM is nonzero, print its corresponding system error message.
@ -175,11 +181,8 @@ fperror (fp, status, errnum, message, va_alist)
fflush (fp);
if (status)
{
#ifdef CVS_SUPPORT
Lock_Cleanup();
#endif
if (cleanup_fn)
(*cleanup_fn) ();
exit (status);
}
}
#endif /* CVS_SUPPORT */

View File

@ -92,6 +92,14 @@ struct timeb {
#define bcopy(from, to, len) memcpy ((to), (from), (len))
#endif
#if defined (STDC_HEADERS)
#include <stdlib.h>
#endif
#if defined (HAVE_ALLOCA_H)
#include <alloca.h>
#endif
extern struct tm *gmtime();
extern struct tm *localtime();

View File

@ -37,6 +37,7 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "system.h"
#include <sys/types.h>
#include <stdio.h>
@ -54,10 +55,6 @@ char *malloc();
#endif /* __STDC__ */
#endif /* STDC_HEADERS */
#ifdef _MINIX
#undef POSIX /* Minix 1.6 doesn't support POSIX.1 sigaction yet */
#endif
/* Define the highest signal number (usually) */
#ifndef SIGMAX
#define SIGMAX 64
@ -78,7 +75,7 @@ static struct SIG_hlist **SIG_handlers;
/* Define array of default signal vectors */
#ifdef POSIX
#ifdef POSIX_SIGNALS
static struct sigaction *SIG_defaults;
#else
#ifdef BSD_SIGNALS
@ -90,7 +87,7 @@ static RETSIGTYPE (**SIG_defaults)();
/* Critical section housekeeping */
static int SIG_crSectNest = 0; /* Nesting level */
#ifdef POSIX
#ifdef POSIX_SIGNALS
static sigset_t SIG_crSectMask; /* Signal mask */
#else
static int SIG_crSectMask; /* Signal mask */
@ -103,14 +100,14 @@ static int SIG_crSectMask; /* Signal mask */
static int SIG_init()
{
int i;
#ifdef POSIX
#ifdef POSIX_SIGNALS
sigset_t sigset_test;
#endif
if (SIG_defaults && SIG_handlers) /* already allocated */
return (0);
#ifdef POSIX
#ifdef POSIX_SIGNALS
(void) sigfillset(&sigset_test);
for (i = 1; i < SIGMAX && sigismember(&sigset_test, i) == 1; i++)
;
@ -175,7 +172,7 @@ RETSIGTYPE (*fn)();
{
int val;
struct SIG_hlist *this;
#ifdef POSIX
#ifdef POSIX_SIGNALS
struct sigaction act;
sigset_t sigset_mask, sigset_omask;
#else
@ -191,7 +188,7 @@ RETSIGTYPE (*fn)();
val = 0;
/* Block this signal while we look at handler chain */
#ifdef POSIX
#ifdef POSIX_SIGNALS
(void) sigemptyset(&sigset_mask);
(void) sigaddset(&sigset_mask, sig);
(void) sigprocmask(SIG_BLOCK, &sigset_mask, &sigset_omask);
@ -220,7 +217,7 @@ RETSIGTYPE (*fn)();
if (SIG_handlers[sig] == (struct SIG_hlist *) NULL)
{
#ifdef POSIX
#ifdef POSIX_SIGNALS
act.sa_handler = SIG_handle;
(void) sigemptyset(&act.sa_mask);
act.sa_flags = 0;
@ -257,7 +254,7 @@ RETSIGTYPE (*fn)();
}
/* Unblock the signal */
#ifdef POSIX
#ifdef POSIX_SIGNALS
(void) sigprocmask(SIG_SETMASK, &sigset_omask, NULL);
#else
#ifdef BSD_SIGNALS
@ -280,7 +277,7 @@ RETSIGTYPE (*fn)();
int val;
struct SIG_hlist *this;
struct SIG_hlist *last;
#ifdef POSIX
#ifdef POSIX_SIGNALS
sigset_t sigset_mask, sigset_omask;
#else
#ifdef BSD_SIGNALS
@ -295,7 +292,7 @@ RETSIGTYPE (*fn)();
last = (struct SIG_hlist *) NULL;
/* Block this signal while we look at handler chain */
#ifdef POSIX
#ifdef POSIX_SIGNALS
(void) sigemptyset(&sigset_mask);
(void) sigaddset(&sigset_mask, sig);
(void) sigprocmask(SIG_BLOCK, &sigset_mask, &sigset_omask);
@ -330,7 +327,7 @@ RETSIGTYPE (*fn)();
/* Restore default behavior if there are no registered handlers */
if (SIG_handlers[sig] == (struct SIG_hlist *) NULL)
{
#ifdef POSIX
#ifdef POSIX_SIGNALS
val = sigaction(sig, &SIG_defaults[sig],
(struct sigaction *) NULL);
#else
@ -344,7 +341,7 @@ RETSIGTYPE (*fn)();
}
/* Unblock the signal */
#ifdef POSIX
#ifdef POSIX_SIGNALS
(void) sigprocmask(SIG_SETMASK, &sigset_omask, NULL);
#else
#ifdef BSD_SIGNALS
@ -365,7 +362,7 @@ void SIG_beginCrSect()
{
if (SIG_crSectNest == 0)
{
#ifdef POSIX
#ifdef POSIX_SIGNALS
sigset_t sigset_mask;
(void) sigfillset(&sigset_mask);
@ -394,7 +391,7 @@ void SIG_endCrSect()
SIG_crSectNest--;
if (SIG_crSectNest == 0)
{
#ifdef POSIX
#ifdef POSIX_SIGNALS
(void) sigprocmask(SIG_SETMASK, &SIG_crSectMask, NULL);
#else
#ifdef BSD_SIGNALS

View File

@ -17,6 +17,9 @@
#ifdef HAVE_SYS_WAIT_H
#include <sys/types.h> /* For pid_t. */
#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h> /* for rusage */
#endif
#include <sys/wait.h>
#else
#define WIFSTOPPED(w) (((w) & 0xff) == 0x7f)