Import of slightly trimmed cvs-1.8 distribution. Generated files
and non-unix code has been left out.
This commit is contained in:
parent
bd3a9cd23c
commit
18576028af
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/vendor/cvs/dist/; revision=17721
262
contrib/cvs/BUGS
Normal file
262
contrib/cvs/BUGS
Normal file
@ -0,0 +1,262 @@
|
||||
To report bugs send mail to bug-cvs@prep.ai.mit.edu, or run the "cvsbug"
|
||||
program and fill out the template:
|
||||
|
||||
$ cvsbug
|
||||
|
||||
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". This is also
|
||||
the procedure for submitting suggested changes to CVS--note that all
|
||||
submitted changes may be distributed under the terms of the GNU Public
|
||||
License, so if you don't like this, don't submit them.
|
||||
|
||||
|
||||
|
||||
* `cvs checkout -d nested/dir/path <module>' just doesn't work. The
|
||||
simpler version -- `cvs checkout -d single-dir <module>' works,
|
||||
however.
|
||||
|
||||
|
||||
* CVS leaves .#mumble files around when a conflict occurs. (Note:
|
||||
this is intentional and is documented in doc/cvs.texinfo. Of course
|
||||
whether it is a good idea is a separate question).
|
||||
|
||||
|
||||
* pcl-cvs doesn't like it when you try to check in a file which isn't
|
||||
up-to-date. The messages produced by the server perhaps don't match
|
||||
what pcl-cvs is looking for.
|
||||
|
||||
|
||||
* From: Roland McGrath <roland@gnu.ai.mit.edu>
|
||||
To: Cyclic CVS Hackers <info-cvs@prep.ai.mit.edu>
|
||||
Subject: weird bug
|
||||
Date: Sat, 25 Mar 1995 16:41:41 -0500
|
||||
X-Windows: Even your dog won't like it.
|
||||
|
||||
I just noticed some droppings on my disk from what must be a pretty weird
|
||||
bug in remote CVS.
|
||||
|
||||
In my home directory on a repository machine I use, I find:
|
||||
|
||||
drwxr-xr-x 4 roland staff 512 Mar 7 14:08 cvs-serv28962
|
||||
drwxr-xr-x 4 roland staff 512 Mar 7 14:11 cvs-serv28978
|
||||
drwxr-xr-x 4 roland staff 512 Mar 7 15:13 cvs-serv29141
|
||||
|
||||
OK, so these are leftover cruft from some cvs run that got aborted.
|
||||
Well, it should clean up after itself, but so what.
|
||||
|
||||
The last one is pretty dull; the real weirdness is the contents of the
|
||||
first two directories.
|
||||
|
||||
duality 77 # ls -RF cvs-serv28978/
|
||||
CVS/ cvs-serv28978/
|
||||
|
||||
cvs-serv28978/CVS:
|
||||
Entries Repository
|
||||
|
||||
cvs-serv28978/cvs-serv28978:
|
||||
arpa/
|
||||
|
||||
cvs-serv28978/cvs-serv28978/arpa:
|
||||
CVS/ cvs-serv28978/
|
||||
|
||||
cvs-serv28978/cvs-serv28978/arpa/CVS:
|
||||
Entries Repository
|
||||
|
||||
cvs-serv28978/cvs-serv28978/arpa/cvs-serv28978:
|
||||
assert/
|
||||
|
||||
cvs-serv28978/cvs-serv28978/arpa/cvs-serv28978/assert:
|
||||
CVS/ cvs-serv28978/
|
||||
|
||||
cvs-serv28978/cvs-serv28978/arpa/cvs-serv28978/assert/CVS:
|
||||
Entries Repository
|
||||
|
||||
cvs-serv28978/cvs-serv28978/arpa/cvs-serv28978/assert/cvs-serv28978:
|
||||
bare/
|
||||
|
||||
cvs-serv28978/cvs-serv28978/arpa/cvs-serv28978/assert/cvs-serv28978/bare:
|
||||
CVS/ cvs-serv28978/
|
||||
|
||||
cvs-serv28978/cvs-serv28978/arpa/cvs-serv28978/assert/cvs-serv28978/bare/CVS:
|
||||
Entries Repository
|
||||
|
||||
cvs-serv28978/cvs-serv28978/arpa/cvs-serv28978/assert/cvs-serv28978/bare/cvs-serv28978:
|
||||
conf/
|
||||
|
||||
cvs-serv28978/cvs-serv28978/arpa/cvs-serv28978/assert/cvs-serv28978/bare/cvs-serv28978/conf:
|
||||
CVS/ cvs-serv28978/
|
||||
|
||||
cvs-serv28978/cvs-serv28978/arpa/cvs-serv28978/assert/cvs-serv28978/bare/cvs-serv28978/conf/CVS:
|
||||
Entries Repository
|
||||
|
||||
cvs-serv28978/cvs-serv28978/arpa/cvs-serv28978/assert/cvs-serv28978/bare/cvs-serv28978/conf/cvs-serv28978:
|
||||
crypt/
|
||||
|
||||
cvs-serv28978/cvs-serv28978/arpa/cvs-serv28978/assert/cvs-serv28978/bare/cvs-serv28978/conf/cvs-serv28978/crypt:
|
||||
CVS/ cvs-serv28978/
|
||||
|
||||
cvs-serv28978/cvs-serv28978/arpa/cvs-serv28978/assert/cvs-serv28978/bare/cvs-serv28978/conf/cvs-serv28978/crypt/CVS:
|
||||
Entries Repository
|
||||
|
||||
cvs-serv28978/cvs-serv28978/arpa/cvs-serv28978/assert/cvs-serv28978/bare/cvs-serv28978/conf/cvs-serv28978/crypt/cvs-serv28978:
|
||||
csu/
|
||||
|
||||
cvs-serv28978/cvs-serv28978/arpa/cvs-serv28978/assert/cvs-serv28978/bare/cvs-serv28978/conf/cvs-serv28978/crypt/cvs-serv28978/csu:
|
||||
CVS/ cvs-serv28978/
|
||||
|
||||
cvs-serv28978/cvs-serv28978/arpa/cvs-serv28978/assert/cvs-serv28978/bare/cvs-serv28978/conf/cvs-serv28978/crypt/cvs-serv28978/csu/CVS:
|
||||
Entries Repository
|
||||
|
||||
cvs-serv28978/cvs-serv28978/arpa/cvs-serv28978/assert/cvs-serv28978/bare/cvs-serv28978/conf/cvs-serv28978/crypt/cvs-serv28978/csu/cvs-serv28978:
|
||||
ctype/
|
||||
|
||||
cvs-serv28978/cvs-serv28978/arpa/cvs-serv28978/assert/cvs-serv28978/bare/cvs-serv28978/conf/cvs-serv28978/crypt/cvs-serv28978/csu/cvs-serv28978/ctype:
|
||||
CVS/ cvs-serv28978/
|
||||
|
||||
[...]
|
||||
|
||||
ls: cvs-serv28978/cvs-serv28978/arpa/cvs-serv28978/assert/cvs-serv28978/bare/cvs-serv28978/conf/cvs-serv28978/crypt/cvs-serv28978/csu/cvs-serv28978/ctype/cvs-serv28978/dirent/cvs-serv28978/elf/cvs-serv28978/gnu/cvs-serv28978/gnulib/cvs-serv28978/grp/cvs-serv28978/hurd/cvs-serv28978/hurd/hurd/cvs-serv28978/inet/cvs-serv28978/inet/arpa/cvs-serv28978/inet/netinet[...]/cvs-serv28978/posix/cvs-serv28978/posix/glob/cvs-serv28978/posix/gnu/cvs-serv28978/posix/sys/cvs-serv28978/protocols/cvs-serv28978/pwd/cvs-serv28978/resolv/cvs-serv28978/resolv/arpa/cvs-serv28978/resolv/sys/cvs-serv28978/resource/cvs-serv28978/resource/sys/cvs-serv28978/rpc/cvs-serv28978/setjmp/cvs-serv28978/signal/cvs-serv28978/signal/sys/cvs-serv28978/socket/cvs-serv28978/socket: File name too long
|
||||
cvs-serv28978/cvs-serv28978/arpa/cvs-serv28978/assert/cvs-serv28978/bare/cvs-serv28978/conf/cvs-serv28978/crypt/cvs-serv28978/csu/cvs-serv28978/ctype/cvs-serv28978/dirent/cvs-serv28978/elf/cvs-serv28978/gnu/cvs-serv28978/gnulib/cvs-serv28978/grp/cvs-serv28978/hurd/cvs-serv28978/hurd/hurd/cvs-serv28978/inet/cvs-serv28978/inet/arpa/cvs-serv28978/inet/netinet[...]/cvs-serv28978/posix/glob/cvs-serv28978/posix/gnu/cvs-serv28978/posix/sys/cvs-serv28978/protocols/cvs-serv28978/pwd/cvs-serv28978/resolv/cvs-serv28978/resolv/arpa/cvs-serv28978/resolv/sys/cvs-serv28978/resource/cvs-serv28978/resource/sys/cvs-serv28978/rpc/cvs-serv28978/setjmp/cvs-serv28978/signal/cvs-serv28978/signal/sys/cvs-serv28978/socket/cvs-serv28978:
|
||||
|
||||
|
||||
* From: billr@mpd.tandem.com (Bill Robertson)
|
||||
Subject: Problem with rtag and the -D option
|
||||
Date: Fri, 17 Mar 1995 10:53:29 -0600 (CST)
|
||||
|
||||
I have been trying to use the -D option to specify a date for tagging, but
|
||||
rtag does not recognize the -D option. It is documented to do so and I've
|
||||
tested the use of -D with cvs update and cvs diff and it works fine there.
|
||||
|
||||
|
||||
* We need some version numbers really badly. Are there some
|
||||
(and Charles Hannum is just not including them in his reports), or do
|
||||
we simply have no reliable way to distinguish between the various
|
||||
versions of rCVS people on the list are running?
|
||||
|
||||
Now that I think of it, version numbers present a problem when
|
||||
people can update their sources anytime and rebuild. I think the
|
||||
solution is to increment a minor version number *every* time a bug is
|
||||
fixed, so we can identify uniquely what someone is running when they
|
||||
submit a report. This implies recording the version increments in the
|
||||
ChangeLog; that way we can just look to see where a particular version
|
||||
lies in relation to the flow of changing code.
|
||||
|
||||
Should we be doing same with Guppy? I guess not -- it's only
|
||||
important when you have people who are updating directly from your
|
||||
development tree, which is the case with the remote-cvs folks.
|
||||
|
||||
Thoughts?
|
||||
|
||||
|
||||
* (Charles Hannum <mycroft@ai.mit.edu>) has these bugs:
|
||||
|
||||
I just tossed remote CVS at a fairly large source tree that I already
|
||||
had, and noticed a few problems:
|
||||
|
||||
1) server.c assumes that /usr/tmp is a valid default for the place to
|
||||
store files uploaded from the client. There are a number of systems
|
||||
that now use /var/tmp. These should probably be detected by autoconf.
|
||||
|
||||
2) The server deals rather ungracefully with the tmp directory
|
||||
becoming full.
|
||||
|
||||
3) There's some oddness with relative paths in Repository files that
|
||||
causes the directory prefix to be added twice; e.g. if I have CVSROOT
|
||||
set to `machine:/this/dir', and I try to update in a directory whose
|
||||
Repository file says `src/bin', the server looks in
|
||||
`/this/dir/machine:/this/dir/src/bin'.
|
||||
|
||||
* From: "Charles M. Hannum" <mycroft@ai.mit.edu>
|
||||
To: jimb@duality.gnu.ai.mit.edu, roland@duality.gnu.ai.mit.edu
|
||||
Subject: Serious flaw in remote CVS
|
||||
Date: Wed, 22 Feb 1995 20:54:36 -0500
|
||||
|
||||
I just found a major flaw in the current implementation. Because the
|
||||
sockets are not changed to non-blocking mode, write(2)s can hang. In
|
||||
some cases, this happens on both sides at the same time, with the
|
||||
socket buffers full in both directions. This causes a deadlock,
|
||||
because both processes are stuck in I/O wait and thus never drain
|
||||
their input queues.
|
||||
|
||||
Until this is fixed, I can't use it. I'll look at the problem myself
|
||||
at some point, but I don't know when.
|
||||
|
||||
|
||||
From: "Charles M. Hannum" <mycroft@ai.mit.edu>
|
||||
To: info-cvs@prep.ai.mit.edu
|
||||
Cc: jimb@totoro.bio.indiana.edu
|
||||
Subject: Re: forwarded message from Charles M. Hannum
|
||||
Date: Wed, 22 Feb 1995 22:07:07 -0500
|
||||
|
||||
FYI, this happened because the tmp directory on the server became
|
||||
full. Somehow the server started interpreting the files the client
|
||||
was sending as commands, and started spewing tons of errors.
|
||||
Apparently the errors are sent with blocking I/O, or something, and
|
||||
thus allowed the deadlock to happen.
|
||||
|
||||
|
||||
* From: "Charles M. Hannum" <mycroft@ai.mit.edu>
|
||||
To: info-cvs@prep.ai.mit.edu
|
||||
Subject: Regarding that relative path problem
|
||||
Date: Thu, 23 Feb 1995 02:41:51 -0500
|
||||
|
||||
This is actually more serious. If you have `bar.com:/foo' as your CVS
|
||||
root directory, then:
|
||||
|
||||
1) When you check things out, the Repository files will contain
|
||||
`/foo/...' (i.e. without the machine name), which makes little sense.
|
||||
|
||||
2) If you instead have a relative path, when the Repository file is
|
||||
read, `bar.com:/foo' is prepended. This is sent to the server, but
|
||||
confuses it, because it's not expecting the machine name to be
|
||||
prepended.
|
||||
|
||||
A slightly klugy fix would be to have the client prepend the machine
|
||||
name when writing a new Repository file, and strip it off before
|
||||
sending one to the server. This would be backward-compatible with the
|
||||
current arrangement.
|
||||
|
||||
|
||||
* From: "Charles M. Hannum" <mycroft@ai.mit.edu>
|
||||
To: info-cvs@prep.ai.mit.edu
|
||||
Subject: Still one more bug
|
||||
Date: Sat, 25 Feb 1995 17:01:15 -0500
|
||||
|
||||
mycroft@duality [1]; cd /usr/src/lib/libc
|
||||
mycroft@duality [1]; cvs diff -c2 '-D1 day ago' -Dnow
|
||||
cvs server: Diffing .
|
||||
cvs server: Diffing DB
|
||||
cvs [server aborted]: could not chdir to DB: No such file or directory
|
||||
mycroft@duality [1];
|
||||
|
||||
`DB' is an old directory, which no longer has files in it, and is
|
||||
removed automatically when I use the `-P' option to checkout.
|
||||
|
||||
This error doesn't occur when run locally.
|
||||
|
||||
P.S. Is anyone working on fixing these bugs?
|
||||
|
||||
|
||||
* From: Roland McGrath <roland@gnu.ai.mit.edu>
|
||||
To: Cyclic CVS Hackers <info-cvs@prep.ai.mit.edu>
|
||||
Subject: bizarre failure mode
|
||||
Date: Tue, 7 Mar 95 14:17:28 -0500
|
||||
|
||||
This is pretty weird:
|
||||
|
||||
CVS_SERVER='TMPDIR=. /usr/local/bin/cvs' ../cvs-build/src/cvs update -q
|
||||
cvs [server aborted]: could not get working directory: Result too large
|
||||
[Exit 1]
|
||||
asylum 29 % grep 'Result too large' /usr/include/sys/errno.h
|
||||
#define ERANGE 34 /* Result too large */
|
||||
|
||||
Now, getcwd fails with ERANGE when the buffer is too small. But I don't
|
||||
know why that would be the case; I don't think there are exceptionally long
|
||||
directory names involved. It would be robust to notice ERANGE and use a
|
||||
bigger buffer. But I suspect something weirder is going on.
|
||||
|
||||
The repository in question in duality.gnu.ai.mit.edu:/gd4/gnu/cvsroot/libc.
|
||||
|
||||
Send me a PGP-signed message if you want the password to use the machine
|
||||
where the problem showed up.
|
249
contrib/cvs/COPYING
Normal file
249
contrib/cvs/COPYING
Normal file
@ -0,0 +1,249 @@
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 1, February 1989
|
||||
|
||||
Copyright (C) 1989 Free Software Foundation, Inc.
|
||||
675 Mass Ave, Cambridge, MA 02139, USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The license agreements of most software companies try to keep users
|
||||
at the mercy of those companies. By contrast, our General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. The
|
||||
General Public License applies to the Free Software Foundation's
|
||||
software and to any other program whose authors commit to using it.
|
||||
You can use it for your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Specifically, the General Public License is designed to make
|
||||
sure that you have the freedom to give away or sell copies of free
|
||||
software, that you receive source code or can get it if you want it,
|
||||
that you can change the software or use pieces of it in new free
|
||||
programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of a such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must tell them their rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any program or other work which
|
||||
contains a notice placed by the copyright holder saying it may be
|
||||
distributed under the terms of this General Public License. The
|
||||
"Program", below, refers to any such program or work, and a "work based
|
||||
on the Program" means either the Program or any work containing the
|
||||
Program or a portion of it, either verbatim or with modifications. Each
|
||||
licensee is addressed as "you".
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's source
|
||||
code as you receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice and
|
||||
disclaimer of warranty; keep intact all the notices that refer to this
|
||||
General Public License and to the absence of any warranty; and give any
|
||||
other recipients of the Program a copy of this General Public License
|
||||
along with the Program. You may charge a fee for the physical act of
|
||||
transferring a copy.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion of
|
||||
it, and copy and distribute such modifications under the terms of Paragraph
|
||||
1 above, provided that you also do the following:
|
||||
|
||||
a) cause the modified files to carry prominent notices stating that
|
||||
you changed the files and the date of any change; and
|
||||
|
||||
b) cause the whole of any work that you distribute or publish, that
|
||||
in whole or in part contains the Program or any part thereof, either
|
||||
with or without modifications, to be licensed at no charge to all
|
||||
third parties under the terms of this General Public License (except
|
||||
that you may choose to grant warranty protection to some or all
|
||||
third parties, at your option).
|
||||
|
||||
c) If the modified program normally reads commands interactively when
|
||||
run, you must cause it, when started running for such interactive use
|
||||
in the simplest and most usual way, to print or display an
|
||||
announcement including an appropriate copyright notice and a notice
|
||||
that there is no warranty (or else, saying that you provide a
|
||||
warranty) and that users may redistribute the program under these
|
||||
conditions, and telling the user how to view a copy of this General
|
||||
Public License.
|
||||
|
||||
d) You may charge a fee for the physical act of transferring a
|
||||
copy, and you may at your option offer warranty protection in
|
||||
exchange for a fee.
|
||||
|
||||
Mere aggregation of another independent work with the Program (or its
|
||||
derivative) on a volume of a storage or distribution medium does not bring
|
||||
the other work under the scope of these terms.
|
||||
|
||||
3. You may copy and distribute the Program (or a portion or derivative of
|
||||
it, under Paragraph 2) in object code or executable form under the terms of
|
||||
Paragraphs 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of
|
||||
Paragraphs 1 and 2 above; or,
|
||||
|
||||
b) accompany it with a written offer, valid for at least three
|
||||
years, to give any third party free (except for a nominal charge
|
||||
for the cost of distribution) a complete machine-readable copy of the
|
||||
corresponding source code, to be distributed under the terms of
|
||||
Paragraphs 1 and 2 above; or,
|
||||
|
||||
c) accompany it with the information you received as to where the
|
||||
corresponding source code may be obtained. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form alone.)
|
||||
|
||||
Source code for a work means the preferred form of the work for making
|
||||
modifications to it. For an executable file, complete source code means
|
||||
all the source code for all modules it contains; but, as a special
|
||||
exception, it need not include source code for modules which are standard
|
||||
libraries that accompany the operating system on which the executable
|
||||
file runs, or for standard header files or definitions files that
|
||||
accompany that operating system.
|
||||
|
||||
4. You may not copy, modify, sublicense, distribute or transfer the
|
||||
Program except as expressly provided under this General Public License.
|
||||
Any attempt otherwise to copy, modify, sublicense, distribute or transfer
|
||||
the Program is void, and will automatically terminate your rights to use
|
||||
the Program under this License. However, parties who have received
|
||||
copies, or rights to use copies, from you under this General Public
|
||||
License will not have their licenses terminated so long as such parties
|
||||
remain in full compliance.
|
||||
|
||||
5. By copying, distributing or modifying the Program (or any work based
|
||||
on the Program) you indicate your acceptance of this license to do so,
|
||||
and all its terms and conditions.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the original
|
||||
licensor to copy, distribute or modify the Program subject to these
|
||||
terms and conditions. You may not impose any further restrictions on the
|
||||
recipients' exercise of the rights granted herein.
|
||||
|
||||
7. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of the license which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
the license, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
8. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
Appendix: How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to humanity, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these
|
||||
terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest to
|
||||
attach them to the start of each source file to most effectively convey
|
||||
the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) 19yy <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 1, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) 19xx name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the
|
||||
appropriate parts of the General Public License. Of course, the
|
||||
commands you use may be called something other than `show w' and `show
|
||||
c'; they could even be mouse-clicks or menu items--whatever suits your
|
||||
program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
program `Gnomovision' (a program to direct compilers to make passes
|
||||
at assemblers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
481
contrib/cvs/COPYING.LIB
Normal file
481
contrib/cvs/COPYING.LIB
Normal file
@ -0,0 +1,481 @@
|
||||
GNU LIBRARY GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1991 Free Software Foundation, Inc.
|
||||
675 Mass Ave, Cambridge, MA 02139, USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the library GPL. It is
|
||||
numbered 2 because it goes with version 2 of the ordinary GPL.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Library General Public License, applies to some
|
||||
specially designated Free Software Foundation software, and to any
|
||||
other libraries whose authors decide to use it. You can use it for
|
||||
your libraries, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if
|
||||
you distribute copies of the library, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link a program with the library, you must provide
|
||||
complete object files to the recipients so that they can relink them
|
||||
with the library, after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
Our method of protecting your rights has two steps: (1) copyright
|
||||
the library, and (2) offer you this license which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
Also, for each distributor's protection, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
library. If the library is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original
|
||||
version, so that any problems introduced by others will not reflect on
|
||||
the original authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that companies distributing free
|
||||
software will individually obtain patent licenses, thus in effect
|
||||
transforming the program into proprietary software. To prevent this,
|
||||
we have made it clear that any patent must be licensed for everyone's
|
||||
free use or not licensed at all.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the ordinary
|
||||
GNU General Public License, which was designed for utility programs. This
|
||||
license, the GNU Library General Public License, applies to certain
|
||||
designated libraries. This license is quite different from the ordinary
|
||||
one; be sure to read it in full, and don't assume that anything in it is
|
||||
the same as in the ordinary license.
|
||||
|
||||
The reason we have a separate public license for some libraries is that
|
||||
they blur the distinction we usually make between modifying or adding to a
|
||||
program and simply using it. Linking a program with a library, without
|
||||
changing the library, is in some sense simply using the library, and is
|
||||
analogous to running a utility program or application program. However, in
|
||||
a textual and legal sense, the linked executable is a combined work, a
|
||||
derivative of the original library, and the ordinary General Public License
|
||||
treats it as such.
|
||||
|
||||
Because of this blurred distinction, using the ordinary General
|
||||
Public License for libraries did not effectively promote software
|
||||
sharing, because most developers did not use the libraries. We
|
||||
concluded that weaker conditions might promote sharing better.
|
||||
|
||||
However, unrestricted linking of non-free programs would deprive the
|
||||
users of those programs of all benefit from the free status of the
|
||||
libraries themselves. This Library General Public License is intended to
|
||||
permit developers of non-free programs to use free libraries, while
|
||||
preserving your freedom as a user of such programs to change the free
|
||||
libraries that are incorporated in them. (We have not seen how to achieve
|
||||
this as regards changes in header files, but we have achieved it as regards
|
||||
changes in the actual functions of the Library.) The hope is that this
|
||||
will lead to faster development of free libraries.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, while the latter only
|
||||
works together with the library.
|
||||
|
||||
Note that it is possible for a library to be covered by the ordinary
|
||||
General Public License rather than by this special one.
|
||||
|
||||
GNU LIBRARY GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library which
|
||||
contains a notice placed by the copyright holder or other authorized
|
||||
party saying it may be distributed under the terms of this Library
|
||||
General Public License (also called "this License"). Each licensee is
|
||||
addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also compile or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
c) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
d) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the source code distributed need not include anything that is normally
|
||||
distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Library General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
Appendix: How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
1162
contrib/cvs/ChangeLog
Normal file
1162
contrib/cvs/ChangeLog
Normal file
File diff suppressed because it is too large
Load Diff
700
contrib/cvs/ChangeLog.zoo
Normal file
700
contrib/cvs/ChangeLog.zoo
Normal file
@ -0,0 +1,700 @@
|
||||
Thu Sep 15 14:19:21 1994 david d `zoo' zuhn <zoo@monad.armadillo.com>
|
||||
|
||||
* Makefile.in: define TEXI2DVI, add it to FLAGS_TO_PASS; remove
|
||||
old comments about parameters for DEFS
|
||||
|
||||
Wed Jul 13 21:54:46 1994 david d `zoo' zuhn (zoo@monad.armadillo.com)
|
||||
|
||||
* contrib/rcs-to-cvs: rewritten for Bourne shell (thanks to David
|
||||
MacKenzie <djm@cygnus.com>)
|
||||
|
||||
Wed Jul 13 21:48:38 1994 Ken Raeburn (raeburn@cujo.cygnus.com)
|
||||
|
||||
* Makefile.in: Deleted line consisting of only whitespace; it
|
||||
confuses some versions of make.
|
||||
|
||||
Mon Jan 24 12:26:47 1994 david d zuhn (zoo@monad.armadillo.com)
|
||||
|
||||
* configure.in: check for <sys/select.h> and <ndbm.h>
|
||||
|
||||
* Makefile.in: define YACC and not BISON
|
||||
|
||||
Sat Dec 18 00:52:04 1993 david d zuhn (zoo@monad.armadillo.com)
|
||||
|
||||
* config.h.in: handle HAVE_SYS_WAIT_H, HAVE_ERRNO_H
|
||||
|
||||
* configure.in: check for memmove, <errno.h>
|
||||
|
||||
* Makefile.in (VPATH): don't use $(srcdir), but @srcdir@ instead
|
||||
|
||||
* configure.in (AC_HAVE_HEADERS): check for <sys/wait.h>
|
||||
|
||||
Mon Nov 29 15:05:43 1993 K. Richard Pixley (rich@sendai.cygnus.com)
|
||||
|
||||
* lib/Makefile.in, src/Makefile.in (CFLAGS): default to -g.
|
||||
|
||||
* src/log.c (log_fileproc): if a file has been added, but not
|
||||
committed, then say so rather than reporting that nothing is
|
||||
known.
|
||||
|
||||
* src/sanity.el: update for emacs-19.
|
||||
|
||||
* src/RCS-patches, src/README-rm-add: update for rcs-5.6.6.
|
||||
|
||||
* src/Makefile.in: removed some gratuitous diffs from cvs-1.3.
|
||||
|
||||
* src/cvsrc.c: strdup -> xstrdup, malloc -> xmalloc, comment about
|
||||
fgets lossage.
|
||||
|
||||
* configure, configure.in, Makefile.in: support man and doc
|
||||
directories and info and dvi targets.
|
||||
|
||||
* doc/cvs.texinfo: comment out include of gpl.texinfo.
|
||||
|
||||
* doc/Makefile.in: added dvi & info targets.
|
||||
|
||||
* doc/cvsclient.texi: added @setfilename.
|
||||
|
||||
* lib/Makefile.in: remove some extraneous diffs against the
|
||||
patched cvs-1.3.
|
||||
|
||||
* doc/Makefile.in, man/Makefile.in: update for autoconf.
|
||||
|
||||
Fri Nov 19 12:56:34 1993 K. Richard Pixley (rich@sendai.cygnus.com)
|
||||
|
||||
* Many files: added configure.in, updated configure based on
|
||||
autoconf.
|
||||
|
||||
Tue Jun 1 17:02:41 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
|
||||
|
||||
* configure: add support for alloca and sys/select.h
|
||||
|
||||
Wed May 19 19:34:48 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
|
||||
|
||||
* cvs-format.el: Don't set c-tab-always-indent.
|
||||
|
||||
Mon Mar 22 23:25:33 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
|
||||
|
||||
* Makefile.in: installcheck: recurse into src directory to run tests
|
||||
|
||||
Mon Jan 18 17:21:16 1993 K. Richard Pixley (rich@rtl.cygnus.com)
|
||||
|
||||
* Makefile.in (check): recur into src directory in order to pick
|
||||
up the sanity check.
|
||||
|
||||
Thu Dec 17 19:41:22 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
|
||||
|
||||
* Makefile.in: added blank 'dvi' target
|
||||
|
||||
Tue Apr 7 15:55:25 1992 Brian Berliner (berliner at sun.com)
|
||||
|
||||
* Changes between CVS 1.3 Beta-3 and official CVS 1.3!
|
||||
|
||||
* A new shell script is provided, "./cvsinit", which can be run at
|
||||
install time to help setup your $CVSROOT area. This can greatly
|
||||
ease your entry into CVS usage.
|
||||
|
||||
* The INSTALL file has been updated to include the machines on
|
||||
which CVS has compiled successfully. I think CVS 1.3 is finally
|
||||
portable. Thanks to all the Beta testers!
|
||||
|
||||
* Support for the "editinfo" file was contributed. This file
|
||||
(located in $CVSROOT/CVSROOT) can be used to specify a special
|
||||
"editor" to run on a per-directory basis within the repository,
|
||||
instead of the usual user's editor. As such, it can verify that
|
||||
the log message entered by the user is of the appropriate form
|
||||
(contains a bugid and test validation, for example).
|
||||
|
||||
* The manual pages cvs(1) and cvs(5) have been updated.
|
||||
|
||||
* The "mkmodules" command now informs you when your modules file
|
||||
has duplicate entries.
|
||||
|
||||
* The "add" command now preserves any per-directory sticky tag when
|
||||
you add a new directory to your checked-out sources.
|
||||
|
||||
* The "admin" command is now a fully recursive interface to the
|
||||
"rcs" program which operates on your checked-out sources. It no
|
||||
longer requires you to specify the full path to the RCS file.
|
||||
|
||||
* The per-file sticky tags can now be effectively removed with
|
||||
"cvs update -A file", even if you had checked out the whole
|
||||
directory with a per-directory sticky tag. This allows a great
|
||||
deal of flexibility in managing the revisions that your checked-out
|
||||
sources are based upon (both per-directory and per-file sticky
|
||||
tags).
|
||||
|
||||
* The "cvs -n commit" command now works, to show which files are
|
||||
out-of-date and will cause the real commit to fail, or which files
|
||||
will fail any pre-commit checks. Also, the "cvs -n import ..."
|
||||
command will now show you what it would've done without actually
|
||||
doing it.
|
||||
|
||||
* Doing "cvs commit modules" to checkin the modules file will no
|
||||
properly run the "mkmodules" program (assuming you have setup your
|
||||
$CVSROOT/CVSROOT/modules file to do so).
|
||||
|
||||
* The -t option in the modules file (which specifies a program to
|
||||
run when you do a "cvs rtag" operation on a module) now gets the
|
||||
symbolic tag as the second argument when invoked.
|
||||
|
||||
* When the source repository is locked by another user, that user's
|
||||
login name will be displayed as the holder of the lock.
|
||||
|
||||
* Doing "cvs checkout module/file.c" now works even if
|
||||
module/file.c is in the Attic (has been removed from main-line
|
||||
development).
|
||||
|
||||
* Doing "cvs commit */Makefile" now works as one would expect.
|
||||
Rather than trying to commit everything recursively, it will now
|
||||
commit just the files specified.
|
||||
|
||||
* The "cvs remove" command is now fully recursive. To schedule a
|
||||
file for removal, all you have to do is "rm file" and "cvs rm".
|
||||
With no arguments, "cvs rm" will schedule all files that have been
|
||||
physically removed for removal from the source repository at the
|
||||
next "cvs commit".
|
||||
|
||||
* The "cvs tag" command now prints "T file" for each file that was
|
||||
tagged by this invocation and "D file" for each file that had the
|
||||
tag removed (as with "cvs tag -d").
|
||||
|
||||
* The -a option has been added to "cvs rtag" to force it to clean
|
||||
up any old, matching tags for files that have been removed (in the
|
||||
Attic) that may not have been touched by this tag operation. This
|
||||
can help keep a consistent view with your tag, even if you re-use
|
||||
it frequently.
|
||||
|
||||
Sat Feb 29 16:02:05 1992 Brian Berliner (berliner at sun.com)
|
||||
|
||||
* Changes between CVS 1.3 Beta-2 and CVS 1.3 Beta-3
|
||||
|
||||
* Many portability fixes, thanks to all the Beta testers! With any
|
||||
luck, this Beta release will compile correctly on most anything.
|
||||
Hey, what are we without our dreams.
|
||||
|
||||
* CVS finally has support for doing isolated development on a
|
||||
branch off the current (or previous!) revisions. This is also
|
||||
extremely nice for generating patches for previously released
|
||||
software while development is progressing on the next release.
|
||||
Here's an example of creating a branch to fix a patch with the 2.0
|
||||
version of the "foo" module, even though we are already well into
|
||||
the 3.0 release. Do:
|
||||
|
||||
% cvs rtag -b -rFOO_2_0 FOO_2_0_Patch foo
|
||||
% cvs checkout -rFOO_2_0_Patch foo
|
||||
% cd foo
|
||||
[[ hack away ]]
|
||||
% cvs commit
|
||||
|
||||
A physical branch will be created in the RCS file only when you
|
||||
actually commit the change. As such, forking development at some
|
||||
random point in time is extremely light-weight -- requiring just a
|
||||
symbolic tag in each file until a commit is done. To fork
|
||||
development at the currently checked out sources, do:
|
||||
|
||||
% cvs tag -b Personal_Hack
|
||||
% cvs update -rPersonal_Hack
|
||||
[[ hack away ]]
|
||||
% cvs commit
|
||||
|
||||
Now, if you decide you want the changes made in the Personal_Hack
|
||||
branch to be merged in with other changes made in the main-line
|
||||
development, you could do:
|
||||
|
||||
% cvs commit # to make Personal_Hack complete
|
||||
% cvs update -A # to update sources to main-line
|
||||
% cvs update -jPersonal_Hack # to merge Personal_Hack
|
||||
|
||||
to update your checked-out sources, or:
|
||||
|
||||
% cvs checkout -jPersonal_Hack module
|
||||
|
||||
to checkout a fresh copy.
|
||||
|
||||
To support this notion of forked development, CVS reserves
|
||||
all even-numbered branches for its own use. In addition, CVS
|
||||
reserves the ".0" and ".1" branches. So, if you intend to do your
|
||||
own branches by hand with RCS, you should use odd-numbered branches
|
||||
starting with ".3", as in "1.1.3", "1.1.5", 1.2.9", ....
|
||||
|
||||
* The "cvs commit" command now supports a fully functional -r
|
||||
option, allowing you to commit your changes to a specific numeric
|
||||
revision or symbolic tag with full consistency checks. Numeric
|
||||
tags are useful for bringing your sources all up to some revision
|
||||
level:
|
||||
|
||||
% cvs commit -r2.0
|
||||
|
||||
For symbolic tags, you can only commit to a tag that references a
|
||||
branch in the RCS file. One created by "cvs rtag -b" or from
|
||||
"cvs tag -b" is appropriate (see below).
|
||||
|
||||
* Roland Pesch <pesch@cygnus.com> and K. Richard Pixley
|
||||
<rich@cygnus.com> were kind enough to contribute two new manual
|
||||
pages for CVS: cvs(1) and cvs(5). Most of the new CVS 1.3 features
|
||||
are now documented, with the exception of the new branch support
|
||||
added to commit/rtag/tag/checkout/update.
|
||||
|
||||
* The -j options of checkout/update have been added. The "cvs join"
|
||||
command has been removed.
|
||||
|
||||
With one -j option, CVS will merge the changes made between the
|
||||
resulting revision and the revision that it is based on (e.g., if
|
||||
the tag refers to a branch, CVS will merge all changes made in
|
||||
that branch into your working file).
|
||||
|
||||
With two -j options, CVS will merge in the changes between the two
|
||||
respective revisions. This can be used to "remove" a certain delta
|
||||
from your working file. E.g., If the file foo.c is based on
|
||||
revision 1.6 and I want to remove the changes made between 1.3 and
|
||||
1.5, I might do:
|
||||
|
||||
% cvs update -j1.5 -j1.3 foo.c # note the order...
|
||||
|
||||
In addition, each -j option can contain on optional date
|
||||
specification which, when used with branches, can limit the chosen
|
||||
revision to one within a specific date. An optional date is
|
||||
specified by adding a colon (:) to the tag, as in:
|
||||
|
||||
-jSymbolic_Tag:Date_Specifier
|
||||
|
||||
An example might be what "cvs import" tells you to do when you have
|
||||
just imported sources that have conflicts with local changes:
|
||||
|
||||
% cvs checkout -jTAG:yesterday -jTAG module
|
||||
|
||||
which tells CVS to merge in the changes made to the branch
|
||||
specified by TAG in the last 24 hours. If this is not what is
|
||||
intended, substitute "yesterday" for whatever format of date that
|
||||
is appropriate, like:
|
||||
|
||||
% cvs checkout -jTAG:'1 week ago' -jTAG module
|
||||
|
||||
* "cvs diff" now supports the special tags "BASE" and "HEAD". So,
|
||||
the command:
|
||||
|
||||
% cvs diff -u -rBASE -rHEAD
|
||||
|
||||
will effectively show the changes made by others (in unidiff
|
||||
format) that will be merged into your working sources with your
|
||||
next "cvs update" command. "-rBASE" resolves to the revision that
|
||||
your working file is based on. "-rHEAD" resolves to the current
|
||||
head of the branch or trunk that you are working on.
|
||||
|
||||
* The -P option of "cvs checkout" now means to Prune empty
|
||||
directories, as with "update". The default is to not remove empty
|
||||
directories. However, if you do "checkout" with any -r options, -P
|
||||
will be implied. I.e., checking out with a tag will cause empty
|
||||
directories to be pruned automatically.
|
||||
|
||||
* The new file INSTALL describes how to install CVS, including
|
||||
detailed descriptions of interfaces to "configure".
|
||||
|
||||
* The example loginfo file in examples/loginfo has been updated to
|
||||
use the perl script included in contrib/log.pl. The nice thing
|
||||
about this log program is that it records the revision numbers of
|
||||
your change in the log message.
|
||||
|
||||
Example files for commitinfo and rcsinfo are now included in the
|
||||
examples directory.
|
||||
|
||||
* All "#if defined(__STDC__) && __STDC__ == 1" lines have been
|
||||
changed to be "#if __STDC__" to fix some problems with the former.
|
||||
|
||||
* The lib/regex.[ch] files have been updated to the 1.3 release of
|
||||
the GNU regex package.
|
||||
|
||||
* The ndbm emulation routines included with CVS 1.3 Beta-2 in the
|
||||
src/ndbm.[ch] files has been moved into the src/myndbm.[ch] files
|
||||
to avoid any conflict with the system <ndbm.h> header file. If
|
||||
you had a previous CVS 1.3 Beta release, you will want to "cvs
|
||||
remove ndbm.[ch]" form your copy of CVS as well.
|
||||
|
||||
* "cvs add" and "cvs remove" are a bit more verbose, telling you
|
||||
what to do to add/remove your file permanently.
|
||||
|
||||
* We no longer mess with /dev/tty in "commit" and "add".
|
||||
|
||||
* More things are quiet with the -Q option set.
|
||||
|
||||
* New src/config.h option: If CVS_BADROOT is set, CVS will not
|
||||
allow people really logged in as "root" to commit changes.
|
||||
|
||||
* "cvs diff" exits with a status of 0 if there were no diffs, 1 if
|
||||
there were diffs, and 2 if there were errors.
|
||||
|
||||
* "cvs -n diff" is now supported so that you can still run diffs
|
||||
even while in the middle of committing files.
|
||||
|
||||
* Handling of the CVS/Entries file is now much more robust.
|
||||
|
||||
* The default file ignore list now includes "*.so".
|
||||
|
||||
* "cvs import" did not expand '@' in the log message correctly. It
|
||||
does now. Also, import now uses the ignore file facility
|
||||
correctly.
|
||||
|
||||
Import will now tell you whether there were conflicts that need to
|
||||
be resolved, and how to resolve them.
|
||||
|
||||
* "cvs log" has been changed so that you can "log" things that are
|
||||
not a part of the current release (in the Attic).
|
||||
|
||||
* If you don't change the editor message on commit, CVS now prompts
|
||||
you with the choice:
|
||||
|
||||
!)reuse this message unchanged for remaining dirs
|
||||
|
||||
which allows you to tell CVS that you have no intention of changing
|
||||
the log message for the remainder of the commit.
|
||||
|
||||
* It is no longer necessary to have CVSROOT set if you are using
|
||||
the -H option to get Usage information on the commands.
|
||||
|
||||
* Command argument changes:
|
||||
checkout: -P handling changed as described above.
|
||||
New -j option (up to 2 can be specified)
|
||||
for doing rcsmerge kind of things on
|
||||
checkout.
|
||||
commit: -r option now supports committing to a
|
||||
numeric or symbolic tags, with some
|
||||
restrictions. Full consistency checks will
|
||||
be done.
|
||||
Added "-f logfile" option, which tells
|
||||
commit to glean the log message from the
|
||||
specified file, rather than invoking the
|
||||
editor.
|
||||
rtag: Added -b option to create a branch tag,
|
||||
useful for creating a patch for a previous
|
||||
release, or for forking development.
|
||||
tag: Added -b option to create a branch tag,
|
||||
useful for creating a patch for a previous
|
||||
release, or for forking development.
|
||||
update: New -j option (up to 2 can be specified)
|
||||
for doing rcsmerge kind of things on
|
||||
update.
|
||||
|
||||
Thu Jan 9 10:51:35 MST 1992 Jeff Polk (polk at BSDI.COM)
|
||||
|
||||
* Changes between CVS 1.3 Beta-1 and CVS 1.3 Beta-2
|
||||
|
||||
* Thanks to K. Richard Pixley at Cygnus we now have function
|
||||
prototypes in all the files
|
||||
|
||||
* Some small changes to configure for portability. There have
|
||||
been other portability problems submitted that have not been fixed
|
||||
(Brian will be working on those). Additionally all __STDC__
|
||||
tests have been modified to check __STDC__ against the constant 1
|
||||
(this is what the Second edition of K&R says must be true).
|
||||
|
||||
* Lots of additional error checking for forked processes (run_exec)
|
||||
(thanks again to K. Richard Pixley)
|
||||
|
||||
* Lots of miscellaneous bug fixes - including but certainly not
|
||||
limited to:
|
||||
various commit core dumps
|
||||
various update core dumps
|
||||
bogus results from status with numeric sticky tags
|
||||
commitprog used freed memory
|
||||
Entries file corruption caused by No_Difference
|
||||
commit to revision broken (now works if branch exists)
|
||||
ignore file processing broken for * and !
|
||||
ignore processing didn't handle memory reasonably
|
||||
miscellaneous bugs in the recursion processor
|
||||
file descriptor leak in ParseInfo
|
||||
CVSROOT.adm->CVSROOT rename bug
|
||||
lots of lint fixes
|
||||
|
||||
* Reformatted all the code in src (with GNU indent) and then
|
||||
went back and fixed prototypes, etc since indent gets confused. The
|
||||
rationale is that it is better to do it sooner than later and now
|
||||
everything is consistent and will hopefully stay that way.
|
||||
The basic options to indent were: "-bad -bbb -bap -cdb -d0 -bl -bli0
|
||||
-nce -pcs -cs -cli4 -di1 -nbc -psl -lp -i4 -ip4 -c41" and then
|
||||
miscellaneous formatting fixes were applied. Note also that the
|
||||
"-nfc1" or "-nfca" may be appropriate in files where comments have
|
||||
been carefully formatted (e.g, modules.c).
|
||||
|
||||
Sat Dec 14 20:35:22 1991 Brian Berliner (berliner at sun.com)
|
||||
|
||||
* Changes between CVS 1.2 and CVS 1.3 Beta are described here.
|
||||
|
||||
* Lots of portability work. CVS now uses the GNU "configure"
|
||||
script to dynamically determine the features provided by your
|
||||
system. It probably is not foolproof, but it is better than
|
||||
nothing. Please let me know of any portability problems. Some
|
||||
file names were changed to fit within 14-characters.
|
||||
|
||||
* CVS has a new RCS parser that is much more flexible and
|
||||
extensible. It should read all known RCS ",v" format files.
|
||||
|
||||
* Most of the commands now are fully recursive, rather than just
|
||||
operating on the current directory alone. This includes "commit",
|
||||
which makes it real easy to do an "atomic" commit of all the
|
||||
changes made to a CVS hierarchy of sources. Most of the commands
|
||||
also correctly handle file names that are in directories other than
|
||||
".", including absolute path names. Commands now accept the "-R"
|
||||
option to force recursion on (though it is always the default now)
|
||||
and the "-l" option to force recursion off, doing just "." and not
|
||||
any sub-directories.
|
||||
|
||||
* CVS supports many of the features provided with the RCS 5.x
|
||||
distribution - including the new "-k" keyword expansion options. I
|
||||
recommend using RCS 5.x (5.6 is the current official RCS version)
|
||||
and GNU diff 1.15 (or later) distributions with CVS.
|
||||
|
||||
* Checking out files with symbolic tags/dates is now "sticky", in
|
||||
that CVS remembers the tag/date used for each file (and directory)
|
||||
and will use that tag/date automatically on the next "update" call.
|
||||
This stickyness also holds for files checked out with the the new
|
||||
RCS 5.x "-k" options.
|
||||
|
||||
* The "cvs diff" command now recognizes all of the rcsdiff 5.x
|
||||
options. Unidiff format is available by installing the GNU
|
||||
diff 1.15 distribution.
|
||||
|
||||
* The old "CVS.adm" directories created on checkout are now called
|
||||
"CVS" directories, to look more like "RCS" and "SCCS". Old CVS.adm
|
||||
directories are automagically converted to CVS directories. The
|
||||
old "CVSROOT.adm" directory within the source repository is
|
||||
automagically changed into a "CVSROOT" directory as well.
|
||||
|
||||
* Symbolic links in the source repository are fully supported ONLY
|
||||
if you use RCS 5.6 or later and (of course) your system supports
|
||||
symlinks.
|
||||
|
||||
* A history database has been contributed which maintains the
|
||||
history of certain CVS operations, as well as providing a wide array
|
||||
of querying options.
|
||||
|
||||
* The "cvs" program has a "-n" option which can be used with the
|
||||
"update" command to show what would be updated without actually
|
||||
doing the update, like: "cvs -n update". All usage statements
|
||||
have been cleaned up and made more verbose.
|
||||
|
||||
* The module database parsing has been rewritten. The new format
|
||||
is compatible with the old format, but with much more
|
||||
functionality. It allows modules to be created that grab pieces or
|
||||
whole directories from various different parts of your source
|
||||
repository. Module-relative specifications are also correctly
|
||||
recognized now, like "cvs checkout module/file.c".
|
||||
|
||||
* A configurable template can be specified such that on a "commit",
|
||||
certain directories can supply a template that the user must fill
|
||||
before completing the commit operation.
|
||||
|
||||
* A configurable pre-commit checking program can be specified which
|
||||
will run to verify that a "commit" can happen. This feature can be
|
||||
used to restrict certain users from changing certain pieces of the
|
||||
source repository, or denying commits to the entire source
|
||||
repository.
|
||||
|
||||
* The new "cvs export" command is much like "checkout", but
|
||||
establishes defaults suitable for exporting code to others (expands
|
||||
out keywords, forces the use of a symbolic tag, and does not create
|
||||
"CVS" directories within the checked out sources.
|
||||
|
||||
* The new "cvs import" command replaces the deprecated "checkin"
|
||||
shell script and is used to import sources into CVS control. It is
|
||||
also much faster for the first-time import. Some algorithmic
|
||||
improvements have also been made to reduce the number of
|
||||
conflicting files on next-time imports.
|
||||
|
||||
* The new "cvs admin" command is basically an interface to the
|
||||
"rcs" program. (Not yet implemented very well).
|
||||
|
||||
* Signal handling (on systems with BSD or POSIX signals) is much
|
||||
improved. Interrupting CVS now works with a single interrupt!
|
||||
|
||||
* CVS now invokes RCS commands by direct fork/exec rather than
|
||||
calling system(3). This improves performance by removing a call to
|
||||
the shell to parse the arguments.
|
||||
|
||||
* Support for the .cvsignore file has been contributed. CVS will
|
||||
now show "unknown" files as "? filename" as the result of an "update"
|
||||
command. The .cvsignore file can be used to add files to the
|
||||
current list of ignored files so that they won't show up as unknown.
|
||||
|
||||
* Command argument changes:
|
||||
cvs: Added -l to turn off history logging.
|
||||
Added -n to show what would be done without actually
|
||||
doing anything.
|
||||
Added -q/-Q for quiet and really quiet settings.
|
||||
Added -t to show debugging trace.
|
||||
add: Added -k to allow RCS 5.x -k options to be specified.
|
||||
admin: New command; an interface to rcs(1).
|
||||
checkout: Added -A to reset sticky tags/date/options.
|
||||
Added -N to not shorten module paths.
|
||||
Added -R option to force recursion.
|
||||
Changed -p (prune empty directories) to -P option.
|
||||
Changed -f option; forcing tags match is now default.
|
||||
Added -p option to checkout module to standard output.
|
||||
Added -s option to cat the modules db with status.
|
||||
Added -d option to checkout in the specified directory.
|
||||
Added -k option to use RCS 5.x -k support.
|
||||
commit: Removed -a option; use -l instead.
|
||||
Removed -f option.
|
||||
Added -l option to disable recursion.
|
||||
Added -R option to force recursion.
|
||||
If no files specified, commit is recursive.
|
||||
diff: Now recognizes all RCS 5.x rcsdiff options.
|
||||
Added -l option to disable recursion.
|
||||
Added -R option to force recursion.
|
||||
history: New command; displays info about CVS usage.
|
||||
import: Replaces "checkin" shell script; imports sources
|
||||
under CVS control. Ignores files on the ignore
|
||||
list (see -I option or .cvsignore description above).
|
||||
export: New command; like "checkout", but w/special options
|
||||
turned on by default to facilitate exporting sources.
|
||||
join: Added -B option to join from base of the branch;
|
||||
join now defaults to only joining with the top two
|
||||
revisions on the branch.
|
||||
Added -k option for RCS 5.x -k support.
|
||||
log: Supports all RCS 5.x options.
|
||||
Added -l option to disable recursion.
|
||||
Added -R option to force recursion.
|
||||
patch: Changed -f option; forcing tags match is now default.
|
||||
Added -c option to force context-style diffs.
|
||||
Added -u option to support unidiff-style diffs.
|
||||
Added -V option to support RCS specific-version
|
||||
keyword expansion formats.
|
||||
Added -R option to force recursion.
|
||||
remove: No option changes. It's a bit more verbose.
|
||||
rtag: Equivalent to the old "cvs tag" command.
|
||||
No option changes. It's a lot faster for re-tag.
|
||||
status: New output formats with more information.
|
||||
Added -l option to disable recursion.
|
||||
Added -R option to force recursion.
|
||||
Added -v option to show symbolic tags for files.
|
||||
tag: Functionality changed to tag checked out files
|
||||
rather than modules; use "rtag" command to get the
|
||||
old "cvs tag" behaviour.
|
||||
update: Added -A to reset sticky tags/date/options.
|
||||
Changed -p (prune empty directories) to -P option.
|
||||
Changed -f option; forcing tags match is now default.
|
||||
Added -p option to checkout module to standard output.
|
||||
Added -I option to add files to the ignore list.
|
||||
Added -R option to force recursion.
|
||||
|
||||
Major Contributors:
|
||||
|
||||
* Jeff Polk <polk@bsdi.com> rewrote most of the grody code of CVS
|
||||
1.2. He made just about everything dynamic (by using malloc),
|
||||
added a generic hashed list manager, re-wrote the modules database
|
||||
parsing in a compatible - but extended way, generalized directory
|
||||
hierarchy recursion for virtually all the commands (including
|
||||
commit!), generalized the loginfo file to be used for pre-commit
|
||||
checks and commit templates, wrote a new and flexible RCS parser,
|
||||
fixed an uncountable number of bugs, and helped in the design of
|
||||
future CVS features. If there's anything gross left in CVS, it's
|
||||
probably my fault!
|
||||
|
||||
* David G. Grubbs <dgg@ksr.com> contributed the CVS "history" and
|
||||
"release" commands. As well as the ever-so-useful "-n" option of
|
||||
CVS which tells CVS to show what it would do, without actually
|
||||
doing it. He also contributed support for the .cvsignore file.
|
||||
|
||||
* 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.
|
||||
|
||||
* Free Software Foundation contributed the "configure" script and
|
||||
other compatibility support in the "lib" directory, which will help
|
||||
make CVS much more portable.
|
||||
|
||||
* Many others have contributed bug reports and enhancement requests.
|
||||
Some have even submitted actual code which I have not had time yet
|
||||
to integrate into CVS. Maybe for the next release.
|
||||
|
||||
* Thanks to you all!
|
||||
|
||||
Wed Feb 6 10:10:58 1991 Brian Berliner (berliner at sun.com)
|
||||
|
||||
* Changes from CVS 1.0 Patchlevel 1 to CVS 1.0 Patchlevel 2; also
|
||||
known as "Changes from CVS 1.1 to CVS 1.2".
|
||||
|
||||
* Major new support with this release is the ability to use the
|
||||
recently-posted RCS 5.5 distribution with CVS 1.2. See below for
|
||||
other assorted bug-fixes that have been thrown in.
|
||||
|
||||
* ChangeLog (new): Added Emacs-style change-log file to CVS 1.2
|
||||
release. Chronological description of changes between release.
|
||||
|
||||
* README: Small fixes to installation instructions. My email
|
||||
address is now "berliner@sun.com".
|
||||
|
||||
* src/Makefile: Removed "rcstime.h". Removed "depend" rule.
|
||||
|
||||
* src/partime.c: Updated to RCS 5.5 version with hooks for CVS.
|
||||
* src/maketime.c: Updated to RCS 5.5 version with hooks for CVS.
|
||||
* src/rcstime.h: Removed from the CVS 1.2 distribution.
|
||||
Thanks to Paul Eggert <eggert@twinsun.com> for these changes.
|
||||
|
||||
* src/checkin.csh: Support for RCS 5.5 parsing.
|
||||
Thanks to Paul Eggert <eggert@twinsun.com> for this change.
|
||||
|
||||
* src/collect_sets.c (Collect_Sets): Be quieter if "-f" option is
|
||||
specified. When checking out files on-top-of other files that CVS
|
||||
doesn't know about, run a diff in the hopes that they are really
|
||||
the same file before aborting.
|
||||
|
||||
* src/commit.c (branch_number): Fix for RCS 5.5 parsing.
|
||||
Thanks to Paul Eggert <eggert@twinsun.com> for this change.
|
||||
|
||||
* src/commit.c (do_editor): Bug fix - fprintf missing argument
|
||||
which sometimes caused core dumps.
|
||||
|
||||
* src/modules.c (process_module): Properly NULL-terminate
|
||||
update_dir[] in all cases.
|
||||
|
||||
* src/no_difference.c (No_Difference): The wrong RCS revision was
|
||||
being registered in certain (strange) cases.
|
||||
|
||||
* src/patch.c (get_rcsdate): New algorithm. No need to call
|
||||
maketime() any longer.
|
||||
Thanks to Paul Eggert <eggert@twinsun.com> for this change.
|
||||
|
||||
* src/patchlevel.h: Increased patch level to "2".
|
||||
|
||||
* src/subr.c (isdir, islink): Changed to compare stat mode bits
|
||||
correctly.
|
||||
|
||||
* src/tag.c (tag_file): Added support for following symbolic links
|
||||
that are in the master source repository when tagging. Made tag
|
||||
somewhat quieter in certain cases.
|
||||
|
||||
* src/update.c (update_process_lists): Unlink the user's file if it
|
||||
was put on the Wlist, meaning that the user's file is not modified
|
||||
and its RCS file has been removed by someone else.
|
||||
|
||||
* src/update.c (update): Support for "cvs update dir" to correctly
|
||||
just update the argument directory "dir".
|
||||
|
||||
* src/cvs.h: Fixes for RCS 5.5 parsing.
|
||||
* src/version_number.c (Version_Number): Fixes for parsing RCS 5.5
|
||||
and older RCS-format files.
|
||||
Thanks to Paul Eggert <eggert@twinsun.com> for these changes.
|
||||
|
||||
* src/version_number.c (Version_Number): Bug fixes for "-f" option.
|
||||
Bug fixes for parsing with certain branch numbers. RCS
|
||||
revision/symbol parsing is much more solid now.
|
||||
|
||||
Wed Feb 14 10:01:33 1990 Brian Berliner (berliner at sun.com)
|
||||
|
||||
* Changes from CVS 1.0 Patchlevel 0 to CVS 1.0 Patchlevel 1; also
|
||||
known as "Changes from CVS 1.0 to CVS 1.1".
|
||||
|
||||
* src/patch.c (get_rcsdate): Portability fix. Replaced call to
|
||||
timelocal() with call to maketime().
|
||||
|
||||
Mon Nov 19 23:15:11 1990 Brian Berliner (berliner at prisma.com)
|
||||
|
||||
* Sent CVS 1.0 release to comp.sources.unix moderator and FSF.
|
||||
|
||||
* Special thanks to Dick Grune <dick@cs.vu.nl> for his work on the
|
||||
1986 version of CVS and making it available to the world. Dick's
|
||||
version is available on uunet.uu.net in the
|
||||
comp.sources.unix/volume6/cvs directory.
|
||||
|
||||
@(#)ChangeLog 1.17 92/04/10
|
14
contrib/cvs/FAQ
Normal file
14
contrib/cvs/FAQ
Normal file
@ -0,0 +1,14 @@
|
||||
This file formerly contained a CVS FAQ, maintained by David Grubbs.
|
||||
However, it has been out of date for a long time, he officially gave up
|
||||
maintaining it in the fall of 1995, and noone else has taken it over.
|
||||
Most of the information which used to be in it can be found in the CVS
|
||||
manual, doc/cvs.texinfo in this distribution. For information on
|
||||
questions like "what is the latest version of CVS?" and "what about GUIs
|
||||
for CVS?", see the CVS web site,
|
||||
http://www.loria.fr/~molli/cvs-index.html. There are many web sites on
|
||||
Configuration Management packages (of which CVS is an example); for
|
||||
example see
|
||||
|
||||
http://www.yahoo.com/Computers_and_Internet/Software/Software_Engineering/Configuration_Management/index.html
|
||||
|
||||
or http://www.iac.honeywell.com/Pub/Tech/CM/index.html.
|
102
contrib/cvs/HACKING
Normal file
102
contrib/cvs/HACKING
Normal file
@ -0,0 +1,102 @@
|
||||
How to write code for CVS
|
||||
|
||||
* Compiler options
|
||||
|
||||
If you are using GCC, you'll want to configure with -Wall, which can
|
||||
detect many programming errors. This is not the default because it
|
||||
might cause spurious warnings, but at least on some machines, there
|
||||
should be no spurious warnings. For example:
|
||||
|
||||
$ CFLAGS="-g -Wall" ./configure
|
||||
|
||||
Configure is not very good at remembering this setting; it will get
|
||||
wiped out whenever you do a ./config.status --recheck, so you'll need
|
||||
to use:
|
||||
|
||||
$ CFLAGS="-g -Wall" ./config.status --recheck
|
||||
|
||||
* Indentation style
|
||||
|
||||
CVS mostly uses a consistent indentation style which looks like this:
|
||||
|
||||
void
|
||||
foo (arg)
|
||||
char *arg;
|
||||
{
|
||||
if (arg != NULL)
|
||||
{
|
||||
bar (arg);
|
||||
baz (arg);
|
||||
}
|
||||
}
|
||||
|
||||
The file cvs-format.el contains settings for emacs and the NEWS file
|
||||
contains a set of options for the indent program which I haven't tried
|
||||
but which are correct as far as I know. You will find some code which
|
||||
does not conform to this indentation style; the plan is to reindent it
|
||||
as those sections of the code are changed (one function at a time,
|
||||
perhaps).
|
||||
|
||||
In a submitted patch it is acceptable to refrain from changing the
|
||||
indentation of large blocks of code to minimize the size of the patch;
|
||||
the person checking in such a patch should reindent it.
|
||||
|
||||
* Portability
|
||||
|
||||
If it is in ANSI C and it is in SunOS4 (using /bin/cc), generally it
|
||||
is OK to use it without ifdefs (for example, assert() and void * as
|
||||
long as you add more casts to and from void * than ANSI requires. But
|
||||
not function prototypes). Such constructs are generally portable
|
||||
enough, including to NT, OS/2, VMS, etc.
|
||||
|
||||
* Run-time behaviors
|
||||
|
||||
Use assert() to check "can't happen" conditions internal to CVS. We
|
||||
realize that there are functions in CVS which instead return NULL or
|
||||
some such value (thus confusing the meaning of such a returned value),
|
||||
but we want to fix that code. Of course, bad input data, a corrupt
|
||||
repository, bad options, etc., should always print a real error
|
||||
message instead.
|
||||
|
||||
* Coding standards in general
|
||||
|
||||
Generally speaking the GNU coding standards are mostly used by CVS
|
||||
(but see the exceptions mentioned above, such as indentation style,
|
||||
and perhaps an exception or two we haven't mentioned). This is the
|
||||
file standards.text at the GNU FTP sites.
|
||||
|
||||
* Submitting patches
|
||||
|
||||
Please include a ChangeLog entry (see the GNU coding standards for
|
||||
information on writing one) with patches. Include a description of
|
||||
what the patch does (sometimes the ChangeLog entry and/or comments in
|
||||
the code are appropriate for this, but not always)--patches should not
|
||||
be checked in unless there is some reason for them, and the
|
||||
description may be helpful if there is a better way to solve the
|
||||
problem. In addition to the ChangeLog entry, there should be a change
|
||||
to the NEWS file in the case of a new feature.
|
||||
|
||||
If you solve several unrelated problems, submit a separate
|
||||
patch for each one. Patches should be tested before submission. Use
|
||||
context diffs or unidiffs for patches.
|
||||
|
||||
Note that all submitted changes may be distributed under the terms of
|
||||
the GNU Public License, so if you don't like this, don't submit them.
|
||||
Submit changes to bug-cvs@prep.ai.mit.edu.
|
||||
|
||||
Generally speaking if you follow the guidelines in this file you can
|
||||
expect a yes or no answer about whether your patch is accepted. But
|
||||
even in this case there is no guarantee because wading through a bunch
|
||||
of submissions can be time consuming, and noone has volunteered to
|
||||
offer any such guarantee. If you don't receive an answer one way or
|
||||
another within a month, feel free to ask what the status is. You can,
|
||||
if you wish, distribute your patch on mailing lists or newsgroups, if
|
||||
you want to make it available before it gets merged.
|
||||
|
||||
* What is the schedule for the next release?
|
||||
|
||||
There isn't one. That is, upcoming releases are not announced (or
|
||||
even hinted at, really) until the feature freeze which is
|
||||
approximately 2 weeks before the final release (at this time test
|
||||
releases start appearing and are announced on info-cvs). This is
|
||||
intentional, to avoid a last minute rush to get new features in.
|
344
contrib/cvs/INSTALL
Normal file
344
contrib/cvs/INSTALL
Normal file
@ -0,0 +1,344 @@
|
||||
#ident "$CVSid$"
|
||||
|
||||
First, read the README file. If you're still happy...
|
||||
|
||||
CVS has been tested on the following platforms. The most recent
|
||||
version of CVS reported to have been tested is indicated, but more
|
||||
recent versions of CVS probably will work too. Please send updates to
|
||||
this list to bug-cvs@prep.ai.mit.edu (doing so in the form of a diff
|
||||
to this file is encouraged).
|
||||
|
||||
Alpha:
|
||||
DEC Alpha running OSF/1 version 1.3 using cc (about 1.4A2)
|
||||
DEC Alpha running OSF/1 version 2.0 (1.4.90)
|
||||
DEC Alpha running OSF/1 version 2.1 (about 1.4A2)
|
||||
DEC Alpha running OSF/1 version 3.0 (1.5.95) (footnote 7)
|
||||
DEC Alpha running OSF/1 version 3.2 (1.7+obvious patch)
|
||||
HPPA:
|
||||
HP 9000/710 running HP-UX 8.07A using gcc (about 1.4A2)
|
||||
HP 9000/715 running HP-UX 9.01 (1.6)
|
||||
HPPA running HP-UX 10.01 (1.7)
|
||||
HPPA 1.1 running HP-UX A.09.03 (1.5.95) (footnote 8)
|
||||
HPPA 1.1 running HP-UX A.09.04 (1.7.1)
|
||||
NextSTEP 3.3 (1.6.86)
|
||||
i386 family:
|
||||
Solaris 2.4 using gcc (about 1.4A2)
|
||||
UnixWare v1.1.1 using gcc (about 1.4A2)
|
||||
ISC 4.0.1 (1.5.94)
|
||||
Linux (kernel 1.2.x) (1.7.1)
|
||||
BSDI 2.0 (1.4.93) (footnote 5)
|
||||
FreeBSD 2.0.5, i486, gcc (1.5.95)
|
||||
NextSTEP 3.3 (1.6.86)
|
||||
NeXTSTEP 3.3 (1.7), (footnote 10)
|
||||
SCO Unix 3.2.4.2 (1.4.93) (footnote 4)
|
||||
SCO OpenServer 5.0.0, "CC='cc -b elf' configure"
|
||||
Lynx 2.3.0 080695 (1.6.86) (footnote 9)
|
||||
Windows NT 3.51 (1.7.87 client-only)
|
||||
QNX 4 (1.7 + obvious patches)
|
||||
OS/2 Version 3 using IBM C/C++ Tools 2.01 (1.7.86 with patches)
|
||||
m68k:
|
||||
Sun 3 running SunOS 4.1.1_U1 w/ bundled K&R /usr/5bin/cc (1.6)
|
||||
NextSTEP 3.3 (1.6.86)
|
||||
NeXTSTEP 3.3 (1.7), (footnote 10)
|
||||
Lynx 2.3.0 062695 (1.6.86) (footnote 9)
|
||||
m88k:
|
||||
Data General AViiON running dgux 5.4R2.10 (1.5)
|
||||
Data General AViiON running dgux 5.4R3.10 (1.7.1)
|
||||
Harris Nighthawk 5800 running CX/UX 7.1 (1.5) (footnote 6)
|
||||
MIPS:
|
||||
DECstation running Ultrix 4.2a (1.4.90)
|
||||
DECstation running Ultrix 4.3 (1.6.86)
|
||||
SGI running Irix 4.0.5H using gcc and cc (about 1.4A2) (footnote 2)
|
||||
SGI running Irix 5.3 (1.7)
|
||||
SGI running Irix-6 (about 1.4.90) (footnote 3)
|
||||
Siemens-Nixdorf RM600 running SINIX-Y (1.6)
|
||||
PowerPC or RS/6000:
|
||||
IBM RS/6000 running AIX 3.1 using gcc and cc (1.6.86)
|
||||
IBM RS/6000 running AIX 3.2.5 (1.7.87)
|
||||
IBM RS/6000 running AIX 4.1 using gcc and cc (about 1.4A2) (footnote 1)
|
||||
Lynx 2.3.1 120495 (1.6.86) (footnote 9)
|
||||
SPARC:
|
||||
Sun SPARC running SunOS 4.1.x (1.6.86)
|
||||
Sun SPARCstation 10 running Solaris 2.3 using gcc and cc (about 1.4A2)
|
||||
Sun SPARCstation running Solaris 2.4 using gcc and cc (about 1.5.91)
|
||||
Sun SPARC running Solaris 2.5 (2.5 beta?) (1.6.4)
|
||||
NextSTEP 3.3 (1.6.86)
|
||||
NeXTSTEP 3.3 (1.7), (footnote 10)
|
||||
|
||||
(footnote 1)
|
||||
AIX 4.1 systems fail to run "configure" due to bugs in their
|
||||
"/bin/sh" implementation. You might want to try feeding the
|
||||
configure script to "bash" ported to AIX 4.1. (about 1.4A2).
|
||||
|
||||
(footnote 2)
|
||||
Some Irix 4.0 systems may core dump in malloc while running
|
||||
CVS. We believe this is a bug in the Irix malloc. You can
|
||||
workaround this bug by linking with "-lmalloc" if necessary.
|
||||
(about 1.4A2).
|
||||
|
||||
(footnote 3)
|
||||
There are some warnings about pointer casts which can safely be
|
||||
ignored. (about 1.4.90).
|
||||
|
||||
(footnote 4) Comment out the include of sys/time.h in src/server.c. (1.4.93)
|
||||
You also may have to make sure TIME_WITH_SYS_TIME is undef'ed.
|
||||
|
||||
(footnote 5) Change /usr/tmp to /var/tmp in src/server.c (2 places) (1.4.93).
|
||||
|
||||
(footnote 6) Build in ucb universe with COFF compiler tools. Put
|
||||
/usr/local/bin first in PATH while doing a configure, make
|
||||
and install of GNU diffutils-2.7, rcs-5.7, then cvs-1.5.
|
||||
|
||||
(footnote 7) Manoj Srivastava <srivasta@pilgrim.umass.edu> reports
|
||||
success with this configure command:
|
||||
CC=cc CFLAGS='-O2 -Olimit 2000 -std1' ./configure --verbose alpha-dec-osf
|
||||
|
||||
(footnote 8) Manoj Srivastava <srivasta@pilgrim.umass.edu> reports
|
||||
success with this configure command:
|
||||
CC=cc CFLAGS='+O2 -Aa -D_HPUX_SOURCE' ./configure --verbose hppa1.1-hp-hpux
|
||||
|
||||
(footnote 9)
|
||||
Had to configure with ./configure --host=<arch>-lynx.
|
||||
|
||||
In src/cvs.h, protected the waitpid prototype with ifdef _POSIX_SOURCE.
|
||||
(I might try building with gcc -mposix -D_POSIX_SOURCE.)
|
||||
|
||||
LynxOS has <dirent.h>, but you don't want to use it.
|
||||
You want to use <sys/dir.h> instead.
|
||||
So after running configure I had to undef HAVE_DIRENT_H and
|
||||
define HAVE_SYS_DIR_H.
|
||||
|
||||
(footnote 10) Ralf E. Stranzenbach <ralf@reswi.ruhr.de>
|
||||
I've made some modifications to "filesubr.c" to deal with NFS
|
||||
mounted directories (and those funny .nfs* files). This patch
|
||||
should be used whenever the programmers "sandbox" is located on
|
||||
a NFS mounted device --- at least on NeXTSTEP.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Installation under Unix:
|
||||
|
||||
1) Run "configure":
|
||||
|
||||
$ ./configure
|
||||
|
||||
You can specify an alternate destination to override the default with
|
||||
the --prefix option:
|
||||
|
||||
$ ./configure --prefix=/usr/local/gnu
|
||||
|
||||
or some path that is more appropriate for your site. The default prefix
|
||||
value is "/usr/local", with binaries in sub-directory "bin", manual
|
||||
pages in sub-directory "man", and libraries in sub-directory "lib".
|
||||
|
||||
If you are using server or local CVS, RCS needs to be installed in
|
||||
the user's PATH (or a path you have configured in src/options.h,
|
||||
or a path specified with the -b option). If you don't have RCS,
|
||||
you will need to get it from GNU as well. It is best to get the
|
||||
version 5.7 (or later) version of RCS, available from
|
||||
prep.ai.mit.edu in the file pub/gnu/rcs-5.7.tar.gz.
|
||||
|
||||
If you want version control of files with binary data, make sure
|
||||
that the RCS configure script finds GNU diff 1.15 or later and
|
||||
notices that diff supports the -a option. CVS itself is much less
|
||||
picky about which version of diff it uses, and you shouldn't need
|
||||
to worry about that.
|
||||
|
||||
NOTE: The configure program will cache the results of the previous
|
||||
configure execution. If you need to re-run configure from scratch, you
|
||||
may need to run "make distclean" first to remove the cached
|
||||
configuration information.
|
||||
|
||||
If you are using gcc and are planning to modify CVS, you may want to
|
||||
configure with -Wall; see the file HACKING for details.
|
||||
|
||||
Try './configure --help' for further information on its usage.
|
||||
|
||||
NOTE ON CVS's USE OF NDBM:
|
||||
|
||||
By default, CVS uses some built-in ndbm emulation code to allow
|
||||
CVS to work in a heterogeneous environment. However, if you have
|
||||
a very large modules database, this may not work well. You will
|
||||
need to edit src/options.h to turn off the MY_NDBM #define and
|
||||
re-run configure. If you do this, the following comments apply.
|
||||
If not, you may safely skip these comments.
|
||||
|
||||
If you configure CVS to use the real ndbm(3) libraries and
|
||||
you do not have them installed in a "normal" place, you will
|
||||
probably want to get the GNU version of ndbm (gdbm) and install
|
||||
that before running the CVS configure script. Be aware that the
|
||||
GDBM 1.5 release does NOT install the <ndbm.h> header file included
|
||||
with the release automatically. You may have to install it by hand.
|
||||
|
||||
If you configure CVS to use the ndbm(3) libraries, you cannot
|
||||
compile CVS with GNU cc (gcc) on Sun-4 SPARC systems. However, gcc
|
||||
2.0 may have fixed this limitation if -fpcc-struct-return is
|
||||
defined. When using gcc on other systems to compile CVS, you *may*
|
||||
need to specify the -fpcc-struct-return option to gcc (you will
|
||||
*know* you have to if "cvs checkout" core dumps in some ndbm
|
||||
function). You can do this as follows:
|
||||
|
||||
$ CC='gcc -fpcc-struct-return' ./configure
|
||||
|
||||
for sh, bash, and ksh users and:
|
||||
|
||||
% setenv CC 'gcc -fpcc-struct-return'
|
||||
% ./configure
|
||||
|
||||
for csh and tcsh users.
|
||||
|
||||
END OF NOTE FOR NDBM GUNK.
|
||||
|
||||
2) Edit src/options.h. Appropriate things to look at may be the
|
||||
invocation locations of programs like DIFF and GREP.
|
||||
Also glance at the default values for the environment variables
|
||||
that CVS uses, in particular, the RCSBIN variable, which holds the
|
||||
path to where the RCS programs live on your system.
|
||||
|
||||
3) Try to build it:
|
||||
|
||||
$ make
|
||||
|
||||
This will (hopefully) make the needed CVS binaries within the
|
||||
"src" directory. If something fails for your system, and you want
|
||||
to submit a bug report, you may wish to include your
|
||||
"config.status" file, your host type, operating system and
|
||||
compiler information, make output, and anything else you think
|
||||
will be helpful.
|
||||
|
||||
3a) Run the regression tests (optional).
|
||||
|
||||
You may also wish to validate the correctness of the new binary by
|
||||
running the regression tests:
|
||||
|
||||
$ make check
|
||||
|
||||
Note that if your /bin/sh doesn't support shell functions, you'll
|
||||
have to try something like this, where "/bin/sh5" is replaced by the
|
||||
pathname of a shell which handles normal shell functions:
|
||||
|
||||
$ make SHELL=/bin/sh5 check
|
||||
|
||||
WARNING: This test can take quite a while to run, esp. if your
|
||||
disks are slow or over-loaded.
|
||||
|
||||
If you receive any un-expected output from the regression tests,
|
||||
it may indicate a bug in CVS (or might just indicate a problem
|
||||
running the tests). If you choose to submit a bug report,
|
||||
be aware that, as with all bug reports, you may or may not get a
|
||||
response, and your odds might be better if you include enough information
|
||||
to reproduce the bug, an analysis of what is going wrong (if you have
|
||||
the time and ability to provide one), etc. The check.log file is the
|
||||
first place to look.
|
||||
|
||||
4) Install the binaries/documentation:
|
||||
|
||||
$ make install
|
||||
|
||||
Depending on your installation's configuration, you may need to be
|
||||
root to do this.
|
||||
|
||||
5) Take a look at the CVS documentation.
|
||||
|
||||
$ man cvs
|
||||
|
||||
and
|
||||
|
||||
$ info cvs
|
||||
|
||||
See what it can do for you, and if it fits your environment (or can
|
||||
possibly be made to fit your environment). If things look good,
|
||||
continue on...
|
||||
|
||||
6) Set up the master source repository. See the "Setting up the repository"
|
||||
section of cvs.texinfo for details; the one-line summary is (if you
|
||||
are putting the repository in /src/master):
|
||||
$ cvs -d /src/master init
|
||||
|
||||
7) Have all users of the CVS system set the CVSROOT environment
|
||||
variable appropriately to reflect the placement of your source
|
||||
repository. If the above example is used, the following commands
|
||||
can be placed in user's ~/.profile, ~/.bash_profile file; or in the
|
||||
site-wide /etc/profile:
|
||||
|
||||
CVSROOT=/src/master; export CVSROOT
|
||||
|
||||
for sh/bash/ksh users, or place the following commands in the user's
|
||||
~/.cshrc, ~/.login, or /etc/chsrc file:
|
||||
|
||||
setenv CVSROOT /src/master
|
||||
|
||||
for csh/tcsh users. If these environment variables are not already set
|
||||
in your current shell, set them now (or source the login script you
|
||||
just edited). You will need to have the CVSROOT environment variable
|
||||
set to continue on to the next step.
|
||||
|
||||
8) It might be a good idea to jump right in and put the CVS distribution
|
||||
directly under CVS control. From within the top-level directory of the
|
||||
CVS distribution (the one that contains this README file) do the
|
||||
following commands:
|
||||
|
||||
$ make distclean
|
||||
$ cvs import -m 'CVS 1.6 distribution' cvs CVS_DIST CVS-1_6
|
||||
|
||||
9) Having done step 8, one should be able to checkout a fresh copy of the
|
||||
CVS distribution and hack away at the sources with the following command:
|
||||
|
||||
$ cd
|
||||
$ cvs checkout cvs
|
||||
|
||||
This will make the directory "cvs" in your current directory and
|
||||
populate it with the appropriate CVS files and directories.
|
||||
|
||||
10) You may wish to customize the various administrative files, in particular
|
||||
modules. See cvs.texinfo for details.
|
||||
|
||||
11) Read the NEWS file to see what's new.
|
||||
|
||||
12) Hack away.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Detailed information about your interaction with "configure":
|
||||
|
||||
The "configure" script and its interaction with its options and the
|
||||
environment is described here. For more detailed documentation about
|
||||
"configure", please refer to the GNU Autoconf documentation.
|
||||
|
||||
Supported options are:
|
||||
|
||||
--srcdir=DIR Useful for compiling on many different
|
||||
machines sharing one source tree.
|
||||
--prefix=DIR The root of where to install the
|
||||
various pieces of CVS (/usr/local).
|
||||
--exec_prefix=DIR If you want executables in a
|
||||
host-dependent place and shared
|
||||
things in a host-independent place.
|
||||
|
||||
The following environment variables override configure's default
|
||||
behaviour:
|
||||
|
||||
CC If not set, tries to use gcc first,
|
||||
then cc. Also tries to use "-g -O"
|
||||
as options, backing down to -g
|
||||
alone if that doesn't work.
|
||||
INSTALL If not set, tries to use "install", then
|
||||
"./install-sh" as a final choice.
|
||||
RANLIB If not set, tries to determine if "ranlib"
|
||||
is available, choosing "echo" if it doesn't
|
||||
appear to be.
|
||||
YACC If not set, tries to determine if "bison"
|
||||
is available, choosing "yacc" if it doesn't
|
||||
appear to be.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Installation under Windows NT:
|
||||
|
||||
You may find interesting information in windows-NT/README.
|
||||
|
||||
1) Using Microsoft Visual C++ version 2.1, open the project `cvsnt.mak',
|
||||
in the top directory of the CVS distribution.
|
||||
2) Choose "Build cvs.exe" from the "Project" menu.
|
||||
3) MSVC will place the executable file cvs.exe in WinDebug, or whatever
|
||||
your target directory is.
|
||||
-------------------------------------------------------------------------------
|
60
contrib/cvs/MINOR-BUGS
Normal file
60
contrib/cvs/MINOR-BUGS
Normal file
@ -0,0 +1,60 @@
|
||||
Low-priority bugs go here. We don't have many yet -- everything is
|
||||
high-priority at the moment. :-)
|
||||
|
||||
|
||||
* From: Jeff Johnson <jbj@brewster.JBJ.ORG>
|
||||
To: cyclic-cvs@cyclic.com
|
||||
Subject: Named_Root assumes . on server
|
||||
Date: Wed, 17 May 1995 11:04:53 -0400 (EDT)
|
||||
|
||||
Problem:
|
||||
On server, Name_Root() attempts (aggressively) to set CVSADM_Root.
|
||||
If ~/CVS/Root exists (wrto rsh login), then CVSADM_Root will be
|
||||
initialized from that file. The sanity check between the root
|
||||
repository and the invocation will fail if the two values are not
|
||||
coincidentally the same.
|
||||
|
||||
Workaround:
|
||||
There's a zillion ways to fix this bugture/featurelet. My current
|
||||
workaround is to remove ~/CVS/Root on the server. I shall attempt
|
||||
a better fix as soon as I can determine what appears politically
|
||||
correct. IMHO, the CVS/Root stuff (and getenv("CVSROOT") also) is
|
||||
a bit fragile and tedious in an rcmd() driven CCVS environment.
|
||||
|
||||
|
||||
* (Jeff Johnson <jbj@jbj.org>)
|
||||
I tried a "cvs status -v" and received the following:
|
||||
|
||||
? CVS
|
||||
? programs/CVS
|
||||
? tests/CVS
|
||||
cvs server: Examining .
|
||||
===================================================================
|
||||
File: Install.dec Status: Up-to-date
|
||||
...
|
||||
|
||||
I claim that CVS dirs should be ignored.
|
||||
|
||||
|
||||
* I sometimes get this message:
|
||||
|
||||
Could not look up address for your host. Permission denied.
|
||||
cvs [update aborted]: premature end of file from server
|
||||
|
||||
The client's response should be cleaned up.
|
||||
|
||||
* In the gb-grep module, update-ChangeLog (and therefore, I assume,
|
||||
rcs2log) truncates file names --- I get entries for things called
|
||||
ring/lenstring.h instead of lenstring/lenstring.h.
|
||||
|
||||
* On remote checkout, files don't have the right time/date stamps in
|
||||
the CVS/Entries files. Doesn't look like the C/S protocol has any
|
||||
way to send this information along (according to cvsclient.texi).
|
||||
Perhaps we can spiff it up a bit by using the conflict field for the
|
||||
stamp on the checkout/update command. Please note that this really
|
||||
doesn't do very much for us even if we get it done.
|
||||
|
||||
* Does the function that lists the available modules in the repository
|
||||
belong under the "checkout" function? Perhaps it is more logically
|
||||
grouped with the "history" function or we should create a new "info"
|
||||
function?
|
264
contrib/cvs/Makefile.in
Normal file
264
contrib/cvs/Makefile.in
Normal file
@ -0,0 +1,264 @@
|
||||
# Master Makefile for the GNU Concurrent Versions System.
|
||||
# Copyright (C) 1986, 1988-1992, 1994 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
# $CVSid: @(#)Makefile.in 1.30 94/10/22 $
|
||||
|
||||
SHELL = /bin/sh
|
||||
|
||||
#### Start of system configuration section. ####
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
# If you use gcc, you should either run the fixincludes script that
|
||||
# comes with it or else use gcc with the -traditional option. Otherwise
|
||||
# ioctl calls will be compiled incorrectly on some systems.
|
||||
CC = @CC@
|
||||
AR = ar
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
# Set RANLIB = echo if your system doesn't have or need ranlib.
|
||||
RANLIB = @RANLIB@
|
||||
# Set YACC = bison or yacc, depending on which you have on your system
|
||||
YACC = @YACC@
|
||||
# Use cp if you don't have install.
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
|
||||
DEFS = @DEFS@
|
||||
LIBS = @LIBS@
|
||||
|
||||
INCLUDES = -I. -I../lib @includeopt@
|
||||
CFLAGS = @CFLAGS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
|
||||
MAKEINFO = makeinfo
|
||||
TEXI2DVI = texi2dvi
|
||||
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
# Where to install the executables.
|
||||
bindir = $(exec_prefix)/bin
|
||||
|
||||
# Where to put the system-wide .cvsrc file
|
||||
libdir = $(prefix)/lib
|
||||
|
||||
# Where to put the Info files
|
||||
infodir = $(prefix)/info
|
||||
|
||||
# Where to put the manual pages.
|
||||
mandir = $(prefix)/man
|
||||
|
||||
#### End of system configuration section. ####
|
||||
|
||||
FLAGS_TO_PASS = \
|
||||
AR='$(AR)' \
|
||||
CC='$(CC)' \
|
||||
CFLAGS='$(CFLAGS)' \
|
||||
LDFLAGS='$(LDFLAGS)' \
|
||||
LIBPROGS='$(LIBPROGS)' \
|
||||
LIBS='$(LIBS)' \
|
||||
MAKE='$(MAKE)' \
|
||||
MAKEINFO='$(MAKEINFO)' \
|
||||
RANLIB='$(RANLIB)' \
|
||||
TEXI2DVI='$(TEXI2DVI)' \
|
||||
YACC='$(YACC)' \
|
||||
bindir='$(bindir)' \
|
||||
infodir='$(infodir)' \
|
||||
libdir='$(libdir)' \
|
||||
mandir='$(mandir)' \
|
||||
prefix='$(prefix)' \
|
||||
exec_prefix='$(exec_prefix)'
|
||||
|
||||
DISTFILES = \
|
||||
COPYING COPYING.LIB INSTALL README TODO PROJECTS \
|
||||
BUGS MINOR-BUGS FAQ HACKING \
|
||||
ChangeLog NEWS ChangeLog.zoo \
|
||||
configure configure.in stamp-h.in config.h.in Makefile.in acconfig.h \
|
||||
cvs-format.el mkinstalldirs install-sh \
|
||||
cvsnt.mak \
|
||||
.cvsignore
|
||||
|
||||
### Subdirectories to run make in for the primary targets.
|
||||
# Unix source subdirs, where we'll want to run lint and etags:
|
||||
USOURCE_SUBDIRS = lib src
|
||||
# All other subdirs:
|
||||
SUBDIRS = ${USOURCE_SUBDIRS} man doc contrib tools windows-NT os2 macintosh
|
||||
# Only make TAGS/tags files in these directories, in this order
|
||||
# [Why in this order? If we didn't have to stick to this order, we
|
||||
# could make "TSUBDIRS = ${USOURCE_SUBDIRS}". -Karl]
|
||||
TSUBDIRS= src lib
|
||||
|
||||
# Set default target.
|
||||
all:
|
||||
|
||||
.PHONY: all install uninstall
|
||||
all install uninstall: config.h Makefile all-local
|
||||
@for subdir in $(SUBDIRS); do \
|
||||
echo "making $@ in $$subdir"; \
|
||||
( cd $$subdir && $(MAKE) $(FLAGS_TO_PASS) $@ ) || exit 1; \
|
||||
done
|
||||
|
||||
install: all install-local install-info
|
||||
|
||||
.PHONY: all-local
|
||||
all-local:
|
||||
|
||||
.PHONY: info dvi clean-info install-info
|
||||
info dvi clean-info install-info:
|
||||
cd doc && $(MAKE) $(FLAGS_TO_PASS) $@ || exit 1
|
||||
|
||||
.PHONY: install-local
|
||||
install-local: all-local
|
||||
@: nothing to do locally
|
||||
|
||||
.PHONY: tags
|
||||
tags:
|
||||
@for dir in $(TSUBDIRS); do echo making $@ in $$dir; cd $$dir && $(MAKE) $(FLAGS_TO_PASS) $@ || exit 1; cd ..; done
|
||||
@echo making $@ in .
|
||||
@ctags `for i in \`$(MAKE) SUBDIRS="$(TSUBDIRS)" ls\` ; do echo $(srcdir)/$$i ; done`
|
||||
|
||||
.PHONY: TAGS
|
||||
TAGS:
|
||||
@for dir in $(TSUBDIRS); do echo making $@ in $$dir; cd $$dir && $(MAKE) $(FLAGS_TO_PASS) $@ || exit 1; cd ..; done
|
||||
@echo making $@ in .
|
||||
@etags `for i in \`$(MAKE) SUBDIRS="$(TSUBDIRS)" ls | grep -v 'make\[[0-9]\]'\` ; do echo $(srcdir)/$$i ; done`
|
||||
|
||||
.PHONY: ls
|
||||
ls:
|
||||
@echo $(DISTFILES)
|
||||
@for dir in $(SUBDIRS); do \
|
||||
for i in `cd $$dir && $(MAKE) $(FLAGS_TO_PASS) $@ | grep -v 'make\[[0-9]\]'` ; do \
|
||||
echo $$dir/$$i ; \
|
||||
done ; \
|
||||
done
|
||||
|
||||
.PHONY: clean
|
||||
clean: clean-local
|
||||
@for dir in $(SUBDIRS); do echo making $@ in $$dir; cd $$dir && $(MAKE) $(FLAGS_TO_PASS) $@ || exit 1; cd ..; done
|
||||
|
||||
.PHONY: distclean
|
||||
distclean: distclean-local
|
||||
@for dir in $(SUBDIRS); do echo making $@ in $$dir; cd $$dir && $(MAKE) $(FLAGS_TO_PASS) $@ || exit 1; cd ..; done
|
||||
rm -f config.status
|
||||
|
||||
.PHONY: realclean
|
||||
realclean: realclean-local
|
||||
@for dir in $(SUBDIRS); do echo making $@ in $$dir; cd $$dir && $(MAKE) $(FLAGS_TO_PASS) $@ || exit 1; cd ..; done
|
||||
rm -f config.status
|
||||
|
||||
.PHONY: mostlyclean-local
|
||||
mostlyclean-local:
|
||||
rm -f *~
|
||||
|
||||
.PHONY: clean-local
|
||||
clean-local: mostlyclean-local
|
||||
|
||||
.PHONY: distclean-local
|
||||
distclean-local: clean-local
|
||||
rm -f Makefile config.cache config.h config.log stamp-h
|
||||
rm -f tags TAGS
|
||||
|
||||
.PHONY: realclean-local
|
||||
realclean-local: distclean-local
|
||||
|
||||
.PHONY: saber
|
||||
saber:
|
||||
@for dir in $(SUBDIRS); do cd $$dir && $(MAKE) $(FLAGS_TO_PASS) $@ || exit 1; cd ..; done
|
||||
|
||||
.PHONY: check
|
||||
check:
|
||||
cd lib ; $(MAKE) $(FLAGS_TO_PASS)
|
||||
cd src ; $(MAKE) $(FLAGS_TO_PASS) check
|
||||
|
||||
.PHONY: remotecheck
|
||||
remotecheck:
|
||||
cd lib ; $(MAKE) $(FLAGS_TO_PASS)
|
||||
cd src ; $(MAKE) $(FLAGS_TO_PASS) remotecheck
|
||||
|
||||
.PHONY: installcheck
|
||||
installcheck:
|
||||
cd lib ; $(MAKE) $(FLAGS_TO_PASS)
|
||||
cd src ; $(MAKE) $(FLAGS_TO_PASS) installcheck
|
||||
|
||||
.PHONY: lint
|
||||
lint:
|
||||
@for dir in $(USOURCE_SUBDIRS); do cd $$dir && $(MAKE) $(FLAGS_TO_PASS) xlint || exit 1; cd ..; done
|
||||
|
||||
.PHONY: dist
|
||||
GZIP=gzip --best
|
||||
GZIP_EXT=.gz
|
||||
TAR_VERBOSE=
|
||||
dist:
|
||||
echo > .fname \
|
||||
cvs-`sed < $(srcdir)/src/version.c \
|
||||
-e '/version_string/!d' \
|
||||
-e 's/[^0-9.]*\([0-9.]*\).*/\1/' \
|
||||
-e q`
|
||||
rm -rf `cat .fname`
|
||||
${MAKE} dist-dir DISTDIR="`cat .fname`"
|
||||
for dir in ${SUBDIRS}; do \
|
||||
( DISTDIR="../`cat .fname`/$${dir}"; \
|
||||
cd $${dir} && \
|
||||
${MAKE} dist-dir DISTDIR="$${DISTDIR}" \
|
||||
); \
|
||||
done
|
||||
tar chf${TAR_VERBOSE} - `cat .fname` | ${GZIP} > "`cat .fname`.tar${GZIP_EXT}"
|
||||
rm -rf `cat .fname` .fname
|
||||
|
||||
.PHONY: dist-dir
|
||||
dist-dir:
|
||||
mkdir ${DISTDIR}
|
||||
for i in ${DISTFILES}; do \
|
||||
ln $(srcdir)/$${i} ${DISTDIR}; \
|
||||
done
|
||||
|
||||
# For the justification of the following Makefile rules, see node
|
||||
# `Automatic Remaking' in GNU Autoconf documentation.
|
||||
Makefile: Makefile.in config.status
|
||||
CONFIG_FILES=$@ CONFIG_HEADERS= ./config.status
|
||||
config.status: configure
|
||||
./config.status --recheck
|
||||
# The rules to run autoconf and autoheader are commented out. This is because
|
||||
# when the user unpacks a tarfile, configure.in might end up newer than
|
||||
# configure, but the user might not have (and does not need to have) autoconf
|
||||
# installed.
|
||||
#configure: configure.in #aclocal.m4
|
||||
# cd $(srcdir); autoconf
|
||||
|
||||
config.h: stamp-h
|
||||
|
||||
# This used to do a ./config.status --recheck, to update config.status with
|
||||
# any new #defines from config.h.in. The problem was that the rule itself
|
||||
# depends on config.status, so that the --recheck would get run several
|
||||
# times, which is bad if the user was trying to specify CFLAGS manually.
|
||||
# It was a big pain in the neck.
|
||||
stamp-h: config.h.in config.status
|
||||
CONFIG_FILES=$@ CONFIG_HEADERS=config.h ./config.status
|
||||
|
||||
#config.h.in: stamp-h.in
|
||||
#stamp-h.in: configure.in #aclocal.m4 acconfig.h
|
||||
# cd $(srcdir); autoheader
|
||||
# date > $(srcdir)/stamp-h.in
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make not to export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
907
contrib/cvs/NEWS
Normal file
907
contrib/cvs/NEWS
Normal file
@ -0,0 +1,907 @@
|
||||
Changes since 1.7:
|
||||
|
||||
* New "cvs annotate" command to display the last modification for each
|
||||
line of a file, with the revision number, user checking in the
|
||||
modification, and date of the modification. For more information see
|
||||
the `annotate' node in cvs.texinfo.
|
||||
|
||||
* The cvsinit shell script has been replaced by a cvs init command.
|
||||
The cvs init command creates some example administrative files which
|
||||
are similar to the files found in the examples directory (and copied
|
||||
by cvsinit) in previous releases.
|
||||
|
||||
* Added the patterns *.olb *.exe _$* *$ to default ignore list.
|
||||
|
||||
* There is now a $USER internal variable for *info files.
|
||||
|
||||
* There is no longer a separate `mkmodules' program; the functionality
|
||||
is now built into `cvs'. If upgrading an old repository, it is OK to
|
||||
leave in the lines in the modules file which run mkmodules (the
|
||||
mkmodules actions will get done twice, but that is harmless); you will
|
||||
probably want to remove them once you are no longer using the old CVS.
|
||||
|
||||
* One can now specify user variables in *info files via the
|
||||
${=varname} syntax; there is a -s global option to set them. See the
|
||||
Variables node in cvs.texinfo for details.
|
||||
|
||||
Changes from 1.6 to 1.7:
|
||||
|
||||
* The default ignore list has changed slightly: *.obj has been added
|
||||
and CVS* has been changed to CVS CVS.adm.
|
||||
|
||||
* CVS now supports password authentication when accessing remote
|
||||
repositories; this is useful for sites that can't use rsh (because of
|
||||
a firewall, for example), and also don't have kerberos. See node
|
||||
"Password authenticated" (in "Remote repositories", in
|
||||
doc/cvs.texinfo) for more details. Note: This feature requires both
|
||||
the client and server to be upgraded.
|
||||
|
||||
* Using the -kb option to specify binary files now works--most cases
|
||||
did not work before. See the "Binary files" section of
|
||||
doc/cvs.texinfo for details.
|
||||
|
||||
* New developer communication features. See the "Watches" section of
|
||||
doc/cvs.texinfo for details.
|
||||
|
||||
* RCS keyword "Name" supported for "cvs update -r <tag>" and "cvs
|
||||
checkout -r <tag>".
|
||||
|
||||
* If there is a group whose name matches a compiled in value which
|
||||
defaults to "cvsadmin", only members of that group can use "cvs
|
||||
admin". This replaces the CVS_NOADMIN option.
|
||||
|
||||
* CVS now sets the modes of files in the repository based on the
|
||||
CVSUMASK environment variable or a compiled in value defaulting to
|
||||
002. This way other developers will be able to access the files in
|
||||
the repository regardless of the umask of the developer creating them.
|
||||
|
||||
* The command names in .cvsrc now match the official name of the
|
||||
command, not the one (possibly an alias) by which it was invoked. If
|
||||
you had previously relied on "cvs di" and "cvs diff" using different
|
||||
options, instead use a shell function or alias (for example "alias
|
||||
cvsdi='cvs diff -u'"). You also can specify global CVS options (like
|
||||
"-z") using the command name "cvs".
|
||||
|
||||
Changes from 1.5 to 1.6:
|
||||
|
||||
* Del updated the man page to include all of the new features
|
||||
of CVS 1.6.
|
||||
|
||||
* "cvs tag" now supports a "-r | -D" option for tagging an already
|
||||
tagged revision / specific revision of a file.
|
||||
|
||||
* There is a "taginfo" file in CVSROOT that supports filtering and
|
||||
recording of tag operations.
|
||||
|
||||
* Long options support added, including --help and --version options.
|
||||
|
||||
* "cvs release" no longer cares whether or not the directory being
|
||||
released has an entry in the `modules' file.
|
||||
|
||||
* The modules file now takes a -e option which is used instead of -o
|
||||
for "cvs export". If your modules file has a -o option which you want
|
||||
to be used for "cvs export", change it to specify -e as well as -o.
|
||||
|
||||
* "cvs export" now takes a -k option to set RCS keyword expansion.
|
||||
This way you can export binary files. If you want the old behavior,
|
||||
you need to specify -kv.
|
||||
|
||||
* "cvs update", "cvs rdiff", "cvs checkout", "cvs import", "cvs
|
||||
release", "cvs rtag", and "cvs tag" used to take -q and -Q options
|
||||
after the command name (e.g. "cvs update -q"). This was confusing
|
||||
because other commands, such as "cvs ci", did not. So the options
|
||||
after the command name have been removed and you must now specify, for
|
||||
example, "cvs -q update", which has been supported since CVS 1.3.
|
||||
|
||||
* New "wrappers" feature. This allows you to set a hook which
|
||||
transforms files on their way in and out of cvs (apparently on the
|
||||
NeXT there is some particular usefulness in tarring things up in the
|
||||
repository). It also allows you to declare files as merge-by-copy
|
||||
which means that instead of trying to merge the file, CVS will merely
|
||||
copy the new version. There is a CVSROOT/cvswrappers file and an
|
||||
optionsl ~/.cvswrappers file to support this feature.
|
||||
|
||||
* You can set CVSROOT to user@host:dir, not just host:dir, if your
|
||||
username on the server host is different than on the client host.
|
||||
|
||||
* VISUAL is accepted as well as EDITOR.
|
||||
|
||||
* $CVSROOT is expanded in *info files.
|
||||
|
||||
Changes from 1.4A2 to 1.5:
|
||||
|
||||
* Remote implementation. This is very helpful when collaborating on a
|
||||
project with someone across a wide-area network. This release can
|
||||
also be used locally, like other CVS versions, if you have no need for
|
||||
remote access.
|
||||
|
||||
Here are some of the features of the remote implementation:
|
||||
- It uses reliable transport protocols (TCP/IP) for remote repository
|
||||
access, not NFS. NFS is unusable over long distances (and sometimes
|
||||
over short distances)
|
||||
- It transfers only those files that have changed in the repository or
|
||||
the working directory. To save transmission time, it will transfer
|
||||
patches when appropriate, and can compress data for transmission.
|
||||
- The server never holds CVS locks while waiting for a reply from the client;
|
||||
this makes the system robust when used over flaky networks.
|
||||
|
||||
The remote features are documented in doc/cvsclient.texi in the CVS
|
||||
distribution, but the main doc file, cvs.texinfo, has not yet been
|
||||
updated to include the remote features.
|
||||
|
||||
* Death support. See src/README-rm-add for more information on this.
|
||||
|
||||
* Many speedups, especially from jtc@cygnus.com.
|
||||
|
||||
* CVS 1.2 compatibility code has been removed as a speedup. If you
|
||||
have working directories checked out by CVS 1.2, CVS 1.3 or 1.4A2 will
|
||||
try to convert them, but CVS 1.5 and later will not (if the working
|
||||
directory is up to date and contains no extraneous files, you can just
|
||||
remove it, and then check out a new working directory). Likewise if
|
||||
your repository contains a CVSROOT.adm directory instead of a CVSROOT
|
||||
directory, you need to rename it.
|
||||
|
||||
Fri Oct 21 20:58:54 1994 Brian Berliner <berliner@sun.com>
|
||||
|
||||
* Changes between CVS 1.3 and CVS 1.4 Alpha-2
|
||||
|
||||
* A new program, "cvsbug", is provided to let you send bug reports
|
||||
directly to the CVS maintainers. Please use it instead of sending
|
||||
mail to the info-cvs mailing list. If your build fails, you may
|
||||
have to invoke "cvsbug" directly from the "src" directory as
|
||||
"src/cvsbug.sh".
|
||||
|
||||
* A new User's Guide and Tutorial, written by Per Cederqvist
|
||||
<ceder@signum.se> of Signum Support. See the "doc" directory. A
|
||||
PostScript version is included as "doc/cvs.ps".
|
||||
|
||||
* The Frequesntly Asked Questions file, FAQ, has been added to the
|
||||
release. Unfortunately, its contents are likely out-of-date.
|
||||
|
||||
* The "cvsinit" shell script is now installed in the $prefix/bin
|
||||
directory like the other programs. You can now create new
|
||||
CVS repositories with great ease.
|
||||
|
||||
* Index: lines are now printed on output from 'diff' and 'rdiff',
|
||||
in order to facilitate application of patches to multiple subdirs.
|
||||
|
||||
* Support for a ~/.cvsrc file, which allows you to specify options
|
||||
that are always supposed to be given to a specific command. This
|
||||
feature shows the non-orthogonality of the option set, since while
|
||||
there may be an option to turn something on, the option to turn
|
||||
that same thing off may not exist.
|
||||
|
||||
* You can now list subdirectories that you wish to ignore in a
|
||||
modules listing, such as:
|
||||
|
||||
gcc -a gnu/gcc, !gnu/gcc/testsuites
|
||||
|
||||
which will check out everything underneath gnu/gcc, except
|
||||
everything underneath gnu/gcc/testsuites.
|
||||
|
||||
* It is now much harder to accidentally overwrite an existing tag
|
||||
name, since attempting to move a tag name will result in a error,
|
||||
unless the -F (force) flag is given to the tag subcommands.
|
||||
|
||||
* Better error checking on matching of the repository used to
|
||||
check code out from against the repository the current cvs
|
||||
commnands would use. (Thanks to Mark Baushke <mdb@cisco.com>)
|
||||
|
||||
* Better support for sites with multiple CVSROOT repositories has
|
||||
been contributed. The file "CVS/Root" in your working directory
|
||||
is created to hold the full path to the CVS repository and a
|
||||
simple check is made against your current CVSROOT setting.
|
||||
|
||||
* You can now specify an RCS keyword substitution value when you
|
||||
import files into the repository.
|
||||
|
||||
* Uses a much newer version of Autoconf, and conforms to the GNU
|
||||
coding standards much more closely. No, it still doesn't have
|
||||
long option names.
|
||||
|
||||
* Code cleanup. Many passes through gcc -Wall helped to identify
|
||||
a number of questionable constructs. Most arbitrary length limits
|
||||
were removed.
|
||||
|
||||
* Profiling to determine bottlenecks helped to identify the best
|
||||
places to spend time speeding up the code, which was then done. A
|
||||
number of performance enhancements in filename matching have sped
|
||||
up checkouts.
|
||||
|
||||
* Many more contributions have been added to the "contrib"
|
||||
directory. See the README file in that directory for more
|
||||
information.
|
||||
|
||||
* "cvs commit" will try harder to not change the file's
|
||||
modification time after the commit. If the file does not change
|
||||
as a result of the commit operation, CVS will preserve the
|
||||
original modification time, thus speeding up future make-type
|
||||
builds.
|
||||
|
||||
* "cvs commit" now includes any removed files in the (optional)
|
||||
pre-commit checking program that may be invoked. Previously, only
|
||||
added and modified files were included.
|
||||
|
||||
* It is now possible to commit a file directly onto the trunk at a
|
||||
specific revision level by doing "cvs commit -r3.0 file.c", where
|
||||
"3.0" specifies the revision you wish to create. The file must be
|
||||
up-to-date with the current head of the trunk for this to succeed.
|
||||
|
||||
* "cvs commit" will now function with a pre-commit program that
|
||||
has arguments specified in the "commitinfo" file.
|
||||
|
||||
* The "mkmodules" program will now look within the
|
||||
$CVSROOT/CVSROOT/checkoutlist" file for any additional files that
|
||||
should be automatically checked out within CVSROOT; mkmodules also
|
||||
tries harder to preserve any execute bits the files may have
|
||||
originally had.
|
||||
|
||||
* "cvs diff" is much more accurate about its exit status now. It
|
||||
now returns the maximum exit status of any invoked diff.
|
||||
|
||||
* The "-I !" option is now supported for the import and update
|
||||
commands correctly. It will properly clear the ignore list now.
|
||||
|
||||
* Some problems with "cvs import" handling of .cvsignore have been
|
||||
fixed; as well, some rampant recursion problems with import have
|
||||
also been fixed.
|
||||
|
||||
* "cvs rdiff" (aka "cvs patch") now tries to set the modify time
|
||||
of any temporary files it uses to match those specified for the
|
||||
particular revision. This allows a more accurate patch image to
|
||||
be created.
|
||||
|
||||
* "cvs status" has improved revision descriptions. "Working
|
||||
revision" is used for the revision of the working file that you
|
||||
edit directly; "Repository revision" is the revision of the file
|
||||
with the $CVSROOT source repository. Also, the output is clearer
|
||||
with regard to sticky and branch revisions.
|
||||
|
||||
* CVS no longer dumps core when given a mixture of directories and
|
||||
files in sub-directories (as in "cvs ci file1 dir1/file2").
|
||||
Instead, arguments are now clumped into their respective directory
|
||||
and operated on in chunks, together.
|
||||
|
||||
* If the CVSEDITOR environment variable is set, that editor is
|
||||
used for log messages instead of the EDITOR environment variable.
|
||||
This makes it easy to substitute intelligent programs to make more
|
||||
elaborate log messages. Contributed by Mark D Baushke
|
||||
(mdb@cisco.com).
|
||||
|
||||
* Command argument changes:
|
||||
cvs: The "-f" option has been added to ignore
|
||||
the ~/.cvsrc file.
|
||||
commit: Renamed the "-f logfile" option to the
|
||||
"-F logfile" option. Added the "-f"
|
||||
option to force a commit of the specified
|
||||
files (this disables recursion).
|
||||
history: Added "-t timezone" option to force any
|
||||
date-specific output into the specified
|
||||
timezone.
|
||||
import: Added "-d" option to use the file's
|
||||
modification time as the time of the
|
||||
import. Added "-k sub" option to set the
|
||||
default RCS keyword substitution mode for
|
||||
newly-created files.
|
||||
remove: Added "-f" option to force the file's
|
||||
automatic removal if it still exists in
|
||||
the working directory (use with caution).
|
||||
rtag: Added "-F" option to move the tag if it
|
||||
already exists -- new default is to NOT
|
||||
move tags automatically.
|
||||
tag: Added "-F" option to move the tag if it
|
||||
already exists -- new default is to NOT
|
||||
move tags automatically.
|
||||
|
||||
Tue Apr 7 15:55:25 1992 Brian Berliner (berliner at sun.com)
|
||||
|
||||
* Changes between CVS 1.3 Beta-3 and official CVS 1.3!
|
||||
|
||||
* A new shell script is provided, "./cvsinit", which can be run at
|
||||
install time to help setup your $CVSROOT area. This can greatly
|
||||
ease your entry into CVS usage.
|
||||
|
||||
* The INSTALL file has been updated to include the machines on
|
||||
which CVS has compiled successfully. I think CVS 1.3 is finally
|
||||
portable. Thanks to all the Beta testers!
|
||||
|
||||
* Support for the "editinfo" file was contributed. This file
|
||||
(located in $CVSROOT/CVSROOT) can be used to specify a special
|
||||
"editor" to run on a per-directory basis within the repository,
|
||||
instead of the usual user's editor. As such, it can verify that
|
||||
the log message entered by the user is of the appropriate form
|
||||
(contains a bugid and test validation, for example).
|
||||
|
||||
* The manual pages cvs(1) and cvs(5) have been updated.
|
||||
|
||||
* The "mkmodules" command now informs you when your modules file
|
||||
has duplicate entries.
|
||||
|
||||
* The "add" command now preserves any per-directory sticky tag when
|
||||
you add a new directory to your checked-out sources.
|
||||
|
||||
* The "admin" command is now a fully recursive interface to the
|
||||
"rcs" program which operates on your checked-out sources. It no
|
||||
longer requires you to specify the full path to the RCS file.
|
||||
|
||||
* The per-file sticky tags can now be effectively removed with
|
||||
"cvs update -A file", even if you had checked out the whole
|
||||
directory with a per-directory sticky tag. This allows a great
|
||||
deal of flexibility in managing the revisions that your checked-out
|
||||
sources are based upon (both per-directory and per-file sticky
|
||||
tags).
|
||||
|
||||
* The "cvs -n commit" command now works, to show which files are
|
||||
out-of-date and will cause the real commit to fail, or which files
|
||||
will fail any pre-commit checks. Also, the "cvs -n import ..."
|
||||
command will now show you what it would've done without actually
|
||||
doing it.
|
||||
|
||||
* Doing "cvs commit modules" to checkin the modules file will no
|
||||
properly run the "mkmodules" program (assuming you have setup your
|
||||
$CVSROOT/CVSROOT/modules file to do so).
|
||||
|
||||
* The -t option in the modules file (which specifies a program to
|
||||
run when you do a "cvs rtag" operation on a module) now gets the
|
||||
symbolic tag as the second argument when invoked.
|
||||
|
||||
* When the source repository is locked by another user, that user's
|
||||
login name will be displayed as the holder of the lock.
|
||||
|
||||
* Doing "cvs checkout module/file.c" now works even if
|
||||
module/file.c is in the Attic (has been removed from main-line
|
||||
development).
|
||||
|
||||
* Doing "cvs commit */Makefile" now works as one would expect.
|
||||
Rather than trying to commit everything recursively, it will now
|
||||
commit just the files specified.
|
||||
|
||||
* The "cvs remove" command is now fully recursive. To schedule a
|
||||
file for removal, all you have to do is "rm file" and "cvs rm".
|
||||
With no arguments, "cvs rm" will schedule all files that have been
|
||||
physically removed for removal from the source repository at the
|
||||
next "cvs commit".
|
||||
|
||||
* The "cvs tag" command now prints "T file" for each file that was
|
||||
tagged by this invocation and "D file" for each file that had the
|
||||
tag removed (as with "cvs tag -d").
|
||||
|
||||
* The -a option has been added to "cvs rtag" to force it to clean
|
||||
up any old, matching tags for files that have been removed (in the
|
||||
Attic) that may not have been touched by this tag operation. This
|
||||
can help keep a consistent view with your tag, even if you re-use
|
||||
it frequently.
|
||||
|
||||
Sat Feb 29 16:02:05 1992 Brian Berliner (berliner at sun.com)
|
||||
|
||||
* Changes between CVS 1.3 Beta-2 and CVS 1.3 Beta-3
|
||||
|
||||
* Many portability fixes, thanks to all the Beta testers! With any
|
||||
luck, this Beta release will compile correctly on most anything.
|
||||
Hey, what are we without our dreams.
|
||||
|
||||
* CVS finally has support for doing isolated development on a
|
||||
branch off the current (or previous!) revisions. This is also
|
||||
extremely nice for generating patches for previously released
|
||||
software while development is progressing on the next release.
|
||||
Here's an example of creating a branch to fix a patch with the 2.0
|
||||
version of the "foo" module, even though we are already well into
|
||||
the 3.0 release. Do:
|
||||
|
||||
% cvs rtag -b -rFOO_2_0 FOO_2_0_Patch foo
|
||||
% cvs checkout -rFOO_2_0_Patch foo
|
||||
% cd foo
|
||||
[[ hack away ]]
|
||||
% cvs commit
|
||||
|
||||
A physical branch will be created in the RCS file only when you
|
||||
actually commit the change. As such, forking development at some
|
||||
random point in time is extremely light-weight -- requiring just a
|
||||
symbolic tag in each file until a commit is done. To fork
|
||||
development at the currently checked out sources, do:
|
||||
|
||||
% cvs tag -b Personal_Hack
|
||||
% cvs update -rPersonal_Hack
|
||||
[[ hack away ]]
|
||||
% cvs commit
|
||||
|
||||
Now, if you decide you want the changes made in the Personal_Hack
|
||||
branch to be merged in with other changes made in the main-line
|
||||
development, you could do:
|
||||
|
||||
% cvs commit # to make Personal_Hack complete
|
||||
% cvs update -A # to update sources to main-line
|
||||
% cvs update -jPersonal_Hack # to merge Personal_Hack
|
||||
|
||||
to update your checked-out sources, or:
|
||||
|
||||
% cvs checkout -jPersonal_Hack module
|
||||
|
||||
to checkout a fresh copy.
|
||||
|
||||
To support this notion of forked development, CVS reserves
|
||||
all even-numbered branches for its own use. In addition, CVS
|
||||
reserves the ".0" and ".1" branches. So, if you intend to do your
|
||||
own branches by hand with RCS, you should use odd-numbered branches
|
||||
starting with ".3", as in "1.1.3", "1.1.5", 1.2.9", ....
|
||||
|
||||
* The "cvs commit" command now supports a fully functional -r
|
||||
option, allowing you to commit your changes to a specific numeric
|
||||
revision or symbolic tag with full consistency checks. Numeric
|
||||
tags are useful for bringing your sources all up to some revision
|
||||
level:
|
||||
|
||||
% cvs commit -r2.0
|
||||
|
||||
For symbolic tags, you can only commit to a tag that references a
|
||||
branch in the RCS file. One created by "cvs rtag -b" or from
|
||||
"cvs tag -b" is appropriate (see below).
|
||||
|
||||
* Roland Pesch <pesch@cygnus.com> and K. Richard Pixley
|
||||
<rich@cygnus.com> were kind enough to contribute two new manual
|
||||
pages for CVS: cvs(1) and cvs(5). Most of the new CVS 1.3 features
|
||||
are now documented, with the exception of the new branch support
|
||||
added to commit/rtag/tag/checkout/update.
|
||||
|
||||
* The -j options of checkout/update have been added. The "cvs join"
|
||||
command has been removed.
|
||||
|
||||
With one -j option, CVS will merge the changes made between the
|
||||
resulting revision and the revision that it is based on (e.g., if
|
||||
the tag refers to a branch, CVS will merge all changes made in
|
||||
that branch into your working file).
|
||||
|
||||
With two -j options, CVS will merge in the changes between the two
|
||||
respective revisions. This can be used to "remove" a certain delta
|
||||
from your working file. E.g., If the file foo.c is based on
|
||||
revision 1.6 and I want to remove the changes made between 1.3 and
|
||||
1.5, I might do:
|
||||
|
||||
% cvs update -j1.5 -j1.3 foo.c # note the order...
|
||||
|
||||
In addition, each -j option can contain on optional date
|
||||
specification which, when used with branches, can limit the chosen
|
||||
revision to one within a specific date. An optional date is
|
||||
specified by adding a colon (:) to the tag, as in:
|
||||
|
||||
-jSymbolic_Tag:Date_Specifier
|
||||
|
||||
An example might be what "cvs import" tells you to do when you have
|
||||
just imported sources that have conflicts with local changes:
|
||||
|
||||
% cvs checkout -jTAG:yesterday -jTAG module
|
||||
|
||||
which tells CVS to merge in the changes made to the branch
|
||||
specified by TAG in the last 24 hours. If this is not what is
|
||||
intended, substitute "yesterday" for whatever format of date that
|
||||
is appropriate, like:
|
||||
|
||||
% cvs checkout -jTAG:'1 week ago' -jTAG module
|
||||
|
||||
* "cvs diff" now supports the special tags "BASE" and "HEAD". So,
|
||||
the command:
|
||||
|
||||
% cvs diff -u -rBASE -rHEAD
|
||||
|
||||
will effectively show the changes made by others (in unidiff
|
||||
format) that will be merged into your working sources with your
|
||||
next "cvs update" command. "-rBASE" resolves to the revision that
|
||||
your working file is based on. "-rHEAD" resolves to the current
|
||||
head of the branch or trunk that you are working on.
|
||||
|
||||
* The -P option of "cvs checkout" now means to Prune empty
|
||||
directories, as with "update". The default is to not remove empty
|
||||
directories. However, if you do "checkout" with any -r options, -P
|
||||
will be implied. I.e., checking out with a tag will cause empty
|
||||
directories to be pruned automatically.
|
||||
|
||||
* The new file INSTALL describes how to install CVS, including
|
||||
detailed descriptions of interfaces to "configure".
|
||||
|
||||
* The example loginfo file in examples/loginfo has been updated to
|
||||
use the perl script included in contrib/log.pl. The nice thing
|
||||
about this log program is that it records the revision numbers of
|
||||
your change in the log message.
|
||||
|
||||
Example files for commitinfo and rcsinfo are now included in the
|
||||
examples directory.
|
||||
|
||||
* All "#if defined(__STDC__) && __STDC__ == 1" lines have been
|
||||
changed to be "#if __STDC__" to fix some problems with the former.
|
||||
|
||||
* The lib/regex.[ch] files have been updated to the 1.3 release of
|
||||
the GNU regex package.
|
||||
|
||||
* The ndbm emulation routines included with CVS 1.3 Beta-2 in the
|
||||
src/ndbm.[ch] files has been moved into the src/myndbm.[ch] files
|
||||
to avoid any conflict with the system <ndbm.h> header file. If
|
||||
you had a previous CVS 1.3 Beta release, you will want to "cvs
|
||||
remove ndbm.[ch]" form your copy of CVS as well.
|
||||
|
||||
* "cvs add" and "cvs remove" are a bit more verbose, telling you
|
||||
what to do to add/remove your file permanently.
|
||||
|
||||
* We no longer mess with /dev/tty in "commit" and "add".
|
||||
|
||||
* More things are quiet with the -Q option set.
|
||||
|
||||
* New src/config.h option: If CVS_BADROOT is set, CVS will not
|
||||
allow people really logged in as "root" to commit changes.
|
||||
|
||||
* "cvs diff" exits with a status of 0 if there were no diffs, 1 if
|
||||
there were diffs, and 2 if there were errors.
|
||||
|
||||
* "cvs -n diff" is now supported so that you can still run diffs
|
||||
even while in the middle of committing files.
|
||||
|
||||
* Handling of the CVS/Entries file is now much more robust.
|
||||
|
||||
* The default file ignore list now includes "*.so".
|
||||
|
||||
* "cvs import" did not expand '@' in the log message correctly. It
|
||||
does now. Also, import now uses the ignore file facility
|
||||
correctly.
|
||||
|
||||
Import will now tell you whether there were conflicts that need to
|
||||
be resolved, and how to resolve them.
|
||||
|
||||
* "cvs log" has been changed so that you can "log" things that are
|
||||
not a part of the current release (in the Attic).
|
||||
|
||||
* If you don't change the editor message on commit, CVS now prompts
|
||||
you with the choice:
|
||||
|
||||
!)reuse this message unchanged for remaining dirs
|
||||
|
||||
which allows you to tell CVS that you have no intention of changing
|
||||
the log message for the remainder of the commit.
|
||||
|
||||
* It is no longer necessary to have CVSROOT set if you are using
|
||||
the -H option to get Usage information on the commands.
|
||||
|
||||
* Command argument changes:
|
||||
checkout: -P handling changed as described above.
|
||||
New -j option (up to 2 can be specified)
|
||||
for doing rcsmerge kind of things on
|
||||
checkout.
|
||||
commit: -r option now supports committing to a
|
||||
numeric or symbolic tags, with some
|
||||
restrictions. Full consistency checks will
|
||||
be done.
|
||||
Added "-f logfile" option, which tells
|
||||
commit to glean the log message from the
|
||||
specified file, rather than invoking the
|
||||
editor.
|
||||
rtag: Added -b option to create a branch tag,
|
||||
useful for creating a patch for a previous
|
||||
release, or for forking development.
|
||||
tag: Added -b option to create a branch tag,
|
||||
useful for creating a patch for a previous
|
||||
release, or for forking development.
|
||||
update: New -j option (up to 2 can be specified)
|
||||
for doing rcsmerge kind of things on
|
||||
update.
|
||||
|
||||
Thu Jan 9 10:51:35 MST 1992 Jeff Polk (polk at BSDI.COM)
|
||||
|
||||
* Changes between CVS 1.3 Beta-1 and CVS 1.3 Beta-2
|
||||
|
||||
* Thanks to K. Richard Pixley at Cygnus we now have function
|
||||
prototypes in all the files
|
||||
|
||||
* Some small changes to configure for portability. There have
|
||||
been other portability problems submitted that have not been fixed
|
||||
(Brian will be working on those). Additionally all __STDC__
|
||||
tests have been modified to check __STDC__ against the constant 1
|
||||
(this is what the Second edition of K&R says must be true).
|
||||
|
||||
* Lots of additional error checking for forked processes (run_exec)
|
||||
(thanks again to K. Richard Pixley)
|
||||
|
||||
* Lots of miscellaneous bug fixes - including but certainly not
|
||||
limited to:
|
||||
various commit core dumps
|
||||
various update core dumps
|
||||
bogus results from status with numeric sticky tags
|
||||
commitprog used freed memory
|
||||
Entries file corruption caused by No_Difference
|
||||
commit to revision broken (now works if branch exists)
|
||||
ignore file processing broken for * and !
|
||||
ignore processing didn't handle memory reasonably
|
||||
miscellaneous bugs in the recursion processor
|
||||
file descriptor leak in ParseInfo
|
||||
CVSROOT.adm->CVSROOT rename bug
|
||||
lots of lint fixes
|
||||
|
||||
* Reformatted all the code in src (with GNU indent) and then
|
||||
went back and fixed prototypes, etc since indent gets confused. The
|
||||
rationale is that it is better to do it sooner than later and now
|
||||
everything is consistent and will hopefully stay that way.
|
||||
The basic options to indent were: "-bad -bbb -bap -cdb -d0 -bl -bli0
|
||||
-nce -pcs -cs -cli4 -di1 -nbc -psl -lp -i4 -ip4 -c41" and then
|
||||
miscellaneous formatting fixes were applied. Note also that the
|
||||
"-nfc1" or "-nfca" may be appropriate in files where comments have
|
||||
been carefully formatted (e.g, modules.c).
|
||||
|
||||
Sat Dec 14 20:35:22 1991 Brian Berliner (berliner at sun.com)
|
||||
|
||||
* Changes between CVS 1.2 and CVS 1.3 Beta are described here.
|
||||
|
||||
* Lots of portability work. CVS now uses the GNU "configure"
|
||||
script to dynamically determine the features provided by your
|
||||
system. It probably is not foolproof, but it is better than
|
||||
nothing. Please let me know of any portability problems. Some
|
||||
file names were changed to fit within 14-characters.
|
||||
|
||||
* CVS has a new RCS parser that is much more flexible and
|
||||
extensible. It should read all known RCS ",v" format files.
|
||||
|
||||
* Most of the commands now are fully recursive, rather than just
|
||||
operating on the current directory alone. This includes "commit",
|
||||
which makes it real easy to do an "atomic" commit of all the
|
||||
changes made to a CVS hierarchy of sources. Most of the commands
|
||||
also correctly handle file names that are in directories other than
|
||||
".", including absolute path names. Commands now accept the "-R"
|
||||
option to force recursion on (though it is always the default now)
|
||||
and the "-l" option to force recursion off, doing just "." and not
|
||||
any sub-directories.
|
||||
|
||||
* CVS supports many of the features provided with the RCS 5.x
|
||||
distribution - including the new "-k" keyword expansion options. I
|
||||
recommend using RCS 5.x (5.6 is the current official RCS version)
|
||||
and GNU diff 1.15 (or later) distributions with CVS.
|
||||
|
||||
* Checking out files with symbolic tags/dates is now "sticky", in
|
||||
that CVS remembers the tag/date used for each file (and directory)
|
||||
and will use that tag/date automatically on the next "update" call.
|
||||
This stickyness also holds for files checked out with the the new
|
||||
RCS 5.x "-k" options.
|
||||
|
||||
* The "cvs diff" command now recognizes all of the rcsdiff 5.x
|
||||
options. Unidiff format is available by installing the GNU
|
||||
diff 1.15 distribution.
|
||||
|
||||
* The old "CVS.adm" directories created on checkout are now called
|
||||
"CVS" directories, to look more like "RCS" and "SCCS". Old CVS.adm
|
||||
directories are automagically converted to CVS directories. The
|
||||
old "CVSROOT.adm" directory within the source repository is
|
||||
automagically changed into a "CVSROOT" directory as well.
|
||||
|
||||
* Symbolic links in the source repository are fully supported ONLY
|
||||
if you use RCS 5.6 or later and (of course) your system supports
|
||||
symlinks.
|
||||
|
||||
* A history database has been contributed which maintains the
|
||||
history of certain CVS operations, as well as providing a wide array
|
||||
of querying options.
|
||||
|
||||
* The "cvs" program has a "-n" option which can be used with the
|
||||
"update" command to show what would be updated without actually
|
||||
doing the update, like: "cvs -n update". All usage statements
|
||||
have been cleaned up and made more verbose.
|
||||
|
||||
* The module database parsing has been rewritten. The new format
|
||||
is compatible with the old format, but with much more
|
||||
functionality. It allows modules to be created that grab pieces or
|
||||
whole directories from various different parts of your source
|
||||
repository. Module-relative specifications are also correctly
|
||||
recognized now, like "cvs checkout module/file.c".
|
||||
|
||||
* A configurable template can be specified such that on a "commit",
|
||||
certain directories can supply a template that the user must fill
|
||||
before completing the commit operation.
|
||||
|
||||
* A configurable pre-commit checking program can be specified which
|
||||
will run to verify that a "commit" can happen. This feature can be
|
||||
used to restrict certain users from changing certain pieces of the
|
||||
source repository, or denying commits to the entire source
|
||||
repository.
|
||||
|
||||
* The new "cvs export" command is much like "checkout", but
|
||||
establishes defaults suitable for exporting code to others (expands
|
||||
out keywords, forces the use of a symbolic tag, and does not create
|
||||
"CVS" directories within the checked out sources.
|
||||
|
||||
* The new "cvs import" command replaces the deprecated "checkin"
|
||||
shell script and is used to import sources into CVS control. It is
|
||||
also much faster for the first-time import. Some algorithmic
|
||||
improvements have also been made to reduce the number of
|
||||
conflicting files on next-time imports.
|
||||
|
||||
* The new "cvs admin" command is basically an interface to the
|
||||
"rcs" program. (Not yet implemented very well).
|
||||
|
||||
* Signal handling (on systems with BSD or POSIX signals) is much
|
||||
improved. Interrupting CVS now works with a single interrupt!
|
||||
|
||||
* CVS now invokes RCS commands by direct fork/exec rather than
|
||||
calling system(3). This improves performance by removing a call to
|
||||
the shell to parse the arguments.
|
||||
|
||||
* Support for the .cvsignore file has been contributed. CVS will
|
||||
now show "unknown" files as "? filename" as the result of an "update"
|
||||
command. The .cvsignore file can be used to add files to the
|
||||
current list of ignored files so that they won't show up as unknown.
|
||||
|
||||
* Command argument changes:
|
||||
cvs: Added -l to turn off history logging.
|
||||
Added -n to show what would be done without actually
|
||||
doing anything.
|
||||
Added -q/-Q for quiet and really quiet settings.
|
||||
Added -t to show debugging trace.
|
||||
add: Added -k to allow RCS 5.x -k options to be specified.
|
||||
admin: New command; an interface to rcs(1).
|
||||
checkout: Added -A to reset sticky tags/date/options.
|
||||
Added -N to not shorten module paths.
|
||||
Added -R option to force recursion.
|
||||
Changed -p (prune empty directories) to -P option.
|
||||
Changed -f option; forcing tags match is now default.
|
||||
Added -p option to checkout module to standard output.
|
||||
Added -s option to cat the modules db with status.
|
||||
Added -d option to checkout in the specified directory.
|
||||
Added -k option to use RCS 5.x -k support.
|
||||
commit: Removed -a option; use -l instead.
|
||||
Removed -f option.
|
||||
Added -l option to disable recursion.
|
||||
Added -R option to force recursion.
|
||||
If no files specified, commit is recursive.
|
||||
diff: Now recognizes all RCS 5.x rcsdiff options.
|
||||
Added -l option to disable recursion.
|
||||
Added -R option to force recursion.
|
||||
history: New command; displays info about CVS usage.
|
||||
import: Replaces "checkin" shell script; imports sources
|
||||
under CVS control. Ignores files on the ignore
|
||||
list (see -I option or .cvsignore description above).
|
||||
export: New command; like "checkout", but w/special options
|
||||
turned on by default to facilitate exporting sources.
|
||||
join: Added -B option to join from base of the branch;
|
||||
join now defaults to only joining with the top two
|
||||
revisions on the branch.
|
||||
Added -k option for RCS 5.x -k support.
|
||||
log: Supports all RCS 5.x options.
|
||||
Added -l option to disable recursion.
|
||||
Added -R option to force recursion.
|
||||
patch: Changed -f option; forcing tags match is now default.
|
||||
Added -c option to force context-style diffs.
|
||||
Added -u option to support unidiff-style diffs.
|
||||
Added -V option to support RCS specific-version
|
||||
keyword expansion formats.
|
||||
Added -R option to force recursion.
|
||||
remove: No option changes. It's a bit more verbose.
|
||||
rtag: Equivalent to the old "cvs tag" command.
|
||||
No option changes. It's a lot faster for re-tag.
|
||||
status: New output formats with more information.
|
||||
Added -l option to disable recursion.
|
||||
Added -R option to force recursion.
|
||||
Added -v option to show symbolic tags for files.
|
||||
tag: Functionality changed to tag checked out files
|
||||
rather than modules; use "rtag" command to get the
|
||||
old "cvs tag" behaviour.
|
||||
update: Added -A to reset sticky tags/date/options.
|
||||
Changed -p (prune empty directories) to -P option.
|
||||
Changed -f option; forcing tags match is now default.
|
||||
Added -p option to checkout module to standard output.
|
||||
Added -I option to add files to the ignore list.
|
||||
Added -R option to force recursion.
|
||||
|
||||
Major Contributors:
|
||||
|
||||
* Jeff Polk <polk@bsdi.com> rewrote most of the grody code of CVS
|
||||
1.2. He made just about everything dynamic (by using malloc),
|
||||
added a generic hashed list manager, re-wrote the modules database
|
||||
parsing in a compatible - but extended way, generalized directory
|
||||
hierarchy recursion for virtually all the commands (including
|
||||
commit!), generalized the loginfo file to be used for pre-commit
|
||||
checks and commit templates, wrote a new and flexible RCS parser,
|
||||
fixed an uncountable number of bugs, and helped in the design of
|
||||
future CVS features. If there's anything gross left in CVS, it's
|
||||
probably my fault!
|
||||
|
||||
* David G. Grubbs <dgg@odi.com> contributed the CVS "history" and
|
||||
"release" commands. As well as the ever-so-useful "-n" option of
|
||||
CVS which tells CVS to show what it would do, without actually
|
||||
doing it. He also contributed support for the .cvsignore file.
|
||||
|
||||
* 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.
|
||||
|
||||
* Free Software Foundation contributed the "configure" script and
|
||||
other compatibility support in the "lib" directory, which will help
|
||||
make CVS much more portable.
|
||||
|
||||
* Many others have contributed bug reports and enhancement requests.
|
||||
Some have even submitted actual code which I have not had time yet
|
||||
to integrate into CVS. Maybe for the next release.
|
||||
|
||||
* Thanks to you all!
|
||||
|
||||
Wed Feb 6 10:10:58 1991 Brian Berliner (berliner at sun.com)
|
||||
|
||||
* Changes from CVS 1.0 Patchlevel 1 to CVS 1.0 Patchlevel 2; also
|
||||
known as "Changes from CVS 1.1 to CVS 1.2".
|
||||
|
||||
* Major new support with this release is the ability to use the
|
||||
recently-posted RCS 5.5 distribution with CVS 1.2. See below for
|
||||
other assorted bug-fixes that have been thrown in.
|
||||
|
||||
* ChangeLog (new): Added Emacs-style change-log file to CVS 1.2
|
||||
release. Chronological description of changes between release.
|
||||
|
||||
* README: Small fixes to installation instructions. My email
|
||||
address is now "berliner@sun.com".
|
||||
|
||||
* src/Makefile: Removed "rcstime.h". Removed "depend" rule.
|
||||
|
||||
* src/partime.c: Updated to RCS 5.5 version with hooks for CVS.
|
||||
* src/maketime.c: Updated to RCS 5.5 version with hooks for CVS.
|
||||
* src/rcstime.h: Removed from the CVS 1.2 distribution.
|
||||
Thanks to Paul Eggert <eggert@twinsun.com> for these changes.
|
||||
|
||||
* src/checkin.csh: Support for RCS 5.5 parsing.
|
||||
Thanks to Paul Eggert <eggert@twinsun.com> for this change.
|
||||
|
||||
* src/collect_sets.c (Collect_Sets): Be quieter if "-f" option is
|
||||
specified. When checking out files on-top-of other files that CVS
|
||||
doesn't know about, run a diff in the hopes that they are really
|
||||
the same file before aborting.
|
||||
|
||||
* src/commit.c (branch_number): Fix for RCS 5.5 parsing.
|
||||
Thanks to Paul Eggert <eggert@twinsun.com> for this change.
|
||||
|
||||
* src/commit.c (do_editor): Bug fix - fprintf missing argument
|
||||
which sometimes caused core dumps.
|
||||
|
||||
* src/modules.c (process_module): Properly NULL-terminate
|
||||
update_dir[] in all cases.
|
||||
|
||||
* src/no_difference.c (No_Difference): The wrong RCS revision was
|
||||
being registered in certain (strange) cases.
|
||||
|
||||
* src/patch.c (get_rcsdate): New algorithm. No need to call
|
||||
maketime() any longer.
|
||||
Thanks to Paul Eggert <eggert@twinsun.com> for this change.
|
||||
|
||||
* src/patchlevel.h: Increased patch level to "2".
|
||||
|
||||
* src/subr.c (isdir, islink): Changed to compare stat mode bits
|
||||
correctly.
|
||||
|
||||
* src/tag.c (tag_file): Added support for following symbolic links
|
||||
that are in the master source repository when tagging. Made tag
|
||||
somewhat quieter in certain cases.
|
||||
|
||||
* src/update.c (update_process_lists): Unlink the user's file if it
|
||||
was put on the Wlist, meaning that the user's file is not modified
|
||||
and its RCS file has been removed by someone else.
|
||||
|
||||
* src/update.c (update): Support for "cvs update dir" to correctly
|
||||
just update the argument directory "dir".
|
||||
|
||||
* src/cvs.h: Fixes for RCS 5.5 parsing.
|
||||
* src/version_number.c (Version_Number): Fixes for parsing RCS 5.5
|
||||
and older RCS-format files.
|
||||
Thanks to Paul Eggert <eggert@twinsun.com> for these changes.
|
||||
|
||||
* src/version_number.c (Version_Number): Bug fixes for "-f" option.
|
||||
Bug fixes for parsing with certain branch numbers. RCS
|
||||
revision/symbol parsing is much more solid now.
|
||||
|
||||
Wed Feb 14 10:01:33 1990 Brian Berliner (berliner at sun.com)
|
||||
|
||||
* Changes from CVS 1.0 Patchlevel 0 to CVS 1.0 Patchlevel 1; also
|
||||
known as "Changes from CVS 1.0 to CVS 1.1".
|
||||
|
||||
* src/patch.c (get_rcsdate): Portability fix. Replaced call to
|
||||
timelocal() with call to maketime().
|
||||
|
||||
Mon Nov 19 23:15:11 1990 Brian Berliner (berliner at prisma.com)
|
||||
|
||||
* Sent CVS 1.0 release to comp.sources.unix moderator and FSF.
|
||||
|
||||
* Special thanks to Dick Grune <dick@cs.vu.nl> for his work on the
|
||||
1986 version of CVS and making it available to the world. Dick's
|
||||
version is available on uunet.uu.net in the
|
||||
comp.sources.unix/volume6/cvs directory.
|
||||
|
||||
$CVSid: @(#)ChangeLog 1.35 94/10/22 $
|
59
contrib/cvs/PROJECTS
Normal file
59
contrib/cvs/PROJECTS
Normal file
@ -0,0 +1,59 @@
|
||||
This is a list of projects for CVS. In general, unlike the things in
|
||||
the TODO file, these need more analysis to determine if and how
|
||||
worthwhile each task is.
|
||||
|
||||
I haven't gone through TODO, but it's likely that it has entries that
|
||||
are actually more appropriate for this list.
|
||||
|
||||
0. Improved Efficency
|
||||
|
||||
* CVS uses a single doubly linked list/hash table data structure for
|
||||
all of its lists. Since the back links are only used for deleting
|
||||
list nodes it might be beneficial to use singly linked lists or a
|
||||
tree structure. Most likely, a single list implementation will not
|
||||
be appropriate for all uses.
|
||||
|
||||
One easy change would be to remove the "type" field out of the list
|
||||
and node structures. I have found it to be of very little use when
|
||||
debugging, and each instance eats up a word of memory. This can add
|
||||
up and be a problem on memory-starved machines.
|
||||
|
||||
Profiles have shown that on fast machines like the Alpha, fsortcmp()
|
||||
is one of the hot spots.
|
||||
|
||||
* Dynamically allocated character strings are created, copied, and
|
||||
destroyed throughout CVS. The overhead of malloc()/strcpy()/free()
|
||||
needs to be measured. If significant, it could be minimized by using a
|
||||
reference counted string "class".
|
||||
|
||||
* File modification time is stored as a character string. It might be
|
||||
worthwile to use a time_t internally if the time to convert a time_t
|
||||
(from struct stat) to a string is greater that the time to convert a
|
||||
ctime style string (from the entries file) to a time_t. time_t is
|
||||
an machine-dependant type (although it's pretty standard on UN*X
|
||||
systems), so we would have to have different conversion routines.
|
||||
Profiles show that both operations are called about the same number
|
||||
of times.
|
||||
|
||||
* stat() is one of the largest performance bottlenecks on systems
|
||||
without the 4.4BSD filesystem. By spliting information out of
|
||||
the filesystem (perhaps the "rename database") we should be
|
||||
able to improve performance.
|
||||
|
||||
* Parsing RCS files is very expensive. This might be unnecessary if
|
||||
RCS files are only used as containers for revisions, and tag,
|
||||
revision, and date information was available in easy to read
|
||||
(and modify) indexes. This becomes very apparent with files
|
||||
with several hundred revisions.
|
||||
|
||||
* A RCS "library", so CVS could operate on RCS files directly.
|
||||
|
||||
CVS parses RCS files in order to determine if work needs to be done,
|
||||
and then RCS parses the files again when it is performing the work.
|
||||
This would be much faster if CVS could do whatever is necessary
|
||||
by itself.
|
||||
|
||||
1. Improved testsuite/sanity check script
|
||||
|
||||
* Need to use a code coverage tool to determine how much the sanity
|
||||
script tests, and fill in the holes.
|
222
contrib/cvs/README
Normal file
222
contrib/cvs/README
Normal file
@ -0,0 +1,222 @@
|
||||
$CVSid: @(#)README 1.32 94/10/22 $
|
||||
|
||||
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
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 1, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
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 or
|
||||
info@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
|
||||
|
||||
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". This is also
|
||||
the procedure for submitting suggested changes to CVS (see the file
|
||||
HACKING for more details). Note that all submitted changes may be
|
||||
distributed under the terms of the GNU Public License, so if you don't
|
||||
like this, don't submit them.
|
||||
|
||||
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
|
||||
release, but you are completely on your own. We recommend testing this
|
||||
release on a source repository that is not critical to your work. THIS
|
||||
SOFTWARE IS SUPPLIED COMPLETELY "AS IS". NO WARRANTY....
|
||||
|
||||
Thanks for your support!
|
||||
|
||||
-The CVS Team
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
CVS is a freely available collection of programs that provide for software
|
||||
release and revision control functions in a UNIX environment. It is
|
||||
designed to work on top of the RCS distribution, V4 and later. CVS does
|
||||
understand how to parse older RCS formats, but cannot do any of the fancier
|
||||
features (like vendor branch support) without RCS branch support.
|
||||
|
||||
Short blurb from the manual page (larger blurb is included there):
|
||||
cvs is a front end to the rcs(1) revision control system
|
||||
which extends the notion of revision control from a collec-
|
||||
tion of files in a single directory to a hierarchical col-
|
||||
lection of directories consisting of revision controlled
|
||||
files. These directories and files can be combined together
|
||||
to form a software release. cvs provides the functions
|
||||
necessary to manage these software releases and to control
|
||||
the concurrent editing of source files among multiple
|
||||
software developers.
|
||||
|
||||
And a whole lot more. See the doc/cvs.texinfo file for more information.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Notes to people upgrading from a previous release of CVS:
|
||||
|
||||
See the NEWS file for a description of features new in this version.
|
||||
|
||||
The repository format is compatible going back to CVS 1.3. But see
|
||||
the "Watches compatibility" section of doc/cvs.texinfo if you have
|
||||
copies of CVS 1.6 or older and you want to use the optional developer
|
||||
communication features.
|
||||
|
||||
The working directory format is compatible going back to CVS 1.5. It
|
||||
did change between CVS 1.3 and CVS 1.5. If you run CVS 1.5 or newer
|
||||
on a working directory checked out with CVS 1.3, CVS will convert it,
|
||||
but to go back to CVS 1.3 you need to check out a new working
|
||||
directory with CVS 1.3.
|
||||
|
||||
The remote protocol is interoperable going back to CVS 1.5. Using a
|
||||
client or server older than 1.5 is deprecated and may fail to work at
|
||||
some point in the future (1.5 was the first official release with the
|
||||
remote protocol, but some older versions might still be floating
|
||||
around). In many cases you need to upgrade both the client and the
|
||||
server to take advantage of new features and bugfixes, however.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Installation:
|
||||
|
||||
Please read the INSTALL file for installation instructions. Brief summary:
|
||||
|
||||
$ ./configure
|
||||
$ make
|
||||
$ make check # optional, long-running, step
|
||||
$ make install
|
||||
$ cvsinit
|
||||
|
||||
The documentation is in the doc subdirectory. cvs.texinfo is the main
|
||||
manual; cvs.info* and cvs.ps are the info and postscript versions,
|
||||
respectively, generated from cvs.texinfo. The postscript version is
|
||||
for A4 paper; if you want US letter size, you need to remove the line
|
||||
@afourpaper from cvs.texinfo and re-generate cvs.ps using TeX.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
* How do I get up-to-date information and information about other
|
||||
versions of CVS?
|
||||
|
||||
On the web, http://www.loria.fr/~molli/cvs-index.html.
|
||||
|
||||
The mailing list for CVS is info-cvs@prep.ai.mit.edu. Send
|
||||
subscription and removal requests for that list to
|
||||
info-cvs-request@prep.ai.mit.edu.
|
||||
|
||||
The newsgroup for CVS (and other configuration management systems) is
|
||||
comp.software.config-mgmt. There is not yet a CVS-specific newsgroup,
|
||||
but perhaps if comp.software.config-mgmt gets enough CVS discussion,
|
||||
then it will be possible to create one.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Credits:
|
||||
|
||||
The conflict-resolution algorithms and much of the administrative file
|
||||
definitions of CVS were based on the original package written by Dick Grune
|
||||
at Vrije Universiteit in Amsterdam <dick@cs.vu.nl>, and posted to
|
||||
comp.sources.unix in the volume 6 release sometime in 1986. This original
|
||||
version was a collection of shell scripts. I am thankful that Dick made
|
||||
his work available.
|
||||
|
||||
Brian Berliner from Prisma, Inc. (now at Sun Microsystems, Inc.)
|
||||
<berliner@sun.com> converted the original CVS shell scripts into reasonably
|
||||
fast C and added many, many features to support software release control
|
||||
functions. See the manual page in the "man" directory. A copy of the
|
||||
USENIX article presented at the Winter 1990 USENIX Conference, Washington
|
||||
D.C., is included in the "doc" directory.
|
||||
|
||||
Jeff Polk from BSDI <polk@bsdi.com> converted the CVS 1.2
|
||||
sources into much more readable and maintainable C code. He also added a
|
||||
whole lot of functionality and modularity to the code in the process.
|
||||
See the ChangeLog file.
|
||||
|
||||
david d `zoo' zuhn <zoo@armadillo.com> contributed the working base code
|
||||
for CVS 1.4 Alpha. His work carries on from work done by K. Richard Pixley
|
||||
and others at Cygnus Support. The CVS 1.4 upgrade is due in large part to
|
||||
Zoo's efforts.
|
||||
|
||||
David G. Grubbs <dgg@odi.com> contributed the CVS "history" and "release"
|
||||
commands. As well as the ever-so-useful "-n" option of CVS which tells CVS
|
||||
to show what it would do, without actually doing it. He also contributed
|
||||
support for the .cvsignore file.
|
||||
|
||||
The Free Software Foundation (GNU) contributed most of the portability
|
||||
framework that CVS now uses. This can be found in the "configure" script,
|
||||
the Makefile's, and basically most of the "lib" directory.
|
||||
|
||||
K. Richard Pixley, Cygnus Support <rich@cygnus.com> contributed many bug
|
||||
fixes/enhancement as well as completing early reviews of the CVS 1.3 manual
|
||||
pages.
|
||||
|
||||
Roland Pesch, then of Cygnus Support <roland@wrs.com> contributed brand new
|
||||
cvs(1) and cvs(5) manual pages. We should all thank him for saving us from
|
||||
my poor use of our language!
|
||||
|
||||
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!
|
||||
|
||||
Mark D. Baushke <mdb@cisco.com>
|
||||
Per Cederqvist <ceder@signum.se>
|
||||
J.T. Conklin (jtc@cygnus.com>
|
||||
Vince DeMarco <vdemarco@fdcsrvr.cs.mci.com>
|
||||
Paul Eggert <eggert@twinsun.com>
|
||||
Lal George <george@research.att.com>
|
||||
Dean E. Hardi <Dean.E.Hardi@ccmail.jpl.nasa.gov>
|
||||
Mike Heath <mike@pencom.com>
|
||||
Jim Kingdon <kingdon@cygnus.com>
|
||||
Bernd Leibing <bernd.leibing@rz.uni-ulm.de>
|
||||
Benedict Lofstedt <benedict@tusc.com.au>
|
||||
Dave Love <d.love@dl.ac.uk>
|
||||
Robert Lupton the Good <rhl@astro.princeton.edu>
|
||||
Tom McAliney <tom@hilco.com>
|
||||
Eberhard Mattes <mattes@azu.informatik.uni-stuttgart.de>
|
||||
Jim Meyering <meyering@comco.com>
|
||||
Thomas Mohr <mohr@lts.sel.alcatel.de>
|
||||
Thomas Nilsson <thoni@softlab.se>
|
||||
Raye Raskin <raye.raskin@lia.com>
|
||||
Harlan Stenn <harlan@landmark.com>
|
||||
Gunnar Tornblom <gunnar.tornblom@senet.abb.se>
|
||||
Greg A. Woods <woods@planix.com>
|
||||
|
||||
Many contributors have added code to the "contrib" directory. See the
|
||||
README file there for a list of what is available. There is also a
|
||||
contributed GNU Emacs CVS-mode in contrib/pcl-cvs.
|
423
contrib/cvs/TODO
Normal file
423
contrib/cvs/TODO
Normal file
@ -0,0 +1,423 @@
|
||||
$CVSid: @(#)TODO 1.26 94/09/21 $
|
||||
|
||||
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).
|
||||
|
||||
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.
|
||||
|
||||
31. Think hard about ^C recovery.
|
||||
|
||||
35. Add "admin" command as an interface to "rcs".
|
||||
[[ a cheesy version is there, but it should be re-done ]]
|
||||
|
||||
38. Think hard about using RCS state information to allow one to checkin
|
||||
a new vendor release without having it be accessed until it has been
|
||||
integrated into the local changes.
|
||||
|
||||
39. Think about allowing parallel source trees that can easily track
|
||||
each other.
|
||||
[[ sort of solved with the automagic branch support, but I want more ]]
|
||||
|
||||
45. Consider enhancing the "patch" and "tag" command support in the module
|
||||
database -- they seem hard to use since these commands deal directly
|
||||
with the RCS ,v files.
|
||||
|
||||
46. Perhaps checkout/checkin/tag/patch commands should be imbedded in the
|
||||
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 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 ]]
|
||||
|
||||
52. SCCS has a feature that I would *love* to see in CVS, as it is very
|
||||
useful. One may make a private copy of SCCS suid to a particular user,
|
||||
so other users in the authentication list may check files in and out of
|
||||
a project directory without mucking about with groups. Is there any
|
||||
plan to provide a similar functionality to CVS? Our site (and, I'd
|
||||
imagine, many other sites with large user bases) has decided against
|
||||
having the user-groups feature of unix available to the users, due to
|
||||
perceived administrative, technical and performance headaches. A tool
|
||||
such as CVS with features that provide group-like functionality would
|
||||
be a huge help.
|
||||
|
||||
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.
|
||||
|
||||
63. The "import" and vendor support commands (co -j) need to be documented
|
||||
better.
|
||||
|
||||
64. Need to greatly increase the performance of an initial checkout.
|
||||
[[ it got better, then we added functionality, making it worse again ]]
|
||||
|
||||
66. Length of the CVS temporary files must be limited to 14 characters for
|
||||
System-V stupid support. As well as the length on the CVS.adm files.
|
||||
|
||||
67. cvs import should populate the vendor sources with CVS.adm files so
|
||||
that one could use the vendor sources directly without having the check
|
||||
them out.
|
||||
|
||||
69. Consider enhacing import to add a module automatically to the module
|
||||
database. Perhaps with a new option, or perhaps with an editor.
|
||||
|
||||
72. Consider re-design of the module -o, -i, -t options to use the file
|
||||
system more intuitively.
|
||||
|
||||
73. Consider an option (in .cvsrc?) to automatically add files that are new
|
||||
and specified to commit.
|
||||
|
||||
76. Consider adding a layer of abstraction so that CVS can work with both
|
||||
RCS and SCCS files. Larry says this should be #ifdef'ed.
|
||||
|
||||
79. Might be nice to have some sort of interface to TFS and tagged
|
||||
revisions.
|
||||
|
||||
82. Maybe the import stuff should allow an arbitrary revision to be
|
||||
specified.
|
||||
|
||||
84. Improve the documentation about administration of the repository and
|
||||
how to add/remove files and the use of symbolic links.
|
||||
|
||||
85. Add revision controlled symbolic links to CVS using one of the tag
|
||||
fields in the RCS file.
|
||||
|
||||
91. Better document the format of the source repository and how one might
|
||||
convert their current SCCS or RCS files into CVS format.
|
||||
|
||||
92. Look into this:
|
||||
After a bit of soul searching via dbx, I realized my sin was that I'd
|
||||
specified "echo" as the program to call from loginfo. The commit
|
||||
procedure worked fine till it hit my echo, then silently aborted
|
||||
leaving the lockfiles intact. Since I needn't use the loginfo
|
||||
facility, I simply removed those commands and it all works.
|
||||
|
||||
93. Need to think hard about release and development environments. Think
|
||||
about execsets as well.
|
||||
|
||||
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.
|
||||
|
||||
100. Checked out files should have revision control support. Maybe.
|
||||
|
||||
102. Perhaps directory modes should be propagated on all import check-ins.
|
||||
Not necessarily uid/gid changes.
|
||||
|
||||
103. setuid/setgid on files is suspect.
|
||||
|
||||
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. 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
|
||||
matches within the RCS file for the symbolic revision. If there is
|
||||
not a match, the next symbolic rev on the list is checked, and so on,
|
||||
until all symbolic revs are exhausted. This would allow one to, say,
|
||||
checkout "4.0" + "4.0.3" + "4.0.3Patch1" + "4.0.3Patch2" to get the
|
||||
most recent 4.x stuff. This is usually handled by just specifying the
|
||||
right release_tag, but most people forget to do this.
|
||||
|
||||
108. If someone creates a whole new directory (i.e. adds it to the cvs
|
||||
repository) and you happen to have a directory in your source farm by
|
||||
the same name, when you do your cvs update -d it SILENTLY does
|
||||
*nothing* to that directory. At least, I think it was silent;
|
||||
certainly, it did *not* abort my cvs update, as it would have if the
|
||||
same thing had happened with a file instead of a directory.
|
||||
|
||||
109. I had gotten pieces of the sys directory in the past but not a
|
||||
complete tree. I just did something like:
|
||||
|
||||
cvs get *
|
||||
|
||||
Where sys was in * and got the message
|
||||
|
||||
cvs get: Executing 'sys/tools/make_links sys'
|
||||
sh: sys/tools/make_links: not found
|
||||
|
||||
I suspect this is because I didn't have the file in question,
|
||||
but I do not understand how I could fool it into getting an
|
||||
error. I think a later cvs get sys seemed to work so perhaps
|
||||
something is amiss in handling multiple arguments to cvs get?
|
||||
|
||||
113. The "cvs update" command should tee its output to a log file in ".".
|
||||
(why? What is wrong with piping stdout to "tee"? -kingdon, Jun 1995)
|
||||
|
||||
119. Consider an option to have import checkout the RCS or SCCS files
|
||||
if necessary.
|
||||
|
||||
122. If Name_Repository fails, it currently causes CVS to die completely. It
|
||||
should instead return NULL and have the caller do something reasonable.
|
||||
|
||||
123. Add a flag to import to not build vendor branches for local code.
|
||||
|
||||
124. Anyway, I thought you might want to add something like the following
|
||||
to the cvs man pages:
|
||||
|
||||
BUGS
|
||||
The sum of the sizes of a module key and its contents are
|
||||
limited. See ndbm(3).
|
||||
|
||||
126. Do an analysis to see if CVS is forgetting to close file descriptors.
|
||||
Especially when committing many files (more than the open file limit
|
||||
for the particular UNIX).
|
||||
|
||||
127. Look at *info files; they should all be quiet if the files are not
|
||||
there. Should be able to point at a RCS directory and go.
|
||||
|
||||
128. When I tag a file, the message tells me that I'm tagging a directory.
|
||||
|
||||
129. Something strange seems to have happened here. When I check this out,
|
||||
the update lines (U CFTS/...) seem to report a bogus leading CFTS
|
||||
(e.g. U CFTS/Medusa_TS/...) when the later files are checked out.
|
||||
|
||||
The directory structure doesn't seem to be botched, just the
|
||||
messages. I don't recall seeing this before.
|
||||
|
||||
130. cvs diff with no -r arguments does not need to look up the current RCS
|
||||
version number since it only cares about what's in the Entries file.
|
||||
This should make it much faster.
|
||||
|
||||
It should ParseEntries itself and access the entries list much like
|
||||
Version_TS does (sticky tags and sticky options may need to be
|
||||
supported here as well). Then it should only diff the things that
|
||||
have the wrong time stamp (the ones that look modified).
|
||||
|
||||
134. Make a statement about using hard NFS mounts to your source
|
||||
repository. Look into checking NULL fgets() returns with ferror() to
|
||||
see if an error had occurred.
|
||||
|
||||
135. The email CVS sends with each checkin, should include the version
|
||||
number of each file it is checking in.
|
||||
[[ Sort of solved by contrib/log.pl, which does a good job of this ]]
|
||||
|
||||
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.
|
||||
Also, along with this, we should look at the places where CVS itself
|
||||
could be a little more synchronous so as not to lose data.
|
||||
[[ I've done some of this, but it could use much more ]]
|
||||
|
||||
138. Some people have suggested that CVS use a VPATH-like environment
|
||||
variable to limit the amount of sources that need to be duplicated for
|
||||
sites with giant source trees and no disk space.
|
||||
|
||||
141. Import should accept modules as its directory argument.
|
||||
|
||||
143. Update the documentation to show that the source repository is
|
||||
something far away from the files that you work on.
|
||||
|
||||
144. Have cvs checkout look for the environment variable CVSPREFIX
|
||||
(or CVSMODPREFIX or some such). If it's set, then when looking
|
||||
up an alias in the modules database, first look it up with the
|
||||
value of CVSPREFIX attached, and then look for the alias itself.
|
||||
This would be useful when you have several projects in a single
|
||||
repository. You could have aliases abc_src and xyz_src and
|
||||
tell people working on project abc to put "setenv CVSPREFIX abc_"
|
||||
in their .cshrc file (or equivalent for other shells).
|
||||
Then they could do "cvs co src" to get a copy of their src
|
||||
directory, not xyz's. (This should create a directory called
|
||||
src, not abc_src.)
|
||||
|
||||
145. After you create revision 1.1.1.1 in the previous scenario, if
|
||||
you do "cvs update -r1 filename" you get revision 1.1, not
|
||||
1.1.1.1. It would be nice to get the later revision. Again,
|
||||
this restriction comes from RCS and is probably hard to
|
||||
change in CVS. Sigh.
|
||||
|
||||
|"cvs update -r1 filename" does not tell RCS to follow any branches. CVS
|
||||
|tries to be consistent with RCS in this fashion, so I would not change
|
||||
|this. Within CVS we do have the flexibility of extending things, like
|
||||
|making a revision of the form "-r1HEAD" find the most recent revision
|
||||
|(branch or not) with a "1." prefix in the RCS file. This would get what
|
||||
|you want maybe.
|
||||
|
||||
This would be very useful. Though I would prefer an option
|
||||
such as "-v1" rather than "-r1HEAD". This option might be
|
||||
used quite often.
|
||||
|
||||
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. (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:
|
||||
Maybe there should be an option to cvs admin that allows a user to
|
||||
change the Repository file with some degree of error checking?
|
||||
Something like "cvs admin reposmv /old/path /new/pretty/path". Before
|
||||
it does the replace it check to see that the files
|
||||
/new/pretty/path/<dir>/<files> exist.
|
||||
|
||||
150. I have a customer request for a way to specify log message per
|
||||
file, non-interactively before the commit, such that a single, fully
|
||||
recursive commit prompts for one commit message, and concatenates the
|
||||
per file messages for each file. In short, one commit, one editor
|
||||
session, log messages allowed to vary across files within the commit.
|
||||
Also, the per file messages should be allowed to be written when the
|
||||
files are changed, which may predate the commit considerably.
|
||||
|
||||
A new command seems appropriate for this. The state can be saved in the
|
||||
CVS directory. I.e.,
|
||||
|
||||
% cvs msg foo.c
|
||||
Enter log message for foo.c
|
||||
>> fixed an uninitialized variable
|
||||
>> ^D
|
||||
|
||||
The text is saved as CVS/foo.c,m (or some such name) and commit is
|
||||
modified to append (prepend?) the text (if found) to the log message
|
||||
specified at commit time. Easy enough.
|
||||
|
||||
151. Also, is there a flag I am missing that allows replacing Ulrtx_Build
|
||||
by Ultrix_build? I.E. I would like a tag replacement to be a one step
|
||||
operation rather than a two step "cvs rtag -r Ulrtx_Build Ultrix_Build"
|
||||
followed by "cvs trag -d Ulrtx_Build"
|
||||
|
||||
152. The "cvs -n" option does not work as one would expect for all the
|
||||
commands. In particular, for "commit" and "import", where one would
|
||||
also like to see what it would do, without actually doing anything.
|
||||
|
||||
153. There should be some command (maybe I just haven't figured
|
||||
out which one...) to import a source directory which is already
|
||||
RCS-administered without losing all prior RCS gathered data. Thus, it
|
||||
would have to examine the RCS files and choose a starting version and
|
||||
branch higher than previous ones used.
|
||||
|
||||
154. When committing the modules file, a pre-commit check should be done to
|
||||
verify the validity of the new modules file before allowing it to be
|
||||
committed.
|
||||
|
||||
155. The options for "cvs history" are mutually exclusive, even though
|
||||
useful queries can be done if they are not, as in specifying both a
|
||||
module and a tag. A workaround is to specify the module, then run the
|
||||
output through grep to only display lines that begin with T, which are
|
||||
tag lines.
|
||||
|
||||
156. Also, how hard would it be to allow continuation lines in the
|
||||
{commit,rcs,log}info files? It would probably be useful with all of
|
||||
the various flags that are now available, or if somebody has a lot of
|
||||
files to put into a module.
|
||||
|
||||
157. The "cvs release" command does not understand about module names with
|
||||
the same flexibility that the "checkout" and "rdiff" commands do.
|
||||
It should, though, since it's confusing right now.
|
||||
|
||||
158. If I do a recursive commit and find that the same RCS file is checked
|
||||
out (and modified!) in two different places within my checked-out
|
||||
files (but within the realm of a single "commit"), CVS will commit the
|
||||
first change, then overwrite that change with the second change. We
|
||||
should catch this (typically unusual) case and issue an appropriate
|
||||
diagnostic and die.
|
||||
|
||||
159. On "update", when a merge is done, CVS should remember that your file
|
||||
was merged into and should keep reminding you of this fact until you
|
||||
actually look at the file (change its access time). Once you do this,
|
||||
it should go back to being a normal, unmodified file. This way, after
|
||||
a big update, you can run update again to see which files just got
|
||||
merged and may need attention.
|
||||
|
||||
160. The checks that the commit command does should be extended to make
|
||||
sure that the revision that we will lock is not already locked by
|
||||
someone else. Maybe it should also lock the new revision if the old
|
||||
revision was already locked by the user as well, thus moving the lock
|
||||
forward after the commit.
|
||||
|
||||
161. The date parser included with CVS (lib/getdate.y) does not support
|
||||
such RCS-supported dates as "1992/03/07". It probably should.
|
||||
|
||||
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 *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
|
||||
file systems. Perhaps import should be a bit more cautious.
|
||||
|
||||
166. There really needs to be a "Getting Started" document which describes
|
||||
some of the new CVS philosophies. Folks coming straight from SCCS or
|
||||
RCS might be confused by "cvs import". Also need to explain:
|
||||
- How one might setup their $CVSROOT
|
||||
- What all the tags mean in an "import" command
|
||||
- Tags are important; revision numbers are not
|
||||
|
||||
167. "cvs log" doesn't understand about CVS magic branch numbers. As such,
|
||||
the command:
|
||||
|
||||
cvs log -r1.63.2
|
||||
cvs log -rC2
|
||||
|
||||
where "C2" is a magic branch that resolves to 1.63.2 do not print the
|
||||
same things. Sigh.
|
||||
|
||||
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
|
||||
archive library with an API. This enhancement would go nicely with the
|
||||
notion of being able to integrate tools into a large software engineering
|
||||
environment.
|
||||
|
||||
170. Is there an "info" file that can be invoked when a file is checked out, or
|
||||
updated ? What I want to do is to advise users, particularly novices, of
|
||||
the state of their working source whenever they check something out, as
|
||||
a sanity check.
|
||||
|
||||
For example, I've written a perl script which tells you what branch you're
|
||||
on, if any. Hopefully this will help guard against mistaken checkins to
|
||||
the trunk, or to the wrong branch. I suppose I can do this in
|
||||
"commitinfo", but it'd be nice to advise people before they edit their
|
||||
files.
|
||||
|
||||
It would also be nice if there was some sort of "verboseness" switch to
|
||||
the checkout and update commands that could turn this invocation of the
|
||||
script off, for mature users.
|
||||
|
||||
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
|
||||
can't. It looks like I can only specify the date for the main line (as
|
||||
opposed to any branches). True? Any workarounds to get what I need?
|
||||
|
||||
174. I would like to see "cvs release" modified so that it only removes files
|
||||
which are known to CVS - all the files in the repository, plus those which
|
||||
are listed in .cvsignore. This way, if you do leave something valuable in
|
||||
a source tree you can "cvs release -d" the tree and your non-CVS goodies
|
||||
are still there. If a user is going to leave non-CVS files in their source
|
||||
trees, they really should have to clean them up by hand.
|
||||
|
||||
175. And, in the feature request department, I'd dearly love a command-line
|
||||
interface to adding a new module to the CVSROOT/modules file.
|
||||
|
||||
176. If you use the -i flag in the modules file, you can control access
|
||||
to source code; this is a Good Thing under certain circumstances. I
|
||||
just had a nasty thought, and on experiment discovered that the
|
||||
filter specified by -i is _not_ run before a cvs admin command; as
|
||||
this allows a user to go behind cvs's back and delete information
|
||||
(cvs admin -o1.4 file) this seems like a serious problem.
|
||||
|
||||
177. We've got some external vendor source that sits under a source code
|
||||
hierarchy, and when we do a cvs update, it gets wiped out because
|
||||
its tag is different from the "main" distribution. I've tried to
|
||||
use "-I" to ignore the directory, as well as .cvsignore, but this
|
||||
doesn't work.
|
||||
|
||||
179. "cvs admin" does not log its actions with loginfo, nor does it check
|
||||
whether the action is allowed with commitinfo. It should.
|
12
contrib/cvs/acconfig.h
Normal file
12
contrib/cvs/acconfig.h
Normal file
@ -0,0 +1,12 @@
|
||||
/* 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. */
|
||||
#undef CLIENT_SUPPORT
|
||||
|
||||
/* Define if you want CVS to be able to serve repositories to remote
|
||||
clients. */
|
||||
#undef SERVER_SUPPORT
|
||||
|
||||
/* Define if you want to use the password authenticated server. */
|
||||
#undef AUTH_SERVER_SUPPORT
|
210
contrib/cvs/config.h.in
Normal file
210
contrib/cvs/config.h.in
Normal file
@ -0,0 +1,210 @@
|
||||
/* 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 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
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#undef gid_t
|
||||
|
||||
/* Define if you support file names longer than 14 characters. */
|
||||
#undef HAVE_LONG_FILE_NAMES
|
||||
|
||||
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
|
||||
#undef HAVE_SYS_WAIT_H
|
||||
|
||||
/* Define if utime(file, NULL) sets file's timestamp to the present. */
|
||||
#undef HAVE_UTIME_NULL
|
||||
|
||||
/* 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
|
||||
|
||||
/* Define if you need to in order for stat and other things to work. */
|
||||
#undef _POSIX_SOURCE
|
||||
|
||||
/* Define as the return type of signal handlers (int or void). */
|
||||
#undef RETSIGTYPE
|
||||
|
||||
/* Define to `unsigned' if <sys/types.h> doesn't define. */
|
||||
#undef size_t
|
||||
|
||||
/* 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. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Define if you can safely include both <sys/time.h> and <time.h>. */
|
||||
#undef TIME_WITH_SYS_TIME
|
||||
|
||||
/* 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. */
|
||||
#undef CLIENT_SUPPORT
|
||||
|
||||
/* Define if you want CVS to be able to serve repositories to remote
|
||||
clients. */
|
||||
#undef SERVER_SUPPORT
|
||||
|
||||
/* Define if you want to use the password authenticated server. */
|
||||
#undef AUTH_SERVER_SUPPORT
|
||||
|
||||
/* The number of bytes in a int. */
|
||||
#undef SIZEOF_INT
|
||||
|
||||
/* The number of bytes in a long. */
|
||||
#undef SIZEOF_LONG
|
||||
|
||||
/* Define if you have the connect function. */
|
||||
#undef HAVE_CONNECT
|
||||
|
||||
/* Define if you have the fchdir function. */
|
||||
#undef HAVE_FCHDIR
|
||||
|
||||
/* Define if you have the fchmod function. */
|
||||
#undef HAVE_FCHMOD
|
||||
|
||||
/* Define if you have the fsync function. */
|
||||
#undef HAVE_FSYNC
|
||||
|
||||
/* Define if you have the ftime function. */
|
||||
#undef HAVE_FTIME
|
||||
|
||||
/* Define if you have the ftruncate function. */
|
||||
#undef HAVE_FTRUNCATE
|
||||
|
||||
/* Define if you have the getpagesize function. */
|
||||
#undef HAVE_GETPAGESIZE
|
||||
|
||||
/* Define if you have the krb_get_err_text function. */
|
||||
#undef HAVE_KRB_GET_ERR_TEXT
|
||||
|
||||
/* Define if you have the mkfifo function. */
|
||||
#undef HAVE_MKFIFO
|
||||
|
||||
/* Define if you have the putenv function. */
|
||||
#undef HAVE_PUTENV
|
||||
|
||||
/* Define if you have the setvbuf function. */
|
||||
#undef HAVE_SETVBUF
|
||||
|
||||
/* Define if you have the sigaction function. */
|
||||
#undef HAVE_SIGACTION
|
||||
|
||||
/* Define if you have the sigblock function. */
|
||||
#undef HAVE_SIGBLOCK
|
||||
|
||||
/* Define if you have the sigprocmask function. */
|
||||
#undef HAVE_SIGPROCMASK
|
||||
|
||||
/* Define if you have the sigsetmask function. */
|
||||
#undef HAVE_SIGSETMASK
|
||||
|
||||
/* Define if you have the sigvec function. */
|
||||
#undef HAVE_SIGVEC
|
||||
|
||||
/* Define if you have the timezone function. */
|
||||
#undef HAVE_TIMEZONE
|
||||
|
||||
/* Define if you have the vfork function. */
|
||||
#undef HAVE_VFORK
|
||||
|
||||
/* Define if you have the vprintf function. */
|
||||
#undef HAVE_VPRINTF
|
||||
|
||||
/* Define if you have the <direct.h> header file. */
|
||||
#undef HAVE_DIRECT_H
|
||||
|
||||
/* Define if you have the <dirent.h> header file. */
|
||||
#undef HAVE_DIRENT_H
|
||||
|
||||
/* Define if you have the <errno.h> header file. */
|
||||
#undef HAVE_ERRNO_H
|
||||
|
||||
/* Define if you have the <fcntl.h> header file. */
|
||||
#undef HAVE_FCNTL_H
|
||||
|
||||
/* Define if you have the <io.h> header file. */
|
||||
#undef HAVE_IO_H
|
||||
|
||||
/* Define if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* Define if you have the <ndbm.h> header file. */
|
||||
#undef HAVE_NDBM_H
|
||||
|
||||
/* Define if you have the <ndir.h> header file. */
|
||||
#undef HAVE_NDIR_H
|
||||
|
||||
/* Define if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
|
||||
/* 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. */
|
||||
#undef HAVE_SYS_PARAM_H
|
||||
|
||||
/* Define if you have the <sys/resource.h> header file. */
|
||||
#undef HAVE_SYS_RESOURCE_H
|
||||
|
||||
/* Define if you have the <sys/select.h> header file. */
|
||||
#undef HAVE_SYS_SELECT_H
|
||||
|
||||
/* Define if you have the <sys/time.h> header file. */
|
||||
#undef HAVE_SYS_TIME_H
|
||||
|
||||
/* Define if you have the <sys/timeb.h> header file. */
|
||||
#undef HAVE_SYS_TIMEB_H
|
||||
|
||||
/* Define if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define if you have the <utime.h> header file. */
|
||||
#undef HAVE_UTIME_H
|
||||
|
||||
/* Define if you have the 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
|
3186
contrib/cvs/configure
vendored
Executable file
3186
contrib/cvs/configure
vendored
Executable file
File diff suppressed because it is too large
Load Diff
191
contrib/cvs/configure.in
Normal file
191
contrib/cvs/configure.in
Normal file
@ -0,0 +1,191 @@
|
||||
dnl configure.in for cvs
|
||||
dnl "$CVSid$"
|
||||
AC_INIT(src/cvs.h)
|
||||
AC_PREREQ(2.4)dnl Required Autoconf version.
|
||||
AC_CONFIG_HEADER(config.h src/options.h)
|
||||
|
||||
AC_PROG_CC
|
||||
|
||||
AC_AIX
|
||||
AC_MINIX
|
||||
AC_ISC_POSIX
|
||||
if test "$ISC" = yes; then
|
||||
CFLAGS="$CFLAGS -D_SYSV3"
|
||||
fi
|
||||
|
||||
AC_PREFIX_PROGRAM(cvs)
|
||||
|
||||
AC_C_CROSS
|
||||
|
||||
AC_C_CONST
|
||||
AC_C_CHAR_UNSIGNED
|
||||
AC_C_INLINE
|
||||
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_RANLIB
|
||||
AC_PROG_YACC
|
||||
AC_PROG_MAKE_SET
|
||||
|
||||
AC_PATH_PROG(perl_path, perl, no)
|
||||
AC_PATH_PROG(csh_path, csh, no)
|
||||
|
||||
AC_SYS_INTERPRETER
|
||||
if test X"$ac_cv_sys_interpreter" != X"yes" ; then
|
||||
# silly trick to avoid problems in AC macros...
|
||||
ac_msg='perl scripts using #! may not be invoked properly'
|
||||
AC_MSG_WARN($ac_msg)
|
||||
fi
|
||||
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS(errno.h unistd.h string.h memory.h utime.h fcntl.h ndbm.h \
|
||||
sys/param.h sys/select.h sys/time.h sys/timeb.h \
|
||||
io.h direct.h sys/bsdtypes.h sys/resource.h)
|
||||
AC_HEADER_SYS_WAIT
|
||||
AC_HEADER_STAT
|
||||
AC_HEADER_TIME
|
||||
AC_HEADER_DIRENT
|
||||
AC_TYPE_SIGNAL
|
||||
AC_TYPE_UID_T
|
||||
AC_TYPE_MODE_T
|
||||
AC_TYPE_SIZE_T
|
||||
AC_TYPE_PID_T
|
||||
AC_REPLACE_FUNCS(getwd mkdir rename strdup strstr dup2 strerror valloc waitpid memmove vasprintf strtoul)
|
||||
AC_CHECK_FUNCS(fchmod fsync ftime mkfifo putenv setvbuf vfork vprintf ftruncate timezone getpagesize initgroups fchdir sigaction sigprocmask sigvec sigsetmask sigblock)
|
||||
AC_CHECK_FUNC(re_exec, :, LIBOBJS="$LIBOBJS regex.o")
|
||||
AC_FUNC_UTIME_NULL
|
||||
AC_SYS_LONG_FILE_NAMES
|
||||
|
||||
AC_MSG_CHECKING([for working fnmatch function])
|
||||
AC_CACHE_VAL(ccvs_cv_sys_working_fnmatch,
|
||||
[AC_TRY_RUN([
|
||||
#include <fnmatch.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
exit ((fnmatch ("a", "a", FNM_PATHNAME) == 0
|
||||
&& fnmatch ("a", "b", FNM_PATHNAME) == FNM_NOMATCH)
|
||||
? 0 : 1);
|
||||
}],
|
||||
ccvs_cv_sys_working_fnmatch=yes,
|
||||
ccvs_cv_sys_working_fnmatch=no,
|
||||
ccvs_cv_sys_working_fnmatch=no)])
|
||||
if test $ccvs_cv_sys_working_fnmatch = no; then
|
||||
LIBOBJS="$LIBOBJS fnmatch.o"
|
||||
fi
|
||||
AC_MSG_RESULT($ccvs_cv_sys_working_fnmatch)
|
||||
|
||||
dnl
|
||||
dnl set $(KRB4) from --with-krb4=value -- WITH_KRB4
|
||||
dnl
|
||||
KRB4=/usr/kerberos
|
||||
define(WITH_KRB4,[
|
||||
AC_ARG_WITH([krb4],
|
||||
[ --with-krb4=value set default \$(KRB4) from value],
|
||||
[KRB4=$withval],
|
||||
)dnl
|
||||
echo "default place for krb4 is $KRB4"
|
||||
AC_SUBST(KRB4)])dnl
|
||||
WITH_KRB4
|
||||
|
||||
AC_CHECK_SIZEOF(long)
|
||||
AC_CHECK_SIZEOF(int)
|
||||
|
||||
krb_h=
|
||||
AC_MSG_CHECKING([for krb.h])
|
||||
AC_TRY_LINK([#include <krb.h>],[int i;],
|
||||
[krb_h=yes krb_incdir=],
|
||||
[if test "$cross_compiling" != yes && test -r $KRB4/include/krb.h; then
|
||||
hold_cflags=$CFLAGS
|
||||
CFLAGS="$CFLAGS -I$KRB4/include"
|
||||
AC_TRY_LINK([#include <krb.h>],[int i;],
|
||||
[krb_h=yes krb_incdir=$KRB4/include])
|
||||
CFLAGS=$hold_cflags
|
||||
fi])
|
||||
if test -z "$krb_h"; then
|
||||
AC_TRY_LINK([#include <krb.h>],[int i;],
|
||||
[krb_h=yes krb_incdir=],
|
||||
[if test "$cross_compiling" != yes && test -r $KRB4/include/kerberosIV/krb.h; then
|
||||
hold_cflags=$CFLAGS
|
||||
CFLAGS="$CFLAGS -I$KRB4/include/kerberosIV"
|
||||
AC_TRY_LINK([#include <krb.h>],[int i;],
|
||||
[krb_h=yes krb_incdir=$KRB4/include/kerberosIV])
|
||||
CFLAGS=$hold_cflags
|
||||
fi])
|
||||
fi
|
||||
AC_MSG_RESULT($krb_h)
|
||||
|
||||
if test -n "$krb_h"; then
|
||||
krb_lib=
|
||||
AC_CHECK_LIB(krb,printf,[krb_lib=yes krb_libdir=],
|
||||
[if test "$cross_compiling" != yes && test -r $KRB4/lib/libkrb.a; then
|
||||
krb_lib=yes krb_libdir=$KRB4/lib
|
||||
fi])
|
||||
if test -n "$krb_lib"; then
|
||||
AC_DEFINE(HAVE_KERBEROS)
|
||||
test -n "${krb_libdir}" && LIBS="${LIBS} -L${krb_libdir}"
|
||||
LIBS="${LIBS} -lkrb"
|
||||
AC_CHECK_LIB(des,printf,[LIBS="${LIBS} -ldes"])
|
||||
if test -n "$krb_incdir"; then
|
||||
includeopt="${includeopt} -I$krb_incdir"
|
||||
AC_SUBST(includeopt)
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
AC_CHECK_FUNCS(krb_get_err_text)
|
||||
# If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
|
||||
# The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has
|
||||
# libsocket.so which has a bad implementation of gethostbyname (it
|
||||
# only looks in /etc/hosts), so we only look for -lsocket if we need
|
||||
# it.
|
||||
unset ac_cv_func_connect
|
||||
AC_CHECK_FUNC(connect, :,
|
||||
[case "$LIBS" in
|
||||
*-lnsl*) ;;
|
||||
*) AC_CHECK_LIB(nsl_s, printf) ;;
|
||||
esac
|
||||
case "$LIBS" in
|
||||
*-lnsl*) ;;
|
||||
*) AC_CHECK_LIB(nsl, printf) ;;
|
||||
esac
|
||||
case "$LIBS" in
|
||||
*-lsocket*) ;;
|
||||
*) AC_CHECK_LIB(socket, connect) ;;
|
||||
esac
|
||||
case "$LIBS" in
|
||||
*-linet*) ;;
|
||||
*) AC_CHECK_LIB(inet, connect) ;;
|
||||
esac
|
||||
unset ac_cv_func_connect
|
||||
AC_CHECK_FUNCS(connect)])
|
||||
|
||||
AC_CHECK_FUNC(gethostname, :, LIBOBJS="$LIBOBJS hostname.o")
|
||||
|
||||
# If we have connect(), we want the full client & server arrangement.
|
||||
if test "$ac_cv_func_connect" = yes; then
|
||||
AC_DEFINE(CLIENT_SUPPORT)
|
||||
AC_DEFINE(SERVER_SUPPORT)
|
||||
# Define AUTH_SERVER_SUPPORT only if we could locate the crypt() function
|
||||
unset ac_cv_func_crypt
|
||||
AC_CHECK_FUNC(crypt, :,
|
||||
[case "$LIBS" in
|
||||
*-lcrypt*) ;;
|
||||
*) AC_CHECK_LIB(crypt, crypt) ;;
|
||||
esac
|
||||
unset ac_cv_func_crypt
|
||||
AC_CHECK_FUNCS(crypt)])
|
||||
if test "$ac_cv_func_crypt" = yes; then
|
||||
AC_DEFINE(AUTH_SERVER_SUPPORT)
|
||||
fi
|
||||
fi
|
||||
|
||||
test -f src/options.h && (
|
||||
AC_MSG_WARN(saving ./src/options.h in ./src/options.h-SAVED)
|
||||
AC_MSG_WARN(You may wish to check that local options have not been lost.)
|
||||
AC_MSG_WARN(Do not re-run ./configure or ./config.status until you have....)
|
||||
cp ./src/options.h ./src/options.h-SAVED
|
||||
)
|
||||
|
||||
AC_OUTPUT(Makefile lib/Makefile src/Makefile doc/Makefile \
|
||||
man/Makefile tools/Makefile tools/pcl-cvs/Makefile \
|
||||
contrib/Makefile contrib/elib/Makefile \
|
||||
windows-NT/Makefile os2/Makefile macintosh/Makefile stamp-h)
|
193
contrib/cvs/contrib/ChangeLog
Normal file
193
contrib/cvs/contrib/ChangeLog
Normal file
@ -0,0 +1,193 @@
|
||||
Sun Apr 14 11:30:36 1996 Karl Fogel <kfogel@floss.red-bean.com>
|
||||
|
||||
* Removed pcl-cvs/ subdir; see tools/ subdir in the top-level from
|
||||
now on.
|
||||
Added elib/ subdir.
|
||||
|
||||
* Makefile.in (dist-dir): Removed all references to pcl-cvs/
|
||||
subdir.
|
||||
|
||||
Wed Mar 6 10:20:28 1996 Greg A. Woods <woods@most.weird.com>
|
||||
|
||||
* log_accum.pl: ($MAILER): use sendmail directly to allow other
|
||||
headers to be included
|
||||
* log_accum.pl (mail_notification): add support to allow settting
|
||||
of Reply-To and Date header fields in the sent mail; remove $mailto
|
||||
argument and use the global variable (as with $replyto).
|
||||
* log_accum.pl: add -R option for mail_notification()'s optional
|
||||
Reply-To value [default to $login]
|
||||
|
||||
Fri Mar 1 01:51:56 1996 Benjamin J. Lee <benjamin@cyclic.com>
|
||||
|
||||
* listener.c: added as mentioned in ../README.VMS
|
||||
|
||||
Mon Feb 19 13:37:36 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* README: Don't just tell people "we don't want your script"; tell
|
||||
them what to do instead.
|
||||
|
||||
Thu Feb 1 14:28:16 1996 Karl Fogel <kfogel@floss.red-bean.com>
|
||||
|
||||
* Makefile.in (DISTFILES): added `rcs2sccs.sh', as mentioned in
|
||||
README.
|
||||
|
||||
Thu Jan 18 09:39:16 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* README: Talk about submitting changes to contrib directory.
|
||||
|
||||
Tue Nov 14 15:28:25 1995 Greg A. Woods <woods@most.weird.com>
|
||||
|
||||
* README: fix some spelling and other typos
|
||||
|
||||
* Makefile.in: if I need reminding to run cvsinit....
|
||||
|
||||
Tue Nov 14 13:47:40 1995 Greg A. Woods <woods@most.weird.com>
|
||||
|
||||
* log_accum.pl:
|
||||
- Fix 'cvs status' to use global -Qq options
|
||||
- fix up a couple of comments, incl., my proper address
|
||||
|
||||
* log.pl: add a CVSid and fix a couple of comments
|
||||
|
||||
Sun Oct 1 02:02:57 1995 Peter Wemm <peter@haywire.dialix.com>
|
||||
|
||||
* Makefile.in: supply a suffix rule to deal with .sh "source"
|
||||
|
||||
Sat Jul 29 17:29:13 1995 James Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* log.pl: Use global options -Qq, not command options -Qq.
|
||||
|
||||
* Makefile.in (install): Look for $(PROGS) and
|
||||
$(CONTRIB_PROGS) in build dir, not srcdir.
|
||||
|
||||
Fri Jul 28 19:48:45 1995 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* rcs2log.sh: Sync with latest Emacs snapshot.
|
||||
|
||||
Thu Jul 27 20:29:30 1995 Jim Blandy <jimb@totoro.cyclic.com>
|
||||
|
||||
* rcs2log.sh: import of initial WNT port work
|
||||
|
||||
Fri Jul 14 22:38:44 1995 Jim Blandy <jimb@totoro.cyclic.com>
|
||||
|
||||
* rcs-to-cvs.sh: Changes from David J. Mackenzie.
|
||||
Set permissions on new repository files correctly.
|
||||
Ignore *~ files.
|
||||
|
||||
Thu Jul 13 23:04:12 CDT 1995 Jim Meyering (meyering@comco.com)
|
||||
|
||||
* Makefile.in (.pl, .csh): *Never* redirect output directly to
|
||||
the target (usu $@) of a rule. Instead, redirect to a temporary
|
||||
file, and then move that temporary to the target. I chose to
|
||||
name temporary files $@-t. Remember to be careful that the length
|
||||
of the temporary file name not exceed the 14-character limit.
|
||||
|
||||
Sun Jul 9 21:16:53 1995 Karl Fogel <kfogel@floss.cyclic.com>
|
||||
|
||||
These are actually Greg Woods' changes:
|
||||
|
||||
* clmerge.pl, cvscheck.sh, descend.sh, dirfns.shar, rcs-to-cvs.sh,
|
||||
rcs2log.sh, sccs2rcs.csh: renamed from the corresponding files
|
||||
sans extensions.
|
||||
|
||||
* rcs2sccs.sh: new file.
|
||||
|
||||
Sun Jul 9 19:03:00 1995 Greg A. Woods <woods@most.weird.com>
|
||||
|
||||
* rcs2log.sh: oops, one more thing that should not have been
|
||||
there.
|
||||
- fix interpreter file syntax.
|
||||
- remove "fix" for separating filenames and comments
|
||||
|
||||
* Makefile.in: hmm... thought rcs2log was in RCS-5.7 for some
|
||||
reason -- it's not, so we'll install it from here....
|
||||
- fix typo -- that's what you get for re-doing changes by hand!
|
||||
- updates to support proper transformation and installation of
|
||||
renamed files (from previous local changes)
|
||||
|
||||
* .cvsignore: one more target noted...
|
||||
|
||||
* sccs2rcs.csh: set up the interpreter file for updating by
|
||||
Makefile (from previous local changes)
|
||||
|
||||
* log_accum.pl, log.pl, commit_prep.pl:
|
||||
- set up the interpreter file for updating by Makefile
|
||||
- various modifications, updates, and enhancements
|
||||
(from previous local changes)
|
||||
|
||||
* rcslock.pl, mfpipe.pl, cvs_acls.pl, cln_hist.pl, clmerge.pl:
|
||||
- set up the interpreter file for updating by Makefile
|
||||
(from previous local changes)
|
||||
- include changes from 1.5 here too, if any
|
||||
|
||||
* README:
|
||||
- remove extensions from filenames to match installed names
|
||||
(from previous local changes)
|
||||
|
||||
* .cvsignore: - added $(CONTRIB_PROGS) (from previous local changes)
|
||||
|
||||
|
||||
Thu Jun 29 10:43:07 1995 James Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* Makefile.in (distclean): Also remove pcl-cvs/Makefile.
|
||||
|
||||
Thu Jun 8 15:32:29 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
|
||||
|
||||
* intro.doc: Added.
|
||||
* Makefile.in (DISTFILES): Add intro.doc.
|
||||
|
||||
Sat May 27 08:46:00 1995 Jim Meyering (meyering@comco.com)
|
||||
|
||||
* Makefile.in (Makefile): Regenerate only Makefile in current
|
||||
directory when Makefile.in is out of date. Depend on ../config.status.
|
||||
|
||||
Mon May 8 13:06:29 1995 Bryan O'Sullivan <bos@serpentine.com>
|
||||
|
||||
* README: added an entry for ccvs-rsh.pl.
|
||||
|
||||
Sun Apr 30 23:50:32 1995 Bryan O'Sullivan <bos@serpentine.com>
|
||||
|
||||
* ccvs-rsh.pl: fixed a typo and added more flexible use of
|
||||
CVS_PROXY_USER.
|
||||
|
||||
Sun Apr 30 14:56:21 1995 Jim Blandy <jimb@totoro.bio.indiana.edu>
|
||||
|
||||
* clmerge: Changes from Tom Tromey --- fix bug in date comparison
|
||||
function.
|
||||
|
||||
Sat Apr 29 20:53:08 1995 Bryan O'Sullivan <bos@serpentine.com>
|
||||
|
||||
* ccvs-rsh.pl: created. See the file itself for documentation.
|
||||
|
||||
* Makefile.in (DISTFILES): added ccvs-rsh.pl to the list of
|
||||
files to install.
|
||||
|
||||
Fri Apr 28 22:32:45 1995 Jim Blandy <jimb@totoro.bio.indiana.edu>
|
||||
|
||||
* Makefile.in (DISTFILES): Brought up-to-date with current
|
||||
directory contents.
|
||||
(dist-dir): Renamed from dist-dir; use DISTDIR variable, passed
|
||||
from parent.
|
||||
|
||||
Mon Feb 13 13:32:07 1995 Jim Blandy <jimb@totoro.bio.indiana.edu>
|
||||
|
||||
* rcs2log: rcs2log was originally in this tree; how did it get
|
||||
deleted? Anyway, this is the version distributed with Emacs
|
||||
19.28, hacked to support CVS and Remote CVS.
|
||||
|
||||
Mon Jul 26 13:18:23 1993 David J. Mackenzie (djm@thepub.cygnus.com)
|
||||
|
||||
* rcs-to-cvs: Rewrite in sh.
|
||||
|
||||
Wed Jul 14 21:16:40 1993 David J. Mackenzie (djm@thepub.cygnus.com)
|
||||
|
||||
* rcs-to-cvs: Don't source .cshrc or hardcode paths.
|
||||
Make respository dir if needed. Don't suppress errors
|
||||
(such as prompts) from co.
|
||||
|
||||
Wed Feb 26 18:04:40 1992 K. Richard Pixley (rich@cygnus.com)
|
||||
|
||||
* Makefile.in, configure.in: removed traces of namesubdir,
|
||||
-subdirs, $(subdir), $(unsubdir), some rcs triggers. Forced
|
||||
copyrights to '92, changed some from Cygnus to FSF.
|
||||
|
134
contrib/cvs/contrib/Makefile.in
Normal file
134
contrib/cvs/contrib/Makefile.in
Normal file
@ -0,0 +1,134 @@
|
||||
# Makefile for GNU CVS contributed sources.
|
||||
# Do not use this makefile directly, but only from `../Makefile'.
|
||||
# Copyright (C) 1986, 1988-1990 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
# $CVSid: @(#)Makefile.in 1.6 94/10/22 $
|
||||
|
||||
SHELL = /bin/sh
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
# Where to install the executables.
|
||||
bindir = $(exec_prefix)/bin
|
||||
|
||||
# Where to put the system-wide .cvsrc file
|
||||
libdir = $(prefix)/lib
|
||||
|
||||
# Where to put the manual pages.
|
||||
mandir = $(prefix)/man
|
||||
|
||||
# where to find command interpreters
|
||||
perl_path = @perl_path@
|
||||
csh_path = @csh_path@
|
||||
|
||||
# Use cp if you don't have install.
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
|
||||
DISTFILES = \
|
||||
ChangeLog README .cvsignore intro.doc \
|
||||
Makefile.in clmerge.pl cln_hist.pl commit_prep.pl cvs_acls.pl \
|
||||
cvscheck.sh cvscheck.man cvshelp.man descend.sh descend.man \
|
||||
dirfns.shar log.pl log_accum.pl mfpipe.pl rcs-to-cvs.sh rcs2log.sh \
|
||||
rcslock.pl sccs2rcs.csh rcs2sccs.sh
|
||||
|
||||
# files installed in $(libdir)/cvs/contrib
|
||||
#
|
||||
CONTRIB_FILES = README intro.doc cvscheck.man
|
||||
|
||||
# things we actually build and install....
|
||||
#
|
||||
PROGS = rcs2log
|
||||
CONTRIB_PROGS = clmerge cln_hist commit_prep cvs_acls cvscheck log log_accum \
|
||||
mfpipe rcs-to-cvs rcs2log rcslock sccs2rcs
|
||||
|
||||
.SUFFIXES: .pl .sh .csh
|
||||
|
||||
.pl:
|
||||
rm -f $@
|
||||
sed -e 's,xPERL_PATHx,$(perl_path),' $< > $@-t
|
||||
mv $@-t $@
|
||||
chmod +x $@
|
||||
|
||||
.csh:
|
||||
rm -f $@
|
||||
sed -e 's,xCSH_PATHx,$(csh_path),' $< > $@-t
|
||||
mv $@-t $@
|
||||
chmod +x $@
|
||||
|
||||
.sh:
|
||||
rm -f $@
|
||||
cp $< $@
|
||||
chmod +x $@
|
||||
|
||||
all: Makefile $(PROGS) $(CONTRIB_PROGS)
|
||||
.PHONY: all
|
||||
|
||||
install: all $(libdir)/cvs/contrib
|
||||
for f in $(CONTRIB_FILES) ; do\
|
||||
$(INSTALL_DATA) $(srcdir)/$$f $(libdir)/cvs/contrib/$$f; \
|
||||
done
|
||||
for f in $(CONTRIB_PROGS) ; do\
|
||||
$(INSTALL_PROGRAM) $$f $(libdir)/cvs/contrib/$$f; \
|
||||
done
|
||||
for f in $(PROGS) ; do\
|
||||
$(INSTALL_PROGRAM) $$f $(bindir)/$$f; \
|
||||
done
|
||||
@echo "You might consider running 'cvsinit' to upgrade your repository(s)...."
|
||||
.PHONY: install
|
||||
|
||||
$(libdir)/cvs/contrib:
|
||||
$(top_srcdir)/mkinstalldirs $(libdir)/cvs/contrib
|
||||
|
||||
tags:
|
||||
.PHONY: tags
|
||||
|
||||
TAGS:
|
||||
.PHONY: TAGS
|
||||
|
||||
ls:
|
||||
@echo $(DISTFILES)
|
||||
.PHONY: ls
|
||||
|
||||
clean:
|
||||
/bin/rm -f *.o core
|
||||
.PHONY: clean
|
||||
|
||||
distclean: clean
|
||||
rm -f Makefile elib/Makefile $(PROGS) $(CONTRIB_PROGS)
|
||||
.PHONY: distclean
|
||||
|
||||
realclean: distclean
|
||||
.PHONY: realclean
|
||||
|
||||
dist-dir:
|
||||
mkdir ${DISTDIR}
|
||||
for i in ${DISTFILES}; do \
|
||||
ln $(srcdir)/$${i} ${DISTDIR}; \
|
||||
done
|
||||
cd elib; ${MAKE} dist-dir DISTDIR="../${DISTDIR}/elib"
|
||||
.PHONY: dist-dir
|
||||
|
||||
subdir = contrib
|
||||
Makefile: ../config.status Makefile.in
|
||||
cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
|
106
contrib/cvs/contrib/README
Normal file
106
contrib/cvs/contrib/README
Normal file
@ -0,0 +1,106 @@
|
||||
$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 README file will be kept
|
||||
up-to-date from release to release. BUT, I must point out that these
|
||||
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
|
||||
a reply. USE AT YOUR OWN RISK -- and all that stuff.
|
||||
|
||||
"Unsupported" also means that noone has volunteered to accept and
|
||||
check in changes to this directory. So submissions for new scripts to
|
||||
add here are unlikely to be accepted. Suggested changes to the
|
||||
existing scripts here conceivably might, but that isn't clear either.
|
||||
The exception is pcl-cvs; that is more actively maintained (see
|
||||
pcl-cvs/README). If you have some software that works with CVS that
|
||||
you wish to offer it is suggested that you make it available by FTP or
|
||||
HTTP and then announce it on the info-cvs mailing list. There is also
|
||||
a web page of software related to CVS at
|
||||
http://www.loria.fr/~molli/cvs-index.html which would presumably be
|
||||
willing to list your software.
|
||||
|
||||
Contents of this directory:
|
||||
|
||||
README This file.
|
||||
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.
|
||||
Contributed by Kevin Samborn <samborn@sunrise.com>.
|
||||
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 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.
|
||||
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 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>.
|
||||
rcs-to-cvs Script to import sources that may have been under
|
||||
RCS control already.
|
||||
Contributed by Per Cederqvist <ceder@lysator.liu.se>.
|
||||
cvscheck Identifies files added, changed, or removed in a
|
||||
cvscheck.man checked out CVS tree; also notices unknown files.
|
||||
Contributed by Lowell Skoog <fluke!lowell@uunet.uu.net>
|
||||
cvshelp.man An introductory manual page written by Lowell Skoog
|
||||
<fluke!lowell@uunet.uu.net>. It is most likely
|
||||
out-of-date relative to CVS 1.3, but still may be
|
||||
useful.
|
||||
dirfns A shar file which contains some code that might
|
||||
help your system support opendir/readdir/closedir,
|
||||
if it does not already.
|
||||
Copied from the C-News distribution.
|
||||
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>.
|
||||
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>.
|
||||
descend A shell script that can be used to recursively
|
||||
descend.man descend through a directory. In CVS 1.2, this was
|
||||
very useful, since many of the commands were not
|
||||
recursive. In CVS 1.3 (and later), however, most of
|
||||
the commands are recursive. However, this may still
|
||||
come in handy.
|
||||
Contributed by Lowell Skoog <fluke!lowell@uunet.uu.net>
|
||||
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>
|
||||
sccs2rcs A C-shell script that can convert (some) SCCS files
|
||||
into RCS files, retaining the info contained in the
|
||||
SCCS file (like dates, author, and log message).
|
||||
Contributed by Ken Cox <kenstir@viewlogic.com>.
|
||||
intro.doc A user's view of what you need to know to get
|
||||
started with CVS.
|
||||
Contributed by <Steven.Pemberton@cwi.nl>.
|
||||
rcs2sccs A shell script to convert simple RCS files into
|
||||
SCCS files, originally gleaned off the network
|
||||
somewhere (originally by "kenc") and modified by
|
||||
Jerry Jelinek <jerry@rmtc.Central.Sun.COM> and
|
||||
Brian Berliner <berliner@sun.com> to increase
|
||||
robustness and add support for one-level of branches.
|
||||
rcs2log A shell script to create a ChangeLog-format file
|
||||
given only a set of RCS files.
|
||||
Contributed by Paul Eggert <eggert@twinsun.com>.
|
||||
clmerge A perl script to handle merge conflicts in GNU
|
||||
style ChangeLog files .
|
||||
Contributed by Tom Tromey <tromey@busco.lanl.gov>.
|
||||
listener A program which listens to a TCP port, authenticates
|
||||
by hostname, then runs a subprocess whose input/output
|
||||
is redirected through the port.
|
||||
Contributed by Benjamin J. Lee <benjamin@cyclic.com>
|
152
contrib/cvs/contrib/clmerge.pl
Normal file
152
contrib/cvs/contrib/clmerge.pl
Normal file
@ -0,0 +1,152 @@
|
||||
#! xPERL_PATHx
|
||||
|
||||
# Merge conflicted ChangeLogs
|
||||
# tromey Mon Aug 15 1994
|
||||
|
||||
# Usage is:
|
||||
#
|
||||
# cl-merge [-i] file ...
|
||||
#
|
||||
# With -i, it works in place (backups put in a ~ file). Otherwise the
|
||||
# merged ChangeLog is printed to stdout.
|
||||
|
||||
# Please report any bugs to me. I wrote this yesterday, so there are no
|
||||
# guarantees about its performance. I recommend checking its output
|
||||
# carefully. If you do send a bug report, please include the failing
|
||||
# ChangeLog, so I can include it in my test suite.
|
||||
#
|
||||
# Tom
|
||||
# ---
|
||||
# tromey@busco.lanl.gov Member, League for Programming Freedom
|
||||
# Sadism and farce are always inexplicably linked.
|
||||
# -- Alexander Theroux
|
||||
|
||||
|
||||
# Month->number mapping. Used for sorting.
|
||||
%months = ('Jan', 0,
|
||||
'Feb', 1,
|
||||
'Mar', 2,
|
||||
'Apr', 3,
|
||||
'May', 4,
|
||||
'Jun', 5,
|
||||
'Jul', 6,
|
||||
'Aug', 7,
|
||||
'Sep', 8,
|
||||
'Oct', 9,
|
||||
'Nov', 10,
|
||||
'Dec', 11);
|
||||
|
||||
# If '-i' is given, do it in-place.
|
||||
if ($ARGV[0] eq '-i') {
|
||||
shift (@ARGV);
|
||||
$^I = '~';
|
||||
}
|
||||
|
||||
$lastkey = '';
|
||||
$lastval = '';
|
||||
$conf = 0;
|
||||
%conflist = ();
|
||||
|
||||
$tjd = 0;
|
||||
|
||||
# Simple state machine. The states:
|
||||
#
|
||||
# 0 Not in conflict. Just copy input to output.
|
||||
# 1 Beginning an entry. Next non-blank line is key.
|
||||
# 2 In entry. Entry beginner transitions to state 1.
|
||||
while (<>) {
|
||||
if (/^<<<</ || /^====/) {
|
||||
# Start of a conflict.
|
||||
|
||||
# Copy last key into array.
|
||||
if ($lastkey ne '') {
|
||||
$conflist{$lastkey} = $lastval;
|
||||
|
||||
$lastkey = '';
|
||||
$lastval = '';
|
||||
}
|
||||
|
||||
$conf = 1;
|
||||
} elsif (/^>>>>/) {
|
||||
# End of conflict. Output.
|
||||
|
||||
# Copy last key into array.
|
||||
if ($lastkey ne '') {
|
||||
$conflist{$lastkey} = $lastval;
|
||||
|
||||
$lastkey = '';
|
||||
$lastval = '';
|
||||
}
|
||||
|
||||
foreach (reverse sort clcmp keys %conflist) {
|
||||
print STDERR "doing $_" if $tjd;
|
||||
print $_;
|
||||
print $conflist{$_};
|
||||
}
|
||||
|
||||
$lastkey = '';
|
||||
$lastval = '';
|
||||
$conf = 0;
|
||||
%conflist = ();
|
||||
} elsif ($conf == 1) {
|
||||
# Beginning an entry. Skip empty lines. Error if not a real
|
||||
# beginner.
|
||||
if (/^$/) {
|
||||
# Empty line; just skip at this point.
|
||||
} elsif (/^[MTWFS]/) {
|
||||
# Looks like the name of a day; assume opener and move to
|
||||
# "in entry" state.
|
||||
$lastkey = $_;
|
||||
$conf = 2;
|
||||
print STDERR "found $_" if $tjd;
|
||||
} else {
|
||||
die ("conflict crosses entry boundaries: $_");
|
||||
}
|
||||
} elsif ($conf == 2) {
|
||||
# In entry. Copy into variable until we see beginner line.
|
||||
if (/^[MTWFS]/) {
|
||||
# Entry beginner line.
|
||||
|
||||
# Copy last key into array.
|
||||
if ($lastkey ne '') {
|
||||
$conflist{$lastkey} = $lastval;
|
||||
|
||||
$lastkey = '';
|
||||
$lastval = '';
|
||||
}
|
||||
|
||||
$lastkey = $_;
|
||||
print STDERR "found $_" if $tjd;
|
||||
$lastval = '';
|
||||
} else {
|
||||
$lastval .= $_;
|
||||
}
|
||||
} else {
|
||||
# Just copy.
|
||||
print;
|
||||
}
|
||||
}
|
||||
|
||||
# Compare ChangeLog time strings like <=>.
|
||||
#
|
||||
# 0 1 2 3
|
||||
# Thu Aug 11 13:22:42 1994 Tom Tromey (tromey@creche.colorado.edu)
|
||||
# 0123456789012345678901234567890
|
||||
#
|
||||
sub clcmp {
|
||||
# First check year.
|
||||
$r = substr ($a, 20, 4) <=> substr ($b, 20, 4);
|
||||
|
||||
# Now check month.
|
||||
$r = $months{substr ($a, 4, 3)} <=> $months{substr ($b, 4, 3)} if !$r;
|
||||
|
||||
# Now check day.
|
||||
$r = substr ($a, 8, 2) <=> substr ($b, 8, 2) if !$r;
|
||||
|
||||
# Now check time (3 parts).
|
||||
$r = substr ($a, 11, 2) <=> substr ($b, 11, 2) if !$r;
|
||||
$r = substr ($a, 14, 2) <=> substr ($b, 14, 2) if !$r;
|
||||
$r = substr ($a, 17, 2) <=> substr ($b, 17, 2) if !$r;
|
||||
|
||||
$r;
|
||||
}
|
92
contrib/cvs/contrib/cln_hist.pl
Normal file
92
contrib/cvs/contrib/cln_hist.pl
Normal file
@ -0,0 +1,92 @@
|
||||
#! xPERL_PATHx
|
||||
# -*-Perl-*-
|
||||
#
|
||||
# $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
|
||||
#
|
||||
# WUCG records are thrown out.
|
||||
# MAR records are retained.
|
||||
# T records: retain only last tag with same combined tag/module.
|
||||
#
|
||||
# Two passes: Walk through the first time and remember the
|
||||
# 1. Last Tag record with same "tag" and "module" names.
|
||||
# 2. Last O record with unique user/module/directory, unless followed
|
||||
# by a matching F record.
|
||||
#
|
||||
|
||||
$r = $ENV{"CVSROOT"};
|
||||
$c = "$r/CVSROOT";
|
||||
$h = "$c/history";
|
||||
|
||||
eval "print STDERR \$die='Unknown parameter $1\n' if !defined \$$1; \$$1=\$';"
|
||||
while ($ARGV[0] =~ /^(\w+)=/ && shift(@ARGV));
|
||||
exit 255 if $die; # process any variable=value switches
|
||||
|
||||
%tags = ();
|
||||
%outs = ();
|
||||
|
||||
#
|
||||
# Move history file to safe place and re-initialize a new one.
|
||||
#
|
||||
rename($h, "$h.bak");
|
||||
open(XX, ">$h");
|
||||
close(XX);
|
||||
|
||||
#
|
||||
# Pass1 -- remember last tag and checkout.
|
||||
#
|
||||
open(HIST, "$h.bak");
|
||||
while (<HIST>) {
|
||||
next if /^[MARWUCG]/;
|
||||
|
||||
# Save whole line keyed by tag|module
|
||||
if (/^T/) {
|
||||
@tmp = split(/\|/, $_);
|
||||
$tags{$tmp[4] . '|' . $tmp[5]} = $_;
|
||||
}
|
||||
# Save whole line
|
||||
if (/^[OF]/) {
|
||||
@tmp = split(/\|/, $_);
|
||||
$outs{$tmp[1] . '|' . $tmp[2] . '|' . $tmp[5]} = $_;
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Pass2 -- print out what we want to save.
|
||||
#
|
||||
open(SAVE, ">$h.work");
|
||||
open(HIST, "$h.bak");
|
||||
while (<HIST>) {
|
||||
next if /^[FWUCG]/;
|
||||
|
||||
# If whole line matches saved (i.e. "last") one, print it.
|
||||
if (/^T/) {
|
||||
@tmp = split(/\|/, $_);
|
||||
next if $tags{$tmp[4] . '|' . $tmp[5]} ne $_;
|
||||
}
|
||||
# Save whole line
|
||||
if (/^O/) {
|
||||
@tmp = split(/\|/, $_);
|
||||
next if $outs{$tmp[1] . '|' . $tmp[2] . '|' . $tmp[5]} ne $_;
|
||||
}
|
||||
|
||||
print SAVE $_;
|
||||
}
|
||||
|
||||
#
|
||||
# Put back the saved stuff
|
||||
#
|
||||
system "cat $h >> $h.work";
|
||||
|
||||
if (-s $h) {
|
||||
rename ($h, "$h.interim");
|
||||
print "history.interim has non-zero size.\n";
|
||||
} else {
|
||||
unlink($h);
|
||||
}
|
||||
|
||||
rename ("$h.work", $h);
|
||||
|
||||
exit(0);
|
216
contrib/cvs/contrib/commit_prep.pl
Normal file
216
contrib/cvs/contrib/commit_prep.pl
Normal file
@ -0,0 +1,216 @@
|
||||
#! 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_accum.pl script. For new files, it forces the
|
||||
# existence of a RCS "Id" keyword in the first ten lines of the file.
|
||||
# For existing files, it checks version number in the "Id" line to
|
||||
# prevent losing changes because an old version of a file was copied
|
||||
# into the direcory.
|
||||
#
|
||||
# Possible future enhancements:
|
||||
#
|
||||
# Check for cruft left by unresolved conflicts. Search for
|
||||
# "^<<<<<<<$", "^-------$", and "^>>>>>>>$".
|
||||
#
|
||||
# Look for a copyright and automagically update it to the
|
||||
# current year. [[ bad idea! -- woods ]]
|
||||
#
|
||||
#
|
||||
# Contributed by David Hampton <hampton@cisco.com>
|
||||
#
|
||||
# Hacked on lots by Greg A. Woods <woods@web.net>
|
||||
|
||||
#
|
||||
# Configurable options
|
||||
#
|
||||
|
||||
# Constants (remember to protect strings from RCS keyword substitution)
|
||||
#
|
||||
$LAST_FILE = "/tmp/#cvs.lastdir"; # must match name in log_accum.pl
|
||||
$ENTRIES = "CVS/Entries";
|
||||
|
||||
# Patterns to find $Log keywords in files
|
||||
#
|
||||
$LogString1 = "\\\$\\Log: .* \\\$";
|
||||
$LogString2 = "\\\$\\Log\\\$";
|
||||
$NoLog = "%s - contains an RCS \$Log keyword. It must not!\n";
|
||||
|
||||
# pattern to match an RCS Id keyword line with an existing ID
|
||||
#
|
||||
$IDstring = "\"@\\(#\\)[^:]*:.*\\\$\Id: .*\\\$\"";
|
||||
$NoId = "
|
||||
%s - Does not contain a properly formatted line with the keyword \"Id:\".
|
||||
I.e. no lines match \"" . $IDstring . "\".
|
||||
Please see the template files for an example.\n";
|
||||
|
||||
# pattern to match an RCS Id keyword line for a new file (i.e. un-expanded)
|
||||
#
|
||||
$NewId = "\"@(#)[^:]*:.*\\$\Id\\$\"";
|
||||
|
||||
$NoName = "
|
||||
%s - The ID line should contain only \"@(#)module/path:\$Name\$:\$\Id\$\"
|
||||
for a newly created file.\n";
|
||||
|
||||
$BadName = "
|
||||
%s - The file name '%s' in the ID line does not match
|
||||
the actual filename.\n";
|
||||
|
||||
$BadVersion = "
|
||||
%s - How dare you!!! You replaced your copy of the file '%s',
|
||||
which was based upon version %s, with an %s version based
|
||||
upon %s. Please move your '%s' out of the way, perform an
|
||||
update to get the current version, and them merge your changes
|
||||
into that file, then try the commit again.\n";
|
||||
|
||||
#
|
||||
# Subroutines
|
||||
#
|
||||
|
||||
sub write_line {
|
||||
local($filename, $line) = @_;
|
||||
open(FILE, ">$filename") || die("Cannot open $filename, stopped");
|
||||
print(FILE $line, "\n");
|
||||
close(FILE);
|
||||
}
|
||||
|
||||
sub check_version {
|
||||
local($i, $id, $rname, $version);
|
||||
local($filename, $cvsversion) = @_;
|
||||
|
||||
open(FILE, "<$filename") || return(0);
|
||||
|
||||
@all_lines = ();
|
||||
$idpos = -1;
|
||||
$newidpos = -1;
|
||||
for ($i = 0; <FILE>; $i++) {
|
||||
chop;
|
||||
push(@all_lines, $_);
|
||||
if ($_ =~ /$IDstring/) {
|
||||
$idpos = $i;
|
||||
}
|
||||
if ($_ =~ /$NewId/) {
|
||||
$newidpos = $i;
|
||||
}
|
||||
}
|
||||
|
||||
if (grep(/$LogString1/, @all_lines) || grep(/$LogString2/, @all_lines)) {
|
||||
print STDERR sprintf($NoLog, $filename);
|
||||
return(1);
|
||||
}
|
||||
|
||||
if ($debug != 0) {
|
||||
print STDERR sprintf("file = %s, version = %d.\n", $filename, $cvsversion{$filename});
|
||||
}
|
||||
|
||||
if ($cvsversion{$filename} == 0) {
|
||||
if ($newidpos != -1 && $all_lines[$newidpos] !~ /$NewId/) {
|
||||
print STDERR sprintf($NoName, $filename);
|
||||
return(1);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
if ($idpos == -1) {
|
||||
print STDERR sprintf($NoId, $filename);
|
||||
return(1);
|
||||
}
|
||||
|
||||
$line = $all_lines[$idpos];
|
||||
$pos = index($line, "Id: ");
|
||||
if ($debug != 0) {
|
||||
print STDERR sprintf("%d in '%s'.\n", $pos, $line);
|
||||
}
|
||||
($id, $rname, $version) = split(' ', substr($line, $pos));
|
||||
if ($rname ne "$filename,v") {
|
||||
print STDERR sprintf($BadName, $filename, substr($rname, 0, length($rname)-2));
|
||||
return(1);
|
||||
}
|
||||
if ($cvsversion{$filename} < $version) {
|
||||
print STDERR sprintf($BadVersion, $filename, $filename, $cvsversion{$filename},
|
||||
"newer", $version, $filename);
|
||||
return(1);
|
||||
}
|
||||
if ($cvsversion{$filename} > $version) {
|
||||
print STDERR sprintf($BadVersion, $filename, $filename, $cvsversion{$filename},
|
||||
"older", $version, $filename);
|
||||
return(1);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
#
|
||||
# Main Body
|
||||
#
|
||||
|
||||
$id = getpgrp(); # You *must* use a shell that does setpgrp()!
|
||||
|
||||
# Check each file (except dot files) for an RCS "Id" keyword.
|
||||
#
|
||||
$check_id = 0;
|
||||
|
||||
# Record the directory for later use by the log_accumulate stript.
|
||||
#
|
||||
$record_directory = 0;
|
||||
|
||||
# parse command line arguments
|
||||
#
|
||||
while (@ARGV) {
|
||||
$arg = shift @ARGV;
|
||||
|
||||
if ($arg eq '-d') {
|
||||
$debug = 1;
|
||||
print STDERR "Debug turned on...\n";
|
||||
} elsif ($arg eq '-c') {
|
||||
$check_id = 1;
|
||||
} elsif ($arg eq '-r') {
|
||||
$record_directory = 1;
|
||||
} else {
|
||||
push(@files, $arg);
|
||||
}
|
||||
}
|
||||
|
||||
$directory = shift @files;
|
||||
|
||||
if ($debug != 0) {
|
||||
print STDERR "dir - ", $directory, "\n";
|
||||
print STDERR "files - ", join(":", @files), "\n";
|
||||
print STDERR "id - ", $id, "\n";
|
||||
}
|
||||
|
||||
# Suck in the CVS/Entries file
|
||||
#
|
||||
open(ENTRIES, $ENTRIES) || die("Cannot open $ENTRIES.\n");
|
||||
while (<ENTRIES>) {
|
||||
local($filename, $version) = split('/', substr($_, 1));
|
||||
$cvsversion{$filename} = $version;
|
||||
}
|
||||
|
||||
# Now check each file name passed in, except for dot files. Dot files
|
||||
# are considered to be administrative files by this script.
|
||||
#
|
||||
if ($check_id != 0) {
|
||||
$failed = 0;
|
||||
foreach $arg (@files) {
|
||||
if (index($arg, ".") == 0) {
|
||||
next;
|
||||
}
|
||||
$failed += &check_version($arg);
|
||||
}
|
||||
if ($failed) {
|
||||
print STDERR "\n";
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
# Record this directory as the last one checked. This will be used
|
||||
# by the log_accumulate script to determine when it is processing
|
||||
# the final directory of a multi-directory commit.
|
||||
#
|
||||
if ($record_directory != 0) {
|
||||
&write_line("$LAST_FILE.$id", $directory);
|
||||
}
|
||||
exit(0);
|
143
contrib/cvs/contrib/cvs_acls.pl
Normal file
143
contrib/cvs/contrib/cvs_acls.pl
Normal file
@ -0,0 +1,143 @@
|
||||
#! xPERL_PATHx
|
||||
# -*-Perl-*-
|
||||
#
|
||||
# $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)
|
||||
#
|
||||
# CVS "commitinfo" for matching repository names, running the program it finds
|
||||
# on the same line. More information is available in the CVS man pages.
|
||||
#
|
||||
# ==== INSTALLATION:
|
||||
#
|
||||
# To use this program as I intended, do the following four things:
|
||||
#
|
||||
# 0. Install PERL. :-)
|
||||
#
|
||||
# 1. Put one line, as the *only* non-comment line, in your commitinfo file:
|
||||
#
|
||||
# DEFAULT /usr/local/bin/cvs_acls
|
||||
#
|
||||
# 2. Install this file as /usr/local/bin/cvs_acls and make it executable.
|
||||
#
|
||||
# 3. Create a file named $CVSROOT/CVSROOT/avail.
|
||||
#
|
||||
# ==== FORMAT OF THE avail FILE:
|
||||
#
|
||||
# The avail file determines whether you may commit files. It contains lines
|
||||
# read from top to bottom, keeping track of a single "bit". The "bit"
|
||||
# defaults to "on". It can be turned "off" by "unavail" lines and "on" by
|
||||
# "avail" lines. ==> Last one counts.
|
||||
#
|
||||
# Any line not beginning with "avail" or "unavail" is ignored.
|
||||
#
|
||||
# Lines beginning with "avail" or "unavail" are assumed to be '|'-separated
|
||||
# triples: (All spaces and tabs are ignored in a line.)
|
||||
#
|
||||
# {avail.*,unavail.*} [| user,user,... [| repos,repos,...]]
|
||||
#
|
||||
# 1. String starting with "avail" or "unavail".
|
||||
# 2. Optional, comma-separated list of usernames.
|
||||
# 3. Optional, comma-separated list of repository pathnames.
|
||||
# These are pathnames relative to $CVSROOT. They can be directories or
|
||||
# filenames. A directory name allows access to all files and
|
||||
# directories below it.
|
||||
#
|
||||
# Example: (Text from the ';;' rightward may not appear in the file.)
|
||||
#
|
||||
# unavail ;; Make whole repository unavailable.
|
||||
# avail|dgg ;; Except for user "dgg".
|
||||
# avail|fred, john|bin/ls ;; Except when "fred" or "john" commit to
|
||||
# ;; the module whose repository is "bin/ls"
|
||||
#
|
||||
# PROGRAM LOGIC:
|
||||
#
|
||||
# CVS passes to @ARGV an absolute directory pathname (the repository
|
||||
# appended to your $CVSROOT variable), followed by a list of filenames
|
||||
# within that directory.
|
||||
#
|
||||
# We walk through the avail file looking for a line that matches both
|
||||
# the username and repository.
|
||||
#
|
||||
# A username match is simply the user's name appearing in the second
|
||||
# column of the avail line in a space-or-comma separate list.
|
||||
#
|
||||
# A repository match is either:
|
||||
# - One element of the third column matches $ARGV[0], or some
|
||||
# parent directory of $ARGV[0].
|
||||
# - Otherwise *all* file arguments ($ARGV[1..$#ARGV]) must be
|
||||
# in the file list in one avail line.
|
||||
# - In other words, using directory names in the third column of
|
||||
# the avail file allows committing of any file (or group of
|
||||
# files in a single commit) in the tree below that directory.
|
||||
# - If individual file names are used in the third column of
|
||||
# the avail file, then files must be committed individually or
|
||||
# all files specified in a single commit must all appear in
|
||||
# third column of a single avail line.
|
||||
#
|
||||
|
||||
$debug = 0;
|
||||
$cvsroot = $ENV{'CVSROOT'};
|
||||
$availfile = $cvsroot . "/CVSROOT/avail";
|
||||
$myname = $ENV{"USER"} if !($myname = $ENV{"LOGNAME"});
|
||||
|
||||
eval "print STDERR \$die='Unknown parameter $1\n' if !defined \$$1; \$$1=\$';"
|
||||
while ($ARGV[0] =~ /^(\w+)=/ && shift(@ARGV));
|
||||
exit 255 if $die; # process any variable=value switches
|
||||
|
||||
die "Must set CVSROOT\n" if !$cvsroot;
|
||||
($repos = shift) =~ s:^$cvsroot/::;
|
||||
grep($_ = $repos . '/' . $_, @ARGV);
|
||||
|
||||
print "$$ Repos: $repos\n","$$ ==== ",join("\n$$ ==== ",@ARGV),"\n" if $debug;
|
||||
|
||||
$exit_val = 0; # Good Exit value
|
||||
|
||||
$universal_off = 0;
|
||||
open (AVAIL, $availfile) || exit(0); # It is ok for avail file not to exist
|
||||
while (<AVAIL>) {
|
||||
chop;
|
||||
next if /^\s*\#/;
|
||||
next if /^\s*$/;
|
||||
($flagstr, $u, $m) = split(/[\s,]*\|[\s,]*/, $_);
|
||||
|
||||
# Skip anything not starting with "avail" or "unavail" and complain.
|
||||
(print "Bad avail line: $_\n"), next
|
||||
if ($flagstr !~ /^avail/ && $flagstr !~ /^unavail/);
|
||||
|
||||
# Set which bit we are playing with. ('0' is OK == Available).
|
||||
$flag = (($& eq "avail") ? 0 : 1);
|
||||
|
||||
# If we find a "universal off" flag (i.e. a simple "unavail") remember it
|
||||
$universal_off = 1 if ($flag && !$u && !$m);
|
||||
|
||||
# $myname considered "in user list" if actually in list or is NULL
|
||||
$in_user = (!$u || grep ($_ eq $myname, split(/[\s,]+/,$u)));
|
||||
print "$$ \$myname($myname) in user list: $_\n" if $debug && $in_user;
|
||||
|
||||
# Module matches if it is a NULL module list in the avail line. If module
|
||||
# list is not null, we check every argument combination.
|
||||
if (!($in_repo = !$m)) {
|
||||
@tmp = split(/[\s,]+/,$m);
|
||||
for $j (@tmp) {
|
||||
# If the repos from avail is a parent(or equal) dir of $repos, OK
|
||||
$in_repo = 1, last if ($repos eq $j || $repos =~ /^$j\//);
|
||||
}
|
||||
if (!$in_repo) {
|
||||
$in_repo = 1;
|
||||
for $j (@ARGV) {
|
||||
last if !($in_repo = grep ($_ eq $j, @tmp));
|
||||
}
|
||||
}
|
||||
}
|
||||
print "$$ \$repos($repos) in repository list: $_\n" if $debug && $in_repo;
|
||||
|
||||
$exit_val = $flag if ($in_user && $in_repo);
|
||||
print "$$ ==== \$exit_val = $exit_val\n$$ ==== \$flag = $flag\n" if $debug;
|
||||
}
|
||||
close(AVAIL);
|
||||
print "$$ ==== \$exit_val = $exit_val\n" if $debug;
|
||||
print "**** Access denied: Insufficient Karma ($myname|$repos)\n" if $exit_val;
|
||||
print "**** Access allowed: Personal Karma exceeds Environmental Karma.\n"
|
||||
if $universal_off && !$exit_val;
|
||||
exit($exit_val);
|
53
contrib/cvs/contrib/cvscheck.man
Normal file
53
contrib/cvs/contrib/cvscheck.man
Normal file
@ -0,0 +1,53 @@
|
||||
.\" $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
|
||||
cvscheck \- identify files added, changed, or removed in a CVS working
|
||||
directory
|
||||
.SH SYNOPSIS
|
||||
.B cvscheck
|
||||
.SH DESCRIPTION
|
||||
This command is a housekeeping aid. It should be run in a working
|
||||
directory that has been checked out using CVS. It identifies files
|
||||
that have been added, changed, or removed in the working directory, but
|
||||
not CVS
|
||||
.BR commit ted.
|
||||
It also determines whether the files have been CVS
|
||||
.BR add ed
|
||||
or CVS
|
||||
.BR remove d.
|
||||
For directories, this command determines only whether they have been
|
||||
.BR add ed.
|
||||
It operates in the current directory only.
|
||||
.LP
|
||||
This command provides information that is available using CVS
|
||||
.B status
|
||||
and CVS
|
||||
.BR diff .
|
||||
The advantage of
|
||||
.B cvscheck
|
||||
is that its output is very concise. It saves you the strain (and
|
||||
potential error) of interpreting the output of CVS
|
||||
.B status
|
||||
and
|
||||
.BR diff .
|
||||
.LP
|
||||
See
|
||||
.BR cvs (local)
|
||||
or
|
||||
.BR cvshelp (local)
|
||||
for instructions on how to add or remove a file or directory in a
|
||||
CVS-controlled package.
|
||||
.SH DIAGNOSTICS
|
||||
The exit status is 0 if no files have been added, changed, or removed
|
||||
from the current directory. Otherwise, the command returns a count of
|
||||
the adds, changes, and deletes.
|
||||
.SH SEE ALSO
|
||||
.BR cvs (local),
|
||||
.BR cvshelp (local)
|
||||
.SH AUTHOR
|
||||
Lowell Skoog
|
||||
.br
|
||||
Software Technology Group
|
||||
.br
|
||||
Technical Computing
|
84
contrib/cvs/contrib/cvscheck.sh
Normal file
84
contrib/cvs/contrib/cvscheck.sh
Normal file
@ -0,0 +1,84 @@
|
||||
#! /bin/sh
|
||||
# $Id: cvscheck.sh,v 1.1 1995/07/10 02:26:29 kfogel Exp $
|
||||
#
|
||||
# cvscheck - identify files added, changed, or removed
|
||||
# in CVS working directory
|
||||
#
|
||||
# Contributed by Lowell Skoog <fluke!lowell@uunet.uu.net>
|
||||
#
|
||||
# This program should be run in a working directory that has been
|
||||
# checked out using CVS. It identifies files that have been added,
|
||||
# changed, or removed in the working directory, but not "cvs
|
||||
# committed". It also determines whether the files have been "cvs
|
||||
# added" or "cvs removed". For directories, it is only practical to
|
||||
# determine whether they have been added.
|
||||
|
||||
name=cvscheck
|
||||
changes=0
|
||||
|
||||
# If we can't run CVS commands in this directory
|
||||
cvs status . > /dev/null 2>&1
|
||||
if [ $? != 0 ] ; then
|
||||
|
||||
# Bail out
|
||||
echo "$name: there is no version here; bailing out" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Identify files added to working directory
|
||||
for file in .* * ; do
|
||||
|
||||
# Skip '.' and '..'
|
||||
if [ $file = '.' -o $file = '..' ] ; then
|
||||
continue
|
||||
fi
|
||||
|
||||
# If a regular file
|
||||
if [ -f $file ] ; then
|
||||
if cvs status $file | grep -s '^From:[ ]*New file' ; then
|
||||
echo "file added: $file - not CVS committed"
|
||||
changes=`expr $changes + 1`
|
||||
elif cvs status $file | grep -s '^From:[ ]*no entry for' ; then
|
||||
echo "file added: $file - not CVS added, not CVS committed"
|
||||
changes=`expr $changes + 1`
|
||||
fi
|
||||
|
||||
# Else if a directory
|
||||
elif [ -d $file -a $file != CVS.adm ] ; then
|
||||
|
||||
# Move into it
|
||||
cd $file
|
||||
|
||||
# If CVS commands don't work inside
|
||||
cvs status . > /dev/null 2>&1
|
||||
if [ $? != 0 ] ; then
|
||||
echo "directory added: $file - not CVS added"
|
||||
changes=`expr $changes + 1`
|
||||
fi
|
||||
|
||||
# Move back up
|
||||
cd ..
|
||||
fi
|
||||
done
|
||||
|
||||
# Identify changed files
|
||||
changedfiles=`cvs diff | egrep '^diff' | awk '{print $3}'`
|
||||
for file in $changedfiles ; do
|
||||
echo "file changed: $file - not CVS committed"
|
||||
changes=`expr $changes + 1`
|
||||
done
|
||||
|
||||
# Identify files removed from working directory
|
||||
removedfiles=`cvs status | egrep '^File:[ ]*no file' | awk '{print $4}'`
|
||||
|
||||
# Determine whether each file has been cvs removed
|
||||
for file in $removedfiles ; do
|
||||
if cvs status $file | grep -s '^From:[ ]*-' ; then
|
||||
echo "file removed: $file - not CVS committed"
|
||||
else
|
||||
echo "file removed: $file - not CVS removed, not CVS committed"
|
||||
fi
|
||||
changes=`expr $changes + 1`
|
||||
done
|
||||
|
||||
exit $changes
|
562
contrib/cvs/contrib/cvshelp.man
Normal file
562
contrib/cvs/contrib/cvshelp.man
Normal file
@ -0,0 +1,562 @@
|
||||
.\" $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
|
||||
.if n .sp
|
||||
.if t .sp .5
|
||||
..
|
||||
.\" Start a command example
|
||||
.de XS
|
||||
.SP
|
||||
.in +.5i
|
||||
.ft B
|
||||
.nf
|
||||
..
|
||||
.\" End a command example
|
||||
.de XE
|
||||
.fi
|
||||
.ft P
|
||||
.in -.5i
|
||||
.SP
|
||||
..
|
||||
.TH CVSHELP LOCAL "17 March 1991" FLUKE
|
||||
.SH NAME
|
||||
cvshelp \- advice on using the Concurrent Versions System
|
||||
.SH DESCRIPTION
|
||||
This man page is based on experience using CVS.
|
||||
It is bound to change as we gain more experience.
|
||||
If you come up with better advice than is found here,
|
||||
contact the Software Technology
|
||||
Group and we will add it to this page.
|
||||
.SS "Getting Started"
|
||||
Use the following steps to prepare to use CVS:
|
||||
.TP
|
||||
\(bu
|
||||
Take a look at the CVS manual page to see what it can do for you, and
|
||||
if it fits your environment (or can possibly be made to fit your
|
||||
environment).
|
||||
.XS
|
||||
man cvs
|
||||
.XE
|
||||
If things look good, continue on...
|
||||
.TP
|
||||
\(bu
|
||||
Setup the master source repository. Choose a directory with
|
||||
ample disk space available for source files. This is where the RCS
|
||||
`,v' files will be stored. Say you choose
|
||||
.B /src/master
|
||||
as the root
|
||||
of your source repository. Make the
|
||||
.SB CVSROOT.adm
|
||||
directory in the root of the source repository:
|
||||
.XS
|
||||
mkdir /src/master/CVSROOT.adm
|
||||
.XE
|
||||
.TP
|
||||
\(bu
|
||||
Populate this directory with the
|
||||
.I loginfo
|
||||
and
|
||||
.I modules
|
||||
files from the
|
||||
.B "/usr/doc/local/cvs"
|
||||
directory. Edit these files to reflect your local source repository
|
||||
environment \- they may be quite small initially, but will grow as
|
||||
sources are added to your source repository. Turn these files into
|
||||
RCS controlled files:
|
||||
.XS
|
||||
cd /src/master/CVSROOT.adm
|
||||
ci \-m'Initial loginfo file' loginfo
|
||||
ci \-m'Initial modules file' modules
|
||||
.XE
|
||||
.TP
|
||||
\(bu
|
||||
Run the command:
|
||||
.XS
|
||||
mkmodules /src/master/CVSROOT.adm
|
||||
.XE
|
||||
This will build the
|
||||
.BR ndbm (3)
|
||||
file for the modules database.
|
||||
.TP
|
||||
\(bu
|
||||
Remember to edit the
|
||||
.I modules
|
||||
file manually when sources are checked
|
||||
in with
|
||||
.B checkin
|
||||
or CVS
|
||||
.BR add .
|
||||
A copy of the
|
||||
.I modules
|
||||
file for editing can be retrieved with the command:
|
||||
.XS
|
||||
cvs checkout CVSROOT.adm
|
||||
.XE
|
||||
.TP
|
||||
\(bu
|
||||
Have all users of the CVS system set the
|
||||
.SM CVSROOT
|
||||
environment variable appropriately to reflect the placement of your
|
||||
source repository. If the above example is used, the following
|
||||
commands can be placed in a
|
||||
.I .login
|
||||
or
|
||||
.I .profile
|
||||
file:
|
||||
.XS
|
||||
setenv CVSROOT /src/master
|
||||
.XE
|
||||
for csh users, and
|
||||
.XS
|
||||
CVSROOT=/src/master; export CVSROOT
|
||||
.XE
|
||||
for sh users.
|
||||
.SS "Placing Locally Written Sources Under CVS Control"
|
||||
Say you want to place the `whizbang' sources under
|
||||
CVS control. Say further that the sources have never
|
||||
been under revision control before.
|
||||
.TP
|
||||
\(bu
|
||||
Move the source hierarchy (lock, stock, and barrel)
|
||||
into the master source repository:
|
||||
.XS
|
||||
mv ~/whizbang $CVSROOT
|
||||
.XE
|
||||
.TP
|
||||
\(bu
|
||||
Clean out unwanted object files:
|
||||
.XS
|
||||
cd $CVSROOT/whizbang
|
||||
make clean
|
||||
.XE
|
||||
.TP
|
||||
\(bu
|
||||
Turn every file in the hierarchy into an RCS controlled file:
|
||||
.XS
|
||||
descend \-f 'ci \-t/dev/null \-m"Placed under CVS control" \-nV\fR\fIx\fR\fB_\fR\fIy\fR\fB *'
|
||||
.XE
|
||||
In this example, the initial release tag is \fBV\fIx\fB_\fIy\fR,
|
||||
representing version \fIx\fR.\fIy\fR.
|
||||
.LP
|
||||
You can use CVS on sources that are already under RCS control.
|
||||
The following example shows how.
|
||||
In this example, the source package is called `skunkworks'.
|
||||
.TP
|
||||
\(bu
|
||||
Move the source hierarchy into the master source
|
||||
repository:
|
||||
.XS
|
||||
mv ~/skunkworks $CVSROOT
|
||||
.XE
|
||||
.TP
|
||||
\(bu
|
||||
Clean out unwanted object files:
|
||||
.XS
|
||||
cd $CVSROOT/skunkworks
|
||||
make clean
|
||||
.XE
|
||||
.TP
|
||||
\(bu
|
||||
Clean out unwanted working files, leaving only the RCS `,v' files:
|
||||
.XS
|
||||
descend \-r rcsclean
|
||||
.XE
|
||||
Note: If any working files have been checked out and changed,
|
||||
.B rcsclean
|
||||
will fail. Check in the modified working files
|
||||
and run the command again.
|
||||
.TP
|
||||
\(bu
|
||||
Get rid of
|
||||
.SB RCS
|
||||
subdirectories. CVS does not use them.
|
||||
.XS
|
||||
descend \-r \-f 'mv RCS/*,v .'
|
||||
descend \-r \-f 'rmdir RCS'
|
||||
.XE
|
||||
.TP
|
||||
\(bu
|
||||
Delete any unwanted files that remain in the source hierarchy. Then
|
||||
make sure all files are under RCS control:
|
||||
.XS
|
||||
descend \-f 'ci \-t/dev/null \-m"Placed under CVS control" \-n\fR\fItag\fR\fB *'
|
||||
.XE
|
||||
.I tag
|
||||
is the latest symbolic revision tag that you applied to your package
|
||||
(if any). Note: This command will probably generate lots of error
|
||||
messages (for directories and existing RCS files) that you can
|
||||
ignore.
|
||||
.SS "Placing a Third-Party Source Distribution Under CVS Control"
|
||||
The
|
||||
.B checkin
|
||||
command checks third-party sources into CVS. The
|
||||
difference between third-party sources and locally
|
||||
written sources is that third-party sources must be checked into a
|
||||
separate branch (called the
|
||||
.IR "vendor branch" )
|
||||
of the RCS tree. This makes it possible to merge local changes to
|
||||
the sources with later releases from the vendor.
|
||||
.TP
|
||||
\(bu
|
||||
Save the original distribution kit somewhere. For example, if the
|
||||
master source repository is
|
||||
.B /src/master
|
||||
the distribution kit could be saved in
|
||||
.BR /src/dist .
|
||||
Organize the distribution directory so that each release
|
||||
is clearly identifiable.
|
||||
.TP
|
||||
\(bu
|
||||
Unpack the package in a scratch directory, for example
|
||||
.BR ~/scratch .
|
||||
.TP
|
||||
\(bu
|
||||
Create a repository for the package.
|
||||
In this example, the package is called `Bugs-R-Us 4.3'.
|
||||
.XS
|
||||
mkdir $CVSROOT/bugs
|
||||
.XE
|
||||
.TP
|
||||
\(bu
|
||||
Check in the unpacked files:
|
||||
.XS
|
||||
cd ~/scratch
|
||||
checkin \-m 'Bugs-R-Us 4.3 distribution' bugs VENDOR V4_3
|
||||
.XE
|
||||
There is nothing magic about the tag `VENDOR', which is applied to
|
||||
the vendor branch. You can use whatever tag you want. `VENDOR' is a
|
||||
useful convention.
|
||||
.TP
|
||||
\(bu
|
||||
Never modify vendor files before checking them in.
|
||||
Check in the files
|
||||
.I exactly
|
||||
as you unpacked them.
|
||||
If you check in locally modified files, future vendor releases may
|
||||
wipe out your local changes.
|
||||
.SS "Working With CVS-Controlled Sources"
|
||||
To use or edit the sources, you must check out a private copy.
|
||||
For the following examples, the master files are assumed to reside in
|
||||
.BR "$CVSROOT/behemoth" .
|
||||
The working directory is
|
||||
.BR "~/work" .
|
||||
See
|
||||
.BR cvs (local)
|
||||
for more details on the commands mentioned below.
|
||||
.TP
|
||||
.I "To Check Out Working Files
|
||||
Use CVS
|
||||
.BR checkout :
|
||||
.XS
|
||||
cd ~/work
|
||||
cvs checkout behemoth
|
||||
.XE
|
||||
There is nothing magic about the working directory. CVS will check
|
||||
out sources anywhere you like. Once you have a working copy of the
|
||||
sources, you can compile or edit them as desired.
|
||||
.TP
|
||||
.I "To Display Changes You Have Made"
|
||||
Use CVS
|
||||
.BR diff
|
||||
to display detailed changes, equivalent to
|
||||
.BR rcsdiff (local).
|
||||
You can also use
|
||||
.BR cvscheck (local)
|
||||
to list files added, changed, and removed in
|
||||
the directory, but not yet
|
||||
.BR commit ted.
|
||||
You must be in a directory containing working files.
|
||||
.TP
|
||||
.I "To Display Revision Information"
|
||||
Use CVS
|
||||
.BR log ,
|
||||
which is equivalent to
|
||||
.BR rlog (local).
|
||||
You must be in a directory containing working files.
|
||||
.TP
|
||||
.I "To Update Working Files"
|
||||
Use CVS
|
||||
.BR update
|
||||
in a directory containing working files.
|
||||
This command brings your working files up
|
||||
to date with changes checked into the
|
||||
master repository since you last checked out or updated
|
||||
your files.
|
||||
.TP
|
||||
.I "To Check In Your Changes"
|
||||
Use CVS
|
||||
.BR commit
|
||||
in a directory containing working files.
|
||||
This command checks your changes into the master repository.
|
||||
You can specify files by name or use
|
||||
.XS
|
||||
cvs commit \-a
|
||||
.XE
|
||||
to
|
||||
.B commit
|
||||
all the files you have changed.
|
||||
.TP
|
||||
.I "To Add a File"
|
||||
Add the file to the working directory.
|
||||
Use CVS
|
||||
.B add
|
||||
to mark the file as added.
|
||||
Use CVS
|
||||
.B commit
|
||||
to add the file to the master repository.
|
||||
.TP
|
||||
.I "To Remove a File"
|
||||
Remove the file from the working directory.
|
||||
Use CVS
|
||||
.B remove
|
||||
to mark the file as removed.
|
||||
Use CVS
|
||||
.B commit
|
||||
to move the file from its current location in the master repository
|
||||
to the CVS
|
||||
.IR Attic
|
||||
directory.
|
||||
.TP
|
||||
.I "To Add a Directory"
|
||||
Add the directory to the working directory.
|
||||
Use CVS
|
||||
.B add
|
||||
to add the directory to the master repository.
|
||||
.TP
|
||||
.I "To Remove a Directory"
|
||||
.br
|
||||
You shouldn't remove directories under CVS. You should instead remove
|
||||
their contents and then prune them (using the
|
||||
.B \-f
|
||||
and
|
||||
.B \-p
|
||||
options) when you
|
||||
.B checkout
|
||||
or
|
||||
.B update
|
||||
your working files.
|
||||
.TP
|
||||
.I "To Tag a Release"
|
||||
Use CVS
|
||||
.B tag
|
||||
to apply a symbolic tag to the latest revision of each file in the
|
||||
master repository. For example:
|
||||
.XS
|
||||
cvs tag V2_1 behemoth
|
||||
.XE
|
||||
.TP
|
||||
.I "To Retrieve an Exact Copy of a Previous Release"
|
||||
During a CVS
|
||||
.B checkout
|
||||
or
|
||||
.BR update ,
|
||||
use the
|
||||
.B \-r
|
||||
option to retrieve revisions associated with a symbolic tag.
|
||||
Use the
|
||||
.B \-f
|
||||
option to ignore all RCS files that do not contain the
|
||||
tag.
|
||||
Use the
|
||||
.B \-p
|
||||
option to prune directories that wind up empty because none
|
||||
of their files matched the tag. Example:
|
||||
.XS
|
||||
cd ~/work
|
||||
cvs checkout \-r V2_1 \-f \-p behemoth
|
||||
.XE
|
||||
.SS "Logging Changes"
|
||||
It is a good idea to keep a change log together with the
|
||||
sources. As a minimum, the change log should name and describe each
|
||||
tagged release. The change log should also be under CVS control and
|
||||
should be tagged along with the sources.
|
||||
.LP
|
||||
.BR cvslog (local)
|
||||
can help. This command logs
|
||||
changes reported during CVS
|
||||
.B commit
|
||||
operations. It automatically
|
||||
updates a change log file in your working directory. When you are
|
||||
finished making changes, you (optionally) edit the change log file and
|
||||
then commit it to the master repository.
|
||||
.LP
|
||||
Note: You must edit the change log to describe a new release
|
||||
and
|
||||
.B commit
|
||||
it to the master repository
|
||||
.I before
|
||||
.BR tag ging
|
||||
the release using CVS. Otherwise, the release description will not be
|
||||
included in the tagged package.
|
||||
.LP
|
||||
See
|
||||
.BR cvslog (local)
|
||||
for more information.
|
||||
.SS "Merging a Subsequent Third-Party Distribution"
|
||||
The initial steps in this process are identical to placing a
|
||||
third-party distribution under CVS for the first time: save the
|
||||
distribution kit and unpack the package in a scratch directory. From
|
||||
that point the steps diverge.
|
||||
The following example considers release 5.0 of the
|
||||
Bugs-R-Us package.
|
||||
.TP
|
||||
\(bu
|
||||
Check in the sources after unpacking them:
|
||||
.XS
|
||||
cd ~/scratch
|
||||
checkin \-m 'Bugs-R-Us 5.0 distribution' bugs VENDOR V5_0 \\
|
||||
| tee ~/WARNINGS
|
||||
.XE
|
||||
It is important to save the output of
|
||||
.B checkin
|
||||
in a file
|
||||
because it lists the sources that have been locally modified.
|
||||
It is best to save the file in a different directory (for example,
|
||||
your home directory). Otherwise,
|
||||
.B checkin
|
||||
will try to check it into the master repository.
|
||||
.TP
|
||||
\(bu
|
||||
In your usual working directory, check out a fresh copy of the
|
||||
distribution that you just checked in.
|
||||
.XS
|
||||
cd ~/work
|
||||
cvs checkout \-r VENDOR bugs
|
||||
.XE
|
||||
The
|
||||
.B checkout
|
||||
command shown above retrieves the latest revision on the vendor branch.
|
||||
.TP
|
||||
\(bu
|
||||
See the `WARNINGS' file for a list of all locally modified
|
||||
sources.
|
||||
For each locally modified source,
|
||||
look at the differences between
|
||||
the new distribution and the latest local revision:
|
||||
.XS
|
||||
cvs diff \-r \fR\fILocalRev file\fR\fB
|
||||
.XE
|
||||
In this command,
|
||||
.I LocalRev
|
||||
is the latest
|
||||
numeric or symbolic revision
|
||||
on the RCS trunk of
|
||||
.IR file .
|
||||
You can use CVS
|
||||
.B log
|
||||
to get the revision history.
|
||||
.TP
|
||||
\(bu
|
||||
If your local modifications to a file have been incorporated into
|
||||
the vendor's distribution, then you should reset the default RCS
|
||||
branch for that file to the vendor branch. CVS doesn't provide a
|
||||
mechanism to do this. You have to do it by hand in the master
|
||||
repository:
|
||||
.XS
|
||||
rcs \-bVENDOR \fR\fIfile\fR\fB,v
|
||||
.XE
|
||||
.TP
|
||||
\(bu
|
||||
If your local modifications need to be merged with the
|
||||
new distribution, use CVS
|
||||
.B join
|
||||
to do it:
|
||||
.XS
|
||||
cvs join \-r VENDOR \fR\fIfile\fR\fB
|
||||
.XE
|
||||
The resulting file will be placed in your working directory.
|
||||
Edit it to resolve any overlaps.
|
||||
.TP
|
||||
\(bu
|
||||
Test the merged package.
|
||||
.TP
|
||||
\(bu
|
||||
Commit all modified files to the repository:
|
||||
.XS
|
||||
cvs commit \-a
|
||||
.XE
|
||||
.TP
|
||||
\(bu
|
||||
Tag the repository with a new local tag.
|
||||
.SS "Applying Patches to Third-Party Sources"
|
||||
Patches are handled in a manner very similar to complete
|
||||
third-party distributions. This example considers patches applied to
|
||||
Bugs-R-Us release 5.0.
|
||||
.TP
|
||||
\(bu
|
||||
Save the patch files together with the distribution kit
|
||||
to which they apply.
|
||||
The patch file names should clearly indicate the patch
|
||||
level.
|
||||
.TP
|
||||
\(bu
|
||||
In a scratch directory, check out the last `clean' vendor copy \- the
|
||||
highest revision on the vendor branch with
|
||||
.IR "no local changes" :
|
||||
.XS
|
||||
cd ~/scratch
|
||||
cvs checkout \-r VENDOR bugs
|
||||
.XE
|
||||
.TP
|
||||
\(bu
|
||||
Use
|
||||
.BR patch (local)
|
||||
to apply the patches. You should now have an image of the
|
||||
vendor's software just as though you had received a complete,
|
||||
new release.
|
||||
.TP
|
||||
\(bu
|
||||
Proceed with the steps described for merging a subsequent third-party
|
||||
distribution.
|
||||
.TP
|
||||
\(bu
|
||||
Note: When you get to the step that requires you
|
||||
to check out the new distribution after you have
|
||||
checked it into the vendor branch, you should move to a different
|
||||
directory. Do not attempt to
|
||||
.B checkout
|
||||
files in the directory in
|
||||
which you applied the patches. If you do, CVS will try to merge the
|
||||
changes that you made during patching with the version being checked
|
||||
out and things will get very confusing. Instead,
|
||||
go to a different directory (like your working directory) and
|
||||
check out the files there.
|
||||
.SS "Advice to Third-Party Source Hackers"
|
||||
As you can see from the preceding sections, merging local changes
|
||||
into third-party distributions remains difficult, and probably
|
||||
always will. This fact suggests some guidelines:
|
||||
.TP
|
||||
\(bu
|
||||
Minimize local changes.
|
||||
.I Never
|
||||
make stylistic changes.
|
||||
Change makefiles only as much as needed for installation. Avoid
|
||||
overhauling anything. Pray that the vendor does the same.
|
||||
.TP
|
||||
\(bu
|
||||
Avoid renaming files or moving them around.
|
||||
.TP
|
||||
\(bu
|
||||
Put independent, locally written files like help documents, local
|
||||
tools, or man pages in a sub-directory called `local-additions'.
|
||||
Locally written files that are linked into an existing executable
|
||||
should be added right in with the vendor's sources (not in a
|
||||
`local-additions' directory).
|
||||
If, in the future,
|
||||
the vendor distributes something
|
||||
equivalent to your locally written files
|
||||
you can CVS
|
||||
.B remove
|
||||
the files from the `local-additions' directory at that time.
|
||||
.SH SEE ALSO
|
||||
.BR cvs (local),
|
||||
.BR checkin (local),
|
||||
.BR cvslog (local),
|
||||
.BR cvscheck (local)
|
||||
.SH AUTHOR
|
||||
Lowell Skoog
|
||||
.br
|
||||
Software Technology Group
|
||||
.br
|
||||
Technical Computing
|
115
contrib/cvs/contrib/descend.man
Normal file
115
contrib/cvs/contrib/descend.man
Normal file
@ -0,0 +1,115 @@
|
||||
.\" $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
|
||||
.SH SYNOPSIS
|
||||
.B descend
|
||||
[
|
||||
.B \-afqrv
|
||||
]
|
||||
.I command
|
||||
[
|
||||
.I directory
|
||||
\&.\|.\|.
|
||||
]
|
||||
.SH DESCRIPTION
|
||||
.B descend
|
||||
walks down a directory tree and executes a command at each node. It
|
||||
is not as versatile as
|
||||
.BR find (1),
|
||||
but it has a simpler syntax. If no
|
||||
.I directory
|
||||
is specified,
|
||||
.B descend
|
||||
starts at the current one.
|
||||
.LP
|
||||
Unlike
|
||||
.BR find ,
|
||||
.B descend
|
||||
can be told to skip the special directories associated with RCS,
|
||||
CVS, and SCCS. This makes
|
||||
.B descend
|
||||
especially handy for use with these packages. It can be used with
|
||||
other commands too, of course.
|
||||
.LP
|
||||
.B descend
|
||||
is a poor man's way to make any command recursive. Note:
|
||||
.B descend
|
||||
does not follow symbolic links to directories unless they are
|
||||
specified on the command line.
|
||||
.SH OPTIONS
|
||||
.TP 15
|
||||
.B \-a
|
||||
.I All.
|
||||
Descend into directories that begin with '.'.
|
||||
.TP
|
||||
.B \-f
|
||||
.I Force.
|
||||
Ignore errors during descent. Normally,
|
||||
.B descend
|
||||
quits when an error occurs.
|
||||
.TP
|
||||
.B \-q
|
||||
.I Quiet.
|
||||
Suppress the message `In directory
|
||||
.IR directory '
|
||||
that is normally printed during the descent.
|
||||
.TP
|
||||
.B \-r
|
||||
.I Restricted.
|
||||
Don't descend into the special directories
|
||||
.SB RCS,
|
||||
.SB CVS,
|
||||
.SB CVS.adm,
|
||||
and
|
||||
.SB SCCS.
|
||||
.TP
|
||||
.B \-v
|
||||
.I Verbose.
|
||||
Print
|
||||
.I command
|
||||
before executing it.
|
||||
.SH EXAMPLES
|
||||
.TP 15
|
||||
.B "descend ls"
|
||||
Cheap substitute for `ls -R'.
|
||||
.TP 15
|
||||
.B "descend -f 'rm *' tree"
|
||||
Strip `tree' of its leaves. This command descends the `tree'
|
||||
directory, removing all regular files. Since
|
||||
.BR rm (1)
|
||||
does not remove directories, this command leaves the directory
|
||||
structure of `tree' intact, but denuded. The
|
||||
.B \-f
|
||||
option is required to keep
|
||||
.B descend
|
||||
from quitting. You could use `rm \-f' instead.
|
||||
.TP
|
||||
.B "descend -r 'co RCS/*'" /project/src/
|
||||
Check out every RCS file under the directory
|
||||
.BR "/project/src" .
|
||||
.TP
|
||||
.B "descend -r 'cvs diff'"
|
||||
Perform CVS `diff' operation on every directory below (and including)
|
||||
the current one.
|
||||
.SH DIAGNOSTICS
|
||||
Returns 1 if errors occur (and the
|
||||
.B \-f
|
||||
option is not used). Otherwise returns 0.
|
||||
.SH SEE ALSO
|
||||
.BR find (1),
|
||||
.BR rcsintro (1),
|
||||
.BR cvs (1),
|
||||
.BR sccs (1)
|
||||
.SH AUTHOR
|
||||
Lowell Skoog
|
||||
.br
|
||||
Software Technology Group
|
||||
.br
|
||||
John Fluke Mfg. Co., Inc.
|
||||
.SH BUGS
|
||||
Shell metacharacters in
|
||||
.I command
|
||||
may have bizarre effects. In particular, compound commands
|
||||
(containing ';', '[', and ']' characters) will not work. It is best
|
||||
to enclose complicated commands in single quotes \(aa\ \(aa.
|
116
contrib/cvs/contrib/descend.sh
Normal file
116
contrib/cvs/contrib/descend.sh
Normal file
@ -0,0 +1,116 @@
|
||||
#! /bin/sh
|
||||
# $Id: descend.sh,v 1.1 1995/07/10 02:26:32 kfogel Exp $
|
||||
#
|
||||
# descend - walk down a directory tree and execute a command at each node
|
||||
|
||||
fullname=$0
|
||||
name=descend
|
||||
usage="Usage: $name [-afqrv] command [directory ...]\n
|
||||
\040\040-a\040\040All: descend into directories starting with '.'\n
|
||||
\040\040-f\040\040Force: ignore errors during descent\n
|
||||
\040\040-q\040\040Quiet: don't print directory names\n
|
||||
\040\040-r\040\040Restricted: don't descend into RCS, CVS.adm, SCCS directories\n
|
||||
\040\040-v\040\040Verbose: print command before executing it"
|
||||
|
||||
# Scan for options
|
||||
while getopts afqrv option; do
|
||||
case $option in
|
||||
a)
|
||||
alldirs=$option
|
||||
options=$options" "-$option
|
||||
;;
|
||||
f)
|
||||
force=$option
|
||||
options=$options" "-$option
|
||||
;;
|
||||
q)
|
||||
verbose=
|
||||
quiet=$option
|
||||
options=$options" "-$option
|
||||
;;
|
||||
r)
|
||||
restricted=$option
|
||||
options=$options" "-$option
|
||||
;;
|
||||
v)
|
||||
verbose=$option
|
||||
quiet=
|
||||
options=$options" "-$option
|
||||
;;
|
||||
\?)
|
||||
/usr/5bin/echo $usage 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
shift `expr $OPTIND - 1`
|
||||
|
||||
# Get command to execute
|
||||
if [ $# -lt 1 ] ; then
|
||||
/usr/5bin/echo $usage 1>&2
|
||||
exit 1
|
||||
else
|
||||
command=$1
|
||||
shift
|
||||
fi
|
||||
|
||||
# If no directory specified, use '.'
|
||||
if [ $# -lt 1 ] ; then
|
||||
default_dir=.
|
||||
fi
|
||||
|
||||
# For each directory specified
|
||||
for dir in $default_dir "$@" ; do
|
||||
|
||||
# Spawn sub-shell so we return to starting directory afterward
|
||||
(cd $dir
|
||||
|
||||
# Execute specified command
|
||||
if [ -z "$quiet" ] ; then
|
||||
echo In directory `hostname`:`pwd`
|
||||
fi
|
||||
if [ -n "$verbose" ] ; then
|
||||
echo $command
|
||||
fi
|
||||
eval "$command" || if [ -z "$force" ] ; then exit 1; fi
|
||||
|
||||
# Collect dot file names if necessary
|
||||
if [ -n "$alldirs" ] ; then
|
||||
dotfiles=.*
|
||||
else
|
||||
dotfiles=
|
||||
fi
|
||||
|
||||
# For each file in current directory
|
||||
for file in $dotfiles * ; do
|
||||
|
||||
# Skip '.' and '..'
|
||||
if [ "$file" = "." -o "$file" = ".." ] ; then
|
||||
continue
|
||||
fi
|
||||
|
||||
# If a directory but not a symbolic link
|
||||
if [ -d "$file" -a ! -h "$file" ] ; then
|
||||
|
||||
# If not skipping this type of directory
|
||||
if [ \( "$file" != "RCS" -a \
|
||||
"$file" != "SCCS" -a \
|
||||
"$file" != "CVS" -a \
|
||||
"$file" != "CVS.adm" \) \
|
||||
-o -z "$restricted" ] ; then
|
||||
|
||||
# Recursively descend into it
|
||||
$fullname $options "$command" "$file" \
|
||||
|| if [ -z "$force" ] ; then exit 1; fi
|
||||
fi
|
||||
|
||||
# Else if a directory AND a symbolic link
|
||||
elif [ -d "$file" -a -h "$file" ] ; then
|
||||
|
||||
if [ -z "$quiet" ] ; then
|
||||
echo In directory `hostname`:`pwd`/$file: symbolic link: skipping
|
||||
fi
|
||||
fi
|
||||
done
|
||||
) || if [ -z "$force" ] ; then exit 1; fi
|
||||
done
|
481
contrib/cvs/contrib/dirfns.shar
Normal file
481
contrib/cvs/contrib/dirfns.shar
Normal file
@ -0,0 +1,481 @@
|
||||
echo 'directory.3':
|
||||
sed 's/^X//' >'directory.3' <<'!'
|
||||
X.TH DIRECTORY 3 imported
|
||||
X.DA 9 Oct 1985
|
||||
X.SH NAME
|
||||
Xopendir, readdir, telldir, seekdir, rewinddir, closedir \- high-level directory operations
|
||||
X.SH SYNOPSIS
|
||||
X.B #include <sys/types.h>
|
||||
X.br
|
||||
X.B #include <ndir.h>
|
||||
X.PP
|
||||
X.SM
|
||||
X.B DIR
|
||||
X.B *opendir(filename)
|
||||
X.br
|
||||
X.B char *filename;
|
||||
X.PP
|
||||
X.SM
|
||||
X.B struct direct
|
||||
X.B *readdir(dirp)
|
||||
X.br
|
||||
X.B DIR *dirp;
|
||||
X.PP
|
||||
X.SM
|
||||
X.B long
|
||||
X.B telldir(dirp)
|
||||
X.br
|
||||
X.B DIR *dirp;
|
||||
X.PP
|
||||
X.SM
|
||||
X.B seekdir(dirp, loc)
|
||||
X.br
|
||||
X.B DIR *dirp;
|
||||
X.br
|
||||
X.B long loc;
|
||||
X.PP
|
||||
X.SM
|
||||
X.B rewinddir(dirp)
|
||||
X.br
|
||||
X.B DIR *dirp;
|
||||
X.PP
|
||||
X.SM
|
||||
X.B closedir(dirp)
|
||||
X.br
|
||||
X.B DIR *dirp;
|
||||
X.SH DESCRIPTION
|
||||
XThis library provides high-level primitives for directory scanning,
|
||||
Xsimilar to those available for 4.2BSD's (very different) directory system.
|
||||
X.\"The purpose of this library is to simulate
|
||||
X.\"the new flexible length directory names of 4.2bsd UNIX
|
||||
X.\"on top of the old directory structure of v7.
|
||||
XIt incidentally provides easy portability to and from 4.2BSD (insofar
|
||||
Xas such portability is not compromised by other 4.2/VAX dependencies).
|
||||
X.\"It allows programs to be converted immediately
|
||||
X.\"to the new directory access interface,
|
||||
X.\"so that they need only be relinked
|
||||
X.\"when moved to 4.2bsd.
|
||||
X.\"It is obtained with the loader option
|
||||
X.\".BR \-lndir .
|
||||
X.PP
|
||||
X.I Opendir
|
||||
Xopens the directory named by
|
||||
X.I filename
|
||||
Xand associates a
|
||||
X.I directory stream
|
||||
Xwith it.
|
||||
X.I Opendir
|
||||
Xreturns a pointer to be used to identify the
|
||||
X.I directory stream
|
||||
Xin subsequent operations.
|
||||
XThe pointer
|
||||
X.SM
|
||||
X.B NULL
|
||||
Xis returned if
|
||||
X.I filename
|
||||
Xcannot be accessed or is not a directory.
|
||||
X.PP
|
||||
X.I Readdir
|
||||
Xreturns a pointer to the next directory entry.
|
||||
XIt returns
|
||||
X.B NULL
|
||||
Xupon reaching the end of the directory or detecting
|
||||
Xan invalid
|
||||
X.I seekdir
|
||||
Xoperation.
|
||||
X.PP
|
||||
X.I Telldir
|
||||
Xreturns the current location associated with the named
|
||||
X.I directory stream.
|
||||
X.PP
|
||||
X.I Seekdir
|
||||
Xsets the position of the next
|
||||
X.I readdir
|
||||
Xoperation on the
|
||||
X.I directory stream.
|
||||
XThe new position reverts to the one associated with the
|
||||
X.I directory stream
|
||||
Xwhen the
|
||||
X.I telldir
|
||||
Xoperation was performed.
|
||||
XValues returned by
|
||||
X.I telldir
|
||||
Xare good only for the lifetime of the DIR pointer from
|
||||
Xwhich they are derived.
|
||||
XIf the directory is closed and then reopened,
|
||||
Xthe
|
||||
X.I telldir
|
||||
Xvalue may be invalidated
|
||||
Xdue to undetected directory compaction in 4.2BSD.
|
||||
XIt is safe to use a previous
|
||||
X.I telldir
|
||||
Xvalue immediately after a call to
|
||||
X.I opendir
|
||||
Xand before any calls to
|
||||
X.I readdir.
|
||||
X.PP
|
||||
X.I Rewinddir
|
||||
Xresets the position of the named
|
||||
X.I directory stream
|
||||
Xto the beginning of the directory.
|
||||
X.PP
|
||||
X.I Closedir
|
||||
Xcauses the named
|
||||
X.I directory stream
|
||||
Xto be closed,
|
||||
Xand the structure associated with the DIR pointer to be freed.
|
||||
X.PP
|
||||
XA
|
||||
X.I direct
|
||||
Xstructure is as follows:
|
||||
X.PP
|
||||
X.RS
|
||||
X.nf
|
||||
Xstruct direct {
|
||||
X /* unsigned */ long d_ino; /* inode number of entry */
|
||||
X unsigned short d_reclen; /* length of this record */
|
||||
X unsigned short d_namlen; /* length of string in d_name */
|
||||
X char d_name[MAXNAMLEN + 1]; /* name must be no longer than this */
|
||||
X};
|
||||
X.fi
|
||||
X.RE
|
||||
X.PP
|
||||
XThe
|
||||
X.I d_reclen
|
||||
Xfield is meaningless in non-4.2BSD systems and should be ignored.
|
||||
XThe use of a
|
||||
X.I long
|
||||
Xfor
|
||||
X.I d_ino
|
||||
Xis also a 4.2BSDism;
|
||||
X.I ino_t
|
||||
X(see
|
||||
X.IR types (5))
|
||||
Xshould be used elsewhere.
|
||||
XThe macro
|
||||
X.I DIRSIZ(dp)
|
||||
Xgives the minimum memory size needed to hold the
|
||||
X.I direct
|
||||
Xvalue pointed to by
|
||||
X.IR dp ,
|
||||
Xwith the minimum necessary allocation for
|
||||
X.IR d_name .
|
||||
X.PP
|
||||
XThe preferred way to search the current directory for entry ``name'' is:
|
||||
X.PP
|
||||
X.RS
|
||||
X.nf
|
||||
X len = strlen(name);
|
||||
X dirp = opendir(".");
|
||||
X if (dirp == NULL) {
|
||||
X fprintf(stderr, "%s: can't read directory .\\n", argv[0]);
|
||||
X return NOT_FOUND;
|
||||
X }
|
||||
X while ((dp = readdir(dirp)) != NULL)
|
||||
X if (dp->d_namlen == len && strcmp(dp->d_name, name) == 0) {
|
||||
X closedir(dirp);
|
||||
X return FOUND;
|
||||
X }
|
||||
X closedir(dirp);
|
||||
X return NOT_FOUND;
|
||||
X.RE
|
||||
X.\".SH LINKING
|
||||
X.\"This library is accessed by specifying ``-lndir'' as the
|
||||
X.\"last argument to the compile line, e.g.:
|
||||
X.\".PP
|
||||
X.\" cc -I/usr/include/ndir -o prog prog.c -lndir
|
||||
X.SH "SEE ALSO"
|
||||
Xopen(2),
|
||||
Xclose(2),
|
||||
Xread(2),
|
||||
Xlseek(2)
|
||||
X.SH HISTORY
|
||||
XWritten by
|
||||
XKirk McKusick at Berkeley (ucbvax!mckusick).
|
||||
XMiscellaneous bug fixes from elsewhere.
|
||||
XThe size of the data structure has been decreased to avoid excessive
|
||||
Xspace waste under V7 (where filenames are 14 characters at most).
|
||||
XFor obscure historical reasons, the include file is also available
|
||||
Xas
|
||||
X.IR <ndir/sys/dir.h> .
|
||||
XThe Berkeley version lived in a separate library (\fI\-lndir\fR),
|
||||
Xwhereas ours is
|
||||
Xpart of the C library, although the separate library is retained to
|
||||
Xmaximize compatibility.
|
||||
X.PP
|
||||
XThis manual page has been substantially rewritten to be informative in
|
||||
Xthe absence of a 4.2BSD manual.
|
||||
X.SH BUGS
|
||||
XThe
|
||||
X.I DIRSIZ
|
||||
Xmacro actually wastes a bit of space due to some padding requirements
|
||||
Xthat are an artifact of 4.2BSD.
|
||||
X.PP
|
||||
XThe returned value of
|
||||
X.I readdir
|
||||
Xpoints to a static area that will be overwritten by subsequent calls.
|
||||
X.PP
|
||||
XThere are some unfortunate name conflicts with the \fIreal\fR V7
|
||||
Xdirectory structure definitions.
|
||||
!
|
||||
echo 'dir.h':
|
||||
sed 's/^X//' >'dir.h' <<'!'
|
||||
X/* dir.h 4.4 82/07/25 */
|
||||
X
|
||||
X/*
|
||||
X * A directory consists of some number of blocks of DIRBLKSIZ
|
||||
X * bytes, where DIRBLKSIZ is chosen such that it can be transferred
|
||||
X * to disk in a single atomic operation (e.g. 512 bytes on most machines).
|
||||
X *
|
||||
X * Each DIRBLKSIZ byte block contains some number of directory entry
|
||||
X * structures, which are of variable length. Each directory entry has
|
||||
X * a struct direct at the front of it, containing its inode number,
|
||||
X * the length of the entry, and the length of the name contained in
|
||||
X * the entry. These are followed by the name padded to a 4 byte boundary
|
||||
X * with null bytes. All names are guaranteed null terminated.
|
||||
X * The maximum length of a name in a directory is MAXNAMLEN.
|
||||
X *
|
||||
X * The macro DIRSIZ(dp) gives the amount of space required to represent
|
||||
X * a directory entry. Free space in a directory is represented by
|
||||
X * entries which have dp->d_reclen >= DIRSIZ(dp). All DIRBLKSIZ bytes
|
||||
X * in a directory block are claimed by the directory entries. This
|
||||
X * usually results in the last entry in a directory having a large
|
||||
X * dp->d_reclen. When entries are deleted from a directory, the
|
||||
X * space is returned to the previous entry in the same directory
|
||||
X * block by increasing its dp->d_reclen. If the first entry of
|
||||
X * a directory block is free, then its dp->d_ino is set to 0.
|
||||
X * Entries other than the first in a directory do not normally have
|
||||
X * dp->d_ino set to 0.
|
||||
X */
|
||||
X#define DIRBLKSIZ 512
|
||||
X#ifdef VMUNIX
|
||||
X#define MAXNAMLEN 255
|
||||
X#else
|
||||
X#define MAXNAMLEN 14
|
||||
X#endif
|
||||
X
|
||||
Xstruct direct {
|
||||
X /* unsigned */ long d_ino; /* inode number of entry */
|
||||
X unsigned short d_reclen; /* length of this record */
|
||||
X unsigned short d_namlen; /* length of string in d_name */
|
||||
X char d_name[MAXNAMLEN + 1]; /* name must be no longer than this */
|
||||
X};
|
||||
X
|
||||
X/*
|
||||
X * The DIRSIZ macro gives the minimum record length which will hold
|
||||
X * the directory entry. This requires the amount of space in struct direct
|
||||
X * without the d_name field, plus enough space for the name with a terminating
|
||||
X * null byte (dp->d_namlen+1), rounded up to a 4 byte boundary.
|
||||
X */
|
||||
X#undef DIRSIZ
|
||||
X#define DIRSIZ(dp) \
|
||||
X ((sizeof (struct direct) - (MAXNAMLEN+1)) + (((dp)->d_namlen+1 + 3) &~ 3))
|
||||
X
|
||||
X#ifndef KERNEL
|
||||
X/*
|
||||
X * Definitions for library routines operating on directories.
|
||||
X */
|
||||
Xtypedef struct _dirdesc {
|
||||
X int dd_fd;
|
||||
X long dd_loc;
|
||||
X long dd_size;
|
||||
X char dd_buf[DIRBLKSIZ];
|
||||
X} DIR;
|
||||
X#ifndef NULL
|
||||
X#define NULL 0
|
||||
X#endif
|
||||
Xextern DIR *opendir();
|
||||
Xextern struct direct *readdir();
|
||||
Xextern long telldir();
|
||||
X#ifdef void
|
||||
Xextern void seekdir();
|
||||
Xextern void closedir();
|
||||
X#endif
|
||||
X#define rewinddir(dirp) seekdir((dirp), (long)0)
|
||||
X#endif KERNEL
|
||||
!
|
||||
echo 'makefile':
|
||||
sed 's/^X//' >'makefile' <<'!'
|
||||
XDIR = closedir.o opendir.o readdir.o seekdir.o telldir.o
|
||||
XCFLAGS=-O -I. -Dvoid=int
|
||||
XDEST=..
|
||||
X
|
||||
Xall: $(DIR)
|
||||
X
|
||||
Xmv: $(DIR)
|
||||
X mv $(DIR) $(DEST)
|
||||
X
|
||||
Xcpif: dir.h
|
||||
X cp dir.h /usr/include/ndir.h
|
||||
X
|
||||
Xclean:
|
||||
X rm -f *.o
|
||||
!
|
||||
echo 'closedir.c':
|
||||
sed 's/^X//' >'closedir.c' <<'!'
|
||||
Xstatic char sccsid[] = "@(#)closedir.c 4.2 3/10/82";
|
||||
X
|
||||
X#include <sys/types.h>
|
||||
X#include <dir.h>
|
||||
X
|
||||
X/*
|
||||
X * close a directory.
|
||||
X */
|
||||
Xvoid
|
||||
Xclosedir(dirp)
|
||||
X register DIR *dirp;
|
||||
X{
|
||||
X close(dirp->dd_fd);
|
||||
X dirp->dd_fd = -1;
|
||||
X dirp->dd_loc = 0;
|
||||
X free((char *)dirp);
|
||||
X}
|
||||
!
|
||||
echo 'opendir.c':
|
||||
sed 's/^X//' >'opendir.c' <<'!'
|
||||
X/* Copyright (c) 1982 Regents of the University of California */
|
||||
X
|
||||
Xstatic char sccsid[] = "@(#)opendir.c 4.4 11/12/82";
|
||||
X
|
||||
X#include <sys/types.h>
|
||||
X#include <sys/stat.h>
|
||||
X#include <dir.h>
|
||||
X
|
||||
X/*
|
||||
X * open a directory.
|
||||
X */
|
||||
XDIR *
|
||||
Xopendir(name)
|
||||
X char *name;
|
||||
X{
|
||||
X register DIR *dirp;
|
||||
X register int fd;
|
||||
X struct stat statbuf;
|
||||
X char *malloc();
|
||||
X
|
||||
X if ((fd = open(name, 0)) == -1)
|
||||
X return NULL;
|
||||
X if (fstat(fd, &statbuf) == -1 || !(statbuf.st_mode & S_IFDIR)) {
|
||||
X close(fd);
|
||||
X return NULL;
|
||||
X }
|
||||
X if ((dirp = (DIR *)malloc(sizeof(DIR))) == NULL) {
|
||||
X close (fd);
|
||||
X return NULL;
|
||||
X }
|
||||
X dirp->dd_fd = fd;
|
||||
X dirp->dd_loc = 0;
|
||||
X dirp->dd_size = 0; /* so that telldir will work before readdir */
|
||||
X return dirp;
|
||||
X}
|
||||
!
|
||||
echo 'readdir.c':
|
||||
sed 's/^X//' >'readdir.c' <<'!'
|
||||
X/* Copyright (c) 1982 Regents of the University of California */
|
||||
X
|
||||
Xstatic char sccsid[] = "@(#)readdir.c 4.3 8/8/82";
|
||||
X
|
||||
X#include <sys/types.h>
|
||||
X#include <dir.h>
|
||||
X
|
||||
X/*
|
||||
X * read an old stlye directory entry and present it as a new one
|
||||
X */
|
||||
X#define ODIRSIZ 14
|
||||
X
|
||||
Xstruct olddirect {
|
||||
X ino_t od_ino;
|
||||
X char od_name[ODIRSIZ];
|
||||
X};
|
||||
X
|
||||
X/*
|
||||
X * get next entry in a directory.
|
||||
X */
|
||||
Xstruct direct *
|
||||
Xreaddir(dirp)
|
||||
X register DIR *dirp;
|
||||
X{
|
||||
X register struct olddirect *dp;
|
||||
X static struct direct dir;
|
||||
X
|
||||
X for (;;) {
|
||||
X if (dirp->dd_loc == 0) {
|
||||
X dirp->dd_size = read(dirp->dd_fd, dirp->dd_buf,
|
||||
X DIRBLKSIZ);
|
||||
X if (dirp->dd_size <= 0) {
|
||||
X dirp->dd_size = 0;
|
||||
X return NULL;
|
||||
X }
|
||||
X }
|
||||
X if (dirp->dd_loc >= dirp->dd_size) {
|
||||
X dirp->dd_loc = 0;
|
||||
X continue;
|
||||
X }
|
||||
X dp = (struct olddirect *)(dirp->dd_buf + dirp->dd_loc);
|
||||
X dirp->dd_loc += sizeof(struct olddirect);
|
||||
X if (dp->od_ino == 0)
|
||||
X continue;
|
||||
X dir.d_ino = dp->od_ino;
|
||||
X strncpy(dir.d_name, dp->od_name, ODIRSIZ);
|
||||
X dir.d_name[ODIRSIZ] = '\0'; /* insure null termination */
|
||||
X dir.d_namlen = strlen(dir.d_name);
|
||||
X dir.d_reclen = DIRBLKSIZ;
|
||||
X return (&dir);
|
||||
X }
|
||||
X}
|
||||
!
|
||||
echo 'seekdir.c':
|
||||
sed 's/^X//' >'seekdir.c' <<'!'
|
||||
Xstatic char sccsid[] = "@(#)seekdir.c 4.9 3/25/83";
|
||||
X
|
||||
X#include <sys/param.h>
|
||||
X#include <dir.h>
|
||||
X
|
||||
X/*
|
||||
X * seek to an entry in a directory.
|
||||
X * Only values returned by "telldir" should be passed to seekdir.
|
||||
X */
|
||||
Xvoid
|
||||
Xseekdir(dirp, loc)
|
||||
X register DIR *dirp;
|
||||
X long loc;
|
||||
X{
|
||||
X long curloc, base, offset;
|
||||
X struct direct *dp;
|
||||
X extern long lseek();
|
||||
X
|
||||
X curloc = telldir(dirp);
|
||||
X if (loc == curloc)
|
||||
X return;
|
||||
X base = loc & ~(DIRBLKSIZ - 1);
|
||||
X offset = loc & (DIRBLKSIZ - 1);
|
||||
X (void) lseek(dirp->dd_fd, base, 0);
|
||||
X dirp->dd_size = 0;
|
||||
X dirp->dd_loc = 0;
|
||||
X while (dirp->dd_loc < offset) {
|
||||
X dp = readdir(dirp);
|
||||
X if (dp == NULL)
|
||||
X return;
|
||||
X }
|
||||
X}
|
||||
!
|
||||
echo 'telldir.c':
|
||||
sed 's/^X//' >'telldir.c' <<'!'
|
||||
Xstatic char sccsid[] = "@(#)telldir.c 4.1 2/21/82";
|
||||
X
|
||||
X#include <sys/types.h>
|
||||
X#include <dir.h>
|
||||
X
|
||||
X/*
|
||||
X * return a pointer into a directory
|
||||
X */
|
||||
Xlong
|
||||
Xtelldir(dirp)
|
||||
X DIR *dirp;
|
||||
X{
|
||||
X long lseek();
|
||||
X
|
||||
X return (lseek(dirp->dd_fd, 0L, 1) - dirp->dd_size + dirp->dd_loc);
|
||||
X}
|
||||
!
|
||||
echo done
|
112
contrib/cvs/contrib/intro.doc
Normal file
112
contrib/cvs/contrib/intro.doc
Normal file
@ -0,0 +1,112 @@
|
||||
Date: Tue, 16 Jun 1992 17:05:23 +0200
|
||||
From: Steven.Pemberton@cwi.nl
|
||||
Message-Id: <9206161505.AA06927.steven@sijs.cwi.nl>
|
||||
To: berliner@Sun.COM
|
||||
Subject: cvs
|
||||
|
||||
INTRODUCTION TO USING CVS
|
||||
|
||||
CVS is a system that lets groups of people work simultaneously on
|
||||
groups of files (for instance program sources).
|
||||
|
||||
It works by holding a central 'repository' of the most recent version
|
||||
of the files. You may at any time create a personal copy of these
|
||||
files; if at a later date newer versions of the files are put in the
|
||||
repository, you can 'update' your copy.
|
||||
|
||||
You may edit your copy of the files freely. If new versions of the
|
||||
files have been put in the repository in the meantime, doing an update
|
||||
merges the changes in the central copy into your copy.
|
||||
(It can be that when you do an update, the changes in the
|
||||
central copy clash with changes you have made in your own
|
||||
copy. In this case cvs warns you, and you have to resolve the
|
||||
clash in your copy.)
|
||||
|
||||
When you are satisfied with the changes you have made in your copy of
|
||||
the files, you can 'commit' them into the central repository.
|
||||
(When you do a commit, if you haven't updated to the most
|
||||
recent version of the files, cvs tells you this; then you have
|
||||
to first update, resolve any possible clashes, and then redo
|
||||
the commit.)
|
||||
|
||||
USING CVS
|
||||
|
||||
Suppose that a number of repositories have been stored in
|
||||
/usr/src/cvs. Whenever you use cvs, the environment variable
|
||||
CVSROOT must be set to this (for some reason):
|
||||
|
||||
CVSROOT=/usr/src/cvs
|
||||
export CVSROOT
|
||||
|
||||
TO CREATE A PERSONAL COPY OF A REPOSITORY
|
||||
|
||||
Suppose you want a copy of the files in repository 'views' to be
|
||||
created in your directory src. Go to the place where you want your
|
||||
copy of the directory, and do a 'checkout' of the directory you
|
||||
want:
|
||||
|
||||
cd $HOME/src
|
||||
cvs checkout views
|
||||
|
||||
This creates a directory called (in this case) 'views' in the src
|
||||
directory, containing a copy of the files, which you may now work
|
||||
on to your heart's content.
|
||||
|
||||
TO UPDATE YOUR COPY
|
||||
|
||||
Use the command 'cvs update'.
|
||||
|
||||
This will update your copy with any changes from the central
|
||||
repository, telling you which files have been updated (their names
|
||||
are displayed with a U before them), and which have been modified
|
||||
by you and not yet committed (preceded by an M). You will be
|
||||
warned of any files that contain clashes, the clashes will be
|
||||
marked in the file surrounded by lines of the form <<<< and >>>>.
|
||||
|
||||
TO COMMIT YOUR CHANGES
|
||||
|
||||
Use the command 'cvs commit'.
|
||||
|
||||
You will be put in an editor to make a message that describes the
|
||||
changes that you have made (for future reference). Your changes
|
||||
will then be added to the central copy.
|
||||
|
||||
ADDING AND REMOVING FILES
|
||||
|
||||
It can be that the changes you want to make involve a completely
|
||||
new file, or removing an existing one. The commands to use here
|
||||
are:
|
||||
|
||||
cvs add <filename>
|
||||
cvs remove <filename>
|
||||
|
||||
You still have to do a commit after these commands. You may make
|
||||
any number of new files in your copy of the repository, but they
|
||||
will not be committed to the central copy unless you do a 'cvs add'.
|
||||
|
||||
OTHER USEFUL COMMANDS AND HINTS
|
||||
|
||||
To see the commit messages for files, and who made them, use:
|
||||
|
||||
cvs log [filenames]
|
||||
|
||||
To see the differences between your version and the central version:
|
||||
|
||||
cvs diff [filenames]
|
||||
|
||||
To give a file a new name, rename it and do an add and a remove.
|
||||
|
||||
To lose your changes and go back to the version from the
|
||||
repository, delete the file and do an update.
|
||||
|
||||
After an update where there have been clashes, your original
|
||||
version of the file is saved as .#file.version.
|
||||
|
||||
All the cvs commands mentioned accept a flag '-n', that doesn't do
|
||||
the action, but lets you see what would happen. For instance, you
|
||||
can use 'cvs -n update' to see which files would be updated.
|
||||
|
||||
MORE INFORMATION
|
||||
|
||||
This is necessarily a very brief introduction. See the manual page
|
||||
(man cvs) for full details.
|
169
contrib/cvs/contrib/log.pl
Normal file
169
contrib/cvs/contrib/log.pl
Normal file
@ -0,0 +1,169 @@
|
||||
#! 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!
|
||||
#
|
||||
|
||||
# Usage: log.pl [[-m user] ...] [-s] -f logfile 'dirname file ...'
|
||||
#
|
||||
# -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:
|
||||
#
|
||||
# From: woods@kuma.domain.top
|
||||
# Subject: CVS update: testmodule
|
||||
#
|
||||
# Date: Wednesday November 23, 1994 @ 14:15
|
||||
# Author: woods
|
||||
#
|
||||
# Update of /local/src-CVS/testmodule
|
||||
# In directory kuma:/home/kuma/woods/work.d/testmodule
|
||||
#
|
||||
# Modified Files:
|
||||
# test3
|
||||
# Added Files:
|
||||
# test6
|
||||
# Removed Files:
|
||||
# test4
|
||||
# Log Message:
|
||||
# - wow, what a test
|
||||
#
|
||||
# (and for each file the "cvs status -v" output is appended unless -s is used)
|
||||
#
|
||||
# ==================================================================
|
||||
# File: test3 Status: Up-to-date
|
||||
#
|
||||
# Working revision: 1.41 Wed Nov 23 14:15:59 1994
|
||||
# Repository revision: 1.41 /local/src-CVS/cvs/testmodule/test3,v
|
||||
# Sticky Options: -ko
|
||||
#
|
||||
# Existing Tags:
|
||||
# local-v2 (revision: 1.7)
|
||||
# local-v1 (revision: 1.1.1.2)
|
||||
# CVS-1_4A2 (revision: 1.1.1.2)
|
||||
# local-v0 (revision: 1.2)
|
||||
# CVS-1_4A1 (revision: 1.1.1.1)
|
||||
# CVS (branch: 1.1.1)
|
||||
|
||||
$cvsroot = $ENV{'CVSROOT'};
|
||||
|
||||
# turn off setgid
|
||||
#
|
||||
$) = $(;
|
||||
|
||||
$dostatus = 1;
|
||||
|
||||
# parse command line arguments
|
||||
#
|
||||
while (@ARGV) {
|
||||
$arg = shift @ARGV;
|
||||
|
||||
if ($arg eq '-m') {
|
||||
$users = "$users " . shift @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;
|
||||
@files = split(/ /, $arg);
|
||||
}
|
||||
}
|
||||
|
||||
# the first argument is the module location relative to $CVSROOT
|
||||
#
|
||||
$modulepath = shift @files;
|
||||
|
||||
$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);
|
||||
@days = (Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday);
|
||||
|
||||
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime;
|
||||
|
||||
# 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";
|
||||
}
|
||||
|
||||
# print out the log Header
|
||||
#
|
||||
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";
|
||||
|
||||
if (MAIL) {
|
||||
print MAIL "\n";
|
||||
print MAIL "Date:\t$days[$wday] $mos[$mon] $mday, 19$year @ $hour:" . sprintf("%02d", $min) . "\n";
|
||||
print MAIL "Author:\t$login\n\n";
|
||||
}
|
||||
|
||||
# print the stuff from logmsg that comes in on stdin to the logfile
|
||||
#
|
||||
open(IN, "-");
|
||||
while (<IN>) {
|
||||
print OUT $_;
|
||||
if (MAIL) {
|
||||
print MAIL $_;
|
||||
}
|
||||
}
|
||||
close(IN);
|
||||
|
||||
print OUT "\n";
|
||||
|
||||
# after log information, do an 'cvs -Qq status -v' on each file in the arguments.
|
||||
#
|
||||
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;
|
||||
}
|
||||
open(RCS, "-|") || exec 'cvs', '-nQq', 'status', '-v', $file;
|
||||
while (<RCS>) {
|
||||
print OUT;
|
||||
if (MAIL) {
|
||||
print MAIL;
|
||||
}
|
||||
}
|
||||
close(RCS);
|
||||
}
|
||||
}
|
||||
|
||||
close(OUT);
|
||||
die "Write to $logfile failed" if $?;
|
||||
|
||||
close(MAIL);
|
||||
die "Pipe to $mailcmd failed" if $?;
|
||||
|
||||
## must exit cleanly
|
||||
##
|
||||
exit 0;
|
560
contrib/cvs/contrib/log_accum.pl
Normal file
560
contrib/cvs/contrib/log_accum.pl
Normal file
@ -0,0 +1,560 @@
|
||||
#! xPERL_PATHx
|
||||
# -*-Perl-*-
|
||||
#
|
||||
#ident "@(#)ccvs/contrib:$Name: $:$Id: log_accum.pl,v 1.4 1996/03/06 15:27:09 woods Exp $"
|
||||
#
|
||||
# Perl filter to handle the log messages from the checkin of files in
|
||||
# a directory. This script will group the lists of files by log
|
||||
# message, and mail a single consolidated log message at the end of
|
||||
# the commit.
|
||||
#
|
||||
# This file assumes a pre-commit checking program that leaves the
|
||||
# names of the first and last commit directories in a temporary file.
|
||||
#
|
||||
# Contributed by David Hampton <hampton@cisco.com>
|
||||
#
|
||||
# hacked greatly by Greg A. Woods <woods@planix.com>
|
||||
|
||||
# Usage: log_accum.pl [-d] [-s] [-M module] [[-m mailto] ...] [[-R replyto] ...] [-f logfile]
|
||||
# -d - turn on debugging
|
||||
# -m mailto - send mail to "mailto" (multiple)
|
||||
# -R replyto - set the "Reply-To:" to "replyto" (multiple)
|
||||
# -M modulename - set module name to "modulename"
|
||||
# -f logfile - write commit messages to logfile too
|
||||
# -s - *don't* run "cvs status -v" for each file
|
||||
|
||||
#
|
||||
# Configurable options
|
||||
#
|
||||
|
||||
# set this to something that takes a whole message on stdin
|
||||
$MAILER = "/usr/lib/sendmail -t";
|
||||
|
||||
#
|
||||
# End user configurable options.
|
||||
#
|
||||
|
||||
# Constants (don't change these!)
|
||||
#
|
||||
$STATE_NONE = 0;
|
||||
$STATE_CHANGED = 1;
|
||||
$STATE_ADDED = 2;
|
||||
$STATE_REMOVED = 3;
|
||||
$STATE_LOG = 4;
|
||||
|
||||
$LAST_FILE = "/tmp/#cvs.lastdir";
|
||||
|
||||
$CHANGED_FILE = "/tmp/#cvs.files.changed";
|
||||
$ADDED_FILE = "/tmp/#cvs.files.added";
|
||||
$REMOVED_FILE = "/tmp/#cvs.files.removed";
|
||||
$LOG_FILE = "/tmp/#cvs.files.log";
|
||||
|
||||
$FILE_PREFIX = "#cvs.files";
|
||||
|
||||
#
|
||||
# Subroutines
|
||||
#
|
||||
|
||||
sub cleanup_tmpfiles {
|
||||
local($wd, @files);
|
||||
|
||||
$wd = `pwd`;
|
||||
chdir("/tmp") || die("Can't chdir('/tmp')\n");
|
||||
opendir(DIR, ".");
|
||||
push(@files, grep(/^$FILE_PREFIX\..*\.$id$/, readdir(DIR)));
|
||||
closedir(DIR);
|
||||
foreach (@files) {
|
||||
unlink $_;
|
||||
}
|
||||
unlink $LAST_FILE . "." . $id;
|
||||
|
||||
chdir($wd);
|
||||
}
|
||||
|
||||
sub write_logfile {
|
||||
local($filename, @lines) = @_;
|
||||
|
||||
open(FILE, ">$filename") || die("Cannot open log file $filename.\n");
|
||||
print FILE join("\n", @lines), "\n";
|
||||
close(FILE);
|
||||
}
|
||||
|
||||
sub append_to_logfile {
|
||||
local($filename, @lines) = @_;
|
||||
|
||||
open(FILE, ">$filename") || die("Cannot open log file $filename.\n");
|
||||
print FILE join("\n", @lines), "\n";
|
||||
close(FILE);
|
||||
}
|
||||
|
||||
sub format_names {
|
||||
local($dir, @files) = @_;
|
||||
local(@lines);
|
||||
|
||||
$format = "\t%-" . sprintf("%d", length($dir)) . "s%s ";
|
||||
|
||||
$lines[0] = sprintf($format, $dir, ":");
|
||||
|
||||
if ($debug) {
|
||||
print STDERR "format_names(): dir = ", $dir, "; files = ", join(":", @files), ".\n";
|
||||
}
|
||||
foreach $file (@files) {
|
||||
if (length($lines[$#lines]) + length($file) > 65) {
|
||||
$lines[++$#lines] = sprintf($format, " ", " ");
|
||||
}
|
||||
$lines[$#lines] .= $file . " ";
|
||||
}
|
||||
|
||||
@lines;
|
||||
}
|
||||
|
||||
sub format_lists {
|
||||
local(@lines) = @_;
|
||||
local(@text, @files, $lastdir);
|
||||
|
||||
if ($debug) {
|
||||
print STDERR "format_lists(): ", join(":", @lines), "\n";
|
||||
}
|
||||
@text = ();
|
||||
@files = ();
|
||||
$lastdir = shift @lines; # first thing is always a directory
|
||||
if ($lastdir !~ /.*\/$/) {
|
||||
die("Damn, $lastdir doesn't look like a directory!\n");
|
||||
}
|
||||
foreach $line (@lines) {
|
||||
if ($line =~ /.*\/$/) {
|
||||
push(@text, &format_names($lastdir, @files));
|
||||
$lastdir = $line;
|
||||
@files = ();
|
||||
} else {
|
||||
push(@files, $line);
|
||||
}
|
||||
}
|
||||
push(@text, &format_names($lastdir, @files));
|
||||
|
||||
@text;
|
||||
}
|
||||
|
||||
sub append_names_to_file {
|
||||
local($filename, $dir, @files) = @_;
|
||||
|
||||
if (@files) {
|
||||
open(FILE, ">>$filename") || die("Cannot open file $filename.\n");
|
||||
print FILE $dir, "\n";
|
||||
print FILE join("\n", @files), "\n";
|
||||
close(FILE);
|
||||
}
|
||||
}
|
||||
|
||||
sub read_line {
|
||||
local($line);
|
||||
local($filename) = @_;
|
||||
|
||||
open(FILE, "<$filename") || die("Cannot open file $filename.\n");
|
||||
$line = <FILE>;
|
||||
close(FILE);
|
||||
chop($line);
|
||||
$line;
|
||||
}
|
||||
|
||||
sub read_logfile {
|
||||
local(@text);
|
||||
local($filename, $leader) = @_;
|
||||
|
||||
open(FILE, "<$filename");
|
||||
while (<FILE>) {
|
||||
chop;
|
||||
push(@text, $leader.$_);
|
||||
}
|
||||
close(FILE);
|
||||
@text;
|
||||
}
|
||||
|
||||
sub build_header {
|
||||
local($header);
|
||||
local($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
|
||||
$header = sprintf("CVSROOT:\t%s\nModule name:\t%s\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(@text) = @_;
|
||||
|
||||
# if only we had strftime()... stuff stolen from perl's ctime.pl:
|
||||
local($[) = 0;
|
||||
|
||||
@DoW = ('Sun','Mon','Tue','Wed','Thu','Fri','Sat');
|
||||
@MoY = ('Jan','Feb','Mar','Apr','May','Jun',
|
||||
'Jul','Aug','Sep','Oct','Nov','Dec');
|
||||
|
||||
# Determine what time zone is in effect.
|
||||
# Use GMT if TZ is defined as null, local time if TZ undefined.
|
||||
# There's no portable way to find the system default timezone.
|
||||
#
|
||||
$TZ = defined($ENV{'TZ'}) ? ( $ENV{'TZ'} ? $ENV{'TZ'} : 'GMT' ) : '';
|
||||
|
||||
# Hack to deal with 'PST8PDT' format of TZ
|
||||
# Note that this can't deal with all the esoteric forms, but it
|
||||
# does recognize the most common: [:]STDoff[DST[off][,rule]]
|
||||
#
|
||||
if ($TZ =~ /^([^:\d+\-,]{3,})([+-]?\d{1,2}(:\d{1,2}){0,2})([^\d+\-,]{3,})?/) {
|
||||
$TZ = $isdst ? $4 : $1;
|
||||
$tzoff = sprintf("%05d", -($2) * 100);
|
||||
}
|
||||
|
||||
# perl-4.036 doesn't have the $zone or $gmtoff...
|
||||
($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst, $zone, $gmtoff) =
|
||||
($TZ eq 'GMT') ? gmtime(time) : localtime(time);
|
||||
|
||||
$year += ($year < 70) ? 2000 : 1900;
|
||||
|
||||
if ($gmtoff != 0) {
|
||||
$tzoff = sprintf("%05d", ($gmtoff / 60) * 100);
|
||||
}
|
||||
if ($zone ne '') {
|
||||
$TZ = $zone;
|
||||
}
|
||||
|
||||
# ok, let's try....
|
||||
$rfc822date = sprintf("%s, %2d %s %4d %2d:%02d:%02d %s (%s)",
|
||||
$DoW[$wday], $mday, $MoY[$mon], $year,
|
||||
$hour, $min, $sec, $tzoff, $TZ);
|
||||
|
||||
open(MAIL, "| $MAILER");
|
||||
print MAIL "Date: " . $rfc822date . "\n";
|
||||
print MAIL "Subject: CVS Update: " . $modulename . "\n";
|
||||
print MAIL "To: " . $mailto . "\n";
|
||||
print MAIL "From: " . $login . "@" . $hostdomain . "\n";
|
||||
print MAIL "Reply-To: " . $replyto . "\n";
|
||||
print MAIL "\n";
|
||||
print MAIL join("\n", @text), "\n";
|
||||
close(MAIL);
|
||||
}
|
||||
|
||||
sub write_commitlog {
|
||||
local($logfile, @text) = @_;
|
||||
|
||||
open(FILE, ">>$logfile");
|
||||
print FILE join("\n", @text), "\n";
|
||||
close(FILE);
|
||||
}
|
||||
|
||||
#
|
||||
# Main Body
|
||||
#
|
||||
|
||||
# Initialize basic variables
|
||||
#
|
||||
$debug = 0;
|
||||
$id = getpgrp(); # note, you *must* use a shell which does setpgrp()
|
||||
$state = $STATE_NONE;
|
||||
$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') {
|
||||
if ($mailto eq '') {
|
||||
$mailto = shift @ARGV;
|
||||
} else {
|
||||
$mailto = $mailto . ", " . shift @ARGV;
|
||||
}
|
||||
} elsif ($arg eq '-R') {
|
||||
if ($replyto eq '') {
|
||||
$replyto = shift @ARGV;
|
||||
} else {
|
||||
$replyto = $replyto . ", " . shift @ARGV;
|
||||
}
|
||||
} elsif ($arg eq '-M') {
|
||||
$modulename = shift @ARGV;
|
||||
} elsif ($arg eq '-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 mail recipient specified (use -m)\n");
|
||||
if ($replyto eq '') {
|
||||
$replyto = $login;
|
||||
}
|
||||
|
||||
# for now, the first "file" is the repository directory being committed,
|
||||
# relative to the $CVSROOT location
|
||||
#
|
||||
@path = split('/', $files[0]);
|
||||
|
||||
# XXX there are some ugly assumptions in here about module names and
|
||||
# XXX directories relative to the $CVSROOT location -- really should
|
||||
# XXX read $CVSROOT/CVSROOT/modules, but that's not so easy to do, since
|
||||
# XXX we have to parse it backwards.
|
||||
#
|
||||
if ($modulename eq "") {
|
||||
$modulename = $path[0]; # I.e. the module name == top-level dir
|
||||
}
|
||||
if ($#path == 0) {
|
||||
$dir = ".";
|
||||
} else {
|
||||
$dir = join('/', @path);
|
||||
}
|
||||
$dir = $dir . "/";
|
||||
|
||||
if ($debug) {
|
||||
print STDERR "module - ", $modulename, "\n";
|
||||
print STDERR "dir - ", $dir, "\n";
|
||||
print STDERR "path - ", join(":", @path), "\n";
|
||||
print STDERR "files - ", join(":", @files), "\n";
|
||||
print STDERR "id - ", $id, "\n";
|
||||
}
|
||||
|
||||
# Check for a new directory first. This appears with files set as follows:
|
||||
#
|
||||
# files[0] - "path/name/newdir"
|
||||
# files[1] - "-"
|
||||
# files[2] - "New"
|
||||
# files[3] - "directory"
|
||||
#
|
||||
if ($files[2] =~ /New/ && $files[3] =~ /directory/) {
|
||||
local(@text);
|
||||
|
||||
@text = ();
|
||||
push(@text, &build_header());
|
||||
push(@text, "");
|
||||
push(@text, $files[0]);
|
||||
push(@text, "");
|
||||
|
||||
while (<STDIN>) {
|
||||
chop; # Drop the newline
|
||||
push(@text, $_);
|
||||
}
|
||||
|
||||
&mail_notification($mailto, @text);
|
||||
|
||||
exit 0;
|
||||
}
|
||||
|
||||
# Check for an import command. This appears with files set as follows:
|
||||
#
|
||||
# files[0] - "path/name"
|
||||
# files[1] - "-"
|
||||
# files[2] - "Imported"
|
||||
# files[3] - "sources"
|
||||
#
|
||||
if ($files[2] =~ /Imported/ && $files[3] =~ /sources/) {
|
||||
local(@text);
|
||||
|
||||
@text = ();
|
||||
push(@text, &build_header());
|
||||
push(@text, "");
|
||||
push(@text, $files[0]);
|
||||
push(@text, "");
|
||||
|
||||
while (<STDIN>) {
|
||||
chop; # Drop the newline
|
||||
push(@text, $_);
|
||||
}
|
||||
|
||||
&mail_notification(@text);
|
||||
|
||||
exit 0;
|
||||
}
|
||||
|
||||
# Iterate over the body of the message collecting information.
|
||||
#
|
||||
while (<STDIN>) {
|
||||
chop; # Drop the newline
|
||||
|
||||
if (/^In directory/) {
|
||||
push(@log_lines, $_);
|
||||
push(@log_lines, "");
|
||||
next;
|
||||
}
|
||||
|
||||
if (/^Modified Files/) { $state = $STATE_CHANGED; next; }
|
||||
if (/^Added Files/) { $state = $STATE_ADDED; next; }
|
||||
if (/^Removed Files/) { $state = $STATE_REMOVED; next; }
|
||||
if (/^Log Message/) { $state = $STATE_LOG; next; }
|
||||
|
||||
s/^[ \t\n]+//; # delete leading whitespace
|
||||
s/[ \t\n]+$//; # delete trailing whitespace
|
||||
|
||||
if ($state == $STATE_CHANGED) { push(@changed_files, split); }
|
||||
if ($state == $STATE_ADDED) { push(@added_files, split); }
|
||||
if ($state == $STATE_REMOVED) { push(@removed_files, split); }
|
||||
if ($state == $STATE_LOG) { push(@log_lines, $_); }
|
||||
}
|
||||
|
||||
# Strip leading and trailing blank lines from the log message. Also
|
||||
# compress multiple blank lines in the body of the message down to a
|
||||
# single blank line.
|
||||
#
|
||||
while ($#log_lines > -1) {
|
||||
last if ($log_lines[0] ne "");
|
||||
shift(@log_lines);
|
||||
}
|
||||
while ($#log_lines > -1) {
|
||||
last if ($log_lines[$#log_lines] ne "");
|
||||
pop(@log_lines);
|
||||
}
|
||||
for ($i = $#log_lines; $i > 0; $i--) {
|
||||
if (($log_lines[$i - 1] eq "") && ($log_lines[$i] eq "")) {
|
||||
splice(@log_lines, $i, 1);
|
||||
}
|
||||
}
|
||||
|
||||
if ($debug) {
|
||||
print STDERR "Searching for log file index...";
|
||||
}
|
||||
# Find an index to a log file that matches this log message
|
||||
#
|
||||
for ($i = 0; ; $i++) {
|
||||
local(@text);
|
||||
|
||||
last if (! -e "$LOG_FILE.$i.$id"); # the next available one
|
||||
@text = &read_logfile("$LOG_FILE.$i.$id", "");
|
||||
last if ($#text == -1); # nothing in this file, use it
|
||||
last if (join(" ", @log_lines) eq join(" ", @text)); # it's the same log message as another
|
||||
}
|
||||
if ($debug) {
|
||||
print STDERR " found log file at $i.$id, now writing tmp files.\n";
|
||||
}
|
||||
|
||||
# Spit out the information gathered in this pass.
|
||||
#
|
||||
&append_names_to_file("$CHANGED_FILE.$i.$id", $dir, @changed_files);
|
||||
&append_names_to_file("$ADDED_FILE.$i.$id", $dir, @added_files);
|
||||
&append_names_to_file("$REMOVED_FILE.$i.$id", $dir, @removed_files);
|
||||
&write_logfile("$LOG_FILE.$i.$id", @log_lines);
|
||||
|
||||
# Check whether this is the last directory. If not, quit.
|
||||
#
|
||||
if ($debug) {
|
||||
print STDERR "Checking current dir against last dir.\n";
|
||||
}
|
||||
$_ = &read_line("$LAST_FILE.$id");
|
||||
|
||||
if ($_ ne $cvsroot . "/" . $files[0]) {
|
||||
if ($debug) {
|
||||
print STDERR sprintf("Current directory %s is not last directory %s.\n", $cvsroot . "/" .$files[0], $_);
|
||||
}
|
||||
exit 0;
|
||||
}
|
||||
if ($debug) {
|
||||
print STDERR sprintf("Current directory %s is last directory %s -- all commits done.\n", $files[0], $_);
|
||||
}
|
||||
|
||||
#
|
||||
# End Of Commits!
|
||||
#
|
||||
|
||||
# This is it. The commits are all finished. Lump everything together
|
||||
# into a single message, fire a copy off to the mailing list, and drop
|
||||
# it on the end of the Changes file.
|
||||
#
|
||||
|
||||
#
|
||||
# Produce the final compilation of the log messages
|
||||
#
|
||||
@text = ();
|
||||
@status_txt = ();
|
||||
push(@text, &build_header());
|
||||
push(@text, "");
|
||||
|
||||
for ($i = 0; ; $i++) {
|
||||
last if (! -e "$LOG_FILE.$i.$id"); # we're done them all!
|
||||
@lines = &read_logfile("$CHANGED_FILE.$i.$id", "");
|
||||
if ($#lines >= 0) {
|
||||
push(@text, "Modified files:");
|
||||
push(@text, &format_lists(@lines));
|
||||
}
|
||||
@lines = &read_logfile("$ADDED_FILE.$i.$id", "");
|
||||
if ($#lines >= 0) {
|
||||
push(@text, "Added files:");
|
||||
push(@text, &format_lists(@lines));
|
||||
}
|
||||
@lines = &read_logfile("$REMOVED_FILE.$i.$id", "");
|
||||
if ($#lines >= 0) {
|
||||
push(@text, "Removed files:");
|
||||
push(@text, &format_lists(@lines));
|
||||
}
|
||||
if ($#text >= 0) {
|
||||
push(@text, "");
|
||||
}
|
||||
@lines = &read_logfile("$LOG_FILE.$i.$id", "\t");
|
||||
if ($#lines >= 0) {
|
||||
push(@text, "Log message:");
|
||||
push(@text, @lines);
|
||||
push(@text, "");
|
||||
}
|
||||
if ($do_status) {
|
||||
local(@changed_files);
|
||||
|
||||
@changed_files = ();
|
||||
push(@changed_files, &read_logfile("$CHANGED_FILE.$i.$id", ""));
|
||||
push(@changed_files, &read_logfile("$ADDED_FILE.$i.$id", ""));
|
||||
push(@changed_files, &read_logfile("$REMOVED_FILE.$i.$id", ""));
|
||||
|
||||
if ($debug) {
|
||||
print STDERR "main: pre-sort changed_files = ", join(":", @changed_files), ".\n";
|
||||
}
|
||||
sort(@changed_files);
|
||||
if ($debug) {
|
||||
print STDERR "main: post-sort changed_files = ", join(":", @changed_files), ".\n";
|
||||
}
|
||||
|
||||
foreach $dofile (@changed_files) {
|
||||
if ($dofile =~ /\/$/) {
|
||||
next; # ignore the silly "dir" entries
|
||||
}
|
||||
if ($debug) {
|
||||
print STDERR "main(): doing 'cvs -nQq status -v $dofile'\n";
|
||||
}
|
||||
open(STATUS, "-|") || exec 'cvs', '-nQq', 'status', '-v', $dofile;
|
||||
while (<STATUS>) {
|
||||
chop;
|
||||
push(@status_txt, $_);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Write to the commitlog file
|
||||
#
|
||||
if ($commitlog) {
|
||||
&write_commitlog($commitlog, @text);
|
||||
}
|
||||
|
||||
if ($#status_txt >= 0) {
|
||||
push(@text, @status_txt);
|
||||
}
|
||||
|
||||
# Mailout the notification.
|
||||
#
|
||||
&mail_notification(@text);
|
||||
|
||||
# cleanup
|
||||
#
|
||||
if (! $debug) {
|
||||
&cleanup_tmpfiles();
|
||||
}
|
||||
|
||||
exit 0;
|
88
contrib/cvs/contrib/mfpipe.pl
Normal file
88
contrib/cvs/contrib/mfpipe.pl
Normal file
@ -0,0 +1,88 @@
|
||||
#! xPERL_PATHx
|
||||
# -*-Perl-*-
|
||||
#
|
||||
# From: clyne@niwot.scd.ucar.EDU (John Clyne)
|
||||
# Date: Fri, 28 Feb 92 09:54:21 MST
|
||||
#
|
||||
# BTW, i wrote a perl script that is similar to 'nfpipe' except that in
|
||||
# addition to logging to a file it provides a command line option for mailing
|
||||
# change notices to a group of users. Obviously you probably wouldn't want
|
||||
# to mail every change. But there may be certain directories that are commonly
|
||||
# accessed by a group of users who would benefit from an email notice.
|
||||
# Especially if they regularly beat on the same directory. Anyway if you
|
||||
# think anyone would be interested here it is.
|
||||
#
|
||||
# $Id: mfpipe.pl,v 1.2 1995/07/10 02:01:57 kfogel Exp $
|
||||
#
|
||||
#
|
||||
# File: mfpipe
|
||||
#
|
||||
# Author: John Clyne
|
||||
# National Center for Atmospheric Research
|
||||
# PO 3000, Boulder, Colorado
|
||||
#
|
||||
# Date: Wed Feb 26 18:34:53 MST 1992
|
||||
#
|
||||
# Description: Tee standard input to mail a list of users and to
|
||||
# a file. Used by CVS logging.
|
||||
#
|
||||
# Usage: mfpipe [-f file] [user@host...]
|
||||
#
|
||||
# Environment: CVSROOT
|
||||
# Path to CVS root.
|
||||
#
|
||||
# Files:
|
||||
#
|
||||
#
|
||||
# Options: -f file
|
||||
# Capture output to 'file'
|
||||
#
|
||||
|
||||
$header = "Log Message:\n";
|
||||
|
||||
$mailcmd = "| mail -s 'CVS update notice'";
|
||||
$whoami = `whoami`;
|
||||
chop $whoami;
|
||||
$date = `date`;
|
||||
chop $date;
|
||||
|
||||
$cvsroot = $ENV{'CVSROOT'};
|
||||
|
||||
while (@ARGV) {
|
||||
$arg = shift @ARGV;
|
||||
|
||||
if ($arg eq '-f') {
|
||||
$file = shift @ARGV;
|
||||
}
|
||||
else {
|
||||
$users = "$users $arg";
|
||||
}
|
||||
}
|
||||
|
||||
if ($users) {
|
||||
$mailcmd = "$mailcmd $users";
|
||||
open(MAIL, $mailcmd) || die "Execing $mail: $!\n";
|
||||
}
|
||||
|
||||
if ($file) {
|
||||
$logfile = "$cvsroot/LOG/$file";
|
||||
open(FILE, ">> $logfile") || die "Opening $logfile: $!\n";
|
||||
}
|
||||
|
||||
print FILE "$whoami $date--------BEGIN LOG ENTRY-------------\n" if ($logfile);
|
||||
|
||||
while (<>) {
|
||||
print FILE $log if ($log && $logfile);
|
||||
|
||||
print FILE $_ if ($logfile);
|
||||
print MAIL $_ if ($users);
|
||||
|
||||
$log = "log: " if ($_ eq $header);
|
||||
}
|
||||
|
||||
close FILE;
|
||||
die "Write failed" if $?;
|
||||
close MAIL;
|
||||
die "Mail failed" if $?;
|
||||
|
||||
exit 0;
|
185
contrib/cvs/contrib/rcs-to-cvs.sh
Normal file
185
contrib/cvs/contrib/rcs-to-cvs.sh
Normal file
@ -0,0 +1,185 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# $Id: rcs-to-cvs.sh,v 1.2 1995/07/15 03:40:34 jimb Exp $
|
||||
# Based on the CVS 1.0 checkin csh script.
|
||||
# Contributed by Per Cederqvist <ceder@signum.se>.
|
||||
# Rewritten in sh by David MacKenzie <djm@cygnus.com>.
|
||||
#
|
||||
# Copyright (c) 1989, Brian Berliner
|
||||
#
|
||||
# You may distribute under the terms of the GNU General Public License.
|
||||
#
|
||||
#############################################################################
|
||||
#
|
||||
# Check in sources that previously were under RCS or no source control system.
|
||||
#
|
||||
# The repository is the directory where the sources should be deposited.
|
||||
#
|
||||
# Traverses the current directory, ensuring that an
|
||||
# identical directory structure exists in the repository directory. It
|
||||
# then checks the files in in the following manner:
|
||||
#
|
||||
# 1) If the file doesn't yet exist, check it in as revision 1.1
|
||||
#
|
||||
# The script also is somewhat verbose in letting the user know what is
|
||||
# going on. It prints a diagnostic when it creates a new file, or updates
|
||||
# a file that has been modified on the trunk.
|
||||
#
|
||||
# Bugs: doesn't put the files in branch 1.1.1
|
||||
# doesn't put in release and vendor tags
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
usage="Usage: rcs-to-cvs [-v] [-m message] [-f message_file] repository"
|
||||
vbose=0
|
||||
message=""
|
||||
message_file=/usr/tmp/checkin.$$
|
||||
got_one=0
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
echo "$usage" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
while [ $# -ne 0 ]; do
|
||||
case "$1" in
|
||||
-v)
|
||||
vbose=1
|
||||
;;
|
||||
-m)
|
||||
shift
|
||||
echo $1 > $message_file
|
||||
got_one=1
|
||||
;;
|
||||
-f)
|
||||
shift
|
||||
message_file=$1
|
||||
got_one=2
|
||||
;;
|
||||
*)
|
||||
break
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
echo "$usage" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
repository=$1
|
||||
shift
|
||||
|
||||
if [ -z "$CVSROOT" ]; then
|
||||
echo "Please the environmental variable CVSROOT to the root" >&2
|
||||
echo " of the tree you wish to update" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $got_one -eq 0 ]; then
|
||||
echo "Please Edit this file to contain the RCS log information" >$message_file
|
||||
echo "to be associated with this directory (please remove these lines)">>$message_file
|
||||
${EDITOR-/usr/ucb/vi} $message_file
|
||||
got_one=1
|
||||
fi
|
||||
|
||||
# Ya gotta share.
|
||||
umask 0
|
||||
|
||||
update_dir=${CVSROOT}/${repository}
|
||||
[ ! -d ${update_dir} ] && mkdir $update_dir
|
||||
|
||||
if [ -d SCCS ]; then
|
||||
echo SCCS files detected! >&2
|
||||
exit 1
|
||||
fi
|
||||
if [ -d RCS ]; then
|
||||
co RCS/*
|
||||
fi
|
||||
|
||||
for name in * .[a-zA-Z0-9]*
|
||||
do
|
||||
case "$name" in
|
||||
RCS | *~ | \* | .\[a-zA-Z0-9\]\* ) continue ;;
|
||||
esac
|
||||
echo $name
|
||||
if [ $vbose -ne 0 ]; then
|
||||
echo "Updating ${repository}/${name}"
|
||||
fi
|
||||
if [ -d "$name" ]; then
|
||||
if [ ! -d "${update_dir}/${name}" ]; then
|
||||
echo "WARNING: Creating new directory ${repository}/${name}"
|
||||
mkdir "${update_dir}/${name}"
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "ERROR: mkdir failed - aborting" >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
cd "$name"
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "ERROR: Couldn\'t cd to $name - aborting" >&2
|
||||
exit 1
|
||||
fi
|
||||
if [ $vbose -ne 0 ]; then
|
||||
$0 -v -f $message_file "${repository}/${name}"
|
||||
else
|
||||
$0 -f $message_file "${repository}/${name}"
|
||||
fi
|
||||
if [ $? -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
cd ..
|
||||
else # if not directory
|
||||
if [ ! -f "$name" ]; then
|
||||
echo "WARNING: $name is neither a regular file"
|
||||
echo " nor a directory - ignored"
|
||||
continue
|
||||
fi
|
||||
file="${update_dir}/${name},v"
|
||||
comment=""
|
||||
if grep -s '\$Log.*\$' "${name}"; then # If $Log keyword
|
||||
myext=`echo $name | sed 's,.*\.,,'`
|
||||
[ "$myext" = "$name" ] && myext=
|
||||
case "$myext" in
|
||||
c | csh | e | f | h | l | mac | me | mm | ms | p | r | red | s | sh | sl | cl | ml | el | tex | y | ye | yr | "" )
|
||||
;;
|
||||
|
||||
* )
|
||||
echo "For file ${file}:"
|
||||
grep '\$Log.*\$' "${name}"
|
||||
echo -n "Please insert a comment leader for file ${name} > "
|
||||
read comment
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if [ ! -f "$file" ]; then # If not exists in repository
|
||||
if [ ! -f "${update_dir}/Attic/${name},v" ]; then
|
||||
echo "WARNING: Creating new file ${repository}/${name}"
|
||||
if [ -f RCS/"${name}",v ]; then
|
||||
echo "MSG: Copying old rcs file."
|
||||
cp RCS/"${name}",v "$file"
|
||||
else
|
||||
if [ -n "${comment}" ]; then
|
||||
rcs -q -i -c"${comment}" -t${message_file} -m'.' "$file"
|
||||
fi
|
||||
ci -q -u1.1 -t${message_file} -m'.' "$file"
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "ERROR: Initial check-in of $file failed - aborting" >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
else
|
||||
file="${update_dir}/Attic/${name},v"
|
||||
echo "WARNING: IGNORED: ${repository}/Attic/${name}"
|
||||
continue
|
||||
fi
|
||||
else # File existed
|
||||
echo "ERROR: File exists in repository: Ignored: $file"
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
[ $got_one -eq 1 ] && rm -f $message_file
|
||||
|
||||
exit 0
|
592
contrib/cvs/contrib/rcs2log.sh
Normal file
592
contrib/cvs/contrib/rcs2log.sh
Normal file
@ -0,0 +1,592 @@
|
||||
#! /bin/sh
|
||||
|
||||
# RCS to ChangeLog generator
|
||||
|
||||
# Generate a change log prefix from RCS files and the ChangeLog (if any).
|
||||
# Output the new prefix to standard output.
|
||||
# You can edit this prefix by hand, and then prepend it to ChangeLog.
|
||||
|
||||
# Ignore log entries that start with `#'.
|
||||
# Clump together log entries that start with `{topic} ',
|
||||
# where `topic' contains neither white space nor `}'.
|
||||
|
||||
# Author: Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
# $Id: rcs2log.sh,v 1.2 1995/07/28 19:48:45 eggert Exp $
|
||||
|
||||
# Copyright 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
tab=' '
|
||||
nl='
|
||||
'
|
||||
|
||||
# Parse options.
|
||||
|
||||
# defaults
|
||||
: ${AWK=awk}
|
||||
: ${TMPDIR=/tmp}
|
||||
hostname= # name of local host (if empty, will deduce it later)
|
||||
indent=8 # indent of log line
|
||||
length=79 # suggested max width of log line
|
||||
logins= # login names for people we know fullnames and mailaddrs of
|
||||
loginFullnameMailaddrs= # login<tab>fullname<tab>mailaddr triplets
|
||||
recursive= # t if we want recursive rlog
|
||||
rlog_options= # options to pass to rlog
|
||||
tabwidth=8 # width of horizontal tab
|
||||
|
||||
while :
|
||||
do
|
||||
case $1 in
|
||||
-i) indent=${2?}; shift;;
|
||||
-h) hostname=${2?}; shift;;
|
||||
-l) length=${2?}; shift;;
|
||||
-[nu]) # -n is obsolescent; it is replaced by -u.
|
||||
case $1 in
|
||||
-n) case ${2?}${3?}${4?} in
|
||||
*"$tab"* | *"$nl"*)
|
||||
echo >&2 "$0: -n '$2' '$3' '$4': tabs, newlines not allowed"
|
||||
exit 1
|
||||
esac
|
||||
loginFullnameMailaddrs=$loginFullnameMailaddrs$nl$2$tab$3$tab$4
|
||||
shift; shift; shift;;
|
||||
-u)
|
||||
# If $2 is not tab-separated, use colon for separator.
|
||||
case ${2?} in
|
||||
*"$nl"*)
|
||||
echo >&2 "$0: -u '$2': newlines not allowed"
|
||||
exit 1;;
|
||||
*"$tab"*)
|
||||
t=$tab;;
|
||||
*)
|
||||
t=:
|
||||
esac
|
||||
case $2 in
|
||||
*"$t"*"$t"*"$t"*)
|
||||
echo >&2 "$0: -u '$2': too many fields"
|
||||
exit 1;;
|
||||
*"$t"*"$t"*)
|
||||
;;
|
||||
*)
|
||||
echo >&2 "$0: -u '$2': not enough fields"
|
||||
exit 1
|
||||
esac
|
||||
loginFullnameMailaddrs=$loginFullnameMailaddrs$nl$2
|
||||
shift
|
||||
esac
|
||||
logins=$logins$nl$login
|
||||
;;
|
||||
-r) rlog_options=$rlog_options$nl${2?}; shift;;
|
||||
-R) recursive=t;;
|
||||
-t) tabwidth=${2?}; shift;;
|
||||
-*) echo >&2 "$0: usage: $0 [options] [file ...]
|
||||
Options:
|
||||
[-h hostname] [-i indent] [-l length] [-R] [-r rlog_option]
|
||||
[-t tabwidth] [-u 'login<TAB>fullname<TAB>mailaddr']..."
|
||||
exit 1;;
|
||||
*) break
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
month_data='
|
||||
m[0]="Jan"; m[1]="Feb"; m[2]="Mar"
|
||||
m[3]="Apr"; m[4]="May"; m[5]="Jun"
|
||||
m[6]="Jul"; m[7]="Aug"; m[8]="Sep"
|
||||
m[9]="Oct"; m[10]="Nov"; m[11]="Dec"
|
||||
|
||||
# days in non-leap year thus far, indexed by month (0-12)
|
||||
mo[0]=0; mo[1]=31; mo[2]=59; mo[3]=90
|
||||
mo[4]=120; mo[5]=151; mo[6]=181; mo[7]=212
|
||||
mo[8]=243; mo[9]=273; mo[10]=304; mo[11]=334
|
||||
mo[12]=365
|
||||
'
|
||||
|
||||
|
||||
# Put rlog output into $rlogout.
|
||||
|
||||
# If no rlog options are given,
|
||||
# log the revisions checked in since the first ChangeLog entry.
|
||||
case $rlog_options in
|
||||
'')
|
||||
date=1970
|
||||
if test -s ChangeLog
|
||||
then
|
||||
# Add 1 to seconds to avoid duplicating most recent log.
|
||||
e='
|
||||
/^... ... [ 0-9][0-9] [ 0-9][0-9]:[0-9][0-9]:[0-9][0-9] [0-9]+ /{
|
||||
'"$month_data"'
|
||||
year = $5
|
||||
for (i=0; i<=11; i++) if (m[i] == $2) break
|
||||
dd = $3
|
||||
hh = substr($0,12,2)
|
||||
mm = substr($0,15,2)
|
||||
ss = substr($0,18,2)
|
||||
ss++
|
||||
if (ss == 60) {
|
||||
ss = 0
|
||||
mm++
|
||||
if (mm == 60) {
|
||||
mm = 0
|
||||
hh++
|
||||
if (hh == 24) {
|
||||
hh = 0
|
||||
dd++
|
||||
monthdays = mo[i+1] - mo[i]
|
||||
if (i == 1 && year%4 == 0 && (year%100 != 0 || year%400 == 0)) monthdays++
|
||||
if (dd == monthdays + 1) {
|
||||
dd = 1
|
||||
i++
|
||||
if (i == 12) {
|
||||
i = 0
|
||||
year++
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
# Output comma instead of space to avoid CVS 1.5 bug.
|
||||
printf "%d/%02d/%02d,%02d:%02d:%02d\n", year,i+1,dd,hh,mm,ss
|
||||
exit
|
||||
}
|
||||
'
|
||||
d=`$AWK "$e" <ChangeLog` || exit
|
||||
case $d in
|
||||
?*) date=$d
|
||||
esac
|
||||
fi
|
||||
datearg="-d>$date"
|
||||
esac
|
||||
|
||||
# If CVS is in use, examine its repository, not the normal RCS files.
|
||||
if test ! -f CVS/Repository
|
||||
then
|
||||
rlog=rlog
|
||||
repository=
|
||||
else
|
||||
rlog='cvs log'
|
||||
repository=`sed 1q <CVS/Repository` || exit
|
||||
test ! -f CVS/Root || CVSROOT=`cat <CVS/Root` || exit
|
||||
case $CVSROOT in
|
||||
*:/*)
|
||||
# remote repository
|
||||
;;
|
||||
*)
|
||||
# local repository
|
||||
case $repository in
|
||||
/*) ;;
|
||||
*) repository=${CVSROOT?}/$repository
|
||||
esac
|
||||
if test ! -d "$repository"
|
||||
then
|
||||
echo >&2 "$0: $repository: bad repository (see CVS/Repository)"
|
||||
exit 1
|
||||
fi
|
||||
esac
|
||||
fi
|
||||
|
||||
# With no arguments, examine all files under the RCS directory.
|
||||
case $# in
|
||||
0)
|
||||
case $repository in
|
||||
'')
|
||||
oldIFS=$IFS
|
||||
IFS=$nl
|
||||
case $recursive in
|
||||
t)
|
||||
RCSdirs=`find . -name RCS -type d -print`
|
||||
filesFromRCSfiles='s|,v$||; s|/RCS/|/|; s|^\./||'
|
||||
files=`
|
||||
{
|
||||
case $RCSdirs in
|
||||
?*) find $RCSdirs -type f -print
|
||||
esac
|
||||
find . -name '*,v' -print
|
||||
} |
|
||||
sort -u |
|
||||
sed "$filesFromRCSfiles"
|
||||
`;;
|
||||
*)
|
||||
files=
|
||||
for file in RCS/.* RCS/* .*,v *,v
|
||||
do
|
||||
case $file in
|
||||
RCS/. | RCS/..) continue;;
|
||||
RCS/.\* | RCS/\* | .\*,v | \*,v) test -f "$file" || continue
|
||||
esac
|
||||
files=$files$nl$file
|
||||
done
|
||||
case $files in
|
||||
'') exit 0
|
||||
esac
|
||||
esac
|
||||
set x $files
|
||||
shift
|
||||
IFS=$oldIFS
|
||||
esac
|
||||
esac
|
||||
|
||||
llogout=$TMPDIR/rcs2log$$l
|
||||
rlogout=$TMPDIR/rcs2log$$r
|
||||
trap exit 1 2 13 15
|
||||
trap "rm -f $llogout $rlogout; exit 1" 0
|
||||
|
||||
case $rlog_options in
|
||||
?*) $rlog $rlog_options ${1+"$@"} >$rlogout;;
|
||||
'') $rlog "$datearg" ${1+"$@"} >$rlogout
|
||||
esac || exit
|
||||
|
||||
|
||||
# Get the full name of each author the logs mention, and set initialize_fullname
|
||||
# to awk code that initializes the `fullname' awk associative array.
|
||||
# Warning: foreign authors (i.e. not known in the passwd file) are mishandled;
|
||||
# you have to fix the resulting output by hand.
|
||||
|
||||
initialize_fullname=
|
||||
initialize_mailaddr=
|
||||
|
||||
case $loginFullnameMailaddrs in
|
||||
?*)
|
||||
case $loginFullnameMailaddrs in
|
||||
*\"* | *\\*)
|
||||
sed 's/["\\]/\\&/g' >$llogout <<EOF || exit
|
||||
$loginFullnameMailaddrs
|
||||
EOF
|
||||
loginFullnameMailaddrs=`cat $llogout`
|
||||
esac
|
||||
|
||||
oldIFS=$IFS
|
||||
IFS=$nl
|
||||
for loginFullnameMailaddr in $loginFullnameMailaddrs
|
||||
do
|
||||
case $loginFullnameMailaddr in
|
||||
*"$tab"*) IFS=$tab;;
|
||||
*) IFS=:
|
||||
esac
|
||||
set x $loginFullnameMailaddr
|
||||
login=$2
|
||||
fullname=$3
|
||||
mailaddr=$4
|
||||
initialize_fullname="$initialize_fullname
|
||||
fullname[\"$login\"] = \"$fullname\""
|
||||
initialize_mailaddr="$initialize_mailaddr
|
||||
mailaddr[\"$login\"] = \"$mailaddr\""
|
||||
done
|
||||
IFS=$oldIFS
|
||||
esac
|
||||
|
||||
case $llogout in
|
||||
?*) sort -u -o $llogout <<EOF || exit
|
||||
$logins
|
||||
EOF
|
||||
esac
|
||||
output_authors='/^date: / {
|
||||
if ($2 ~ /^[0-9]*[-\/][0-9][0-9][-\/][0-9][0-9]$/ && $3 ~ /^[0-9][0-9]:[0-9][0-9]:[0-9][0-9][-+0-9:]*;$/ && $4 == "author:" && $5 ~ /^[^;]*;$/) {
|
||||
print substr($5, 1, length($5)-1)
|
||||
}
|
||||
}'
|
||||
authors=`
|
||||
$AWK "$output_authors" <$rlogout |
|
||||
case $llogout in
|
||||
'') sort -u;;
|
||||
?*) sort -u | comm -23 - $llogout
|
||||
esac
|
||||
`
|
||||
case $authors in
|
||||
?*)
|
||||
cat >$llogout <<EOF || exit
|
||||
$authors
|
||||
EOF
|
||||
initialize_author_script='s/["\\]/\\&/g; s/.*/author[\"&\"] = 1/'
|
||||
initialize_author=`sed -e "$initialize_author_script" <$llogout`
|
||||
awkscript='
|
||||
BEGIN {
|
||||
alphabet = "abcdefghijklmnopqrstuvwxyz"
|
||||
ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||
'"$initialize_author"'
|
||||
}
|
||||
{
|
||||
if (author[$1]) {
|
||||
fullname = $5
|
||||
if (fullname ~ /[0-9]+-[^(]*\([0-9]+\)$/) {
|
||||
# Remove the junk from fullnames like "0000-Admin(0000)".
|
||||
fullname = substr(fullname, index(fullname, "-") + 1)
|
||||
fullname = substr(fullname, 1, index(fullname, "(") - 1)
|
||||
}
|
||||
if (fullname ~ /,[^ ]/) {
|
||||
# Some sites put comma-separated junk after the fullname.
|
||||
# Remove it, but leave "Bill Gates, Jr" alone.
|
||||
fullname = substr(fullname, 1, index(fullname, ",") - 1)
|
||||
}
|
||||
abbr = index(fullname, "&")
|
||||
if (abbr) {
|
||||
a = substr($1, 1, 1)
|
||||
A = a
|
||||
i = index(alphabet, a)
|
||||
if (i) A = substr(ALPHABET, i, 1)
|
||||
fullname = substr(fullname, 1, abbr-1) A substr($1, 2) substr(fullname, abbr+1)
|
||||
}
|
||||
|
||||
# Quote quotes and backslashes properly in full names.
|
||||
# Do not use gsub; traditional awk lacks it.
|
||||
quoted = ""
|
||||
rest = fullname
|
||||
for (;;) {
|
||||
p = index(rest, "\\")
|
||||
q = index(rest, "\"")
|
||||
if (p) {
|
||||
if (q && q<p) p = q
|
||||
} else {
|
||||
if (!q) break
|
||||
p = q
|
||||
}
|
||||
quoted = quoted substr(rest, 1, p-1) "\\" substr(rest, p, 1)
|
||||
rest = substr(rest, p+1)
|
||||
}
|
||||
|
||||
printf "fullname[\"%s\"] = \"%s%s\"\n", $1, quoted, rest
|
||||
author[$1] = 0
|
||||
}
|
||||
}
|
||||
'
|
||||
|
||||
initialize_fullname=`
|
||||
(cat /etc/passwd; ypmatch $authors passwd) 2>/dev/null |
|
||||
$AWK -F: "$awkscript"
|
||||
`$initialize_fullname
|
||||
esac
|
||||
|
||||
|
||||
# Function to print a single log line.
|
||||
# We don't use awk functions, to stay compatible with old awk versions.
|
||||
# `Log' is the log message (with \n replaced by \r).
|
||||
# `files' contains the affected files.
|
||||
printlogline='{
|
||||
|
||||
# Following the GNU coding standards, rewrite
|
||||
# * file: (function): comment
|
||||
# to
|
||||
# * file (function): comment
|
||||
if (Log ~ /^\([^)]*\): /) {
|
||||
i = index(Log, ")")
|
||||
files = files " " substr(Log, 1, i)
|
||||
Log = substr(Log, i+3)
|
||||
}
|
||||
|
||||
# If "label: comment" is too long, break the line after the ":".
|
||||
sep = " "
|
||||
if ('"$length"' <= '"$indent"' + 1 + length(files) + index(Log, CR)) sep = "\n" indent_string
|
||||
|
||||
# Print the label.
|
||||
printf "%s*%s:", indent_string, files
|
||||
|
||||
# Print each line of the log, transliterating \r to \n.
|
||||
while ((i = index(Log, CR)) != 0) {
|
||||
logline = substr(Log, 1, i-1)
|
||||
if (logline ~ /[^'"$tab"' ]/) {
|
||||
printf "%s%s\n", sep, logline
|
||||
} else {
|
||||
print ""
|
||||
}
|
||||
sep = indent_string
|
||||
Log = substr(Log, i+1)
|
||||
}
|
||||
}'
|
||||
|
||||
case $hostname in
|
||||
'')
|
||||
hostname=`(
|
||||
hostname || uname -n || uuname -l || cat /etc/whoami
|
||||
) 2>/dev/null` || {
|
||||
echo >&2 "$0: cannot deduce hostname"
|
||||
exit 1
|
||||
}
|
||||
esac
|
||||
|
||||
|
||||
# Process the rlog output, generating ChangeLog style entries.
|
||||
|
||||
# First, reformat the rlog output so that each line contains one log entry.
|
||||
# Transliterate \n to \r so that multiline entries fit on a single line.
|
||||
# Discard irrelevant rlog output.
|
||||
$AWK <$rlogout '
|
||||
BEGIN { repository = "'"$repository"'" }
|
||||
/^RCS file:/ {
|
||||
if (repository != "") {
|
||||
filename = $3
|
||||
if (substr(filename, 1, length(repository) + 1) == repository "/") {
|
||||
filename = substr(filename, length(repository) + 2)
|
||||
}
|
||||
if (filename ~ /,v$/) {
|
||||
filename = substr(filename, 1, length(filename) - 2)
|
||||
}
|
||||
}
|
||||
}
|
||||
/^Working file:/ { if (repository == "") filename = $3 }
|
||||
/^date: /, /^(-----------*|===========*)$/ {
|
||||
if ($0 ~ /^branches: /) { next }
|
||||
if ($0 ~ /^date: [0-9][- +\/0-9:]*;/) {
|
||||
date = $2
|
||||
if (date ~ /-/) {
|
||||
# An ISO format date. Replace all "-"s with "/"s.
|
||||
newdate = ""
|
||||
while ((i = index(date, "-")) != 0) {
|
||||
newdate = newdate substr(date, 1, i-1) "/"
|
||||
date = substr(date, i+1)
|
||||
}
|
||||
date = newdate date
|
||||
}
|
||||
# Ignore any time zone; ChangeLog has no room for it.
|
||||
time = substr($3, 1, 8)
|
||||
author = substr($5, 1, length($5)-1)
|
||||
printf "%s %s %s %s %c", filename, date, time, author, 13
|
||||
next
|
||||
}
|
||||
if ($0 ~ /^(-----------*|===========*)$/) { print ""; next }
|
||||
printf "%s%c", $0, 13
|
||||
}
|
||||
' |
|
||||
|
||||
# Now each line is of the form
|
||||
# FILENAME YYYY/MM/DD HH:MM:SS AUTHOR \rLOG
|
||||
# where \r stands for a carriage return,
|
||||
# and each line of the log is terminated by \r instead of \n.
|
||||
# Sort the log entries, first by date+time (in reverse order),
|
||||
# then by author, then by log entry, and finally by file name (just in case).
|
||||
sort +1 -3r +3 +0 |
|
||||
|
||||
# Finally, reformat the sorted log entries.
|
||||
$AWK '
|
||||
BEGIN {
|
||||
# Some awk variants do not understand "\r" or "\013", so we have to
|
||||
# put a carriage return directly in the file.
|
||||
CR="
" # <-- There is a single CR between the " chars here.
|
||||
|
||||
# Initialize the fullname and mailaddr associative arrays.
|
||||
'"$initialize_fullname"'
|
||||
'"$initialize_mailaddr"'
|
||||
|
||||
# Initialize indent string.
|
||||
indent_string = ""
|
||||
i = '"$indent"'
|
||||
if (0 < '"$tabwidth"')
|
||||
for (; '"$tabwidth"' <= i; i -= '"$tabwidth"')
|
||||
indent_string = indent_string "\t"
|
||||
while (1 <= i--)
|
||||
indent_string = indent_string " "
|
||||
|
||||
# Set up date conversion tables.
|
||||
# RCS uses a nice, clean, sortable format,
|
||||
# but ChangeLog wants the traditional, ugly ctime format.
|
||||
|
||||
# January 1, 0 AD (Gregorian) was Saturday = 6
|
||||
EPOCH_WEEKDAY = 6
|
||||
# Of course, there was no 0 AD, but the algorithm works anyway.
|
||||
|
||||
w[0]="Sun"; w[1]="Mon"; w[2]="Tue"; w[3]="Wed"
|
||||
w[4]="Thu"; w[5]="Fri"; w[6]="Sat"
|
||||
|
||||
'"$month_data"'
|
||||
}
|
||||
|
||||
{
|
||||
newlog = substr($0, 1 + index($0, CR))
|
||||
|
||||
# Ignore log entries prefixed by "#".
|
||||
if (newlog ~ /^#/) { next }
|
||||
|
||||
if (Log != newlog || date != $2 || author != $4) {
|
||||
|
||||
# The previous log and this log differ.
|
||||
|
||||
# Print the old log.
|
||||
if (date != "") '"$printlogline"'
|
||||
|
||||
# Logs that begin with "{clumpname} " should be grouped together,
|
||||
# and the clumpname should be removed.
|
||||
# Extract the new clumpname from the log header,
|
||||
# and use it to decide whether to output a blank line.
|
||||
newclumpname = ""
|
||||
sep = "\n"
|
||||
if (date == "") sep = ""
|
||||
if (newlog ~ /^\{[^'"$tab"' }]*}['"$tab"' ]/) {
|
||||
i = index(newlog, "}")
|
||||
newclumpname = substr(newlog, 1, i)
|
||||
while (substr(newlog, i+1) ~ /^['"$tab"' ]/) i++
|
||||
newlog = substr(newlog, i+1)
|
||||
if (clumpname == newclumpname) sep = ""
|
||||
}
|
||||
printf sep
|
||||
clumpname = newclumpname
|
||||
|
||||
# Get ready for the next log.
|
||||
Log = newlog
|
||||
if (files != "")
|
||||
for (i in filesknown)
|
||||
filesknown[i] = 0
|
||||
files = ""
|
||||
}
|
||||
if (date != $2 || author != $4) {
|
||||
# The previous date+author and this date+author differ.
|
||||
# Print the new one.
|
||||
date = $2
|
||||
author = $4
|
||||
|
||||
# Convert nice RCS date like "1992/01/03 00:03:44"
|
||||
# into ugly ctime date like "Fri Jan 3 00:03:44 1992".
|
||||
# Calculate day of week from Gregorian calendar.
|
||||
i = index($2, "/")
|
||||
year = substr($2, 1, i-1) + 0
|
||||
monthday = substr($2, i+1)
|
||||
i = index(monthday, "/")
|
||||
month = substr(monthday, 1, i-1) + 0
|
||||
day = substr(monthday, i+1) + 0
|
||||
leap = 0
|
||||
if (2 < month && year%4 == 0 && (year%100 != 0 || year%400 == 0)) leap = 1
|
||||
days_since_Sunday_before_epoch = EPOCH_WEEKDAY + year * 365 + int((year + 3) / 4) - int((year + 99) / 100) + int((year + 399) / 400) + mo[month-1] + leap + day - 1
|
||||
|
||||
# Print "date fullname (email address)".
|
||||
# Get fullname and email address from associative arrays;
|
||||
# default to author and author@hostname if not in arrays.
|
||||
if (fullname[author])
|
||||
auth = fullname[author]
|
||||
else
|
||||
auth = author
|
||||
printf "%s %s %2d %s %d %s ", w[days_since_Sunday_before_epoch%7], m[month-1], day, $3, year, auth
|
||||
if (mailaddr[author])
|
||||
printf "<%s>\n\n", mailaddr[author]
|
||||
else
|
||||
printf "<%s@%s>\n\n", author, "'"$hostname"'"
|
||||
}
|
||||
if (! filesknown[$1]) {
|
||||
filesknown[$1] = 1
|
||||
if (files == "") files = " " $1
|
||||
else files = files ", " $1
|
||||
}
|
||||
}
|
||||
END {
|
||||
# Print the last log.
|
||||
if (date != "") {
|
||||
'"$printlogline"'
|
||||
printf "\n"
|
||||
}
|
||||
}
|
||||
' &&
|
||||
|
||||
|
||||
# Exit successfully.
|
||||
|
||||
exec rm -f $llogout $rlogout
|
143
contrib/cvs/contrib/rcs2sccs.sh
Normal file
143
contrib/cvs/contrib/rcs2sccs.sh
Normal file
@ -0,0 +1,143 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
#
|
||||
# OrigId: rcs2sccs,v 1.12 90/10/04 20:52:23 kenc Exp Locker: kenc
|
||||
# $Id: rcs2sccs.sh,v 1.1 1995/07/10 02:26:45 kfogel Exp $
|
||||
|
||||
############################################################
|
||||
# Error checking
|
||||
#
|
||||
if [ ! -d SCCS ] ; then
|
||||
mkdir SCCS
|
||||
fi
|
||||
|
||||
logfile=/tmp/rcs2sccs_$$_log
|
||||
rm -f $logfile
|
||||
tmpfile=/tmp/rcs2sccs_$$_tmp
|
||||
rm -f $tmpfile
|
||||
emptyfile=/tmp/rcs2sccs_$$_empty
|
||||
echo -n "" > $emptyfile
|
||||
initialfile=/tmp/rcs2sccs_$$_init
|
||||
echo "Initial revision" > $initialfile
|
||||
sedfile=/tmp/rcs2sccs_$$_sed
|
||||
rm -f $sedfile
|
||||
revfile=/tmp/rcs2sccs_$$_rev
|
||||
rm -f $revfile
|
||||
commentfile=/tmp/rcs2sccs_$$_comment
|
||||
rm -f $commentfile
|
||||
|
||||
# create the sed script
|
||||
cat > $sedfile << EOF
|
||||
s,;Id;,%Z%%M% %I% %E%,g
|
||||
s,;SunId;,%Z%%M% %I% %E%,g
|
||||
s,;RCSfile;,%M%,g
|
||||
s,;Revision;,%I%,g
|
||||
s,;Date;,%E%,g
|
||||
s,;Id:.*;,%Z%%M% %I% %E%,g
|
||||
s,;SunId:.*;,%Z%%M% %I% %E%,g
|
||||
s,;RCSfile:.*;,%M%,g
|
||||
s,;Revision:.*;,%I%,g
|
||||
s,;Date:.*;,%E%,g
|
||||
EOF
|
||||
sed -e 's/;/\\$/g' $sedfile > $tmpfile
|
||||
cp $tmpfile $sedfile
|
||||
############################################################
|
||||
# Loop over every RCS file in RCS dir
|
||||
#
|
||||
for vfile in *,v; do
|
||||
# get rid of the ",v" at the end of the name
|
||||
file=`echo $vfile | sed -e 's/,v$//'`
|
||||
|
||||
# work on each rev of that file in ascending order
|
||||
firsttime=1
|
||||
rlog $file | grep "^revision [0-9][0-9]*\." | awk '{print $2}' | sed -e 's/\./ /g' | sort -n -u +0 +1 +2 +3 +4 +5 +6 +7 +8 | sed -e 's/ /./g' > $revfile
|
||||
for rev in `cat $revfile`; do
|
||||
if [ $? != 0 ]; then
|
||||
echo ERROR - revision
|
||||
exit
|
||||
fi
|
||||
# get file into current dir and get stats
|
||||
date=`rlog -r$rev $file | grep "^date: " | awk '{print $2; exit}' | sed -e 's/^19//'`
|
||||
time=`rlog -r$rev $file | grep "^date: " | awk '{print $3; exit}' | sed -e 's/;//'`
|
||||
author=`rlog -r$rev $file | grep "^date: " | awk '{print $5; exit}' | sed -e 's/;//'`
|
||||
date="$date $time"
|
||||
echo ""
|
||||
rlog -r$rev $file | sed -e '/^branches: /d' -e '1,/^date: /d' -e '/^===========/d' -e 's/$/\\/' | awk '{if ((total += length($0) + 1) < 510) print $0}' > $commentfile
|
||||
echo "==> file $file, rev=$rev, date=$date, author=$author"
|
||||
rm -f $file
|
||||
co -r$rev $file >> $logfile 2>&1
|
||||
if [ $? != 0 ]; then
|
||||
echo ERROR - co
|
||||
exit
|
||||
fi
|
||||
echo checked out of RCS
|
||||
|
||||
# add SCCS keywords in place of RCS keywords
|
||||
sed -f $sedfile $file > $tmpfile
|
||||
if [ $? != 0 ]; then
|
||||
echo ERROR - sed
|
||||
exit
|
||||
fi
|
||||
echo performed keyword substitutions
|
||||
rm -f $file
|
||||
cp $tmpfile $file
|
||||
|
||||
# check file into SCCS
|
||||
if [ "$firsttime" = "1" ]; then
|
||||
firsttime=0
|
||||
echo about to do sccs admin
|
||||
echo sccs admin -n -i$file $file < $commentfile
|
||||
sccs admin -n -i$file $file < $commentfile >> $logfile 2>&1
|
||||
if [ $? != 0 ]; then
|
||||
echo ERROR - sccs admin
|
||||
exit
|
||||
fi
|
||||
echo initial rev checked into SCCS
|
||||
else
|
||||
case $rev in
|
||||
*.*.*.*)
|
||||
brev=`echo $rev | sed -e 's/\.[0-9]*$//'`
|
||||
sccs admin -fb $file 2>>$logfile
|
||||
echo sccs get -e -p -r$brev $file
|
||||
sccs get -e -p -r$brev $file >/dev/null 2>>$logfile
|
||||
;;
|
||||
*)
|
||||
echo sccs get -e -p $file
|
||||
sccs get -e -p $file >/dev/null 2>> $logfile
|
||||
;;
|
||||
esac
|
||||
if [ $? != 0 ]; then
|
||||
echo ERROR - sccs get
|
||||
exit
|
||||
fi
|
||||
sccs delta $file < $commentfile >> $logfile 2>&1
|
||||
if [ $? != 0 ]; then
|
||||
echo ERROR - sccs delta -r$rev $file
|
||||
exit
|
||||
fi
|
||||
echo checked into SCCS
|
||||
fi
|
||||
sed -e "s;^d D $rev ../../.. ..:..:.. [^ ][^ ]*;d D $rev $date $author;" SCCS/s.$file > $tmpfile
|
||||
rm -f SCCS/s.$file
|
||||
cp $tmpfile SCCS/s.$file
|
||||
chmod 444 SCCS/s.$file
|
||||
sccs admin -z $file
|
||||
if [ $? != 0 ]; then
|
||||
echo ERROR - sccs admin -z
|
||||
exit
|
||||
fi
|
||||
done
|
||||
rm -f $file
|
||||
done
|
||||
|
||||
|
||||
############################################################
|
||||
# Clean up
|
||||
#
|
||||
echo cleaning up...
|
||||
rm -f $tmpfile $emptyfile $initialfile $sedfile $commentfile
|
||||
echo ===================================================
|
||||
echo " Conversion Completed Successfully"
|
||||
echo ===================================================
|
||||
|
||||
rm -f *,v
|
235
contrib/cvs/contrib/rcslock.pl
Normal file
235
contrib/cvs/contrib/rcslock.pl
Normal file
@ -0,0 +1,235 @@
|
||||
#! xPERL_PATHx
|
||||
# -*-Perl-*-
|
||||
|
||||
# Author: John Rouillard (rouilj@cs.umb.edu)
|
||||
# Supported: Yeah right. (Well what do you expect for 2 hours work?)
|
||||
# Blame-to: rouilj@cs.umb.edu
|
||||
# Complaints to: Anybody except Brian Berliner, he's blameless for
|
||||
# this script.
|
||||
# Acknowlegements: The base code for this script has been acquired
|
||||
# from the log.pl script.
|
||||
|
||||
# rcslock.pl - A program to prevent commits when a file to be ckecked
|
||||
# in is locked in the repository.
|
||||
|
||||
# There are times when you need exclusive access to a file. This
|
||||
# often occurs when binaries are checked into the repository, since
|
||||
# cvs's (actually rcs's) text based merging mechanism won't work. This
|
||||
# script allows you to use the rcs lock mechanism (rcs -l) to make
|
||||
# sure that no changes to a repository are able to be committed if
|
||||
# those changes would result in a locked file being changed.
|
||||
|
||||
# WARNING:
|
||||
# This script will work only if locking is set to strict.
|
||||
#
|
||||
|
||||
# Setup:
|
||||
# Add the following line to the commitinfo file:
|
||||
|
||||
# ALL /local/location/for/script/lockcheck [options]
|
||||
|
||||
# Where ALL is replaced by any suitable regular expression.
|
||||
# Options are -v for verbose info, or -d for debugging info.
|
||||
# The %s will provide the repository directory name and the names of
|
||||
# all changed files.
|
||||
|
||||
# Use:
|
||||
# When a developer needs exclusive access to a version of a file, s/he
|
||||
# should use "rcs -l" in the repository tree to lock the version they
|
||||
# are working on. CVS will automagically release the lock when the
|
||||
# commit is performed.
|
||||
|
||||
# Method:
|
||||
# An "rlog -h" is exec'ed to give info on all about to be
|
||||
# committed files. This (header) information is parsed to determine
|
||||
# if any locks are outstanding and what versions of the file are
|
||||
# locked. This filename, version number info is used to index an
|
||||
# associative array. All of the files to be committed are checked to
|
||||
# see if any locks are outstanding. If locks are outstanding, the
|
||||
# version number of the current file (taken from the CVS/Entries
|
||||
# subdirectory) is used in the key to determine if that version is
|
||||
# locked. If the file being checked in is locked by the person doing
|
||||
# the checkin, the commit is allowed, but if the lock is held on that
|
||||
# version of a file by another person, the commit is not allowed.
|
||||
|
||||
$ext = ",v"; # The extension on your rcs files.
|
||||
|
||||
$\="\n"; # I hate having to put \n's at the end of my print statements
|
||||
$,=' '; # Spaces should occur between arguments to print when printed
|
||||
|
||||
# turn off setgid
|
||||
#
|
||||
$) = $(;
|
||||
|
||||
#
|
||||
# parse command line arguments
|
||||
#
|
||||
require 'getopts.pl';
|
||||
|
||||
&Getopts("vd"); # verbose or debugging
|
||||
|
||||
# Verbose is useful when debugging
|
||||
$opt_v = $opt_d if defined $opt_d;
|
||||
|
||||
# $files[0] is really the name of the subdirectory.
|
||||
# @files = split(/ /,$ARGV[0]);
|
||||
@files = @ARGV[0..$#ARGV];
|
||||
$cvsroot = $ENV{'CVSROOT'};
|
||||
|
||||
#
|
||||
# get login name
|
||||
#
|
||||
$login = getlogin || (getpwuid($<))[0] || "nobody";
|
||||
|
||||
#
|
||||
# save the current directory since we have to return here to parse the
|
||||
# CVS/Entries file if a lock is found.
|
||||
#
|
||||
$pwd = `/bin/pwd`;
|
||||
chop $pwd;
|
||||
|
||||
print "Starting directory is $pwd" if defined $opt_d ;
|
||||
|
||||
#
|
||||
# cd to the repository directory and check on the files.
|
||||
#
|
||||
print "Checking directory ", $files[0] if defined $opt_v ;
|
||||
|
||||
if ( $files[0] =~ /^\// )
|
||||
{
|
||||
print "Directory path is $files[0]" if defined $opt_d ;
|
||||
chdir $files[0] || die "Can't change to repository directory $files[0]" ;
|
||||
}
|
||||
else
|
||||
{
|
||||
print "Directory path is $cvsroot/$files[0]" if defined $opt_d ;
|
||||
chdir ($cvsroot . "/" . $files[0]) ||
|
||||
die "Can't change to repository directory $files[0] in $cvsroot" ;
|
||||
}
|
||||
|
||||
|
||||
# Open the rlog process and apss all of the file names to that one
|
||||
# process to cut down on exec overhead. This may backfire if there
|
||||
# are too many files for the system buffer to handle, but if there are
|
||||
# that many files, chances are that the cvs repository is not set up
|
||||
# cleanly.
|
||||
|
||||
print "opening rlog -h @files[1..$#files] |" if defined $opt_d;
|
||||
|
||||
open( RLOG, "rlog -h @files[1..$#files] |") || die "Can't run rlog command" ;
|
||||
|
||||
# Create the locks associative array. The elements in the array are
|
||||
# of two types:
|
||||
#
|
||||
# The name of the RCS file with a value of the total number of locks found
|
||||
# for that file,
|
||||
# or
|
||||
#
|
||||
# The name of the rcs file concatenated with the version number of the lock.
|
||||
# The value of this element is the name of the locker.
|
||||
|
||||
# The regular expressions used to split the rcs info may have to be changed.
|
||||
# The current ones work for rcs 5.6.
|
||||
|
||||
$lock = 0;
|
||||
|
||||
while (<RLOG>)
|
||||
{
|
||||
chop;
|
||||
next if /^$/; # ditch blank lines
|
||||
|
||||
if ( $_ =~ /^RCS file: (.*)$/ )
|
||||
{
|
||||
$curfile = $1;
|
||||
next;
|
||||
}
|
||||
|
||||
if ( $_ =~ /^locks: strict$/ )
|
||||
{
|
||||
$lock = 1 ;
|
||||
next;
|
||||
}
|
||||
|
||||
if ( $lock )
|
||||
{
|
||||
# access list: is the line immediately following the list of locks.
|
||||
if ( /^access list:/ )
|
||||
{ # we are done getting lock info for this file.
|
||||
$lock = 0;
|
||||
}
|
||||
else
|
||||
{ # We are accumulating lock info.
|
||||
|
||||
# increment the lock count
|
||||
$locks{$curfile}++;
|
||||
# save the info on the version that is locked. $2 is the
|
||||
# version number $1 is the name of the locker.
|
||||
$locks{"$curfile" . "$2"} = $1
|
||||
if /[ ]*([a-zA-Z._]*): ([0-9.]*)$/;
|
||||
|
||||
print "lock by $1 found on $curfile version $2" if defined $opt_d;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Lets go back to the starting directory and see if any locked files
|
||||
# are ones we are interested in.
|
||||
|
||||
chdir $pwd;
|
||||
|
||||
# fo all of the file names (remember $files[0] is the directory name
|
||||
foreach $i (@files[1..$#files])
|
||||
{
|
||||
if ( defined $locks{$i . $ext} )
|
||||
{ # well the file has at least one lock outstanding
|
||||
|
||||
# find the base version number of our file
|
||||
&parse_cvs_entry($i,*entry);
|
||||
|
||||
# is our version of this file locked?
|
||||
if ( defined $locks{$i . $ext . $entry{"version"}} )
|
||||
{ # if so, it is by us?
|
||||
if ( $login ne ($by = $locks{$i . $ext . $entry{"version"}}) )
|
||||
{# crud somebody else has it locked.
|
||||
$outstanding_lock++ ;
|
||||
print "$by has file $i locked for version " , $entry{"version"};
|
||||
}
|
||||
else
|
||||
{ # yeah I have it locked.
|
||||
print "You have a lock on file $i for version " , $entry{"version"}
|
||||
if defined $opt_v;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
exit $outstanding_lock;
|
||||
|
||||
|
||||
### End of main program
|
||||
|
||||
sub parse_cvs_entry
|
||||
{ # a very simple minded hack at parsing an entries file.
|
||||
local ( $file, *entry ) = @_;
|
||||
local ( @pp );
|
||||
|
||||
|
||||
open(ENTRIES, "< CVS/Entries") || die "Can't open entries file";
|
||||
|
||||
while (<ENTRIES>)
|
||||
{
|
||||
if ( $_ =~ /^\/$file\// )
|
||||
{
|
||||
@pp = split('/');
|
||||
|
||||
$entry{"name"} = $pp[1];
|
||||
$entry{"version"} = $pp[2];
|
||||
$entry{"dates"} = $pp[3];
|
||||
$entry{"name"} = $pp[4];
|
||||
$entry{"name"} = $pp[5];
|
||||
$entry{"sticky"} = $pp[6];
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
277
contrib/cvs/contrib/sccs2rcs.csh
Normal file
277
contrib/cvs/contrib/sccs2rcs.csh
Normal file
@ -0,0 +1,277 @@
|
||||
#! xCSH_PATHx -f
|
||||
#
|
||||
# Sccs2rcs is a script to convert an existing SCCS
|
||||
# history into an RCS history without losing any of
|
||||
# the information contained therein.
|
||||
# It has been tested under the following OS's:
|
||||
# SunOS 3.5, 4.0.3, 4.1
|
||||
# Ultrix-32 2.0, 3.1
|
||||
#
|
||||
# Things to note:
|
||||
# + It will NOT delete or alter your ./SCCS history under any circumstances.
|
||||
#
|
||||
# + Run in a directory where ./SCCS exists and where you can
|
||||
# create ./RCS
|
||||
#
|
||||
# + /usr/local/bin is put in front of the default path.
|
||||
# (SCCS under Ultrix is set-uid sccs, bad bad bad, so
|
||||
# /usr/local/bin/sccs here fixes that)
|
||||
#
|
||||
# + Date, time, author, comments, branches, are all preserved.
|
||||
#
|
||||
# + If a command fails somewhere in the middle, it bombs with
|
||||
# a message -- remove what it's done so far and try again.
|
||||
# "rm -rf RCS; sccs unedit `sccs tell`; sccs clean"
|
||||
# There is no recovery and exit is far from graceful.
|
||||
# If a particular module is hanging you up, consider
|
||||
# doing it separately; move it from the current area so that
|
||||
# the next run will have a better chance or working.
|
||||
# Also (for the brave only) you might consider hacking
|
||||
# the s-file for simpler problems: I've successfully changed
|
||||
# the date of a delta to be in sync, then run "sccs admin -z"
|
||||
# on the thing.
|
||||
#
|
||||
# + After everything finishes, ./SCCS will be moved to ./old-SCCS.
|
||||
#
|
||||
# This file may be copied, processed, hacked, mutilated, and
|
||||
# even destroyed as long as you don't tell anyone you wrote it.
|
||||
#
|
||||
# Ken Cox
|
||||
# Viewlogic Systems, Inc.
|
||||
# kenstir@viewlogic.com
|
||||
# ...!harvard!cg-atla!viewlog!kenstir
|
||||
#
|
||||
# Various hacks made by Brian Berliner before inclusion in CVS contrib area.
|
||||
#
|
||||
# $Id: sccs2rcs.csh,v 1.1 1995/07/10 02:26:48 kfogel Exp $
|
||||
|
||||
|
||||
#we'll assume the user set up the path correctly
|
||||
# for the Pmax, /usr/ucb/sccs is suid sccs, what a pain
|
||||
# /usr/local/bin/sccs should override /usr/ucb/sccs there
|
||||
set path = (/usr/local/bin $path)
|
||||
|
||||
|
||||
############################################################
|
||||
# Error checking
|
||||
#
|
||||
if (! -w .) then
|
||||
echo "Error: ./ not writeable by you."
|
||||
exit 1
|
||||
endif
|
||||
if (! -d SCCS) then
|
||||
echo "Error: ./SCCS directory not found."
|
||||
exit 1
|
||||
endif
|
||||
set edits = (`sccs tell`)
|
||||
if ($#edits) then
|
||||
echo "Error: $#edits file(s) out for edit...clean up before converting."
|
||||
exit 1
|
||||
endif
|
||||
if (-d RCS) then
|
||||
echo "Warning: RCS directory exists"
|
||||
if (`ls -a RCS | wc -l` > 2) then
|
||||
echo "Error: RCS directory not empty
|
||||
exit 1
|
||||
endif
|
||||
else
|
||||
mkdir RCS
|
||||
endif
|
||||
|
||||
sccs clean
|
||||
|
||||
set logfile = /tmp/sccs2rcs_$$_log
|
||||
rm -f $logfile
|
||||
set tmpfile = /tmp/sccs2rcs_$$_tmp
|
||||
rm -f $tmpfile
|
||||
set emptyfile = /tmp/sccs2rcs_$$_empty
|
||||
echo -n "" > $emptyfile
|
||||
set initialfile = /tmp/sccs2rcs_$$_init
|
||||
echo "Initial revision" > $initialfile
|
||||
set sedfile = /tmp/sccs2rcs_$$_sed
|
||||
rm -f $sedfile
|
||||
set revfile = /tmp/sccs2rcs_$$_rev
|
||||
rm -f $revfile
|
||||
|
||||
# the quotes surround the dollar signs to fool RCS when I check in this script
|
||||
set sccs_keywords = (\
|
||||
'%W%[ ]*%G%'\
|
||||
'%W%[ ]*%E%'\
|
||||
'%W%'\
|
||||
'%Z%%M%[ ]*%I%[ ]*%G%'\
|
||||
'%Z%%M%[ ]*%I%[ ]*%E%'\
|
||||
'%M%[ ]*%I%[ ]*%G%'\
|
||||
'%M%[ ]*%I%[ ]*%E%'\
|
||||
'%M%'\
|
||||
'%I%'\
|
||||
'%G%'\
|
||||
'%E%'\
|
||||
'%U%')
|
||||
set rcs_keywords = (\
|
||||
'$'Id'$'\
|
||||
'$'Id'$'\
|
||||
'$'Id'$'\
|
||||
'$'SunId'$'\
|
||||
'$'SunId'$'\
|
||||
'$'Id'$'\
|
||||
'$'Id'$'\
|
||||
'$'RCSfile'$'\
|
||||
'$'Revision'$'\
|
||||
'$'Date'$'\
|
||||
'$'Date'$'\
|
||||
'')
|
||||
|
||||
|
||||
############################################################
|
||||
# Get some answers from user
|
||||
#
|
||||
echo ""
|
||||
echo "Do you want to be prompted for a description of each"
|
||||
echo "file as it is checked in to RCS initially?"
|
||||
echo -n "(y=prompt for description, n=null description) [y] ?"
|
||||
set ans = $<
|
||||
if ((_$ans == _) || (_$ans == _y) || (_$ans == _Y)) then
|
||||
set nodesc = 0
|
||||
else
|
||||
set nodesc = 1
|
||||
endif
|
||||
echo ""
|
||||
echo "The default keyword substitutions are as follows and are"
|
||||
echo "applied in the order specified:"
|
||||
set i = 1
|
||||
while ($i <= $#sccs_keywords)
|
||||
# echo ' '\"$sccs_keywords[$i]\"' ==> '\"$rcs_keywords[$i]\"
|
||||
echo " $sccs_keywords[$i] ==> $rcs_keywords[$i]"
|
||||
@ i = $i + 1
|
||||
end
|
||||
echo ""
|
||||
echo -n "Do you want to change them [n] ?"
|
||||
set ans = $<
|
||||
if ((_$ans != _) && (_$ans != _n) && (_$ans != _N)) then
|
||||
echo "You can't always get what you want."
|
||||
echo "Edit this script file and change the variables:"
|
||||
echo ' $sccs_keywords'
|
||||
echo ' $rcs_keywords'
|
||||
else
|
||||
echo "good idea."
|
||||
endif
|
||||
|
||||
# create the sed script
|
||||
set i = 1
|
||||
while ($i <= $#sccs_keywords)
|
||||
echo "s,$sccs_keywords[$i],$rcs_keywords[$i],g" >> $sedfile
|
||||
@ i = $i + 1
|
||||
end
|
||||
|
||||
onintr ERROR
|
||||
|
||||
############################################################
|
||||
# Loop over every s-file in SCCS dir
|
||||
#
|
||||
foreach sfile (SCCS/s.*)
|
||||
# get rid of the "s." at the beginning of the name
|
||||
set file = `echo $sfile:t | sed -e "s/^..//"`
|
||||
|
||||
# work on each rev of that file in ascending order
|
||||
set firsttime = 1
|
||||
sccs prs $file | grep "^D " | awk '{print $2}' | sed -e 's/\./ /g' | sort -n -u +0 +1 +2 +3 +4 +5 +6 +7 +8 | sed -e 's/ /./g' > $revfile
|
||||
foreach rev (`cat $revfile`)
|
||||
if ($status != 0) goto ERROR
|
||||
|
||||
# get file into current dir and get stats
|
||||
set date = `sccs prs -r$rev $file | grep "^D " | awk '{printf("19%s %s", $3, $4); exit}'`
|
||||
set author = `sccs prs -r$rev $file | grep "^D " | awk '{print $5; exit}'`
|
||||
echo ""
|
||||
echo "==> file $file, rev=$rev, date=$date, author=$author"
|
||||
sccs edit -r$rev $file >>& $logfile
|
||||
if ($status != 0) goto ERROR
|
||||
echo checked out of SCCS
|
||||
|
||||
# add RCS keywords in place of SCCS keywords
|
||||
sed -f $sedfile $file > $tmpfile
|
||||
if ($status != 0) goto ERROR
|
||||
echo performed keyword substitutions
|
||||
cp $tmpfile $file
|
||||
|
||||
# check file into RCS
|
||||
if ($firsttime) then
|
||||
set firsttime = 0
|
||||
if ($nodesc) then
|
||||
echo about to do ci
|
||||
echo ci -f -r$rev -d"$date" -w$author -t$emptyfile $file
|
||||
ci -f -r$rev -d"$date" -w$author -t$emptyfile $file < $initialfile >>& $logfile
|
||||
if ($status != 0) goto ERROR
|
||||
echo initial rev checked into RCS without description
|
||||
else
|
||||
echo ""
|
||||
echo Enter a brief description of the file $file \(end w/ Ctrl-D\):
|
||||
cat > $tmpfile
|
||||
ci -f -r$rev -d"$date" -w$author -t$tmpfile $file < $initialfile >>& $logfile
|
||||
if ($status != 0) goto ERROR
|
||||
echo initial rev checked into RCS
|
||||
endif
|
||||
else
|
||||
# get RCS lock
|
||||
set lckrev = `echo $rev | sed -e 's/\.[0-9]*$//'`
|
||||
if ("$lckrev" =~ [0-9]*.*) then
|
||||
# need to lock the brach -- it is OK if the lock fails
|
||||
rcs -l$lckrev $file >>& $logfile
|
||||
else
|
||||
# need to lock the trunk -- must succeed
|
||||
rcs -l $file >>& $logfile
|
||||
if ($status != 0) goto ERROR
|
||||
endif
|
||||
echo got lock
|
||||
sccs prs -r$rev $file | grep "." > $tmpfile
|
||||
# it's OK if grep fails here and gives status == 1
|
||||
# put the delta message in $tmpfile
|
||||
ed $tmpfile >>& $logfile <<EOF
|
||||
/COMMENTS
|
||||
1,.d
|
||||
w
|
||||
q
|
||||
EOF
|
||||
ci -f -r$rev -d"$date" -w$author $file < $tmpfile >>& $logfile
|
||||
if ($status != 0) goto ERROR
|
||||
echo checked into RCS
|
||||
endif
|
||||
sccs unedit $file >>& $logfile
|
||||
if ($status != 0) goto ERROR
|
||||
end
|
||||
rm -f $file
|
||||
end
|
||||
|
||||
|
||||
############################################################
|
||||
# Clean up
|
||||
#
|
||||
echo cleaning up...
|
||||
mv SCCS old-SCCS
|
||||
rm -f $tmpfile $emptyfile $initialfile $sedfile
|
||||
echo ===================================================
|
||||
echo " Conversion Completed Successfully"
|
||||
echo ""
|
||||
echo " SCCS history now in old-SCCS/"
|
||||
echo ===================================================
|
||||
set exitval = 0
|
||||
goto cleanup
|
||||
|
||||
ERROR:
|
||||
foreach f (`sccs tell`)
|
||||
sccs unedit $f
|
||||
end
|
||||
echo ""
|
||||
echo ""
|
||||
echo Danger\! Danger\!
|
||||
echo Some command exited with a non-zero exit status.
|
||||
echo Log file exists in $logfile.
|
||||
echo ""
|
||||
echo Incomplete history in ./RCS -- remove it
|
||||
echo Original unchanged history in ./SCCS
|
||||
set exitval = 1
|
||||
|
||||
cleanup:
|
||||
# leave log file
|
||||
rm -f $tmpfile $emptyfile $initialfile $sedfile $revfile
|
||||
|
||||
exit $exitval
|
81
contrib/cvs/cvs-format.el
Normal file
81
contrib/cvs/cvs-format.el
Normal file
@ -0,0 +1,81 @@
|
||||
;; -*- lisp-interaction -*-
|
||||
;; -*- emacs-lisp -*-
|
||||
;;
|
||||
;;
|
||||
;; originally from...
|
||||
;; Rich's personal .emacs file. feel free to copy.
|
||||
;;
|
||||
;; Last Mod Wed Feb 5 16:11:47 PST 1992, by rich@cygnus.com
|
||||
;;
|
||||
|
||||
;;
|
||||
;;
|
||||
;; This section sets constants used by c-mode for formating
|
||||
;;
|
||||
;;
|
||||
|
||||
;; If `c-auto-newline' is non-`nil', newlines are inserted both
|
||||
;;before and after braces that you insert, and after colons and semicolons.
|
||||
;;Correct C indentation is done on all the lines that are made this way.
|
||||
|
||||
(setq c-auto-newline nil)
|
||||
|
||||
|
||||
;;*Non-nil means TAB in C mode should always reindent the current line,
|
||||
;;regardless of where in the line point is when the TAB command is used.
|
||||
;;It might be desirable to set this to nil for CVS, since unlike GNU
|
||||
;; CVS often uses comments over to the right separated by TABs.
|
||||
;; Depends some on whether you're in the habit of using TAB to
|
||||
;; reindent.
|
||||
;(setq c-tab-always-indent nil)
|
||||
|
||||
;;; It seems to me that
|
||||
;;; `M-x set-c-style BSD RET'
|
||||
;;; or
|
||||
;;; (set-c-style "BSD")
|
||||
;;; takes care of the indentation parameters correctly.
|
||||
|
||||
|
||||
;; C does not have anything analogous to particular function names for which
|
||||
;;special forms of indentation are desirable. However, it has a different
|
||||
;;need for customization facilities: many different styles of C indentation
|
||||
;;are in common use.
|
||||
;;
|
||||
;; There are six variables you can set to control the style that Emacs C
|
||||
;;mode will use.
|
||||
;;
|
||||
;;`c-indent-level'
|
||||
;; Indentation of C statements within surrounding block. The surrounding
|
||||
;; block's indentation is the indentation of the line on which the
|
||||
;; open-brace appears.
|
||||
|
||||
(setq c-indent-level 4)
|
||||
|
||||
;;`c-continued-statement-offset'
|
||||
;; Extra indentation given to a substatement, such as the then-clause of
|
||||
;; an if or body of a while.
|
||||
|
||||
(setq c-continued-statement-offset 4)
|
||||
|
||||
;;`c-brace-offset'
|
||||
;; Extra indentation for line if it starts with an open brace.
|
||||
|
||||
(setq c-brace-offset -4)
|
||||
|
||||
;;`c-brace-imaginary-offset'
|
||||
;; An open brace following other text is treated as if it were this far
|
||||
;; to the right of the start of its line.
|
||||
|
||||
(setq c-brace-imaginary-offset 0)
|
||||
|
||||
;;`c-argdecl-indent'
|
||||
;; Indentation level of declarations of C function arguments.
|
||||
|
||||
(setq c-argdecl-indent 4)
|
||||
|
||||
;;`c-label-offset'
|
||||
;; Extra indentation for line that is a label, or case or default.
|
||||
|
||||
(setq c-label-offset -4)
|
||||
|
||||
;;;; eof
|
569
contrib/cvs/doc/ChangeLog
Normal file
569
contrib/cvs/doc/ChangeLog
Normal file
@ -0,0 +1,569 @@
|
||||
Wed May 1 15:38:26 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* cvs.texinfo (Tags): Document un-revision of all-uppercase tag
|
||||
names.
|
||||
|
||||
Wed Apr 24 08:41:51 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* cvs.texinfo (Password authentication security): Rewrite sentence
|
||||
on complex and unknown security bugs to clarify that it is
|
||||
referring to people who have been give access to cvs, not to holes
|
||||
in the authentication method (which is relatively simple).
|
||||
|
||||
Tue Apr 23 09:31:29 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* cvs.texinfo (Wrappers): Talk about what -m does (and does not
|
||||
do). Other minor edits.
|
||||
|
||||
Wed Apr 17 15:27:03 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* cvs.texinfo (rcsinfo): Rewrite paragraph concerning remote CVS.
|
||||
* cvsclient.texi (Responses): Document Template response.
|
||||
|
||||
Sun Apr 14 16:01:39 1996 Karl Fogel <kfogel@floss.red-bean.com>
|
||||
|
||||
* .cvsignore: added CVSvn.texi.
|
||||
|
||||
Wed Apr 10 16:56:21 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* cvs.texinfo (~/.cvsrc): Mention setting global options with "cvs".
|
||||
|
||||
* cvs.texinfo (release): Change "modules" to "directories".
|
||||
Release does not take module names as arguments.
|
||||
|
||||
* cvs.texinfo (Creating a branch): Add comments about how we
|
||||
should better document tagging the branchpoint.
|
||||
|
||||
Tue Apr 9 19:59:45 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* cvs.texinfo (Top): Use @value{CVSVN}, not a vague refenece to 1.4.
|
||||
|
||||
* cvs.texinfo (From other version control systems): New node.
|
||||
|
||||
Mon Apr 8 15:59:37 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* cvsclient.texi (Connection and Authentication): Revise kerberos
|
||||
and pserver sections to reflect the fact that port 2401 is now
|
||||
officially registered.
|
||||
|
||||
Thu Mar 28 09:51:13 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* cvs.texinfo (History browsing): Reinstate this node. Try to get
|
||||
it into some minimally useful state (it still needs a lot of
|
||||
work).
|
||||
(annotate): New node, subnode of History browing.
|
||||
|
||||
* cvsclient.texi (Requests): Add annotate request.
|
||||
|
||||
Tue Mar 26 08:46:39 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* cvs.texinfo: In various examples, change tag names to avoid tag
|
||||
names reserved to CVS.
|
||||
|
||||
* cvs.texinfo (Tags): Document what is a valid tag name.
|
||||
|
||||
* cvs.texinfo (Substitution modes): Try to describe how the
|
||||
various keyword expansion settings interract.
|
||||
(Binary files): Suggest cvs update -A, not removing file and then
|
||||
updating it, to get effect of new keyword expansion options.
|
||||
|
||||
* cvs.texinfo (admin options): Mention CVS's use of `dead' state.
|
||||
|
||||
Thu Mar 21 08:25:17 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* cvs.texinfo (Environment variables): Expand introduction to RCS
|
||||
environment variables. Expand and correct CVS_SERVER_SLEEP.
|
||||
|
||||
* cvs.texinfo (Environment variables): Remove POSIXLY_CORRECT; cvs
|
||||
requires options to precede arguments regardless of it.
|
||||
|
||||
Thu Mar 21 08:18:42 1996 Norbert Kiesel <nk@col.sw-ley.de>
|
||||
|
||||
* cvs.texinfo: Remove paragrahps about a forthcoming CVS
|
||||
newsgroup and about sending patches to think.com.
|
||||
(Environment): Document some more (all?) used environment
|
||||
variables.
|
||||
|
||||
Wed Mar 20 09:44:21 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* cvsclient.texi (Introduction): New node.
|
||||
* Makefile.in: Add cruft to reflect fact that cvsclient.texi now
|
||||
uses CVSvn.texi.
|
||||
|
||||
Mon Mar 18 14:43:53 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* cvsclient.texi (Requests): Add Case request.
|
||||
|
||||
Wed Mar 13 16:01:47 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* cvsclient.texi (Connection and Authentication): New node.
|
||||
|
||||
* cvsclient.texi (Requests): Expand discussion of Root a bit.
|
||||
|
||||
* cvs.texinfo (Setting up): Don't refer to INSTALL file; revise to
|
||||
reflect some information which had been in the INSTALL file.
|
||||
|
||||
* cvs.texinfo (history file): Update to reflect cvsinit -> cvs
|
||||
init. Adjust discussion of whether history file format is
|
||||
documented.
|
||||
(Setting up): Update to reflect cvsinit -> cvs init.
|
||||
|
||||
* cvsclient.texi (Requests): Document init request.
|
||||
|
||||
Thu Feb 29 10:08:31 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* cvs.texinfo (loginfo example): Adjust example to reflect the way
|
||||
that CVS actually works. Add comments questioning whether that is
|
||||
the best behavior.
|
||||
|
||||
* cvs.texinfo (cvsignore): Document additions to default ignore list.
|
||||
|
||||
Mon Feb 26 13:48:01 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* cvsclient.texi (Filenames): New node, documents / vs \, etc.
|
||||
|
||||
Wed Feb 24 1996 Marcus Daniels <marcus@sayre.sysc.pdx.edu>
|
||||
|
||||
* cvs.texinfo (Password authentication server): Mention
|
||||
support for imaginary usernames.
|
||||
|
||||
Thu Feb 15 16:34:56 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* cvs.texinfo (Variables): Add new internal variable $USER.
|
||||
|
||||
Wed Feb 14 22:52:58 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* cvs.texinfo (export, admin): Document -k option to cvs export.
|
||||
|
||||
* cvs.texinfo (admin options): Mention using -l, -u, -L, and -U in
|
||||
conjunction with rcslock.pl.
|
||||
|
||||
Mon Feb 12 16:38:41 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* cvs.texinfo: Remove references to mkmodules.
|
||||
|
||||
Sun Feb 11 12:31:36 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* cvsclient.texi: Add Set request.
|
||||
|
||||
* cvs.texinfo (Variables): Rewrite to reflect user variables
|
||||
replacing environment variables; motivate the discussion better.
|
||||
(Global options): Add -s option.
|
||||
|
||||
Sat Feb 10 11:18:37 1996 Jim Blandy <jimb@totoro.cyclic.com>
|
||||
|
||||
* cvs.texinfo (Variables): Fix @table commands.
|
||||
|
||||
Fri Feb 9 17:31:18 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* cvs.texinfo (Variables): New node.
|
||||
|
||||
* Makefile.in (CVSvn.texi): New rule.
|
||||
(OBJDIR_DISTFILES): Add CVSvn.texi.
|
||||
(cvs.dvi,cvs.info): Add cruft to deal with it being in build dir
|
||||
or srcdir.
|
||||
* cvs.texinfo: Include CVSvn.texi and use the version number from
|
||||
it instead of a hardcoded version number and date.
|
||||
|
||||
Thu Feb 1 13:28:03 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* cvs.texinfo (Sticky tags): Expand so it really documents the
|
||||
features it is talking about rather than referring to "Appendix
|
||||
A". Add example of how to restore the old version of a dead
|
||||
file. In various other parts of the manual refer to this node, in
|
||||
some cases deleting duplicative text. In the case of cvs admin
|
||||
-b, mention vendor branch usage.
|
||||
(Removing files): Discuss removing files (in user-visible terms,
|
||||
not in terms of the Attic and such).
|
||||
(remove): Remove node; merge contents into Removing files.
|
||||
|
||||
Tue Jan 30 17:52:06 1996 Jim Blandy <jimb@totoro.cyclic.com>
|
||||
|
||||
* cvs.texinfo: Tweak @top node, to make file compatible with both
|
||||
makeinfo and texinfo-format-buffer. Perhaps we should fix the
|
||||
formatters to agree on what constitutes valid texinfo.
|
||||
|
||||
Mon Jan 29 16:38:33 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* cvsclient.texi (Requirements): New node, to talk about required
|
||||
versus optional parts of the protocol.
|
||||
|
||||
Sun Jan 28 09:00:34 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* cvsclient.texi (Modes): Add discussion what what the mode really
|
||||
means (across diverse operating systems).
|
||||
|
||||
Tue Jan 23 12:54:57 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* cvs.texinfo: Per mail from Per Cederqvist, change author to "Per
|
||||
Cederqvist et al". Also remove sentence about Signum shipping
|
||||
hardcopy manuals and add information on Cyclic. Change version
|
||||
number to 1.6.87.
|
||||
|
||||
Fri Jan 12 15:29:39 1996 Vince Demarco <vdemarco@bou.shl.com>
|
||||
|
||||
* cvs.texinfo: Fix the documentation for the com/uncom change
|
||||
to wrap/unwrap. make everything consistant
|
||||
|
||||
Wed Jan 10 16:11:54 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* cvs.texinfo (Concurrency): Add index entries; minor clarification.
|
||||
|
||||
Tue Jan 9 16:03:39 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* cvs.texinfo (Getting Notified): Document users file.
|
||||
|
||||
* cvs.texinfo (cvsignore): Add *.obj to list of ignored files.
|
||||
|
||||
Wed Jan 3 17:01:58 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* cvs.texinfo (import): Adjust list of ignored files to match
|
||||
recent change to CVS (CVS* -> CVS CVS.adm). Consolidate
|
||||
discussion of ignored files in one place (with xrefs from others).
|
||||
|
||||
* cvsclient.texi: Remove How To node. It was out of date
|
||||
(again!), and I am getting sick of trying to update it (internals
|
||||
documentation should be in the comments, where it at least has a
|
||||
fighting chance of staying up to date).
|
||||
(Protocol): Say what \n and \t mean in this document.
|
||||
|
||||
Tue Jan 2 23:39:32 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* cvs.texinfo (Wrappers): Change comb/uncom to wrap/unwrap.
|
||||
|
||||
Mon Jan 2 23:00:00 1996 Vince Demarco <vdemarco@bou.shl.com>
|
||||
|
||||
* cvs.texinfo: update the Wrappers documentation so it isn't
|
||||
so NEXTSTEP centric. The wrappers code has alot of other
|
||||
general uses. The new version of the documentation tryes
|
||||
to show that to the reader.
|
||||
|
||||
Mon Jan 1 13:09:39 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* cvsclient.texi (Responses): Clarify that Module-expansion is not
|
||||
suitable for passing to co.
|
||||
|
||||
Sun Dec 31 10:53:47 1995 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* cvs.texinfo (Password authentication server): Suggest specifying
|
||||
-b in inetd.conf.
|
||||
|
||||
* cvs.texinfo (Password authentication): Variety of cleanups and
|
||||
minor fixes, including shorter node names.
|
||||
|
||||
Sun Dec 24 02:37:51 1995 Karl Fogel <kfogel@floss.cyclic.com>
|
||||
|
||||
* cvs.texinfo (Using the client with password authentication):
|
||||
tixed fypos.
|
||||
|
||||
Sun Dec 24 00:00:16 1995 Karl Fogel <kfogel@floss.cyclic.com>
|
||||
|
||||
* cvs.texinfo (Remote repositories): use @code{rsh} most places,
|
||||
because it is the name of a program, and because I am a pedant.
|
||||
Refer to new node "Password authenticated".
|
||||
(Password authenticated): new node.
|
||||
(Setting up the server for password authentication): new node.
|
||||
(Using the client with password authentication): new node.
|
||||
(Security considerations with password authentication): new node.
|
||||
|
||||
These are all really long node names, but it seems necessary that
|
||||
they be descriptive in case they're referenced elsewhere. If you
|
||||
can think of a way out of this, please change them.
|
||||
|
||||
Thu Dec 21 12:09:34 1995 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* cvsclient.texi (Requests): Add Questionable. Revise
|
||||
documentation of export and update to explain role of -I option.
|
||||
|
||||
Tue Dec 19 16:44:18 1995 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* cvs.texinfo: Update binary files info for -kb.
|
||||
|
||||
Mon Dec 11 12:20:55 1995 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* cvsclient.texi (Responses): Add Notified and Mode.
|
||||
(Requests): Add Notify, noop, watch-on, watch-off, watch-add,
|
||||
watch-remove, watchers, and editors.
|
||||
* cvs.texinfo (Watches): New node, to describe new developer
|
||||
communication features.
|
||||
|
||||
Thu Nov 23 08:59:09 1995 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* cvs.texinfo (admin options): In saying that cvs admin -o is not
|
||||
such a good way to undo a change, refer to the section which
|
||||
describes the preferred way.
|
||||
|
||||
Thu Nov 13 16:39:03 1995 Fred Fish <fnf@cygnus.com>
|
||||
|
||||
* Makefile.in: Remove extraneous tab from empty line.
|
||||
|
||||
Mon Nov 13 15:00:26 1995 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* cvs.texinfo (Concurrency): New node, to describe user-visible
|
||||
behaviors associated with cvs locks.
|
||||
|
||||
* cvs.texinfo (Remote repositories): Add more details of how to
|
||||
set things up (with rsh and kerberos).
|
||||
|
||||
Thu Nov 9 11:41:37 1995 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* cvs.texinfo: Remove -Q and -q options from command synopses.
|
||||
|
||||
Wed Nov 8 09:38:00 1995 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* cvsclient.texi (Notes): Revise paragraph on server memory use
|
||||
problem.
|
||||
|
||||
Tue Nov 7 16:26:39 1995 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* cvs.texinfo: Document merging more than once from a branch;
|
||||
miscellaneous cleanups.
|
||||
|
||||
Mon Oct 30 13:12:53 1995 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* cvs.texinfo (modules): Document -e.
|
||||
|
||||
Thu Oct 26 11:15:40 1995 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* cvs.texinfo (Tags): Update "version" vs. "revision" for CVS 1.5.
|
||||
(Index,BUGS): Change bug reporting address from Per Cederqvist to
|
||||
bug-cvs@prep.ai.mit.edu.
|
||||
|
||||
Wed Oct 25 15:37:05 1995 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* cvs.texinfo: Miscellaneous minor changes (clean up CVS/Root
|
||||
stuff, don't say release requires a module entry, etc.).
|
||||
|
||||
Tue Oct 24 11:01:22 1995 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* cvs.texinfo: More precisely describe scope of document.
|
||||
* cvsclient.texi: Describe scope of document
|
||||
|
||||
Thu Oct 12 11:25:40 1995 Karl Fogel <kfogel@totoro.cyclic.com>
|
||||
|
||||
* cvs.texinfo: cover page now refers to CVS 1.6, and "last
|
||||
updated" date has been upped to today.
|
||||
|
||||
Wed Oct 11 22:30:10 1995 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* Makefile.in (info): Look for *.info* either in build dir or in
|
||||
srcdir.
|
||||
|
||||
Mon Oct 2 17:10:49 1995 Norbert Kiesel <nk@col.sw-ley.de>
|
||||
|
||||
* cvs.texinfo (admin): Describe usage of CVS_ADMIN_GROUP to
|
||||
restrict usage of admin.
|
||||
|
||||
Fri Oct 6 21:17:50 1995 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* cvs.texinfo (~/.cvsrc): Document change to command name matching.
|
||||
|
||||
Thu Oct 5 18:03:41 1995 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* Makefile.in (install-info): Add comment about srcdir.
|
||||
|
||||
Wed Sep 13 12:45:53 1995 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* cvs.texinfo (Moving files): Rewrite "Outside" node to clarify
|
||||
that history is still there and describe how to get it. Assorted
|
||||
cleanups.
|
||||
|
||||
Tue Sep 12 19:02:47 1995 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* cvs.texinfo (Removing files): Remove section on limitations
|
||||
which are gone now that we have death support.
|
||||
|
||||
Wed Aug 30 12:32:29 1995 Karl Fogel <kfogel@floss.cyclic.com>
|
||||
|
||||
* cvs.texinfo (Remote Repositories): new node, referred to from
|
||||
`Basics' and `Repository'.
|
||||
(Repository): documented new `-d' vs. `$CVSROOT' vs. `CVS/Root'
|
||||
behavior.
|
||||
(commitinfo): document client/server-case behavior.
|
||||
(editinfo): document client/server-case behavior.
|
||||
(loginfo): document client/server-case behavior.
|
||||
(rcsinfo): document client/server-case behavior.
|
||||
|
||||
Mon Aug 21 00:23:45 1995 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* cvsclient.texi (How To): The way to force rsh is to set
|
||||
CVS_CLIENT_PORT to -1, not to some bogus value.
|
||||
|
||||
Tue Aug 15 17:12:08 1995 Karl Fogel <kfogel@floss.cyclic.com>
|
||||
|
||||
* cvs.texinfo
|
||||
(Basic concepts): talk about remote repositories.
|
||||
(Repository): same.
|
||||
|
||||
Mon Jul 24 19:09:12 1995 James Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* cvs.texinfo: Remove references to -q and -Q command options.
|
||||
|
||||
Fri Jul 21 10:33:07 1995 Vince DeMarco <vdemarco@bou.shl.com>
|
||||
|
||||
* cvs.texinfo: Changes for CVSEDITOR and wrappers.
|
||||
|
||||
Thu Jul 13 23:04:12 CDT 1995 Jim Meyering (meyering@comco.com)
|
||||
|
||||
* Makefile.in (cvs-paper.ps): *Never* redirect output directly to
|
||||
the target (usu $@) of a rule. Instead, redirect to a temporary
|
||||
file, and then move that temporary to the target. I chose to
|
||||
name temporary files $@-t. Remember to be careful that the length
|
||||
of the temporary file name not exceed the 14-character limit.
|
||||
|
||||
Sun Jul 9 19:03:00 1995 Greg A. Woods <woods@most.weird.com>
|
||||
|
||||
* doc/cvs.texinfo:
|
||||
- document '-q' for 'cvs status'
|
||||
- correction to regexp use in *info files
|
||||
- correction to use of 'cvsinit' script
|
||||
(from previous local changes)
|
||||
|
||||
Tue Jun 20 18:57:55 1995 James Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* Makefile.in (dist-dir): Depend on $(OBJDIR_DISTFILES).
|
||||
|
||||
Fri Jun 16 21:56:16 1995 Karl Fogel <kfogel@cyclic.com>
|
||||
and Jim Meyering <meyering@comco.com>
|
||||
|
||||
* update.c (update_file_proc): If noexec, just write 'C', don't merge.
|
||||
|
||||
Fri Jun 16 07:56:04 1995 Jim Kingdon (kingdon@cyclic.com)
|
||||
|
||||
* cvs-paper.ps: Added.
|
||||
|
||||
Sat May 27 08:46:00 1995 Jim Meyering (meyering@comco.com)
|
||||
|
||||
* Makefile.in (Makefile): Regenerate only Makefile in current
|
||||
directory when Makefile.in is out of date. Depend on ../config.status.
|
||||
|
||||
Sat May 27 08:08:18 1995 Jim Meyering (meyering@comco.com)
|
||||
|
||||
* doc/Makefile.in (realclean): Remove more postscript and info files.
|
||||
|
||||
Fri Apr 28 22:44:06 1995 Jim Blandy <jimb@totoro.bio.indiana.edu>
|
||||
|
||||
* Makefile.in (DISTFILES): Updated.
|
||||
(doc): Depend on cvsclient.ps too.
|
||||
(cvs.aux, cvsclient.aux): Add target.
|
||||
(cvsclient.dvi): Don't nuke the aux file. They're small and
|
||||
helpful.
|
||||
(cvsclient.ps): New target.
|
||||
(dist-dir): Renamed from dist; changed to work with DISTDIR
|
||||
variable from parent.
|
||||
|
||||
Sun Apr 23 22:13:18 1995 Noel Cragg <noel@vo.com>
|
||||
|
||||
* Makefile: Added more files to the `clean' target.
|
||||
* .cvsignore: Added the same files.
|
||||
|
||||
Mon Nov 28 10:22:46 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
|
||||
|
||||
* cvsclient.texi (Notes): Remove item about commit options; now
|
||||
fixed. Rewrite paragraph about server memory usage.
|
||||
|
||||
* cvsclient.texi (Responses): Add Set-checkin-prog and
|
||||
Set-update-prog.
|
||||
(Requests): Add Checkin-prog and Update-prog.
|
||||
* cvsclient.texi (TODO): Remove last item (it is fixed) and node.
|
||||
|
||||
Fri Nov 18 16:51:36 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
|
||||
|
||||
* cvsclient.texi (Requests): Add Max-dotdot.
|
||||
|
||||
Thu Nov 3 07:04:24 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
|
||||
|
||||
* cvsclient.texi (Protocol): Add Directory request.
|
||||
(TODO): Remove item about renaming directories.
|
||||
(Protocol): Change @subheading to @node/@section.
|
||||
|
||||
Fri Oct 28 07:51:13 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
|
||||
|
||||
* cvsclient.texi (Protocol): Add expand-module request and
|
||||
Module-expansion response.
|
||||
(Protocol Notes, TODO): Remove items about cvs co funkiness.
|
||||
|
||||
Wed Oct 12 19:49:36 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
|
||||
|
||||
* cvsclient.texi (Protocol): Add Copy-file response.
|
||||
|
||||
* cvsclient.texi (How To): Correct item about where declaration
|
||||
of cvs commands go.
|
||||
|
||||
* cvsclient.texi (Protocol): Add new commands. Merge description
|
||||
of how commands work which was duplicated among the various
|
||||
commands. Formatting cleanups.
|
||||
(TODO): Remove item about bad error message on checking in a
|
||||
nonexistent file; this works now (presumably fixed by the
|
||||
Unchanged stuff).
|
||||
(Notes): Remove thing about trying unsupported commands via NFS,
|
||||
rdist, etc. Also remove item about some commands not being
|
||||
supported. There are no unsupported commands anymore.
|
||||
|
||||
Tue Sep 13 13:28:52 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
|
||||
|
||||
* cvsclient.texi (Protocol): Document New-entry response.
|
||||
|
||||
Mon Sep 12 06:35:15 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
|
||||
|
||||
* cvsclient.texi (Protocol): Clarify that checksum is of patched
|
||||
file, not patch itself. Fix typo (valid-requests -> Valid-requests).
|
||||
|
||||
* cvsclient.texi (Protocol): Document Sticky request and
|
||||
Set-sticky and Clear-sticky responses.
|
||||
(Notes): Remove sticky tags from todo list.
|
||||
|
||||
Thu Sep 8 14:23:58 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
|
||||
|
||||
* cvsclient.texi (Protocol): Document Static-directory requests
|
||||
and Set-static-directory and Clear-static-directory responses.
|
||||
(Notes): Remove Entries.Static support from todo list.
|
||||
|
||||
* cvsclient.texi (Protocol): Document Unchanged and UseUnchanged
|
||||
requests. Update documentation of Entry and Lost accordingly.
|
||||
|
||||
Mon Aug 22 14:08:21 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
|
||||
|
||||
* cvsclient.texi (Goals): Remove mention of rsh.
|
||||
(Protocol Notes, TODO): Remove compression item.
|
||||
(Protocol): Document "status" request.
|
||||
(TODO): Remove suggestion to add "cvs status".
|
||||
|
||||
Tue Jul 19 10:02:53 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
|
||||
|
||||
* Makefile.in (install-info): Do not depend upon installdirs.
|
||||
|
||||
Fri Jul 15 12:56:53 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
|
||||
|
||||
* Makefile.in (all): Do not depend upon info.
|
||||
(install): Do not depend upon install-info.
|
||||
|
||||
Thu Jul 7 20:43:12 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
|
||||
|
||||
* cvsclient.texi (Protocol): Add Checksum response.
|
||||
|
||||
Thu Jun 30 15:16:50 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
|
||||
|
||||
* cvsclient.texi (Protocol): Add Global_option request.
|
||||
|
||||
Wed Jun 29 14:09:42 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
|
||||
|
||||
* cvsclient.texi: Describe sending patches, including the dummy
|
||||
update-patches request and the Patched response. Mention Kerberos
|
||||
authentication using ``cvs kserver''. Some other minor changes.
|
||||
|
||||
Tue Jun 28 15:21:06 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
|
||||
|
||||
* cvsclient.texi (Protocol Notes): Remove note about sending diffs
|
||||
in Updated; Ian did it. Remove note about adding encryption to rsh.
|
||||
|
||||
Sat May 7 10:44:30 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
|
||||
|
||||
* cvsclient.texi (Protocol): Document Modified without Entry. Add
|
||||
`add' and `remove' and `Remove-entry'. Formatting cleanups.
|
||||
|
||||
Tue Apr 19 01:29:04 1994 John Gilmore (gnu@cygnus.com)
|
||||
|
||||
* cvsclient.texi: New node How To; cleanups throughout.
|
||||
* Makefile.in: Add dependencies on cvsclient.texi.
|
||||
|
38
contrib/cvs/doc/ChangeLog.fsf
Normal file
38
contrib/cvs/doc/ChangeLog.fsf
Normal file
@ -0,0 +1,38 @@
|
||||
Thu Sep 15 14:19:50 1994 david d `zoo' zuhn <zoo@monad.armadillo.com>
|
||||
|
||||
* Makefile.in: define TEXI2DVI
|
||||
|
||||
Sat Dec 18 01:23:39 1993 david d zuhn (zoo@monad.armadillo.com)
|
||||
|
||||
* cvs.texinfo: document -k SUBST options to 'cvs import';
|
||||
regularize use @sc{cvs}
|
||||
|
||||
* Makefile.in (VPATH): don't use $(srcdir), but @srcdir@ instead
|
||||
(install-info): grab all info files, not just *.info
|
||||
|
||||
Mon Oct 11 16:23:54 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
|
||||
|
||||
* cvsclient.texi: New node TODO; various other changes.
|
||||
|
||||
Wed Feb 26 18:04:40 1992 K. Richard Pixley (rich@cygnus.com)
|
||||
|
||||
* Makefile.in, configure.in: removed traces of namesubdir,
|
||||
-subdirs, $(subdir), $(unsubdir), some rcs triggers. Forced
|
||||
copyrights to '92, changed some from Cygnus to FSF.
|
||||
|
||||
Tue Dec 10 04:07:10 1991 K. Richard Pixley (rich at rtl.cygnus.com)
|
||||
|
||||
* Makefile.in: infodir belongs in datadir.
|
||||
|
||||
Thu Dec 5 22:46:01 1991 K. Richard Pixley (rich at rtl.cygnus.com)
|
||||
|
||||
* Makefile.in: idestdir and ddestdir go away. Added copyrights
|
||||
and shift gpl to v2. Added ChangeLog if it didn't exist. docdir
|
||||
and mandir now keyed off datadir by default.
|
||||
|
||||
Wed Nov 27 02:45:18 1991 K. Richard Pixley (rich at sendai)
|
||||
|
||||
* brought Makefile.in's up to standards.text.
|
||||
|
||||
* fresh changelog.
|
||||
|
203
contrib/cvs/doc/Makefile.in
Normal file
203
contrib/cvs/doc/Makefile.in
Normal file
@ -0,0 +1,203 @@
|
||||
# Makefile for GNU CVS documentation.
|
||||
# Do not use this makefile directly, but only from `../Makefile'.
|
||||
# Copyright (C) 1986, 1988-1990 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
# $CVSid: @(#)Makefile.in 1.8 94/10/22 $
|
||||
|
||||
SHELL = /bin/sh
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
infodir = $(prefix)/info
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
|
||||
DISTFILES = \
|
||||
.cvsignore ChangeLog ChangeLog.fsf Makefile.in \
|
||||
cvs-paper.ms cvs-paper.ps \
|
||||
cvs.texinfo \
|
||||
cvsclient.texi
|
||||
|
||||
OBJDIR_DISTFILES = cvs.ps cvs.info cvs.aux \
|
||||
cvsclient.ps cvsclient.info cvsclient.aux CVSvn.texi
|
||||
|
||||
# these are part of the texinfo distribution
|
||||
MAKEINFO=makeinfo
|
||||
TEXI2DVI = texi2dvi
|
||||
|
||||
# where to find texinfo;
|
||||
TEXIDIR=${gdbdir}/../texinfo
|
||||
|
||||
SET_TEXINPUTS = TEXINPUTS=.:$(srcdir):$$TEXINPUTS
|
||||
|
||||
# Don Knuth's TeX formatter
|
||||
TEX = tex
|
||||
|
||||
# auxiliary program for sorting Texinfo indices
|
||||
TEXINDEX = texindex
|
||||
|
||||
DVIPS = dvips
|
||||
DVIPSFLAGS =
|
||||
|
||||
ROFF = groff
|
||||
|
||||
# CYGNUS LOCAL: all does not depend upon info
|
||||
all:
|
||||
.PHONY: all
|
||||
|
||||
# CYGNUS LOCAL: install does not depend on install-info
|
||||
install: all
|
||||
.PHONY: install
|
||||
|
||||
doc: cvs.ps cvs-paper.ps cvsclient.ps
|
||||
|
||||
info: cvs.info cvsclient.info
|
||||
|
||||
cvs.info: cvs.texinfo CVSvn.texi
|
||||
if [ ! -f ./CVSvn.texi ]; then \
|
||||
ln -s $(srcdir)/CVSvn.texi . || \
|
||||
ln $(srcdir)/CVSvn.texi . || \
|
||||
cp $(srcdir)/CVSvn.texi . ; else true; fi
|
||||
$(MAKEINFO) $(srcdir)/cvs.texinfo -o cvs.info
|
||||
|
||||
cvsclient.info: cvsclient.texi CVSvn.texi
|
||||
if [ ! -f ./CVSvn.texi ]; then \
|
||||
ln -s $(srcdir)/CVSvn.texi . || \
|
||||
ln $(srcdir)/CVSvn.texi . || \
|
||||
cp $(srcdir)/CVSvn.texi . ; else true; fi
|
||||
$(MAKEINFO) $(srcdir)/cvsclient.texi -o cvsclient.info
|
||||
|
||||
# Version of the protocol suitable for emailing
|
||||
cvsclient.txt: cvsclient.texi CVSvn.texi
|
||||
if [ ! -f ./CVSvn.texi ]; then \
|
||||
ln -s $(srcdir)/CVSvn.texi . || \
|
||||
ln $(srcdir)/CVSvn.texi . || \
|
||||
cp $(srcdir)/CVSvn.texi . ; else true; fi
|
||||
$(MAKEINFO) $(srcdir)/cvsclient.texi --no-headers -o cvsclient.txt
|
||||
|
||||
# If the user gets a distribution (which contains *.info), unpacks
|
||||
# it, and builds it in a seperate build dir, then *.info* are in srcdir.
|
||||
# If the user builds *.info (e.g. after editing *.texi), then *.info* are
|
||||
# in the build dir.
|
||||
install-info: info
|
||||
test -f cvs.info || cd $(srcdir); \
|
||||
for i in *.info* ; do \
|
||||
$(INSTALL_DATA) $$i $(infodir)/$$i ; \
|
||||
done
|
||||
|
||||
installdirs:
|
||||
$(SHELL) $(top_srcdir)/mkinstalldirs $(infodir)
|
||||
.PHONY: installdirs
|
||||
|
||||
dvi: cvs.dvi cvsclient.dvi
|
||||
|
||||
CVSvn.texi: $(top_srcdir)/src/version.c
|
||||
echo "@set CVSVN `sed < $(top_srcdir)/src/version.c \
|
||||
-e '/version_string/!d' \
|
||||
-e 's/[^0-9.]*\([0-9.]*\).*/\1/' \
|
||||
-e q`" >CVSvn.new
|
||||
mv CVSvn.new CVSvn.texi
|
||||
|
||||
cvs.dvi cvs.aux: cvs.texinfo CVSvn.texi
|
||||
if [ ! -f ./CVSvn.texi ]; then \
|
||||
ln -s $(srcdir)/CVSvn.texi . || \
|
||||
ln $(srcdir)/CVSvn.texi . || \
|
||||
cp $(srcdir)/CVSvn.texi . ; else true; fi
|
||||
$(TEXI2DVI) $(srcdir)/cvs.texinfo
|
||||
|
||||
cvsclient.dvi cvsclient.aux: cvsclient.texi CVSvn.texi
|
||||
if [ ! -f ./CVSvn.texi ]; then \
|
||||
ln -s $(srcdir)/CVSvn.texi . || \
|
||||
ln $(srcdir)/CVSvn.texi . || \
|
||||
cp $(srcdir)/CVSvn.texi . ; else true; fi
|
||||
$(SET_TEXINPUTS) $(TEX) cvsclient.texi
|
||||
$(SET_TEXINPUTS) $(TEX) cvsclient.texi
|
||||
$(TEXINDEX) cvsclient.??
|
||||
$(SET_TEXINPUTS) $(TEX) cvsclient.texi
|
||||
rm -f cvsclient.?? cvsclient.log cvsclient.toc cvsclient.??s
|
||||
|
||||
cvs.ps: cvs.dvi
|
||||
$(DVIPS) $(DVIPSFLAGS) cvs.dvi -o cvs.ps
|
||||
|
||||
cvs-paper.ps: cvs-paper.ms
|
||||
$(ROFF) -t -p -ms -Tps $(srcdir)/cvs-paper.ms > $@-t
|
||||
mv $@-t $@
|
||||
|
||||
cvsclient.ps: cvsclient.dvi
|
||||
$(DVIPS) $(DVIPSFLAGS) cvsclient.dvi -o cvsclient.ps
|
||||
|
||||
tags:
|
||||
.PHONY: tags
|
||||
|
||||
TAGS:
|
||||
.PHONY: TAGS
|
||||
|
||||
ls:
|
||||
@echo $(DISTFILES)
|
||||
.PHONY: ls
|
||||
|
||||
clean:
|
||||
rm -f *.o core
|
||||
rm -f cvs.cp cvs.fn cvs.ky cvs.pg cvs.tp cvs.vr
|
||||
rm -f cvs.cps cvs.fns cvs.kys cvs.pgs cvs.tps cvs.vrs
|
||||
rm -f cvs.aux cvs.dvi cvs.log cvs.toc
|
||||
rm -f cvsclient.cp cvsclient.fn cvsclient.ky cvsclient.pg
|
||||
rm -f cvsclient.tp cvsclient.vr cvsclient.cps cvsclient.fns
|
||||
rm -f cvsclient.kys cvsclient.pgs cvsclient.tps cvsclient.vrs
|
||||
rm -f cvsclient.aux cvsclient.dvi cvsclient.log cvsclient.toc
|
||||
|
||||
.PHONY: clean
|
||||
|
||||
distclean: clean
|
||||
rm -f Makefile
|
||||
.PHONY: distclean
|
||||
|
||||
realclean: distclean
|
||||
rm -f cvs.info* cvs.ps cvs-paper.ps cvsclient.info* cvsclient.ps
|
||||
.PHONY: realclean
|
||||
|
||||
dist-dir: $(DISTFILES) $(OBJDIR_DISTFILES)
|
||||
mkdir ${DISTDIR}
|
||||
for i in ${DISTFILES}; do \
|
||||
ln $(srcdir)/$${i} ${DISTDIR}; \
|
||||
done
|
||||
ln ${OBJDIR_DISTFILES} ${DISTDIR}
|
||||
if [ -f cvs.info-1 ]; \
|
||||
then ln -f cvs.info-* ${DISTDIR}; \
|
||||
else : Pacify Ultrix sh; \
|
||||
fi
|
||||
if [ -f cvsclient.info-1 ]; \
|
||||
then ln -f cvsclient.info-* ${DISTDIR}; \
|
||||
else : Pacify Ultrix sh; \
|
||||
fi
|
||||
.PHONY: dist-dir
|
||||
|
||||
subdir = doc
|
||||
Makefile: ../config.status Makefile.in
|
||||
cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
|
||||
|
||||
#../config.status: ../configure
|
||||
# cd .. ; $(SHELL) config.status --recheck
|
||||
|
||||
#../configure: ../configure.in
|
||||
# cd $(top_srcdir) ; autoconf
|
1073
contrib/cvs/doc/cvs-paper.ms
Normal file
1073
contrib/cvs/doc/cvs-paper.ms
Normal file
File diff suppressed because it is too large
Load Diff
7738
contrib/cvs/doc/cvs.texinfo
Normal file
7738
contrib/cvs/doc/cvs.texinfo
Normal file
File diff suppressed because it is too large
Load Diff
824
contrib/cvs/doc/cvsclient.texi
Normal file
824
contrib/cvs/doc/cvsclient.texi
Normal file
@ -0,0 +1,824 @@
|
||||
\input texinfo @c -*- texinfo -*-
|
||||
|
||||
@setfilename cvsclient.info
|
||||
@include CVSvn.texi
|
||||
|
||||
@node Top
|
||||
@top CVS Client/Server
|
||||
|
||||
This document describes the client/server protocol used by CVS. It does
|
||||
not describe how to use or administer client/server CVS; see the regular
|
||||
CVS manual for that. This is version @value{CVSVN} of the protocol
|
||||
specification---@xref{Introduction} for more on what this version number
|
||||
means.
|
||||
|
||||
@menu
|
||||
* Introduction:: What is CVS and what is the client/server protocol for?
|
||||
* Goals:: Basic design decisions, requirements, scope, etc.
|
||||
* Notes:: Notes on the current implementation
|
||||
* Protocol Notes:: Possible enhancements, limitations, etc. of the protocol
|
||||
* Connection and Authentication:: Various ways to connect to the server
|
||||
* Protocol:: Complete description of the protocol
|
||||
@end menu
|
||||
|
||||
@node Introduction
|
||||
@chapter Introduction
|
||||
|
||||
CVS is a version control system (with some additional configuration
|
||||
management functionality). It maintains a central @dfn{repository}
|
||||
which stores files (often source code), including past versions,
|
||||
information about who modified them and when, and so on. People who
|
||||
wish to look at or modify those files, known as @dfn{developers}, use
|
||||
CVS to @dfn{check out} a @dfn{working directory} from the repository, to
|
||||
@dfn{check in} new versions of files to the repository, and other
|
||||
operations such as viewing the modification history of a file. If
|
||||
developers are connected to the repository by a network, particularly a
|
||||
slow or flaky one, the most efficient way to use the network is with the
|
||||
CVS-specific protocol described in this document.
|
||||
|
||||
Developers, using the machine on which they store their working
|
||||
directory, run the CVS @dfn{client} program. To perform operations
|
||||
which cannot be done locally, it connects to the CVS @dfn{server}
|
||||
program, which maintains the repository. For more information on how
|
||||
to connect see @ref{Connection and Authentication}.
|
||||
|
||||
This document describes the CVS protocol. Unfortunately, it does not
|
||||
yet completely document one aspect of the protocol---the detailed
|
||||
operation of each CVS command and option---and one must look at the CVS
|
||||
user documentation, @file{cvs.texinfo}, for that information. The
|
||||
protocol is non-proprietary (anyone who wants to is encouraged to
|
||||
implement it) and an implementation, known as CVS, is available under
|
||||
the GNU Public License. The CVS distribution, containing this
|
||||
implementation, @file{cvs.texinfo}, and a copy (possibly more or less up
|
||||
to date than what you are reading now) of this document,
|
||||
@file{cvsclient.texi}, can be found at the usual GNU FTP sites, with a
|
||||
filename such as @file{cvs-@var{version}.tar.gz}.
|
||||
|
||||
This is version @value{CVSVN} of the protocol specification. This
|
||||
version number is intended only to aid in distinguishing different
|
||||
versions of this specification. Although the specification is currently
|
||||
maintained in conjunction with the CVS implementation, and carries the
|
||||
same version number, it also intends to document what is involved with
|
||||
interoperating with other implementations (such as other versions of
|
||||
CVS); see @xref{Requirements}. This version number should not be used
|
||||
by clients or servers to determine what variant of the protocol to
|
||||
speak; they should instead use the @code{valid-requests} and
|
||||
@code{Valid-responses} mechanism (@pxref{Protocol}), which is more
|
||||
flexible.
|
||||
|
||||
@node Goals
|
||||
@chapter Goals
|
||||
|
||||
@itemize @bullet
|
||||
@item
|
||||
Do not assume any access to the repository other than via this protocol.
|
||||
It does not depend on NFS, rdist, etc.
|
||||
|
||||
@item
|
||||
Providing a reliable transport is outside this protocol. It is expected
|
||||
that it runs over TCP, UUCP, etc.
|
||||
|
||||
@item
|
||||
Security and authentication are handled outside this protocol (but see
|
||||
below about @samp{cvs kserver}).
|
||||
|
||||
@item
|
||||
This might be a first step towards adding transactions to CVS (i.e. a
|
||||
set of operations is either executed atomically or none of them is
|
||||
executed), improving the locking, or other features. The current server
|
||||
implementation is a long way from being able to do any of these
|
||||
things. The protocol, however, is not known to contain any defects
|
||||
which would preclude them.
|
||||
|
||||
@item
|
||||
The server never has to have any CVS locks in place while it is waiting
|
||||
for communication with the client. This makes things robust in the face
|
||||
of flaky networks.
|
||||
|
||||
@item
|
||||
Data is transferred in large chunks, which is necessary for good
|
||||
performance. In fact, currently the client uploads all the data
|
||||
(without waiting for server responses), and then waits for one server
|
||||
response (which consists of a massive download of all the data). There
|
||||
may be cases in which it is better to have a richer interraction, but
|
||||
the need for the server to release all locks whenever it waits for the
|
||||
client makes it complicated.
|
||||
@end itemize
|
||||
|
||||
@node Notes
|
||||
@chapter Notes on the Current Implementation
|
||||
|
||||
The client is built in to the normal @code{cvs} program, triggered by a
|
||||
@code{CVSROOT} variable containing a colon, for example
|
||||
@code{cygnus.com:/rel/cvsfiles}.
|
||||
|
||||
The client stores what is stored in checked-out directories (including
|
||||
@file{CVS}). The way these are stored is totally compatible with
|
||||
standard CVS. The server requires no storage other than the repository,
|
||||
which also is totally compatible with standard CVS.
|
||||
|
||||
The server is started by @code{cvs server}. There is no particularly
|
||||
compelling reason for this rather than making it a separate program
|
||||
which shares a lot of sources with cvs.
|
||||
|
||||
The server can also be started by @code{cvs kserver}, in which case it
|
||||
does an initial Kerberos authentication on stdin. If the authentication
|
||||
succeeds, it subsequently runs identically to @code{cvs server}.
|
||||
|
||||
The current server implementation can use up huge amounts of memory
|
||||
when transmitting a lot of data over a slow link (i.e. the network is
|
||||
slower than the server can generate the data). There is some
|
||||
experimental code (see @code{SERVER_FLOWCONTROL} in options.h) which
|
||||
should help significantly.
|
||||
|
||||
@node Protocol Notes
|
||||
@chapter Notes on the Protocol
|
||||
|
||||
A number of enhancements are possible:
|
||||
|
||||
@itemize @bullet
|
||||
@item
|
||||
The @code{Modified} request could be speeded up by sending diffs rather
|
||||
than entire files. The client would need some way to keep the version
|
||||
of the file which was originally checked out, which would double client
|
||||
disk space requirements or require coordination with editors (e.g. maybe
|
||||
it could use emacs numbered backups). This would also allow local
|
||||
operation of @code{cvs diff} without arguments.
|
||||
|
||||
@item
|
||||
Have the client keep a copy of some part of the repository. This allows
|
||||
all of @code{cvs diff} and large parts of @code{cvs update} and
|
||||
@code{cvs ci} to be local. The local copy could be made consistent with
|
||||
the master copy at night (but if the master copy has been updated since
|
||||
the latest nightly re-sync, then it would read what it needs to from the
|
||||
master).
|
||||
|
||||
@item
|
||||
Provide encryption using kerberos.
|
||||
|
||||
@item
|
||||
The current procedure for @code{cvs update} is highly sub-optimal if
|
||||
there are many modified files. One possible alternative would be to
|
||||
have the client send a first request without the contents of every
|
||||
modified file, then have the server tell it what files it needs. Note
|
||||
the server needs to do the what-needs-to-be-updated check twice (or
|
||||
more, if changes in the repository mean it has to ask the client for
|
||||
more files), because it can't keep locks open while waiting for the
|
||||
network. Perhaps this whole thing is irrelevant if client-side
|
||||
repositories are implemented, and the rcsmerge is done by the client.
|
||||
@end itemize
|
||||
|
||||
@node Connection and Authentication
|
||||
@chapter How to Connect to and Authenticate Oneself to the CVS server
|
||||
|
||||
Connection and authentication occurs before the CVS protocol itself is
|
||||
started. There are several ways to connect.
|
||||
|
||||
@table @asis
|
||||
@item rsh
|
||||
If the client has a way to execute commands on the server, and provide
|
||||
input to the commands and output from them, then it can connect that
|
||||
way. This could be the usual rsh (port 514) protocol, Kerberos rsh,
|
||||
SSH, or any similar mechanism. The client may allow the user to specify
|
||||
the name of the server program; the default is @code{cvs}. It is
|
||||
invoked with one argument, @code{server}. Once it invokes the server,
|
||||
the client proceeds to start the cvs protocol.
|
||||
|
||||
@item kserver
|
||||
The kerberized server listens on a port (in the current implementation,
|
||||
by having inetd call "cvs kserver") which defaults to 1999. The client
|
||||
connects, sends the usual kerberos authentication information, and then
|
||||
starts the cvs protocol. Note: port 1999 is officially registered for
|
||||
another use, and in any event one cannot register more than one port for
|
||||
CVS, so the kerberized client and server should be changed to use port
|
||||
2401 (see below), and send a different string in place of @samp{BEGIN
|
||||
AUTH REQUEST} to identify the authentication method in use. However,
|
||||
noone has yet gotten around to implementing this.
|
||||
|
||||
@item pserver
|
||||
The password authenticated server listens on a port (in the current
|
||||
implementation, by having inetd call "cvs pserver") which defaults to
|
||||
2401 (this port is officially registered). The client
|
||||
connects, sends the string @samp{BEGIN AUTH REQUEST}, a linefeed, the
|
||||
cvs root, a linefeed, the username, a linefeed, the password trivially
|
||||
encoded (see scramble.c in the cvs sources), a linefeed, the string
|
||||
@samp{END AUTH REQUEST}, and a linefeed. The server responds with
|
||||
@samp{I LOVE YOU} and a linefeed if the authentication is successful or
|
||||
@samp{I HATE YOU} and a linefeed if the authentication fails. After
|
||||
receiving @samp{I LOVE YOU}, the client proceeds with the cvs protocol.
|
||||
If the client wishes to merely authenticate without starting the cvs
|
||||
protocol, the procedure is the same, except @samp{BEGIN AUTH REQUEST} is
|
||||
replaced with @samp{BEGIN VERIFICATION REQUEST}, @samp{END AUTH REQUEST}
|
||||
is replaced with @samp{END VERIFICATION REQUEST}, and upon receipt of
|
||||
@samp{I LOVE YOU} the connection is closed rather than continuing.
|
||||
@end table
|
||||
|
||||
@node Protocol
|
||||
@chapter The CVS client/server protocol
|
||||
|
||||
In the following, @samp{\n} refers to a linefeed and @samp{\t} refers
|
||||
to a horizontal tab.
|
||||
|
||||
@menu
|
||||
* Entries Lines::
|
||||
* Modes::
|
||||
* Filenames:: Conventions regarding filenames
|
||||
* Requests::
|
||||
* Responses::
|
||||
* Example::
|
||||
* Requirements::
|
||||
@end menu
|
||||
|
||||
@node Entries Lines
|
||||
@section Entries Lines
|
||||
|
||||
Entries lines are transmitted as:
|
||||
|
||||
@example
|
||||
/ @var{name} / @var{version} / @var{conflict} / @var{options} / @var{tag_or_date}
|
||||
@end example
|
||||
|
||||
@var{tag_or_date} is either @samp{T} @var{tag} or @samp{D} @var{date}
|
||||
or empty. If it is followed by a slash, anything after the slash
|
||||
shall be silently ignored.
|
||||
|
||||
@var{version} can be empty, or start with @samp{0} or @samp{-}, for no
|
||||
user file, new user file, or user file to be removed, respectively.
|
||||
|
||||
@var{conflict}, if it starts with @samp{+}, indicates that the file had
|
||||
conflicts in it. The rest of @var{conflict} is @samp{=} if the
|
||||
timestamp matches the file, or anything else if it doesn't. If
|
||||
@var{conflict} does not start with a @samp{+}, it is silently ignored.
|
||||
|
||||
@node Modes
|
||||
@section Modes
|
||||
|
||||
A mode is any number of repetitions of
|
||||
|
||||
@example
|
||||
@var{mode-type} = @var{data}
|
||||
@end example
|
||||
|
||||
separated by @samp{,}.
|
||||
|
||||
@var{mode-type} is an identifier composed of alphanumeric characters.
|
||||
Currently specified: @samp{u} for user, @samp{g} for group, @samp{o}
|
||||
for other (see below for discussion of whether these have their POSIX
|
||||
meaning or are more loose). Unrecognized values of @var{mode-type}
|
||||
are silently ignored.
|
||||
|
||||
@var{data} consists of any data not containing @samp{,}, @samp{\0} or
|
||||
@samp{\n}. For @samp{u}, @samp{g}, and @samp{o} mode types, data
|
||||
consists of alphanumeric characters, where @samp{r} means read, @samp{w}
|
||||
means write, @samp{x} means execute, and unrecognized letters are
|
||||
silently ignored.
|
||||
|
||||
The two most obvious ways in which the mode matters are: (1) is it
|
||||
writeable? This is used by the developer communication features, and
|
||||
is implemented even on OS/2 (and could be implemented on DOS), whose
|
||||
notion of mode is limited to a readonly bit. (2) is it executable?
|
||||
Unix CVS users need CVS to store this setting (for shell scripts and
|
||||
the like). The current CVS implementation on unix does a little bit
|
||||
more than just maintain these two settings, but it doesn't really have
|
||||
a nice general facility to store or version control the mode, even on
|
||||
unix, much less across operating systems with diverse protection
|
||||
features. So all the ins and outs of what the mode means across
|
||||
operating systems haven't really been worked out (e.g. should the VMS
|
||||
port use ACLs to get POSIX semantics for groups?).
|
||||
|
||||
@node Filenames
|
||||
@section Conventions regarding transmission of file names
|
||||
|
||||
In most contexts, @samp{/} is used to separate directory and file
|
||||
names in filenames, and any use of other conventions (for example,
|
||||
that the user might type on the command line) is converted to that
|
||||
form. The only exceptions might be a few cases in which the server
|
||||
provides a magic cookie which the client then repeats verbatim, but as
|
||||
the server has not yet been ported beyond unix, the two rules provide
|
||||
the same answer (and what to do if future server ports are operating
|
||||
on a repository like e:/foo or CVS_ROOT:[FOO.BAR] has not been
|
||||
carefully thought out).
|
||||
|
||||
@node Requests
|
||||
@section Requests
|
||||
|
||||
File contents (noted below as @var{file transmission}) can be sent in
|
||||
one of two forms. The simpler form is a number of bytes, followed by a
|
||||
newline, followed by the specified number of bytes of file contents.
|
||||
These are the entire contents of the specified file. Second, if both
|
||||
client and server support @samp{gzip-file-contents}, a @samp{z} may
|
||||
precede the length, and the `file contents' sent are actually compressed
|
||||
with @samp{gzip}. The length specified is that of the compressed
|
||||
version of the file.
|
||||
|
||||
In neither case are the file content followed by any additional data.
|
||||
The transmission of a file will end with a newline iff that file (or its
|
||||
compressed form) ends with a newline.
|
||||
|
||||
@table @code
|
||||
@item Root @var{pathname} \n
|
||||
Response expected: no. Tell the server which @code{CVSROOT} to use.
|
||||
@var{pathname} must already exist; if creating a new root, use the
|
||||
@code{init} request, not @code{Root}. @var{pathname} does not include
|
||||
the hostname of the server, how to access the server, etc.; by the time
|
||||
the CVS protocol is in use, connection, authentication, etc., are
|
||||
already taken care of.
|
||||
|
||||
@item Valid-responses @var{request-list} \n
|
||||
Response expected: no.
|
||||
Tell the server what responses the client will accept.
|
||||
request-list is a space separated list of tokens.
|
||||
|
||||
@item valid-requests \n
|
||||
Response expected: yes.
|
||||
Ask the server to send back a @code{Valid-requests} response.
|
||||
|
||||
@item Repository @var{repository} \n
|
||||
Response expected: no. Tell the server what repository to use. This
|
||||
should be a directory name from a previous server response. Note that
|
||||
this both gives a default for @code{Entry } and @code{Modified } and
|
||||
also for @code{ci} and the other commands; normal usage is to send a
|
||||
@code{Repository } for each directory in which there will be an
|
||||
@code{Entry } or @code{Modified }, and then a final @code{Repository }
|
||||
for the original directory, then the command.
|
||||
|
||||
@item Directory @var{local-directory} \n
|
||||
Additional data: @var{repository} \n. This is like @code{Repository},
|
||||
but the local name of the directory may differ from the repository name.
|
||||
If the client uses this request, it affects the way the server returns
|
||||
pathnames; see @ref{Responses}. @var{local-directory} is relative to
|
||||
the top level at which the command is occurring (i.e. the last
|
||||
@code{Directory} or @code{Repository} which is sent before the command).
|
||||
|
||||
@item Max-dotdot @var{level} \n
|
||||
Tell the server that @var{level} levels of directories above the
|
||||
directory which @code{Directory} requests are relative to will be
|
||||
needed. For example, if the client is planning to use a
|
||||
@code{Directory} request for @file{../../foo}, it must send a
|
||||
@code{Max-dotdot} request with a @var{level} of at least 2.
|
||||
@code{Max-dotdot} must be sent before the first @code{Directory}
|
||||
request.
|
||||
|
||||
@item Static-directory \n
|
||||
Response expected: no. Tell the server that the directory most recently
|
||||
specified with @code{Repository} or @code{Directory} should not have
|
||||
additional files checked out unless explicitly requested. The client
|
||||
sends this if the @code{Entries.Static} flag is set, which is controlled
|
||||
by the @code{Set-static-directory} and @code{Clear-static-directory}
|
||||
responses.
|
||||
|
||||
@item Sticky @var{tagspec} \n
|
||||
Response expected: no. Tell the server that the directory most recently
|
||||
specified with @code{Repository} has a sticky tag or date @var{tagspec}.
|
||||
The first character of @var{tagspec} is @samp{T} for a tag, or @samp{D}
|
||||
for a date. The remainder of @var{tagspec} contains the actual tag or
|
||||
date.
|
||||
|
||||
@item Checkin-prog @var{program} \n
|
||||
Response expected: no. Tell the server that the directory most recently
|
||||
specified with @code{Directory} has a checkin program @var{program}.
|
||||
Such a program would have been previously set with the
|
||||
@code{Set-checkin-prog} response.
|
||||
|
||||
@item Update-prog @var{program} \n
|
||||
Response expected: no. Tell the server that the directory most recently
|
||||
specified with @code{Directory} has an update program @var{program}.
|
||||
Such a program would have been previously set with the
|
||||
@code{Set-update-prog} response.
|
||||
|
||||
@item Entry @var{entry-line} \n
|
||||
Response expected: no. Tell the server what version of a file is on the
|
||||
local machine. The name in @var{entry-line} is a name relative to the
|
||||
directory most recently specified with @code{Repository}. If the user
|
||||
is operating on only some files in a directory, @code{Entry} requests
|
||||
for only those files need be included. If an @code{Entry} request is
|
||||
sent without @code{Modified}, @code{Unchanged}, or @code{Lost} for that
|
||||
file the meaning depends on whether @code{UseUnchanged} has been sent;
|
||||
if it has been it means the file is lost, if not it means the file is
|
||||
unchanged.
|
||||
|
||||
@item Modified @var{filename} \n
|
||||
Response expected: no. Additional data: mode, \n, file transmission.
|
||||
Send the server a copy of one locally modified file. @var{filename} is
|
||||
relative to the most recent repository sent with @code{Repository}. If
|
||||
the user is operating on only some files in a directory, only those
|
||||
files need to be included. This can also be sent without @code{Entry},
|
||||
if there is no entry for the file.
|
||||
|
||||
@item Lost @var{filename} \n
|
||||
Response expected: no. Tell the server that @var{filename} no longer
|
||||
exists. The name is relative to the most recent repository sent with
|
||||
@code{Repository}. This is used for any case in which @code{Entry} is
|
||||
being sent but the file no longer exists. If the client has issued the
|
||||
@code{UseUnchanged} request, then this request is not used.
|
||||
|
||||
@item Unchanged @var{filename} \n
|
||||
Response expected: no. Tell the server that @var{filename} has not been
|
||||
modified in the checked out directory. The name is relative to the most
|
||||
recent repository sent with @code{Repository}. This request can only be
|
||||
issued if @code{UseUnchanged} has been sent.
|
||||
|
||||
@item UseUnchanged \n
|
||||
Response expected: no. Tell the server that the client will be
|
||||
indicating unmodified files with @code{Unchanged}, and that files for
|
||||
which no information is sent are nonexistent on the client side, not
|
||||
unchanged. This is necessary for correct behavior since only the server
|
||||
knows what possible files may exist, and thus what files are
|
||||
nonexistent.
|
||||
|
||||
@item Notify @var{filename} \n
|
||||
Tell the server that a @code{edit} or @code{unedit} command has taken
|
||||
place. The server needs to send a @code{Notified} response, but such
|
||||
response is deferred until the next time that the server is sending
|
||||
responses. Response expected: no. Additional data:
|
||||
@example
|
||||
@var{notification-type} \t @var{time} \t @var{clienthost} \t
|
||||
@var{working-dir} \t @var{watches} \n
|
||||
@end example
|
||||
where @var{notification-type} is @samp{E} for edit or @samp{U} for
|
||||
unedit, @var{time} is the time at which the edit or unedit took place,
|
||||
@var{clienthost} is the name of the host on which the edit or unedit
|
||||
took place, and @var{working-dir} is the pathname of the working
|
||||
directory where the edit or unedit took place. @var{watches} are the
|
||||
temporary watches to set; if it is followed by \t then the tab and the
|
||||
rest of the line are ignored.
|
||||
|
||||
@item Questionable @var{filename} \n
|
||||
Response expected: no. Additional data: no. Tell the server to check
|
||||
whether @var{filename} should be ignored, and if not, next time the
|
||||
server sends responses, send (in a @code{M} response) @samp{?} followed
|
||||
by the directory and filename.
|
||||
|
||||
@item Case \n
|
||||
Tell the server that filenames should be matched against ignore patterns
|
||||
in a case-insensitive fashion. Note that this does not apply to other
|
||||
comparisons---for example the filenames given in @code{Entry} and
|
||||
@code{Modified} requests for the same file must match in case regardless
|
||||
of whether the @code{Case} request is sent.
|
||||
|
||||
@item Argument @var{text} \n
|
||||
Response expected: no.
|
||||
Save argument for use in a subsequent command. Arguments
|
||||
accumulate until an argument-using command is given, at which point
|
||||
they are forgotten.
|
||||
|
||||
@item Argumentx @var{text} \n
|
||||
Response expected: no. Append \n followed by text to the current
|
||||
argument being saved.
|
||||
|
||||
@item Global_option @var{option} \n
|
||||
Transmit one of the global options @samp{-q}, @samp{-Q}, @samp{-l},
|
||||
@samp{-t}, @samp{-r}, or @samp{-n}. @var{option} must be one of those
|
||||
strings, no variations (such as combining of options) are allowed. For
|
||||
graceful handling of @code{valid-requests}, it is probably better to
|
||||
make new global options separate requests, rather than trying to add
|
||||
them to this request.
|
||||
|
||||
@item Set @var{variable}=@var{value} \n
|
||||
Set a user variable @var{variable} to @var{value}.
|
||||
|
||||
@item expand-modules \n
|
||||
Response expected: yes. Expand the modules which are specified in the
|
||||
arguments. Returns the data in @code{Module-expansion} responses. Note
|
||||
that the server can assume that this is checkout or export, not rtag or
|
||||
rdiff; the latter do not access the working directory and thus have no
|
||||
need to expand modules on the client side.
|
||||
|
||||
@item co \n
|
||||
@itemx ci \n
|
||||
@itemx diff \n
|
||||
@itemx tag \n
|
||||
@itemx status \n
|
||||
@itemx log \n
|
||||
@itemx add \n
|
||||
@itemx remove \n
|
||||
@itemx rdiff \n
|
||||
@itemx rtag \n
|
||||
@itemx admin \n
|
||||
@itemx export \n
|
||||
@itemx history \n
|
||||
@itemx watchers \n
|
||||
@itemx editors \n
|
||||
@itemx annotate \n
|
||||
Response expected: yes. Actually do a cvs command. This uses any
|
||||
previous @code{Argument}, @code{Repository}, @code{Entry},
|
||||
@code{Modified}, or @code{Lost} requests, if they have been sent. The
|
||||
last @code{Repository} sent specifies the working directory at the time
|
||||
of the operation. No provision is made for any input from the user.
|
||||
This means that @code{ci} must use a @code{-m} argument if it wants to
|
||||
specify a log message.
|
||||
|
||||
@itemx init @var{root-name} \n
|
||||
Response expected: yes. If it doesn't already exist, create a @sc{cvs}
|
||||
repository @var{root-name}. The @code{Root} request need not have been
|
||||
previously sent.
|
||||
|
||||
@itemx update \n
|
||||
Response expected: yes. Actually do a @code{cvs update} command. This
|
||||
uses any previous @code{Argument}, @code{Repository}, @code{Entry},
|
||||
@code{Modified}, or @code{Lost} requests, if they have been sent. The
|
||||
last @code{Repository} sent specifies the working directory at the time
|
||||
of the operation. The @code{-I} option is not used--files which the
|
||||
client can decide whether to ignore are not mentioned and the client
|
||||
sends the @code{Questionable} request for others.
|
||||
|
||||
@item import \n
|
||||
Response expected: yes. Actually do a @code{cvs import} command. This
|
||||
uses any previous @code{Argument}, @code{Repository}, @code{Entry},
|
||||
@code{Modified}, or @code{Lost} requests, if they have been sent. The
|
||||
last @code{Repository} sent specifies the working directory at the time
|
||||
of the operation. The files to be imported are sent in @code{Modified}
|
||||
requests (files which the client knows should be ignored are not sent;
|
||||
the server must still process the CVSROOT/cvsignore file unless -I ! is
|
||||
sent). A log message must have been specified with a @code{-m}
|
||||
argument.
|
||||
|
||||
@item watch-on \n
|
||||
@itemx watch-off \n
|
||||
@itemx watch-add \n
|
||||
@itemx watch-remove \n
|
||||
Response expected: yes. Actually do the @code{cvs watch on}, @code{cvs
|
||||
watch off}, @code{cvs watch add}, and @code{cvs watch remove} commands,
|
||||
respectively. This uses any previous @code{Argument},
|
||||
@code{Repository}, @code{Entry}, @code{Modified}, or @code{Lost}
|
||||
requests, if they have been sent. The last @code{Repository} sent
|
||||
specifies the working directory at the time of the operation.
|
||||
|
||||
@item release \n
|
||||
Response expected: yes. Note that a @code{cvs release} command has
|
||||
taken place and update the history file accordingly.
|
||||
|
||||
@item noop \n
|
||||
Response expected: yes. This request is a null command in the sense
|
||||
that it doesn't do anything, but merely (as with any other requests
|
||||
expecting a response) sends back any responses pertaining to pending
|
||||
errors, pending @code{Notified} responses, etc.
|
||||
|
||||
@item update-patches \n
|
||||
This request does not actually do anything. It is used as a signal that
|
||||
the server is able to generate patches when given an @code{update}
|
||||
request. The client must issue the @code{-u} argument to @code{update}
|
||||
in order to receive patches.
|
||||
|
||||
@item gzip-file-contents @var{level} \n
|
||||
This request asks the server to filter files it sends to the client
|
||||
through the @samp{gzip} program, using the specified level of
|
||||
compression. If this request is not made, the server must not do any
|
||||
compression.
|
||||
|
||||
This is only a hint to the server. It may still decide (for example, in
|
||||
the case of very small files, or files that already appear to be
|
||||
compressed) not to do the compression. Compression is indicated by a
|
||||
@samp{z} preceding the file length.
|
||||
|
||||
Availability of this request in the server indicates to the client that
|
||||
it may compress files sent to the server, regardless of whether the
|
||||
client actually uses this request.
|
||||
|
||||
@item @var{other-request} @var{text} \n
|
||||
Response expected: yes.
|
||||
Any unrecognized request expects a response, and does not
|
||||
contain any additional data. The response will normally be something like
|
||||
@samp{error unrecognized request}, but it could be a different error if
|
||||
a previous command which doesn't expect a response produced an error.
|
||||
@end table
|
||||
|
||||
When the client is done, it drops the connection.
|
||||
|
||||
@node Responses
|
||||
@section Responses
|
||||
|
||||
After a command which expects a response, the server sends however many
|
||||
of the following responses are appropriate. Pathnames are of the actual
|
||||
files operated on (i.e. they do not contain @samp{,v} endings), and are
|
||||
suitable for use in a subsequent @code{Repository} request. However, if
|
||||
the client has used the @code{Directory} request, then it is instead a
|
||||
local directory name relative to the directory in which the command was
|
||||
given (i.e. the last @code{Directory} before the command). Then a
|
||||
newline and a repository name (the pathname which is sent if
|
||||
@code{Directory} is not used). Then the slash and the filename. For
|
||||
example, for a file @file{i386.mh} which is in the local directory
|
||||
@file{gas.clean/config} and for which the repository is
|
||||
@file{/rel/cvsfiles/devo/gas/config}:
|
||||
|
||||
@example
|
||||
gas.clean/config/
|
||||
/rel/cvsfiles/devo/gas/config/i386.mh
|
||||
@end example
|
||||
|
||||
Any response always ends with @samp{error} or @samp{ok}. This indicates
|
||||
that the response is over.
|
||||
|
||||
@table @code
|
||||
@item Valid-requests @var{request-list} \n
|
||||
Indicate what requests the server will accept. @var{request-list}
|
||||
is a space separated list of tokens. If the server supports sending
|
||||
patches, it will include @samp{update-patches} in this list. The
|
||||
@samp{update-patches} request does not actually do anything.
|
||||
|
||||
@item Checked-in @var{pathname} \n
|
||||
Additional data: New Entries line, \n. This means a file @var{pathname}
|
||||
has been successfully operated on (checked in, added, etc.). name in
|
||||
the Entries line is the same as the last component of @var{pathname}.
|
||||
|
||||
@item New-entry @var{pathname} \n
|
||||
Additional data: New Entries line, \n. Like @code{Checked-in}, but the
|
||||
file is not up to date.
|
||||
|
||||
@item Updated @var{pathname} \n
|
||||
Additional data: New Entries line, \n, mode, \n, file transmission. A
|
||||
new copy of the file is enclosed. This is used for a new revision of an
|
||||
existing file, or for a new file, or for any other case in which the
|
||||
local (client-side) copy of the file needs to be updated, and after
|
||||
being updated it will be up to date. If any directory in pathname does
|
||||
not exist, create it.
|
||||
|
||||
@item Merged @var{pathname} \n
|
||||
This is just like @code{Updated} and takes the same additional data,
|
||||
with the one difference that after the new copy of the file is enclosed,
|
||||
it will still not be up to date. Used for the results of a merge, with
|
||||
or without conflicts.
|
||||
|
||||
@item Patched @var{pathname} \n
|
||||
This is just like @code{Updated} and takes the same additional data,
|
||||
with the one difference that instead of sending a new copy of the file,
|
||||
the server sends a patch produced by @samp{diff -u}. This client must
|
||||
apply this patch, using the @samp{patch} program, to the existing file.
|
||||
This will only be used when the client has an exact copy of an earlier
|
||||
revision of a file. This response is only used if the @code{update}
|
||||
command is given the @samp{-u} argument.
|
||||
|
||||
@item Mode @var{mode} \n
|
||||
This @var{mode} applies to the next file mentioned in
|
||||
@code{Checked-in}. It does not apply to any request which follows a
|
||||
@code{Checked-in}, @code{New-entry}, @code{Updated}, @code{Merged}, or
|
||||
@code{Patched} response.
|
||||
|
||||
@item Checksum @var{checksum}\n
|
||||
The @var{checksum} applies to the next file sent over via
|
||||
@code{Updated}, @code{Merged}, or @code{Patched}. In the case of
|
||||
@code{Patched}, the checksum applies to the file after being patched,
|
||||
not to the patch itself. The client should compute the checksum itself,
|
||||
after receiving the file or patch, and signal an error if the checksums
|
||||
do not match. The checksum is the 128 bit MD5 checksum represented as
|
||||
32 hex digits. This response is optional, and is only used if the
|
||||
client supports it (as judged by the @code{Valid-responses} request).
|
||||
|
||||
@item Copy-file @var{pathname} \n
|
||||
Additional data: @var{newname} \n. Copy file @var{pathname} to
|
||||
@var{newname} in the same directory where it already is. This does not
|
||||
affect @code{CVS/Entries}.
|
||||
|
||||
@item Removed @var{pathname} \n
|
||||
The file has been removed from the repository (this is the case where
|
||||
cvs prints @samp{file foobar.c is no longer pertinent}).
|
||||
|
||||
@item Remove-entry @var{pathname} \n
|
||||
The file needs its entry removed from @code{CVS/Entries}, but the file
|
||||
itself is already gone (this happens in response to a @code{ci} request
|
||||
which involves committing the removal of a file).
|
||||
|
||||
@item Set-static-directory @var{pathname} \n
|
||||
This instructs the client to set the @code{Entries.Static} flag, which
|
||||
it should then send back to the server in a @code{Static-directory}
|
||||
request whenever the directory is operated on. @var{pathname} ends in a
|
||||
slash; its purpose is to specify a directory, not a file within a
|
||||
directory.
|
||||
|
||||
@item Clear-static-directory @var{pathname} \n
|
||||
Like @code{Set-static-directory}, but clear, not set, the flag.
|
||||
|
||||
@item Set-sticky @var{pathname} \n
|
||||
Additional data: @var{tagspec} \n. Tell the client to set a sticky tag
|
||||
or date, which should be supplied with the @code{Sticky} request for
|
||||
future operations. @var{pathname} ends in a slash; its purpose is to
|
||||
specify a directory, not a file within a directory. The first character
|
||||
of @var{tagspec} is @samp{T} for a tag, or @samp{D} for a date. The
|
||||
remainder of @var{tagspec} contains the actual tag or date.
|
||||
|
||||
@item Clear-sticky @var{pathname} \n
|
||||
Clear any sticky tag or date set by @code{Set-sticky}.
|
||||
|
||||
@item Template @var{pathname} \n
|
||||
Additional data: file transmission (note: compressed file transmissions
|
||||
are not supported). @var{pathname} ends in a slash; its purpose is to
|
||||
specify a directory, not a file within a directory. Tell the client to
|
||||
store the file transmission as the template log message, and then use
|
||||
that template in the future when prompting the user for a log message.
|
||||
|
||||
@item Set-checkin-prog @var{dir} \n
|
||||
Additional data: @var{prog} \n. Tell the client to set a checkin
|
||||
program, which should be supplied with the @code{Checkin-prog} request
|
||||
for future operations.
|
||||
|
||||
@item Set-update-prog @var{dir} \n
|
||||
Additional data: @var{prog} \n. Tell the client to set an update
|
||||
program, which should be supplied with the @code{Update-prog} request
|
||||
for future operations.
|
||||
|
||||
@item Notified @var{pathname} \n
|
||||
Indicate to the client that the notification for @var{pathname} has been
|
||||
done. There should be one such response for every @code{Notify}
|
||||
request; if there are several @code{Notify} requests for a single file,
|
||||
the requests should be processed in order; the first @code{Notified}
|
||||
response pertains to the first @code{Notify} request, etc.
|
||||
|
||||
@item Module-expansion @var{pathname} \n Return a file or directory
|
||||
which is included in a particular module. @var{pathname} is relative
|
||||
to cvsroot, unlike most pathnames in responses. @var{pathname} should
|
||||
be used to look and see whether some or all of the module exists on
|
||||
the client side; it is not necessarily suitable for passing as an
|
||||
argument to a @code{co} request (for example, if the modules file
|
||||
contains the @samp{-d} option, it will be the directory specified with
|
||||
@samp{-d}, not the name of the module).
|
||||
|
||||
@item M @var{text} \n
|
||||
A one-line message for the user.
|
||||
|
||||
@item E @var{text} \n
|
||||
Same as @code{M} but send to stderr not stdout.
|
||||
|
||||
@item error @var{errno-code} @samp{ } @var{text} \n
|
||||
The command completed with an error. @var{errno-code} is a symbolic
|
||||
error code (e.g. @code{ENOENT}); if the server doesn't support this
|
||||
feature, or if it's not appropriate for this particular message, it just
|
||||
omits the errno-code (in that case there are two spaces after
|
||||
@samp{error}). Text is an error message such as that provided by
|
||||
strerror(), or any other message the server wants to use.
|
||||
|
||||
@item ok \n
|
||||
The command completed successfully.
|
||||
@end table
|
||||
|
||||
@node Example
|
||||
@section Example
|
||||
|
||||
Lines beginning with @samp{c>} are sent by the client; lines beginning
|
||||
with @samp{s>} are sent by the server; lines beginning with @samp{#} are
|
||||
not part of the actual exchange.
|
||||
|
||||
@example
|
||||
c> Root /rel/cvsfiles
|
||||
# In actual practice the lists of valid responses and requests would
|
||||
# be longer
|
||||
c> Valid-responses Updated Checked-in M ok error
|
||||
c> valid-requests
|
||||
s> Valid-requests Root co Modified Entry Repository ci Argument Argumentx
|
||||
s> ok
|
||||
# cvs co devo/foo
|
||||
c> Argument devo/foo
|
||||
c> co
|
||||
s> Updated /rel/cvsfiles/devo/foo/foo.c
|
||||
s> /foo.c/1.4/Mon Apr 19 15:36:47 1993 Mon Apr 19 15:36:47 1993//
|
||||
s> 26
|
||||
s> int mein () @{ abort (); @}
|
||||
s> Updated /rel/cvsfiles/devo/foo/Makefile
|
||||
s> /Makefile/1.2/Mon Apr 19 15:36:47 1993 Mon Apr 19 15:36:47 1993//
|
||||
s> 28
|
||||
s> foo: foo.c
|
||||
s> $(CC) -o foo $<
|
||||
s> ok
|
||||
# In actual practice the next part would be a separate connection.
|
||||
# Here it is shown as part of the same one.
|
||||
c> Repository /rel/cvsfiles/devo/foo
|
||||
# foo.c relative to devo/foo just set as Repository.
|
||||
c> Entry /foo.c/1.4/Mon Apr 19 15:36:47 1993 Mon Apr 19 15:36:47 1993//
|
||||
c> Entry /Makefile/1.2/Mon Apr 19 15:36:47 1993 Mon Apr 19 15:36:47 1993//
|
||||
c> Modified foo.c
|
||||
c> 26
|
||||
c> int main () @{ abort (); @}
|
||||
# cvs ci -m <log message> foo.c
|
||||
c> Argument -m
|
||||
c> Argument Well, you see, it took me hours and hours to find this typo and I
|
||||
c> Argumentx searched and searched and eventually had to ask John for help.
|
||||
c> Argument foo.c
|
||||
c> ci
|
||||
s> Checked-in /rel/cvsfiles/devo/foo/foo.c
|
||||
s> /foo.c/1.5/ Mon Apr 19 15:54:22 CDT 1993//
|
||||
s> M Checking in foo.c;
|
||||
s> M /cygint/rel/cvsfiles/devo/foo/foo.c,v <-- foo.c
|
||||
s> M new revision: 1.5; previous revision: 1.4
|
||||
s> M done
|
||||
s> ok
|
||||
@end example
|
||||
|
||||
@node Requirements
|
||||
@section Required versus optional parts of the protocol
|
||||
|
||||
The following are part of every known implementation of the CVS
|
||||
protocol and it is considered reasonable behavior to completely fail
|
||||
to work if you are connected with an implementation which attempts to
|
||||
not support them. Requests: Root, Valid-responses, valid-requests,
|
||||
Repository, Entry, Modified, Argument, Argumentx, ci, co, update.
|
||||
Responses: ok, error, Valid-requests, Checked-in, Updated, Merged,
|
||||
Removed, M, E.
|
||||
|
||||
Failure to support the Directory, UseUnchanged, and Unchanged requests
|
||||
is deprecated. CVS 1.5 and later have supported these requests and in
|
||||
the future it will be considered reasonable behavior to completely
|
||||
fail to work with an implementation which attempts to not support
|
||||
them. Support for the Repository and Lost requests is deprecated; CVS
|
||||
clients 1.5 and later will not use them if communicating with a server
|
||||
which supports Directory and UseUnchanged.
|
||||
|
||||
@bye
|
238
contrib/cvs/install-sh
Executable file
238
contrib/cvs/install-sh
Executable file
@ -0,0 +1,238 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# install - install a program, script, or datafile
|
||||
# This comes from X11R5.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# `make' implicit rules from creating a file called install from it
|
||||
# when there is no Makefile.
|
||||
#
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
# from scratch.
|
||||
#
|
||||
|
||||
|
||||
# set DOITPROG to echo to test this script
|
||||
|
||||
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
||||
doit="${DOITPROG-}"
|
||||
|
||||
|
||||
# put in absolute paths if you don't have them in your path; or use env. vars.
|
||||
|
||||
mvprog="${MVPROG-mv}"
|
||||
cpprog="${CPPROG-cp}"
|
||||
chmodprog="${CHMODPROG-chmod}"
|
||||
chownprog="${CHOWNPROG-chown}"
|
||||
chgrpprog="${CHGRPPROG-chgrp}"
|
||||
stripprog="${STRIPPROG-strip}"
|
||||
rmprog="${RMPROG-rm}"
|
||||
mkdirprog="${MKDIRPROG-mkdir}"
|
||||
|
||||
tranformbasename=""
|
||||
transform_arg=""
|
||||
instcmd="$mvprog"
|
||||
chmodcmd="$chmodprog 0755"
|
||||
chowncmd=""
|
||||
chgrpcmd=""
|
||||
stripcmd=""
|
||||
rmcmd="$rmprog -f"
|
||||
mvcmd="$mvprog"
|
||||
src=""
|
||||
dst=""
|
||||
dir_arg=""
|
||||
|
||||
while [ x"$1" != x ]; do
|
||||
case $1 in
|
||||
-c) instcmd="$cpprog"
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-d) dir_arg=true
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-m) chmodcmd="$chmodprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-s) stripcmd="$stripprog"
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
|
||||
shift
|
||||
continue;;
|
||||
|
||||
*) if [ x"$src" = x ]
|
||||
then
|
||||
src=$1
|
||||
else
|
||||
# this colon is to work around a 386BSD /bin/sh bug
|
||||
:
|
||||
dst=$1
|
||||
fi
|
||||
shift
|
||||
continue;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ x"$src" = x ]
|
||||
then
|
||||
echo "install: no input file specified"
|
||||
exit 1
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
if [ x"$dir_arg" != x ]; then
|
||||
dst=$src
|
||||
src=""
|
||||
|
||||
if [ -d $dst ]; then
|
||||
instcmd=:
|
||||
else
|
||||
instcmd=mkdir
|
||||
fi
|
||||
else
|
||||
|
||||
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# if $src (and thus $dsttmp) contains '*'.
|
||||
|
||||
if [ -f $src -o -d $src ]
|
||||
then
|
||||
true
|
||||
else
|
||||
echo "install: $src does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ x"$dst" = x ]
|
||||
then
|
||||
echo "install: no destination specified"
|
||||
exit 1
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
# If destination is a directory, append the input filename; if your system
|
||||
# does not like double slashes in filenames, you may need to add some logic
|
||||
|
||||
if [ -d $dst ]
|
||||
then
|
||||
dst="$dst"/`basename $src`
|
||||
else
|
||||
true
|
||||
fi
|
||||
fi
|
||||
|
||||
## this sed command emulates the dirname command
|
||||
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
|
||||
|
||||
# Make sure that the destination directory exists.
|
||||
# this part is taken from Noah Friedman's mkinstalldirs script
|
||||
|
||||
# Skip lots of stat calls in the usual case.
|
||||
if [ ! -d "$dstdir" ]; then
|
||||
defaultIFS='
|
||||
'
|
||||
IFS="${IFS-${defaultIFS}}"
|
||||
|
||||
oIFS="${IFS}"
|
||||
# Some sh's can't handle IFS=/ for some reason.
|
||||
IFS='%'
|
||||
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
|
||||
IFS="${oIFS}"
|
||||
|
||||
pathcomp=''
|
||||
|
||||
while [ $# -ne 0 ] ; do
|
||||
pathcomp="${pathcomp}${1}"
|
||||
shift
|
||||
|
||||
if [ ! -d "${pathcomp}" ] ;
|
||||
then
|
||||
$mkdirprog "${pathcomp}"
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
pathcomp="${pathcomp}/"
|
||||
done
|
||||
fi
|
||||
|
||||
if [ x"$dir_arg" != x ]
|
||||
then
|
||||
$doit $instcmd $dst &&
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
|
||||
else
|
||||
|
||||
# If we're going to rename the final executable, determine the name now.
|
||||
|
||||
if [ x"$transformarg" = x ]
|
||||
then
|
||||
dstfile=`basename $dst`
|
||||
else
|
||||
dstfile=`basename $dst $transformbasename |
|
||||
sed $transformarg`$transformbasename
|
||||
fi
|
||||
|
||||
# don't allow the sed command to completely eliminate the filename
|
||||
|
||||
if [ x"$dstfile" = x ]
|
||||
then
|
||||
dstfile=`basename $dst`
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
# Make a temp file name in the proper directory.
|
||||
|
||||
dsttmp=$dstdir/#inst.$$#
|
||||
|
||||
# Move or copy the file name to the temp name
|
||||
|
||||
$doit $instcmd $src $dsttmp &&
|
||||
|
||||
trap "rm -f ${dsttmp}" 0 &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits
|
||||
|
||||
# If any of these fail, we abort the whole thing. If we want to
|
||||
# ignore errors from any of these, just make sure not to ignore
|
||||
# errors from the above "$doit $instcmd $src $dsttmp" command.
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
|
||||
$doit $rmcmd -f $dstdir/$dstfile &&
|
||||
$doit $mvcmd $dsttmp $dstdir/$dstfile
|
||||
|
||||
fi &&
|
||||
|
||||
|
||||
exit 0
|
448
contrib/cvs/lib/ChangeLog
Normal file
448
contrib/cvs/lib/ChangeLog
Normal file
@ -0,0 +1,448 @@
|
||||
Thu Apr 25 18:26:34 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* getdate.y (get_date): Set Start from nowtime, not now->time,
|
||||
which may not be set.
|
||||
* getdate.c: Regenerated.
|
||||
|
||||
Wed Apr 10 17:55:02 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* getdate.y (get_date): Use a time_t variable rather than a field
|
||||
in a struct timeb. Works around Solaris compiler bug. Sure, it
|
||||
is a compiler bug, but the workaround is completely painless.
|
||||
* getdate.c: Regenerated.
|
||||
|
||||
Fri Mar 22 11:17:05 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* system.h: If EXIT_FAILURE is not defined by stdlib.h, define it
|
||||
ourself.
|
||||
|
||||
Thu Mar 14 16:27:53 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* system.h: Remove alloca cruft.
|
||||
|
||||
Wed Feb 28 03:16:48 1996 Benjamin J. Lee <benjamin@cyclic.com>
|
||||
|
||||
* build_lib.com: Changed definition of symbol CC to search
|
||||
for include files in [-.VMS] so VMS config.h can be picked
|
||||
up without copying.
|
||||
|
||||
Tue Feb 27 21:26:34 1996 Benjamin J. Lee <benjamin@cyclic.com>
|
||||
|
||||
* build_lib.com: Added. DCL File to build contents of [.lib]
|
||||
|
||||
Tue Feb 27 21:18:38 1996 Benjamin J. Lee <benjamin@cyclic.com>
|
||||
|
||||
* system.h: added an existence_error macro check for EVMSERR
|
||||
necessary for happiness under VMS
|
||||
|
||||
Thu Feb 22 22:30:04 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* Makefile.in (OBJECTS): Remove @ALLOCA@
|
||||
(SOURCES): Remove alloca.c
|
||||
* alloca.c: Removed.
|
||||
* regex.c (REGEX_MALLOC): Define.
|
||||
|
||||
Thu Feb 15 14:00:00 Jim Kingdon <kingdon@cyclic.com>
|
||||
|
||||
* vasprintf.c: Declare abs().
|
||||
|
||||
Wed Feb 14 14:48:31 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* vasprintf.c (int_vasprintf): Don't cast arguments to memcpy.
|
||||
* vasprintf.c, strtoul.c: Don't include ansidecl.h. Do include
|
||||
config.h if HAVE_CONFIG_H (for const).
|
||||
* strtoul.c: Change CONST to const.
|
||||
|
||||
Tue Feb 13 20:04:39 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* strtoul.c: Added (needed by vasprintf.c, and missing on SunOS4).
|
||||
* Makefile.in (SOURCES): Add strtoul.c.
|
||||
|
||||
Mon Feb 12 10:04:46 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* vasprintf.c: Added (same contents as before).
|
||||
* Makefile.in (SOURCES): Add vasprintf.c.
|
||||
|
||||
Thu Feb 1 14:33:17 1996 Karl Fogel <kfogel@floss.red-bean.com>
|
||||
|
||||
* Makefile.in (xlint): new rule; does nothing, as I'm not sure
|
||||
running lint is actually advisable in here, but the top-level
|
||||
Makefile thinks it can `make xlint' here.
|
||||
|
||||
Thu Feb 1 15:07:42 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* getopt.c: Remove rcsid.
|
||||
|
||||
Tue Jan 30 18:20:27 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* getline.c: Don't define NDEBUG.
|
||||
(getstr): Rewrite assertions in a way which should stay clear of
|
||||
signed/unsigned problems and compiler warnings thereof.
|
||||
|
||||
Thu Jan 25 00:14:06 1996 Jim Kingdon <kingdon@beezley.cyclic.com>
|
||||
|
||||
* yesno.c (yesno): fflush stdout as well as stderr.
|
||||
|
||||
Wed Jan 3 18:16:50 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* sighandle.c (SIG_register): Use memset not bzero.
|
||||
* system.h: Remove defines for index, rindex, bcmp, and bzero.
|
||||
All the calls to those functions are gone from CVS.
|
||||
|
||||
Tue Jan 2 13:00:00 1996 Jim Kingdon <kingdon@peary.cyclic.com>
|
||||
|
||||
Visual C++ lint:
|
||||
* sighandle.c: Prototype SIG_handle and SIG_defaults.
|
||||
Use SIG_ERR where appropriate.
|
||||
|
||||
Mon Dec 18 10:15:05 1995 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* rename.c: Check ENOENT rather than existence_error. The latter
|
||||
is undefined in this file, and including system.h is said to cause
|
||||
(unspecified) problems.
|
||||
|
||||
Sun Dec 17 23:58:06 1995 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* vasprintf.c: Removed (it is no longer used).
|
||||
* Makefile.in (SOURCES): Remove vasprintf.c.
|
||||
|
||||
Sat Dec 16 17:18:33 1995 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* vasprintf.c: Added.
|
||||
* Makefile.in (SOURCES): Add vasprintf.c
|
||||
|
||||
Mon Dec 4 10:54:04 1995 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* getdate.c: Remove #line directives. I know, this is a kludge,
|
||||
but Visual C++ 2.1 seems to require it (why, I have no idea. It
|
||||
has no trouble with the #line directives in getdate in CVS 1.6).
|
||||
|
||||
Sat Nov 18 16:20:37 1995 Karl Fogel <kfogel@floss.cyclic.com>
|
||||
|
||||
* rename.c: same.
|
||||
|
||||
* mkdir.c: Use new macro `existence_error', instead of comparing
|
||||
errno to ENOENT directly.
|
||||
|
||||
* system.h (existence_error): new macro, tries to portably ask if
|
||||
errno represents a file-not-exist error.
|
||||
|
||||
Fri Nov 17 20:08:58 1995 Karl Fogel <kfogel@floss.cyclic.com>
|
||||
|
||||
* system.h (NEED_DECOY_PERMISSIONS): moved this section to where
|
||||
it belongs, duh.
|
||||
|
||||
* getdate.c: if STDC_HEADERS, then just include <stdlib.h> instead
|
||||
of declaring malloc() and realloc() to be char *.
|
||||
|
||||
* system.h: ifdef NEED_DECOY_PERMISSIONS, then define the S_I*
|
||||
permission masks for USR, GRP, and OTH in terms of the simpler
|
||||
OS/2 masks.
|
||||
|
||||
Wed Nov 15 15:36:03 1995 Karl Fogel <kfogel@floss.cyclic.com>
|
||||
|
||||
* system.h: ifdef USE_OWN_TCPIP_H, then include "tcpip.h". Only
|
||||
OS/2 does this right now.
|
||||
|
||||
Tue Nov 14 18:44:57 1995 Greg A. Woods <woods@most.weird.com>
|
||||
|
||||
* getdate.c: OK, this one is from SunOS-4.1 yacc and may be more
|
||||
portable -- at least it compiles silently here! ;-)
|
||||
|
||||
Mon Nov 13 03:53:45 1995 Karl Fogel <kfogel@floss.cyclic.com>
|
||||
|
||||
* fnmatch.c: conform to 80 column standard (yes, I'm a pedant).
|
||||
|
||||
Wed Nov 8 11:10:59 1995 Karl Fogel <kfogel@floss.cyclic.com>
|
||||
|
||||
* system.h (STAT_MACROS): ifdef S_IFMT, then use it as before; but
|
||||
if it's not defined, then just do a single mask and assume
|
||||
acceptance any of non-zero result. Norbert, I trust you'll let me
|
||||
know if this is unsatisfactory. :-)
|
||||
Ifdef HAVE_SYS_UTIME_H, then include <sys/utime.h>. Only OS/2
|
||||
defines this right now.
|
||||
|
||||
Wed Nov 8 13:18:51 1995 Norbert Kiesel <nk@col.sw-ley.de>
|
||||
|
||||
* valloc.c: omit malloc declaration (it's already in system.h
|
||||
which is included and conflicts with <stdlib.h> on some
|
||||
systems).
|
||||
|
||||
Tue Nov 7 19:38:48 1995 Norbert Kiesel <nk@col.sw-ley.de>
|
||||
|
||||
* system.h (STAT_MACROS_BROKEN): undo previous change, because
|
||||
else all regular files will be identified as links (the mask for
|
||||
links is S_IFREG|S_IFCHR).
|
||||
|
||||
Mon Nov 6 19:20:56 1995 Karl Fogel <kfogel@floss.cyclic.com>
|
||||
|
||||
* system.h (STAT_MACROS_BROKEN): in defining the S_IF* macros,
|
||||
don't fold to 1 or 0 by first masking with S_IFMT; not all
|
||||
systems have that macro, and anyway it's only necessary that we
|
||||
return non-zero.
|
||||
|
||||
Fri Oct 27 13:43:35 1995 Karl Fogel <kfogel@floss.cyclic.com>
|
||||
|
||||
* save-cwd.c: use __PROTO instead of __P (see below).
|
||||
|
||||
* getline.h (__PROTO): same as below.
|
||||
|
||||
* save-cwd.h (__PROTO): replaces __P. New name, so don't ask if
|
||||
already defined. The conflict was that OS/2 w/ IBM C/C++ uses
|
||||
`__P' for something else, in <ctype.h> of all places.
|
||||
|
||||
* system.h: do nothing about alloca ifdef ALLOCA_IN_STDLIB (see
|
||||
../src/ChangeLog).
|
||||
|
||||
Tue Oct 24 13:01:25 1995 Norbert Kiesel <nk@col.sw-ley.de>
|
||||
|
||||
* wait.h: include sys/resource.h if available. This is needed at
|
||||
least under AIX-3.2 where <sys/wait.h> doesn't include it.
|
||||
|
||||
Mon Oct 23 17:39:11 1995 Norbert Kiesel <nk@col.sw-ley.de>
|
||||
|
||||
* valloc.c (valloc): change parameter definition
|
||||
|
||||
Sun Oct 22 14:15:44 1995 Jim Meyering (meyering@comco.com)
|
||||
|
||||
* getline.c, getline.h: New files.
|
||||
* Makefile.in (SOURCES, OBJECTS, HEADERS): Add getline.c, getline.o,
|
||||
and getline.h, respectively.
|
||||
|
||||
Tue Oct 10 18:01:50 1995 Karl Fogel <kfogel@totoro.cyclic.com>
|
||||
|
||||
* Makefile.in (cvs_srcdir): define cvs_srcdir to be ../src, then
|
||||
include it with -I so save_cwd.c can find error.h (for example).
|
||||
|
||||
Sun Oct 8 12:27:57 1995 Peter Wemm <peter@haywire.DIALix.COM>
|
||||
|
||||
* system.h: define POSIX_SIGNALS or BSD_SIGNALS if configure has
|
||||
located all the necessary functions for each "type".
|
||||
* sighandle.c: detect/use POSIX/BSD reliable signals (especially
|
||||
for blocking signals in critical sections). Helps prevent stray
|
||||
locks on interruption.
|
||||
|
||||
Mon Oct 2 18:11:23 1995 Jim Blandy <jimb@totoro.cyclic.com>
|
||||
|
||||
* system.h: Doc fix.
|
||||
|
||||
Mon Oct 2 18:10:35 1995 Larry Jones <larry.jones@sdrc.com>
|
||||
|
||||
* regex.c: compile 4.2 BSD compatible functions even when
|
||||
_POSIX_SOURCE is defined since we need them and we wouldn't be
|
||||
compiling this file unless they don't exist.
|
||||
|
||||
Mon Oct 2 10:32:20 1995 Michael Finken <finken@conware.de>
|
||||
|
||||
* strstr.c (strstr): new file and func.
|
||||
|
||||
* Makefile.in (SOURCES): added strstr.c.
|
||||
|
||||
Sun Oct 1 21:03:40 1995 Karl Fogel <kfogel@totoro.cyclic.com>
|
||||
|
||||
* regex.c: reverted below change.
|
||||
|
||||
Thu Sep 28 13:37:04 1995 Larry Jones <larry.jones@sdrc.com>
|
||||
|
||||
* regexp.c: check for ISC.
|
||||
|
||||
Thu Sep 7 19:18:00 1995 Jim Blandy <jimb@cyclic.com>
|
||||
|
||||
* save-cwd.c: #include <direct.h> and <io.h>, on systems that
|
||||
have them.
|
||||
|
||||
* getopt.c (_getopt_internal): Cast the return value of strlen,
|
||||
which is unsigned, before comparing it with the difference between
|
||||
two pointers, which is unsigned.
|
||||
|
||||
Thu Aug 31 11:31:42 1995 Jim Blandy <jimb@totoro.cyclic.com>
|
||||
|
||||
* getdate.y [STDC_HEADERS]: #include <stdlib.h>, for abort.
|
||||
[HAVE_ALLOCA_H]: #include <alloca.h>, for alloca on Windows NT.
|
||||
|
||||
Wed Aug 30 18:48:44 1995 Jim Blandy <jimb@totoro.cyclic.com>
|
||||
|
||||
* system.h [HAVE_IO_H]: #include <io.h>, for Windows NT.
|
||||
[HAVE_DIRECT_H]: #include <direct.h>, for Windows NT.
|
||||
(CVS_MKDIR, FOLD_FN_CHAR, fnfold, fncmp, ISDIRSEP, OPEN_BINARY,
|
||||
FOPEN_BINARY_READ, FOPEN_BINARY_WRITE): New macros/functions, for
|
||||
use in system-sensitive code.
|
||||
|
||||
* regex.c (re_set_registers): start and end are pointers, not
|
||||
integers. Cast the initializing value appropriately.
|
||||
|
||||
* getopt.c [HAVE_STRING_H]: #include <string.h>, to avoid
|
||||
warnings.
|
||||
|
||||
* fnmatch.c (FOLD_FN_CHAR): Give this a dummy #definition if
|
||||
config.h didn't #define it.
|
||||
(fnmatch): Pass filename characters through FOLD_FN_CHAR before
|
||||
comparing them.
|
||||
|
||||
* argmatch.c: #include <sys/types.h>.
|
||||
(argmatch): Declare arglen to be a size_t, rather than an int,
|
||||
to avoid signed/unsigned comparison "problems".
|
||||
|
||||
* .cvsignore: Remove getdate.c from this file. We want to
|
||||
distribute it, for systems that don't have a Yacc-equivalent
|
||||
installed (like Windows NT).
|
||||
|
||||
Sat Aug 19 22:00:51 1995 Jim Blandy <jimb@totoro.cyclic.com>
|
||||
|
||||
* error.c: Don't #define CVS_SUPPORT here. config.h takes care of
|
||||
that for us.
|
||||
[CVS_SUPPORT] (error_use_protocol): New variable, with apology.
|
||||
(error): If error_use_protocol is set, report errors using the
|
||||
client/server protocol.
|
||||
* error.h [CVS_SUPPORT]: Extern decl for error_use_protocol.
|
||||
|
||||
Fri Aug 4 00:01:24 1995 Jim Meyering (meyering@comco.com)
|
||||
|
||||
* xgetwd.c: Don't declare free. A K&R style declaration gets
|
||||
a conflict on some Sun systems when compiling with acc.
|
||||
|
||||
* save-cwd.c: New file.
|
||||
* save-cwd.h: New file.
|
||||
* Makefile.in (SOURCES): Add save-cwd.c
|
||||
(OBJECTS): Add save-cwd.o.
|
||||
(HEADERS): Add save-cwd.h.
|
||||
|
||||
Thu Aug 3 00:55:54 1995 Jim Meyering (meyering@comco.com)
|
||||
|
||||
* error.h: New file.
|
||||
* Makefile.in (HEADERS): Add error.h.
|
||||
|
||||
Sat Jul 29 15:53:55 1995 James Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* Makefile.in (SOURCES): Add getdate.c.
|
||||
|
||||
Thu Jul 27 09:11:41 1995 Robert Lipe <robertl@rjlhome.arnet.com>
|
||||
|
||||
* system.h: Check for PATHSIZE before falling back to _POSIX_PATH_MAX.
|
||||
|
||||
Thu Jul 20 12:38:03 1995 James Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* error.c: Instead of calling cvs functions to clean up, allow cvs
|
||||
to register a callback via error_set_cleanup. Avoids hassles with
|
||||
include files and SERVER_SUPPORT and so on.
|
||||
|
||||
Tue Jul 18 21:18:00 1995 Jim Blandy <jimb@cyclic.com>
|
||||
|
||||
* system.h: Include <sys/param.h> only if HAVE_SYS_PARAM_H
|
||||
is #defined. We've added a test to configure.in to #define this
|
||||
on most systems.
|
||||
|
||||
Thu Jul 13 11:22:21 1995 Jim Meyering (meyering@comco.com)
|
||||
|
||||
* xgetwd.c: New file.
|
||||
* Makefile.in (SOURCES): Add xgetwd.c
|
||||
(OBJECTS): Add xgetwd.o.
|
||||
|
||||
Wed Jul 12 09:18:49 1995 Jim Meyering (meyering@comco.com)
|
||||
|
||||
* Makefile.in (OBJECTS): Remove fnmatch.o. Now configure adds it
|
||||
to LIBOBJS when necessary.
|
||||
|
||||
Fri Jun 30 16:27:18 1995 James Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* rename.c (rename): If MVDIR is not defined, just give an error
|
||||
on attempt to rename a directory.
|
||||
|
||||
Thu Jun 29 00:46:31 1995 James Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* system.h: Check HAVE_SYS_TIMEB_H not non-existent HAVE_TIMEB_H.
|
||||
|
||||
* system.h: Don't define alloca if it is already defined.
|
||||
|
||||
Wed Jun 28 15:24:51 1995 James Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* system.h: If NeXT, define utimbuf ourself.
|
||||
|
||||
Mon May 29 22:32:40 1995 J.T. Conklin <jtc@rtl.cygnus.com>
|
||||
|
||||
* system.h: Handle time and directory headers as recommended in
|
||||
the autoconf manual.
|
||||
Undefine the S_FOO() macros if STAT_MACROS_BROKEN is set.
|
||||
Don't define mode_t, as it is handled by config.h.
|
||||
|
||||
Sat May 27 08:46:00 1995 Jim Meyering (meyering@comco.com)
|
||||
|
||||
* Makefile.in (Makefile): Regenerate only Makefile in current
|
||||
directory when Makefile.in is out of date. Depend on ../config.status.
|
||||
|
||||
Fri Apr 28 22:49:25 1995 Jim Blandy <jimb@totoro.bio.indiana.edu>
|
||||
|
||||
* Makefile.in (SOURCES, OBJECTS): Updated.
|
||||
(HEADERS): New variable.
|
||||
(DISTFILES): Updated.
|
||||
(dist-dir): Renamed from dist; changed to work with DISTDIR
|
||||
variable passed from parent.
|
||||
|
||||
Wed Feb 8 06:37:53 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
|
||||
* system.h (S_IRUSR et al): Define if not already defined.
|
||||
|
||||
* waitpid.c [HAVE_CONFIG_H]: Include "config.h".
|
||||
(ualloc): Return OLDPTR rather than running off the end.
|
||||
|
||||
Mon Aug 22 22:48:19 1994 Ken Raeburn (raeburn@kr-pc.cygnus.com)
|
||||
|
||||
* error.c (strerror): Replaced conditional static definition
|
||||
(always used, since the condition variable was never set) with an
|
||||
extern declaration, since it's provided by libc or strerror.c.
|
||||
|
||||
Wed Aug 10 14:54:25 1994 Ken Raeburn (raeburn@cujo.cygnus.com)
|
||||
|
||||
* Makefile.in (SOURCES): Add waitpid.c.
|
||||
* waitpid.c: New file.
|
||||
|
||||
Tue Aug 9 16:00:12 1994 Ken Raeburn (raeburn@cujo.cygnus.com)
|
||||
|
||||
* md5.h (uint32): If SIZEOF_LONG isn't 4, don't define this to be
|
||||
"unsigned long"; try SIZEOF_INT and "unsigned int", otherwise
|
||||
complain.
|
||||
|
||||
* md5.c: Include config.h.
|
||||
(const): Don't bother defining here, config.h should take care of
|
||||
it.
|
||||
|
||||
* valloc.c (malloc): Declare.
|
||||
|
||||
Fri Jul 15 12:57:20 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
|
||||
|
||||
* getopt.c: Do not include <stdlib.h> unless __GNU_LIBRARY__ is
|
||||
defined. On Irix 5.2, <stdlib.h> includes <getopt.h>, which
|
||||
causes a multiple definition of struct option.
|
||||
|
||||
Fri Jul 8 10:04:59 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
|
||||
|
||||
* md5.h, md5.c: Remove ANSI-isms.
|
||||
|
||||
Thu Jul 7 20:24:18 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
|
||||
|
||||
* md5.h, md5.c: New files.
|
||||
* Makefile.in (SOURCES): Add md5.c.
|
||||
(OBJECTS): Add md5.o.
|
||||
(DISTFILES): Add md5.h.
|
||||
(md5.o): New target; depend upon md5.h.
|
||||
|
||||
Fri May 27 18:15:34 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
|
||||
|
||||
* valloc.c: New file.
|
||||
|
||||
Tue May 17 08:18:26 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
|
||||
|
||||
* error.c (error, fperror): If server_active, call server_cleanup
|
||||
as well as Lock_Cleanup.
|
||||
|
||||
Thu Jan 6 13:45:04 1994 Ken Raeburn (raeburn@cujo.cygnus.com)
|
||||
|
||||
* system.h: Fix Dec 27 change to work correctly. Makes Sep 9
|
||||
change unnecessary, so backed that one out. Never define PATH_MAX
|
||||
in terms of pathconf, because that doesn't produce a constant, and
|
||||
PATH_MAX is used to set array sizes.
|
||||
|
||||
Mon Dec 27 14:22:07 1993 Mark Eichin (eichin@cygnus.com)
|
||||
|
||||
* system.h: don't touch PATH_MAX or MAXPATHLEN if *both* of them
|
||||
are already defined, as one may be defined in terms of the other.
|
90
contrib/cvs/lib/ChangeLog.fsf
Normal file
90
contrib/cvs/lib/ChangeLog.fsf
Normal file
@ -0,0 +1,90 @@
|
||||
Thu Sep 15 00:18:26 1994 david d `zoo' zuhn <zoo@monad.armadillo.com>
|
||||
|
||||
* system.h: remove a bunch of "extern int " declarations of system
|
||||
functions (could conflict with vendor header files, and didn't
|
||||
do anything *too* useful to begin with).
|
||||
|
||||
* Makefile.in: update getdate.y message (now has 10 s/r conflicts)
|
||||
|
||||
Wed Sep 14 22:12:21 1994 david d `zoo' zuhn <zoo@monad.armadillo.com>
|
||||
|
||||
* strerror.c: more complete, from the Cygnus libiberty package
|
||||
|
||||
* error.c (strerror): removed, functionality is in strerror.c
|
||||
|
||||
* cvs.h: remove duplicate prototype for Reader_Lock
|
||||
* history.c: printf argument mismatch
|
||||
(Both fixes thanks to J.T. Conklin (jtc@cygnus.com)
|
||||
|
||||
Sat Jul 30 13:50:11 1994 david d `zoo' zuhn (zoo@monad.armadillo.com)
|
||||
|
||||
* getopt1.c, getopt.c, getopt.h, getdate.y: latest versions from FSF
|
||||
|
||||
Wed Jul 13 22:11:17 1994 david d `zoo' zuhn (zoo@monad.armadillo.com)
|
||||
|
||||
* system.h: don't set PATH_MAX to pathconf(), since PATH_MAX is
|
||||
used to size arrays. (thanks to kingdon@cygnus.com)
|
||||
|
||||
* getopt1.c: remove #ifdef __STDC__ around const usages (which
|
||||
isn't correct and weren't complete)
|
||||
|
||||
Wed Apr 20 14:57:16 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
|
||||
|
||||
* getopt.h: Prevent multiple inclusion.
|
||||
|
||||
Tue Jan 25 17:34:42 1994 david d zuhn (zoo@monad.armadillo.com)
|
||||
|
||||
* Makefile.in: make sure that no blank lines are in the $(OBJECTS)
|
||||
list (from Brad Figg)
|
||||
|
||||
Mon Jan 24 12:27:13 1994 david d zuhn (zoo@monad.armadillo.com)
|
||||
|
||||
* system.h: remove alloca checks (added to src/cvs.h); revamped
|
||||
the MAXPATHLEN and PATH_MAX tests (from Brad Figg
|
||||
<bradf@wv.MENTORG.COM>); handle index,rindex,bcmp,bzero better
|
||||
(don't redefine if already defined); added S_IWRITE, S_IWGRP,
|
||||
S_IWOTH definitions (header file reorganization)
|
||||
|
||||
* strippath.c: use strchr, not index
|
||||
|
||||
* getopt1.c: match prototypes when __STDC__ compiler (lint fixes)
|
||||
|
||||
* getdate.c: alloca checks for when using bison
|
||||
|
||||
* Makefile.in: added CC and YACC definitions; use YACC not BISON;
|
||||
better getdate.c tests (also from Brad Figg)
|
||||
|
||||
Sat Dec 18 00:55:43 1993 david d zuhn (zoo@monad.armadillo.com)
|
||||
|
||||
* Makefile.in (VPATH): don't use $(srcdir), but @srcdir@ instead
|
||||
|
||||
* memmove.c: new file, implements memmove in terms of bcopy
|
||||
|
||||
* wait.h: include <sys/wait.h> if HAVE_SYS_WAIT_H, not if POSIX
|
||||
|
||||
Thu Sep 9 18:02:11 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
|
||||
|
||||
* system.h: only #undef PATH_MAX if not on an Alpha. The #undef
|
||||
causes problems with the Alpha C compiler.
|
||||
|
||||
Thu Apr 8 12:39:56 1993 Ian Lance Taylor (ian@cygnus.com)
|
||||
|
||||
* system.h: Removed several incorrect declarations which fail
|
||||
on Solaris.
|
||||
|
||||
Wed Jan 20 17:57:24 1993 K. Richard Pixley (rich@rtl.cygnus.com)
|
||||
|
||||
* system.h: add externs for sun4 so that gcc -Wall becomes useful
|
||||
again.
|
||||
|
||||
Wed Feb 26 18:04:40 1992 K. Richard Pixley (rich@cygnus.com)
|
||||
|
||||
* Makefile.in, configure.in: removed traces of namesubdir,
|
||||
-subdirs, $(subdir), $(unsubdir), some rcs triggers. Forced
|
||||
copyrights to '92, changed some from Cygnus to FSF.
|
||||
|
||||
Sat Dec 28 02:42:06 1991 K. Richard Pixley (rich at cygnus.com)
|
||||
|
||||
* mkdir.c, rename.c: change fork() to vfork().
|
||||
|
||||
|
164
contrib/cvs/lib/Makefile.in
Normal file
164
contrib/cvs/lib/Makefile.in
Normal file
@ -0,0 +1,164 @@
|
||||
# Makefile for library files used by GNU CVS.
|
||||
# Do not use this makefile directly, but only from `../Makefile'.
|
||||
# Copyright (C) 1986, 1988-1994 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
# $CVSid: @(#)Makefile.in 1.21 94/09/24 $
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
cvs_srcdir = @top_srcdir@/src
|
||||
VPATH = @srcdir@
|
||||
|
||||
SHELL = /bin/sh
|
||||
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
SOURCES = \
|
||||
argmatch.c \
|
||||
dup2.c \
|
||||
fnmatch.c \
|
||||
ftruncate.c \
|
||||
getdate.c \
|
||||
getdate.y \
|
||||
getline.c \
|
||||
getopt.c \
|
||||
getopt1.c \
|
||||
getwd.c \
|
||||
hostname.c \
|
||||
md5.c \
|
||||
memmove.c \
|
||||
mkdir.c \
|
||||
regex.c \
|
||||
rename.c \
|
||||
savecwd.c \
|
||||
sighandle.c \
|
||||
strdup.c \
|
||||
strstr.c \
|
||||
strerror.c \
|
||||
strippath.c \
|
||||
stripslash.c \
|
||||
strtoul.c \
|
||||
valloc.c \
|
||||
vasprintf.c \
|
||||
waitpid.c \
|
||||
xgetwd.c \
|
||||
yesno.c
|
||||
|
||||
HEADERS = getline.h getopt.h fnmatch.h regex.h system.h wait.h md5.h savecwd.h
|
||||
|
||||
OBJECTS = \
|
||||
@LIBOBJS@ \
|
||||
argmatch.o \
|
||||
getline.o \
|
||||
getopt.o \
|
||||
getopt1.o \
|
||||
md5.o \
|
||||
savecwd.o \
|
||||
sighandle.o \
|
||||
strippath.o \
|
||||
stripslash.o \
|
||||
xgetwd.o \
|
||||
yesno.o \
|
||||
getdate.o
|
||||
|
||||
DISTFILES = \
|
||||
.cvsignore ChangeLog ChangeLog.fsf Makefile.in \
|
||||
${SOURCES} ${HEADERS}
|
||||
|
||||
DEFS = @DEFS@
|
||||
RANLIB = @RANLIB@
|
||||
|
||||
CC = @CC@
|
||||
CFLAGS = -g
|
||||
CPPFLAGS=
|
||||
|
||||
YACC = @YACC@
|
||||
|
||||
.c.o:
|
||||
$(CC) $(CPPFLAGS) -I.. -I$(srcdir) -I$(cvs_srcdir) \
|
||||
$(DEFS) $(CFLAGS) -c $<
|
||||
|
||||
all: libcvs.a
|
||||
.PHONY: all
|
||||
|
||||
install: all
|
||||
.PHONY: install
|
||||
|
||||
tags: $(DISTFILES)
|
||||
ctags `for i in $(DISTFILES); do echo $(srcdir)/$$i; done`
|
||||
|
||||
TAGS: $(DISTFILES)
|
||||
etags `for i in $(DISTFILES); do echo $(srcdir)/$$i; done`
|
||||
|
||||
ls:
|
||||
@echo $(DISTFILES)
|
||||
.PHONY: ls
|
||||
|
||||
clean:
|
||||
rm -f *.a *.o
|
||||
.PHONY: clean
|
||||
|
||||
distclean: clean
|
||||
rm -f tags TAGS Makefile
|
||||
.PHONY: distclean
|
||||
|
||||
realclean: distclean
|
||||
rm -f *.tab.c getdate.c
|
||||
.PHONY: realclean
|
||||
|
||||
dist-dir:
|
||||
mkdir ${DISTDIR}
|
||||
for i in ${DISTFILES}; do \
|
||||
ln $(srcdir)/$${i} ${DISTDIR}; \
|
||||
done
|
||||
.PHONY: dist-dir
|
||||
|
||||
libcvs.a: $(OBJECTS)
|
||||
$(AR) cr $@ $(OBJECTS)
|
||||
-$(RANLIB) $@
|
||||
|
||||
getdate.c: getdate.y
|
||||
@echo expect 10 shift/reduce conflicts
|
||||
$(YACC) $(srcdir)/getdate.y
|
||||
-@if test -f y.tab.c; then \
|
||||
mv y.tab.c getdate.c ;\
|
||||
else \
|
||||
if test -f getdate.tab.c ; then \
|
||||
mv getdate.tab.c getdate.c ; \
|
||||
else \
|
||||
echo '*** Unable to create getdate.c' ;\
|
||||
fi ;\
|
||||
fi
|
||||
|
||||
fnmatch.o: fnmatch.h
|
||||
getopt1.o: getopt.h
|
||||
regex.o: regex.h
|
||||
getwd.o: system.h
|
||||
md5.o: md5.h
|
||||
|
||||
xlint:
|
||||
@echo xlint does nothing
|
||||
|
||||
subdir = lib
|
||||
Makefile: ../config.status Makefile.in
|
||||
cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
|
||||
|
||||
#../config.status: ../configure
|
||||
# cd .. ; $(SHELL) config.status --recheck
|
||||
|
||||
#../configure: ../configure.in
|
||||
# cd $(top_srcdir) ; autoconf
|
89
contrib/cvs/lib/argmatch.c
Normal file
89
contrib/cvs/lib/argmatch.c
Normal file
@ -0,0 +1,89 @@
|
||||
/* argmatch.c -- find a match for a string in an array
|
||||
Copyright (C) 1990 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
/* Written by David MacKenzie <djm@ai.mit.edu> */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#ifdef STDC_HEADERS
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
extern char *program_name;
|
||||
|
||||
/* If ARG is an unambiguous match for an element of the
|
||||
null-terminated array OPTLIST, return the index in OPTLIST
|
||||
of the matched element, else -1 if it does not match any element
|
||||
or -2 if it is ambiguous (is a prefix of more than one element). */
|
||||
|
||||
int
|
||||
argmatch (arg, optlist)
|
||||
char *arg;
|
||||
char **optlist;
|
||||
{
|
||||
int i; /* Temporary index in OPTLIST. */
|
||||
size_t arglen; /* Length of ARG. */
|
||||
int matchind = -1; /* Index of first nonexact match. */
|
||||
int ambiguous = 0; /* If nonzero, multiple nonexact match(es). */
|
||||
|
||||
arglen = strlen (arg);
|
||||
|
||||
/* Test all elements for either exact match or abbreviated matches. */
|
||||
for (i = 0; optlist[i]; i++)
|
||||
{
|
||||
if (!strncmp (optlist[i], arg, arglen))
|
||||
{
|
||||
if (strlen (optlist[i]) == arglen)
|
||||
/* Exact match found. */
|
||||
return i;
|
||||
else if (matchind == -1)
|
||||
/* First nonexact match found. */
|
||||
matchind = i;
|
||||
else
|
||||
/* Second nonexact match found. */
|
||||
ambiguous = 1;
|
||||
}
|
||||
}
|
||||
if (ambiguous)
|
||||
return -2;
|
||||
else
|
||||
return matchind;
|
||||
}
|
||||
|
||||
/* Error reporting for argmatch.
|
||||
KIND is a description of the type of entity that was being matched.
|
||||
VALUE is the invalid value that was given.
|
||||
PROBLEM is the return value from argmatch. */
|
||||
|
||||
void
|
||||
invalid_arg (kind, value, problem)
|
||||
char *kind;
|
||||
char *value;
|
||||
int problem;
|
||||
{
|
||||
fprintf (stderr, "%s: ", program_name);
|
||||
if (problem == -1)
|
||||
fprintf (stderr, "invalid");
|
||||
else /* Assume -2. */
|
||||
fprintf (stderr, "ambiguous");
|
||||
fprintf (stderr, " %s `%s'\n", kind, value);
|
||||
}
|
40
contrib/cvs/lib/dup2.c
Normal file
40
contrib/cvs/lib/dup2.c
Normal file
@ -0,0 +1,40 @@
|
||||
/*
|
||||
dup2 -- 7th Edition UNIX system call emulation for UNIX System V
|
||||
|
||||
last edit: 11-Feb-1987 D A Gwyn
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
extern int close(), fcntl();
|
||||
|
||||
int
|
||||
dup2( oldfd, newfd )
|
||||
int oldfd; /* already-open file descriptor */
|
||||
int newfd; /* desired duplicate descriptor */
|
||||
{
|
||||
register int ret; /* for fcntl() return value */
|
||||
register int save; /* for saving entry errno */
|
||||
|
||||
if ( oldfd == newfd )
|
||||
return oldfd; /* be careful not to close() */
|
||||
|
||||
save = errno; /* save entry errno */
|
||||
(void) close( newfd ); /* in case newfd is open */
|
||||
/* (may have just clobbered the original errno value) */
|
||||
|
||||
ret = fcntl( oldfd, F_DUPFD, newfd ); /* dupe it */
|
||||
|
||||
if ( ret >= 0 )
|
||||
errno = save; /* restore entry errno */
|
||||
else /* fcntl() returned error */
|
||||
if ( errno == EINVAL )
|
||||
errno = EBADF; /* we think of everything */
|
||||
|
||||
return ret; /* return file descriptor */
|
||||
}
|
193
contrib/cvs/lib/fnmatch.c
Normal file
193
contrib/cvs/lib/fnmatch.c
Normal file
@ -0,0 +1,193 @@
|
||||
/* Copyright (C) 1992 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If
|
||||
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
|
||||
/* Modified slightly by Brian Berliner <berliner@sun.com> and
|
||||
Jim Blandy <jimb@cyclic.com> for CVS use */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
/* Some file systems are case-insensitive. If FOLD_FN_CHAR is
|
||||
#defined, it maps the character C onto its "canonical" form. In a
|
||||
case-insensitive system, it would map all alphanumeric characters
|
||||
to lower case. Under Windows NT, / and \ are both path component
|
||||
separators, so FOLD_FN_CHAR would map them both to /. */
|
||||
#ifndef FOLD_FN_CHAR
|
||||
#define FOLD_FN_CHAR(c) (c)
|
||||
#endif
|
||||
|
||||
/* IGNORE(@ */
|
||||
/* #include <ansidecl.h> */
|
||||
/* @) */
|
||||
#include <errno.h>
|
||||
#include <fnmatch.h>
|
||||
|
||||
#if !defined(__GNU_LIBRARY__) && !defined(STDC_HEADERS)
|
||||
extern int errno;
|
||||
#endif
|
||||
|
||||
/* Match STRING against the filename pattern PATTERN, returning zero if
|
||||
it matches, nonzero if not. */
|
||||
int
|
||||
#if __STDC__
|
||||
fnmatch (const char *pattern, const char *string, int flags)
|
||||
#else
|
||||
fnmatch (pattern, string, flags)
|
||||
char *pattern;
|
||||
char *string;
|
||||
int flags;
|
||||
#endif
|
||||
{
|
||||
register const char *p = pattern, *n = string;
|
||||
register char c;
|
||||
|
||||
if ((flags & ~__FNM_FLAGS) != 0)
|
||||
{
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
while ((c = *p++) != '\0')
|
||||
{
|
||||
switch (c)
|
||||
{
|
||||
case '?':
|
||||
if (*n == '\0')
|
||||
return FNM_NOMATCH;
|
||||
else if ((flags & FNM_PATHNAME) && *n == '/')
|
||||
return FNM_NOMATCH;
|
||||
else if ((flags & FNM_PERIOD) && *n == '.' &&
|
||||
(n == string || ((flags & FNM_PATHNAME) && n[-1] == '/')))
|
||||
return FNM_NOMATCH;
|
||||
break;
|
||||
|
||||
case '\\':
|
||||
if (!(flags & FNM_NOESCAPE))
|
||||
c = *p++;
|
||||
if (*n != c)
|
||||
return FNM_NOMATCH;
|
||||
break;
|
||||
|
||||
case '*':
|
||||
if ((flags & FNM_PERIOD) && *n == '.' &&
|
||||
(n == string || ((flags & FNM_PATHNAME) && n[-1] == '/')))
|
||||
return FNM_NOMATCH;
|
||||
|
||||
for (c = *p++; c == '?' || c == '*'; c = *p++, ++n)
|
||||
if (((flags & FNM_PATHNAME) && *n == '/') ||
|
||||
(c == '?' && *n == '\0'))
|
||||
return FNM_NOMATCH;
|
||||
|
||||
if (c == '\0')
|
||||
return 0;
|
||||
|
||||
{
|
||||
char c1 = (!(flags & FNM_NOESCAPE) && c == '\\') ? *p : c;
|
||||
for (--p; *n != '\0'; ++n)
|
||||
if ((c == '[' || *n == c1) &&
|
||||
fnmatch(p, n, flags & ~FNM_PERIOD) == 0)
|
||||
return 0;
|
||||
return FNM_NOMATCH;
|
||||
}
|
||||
|
||||
case '[':
|
||||
{
|
||||
/* Nonzero if the sense of the character class is inverted. */
|
||||
register int not;
|
||||
|
||||
if (*n == '\0')
|
||||
return FNM_NOMATCH;
|
||||
|
||||
if ((flags & FNM_PERIOD) && *n == '.' &&
|
||||
(n == string || ((flags & FNM_PATHNAME) && n[-1] == '/')))
|
||||
return FNM_NOMATCH;
|
||||
|
||||
not = (*p == '!' || *p == '^');
|
||||
if (not)
|
||||
++p;
|
||||
|
||||
c = *p++;
|
||||
for (;;)
|
||||
{
|
||||
register char cstart = c, cend = c;
|
||||
|
||||
if (!(flags & FNM_NOESCAPE) && c == '\\')
|
||||
cstart = cend = *p++;
|
||||
|
||||
if (c == '\0')
|
||||
/* [ (unterminated) loses. */
|
||||
return FNM_NOMATCH;
|
||||
|
||||
c = *p++;
|
||||
|
||||
if ((flags & FNM_PATHNAME) && c == '/')
|
||||
/* [/] can never match. */
|
||||
return FNM_NOMATCH;
|
||||
|
||||
if (c == '-' && *p != ']')
|
||||
{
|
||||
cend = *p++;
|
||||
if (!(flags & FNM_NOESCAPE) && cend == '\\')
|
||||
cend = *p++;
|
||||
if (cend == '\0')
|
||||
return FNM_NOMATCH;
|
||||
c = *p++;
|
||||
}
|
||||
|
||||
if (*n >= cstart && *n <= cend)
|
||||
goto matched;
|
||||
|
||||
if (c == ']')
|
||||
break;
|
||||
}
|
||||
if (!not)
|
||||
return FNM_NOMATCH;
|
||||
break;
|
||||
|
||||
matched:;
|
||||
/* Skip the rest of the [...] that already matched. */
|
||||
while (c != ']')
|
||||
{
|
||||
if (c == '\0')
|
||||
/* [... (unterminated) loses. */
|
||||
return FNM_NOMATCH;
|
||||
|
||||
c = *p++;
|
||||
if (!(flags & FNM_NOESCAPE) && c == '\\')
|
||||
/* 1003.2d11 is unclear if this is right. %%% */
|
||||
++p;
|
||||
}
|
||||
if (not)
|
||||
return FNM_NOMATCH;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
if (FOLD_FN_CHAR (c) != FOLD_FN_CHAR (*n))
|
||||
return FNM_NOMATCH;
|
||||
}
|
||||
|
||||
++n;
|
||||
}
|
||||
|
||||
if (*n == '\0')
|
||||
return 0;
|
||||
|
||||
return FNM_NOMATCH;
|
||||
}
|
45
contrib/cvs/lib/fnmatch.h
Normal file
45
contrib/cvs/lib/fnmatch.h
Normal file
@ -0,0 +1,45 @@
|
||||
/* Copyright (C) 1992 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If
|
||||
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
|
||||
#ifndef _FNMATCH_H
|
||||
|
||||
#define _FNMATCH_H 1
|
||||
|
||||
/* Bits set in the FLAGS argument to `fnmatch'. */
|
||||
#undef FNM_PATHNAME
|
||||
#define FNM_PATHNAME (1 << 0)/* No wildcard can ever match `/'. */
|
||||
#undef FNM_NOESCAPE
|
||||
#define FNM_NOESCAPE (1 << 1)/* Backslashes don't quote special chars. */
|
||||
#undef FNM_PERIOD
|
||||
#define FNM_PERIOD (1 << 2)/* Leading `.' is matched only explicitly. */
|
||||
#undef __FNM_FLAGS
|
||||
#define __FNM_FLAGS (FNM_PATHNAME|FNM_NOESCAPE|FNM_PERIOD)
|
||||
|
||||
/* Value returned by `fnmatch' if STRING does not match PATTERN. */
|
||||
#undef FNM_NOMATCH
|
||||
#define FNM_NOMATCH 1
|
||||
|
||||
/* Match STRING against the filename pattern PATTERN,
|
||||
returning zero if it matches, FNM_NOMATCH if not. */
|
||||
#if __STDC__
|
||||
extern int fnmatch (const char *pattern, const char *string, int flags);
|
||||
#else
|
||||
extern int fnmatch ();
|
||||
#endif
|
||||
|
||||
#endif /* fnmatch.h */
|
76
contrib/cvs/lib/ftruncate.c
Normal file
76
contrib/cvs/lib/ftruncate.c
Normal file
@ -0,0 +1,76 @@
|
||||
/* ftruncate emulations that work on some System V's.
|
||||
This file is in the public domain. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#ifdef F_CHSIZE
|
||||
int
|
||||
ftruncate (fd, length)
|
||||
int fd;
|
||||
off_t length;
|
||||
{
|
||||
return fcntl (fd, F_CHSIZE, length);
|
||||
}
|
||||
#else
|
||||
#ifdef F_FREESP
|
||||
/* The following function was written by
|
||||
kucharsk@Solbourne.com (William Kucharski) */
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int
|
||||
ftruncate (fd, length)
|
||||
int fd;
|
||||
off_t length;
|
||||
{
|
||||
struct flock fl;
|
||||
struct stat filebuf;
|
||||
|
||||
if (fstat (fd, &filebuf) < 0)
|
||||
return -1;
|
||||
|
||||
if (filebuf.st_size < length)
|
||||
{
|
||||
/* Extend file length. */
|
||||
if (lseek (fd, (length - 1), SEEK_SET) < 0)
|
||||
return -1;
|
||||
|
||||
/* Write a "0" byte. */
|
||||
if (write (fd, "", 1) != 1)
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Truncate length. */
|
||||
fl.l_whence = 0;
|
||||
fl.l_len = 0;
|
||||
fl.l_start = length;
|
||||
fl.l_type = F_WRLCK; /* Write lock on file space. */
|
||||
|
||||
/* This relies on the UNDOCUMENTED F_FREESP argument to
|
||||
fcntl, which truncates the file so that it ends at the
|
||||
position indicated by fl.l_start.
|
||||
Will minor miracles never cease? */
|
||||
if (fcntl (fd, F_FREESP, &fl) < 0)
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
int
|
||||
ftruncate (fd, length)
|
||||
int fd;
|
||||
off_t length;
|
||||
{
|
||||
return chsize (fd, length);
|
||||
}
|
||||
#endif
|
||||
#endif
|
1001
contrib/cvs/lib/getdate.y
Normal file
1001
contrib/cvs/lib/getdate.y
Normal file
File diff suppressed because it is too large
Load Diff
125
contrib/cvs/lib/getline.c
Normal file
125
contrib/cvs/lib/getline.c
Normal file
@ -0,0 +1,125 @@
|
||||
/* getline.c -- Replacement for GNU C library function getline
|
||||
|
||||
Copyright (C) 1993 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
/* Written by Jan Brittenson, bson@gnu.ai.mit.edu. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
|
||||
#if STDC_HEADERS
|
||||
#include <stdlib.h>
|
||||
#else
|
||||
char *malloc (), *realloc ();
|
||||
#endif
|
||||
|
||||
/* Always add at least this many bytes when extending the buffer. */
|
||||
#define MIN_CHUNK 64
|
||||
|
||||
/* Read up to (and including) a TERMINATOR from STREAM into *LINEPTR
|
||||
+ OFFSET (and null-terminate it). *LINEPTR is a pointer returned from
|
||||
malloc (or NULL), pointing to *N characters of space. It is realloc'd
|
||||
as necessary. Return the number of characters read (not including the
|
||||
null terminator), or -1 on error or EOF. */
|
||||
|
||||
int
|
||||
getstr (lineptr, n, stream, terminator, offset)
|
||||
char **lineptr;
|
||||
size_t *n;
|
||||
FILE *stream;
|
||||
char terminator;
|
||||
int offset;
|
||||
{
|
||||
int nchars_avail; /* Allocated but unused chars in *LINEPTR. */
|
||||
char *read_pos; /* Where we're reading into *LINEPTR. */
|
||||
int ret;
|
||||
|
||||
if (!lineptr || !n || !stream)
|
||||
return -1;
|
||||
|
||||
if (!*lineptr)
|
||||
{
|
||||
*n = MIN_CHUNK;
|
||||
*lineptr = malloc (*n);
|
||||
if (!*lineptr)
|
||||
return -1;
|
||||
}
|
||||
|
||||
nchars_avail = *n - offset;
|
||||
read_pos = *lineptr + offset;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
register int c = getc (stream);
|
||||
|
||||
/* We always want at least one char left in the buffer, since we
|
||||
always (unless we get an error while reading the first char)
|
||||
NUL-terminate the line buffer. */
|
||||
|
||||
assert((*lineptr + *n) == (read_pos + nchars_avail));
|
||||
if (nchars_avail < 2)
|
||||
{
|
||||
if (*n > MIN_CHUNK)
|
||||
*n *= 2;
|
||||
else
|
||||
*n += MIN_CHUNK;
|
||||
|
||||
nchars_avail = *n + *lineptr - read_pos;
|
||||
*lineptr = realloc (*lineptr, *n);
|
||||
if (!*lineptr)
|
||||
return -1;
|
||||
read_pos = *n - nchars_avail + *lineptr;
|
||||
assert((*lineptr + *n) == (read_pos + nchars_avail));
|
||||
}
|
||||
|
||||
if (c == EOF || ferror (stream))
|
||||
{
|
||||
/* Return partial line, if any. */
|
||||
if (read_pos == *lineptr)
|
||||
return -1;
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
*read_pos++ = c;
|
||||
nchars_avail--;
|
||||
|
||||
if (c == terminator)
|
||||
/* Return the line. */
|
||||
break;
|
||||
}
|
||||
|
||||
/* Done - NUL terminate and return the number of chars read. */
|
||||
*read_pos = '\0';
|
||||
|
||||
ret = read_pos - (*lineptr + offset);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
getline (lineptr, n, stream)
|
||||
char **lineptr;
|
||||
size_t *n;
|
||||
FILE *stream;
|
||||
{
|
||||
return getstr (lineptr, n, stream, '\n', 0);
|
||||
}
|
15
contrib/cvs/lib/getline.h
Normal file
15
contrib/cvs/lib/getline.h
Normal file
@ -0,0 +1,15 @@
|
||||
#ifndef _getline_h_
|
||||
#define _getline_h_ 1
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#if defined (__GNUC__) || (defined (__STDC__) && __STDC__)
|
||||
#define __PROTO(args) args
|
||||
#else
|
||||
#define __PROTO(args) ()
|
||||
#endif /* GCC. */
|
||||
|
||||
int
|
||||
getline __PROTO ((char **_lineptr, size_t *_n, FILE *_stream));
|
||||
|
||||
#endif /* _getline_h_ */
|
759
contrib/cvs/lib/getopt.c
Normal file
759
contrib/cvs/lib/getopt.c
Normal file
@ -0,0 +1,759 @@
|
||||
/* Getopt for GNU.
|
||||
NOTE: getopt is now part of the C library, so if you don't know what
|
||||
"Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu
|
||||
before changing it!
|
||||
|
||||
Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option) any
|
||||
later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
|
||||
Ditto for AIX 3.2 and <stdlib.h>. */
|
||||
#ifndef _NO_PROTO
|
||||
#define _NO_PROTO
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#if defined (emacs) || defined (CONFIG_BROKETS)
|
||||
/* We use <config.h> instead of "config.h" so that a compilation
|
||||
using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h
|
||||
(which it would do because it found this file in $srcdir). */
|
||||
#include <config.h>
|
||||
#else
|
||||
#include "config.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef __STDC__
|
||||
/* This is a separate conditional since some stdc systems
|
||||
reject `defined (const)'. */
|
||||
#ifndef const
|
||||
#define const
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
/* Comment out all this code if we are using the GNU C Library, and are not
|
||||
actually compiling the library itself. This code is part of the GNU C
|
||||
Library, but also included in many other GNU distributions. Compiling
|
||||
and linking in this code is a waste when using the GNU C library
|
||||
(especially if it is a shared library). Rather than having every GNU
|
||||
program understand `configure --with-gnu-libc' and omit the object files,
|
||||
it is simpler to just do this in the source for each such file. */
|
||||
|
||||
#if defined (_LIBC) || !defined (__GNU_LIBRARY__)
|
||||
|
||||
|
||||
/* This needs to come after some library #include
|
||||
to get __GNU_LIBRARY__ defined. */
|
||||
#ifdef __GNU_LIBRARY__
|
||||
/* Don't include stdlib.h for non-GNU C libraries because some of them
|
||||
contain conflicting prototypes for getopt. */
|
||||
#include <stdlib.h>
|
||||
#endif /* GNU C library. */
|
||||
|
||||
/* This version of `getopt' appears to the caller like standard Unix `getopt'
|
||||
but it behaves differently for the user, since it allows the user
|
||||
to intersperse the options with the other arguments.
|
||||
|
||||
As `getopt' works, it permutes the elements of ARGV so that,
|
||||
when it is done, all the options precede everything else. Thus
|
||||
all application programs are extended to handle flexible argument order.
|
||||
|
||||
Setting the environment variable POSIXLY_CORRECT disables permutation.
|
||||
Then the behavior is completely standard.
|
||||
|
||||
GNU application programs can use a third alternative mode in which
|
||||
they can distinguish the relative order of options and other arguments. */
|
||||
|
||||
#include "getopt.h"
|
||||
|
||||
/* For communication from `getopt' to the caller.
|
||||
When `getopt' finds an option that takes an argument,
|
||||
the argument value is returned here.
|
||||
Also, when `ordering' is RETURN_IN_ORDER,
|
||||
each non-option ARGV-element is returned here. */
|
||||
|
||||
char *optarg = NULL;
|
||||
|
||||
/* Index in ARGV of the next element to be scanned.
|
||||
This is used for communication to and from the caller
|
||||
and for communication between successive calls to `getopt'.
|
||||
|
||||
On entry to `getopt', zero means this is the first call; initialize.
|
||||
|
||||
When `getopt' returns EOF, this is the index of the first of the
|
||||
non-option elements that the caller should itself scan.
|
||||
|
||||
Otherwise, `optind' communicates from one call to the next
|
||||
how much of ARGV has been scanned so far. */
|
||||
|
||||
/* XXX 1003.2 says this must be 1 before any call. */
|
||||
int optind = 0;
|
||||
|
||||
/* The next char to be scanned in the option-element
|
||||
in which the last option character we returned was found.
|
||||
This allows us to pick up the scan where we left off.
|
||||
|
||||
If this is zero, or a null string, it means resume the scan
|
||||
by advancing to the next ARGV-element. */
|
||||
|
||||
static char *nextchar;
|
||||
|
||||
/* Callers store zero here to inhibit the error message
|
||||
for unrecognized options. */
|
||||
|
||||
int opterr = 1;
|
||||
|
||||
/* Set to an option character which was unrecognized.
|
||||
This must be initialized on some systems to avoid linking in the
|
||||
system's own getopt implementation. */
|
||||
|
||||
int optopt = '?';
|
||||
|
||||
/* Describe how to deal with options that follow non-option ARGV-elements.
|
||||
|
||||
If the caller did not specify anything,
|
||||
the default is REQUIRE_ORDER if the environment variable
|
||||
POSIXLY_CORRECT is defined, PERMUTE otherwise.
|
||||
|
||||
REQUIRE_ORDER means don't recognize them as options;
|
||||
stop option processing when the first non-option is seen.
|
||||
This is what Unix does.
|
||||
This mode of operation is selected by either setting the environment
|
||||
variable POSIXLY_CORRECT, or using `+' as the first character
|
||||
of the list of option characters.
|
||||
|
||||
PERMUTE is the default. We permute the contents of ARGV as we scan,
|
||||
so that eventually all the non-options are at the end. This allows options
|
||||
to be given in any order, even with programs that were not written to
|
||||
expect this.
|
||||
|
||||
RETURN_IN_ORDER is an option available to programs that were written
|
||||
to expect options and other ARGV-elements in any order and that care about
|
||||
the ordering of the two. We describe each non-option ARGV-element
|
||||
as if it were the argument of an option with character code 1.
|
||||
Using `-' as the first character of the list of option characters
|
||||
selects this mode of operation.
|
||||
|
||||
The special argument `--' forces an end of option-scanning regardless
|
||||
of the value of `ordering'. In the case of RETURN_IN_ORDER, only
|
||||
`--' can cause `getopt' to return EOF with `optind' != ARGC. */
|
||||
|
||||
static enum
|
||||
{
|
||||
REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
|
||||
} ordering;
|
||||
|
||||
/* Value of POSIXLY_CORRECT environment variable. */
|
||||
static char *posixly_correct;
|
||||
|
||||
#ifdef __GNU_LIBRARY__
|
||||
/* We want to avoid inclusion of string.h with non-GNU libraries
|
||||
because there are many ways it can cause trouble.
|
||||
On some systems, it contains special magic macros that don't work
|
||||
in GCC. */
|
||||
#include <string.h>
|
||||
#define my_index strchr
|
||||
#else
|
||||
|
||||
/* Avoid depending on library functions or files
|
||||
whose names are inconsistent. */
|
||||
|
||||
char *getenv ();
|
||||
|
||||
static char *
|
||||
my_index (str, chr)
|
||||
const char *str;
|
||||
int chr;
|
||||
{
|
||||
while (*str)
|
||||
{
|
||||
if (*str == chr)
|
||||
return (char *) str;
|
||||
str++;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* If using GCC, we can safely declare strlen this way.
|
||||
If not using GCC, it is ok not to declare it. */
|
||||
#ifdef __GNUC__
|
||||
/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h.
|
||||
That was relevant to code that was here before. */
|
||||
#ifndef __STDC__
|
||||
/* gcc with -traditional declares the built-in strlen to return int,
|
||||
and has done so at least since version 2.4.5. -- rms. */
|
||||
extern int strlen (const char *);
|
||||
#endif /* not __STDC__ */
|
||||
#endif /* __GNUC__ */
|
||||
|
||||
#endif /* not __GNU_LIBRARY__ */
|
||||
|
||||
/* Handle permutation of arguments. */
|
||||
|
||||
/* Describe the part of ARGV that contains non-options that have
|
||||
been skipped. `first_nonopt' is the index in ARGV of the first of them;
|
||||
`last_nonopt' is the index after the last of them. */
|
||||
|
||||
static int first_nonopt;
|
||||
static int last_nonopt;
|
||||
|
||||
/* Exchange two adjacent subsequences of ARGV.
|
||||
One subsequence is elements [first_nonopt,last_nonopt)
|
||||
which contains all the non-options that have been skipped so far.
|
||||
The other is elements [last_nonopt,optind), which contains all
|
||||
the options processed since those non-options were skipped.
|
||||
|
||||
`first_nonopt' and `last_nonopt' are relocated so that they describe
|
||||
the new indices of the non-options in ARGV after they are moved. */
|
||||
|
||||
static void
|
||||
exchange (argv)
|
||||
char **argv;
|
||||
{
|
||||
int bottom = first_nonopt;
|
||||
int middle = last_nonopt;
|
||||
int top = optind;
|
||||
char *tem;
|
||||
|
||||
/* Exchange the shorter segment with the far end of the longer segment.
|
||||
That puts the shorter segment into the right place.
|
||||
It leaves the longer segment in the right place overall,
|
||||
but it consists of two parts that need to be swapped next. */
|
||||
|
||||
while (top > middle && middle > bottom)
|
||||
{
|
||||
if (top - middle > middle - bottom)
|
||||
{
|
||||
/* Bottom segment is the short one. */
|
||||
int len = middle - bottom;
|
||||
register int i;
|
||||
|
||||
/* Swap it with the top part of the top segment. */
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
tem = argv[bottom + i];
|
||||
argv[bottom + i] = argv[top - (middle - bottom) + i];
|
||||
argv[top - (middle - bottom) + i] = tem;
|
||||
}
|
||||
/* Exclude the moved bottom segment from further swapping. */
|
||||
top -= len;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Top segment is the short one. */
|
||||
int len = top - middle;
|
||||
register int i;
|
||||
|
||||
/* Swap it with the bottom part of the bottom segment. */
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
tem = argv[bottom + i];
|
||||
argv[bottom + i] = argv[middle + i];
|
||||
argv[middle + i] = tem;
|
||||
}
|
||||
/* Exclude the moved top segment from further swapping. */
|
||||
bottom += len;
|
||||
}
|
||||
}
|
||||
|
||||
/* Update records for the slots the non-options now occupy. */
|
||||
|
||||
first_nonopt += (optind - last_nonopt);
|
||||
last_nonopt = optind;
|
||||
}
|
||||
|
||||
/* Initialize the internal data when the first call is made. */
|
||||
|
||||
static const char *
|
||||
_getopt_initialize (optstring)
|
||||
const char *optstring;
|
||||
{
|
||||
/* Start processing options with ARGV-element 1 (since ARGV-element 0
|
||||
is the program name); the sequence of previously skipped
|
||||
non-option ARGV-elements is empty. */
|
||||
|
||||
first_nonopt = last_nonopt = optind = 1;
|
||||
|
||||
nextchar = NULL;
|
||||
|
||||
posixly_correct = getenv ("POSIXLY_CORRECT");
|
||||
|
||||
/* Determine how to handle the ordering of options and nonoptions. */
|
||||
|
||||
if (optstring[0] == '-')
|
||||
{
|
||||
ordering = RETURN_IN_ORDER;
|
||||
++optstring;
|
||||
}
|
||||
else if (optstring[0] == '+')
|
||||
{
|
||||
ordering = REQUIRE_ORDER;
|
||||
++optstring;
|
||||
}
|
||||
else if (posixly_correct != NULL)
|
||||
ordering = REQUIRE_ORDER;
|
||||
else
|
||||
ordering = PERMUTE;
|
||||
|
||||
return optstring;
|
||||
}
|
||||
|
||||
/* Scan elements of ARGV (whose length is ARGC) for option characters
|
||||
given in OPTSTRING.
|
||||
|
||||
If an element of ARGV starts with '-', and is not exactly "-" or "--",
|
||||
then it is an option element. The characters of this element
|
||||
(aside from the initial '-') are option characters. If `getopt'
|
||||
is called repeatedly, it returns successively each of the option characters
|
||||
from each of the option elements.
|
||||
|
||||
If `getopt' finds another option character, it returns that character,
|
||||
updating `optind' and `nextchar' so that the next call to `getopt' can
|
||||
resume the scan with the following option character or ARGV-element.
|
||||
|
||||
If there are no more option characters, `getopt' returns `EOF'.
|
||||
Then `optind' is the index in ARGV of the first ARGV-element
|
||||
that is not an option. (The ARGV-elements have been permuted
|
||||
so that those that are not options now come last.)
|
||||
|
||||
OPTSTRING is a string containing the legitimate option characters.
|
||||
If an option character is seen that is not listed in OPTSTRING,
|
||||
return '?' after printing an error message. If you set `opterr' to
|
||||
zero, the error message is suppressed but we still return '?'.
|
||||
|
||||
If a char in OPTSTRING is followed by a colon, that means it wants an arg,
|
||||
so the following text in the same ARGV-element, or the text of the following
|
||||
ARGV-element, is returned in `optarg'. Two colons mean an option that
|
||||
wants an optional arg; if there is text in the current ARGV-element,
|
||||
it is returned in `optarg', otherwise `optarg' is set to zero.
|
||||
|
||||
If OPTSTRING starts with `-' or `+', it requests different methods of
|
||||
handling the non-option ARGV-elements.
|
||||
See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above.
|
||||
|
||||
Long-named options begin with `--' instead of `-'.
|
||||
Their names may be abbreviated as long as the abbreviation is unique
|
||||
or is an exact match for some defined option. If they have an
|
||||
argument, it follows the option name in the same ARGV-element, separated
|
||||
from the option name by a `=', or else the in next ARGV-element.
|
||||
When `getopt' finds a long-named option, it returns 0 if that option's
|
||||
`flag' field is nonzero, the value of the option's `val' field
|
||||
if the `flag' field is zero.
|
||||
|
||||
The elements of ARGV aren't really const, because we permute them.
|
||||
But we pretend they're const in the prototype to be compatible
|
||||
with other systems.
|
||||
|
||||
LONGOPTS is a vector of `struct option' terminated by an
|
||||
element containing a name which is zero.
|
||||
|
||||
LONGIND returns the index in LONGOPT of the long-named option found.
|
||||
It is only valid when a long-named option has been found by the most
|
||||
recent call.
|
||||
|
||||
If LONG_ONLY is nonzero, '-' as well as '--' can introduce
|
||||
long-named options. */
|
||||
|
||||
int
|
||||
_getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
int argc;
|
||||
char *const *argv;
|
||||
const char *optstring;
|
||||
const struct option *longopts;
|
||||
int *longind;
|
||||
int long_only;
|
||||
{
|
||||
optarg = NULL;
|
||||
|
||||
if (optind == 0)
|
||||
optstring = _getopt_initialize (optstring);
|
||||
|
||||
if (nextchar == NULL || *nextchar == '\0')
|
||||
{
|
||||
/* Advance to the next ARGV-element. */
|
||||
|
||||
if (ordering == PERMUTE)
|
||||
{
|
||||
/* If we have just processed some options following some non-options,
|
||||
exchange them so that the options come first. */
|
||||
|
||||
if (first_nonopt != last_nonopt && last_nonopt != optind)
|
||||
exchange ((char **) argv);
|
||||
else if (last_nonopt != optind)
|
||||
first_nonopt = optind;
|
||||
|
||||
/* Skip any additional non-options
|
||||
and extend the range of non-options previously skipped. */
|
||||
|
||||
while (optind < argc
|
||||
&& (argv[optind][0] != '-' || argv[optind][1] == '\0'))
|
||||
optind++;
|
||||
last_nonopt = optind;
|
||||
}
|
||||
|
||||
/* The special ARGV-element `--' means premature end of options.
|
||||
Skip it like a null option,
|
||||
then exchange with previous non-options as if it were an option,
|
||||
then skip everything else like a non-option. */
|
||||
|
||||
if (optind != argc && !strcmp (argv[optind], "--"))
|
||||
{
|
||||
optind++;
|
||||
|
||||
if (first_nonopt != last_nonopt && last_nonopt != optind)
|
||||
exchange ((char **) argv);
|
||||
else if (first_nonopt == last_nonopt)
|
||||
first_nonopt = optind;
|
||||
last_nonopt = argc;
|
||||
|
||||
optind = argc;
|
||||
}
|
||||
|
||||
/* If we have done all the ARGV-elements, stop the scan
|
||||
and back over any non-options that we skipped and permuted. */
|
||||
|
||||
if (optind == argc)
|
||||
{
|
||||
/* Set the next-arg-index to point at the non-options
|
||||
that we previously skipped, so the caller will digest them. */
|
||||
if (first_nonopt != last_nonopt)
|
||||
optind = first_nonopt;
|
||||
return EOF;
|
||||
}
|
||||
|
||||
/* If we have come to a non-option and did not permute it,
|
||||
either stop the scan or describe it to the caller and pass it by. */
|
||||
|
||||
if ((argv[optind][0] != '-' || argv[optind][1] == '\0'))
|
||||
{
|
||||
if (ordering == REQUIRE_ORDER)
|
||||
return EOF;
|
||||
optarg = argv[optind++];
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* We have found another option-ARGV-element.
|
||||
Skip the initial punctuation. */
|
||||
|
||||
nextchar = (argv[optind] + 1
|
||||
+ (longopts != NULL && argv[optind][1] == '-'));
|
||||
}
|
||||
|
||||
/* Decode the current option-ARGV-element. */
|
||||
|
||||
/* Check whether the ARGV-element is a long option.
|
||||
|
||||
If long_only and the ARGV-element has the form "-f", where f is
|
||||
a valid short option, don't consider it an abbreviated form of
|
||||
a long option that starts with f. Otherwise there would be no
|
||||
way to give the -f short option.
|
||||
|
||||
On the other hand, if there's a long option "fubar" and
|
||||
the ARGV-element is "-fu", do consider that an abbreviation of
|
||||
the long option, just like "--fu", and not "-f" with arg "u".
|
||||
|
||||
This distinction seems to be the most useful approach. */
|
||||
|
||||
if (longopts != NULL
|
||||
&& (argv[optind][1] == '-'
|
||||
|| (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1])))))
|
||||
{
|
||||
char *nameend;
|
||||
const struct option *p;
|
||||
const struct option *pfound = NULL;
|
||||
int exact = 0;
|
||||
int ambig = 0;
|
||||
int indfound;
|
||||
int option_index;
|
||||
|
||||
for (nameend = nextchar; *nameend && *nameend != '='; nameend++)
|
||||
/* Do nothing. */ ;
|
||||
|
||||
/* Test all long options for either exact match
|
||||
or abbreviated matches. */
|
||||
for (p = longopts, option_index = 0; p->name; p++, option_index++)
|
||||
if (!strncmp (p->name, nextchar, nameend - nextchar))
|
||||
{
|
||||
if (nameend - nextchar == (int) strlen (p->name))
|
||||
{
|
||||
/* Exact match found. */
|
||||
pfound = p;
|
||||
indfound = option_index;
|
||||
exact = 1;
|
||||
break;
|
||||
}
|
||||
else if (pfound == NULL)
|
||||
{
|
||||
/* First nonexact match found. */
|
||||
pfound = p;
|
||||
indfound = option_index;
|
||||
}
|
||||
else
|
||||
/* Second or later nonexact match found. */
|
||||
ambig = 1;
|
||||
}
|
||||
|
||||
if (ambig && !exact)
|
||||
{
|
||||
if (opterr)
|
||||
fprintf (stderr, "%s: option `%s' is ambiguous\n",
|
||||
argv[0], argv[optind]);
|
||||
nextchar += strlen (nextchar);
|
||||
optind++;
|
||||
return '?';
|
||||
}
|
||||
|
||||
if (pfound != NULL)
|
||||
{
|
||||
option_index = indfound;
|
||||
optind++;
|
||||
if (*nameend)
|
||||
{
|
||||
/* Don't test has_arg with >, because some C compilers don't
|
||||
allow it to be used on enums. */
|
||||
if (pfound->has_arg)
|
||||
optarg = nameend + 1;
|
||||
else
|
||||
{
|
||||
if (opterr)
|
||||
{
|
||||
if (argv[optind - 1][1] == '-')
|
||||
/* --option */
|
||||
fprintf (stderr,
|
||||
"%s: option `--%s' doesn't allow an argument\n",
|
||||
argv[0], pfound->name);
|
||||
else
|
||||
/* +option or -option */
|
||||
fprintf (stderr,
|
||||
"%s: option `%c%s' doesn't allow an argument\n",
|
||||
argv[0], argv[optind - 1][0], pfound->name);
|
||||
}
|
||||
nextchar += strlen (nextchar);
|
||||
return '?';
|
||||
}
|
||||
}
|
||||
else if (pfound->has_arg == 1)
|
||||
{
|
||||
if (optind < argc)
|
||||
optarg = argv[optind++];
|
||||
else
|
||||
{
|
||||
if (opterr)
|
||||
fprintf (stderr, "%s: option `%s' requires an argument\n",
|
||||
argv[0], argv[optind - 1]);
|
||||
nextchar += strlen (nextchar);
|
||||
return optstring[0] == ':' ? ':' : '?';
|
||||
}
|
||||
}
|
||||
nextchar += strlen (nextchar);
|
||||
if (longind != NULL)
|
||||
*longind = option_index;
|
||||
if (pfound->flag)
|
||||
{
|
||||
*(pfound->flag) = pfound->val;
|
||||
return 0;
|
||||
}
|
||||
return pfound->val;
|
||||
}
|
||||
|
||||
/* Can't find it as a long option. If this is not getopt_long_only,
|
||||
or the option starts with '--' or is not a valid short
|
||||
option, then it's an error.
|
||||
Otherwise interpret it as a short option. */
|
||||
if (!long_only || argv[optind][1] == '-'
|
||||
|| my_index (optstring, *nextchar) == NULL)
|
||||
{
|
||||
if (opterr)
|
||||
{
|
||||
if (argv[optind][1] == '-')
|
||||
/* --option */
|
||||
fprintf (stderr, "%s: unrecognized option `--%s'\n",
|
||||
argv[0], nextchar);
|
||||
else
|
||||
/* +option or -option */
|
||||
fprintf (stderr, "%s: unrecognized option `%c%s'\n",
|
||||
argv[0], argv[optind][0], nextchar);
|
||||
}
|
||||
nextchar = (char *) "";
|
||||
optind++;
|
||||
return '?';
|
||||
}
|
||||
}
|
||||
|
||||
/* Look at and handle the next short option-character. */
|
||||
|
||||
{
|
||||
char c = *nextchar++;
|
||||
char *temp = my_index (optstring, c);
|
||||
|
||||
/* Increment `optind' when we start to process its last character. */
|
||||
if (*nextchar == '\0')
|
||||
++optind;
|
||||
|
||||
if (temp == NULL || c == ':')
|
||||
{
|
||||
if (opterr)
|
||||
{
|
||||
if (posixly_correct)
|
||||
/* 1003.2 specifies the format of this message. */
|
||||
fprintf (stderr, "%s: illegal option -- %c\n", argv[0], c);
|
||||
else
|
||||
fprintf (stderr, "%s: invalid option -- %c\n", argv[0], c);
|
||||
}
|
||||
optopt = c;
|
||||
return '?';
|
||||
}
|
||||
if (temp[1] == ':')
|
||||
{
|
||||
if (temp[2] == ':')
|
||||
{
|
||||
/* This is an option that accepts an argument optionally. */
|
||||
if (*nextchar != '\0')
|
||||
{
|
||||
optarg = nextchar;
|
||||
optind++;
|
||||
}
|
||||
else
|
||||
optarg = NULL;
|
||||
nextchar = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* This is an option that requires an argument. */
|
||||
if (*nextchar != '\0')
|
||||
{
|
||||
optarg = nextchar;
|
||||
/* If we end this ARGV-element by taking the rest as an arg,
|
||||
we must advance to the next element now. */
|
||||
optind++;
|
||||
}
|
||||
else if (optind == argc)
|
||||
{
|
||||
if (opterr)
|
||||
{
|
||||
/* 1003.2 specifies the format of this message. */
|
||||
fprintf (stderr, "%s: option requires an argument -- %c\n",
|
||||
argv[0], c);
|
||||
}
|
||||
optopt = c;
|
||||
if (optstring[0] == ':')
|
||||
c = ':';
|
||||
else
|
||||
c = '?';
|
||||
}
|
||||
else
|
||||
/* We already incremented `optind' once;
|
||||
increment it again when taking next ARGV-elt as argument. */
|
||||
optarg = argv[optind++];
|
||||
nextchar = NULL;
|
||||
}
|
||||
}
|
||||
return c;
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
getopt (argc, argv, optstring)
|
||||
int argc;
|
||||
char *const *argv;
|
||||
const char *optstring;
|
||||
{
|
||||
return _getopt_internal (argc, argv, optstring,
|
||||
(const struct option *) 0,
|
||||
(int *) 0,
|
||||
0);
|
||||
}
|
||||
|
||||
#endif /* _LIBC or not __GNU_LIBRARY__. */
|
||||
|
||||
#ifdef TEST
|
||||
|
||||
/* Compile with -DTEST to make an executable for use in testing
|
||||
the above definition of `getopt'. */
|
||||
|
||||
int
|
||||
main (argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
{
|
||||
int c;
|
||||
int digit_optind = 0;
|
||||
|
||||
while (1)
|
||||
{
|
||||
int this_option_optind = optind ? optind : 1;
|
||||
|
||||
c = getopt (argc, argv, "abc:d:0123456789");
|
||||
if (c == EOF)
|
||||
break;
|
||||
|
||||
switch (c)
|
||||
{
|
||||
case '0':
|
||||
case '1':
|
||||
case '2':
|
||||
case '3':
|
||||
case '4':
|
||||
case '5':
|
||||
case '6':
|
||||
case '7':
|
||||
case '8':
|
||||
case '9':
|
||||
if (digit_optind != 0 && digit_optind != this_option_optind)
|
||||
printf ("digits occur in two different argv-elements.\n");
|
||||
digit_optind = this_option_optind;
|
||||
printf ("option %c\n", c);
|
||||
break;
|
||||
|
||||
case 'a':
|
||||
printf ("option a\n");
|
||||
break;
|
||||
|
||||
case 'b':
|
||||
printf ("option b\n");
|
||||
break;
|
||||
|
||||
case 'c':
|
||||
printf ("option c with value `%s'\n", optarg);
|
||||
break;
|
||||
|
||||
case '?':
|
||||
break;
|
||||
|
||||
default:
|
||||
printf ("?? getopt returned character code 0%o ??\n", c);
|
||||
}
|
||||
}
|
||||
|
||||
if (optind < argc)
|
||||
{
|
||||
printf ("non-option ARGV-elements: ");
|
||||
while (optind < argc)
|
||||
printf ("%s ", argv[optind++]);
|
||||
printf ("\n");
|
||||
}
|
||||
|
||||
exit (0);
|
||||
}
|
||||
|
||||
#endif /* TEST */
|
131
contrib/cvs/lib/getopt.h
Normal file
131
contrib/cvs/lib/getopt.h
Normal file
@ -0,0 +1,131 @@
|
||||
/* Declarations for getopt.
|
||||
Copyright (C) 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option) any
|
||||
later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
/* $CVSid: @(#)getopt.h 1.7 94/09/21 $ */
|
||||
|
||||
#ifndef _GETOPT_H
|
||||
#define _GETOPT_H 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* For communication from `getopt' to the caller.
|
||||
When `getopt' finds an option that takes an argument,
|
||||
the argument value is returned here.
|
||||
Also, when `ordering' is RETURN_IN_ORDER,
|
||||
each non-option ARGV-element is returned here. */
|
||||
|
||||
extern char *optarg;
|
||||
|
||||
/* Index in ARGV of the next element to be scanned.
|
||||
This is used for communication to and from the caller
|
||||
and for communication between successive calls to `getopt'.
|
||||
|
||||
On entry to `getopt', zero means this is the first call; initialize.
|
||||
|
||||
When `getopt' returns EOF, this is the index of the first of the
|
||||
non-option elements that the caller should itself scan.
|
||||
|
||||
Otherwise, `optind' communicates from one call to the next
|
||||
how much of ARGV has been scanned so far. */
|
||||
|
||||
extern int optind;
|
||||
|
||||
/* Callers store zero here to inhibit the error message `getopt' prints
|
||||
for unrecognized options. */
|
||||
|
||||
extern int opterr;
|
||||
|
||||
/* Set to an option character which was unrecognized. */
|
||||
|
||||
extern int optopt;
|
||||
|
||||
/* Describe the long-named options requested by the application.
|
||||
The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
|
||||
of `struct option' terminated by an element containing a name which is
|
||||
zero.
|
||||
|
||||
The field `has_arg' is:
|
||||
no_argument (or 0) if the option does not take an argument,
|
||||
required_argument (or 1) if the option requires an argument,
|
||||
optional_argument (or 2) if the option takes an optional argument.
|
||||
|
||||
If the field `flag' is not NULL, it points to a variable that is set
|
||||
to the value given in the field `val' when the option is found, but
|
||||
left unchanged if the option is not found.
|
||||
|
||||
To have a long-named option do something other than set an `int' to
|
||||
a compiled-in constant, such as set a value from `optarg', set the
|
||||
option's `flag' field to zero and its `val' field to a nonzero
|
||||
value (the equivalent single-letter option character, if there is
|
||||
one). For long options that have a zero `flag' field, `getopt'
|
||||
returns the contents of the `val' field. */
|
||||
|
||||
struct option
|
||||
{
|
||||
#if __STDC__
|
||||
const char *name;
|
||||
#else
|
||||
char *name;
|
||||
#endif
|
||||
/* has_arg can't be an enum because some compilers complain about
|
||||
type mismatches in all the code that assumes it is an int. */
|
||||
int has_arg;
|
||||
int *flag;
|
||||
int val;
|
||||
};
|
||||
|
||||
/* Names for the values of the `has_arg' field of `struct option'. */
|
||||
|
||||
#define no_argument 0
|
||||
#define required_argument 1
|
||||
#define optional_argument 2
|
||||
|
||||
#if __STDC__
|
||||
#if defined(__GNU_LIBRARY__)
|
||||
/* Many other libraries have conflicting prototypes for getopt, with
|
||||
differences in the consts, in stdlib.h. To avoid compilation
|
||||
errors, only prototype getopt for the GNU C library. */
|
||||
extern int getopt (int argc, char *const *argv, const char *shortopts);
|
||||
#else /* not __GNU_LIBRARY__ */
|
||||
extern int getopt ();
|
||||
#endif /* not __GNU_LIBRARY__ */
|
||||
extern int getopt_long (int argc, char *const *argv, const char *shortopts,
|
||||
const struct option *longopts, int *longind);
|
||||
extern int getopt_long_only (int argc, char *const *argv,
|
||||
const char *shortopts,
|
||||
const struct option *longopts, int *longind);
|
||||
|
||||
/* Internal only. Users should not call this directly. */
|
||||
extern int _getopt_internal (int argc, char *const *argv,
|
||||
const char *shortopts,
|
||||
const struct option *longopts, int *longind,
|
||||
int long_only);
|
||||
#else /* not __STDC__ */
|
||||
extern int getopt ();
|
||||
extern int getopt_long ();
|
||||
extern int getopt_long_only ();
|
||||
|
||||
extern int _getopt_internal ();
|
||||
#endif /* not __STDC__ */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _GETOPT_H */
|
187
contrib/cvs/lib/getopt1.c
Normal file
187
contrib/cvs/lib/getopt1.c
Normal file
@ -0,0 +1,187 @@
|
||||
/* getopt_long and getopt_long_only entry points for GNU getopt.
|
||||
Copyright (C) 1987, 88, 89, 90, 91, 92, 1993
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option) any
|
||||
later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#if defined (emacs) || defined (CONFIG_BROKETS)
|
||||
/* We use <config.h> instead of "config.h" so that a compilation
|
||||
using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h
|
||||
(which it would do because it found this file in $srcdir). */
|
||||
#include <config.h>
|
||||
#else
|
||||
#include "config.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "getopt.h"
|
||||
|
||||
#ifndef __STDC__
|
||||
/* This is a separate conditional since some stdc systems
|
||||
reject `defined (const)'. */
|
||||
#ifndef const
|
||||
#define const
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
/* Comment out all this code if we are using the GNU C Library, and are not
|
||||
actually compiling the library itself. This code is part of the GNU C
|
||||
Library, but also included in many other GNU distributions. Compiling
|
||||
and linking in this code is a waste when using the GNU C library
|
||||
(especially if it is a shared library). Rather than having every GNU
|
||||
program understand `configure --with-gnu-libc' and omit the object files,
|
||||
it is simpler to just do this in the source for each such file. */
|
||||
|
||||
#if defined (_LIBC) || !defined (__GNU_LIBRARY__)
|
||||
|
||||
|
||||
/* This needs to come after some library #include
|
||||
to get __GNU_LIBRARY__ defined. */
|
||||
#ifdef __GNU_LIBRARY__
|
||||
#include <stdlib.h>
|
||||
#else
|
||||
char *getenv ();
|
||||
#endif
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL 0
|
||||
#endif
|
||||
|
||||
int
|
||||
getopt_long (argc, argv, options, long_options, opt_index)
|
||||
int argc;
|
||||
char *const *argv;
|
||||
const char *options;
|
||||
const struct option *long_options;
|
||||
int *opt_index;
|
||||
{
|
||||
return _getopt_internal (argc, argv, options, long_options, opt_index, 0);
|
||||
}
|
||||
|
||||
/* Like getopt_long, but '-' as well as '--' can indicate a long option.
|
||||
If an option that starts with '-' (not '--') doesn't match a long option,
|
||||
but does match a short option, it is parsed as a short option
|
||||
instead. */
|
||||
|
||||
int
|
||||
getopt_long_only (argc, argv, options, long_options, opt_index)
|
||||
int argc;
|
||||
char *const *argv;
|
||||
const char *options;
|
||||
const struct option *long_options;
|
||||
int *opt_index;
|
||||
{
|
||||
return _getopt_internal (argc, argv, options, long_options, opt_index, 1);
|
||||
}
|
||||
|
||||
|
||||
#endif /* _LIBC or not __GNU_LIBRARY__. */
|
||||
|
||||
#ifdef TEST
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
int
|
||||
main (argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
{
|
||||
int c;
|
||||
int digit_optind = 0;
|
||||
|
||||
while (1)
|
||||
{
|
||||
int this_option_optind = optind ? optind : 1;
|
||||
int option_index = 0;
|
||||
static struct option long_options[] =
|
||||
{
|
||||
{"add", 1, 0, 0},
|
||||
{"append", 0, 0, 0},
|
||||
{"delete", 1, 0, 0},
|
||||
{"verbose", 0, 0, 0},
|
||||
{"create", 0, 0, 0},
|
||||
{"file", 1, 0, 0},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
|
||||
c = getopt_long (argc, argv, "abc:d:0123456789",
|
||||
long_options, &option_index);
|
||||
if (c == EOF)
|
||||
break;
|
||||
|
||||
switch (c)
|
||||
{
|
||||
case 0:
|
||||
printf ("option %s", long_options[option_index].name);
|
||||
if (optarg)
|
||||
printf (" with arg %s", optarg);
|
||||
printf ("\n");
|
||||
break;
|
||||
|
||||
case '0':
|
||||
case '1':
|
||||
case '2':
|
||||
case '3':
|
||||
case '4':
|
||||
case '5':
|
||||
case '6':
|
||||
case '7':
|
||||
case '8':
|
||||
case '9':
|
||||
if (digit_optind != 0 && digit_optind != this_option_optind)
|
||||
printf ("digits occur in two different argv-elements.\n");
|
||||
digit_optind = this_option_optind;
|
||||
printf ("option %c\n", c);
|
||||
break;
|
||||
|
||||
case 'a':
|
||||
printf ("option a\n");
|
||||
break;
|
||||
|
||||
case 'b':
|
||||
printf ("option b\n");
|
||||
break;
|
||||
|
||||
case 'c':
|
||||
printf ("option c with value `%s'\n", optarg);
|
||||
break;
|
||||
|
||||
case 'd':
|
||||
printf ("option d with value `%s'\n", optarg);
|
||||
break;
|
||||
|
||||
case '?':
|
||||
break;
|
||||
|
||||
default:
|
||||
printf ("?? getopt returned character code 0%o ??\n", c);
|
||||
}
|
||||
}
|
||||
|
||||
if (optind < argc)
|
||||
{
|
||||
printf ("non-option ARGV-elements: ");
|
||||
while (optind < argc)
|
||||
printf ("%s ", argv[optind++]);
|
||||
printf ("\n");
|
||||
}
|
||||
|
||||
exit (0);
|
||||
}
|
||||
|
||||
#endif /* TEST */
|
35
contrib/cvs/lib/getwd.c
Normal file
35
contrib/cvs/lib/getwd.c
Normal file
@ -0,0 +1,35 @@
|
||||
/* getwd.c -- get current working directory pathname
|
||||
Copyright (C) 1992 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
/* Some systems which include both getwd() and getcwd() have an implementation
|
||||
of getwd() which is much faster than getcwd(). As a result, we use the
|
||||
system's getwd() if it is available */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "system.h"
|
||||
|
||||
/* Get the current working directory into PATHNAME */
|
||||
|
||||
char *
|
||||
getwd (pathname)
|
||||
char *pathname;
|
||||
{
|
||||
return (getcwd(pathname, PATH_MAX));
|
||||
}
|
49
contrib/cvs/lib/hostname.c
Normal file
49
contrib/cvs/lib/hostname.c
Normal file
@ -0,0 +1,49 @@
|
||||
/* hostname.c -- use uname() to get the name of the host
|
||||
Copyright (C) 1992 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#if defined(STDC_HEADERS) || defined(USG)
|
||||
#include <string.h>
|
||||
#ifndef index
|
||||
#define index strchr
|
||||
#endif
|
||||
#else
|
||||
#include <strings.h>
|
||||
#endif
|
||||
|
||||
#include <sys/utsname.h>
|
||||
|
||||
/* Put this host's name into NAME, using at most NAMELEN characters */
|
||||
|
||||
int
|
||||
gethostname(name, namelen)
|
||||
char *name;
|
||||
int namelen;
|
||||
{
|
||||
struct utsname ugnm;
|
||||
|
||||
if (uname(&ugnm) < 0)
|
||||
return (-1);
|
||||
|
||||
(void) strncpy(name, ugnm.nodename, namelen-1);
|
||||
name[namelen-1] = '\0';
|
||||
|
||||
return (0);
|
||||
}
|
277
contrib/cvs/lib/md5.c
Normal file
277
contrib/cvs/lib/md5.c
Normal file
@ -0,0 +1,277 @@
|
||||
/*
|
||||
* This code implements the MD5 message-digest algorithm.
|
||||
* The algorithm is due to Ron Rivest. This code was
|
||||
* written by Colin Plumb in 1993, no copyright is claimed.
|
||||
* This code is in the public domain; do with it what you wish.
|
||||
*
|
||||
* Equivalent code is available from RSA Data Security, Inc.
|
||||
* This code has been tested against that, and is equivalent,
|
||||
* except that you don't need to include two pages of legalese
|
||||
* with every copy.
|
||||
*
|
||||
* To compute the message digest of a chunk of bytes, declare an
|
||||
* MD5Context structure, pass it to MD5Init, call MD5Update as
|
||||
* needed on buffers full of bytes, and then call MD5Final, which
|
||||
* will fill a supplied 16-byte array with the digest.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#if HAVE_STRING_H || STDC_HEADERS
|
||||
#include <string.h> /* for memcpy() */
|
||||
#endif
|
||||
|
||||
/* Add prototype support. */
|
||||
#ifndef PROTO
|
||||
#if defined (USE_PROTOTYPES) ? USE_PROTOTYPES : defined (__STDC__)
|
||||
#define PROTO(ARGS) ARGS
|
||||
#else
|
||||
#define PROTO(ARGS) ()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "md5.h"
|
||||
|
||||
void byteReverse PROTO ((unsigned char *buf, unsigned longs));
|
||||
|
||||
#ifndef ASM_MD5
|
||||
/*
|
||||
* Note: this code is harmless on little-endian machines.
|
||||
*/
|
||||
void byteReverse (buf, longs)
|
||||
unsigned char *buf;
|
||||
unsigned longs;
|
||||
{
|
||||
uint32 t;
|
||||
do {
|
||||
t = (uint32)((unsigned)buf[3]<<8 | buf[2]) << 16 |
|
||||
((unsigned)buf[1]<<8 | buf[0]);
|
||||
*(uint32 *)buf = t;
|
||||
buf += 4;
|
||||
} while (--longs);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Start MD5 accumulation. Set bit count to 0 and buffer to mysterious
|
||||
* initialization constants.
|
||||
*/
|
||||
void
|
||||
MD5Init(ctx)
|
||||
struct MD5Context *ctx;
|
||||
{
|
||||
ctx->buf[0] = 0x67452301;
|
||||
ctx->buf[1] = 0xefcdab89;
|
||||
ctx->buf[2] = 0x98badcfe;
|
||||
ctx->buf[3] = 0x10325476;
|
||||
|
||||
ctx->bits[0] = 0;
|
||||
ctx->bits[1] = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Update context to reflect the concatenation of another buffer full
|
||||
* of bytes.
|
||||
*/
|
||||
void
|
||||
MD5Update(ctx, buf, len)
|
||||
struct MD5Context *ctx;
|
||||
unsigned char const *buf;
|
||||
unsigned len;
|
||||
{
|
||||
uint32 t;
|
||||
|
||||
/* Update bitcount */
|
||||
|
||||
t = ctx->bits[0];
|
||||
if ((ctx->bits[0] = t + ((uint32)len << 3)) < t)
|
||||
ctx->bits[1]++; /* Carry from low to high */
|
||||
ctx->bits[1] += len >> 29;
|
||||
|
||||
t = (t >> 3) & 0x3f; /* Bytes already in shsInfo->data */
|
||||
|
||||
/* Handle any leading odd-sized chunks */
|
||||
|
||||
if ( t ) {
|
||||
unsigned char *p = (unsigned char *)ctx->in + t;
|
||||
|
||||
t = 64-t;
|
||||
if (len < t) {
|
||||
memcpy(p, buf, len);
|
||||
return;
|
||||
}
|
||||
memcpy(p, buf, t);
|
||||
byteReverse(ctx->in, 16);
|
||||
MD5Transform(ctx->buf, (uint32 *)ctx->in);
|
||||
buf += t;
|
||||
len -= t;
|
||||
}
|
||||
|
||||
/* Process data in 64-byte chunks */
|
||||
|
||||
while (len >= 64) {
|
||||
memcpy(ctx->in, buf, 64);
|
||||
byteReverse(ctx->in, 16);
|
||||
MD5Transform(ctx->buf, (uint32 *)ctx->in);
|
||||
buf += 64;
|
||||
len -= 64;
|
||||
}
|
||||
|
||||
/* Handle any remaining bytes of data. */
|
||||
|
||||
memcpy(ctx->in, buf, len);
|
||||
}
|
||||
|
||||
/*
|
||||
* Final wrapup - pad to 64-byte boundary with the bit pattern
|
||||
* 1 0* (64-bit count of bits processed, MSB-first)
|
||||
*/
|
||||
void
|
||||
MD5Final(digest, ctx)
|
||||
unsigned char digest[16];
|
||||
struct MD5Context *ctx;
|
||||
{
|
||||
unsigned count;
|
||||
unsigned char *p;
|
||||
|
||||
/* Compute number of bytes mod 64 */
|
||||
count = (ctx->bits[0] >> 3) & 0x3F;
|
||||
|
||||
/* Set the first char of padding to 0x80. This is safe since there is
|
||||
always at least one byte free */
|
||||
p = ctx->in + count;
|
||||
*p++ = 0x80;
|
||||
|
||||
/* Bytes of padding needed to make 64 bytes */
|
||||
count = 64 - 1 - count;
|
||||
|
||||
/* Pad out to 56 mod 64 */
|
||||
if (count < 8) {
|
||||
/* Two lots of padding: Pad the first block to 64 bytes */
|
||||
memset(p, 0, count);
|
||||
byteReverse(ctx->in, 16);
|
||||
MD5Transform(ctx->buf, (uint32 *)ctx->in);
|
||||
|
||||
/* Now fill the next block with 56 bytes */
|
||||
memset(ctx->in, 0, 56);
|
||||
} else {
|
||||
/* Pad block to 56 bytes */
|
||||
memset(p, 0, count-8);
|
||||
}
|
||||
byteReverse(ctx->in, 14);
|
||||
|
||||
/* Append length in bits and transform */
|
||||
((uint32 *)ctx->in)[ 14 ] = ctx->bits[0];
|
||||
((uint32 *)ctx->in)[ 15 ] = ctx->bits[1];
|
||||
|
||||
MD5Transform(ctx->buf, (uint32 *)ctx->in);
|
||||
byteReverse((unsigned char *)ctx->buf, 4);
|
||||
memcpy(digest, ctx->buf, 16);
|
||||
memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */
|
||||
}
|
||||
|
||||
#ifndef ASM_MD5
|
||||
|
||||
/* The four core functions - F1 is optimized somewhat */
|
||||
|
||||
/* #define F1(x, y, z) (x & y | ~x & z) */
|
||||
#define F1(x, y, z) (z ^ (x & (y ^ z)))
|
||||
#define F2(x, y, z) F1(z, x, y)
|
||||
#define F3(x, y, z) (x ^ y ^ z)
|
||||
#define F4(x, y, z) (y ^ (x | ~z))
|
||||
|
||||
/* This is the central step in the MD5 algorithm. */
|
||||
#define MD5STEP(f, w, x, y, z, data, s) \
|
||||
( w += f(x, y, z) + data, w = w<<s | w>>(32-s), w += x )
|
||||
|
||||
/*
|
||||
* The core of the MD5 algorithm, this alters an existing MD5 hash to
|
||||
* reflect the addition of 16 longwords of new data. MD5Update blocks
|
||||
* the data and converts bytes into longwords for this routine.
|
||||
*/
|
||||
void
|
||||
MD5Transform(buf, in)
|
||||
uint32 buf[4];
|
||||
uint32 const in[16];
|
||||
{
|
||||
register uint32 a, b, c, d;
|
||||
|
||||
a = buf[0];
|
||||
b = buf[1];
|
||||
c = buf[2];
|
||||
d = buf[3];
|
||||
|
||||
MD5STEP(F1, a, b, c, d, in[ 0]+0xd76aa478, 7);
|
||||
MD5STEP(F1, d, a, b, c, in[ 1]+0xe8c7b756, 12);
|
||||
MD5STEP(F1, c, d, a, b, in[ 2]+0x242070db, 17);
|
||||
MD5STEP(F1, b, c, d, a, in[ 3]+0xc1bdceee, 22);
|
||||
MD5STEP(F1, a, b, c, d, in[ 4]+0xf57c0faf, 7);
|
||||
MD5STEP(F1, d, a, b, c, in[ 5]+0x4787c62a, 12);
|
||||
MD5STEP(F1, c, d, a, b, in[ 6]+0xa8304613, 17);
|
||||
MD5STEP(F1, b, c, d, a, in[ 7]+0xfd469501, 22);
|
||||
MD5STEP(F1, a, b, c, d, in[ 8]+0x698098d8, 7);
|
||||
MD5STEP(F1, d, a, b, c, in[ 9]+0x8b44f7af, 12);
|
||||
MD5STEP(F1, c, d, a, b, in[10]+0xffff5bb1, 17);
|
||||
MD5STEP(F1, b, c, d, a, in[11]+0x895cd7be, 22);
|
||||
MD5STEP(F1, a, b, c, d, in[12]+0x6b901122, 7);
|
||||
MD5STEP(F1, d, a, b, c, in[13]+0xfd987193, 12);
|
||||
MD5STEP(F1, c, d, a, b, in[14]+0xa679438e, 17);
|
||||
MD5STEP(F1, b, c, d, a, in[15]+0x49b40821, 22);
|
||||
|
||||
MD5STEP(F2, a, b, c, d, in[ 1]+0xf61e2562, 5);
|
||||
MD5STEP(F2, d, a, b, c, in[ 6]+0xc040b340, 9);
|
||||
MD5STEP(F2, c, d, a, b, in[11]+0x265e5a51, 14);
|
||||
MD5STEP(F2, b, c, d, a, in[ 0]+0xe9b6c7aa, 20);
|
||||
MD5STEP(F2, a, b, c, d, in[ 5]+0xd62f105d, 5);
|
||||
MD5STEP(F2, d, a, b, c, in[10]+0x02441453, 9);
|
||||
MD5STEP(F2, c, d, a, b, in[15]+0xd8a1e681, 14);
|
||||
MD5STEP(F2, b, c, d, a, in[ 4]+0xe7d3fbc8, 20);
|
||||
MD5STEP(F2, a, b, c, d, in[ 9]+0x21e1cde6, 5);
|
||||
MD5STEP(F2, d, a, b, c, in[14]+0xc33707d6, 9);
|
||||
MD5STEP(F2, c, d, a, b, in[ 3]+0xf4d50d87, 14);
|
||||
MD5STEP(F2, b, c, d, a, in[ 8]+0x455a14ed, 20);
|
||||
MD5STEP(F2, a, b, c, d, in[13]+0xa9e3e905, 5);
|
||||
MD5STEP(F2, d, a, b, c, in[ 2]+0xfcefa3f8, 9);
|
||||
MD5STEP(F2, c, d, a, b, in[ 7]+0x676f02d9, 14);
|
||||
MD5STEP(F2, b, c, d, a, in[12]+0x8d2a4c8a, 20);
|
||||
|
||||
MD5STEP(F3, a, b, c, d, in[ 5]+0xfffa3942, 4);
|
||||
MD5STEP(F3, d, a, b, c, in[ 8]+0x8771f681, 11);
|
||||
MD5STEP(F3, c, d, a, b, in[11]+0x6d9d6122, 16);
|
||||
MD5STEP(F3, b, c, d, a, in[14]+0xfde5380c, 23);
|
||||
MD5STEP(F3, a, b, c, d, in[ 1]+0xa4beea44, 4);
|
||||
MD5STEP(F3, d, a, b, c, in[ 4]+0x4bdecfa9, 11);
|
||||
MD5STEP(F3, c, d, a, b, in[ 7]+0xf6bb4b60, 16);
|
||||
MD5STEP(F3, b, c, d, a, in[10]+0xbebfbc70, 23);
|
||||
MD5STEP(F3, a, b, c, d, in[13]+0x289b7ec6, 4);
|
||||
MD5STEP(F3, d, a, b, c, in[ 0]+0xeaa127fa, 11);
|
||||
MD5STEP(F3, c, d, a, b, in[ 3]+0xd4ef3085, 16);
|
||||
MD5STEP(F3, b, c, d, a, in[ 6]+0x04881d05, 23);
|
||||
MD5STEP(F3, a, b, c, d, in[ 9]+0xd9d4d039, 4);
|
||||
MD5STEP(F3, d, a, b, c, in[12]+0xe6db99e5, 11);
|
||||
MD5STEP(F3, c, d, a, b, in[15]+0x1fa27cf8, 16);
|
||||
MD5STEP(F3, b, c, d, a, in[ 2]+0xc4ac5665, 23);
|
||||
|
||||
MD5STEP(F4, a, b, c, d, in[ 0]+0xf4292244, 6);
|
||||
MD5STEP(F4, d, a, b, c, in[ 7]+0x432aff97, 10);
|
||||
MD5STEP(F4, c, d, a, b, in[14]+0xab9423a7, 15);
|
||||
MD5STEP(F4, b, c, d, a, in[ 5]+0xfc93a039, 21);
|
||||
MD5STEP(F4, a, b, c, d, in[12]+0x655b59c3, 6);
|
||||
MD5STEP(F4, d, a, b, c, in[ 3]+0x8f0ccc92, 10);
|
||||
MD5STEP(F4, c, d, a, b, in[10]+0xffeff47d, 15);
|
||||
MD5STEP(F4, b, c, d, a, in[ 1]+0x85845dd1, 21);
|
||||
MD5STEP(F4, a, b, c, d, in[ 8]+0x6fa87e4f, 6);
|
||||
MD5STEP(F4, d, a, b, c, in[15]+0xfe2ce6e0, 10);
|
||||
MD5STEP(F4, c, d, a, b, in[ 6]+0xa3014314, 15);
|
||||
MD5STEP(F4, b, c, d, a, in[13]+0x4e0811a1, 21);
|
||||
MD5STEP(F4, a, b, c, d, in[ 4]+0xf7537e82, 6);
|
||||
MD5STEP(F4, d, a, b, c, in[11]+0xbd3af235, 10);
|
||||
MD5STEP(F4, c, d, a, b, in[ 2]+0x2ad7d2bb, 15);
|
||||
MD5STEP(F4, b, c, d, a, in[ 9]+0xeb86d391, 21);
|
||||
|
||||
buf[0] += a;
|
||||
buf[1] += b;
|
||||
buf[2] += c;
|
||||
buf[3] += d;
|
||||
}
|
||||
#endif
|
31
contrib/cvs/lib/md5.h
Normal file
31
contrib/cvs/lib/md5.h
Normal file
@ -0,0 +1,31 @@
|
||||
#ifndef MD5_H
|
||||
#define MD5_H
|
||||
|
||||
#if SIZEOF_LONG == 4
|
||||
typedef unsigned long uint32;
|
||||
#else
|
||||
#if SIZEOF_INT == 4
|
||||
typedef unsigned int uint32;
|
||||
#else
|
||||
Congratulations! You get to rewrite this code so that it does not require
|
||||
a 32-bit integer type! (Or maybe you just need to reconfigure.)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
struct MD5Context {
|
||||
uint32 buf[4];
|
||||
uint32 bits[2];
|
||||
unsigned char in[64];
|
||||
};
|
||||
|
||||
void MD5Init PROTO((struct MD5Context *context));
|
||||
void MD5Update PROTO((struct MD5Context *context, unsigned char const *buf, unsigned len));
|
||||
void MD5Final PROTO((unsigned char digest[16], struct MD5Context *context));
|
||||
void MD5Transform PROTO((uint32 buf[4], uint32 const in[16]));
|
||||
|
||||
/*
|
||||
* This is needed to make RSAREF happy on some MS-DOS compilers.
|
||||
*/
|
||||
typedef struct MD5Context MD5_CTX;
|
||||
|
||||
#endif /* !MD5_H */
|
57
contrib/cvs/lib/memmove.c
Normal file
57
contrib/cvs/lib/memmove.c
Normal file
@ -0,0 +1,57 @@
|
||||
/* memmove -- copy memory regions of arbitary length
|
||||
Copyright (C) 1991 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the libiberty library.
|
||||
Libiberty is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
Libiberty is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with libiberty; see the file COPYING.LIB. If
|
||||
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
|
||||
|
||||
/*
|
||||
|
||||
NAME
|
||||
|
||||
memmove -- copy memory regions of arbitary length
|
||||
|
||||
SYNOPSIS
|
||||
|
||||
void memmove (void *out, const void *in, size_t n);
|
||||
|
||||
DESCRIPTION
|
||||
|
||||
Copy LENGTH bytes from memory region pointed to by IN to memory
|
||||
region pointed to by OUT.
|
||||
|
||||
Regions can be overlapping.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#ifdef __STDC__
|
||||
#include <stddef.h>
|
||||
#else
|
||||
#define size_t unsigned long
|
||||
#endif
|
||||
|
||||
void *
|
||||
memmove (out, in, length)
|
||||
void *out;
|
||||
const void* in;
|
||||
size_t length;
|
||||
{
|
||||
bcopy(in, out, length);
|
||||
return out;
|
||||
}
|
129
contrib/cvs/lib/mkdir.c
Normal file
129
contrib/cvs/lib/mkdir.c
Normal file
@ -0,0 +1,129 @@
|
||||
/* mkrmdir.c -- BSD compatible directory functions for System V
|
||||
Copyright (C) 1988, 1990 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
#ifndef STDC_HEADERS
|
||||
extern int errno;
|
||||
#endif
|
||||
|
||||
/* mkdir and rmdir adapted from GNU tar. */
|
||||
|
||||
/* Make directory DPATH, with permission mode DMODE.
|
||||
|
||||
Written by Robert Rother, Mariah Corporation, August 1985
|
||||
(sdcsvax!rmr or rmr@uscd). If you want it, it's yours.
|
||||
|
||||
Severely hacked over by John Gilmore to make a 4.2BSD compatible
|
||||
subroutine. 11Mar86; hoptoad!gnu
|
||||
|
||||
Modified by rmtodd@uokmax 6-28-87 -- when making an already existing dir,
|
||||
subroutine didn't return EEXIST. It does now. */
|
||||
|
||||
int
|
||||
mkdir (dpath, dmode)
|
||||
char *dpath;
|
||||
int dmode;
|
||||
{
|
||||
int cpid, status;
|
||||
struct stat statbuf;
|
||||
|
||||
if (stat (dpath, &statbuf) == 0)
|
||||
{
|
||||
errno = EEXIST; /* stat worked, so it already exists. */
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* If stat fails for a reason other than non-existence, return error. */
|
||||
if (! existence_error (errno))
|
||||
return -1;
|
||||
|
||||
cpid = fork ();
|
||||
switch (cpid)
|
||||
{
|
||||
case -1: /* Cannot fork. */
|
||||
return -1; /* errno is set already. */
|
||||
|
||||
case 0: /* Child process. */
|
||||
/* Cheap hack to set mode of new directory. Since this child
|
||||
process is going away anyway, we zap its umask.
|
||||
This won't suffice to set SUID, SGID, etc. on this
|
||||
directory, so the parent process calls chmod afterward. */
|
||||
status = umask (0); /* Get current umask. */
|
||||
umask (status | (0777 & ~dmode)); /* Set for mkdir. */
|
||||
execl ("/bin/mkdir", "mkdir", dpath, (char *) 0);
|
||||
_exit (1);
|
||||
|
||||
default: /* Parent process. */
|
||||
while (wait (&status) != cpid) /* Wait for kid to finish. */
|
||||
/* Do nothing. */ ;
|
||||
|
||||
if (status & 0xFFFF)
|
||||
{
|
||||
errno = EIO; /* /bin/mkdir failed. */
|
||||
return -1;
|
||||
}
|
||||
return chmod (dpath, dmode);
|
||||
}
|
||||
}
|
||||
|
||||
/* Remove directory DPATH.
|
||||
Return 0 if successful, -1 if not. */
|
||||
|
||||
int
|
||||
rmdir (dpath)
|
||||
char *dpath;
|
||||
{
|
||||
int cpid, status;
|
||||
struct stat statbuf;
|
||||
|
||||
if (stat (dpath, &statbuf) != 0)
|
||||
return -1; /* stat set errno. */
|
||||
|
||||
if ((statbuf.st_mode & S_IFMT) != S_IFDIR)
|
||||
{
|
||||
errno = ENOTDIR;
|
||||
return -1;
|
||||
}
|
||||
|
||||
cpid = fork ();
|
||||
switch (cpid)
|
||||
{
|
||||
case -1: /* Cannot fork. */
|
||||
return -1; /* errno is set already. */
|
||||
|
||||
case 0: /* Child process. */
|
||||
execl ("/bin/rmdir", "rmdir", dpath, (char *) 0);
|
||||
_exit (1);
|
||||
|
||||
default: /* Parent process. */
|
||||
while (wait (&status) != cpid) /* Wait for kid to finish. */
|
||||
/* Do nothing. */ ;
|
||||
|
||||
if (status & 0xFFFF)
|
||||
{
|
||||
errno = EIO; /* /bin/rmdir failed. */
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
4952
contrib/cvs/lib/regex.c
Normal file
4952
contrib/cvs/lib/regex.c
Normal file
File diff suppressed because it is too large
Load Diff
490
contrib/cvs/lib/regex.h
Normal file
490
contrib/cvs/lib/regex.h
Normal file
@ -0,0 +1,490 @@
|
||||
/* Definitions for data structures and routines for the regular
|
||||
expression library, version 0.12.
|
||||
|
||||
Copyright (C) 1985, 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#ifndef __REGEXP_LIBRARY_H__
|
||||
#define __REGEXP_LIBRARY_H__
|
||||
|
||||
/* POSIX says that <sys/types.h> must be included (by the caller) before
|
||||
<regex.h>. */
|
||||
|
||||
#ifdef VMS
|
||||
/* VMS doesn't have `size_t' in <sys/types.h>, even though POSIX says it
|
||||
should be there. */
|
||||
#include <stddef.h>
|
||||
#endif
|
||||
|
||||
|
||||
/* The following bits are used to determine the regexp syntax we
|
||||
recognize. The set/not-set meanings are chosen so that Emacs syntax
|
||||
remains the value 0. The bits are given in alphabetical order, and
|
||||
the definitions shifted by one from the previous bit; thus, when we
|
||||
add or remove a bit, only one other definition need change. */
|
||||
typedef unsigned reg_syntax_t;
|
||||
|
||||
/* If this bit is not set, then \ inside a bracket expression is literal.
|
||||
If set, then such a \ quotes the following character. */
|
||||
#define RE_BACKSLASH_ESCAPE_IN_LISTS (1)
|
||||
|
||||
/* If this bit is not set, then + and ? are operators, and \+ and \? are
|
||||
literals.
|
||||
If set, then \+ and \? are operators and + and ? are literals. */
|
||||
#define RE_BK_PLUS_QM (RE_BACKSLASH_ESCAPE_IN_LISTS << 1)
|
||||
|
||||
/* If this bit is set, then character classes are supported. They are:
|
||||
[:alpha:], [:upper:], [:lower:], [:digit:], [:alnum:], [:xdigit:],
|
||||
[:space:], [:print:], [:punct:], [:graph:], and [:cntrl:].
|
||||
If not set, then character classes are not supported. */
|
||||
#define RE_CHAR_CLASSES (RE_BK_PLUS_QM << 1)
|
||||
|
||||
/* If this bit is set, then ^ and $ are always anchors (outside bracket
|
||||
expressions, of course).
|
||||
If this bit is not set, then it depends:
|
||||
^ is an anchor if it is at the beginning of a regular
|
||||
expression or after an open-group or an alternation operator;
|
||||
$ is an anchor if it is at the end of a regular expression, or
|
||||
before a close-group or an alternation operator.
|
||||
|
||||
This bit could be (re)combined with RE_CONTEXT_INDEP_OPS, because
|
||||
POSIX draft 11.2 says that * etc. in leading positions is undefined.
|
||||
We already implemented a previous draft which made those constructs
|
||||
invalid, though, so we haven't changed the code back. */
|
||||
#define RE_CONTEXT_INDEP_ANCHORS (RE_CHAR_CLASSES << 1)
|
||||
|
||||
/* If this bit is set, then special characters are always special
|
||||
regardless of where they are in the pattern.
|
||||
If this bit is not set, then special characters are special only in
|
||||
some contexts; otherwise they are ordinary. Specifically,
|
||||
* + ? and intervals are only special when not after the beginning,
|
||||
open-group, or alternation operator. */
|
||||
#define RE_CONTEXT_INDEP_OPS (RE_CONTEXT_INDEP_ANCHORS << 1)
|
||||
|
||||
/* If this bit is set, then *, +, ?, and { cannot be first in an re or
|
||||
immediately after an alternation or begin-group operator. */
|
||||
#define RE_CONTEXT_INVALID_OPS (RE_CONTEXT_INDEP_OPS << 1)
|
||||
|
||||
/* If this bit is set, then . matches newline.
|
||||
If not set, then it doesn't. */
|
||||
#define RE_DOT_NEWLINE (RE_CONTEXT_INVALID_OPS << 1)
|
||||
|
||||
/* If this bit is set, then . doesn't match NUL.
|
||||
If not set, then it does. */
|
||||
#define RE_DOT_NOT_NULL (RE_DOT_NEWLINE << 1)
|
||||
|
||||
/* If this bit is set, nonmatching lists [^...] do not match newline.
|
||||
If not set, they do. */
|
||||
#define RE_HAT_LISTS_NOT_NEWLINE (RE_DOT_NOT_NULL << 1)
|
||||
|
||||
/* If this bit is set, either \{...\} or {...} defines an
|
||||
interval, depending on RE_NO_BK_BRACES.
|
||||
If not set, \{, \}, {, and } are literals. */
|
||||
#define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1)
|
||||
|
||||
/* If this bit is set, +, ? and | aren't recognized as operators.
|
||||
If not set, they are. */
|
||||
#define RE_LIMITED_OPS (RE_INTERVALS << 1)
|
||||
|
||||
/* If this bit is set, newline is an alternation operator.
|
||||
If not set, newline is literal. */
|
||||
#define RE_NEWLINE_ALT (RE_LIMITED_OPS << 1)
|
||||
|
||||
/* If this bit is set, then `{...}' defines an interval, and \{ and \}
|
||||
are literals.
|
||||
If not set, then `\{...\}' defines an interval. */
|
||||
#define RE_NO_BK_BRACES (RE_NEWLINE_ALT << 1)
|
||||
|
||||
/* If this bit is set, (...) defines a group, and \( and \) are literals.
|
||||
If not set, \(...\) defines a group, and ( and ) are literals. */
|
||||
#define RE_NO_BK_PARENS (RE_NO_BK_BRACES << 1)
|
||||
|
||||
/* If this bit is set, then \<digit> matches <digit>.
|
||||
If not set, then \<digit> is a back-reference. */
|
||||
#define RE_NO_BK_REFS (RE_NO_BK_PARENS << 1)
|
||||
|
||||
/* If this bit is set, then | is an alternation operator, and \| is literal.
|
||||
If not set, then \| is an alternation operator, and | is literal. */
|
||||
#define RE_NO_BK_VBAR (RE_NO_BK_REFS << 1)
|
||||
|
||||
/* If this bit is set, then an ending range point collating higher
|
||||
than the starting range point, as in [z-a], is invalid.
|
||||
If not set, then when ending range point collates higher than the
|
||||
starting range point, the range is ignored. */
|
||||
#define RE_NO_EMPTY_RANGES (RE_NO_BK_VBAR << 1)
|
||||
|
||||
/* If this bit is set, then an unmatched ) is ordinary.
|
||||
If not set, then an unmatched ) is invalid. */
|
||||
#define RE_UNMATCHED_RIGHT_PAREN_ORD (RE_NO_EMPTY_RANGES << 1)
|
||||
|
||||
/* This global variable defines the particular regexp syntax to use (for
|
||||
some interfaces). When a regexp is compiled, the syntax used is
|
||||
stored in the pattern buffer, so changing this does not affect
|
||||
already-compiled regexps. */
|
||||
extern reg_syntax_t re_syntax_options;
|
||||
|
||||
/* Define combinations of the above bits for the standard possibilities.
|
||||
(The [[[ comments delimit what gets put into the Texinfo file, so
|
||||
don't delete them!) */
|
||||
/* [[[begin syntaxes]]] */
|
||||
#define RE_SYNTAX_EMACS 0
|
||||
|
||||
#define RE_SYNTAX_AWK \
|
||||
(RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DOT_NOT_NULL \
|
||||
| RE_NO_BK_PARENS | RE_NO_BK_REFS \
|
||||
| RE_NO_BK_VBAR | RE_NO_EMPTY_RANGES \
|
||||
| RE_UNMATCHED_RIGHT_PAREN_ORD)
|
||||
|
||||
#define RE_SYNTAX_POSIX_AWK \
|
||||
(RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS)
|
||||
|
||||
#define RE_SYNTAX_GREP \
|
||||
(RE_BK_PLUS_QM | RE_CHAR_CLASSES \
|
||||
| RE_HAT_LISTS_NOT_NEWLINE | RE_INTERVALS \
|
||||
| RE_NEWLINE_ALT)
|
||||
|
||||
#define RE_SYNTAX_EGREP \
|
||||
(RE_CHAR_CLASSES | RE_CONTEXT_INDEP_ANCHORS \
|
||||
| RE_CONTEXT_INDEP_OPS | RE_HAT_LISTS_NOT_NEWLINE \
|
||||
| RE_NEWLINE_ALT | RE_NO_BK_PARENS \
|
||||
| RE_NO_BK_VBAR)
|
||||
|
||||
#define RE_SYNTAX_POSIX_EGREP \
|
||||
(RE_SYNTAX_EGREP | RE_INTERVALS | RE_NO_BK_BRACES)
|
||||
|
||||
/* P1003.2/D11.2, section 4.20.7.1, lines 5078ff. */
|
||||
#define RE_SYNTAX_ED RE_SYNTAX_POSIX_BASIC
|
||||
|
||||
#define RE_SYNTAX_SED RE_SYNTAX_POSIX_BASIC
|
||||
|
||||
/* Syntax bits common to both basic and extended POSIX regex syntax. */
|
||||
#define _RE_SYNTAX_POSIX_COMMON \
|
||||
(RE_CHAR_CLASSES | RE_DOT_NEWLINE | RE_DOT_NOT_NULL \
|
||||
| RE_INTERVALS | RE_NO_EMPTY_RANGES)
|
||||
|
||||
#define RE_SYNTAX_POSIX_BASIC \
|
||||
(_RE_SYNTAX_POSIX_COMMON | RE_BK_PLUS_QM)
|
||||
|
||||
/* Differs from ..._POSIX_BASIC only in that RE_BK_PLUS_QM becomes
|
||||
RE_LIMITED_OPS, i.e., \? \+ \| are not recognized. Actually, this
|
||||
isn't minimal, since other operators, such as \`, aren't disabled. */
|
||||
#define RE_SYNTAX_POSIX_MINIMAL_BASIC \
|
||||
(_RE_SYNTAX_POSIX_COMMON | RE_LIMITED_OPS)
|
||||
|
||||
#define RE_SYNTAX_POSIX_EXTENDED \
|
||||
(_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
|
||||
| RE_CONTEXT_INDEP_OPS | RE_NO_BK_BRACES \
|
||||
| RE_NO_BK_PARENS | RE_NO_BK_VBAR \
|
||||
| RE_UNMATCHED_RIGHT_PAREN_ORD)
|
||||
|
||||
/* Differs from ..._POSIX_EXTENDED in that RE_CONTEXT_INVALID_OPS
|
||||
replaces RE_CONTEXT_INDEP_OPS and RE_NO_BK_REFS is added. */
|
||||
#define RE_SYNTAX_POSIX_MINIMAL_EXTENDED \
|
||||
(_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
|
||||
| RE_CONTEXT_INVALID_OPS | RE_NO_BK_BRACES \
|
||||
| RE_NO_BK_PARENS | RE_NO_BK_REFS \
|
||||
| RE_NO_BK_VBAR | RE_UNMATCHED_RIGHT_PAREN_ORD)
|
||||
/* [[[end syntaxes]]] */
|
||||
|
||||
/* Maximum number of duplicates an interval can allow. Some systems
|
||||
(erroneously) define this in other header files, but we want our
|
||||
value, so remove any previous define. */
|
||||
#ifdef RE_DUP_MAX
|
||||
#undef RE_DUP_MAX
|
||||
#endif
|
||||
#define RE_DUP_MAX ((1 << 15) - 1)
|
||||
|
||||
|
||||
/* POSIX `cflags' bits (i.e., information for `regcomp'). */
|
||||
|
||||
/* If this bit is set, then use extended regular expression syntax.
|
||||
If not set, then use basic regular expression syntax. */
|
||||
#define REG_EXTENDED 1
|
||||
|
||||
/* If this bit is set, then ignore case when matching.
|
||||
If not set, then case is significant. */
|
||||
#define REG_ICASE (REG_EXTENDED << 1)
|
||||
|
||||
/* If this bit is set, then anchors do not match at newline
|
||||
characters in the string.
|
||||
If not set, then anchors do match at newlines. */
|
||||
#define REG_NEWLINE (REG_ICASE << 1)
|
||||
|
||||
/* If this bit is set, then report only success or fail in regexec.
|
||||
If not set, then returns differ between not matching and errors. */
|
||||
#define REG_NOSUB (REG_NEWLINE << 1)
|
||||
|
||||
|
||||
/* POSIX `eflags' bits (i.e., information for regexec). */
|
||||
|
||||
/* If this bit is set, then the beginning-of-line operator doesn't match
|
||||
the beginning of the string (presumably because it's not the
|
||||
beginning of a line).
|
||||
If not set, then the beginning-of-line operator does match the
|
||||
beginning of the string. */
|
||||
#define REG_NOTBOL 1
|
||||
|
||||
/* Like REG_NOTBOL, except for the end-of-line. */
|
||||
#define REG_NOTEOL (1 << 1)
|
||||
|
||||
|
||||
/* If any error codes are removed, changed, or added, update the
|
||||
`re_error_msg' table in regex.c. */
|
||||
typedef enum
|
||||
{
|
||||
REG_NOERROR = 0, /* Success. */
|
||||
REG_NOMATCH, /* Didn't find a match (for regexec). */
|
||||
|
||||
/* POSIX regcomp return error codes. (In the order listed in the
|
||||
standard.) */
|
||||
REG_BADPAT, /* Invalid pattern. */
|
||||
REG_ECOLLATE, /* Not implemented. */
|
||||
REG_ECTYPE, /* Invalid character class name. */
|
||||
REG_EESCAPE, /* Trailing backslash. */
|
||||
REG_ESUBREG, /* Invalid back reference. */
|
||||
REG_EBRACK, /* Unmatched left bracket. */
|
||||
REG_EPAREN, /* Parenthesis imbalance. */
|
||||
REG_EBRACE, /* Unmatched \{. */
|
||||
REG_BADBR, /* Invalid contents of \{\}. */
|
||||
REG_ERANGE, /* Invalid range end. */
|
||||
REG_ESPACE, /* Ran out of memory. */
|
||||
REG_BADRPT, /* No preceding re for repetition op. */
|
||||
|
||||
/* Error codes we've added. */
|
||||
REG_EEND, /* Premature end. */
|
||||
REG_ESIZE, /* Compiled pattern bigger than 2^16 bytes. */
|
||||
REG_ERPAREN /* Unmatched ) or \); not returned from regcomp. */
|
||||
} reg_errcode_t;
|
||||
|
||||
/* This data structure represents a compiled pattern. Before calling
|
||||
the pattern compiler, the fields `buffer', `allocated', `fastmap',
|
||||
`translate', and `no_sub' can be set. After the pattern has been
|
||||
compiled, the `re_nsub' field is available. All other fields are
|
||||
private to the regex routines. */
|
||||
|
||||
struct re_pattern_buffer
|
||||
{
|
||||
/* [[[begin pattern_buffer]]] */
|
||||
/* Space that holds the compiled pattern. It is declared as
|
||||
`unsigned char *' because its elements are
|
||||
sometimes used as array indexes. */
|
||||
unsigned char *buffer;
|
||||
|
||||
/* Number of bytes to which `buffer' points. */
|
||||
unsigned long allocated;
|
||||
|
||||
/* Number of bytes actually used in `buffer'. */
|
||||
unsigned long used;
|
||||
|
||||
/* Syntax setting with which the pattern was compiled. */
|
||||
reg_syntax_t syntax;
|
||||
|
||||
/* Pointer to a fastmap, if any, otherwise zero. re_search uses
|
||||
the fastmap, if there is one, to skip over impossible
|
||||
starting points for matches. */
|
||||
char *fastmap;
|
||||
|
||||
/* Either a translate table to apply to all characters before
|
||||
comparing them, or zero for no translation. The translation
|
||||
is applied to a pattern when it is compiled and to a string
|
||||
when it is matched. */
|
||||
char *translate;
|
||||
|
||||
/* Number of subexpressions found by the compiler. */
|
||||
size_t re_nsub;
|
||||
|
||||
/* Zero if this pattern cannot match the empty string, one else.
|
||||
Well, in truth it's used only in `re_search_2', to see
|
||||
whether or not we should use the fastmap, so we don't set
|
||||
this absolutely perfectly; see `re_compile_fastmap' (the
|
||||
`duplicate' case). */
|
||||
unsigned can_be_null : 1;
|
||||
|
||||
/* If REGS_UNALLOCATED, allocate space in the `regs' structure
|
||||
for `max (RE_NREGS, re_nsub + 1)' groups.
|
||||
If REGS_REALLOCATE, reallocate space if necessary.
|
||||
If REGS_FIXED, use what's there. */
|
||||
#define REGS_UNALLOCATED 0
|
||||
#define REGS_REALLOCATE 1
|
||||
#define REGS_FIXED 2
|
||||
unsigned regs_allocated : 2;
|
||||
|
||||
/* Set to zero when `regex_compile' compiles a pattern; set to one
|
||||
by `re_compile_fastmap' if it updates the fastmap. */
|
||||
unsigned fastmap_accurate : 1;
|
||||
|
||||
/* If set, `re_match_2' does not return information about
|
||||
subexpressions. */
|
||||
unsigned no_sub : 1;
|
||||
|
||||
/* If set, a beginning-of-line anchor doesn't match at the
|
||||
beginning of the string. */
|
||||
unsigned not_bol : 1;
|
||||
|
||||
/* Similarly for an end-of-line anchor. */
|
||||
unsigned not_eol : 1;
|
||||
|
||||
/* If true, an anchor at a newline matches. */
|
||||
unsigned newline_anchor : 1;
|
||||
|
||||
/* [[[end pattern_buffer]]] */
|
||||
};
|
||||
|
||||
typedef struct re_pattern_buffer regex_t;
|
||||
|
||||
|
||||
/* search.c (search_buffer) in Emacs needs this one opcode value. It is
|
||||
defined both in `regex.c' and here. */
|
||||
#define RE_EXACTN_VALUE 1
|
||||
|
||||
/* Type for byte offsets within the string. POSIX mandates this. */
|
||||
typedef int regoff_t;
|
||||
|
||||
|
||||
/* This is the structure we store register match data in. See
|
||||
regex.texinfo for a full description of what registers match. */
|
||||
struct re_registers
|
||||
{
|
||||
unsigned num_regs;
|
||||
regoff_t *start;
|
||||
regoff_t *end;
|
||||
};
|
||||
|
||||
|
||||
/* If `regs_allocated' is REGS_UNALLOCATED in the pattern buffer,
|
||||
`re_match_2' returns information about at least this many registers
|
||||
the first time a `regs' structure is passed. */
|
||||
#ifndef RE_NREGS
|
||||
#define RE_NREGS 30
|
||||
#endif
|
||||
|
||||
|
||||
/* POSIX specification for registers. Aside from the different names than
|
||||
`re_registers', POSIX uses an array of structures, instead of a
|
||||
structure of arrays. */
|
||||
typedef struct
|
||||
{
|
||||
regoff_t rm_so; /* Byte offset from string's start to substring's start. */
|
||||
regoff_t rm_eo; /* Byte offset from string's start to substring's end. */
|
||||
} regmatch_t;
|
||||
|
||||
/* Declarations for routines. */
|
||||
|
||||
/* To avoid duplicating every routine declaration -- once with a
|
||||
prototype (if we are ANSI), and once without (if we aren't) -- we
|
||||
use the following macro to declare argument types. This
|
||||
unfortunately clutters up the declarations a bit, but I think it's
|
||||
worth it. */
|
||||
|
||||
#if __STDC__
|
||||
|
||||
#define _RE_ARGS(args) args
|
||||
|
||||
#else /* not __STDC__ */
|
||||
|
||||
#define _RE_ARGS(args) ()
|
||||
|
||||
#endif /* not __STDC__ */
|
||||
|
||||
/* Sets the current default syntax to SYNTAX, and return the old syntax.
|
||||
You can also simply assign to the `re_syntax_options' variable. */
|
||||
extern reg_syntax_t re_set_syntax _RE_ARGS ((reg_syntax_t syntax));
|
||||
|
||||
/* Compile the regular expression PATTERN, with length LENGTH
|
||||
and syntax given by the global `re_syntax_options', into the buffer
|
||||
BUFFER. Return NULL if successful, and an error string if not. */
|
||||
extern const char *re_compile_pattern
|
||||
_RE_ARGS ((const char *pattern, int length,
|
||||
struct re_pattern_buffer *buffer));
|
||||
|
||||
|
||||
/* Compile a fastmap for the compiled pattern in BUFFER; used to
|
||||
accelerate searches. Return 0 if successful and -2 if was an
|
||||
internal error. */
|
||||
extern int re_compile_fastmap _RE_ARGS ((struct re_pattern_buffer *buffer));
|
||||
|
||||
|
||||
/* Search in the string STRING (with length LENGTH) for the pattern
|
||||
compiled into BUFFER. Start searching at position START, for RANGE
|
||||
characters. Return the starting position of the match, -1 for no
|
||||
match, or -2 for an internal error. Also return register
|
||||
information in REGS (if REGS and BUFFER->no_sub are nonzero). */
|
||||
extern int re_search
|
||||
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string,
|
||||
int length, int start, int range, struct re_registers *regs));
|
||||
|
||||
|
||||
/* Like `re_search', but search in the concatenation of STRING1 and
|
||||
STRING2. Also, stop searching at index START + STOP. */
|
||||
extern int re_search_2
|
||||
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,
|
||||
int length1, const char *string2, int length2,
|
||||
int start, int range, struct re_registers *regs, int stop));
|
||||
|
||||
|
||||
/* Like `re_search', but return how many characters in STRING the regexp
|
||||
in BUFFER matched, starting at position START. */
|
||||
extern int re_match
|
||||
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string,
|
||||
int length, int start, struct re_registers *regs));
|
||||
|
||||
|
||||
/* Relates to `re_match' as `re_search_2' relates to `re_search'. */
|
||||
extern int re_match_2
|
||||
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,
|
||||
int length1, const char *string2, int length2,
|
||||
int start, struct re_registers *regs, int stop));
|
||||
|
||||
|
||||
/* Set REGS to hold NUM_REGS registers, storing them in STARTS and
|
||||
ENDS. Subsequent matches using BUFFER and REGS will use this memory
|
||||
for recording register information. STARTS and ENDS must be
|
||||
allocated with malloc, and must each be at least `NUM_REGS * sizeof
|
||||
(regoff_t)' bytes long.
|
||||
|
||||
If NUM_REGS == 0, then subsequent matches should allocate their own
|
||||
register data.
|
||||
|
||||
Unless this function is called, the first search or match using
|
||||
PATTERN_BUFFER will allocate its own register data, without
|
||||
freeing the old data. */
|
||||
extern void re_set_registers
|
||||
_RE_ARGS ((struct re_pattern_buffer *buffer, struct re_registers *regs,
|
||||
unsigned num_regs, regoff_t *starts, regoff_t *ends));
|
||||
|
||||
/* 4.2 bsd compatibility. */
|
||||
extern char *re_comp _RE_ARGS ((const char *));
|
||||
extern int re_exec _RE_ARGS ((const char *));
|
||||
|
||||
/* POSIX compatibility. */
|
||||
extern int regcomp _RE_ARGS ((regex_t *preg, const char *pattern, int cflags));
|
||||
extern int regexec
|
||||
_RE_ARGS ((const regex_t *preg, const char *string, size_t nmatch,
|
||||
regmatch_t pmatch[], int eflags));
|
||||
extern size_t regerror
|
||||
_RE_ARGS ((int errcode, const regex_t *preg, char *errbuf,
|
||||
size_t errbuf_size));
|
||||
extern void regfree _RE_ARGS ((regex_t *preg));
|
||||
|
||||
#endif /* not __REGEXP_LIBRARY_H__ */
|
||||
|
||||
/*
|
||||
Local variables:
|
||||
make-backup-files: t
|
||||
version-control: t
|
||||
trim-versions-without-asking: nil
|
||||
End:
|
||||
*/
|
84
contrib/cvs/lib/rename.c
Normal file
84
contrib/cvs/lib/rename.c
Normal file
@ -0,0 +1,84 @@
|
||||
/* rename.c -- BSD compatible directory function for System V
|
||||
Copyright (C) 1988, 1990 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
#ifndef STDC_HEADERS
|
||||
extern int errno;
|
||||
#endif
|
||||
|
||||
/* Rename file FROM to file TO.
|
||||
Return 0 if successful, -1 if not. */
|
||||
|
||||
int
|
||||
rename (from, to)
|
||||
char *from;
|
||||
char *to;
|
||||
{
|
||||
struct stat from_stats;
|
||||
int pid, status;
|
||||
|
||||
if (stat (from, &from_stats) == 0)
|
||||
{
|
||||
/* We don't check existence_error because the systems which need it
|
||||
have rename(). */
|
||||
if (unlink (to) && errno != ENOENT)
|
||||
return -1;
|
||||
if ((from_stats.st_mode & S_IFMT) == S_IFDIR)
|
||||
{
|
||||
#ifdef MVDIR
|
||||
/* I don't think MVDIR ever gets defined, but I don't think
|
||||
it matters, because I don't think CVS ever calls rename()
|
||||
on directories. */
|
||||
|
||||
/* Need a setuid root process to link and unlink directories. */
|
||||
pid = fork ();
|
||||
switch (pid)
|
||||
{
|
||||
case -1: /* Error. */
|
||||
error (1, errno, "cannot fork");
|
||||
|
||||
case 0: /* Child. */
|
||||
execl (MVDIR, "mvdir", from, to, (char *) 0);
|
||||
error (255, errno, "cannot run `%s'", MVDIR);
|
||||
|
||||
default: /* Parent. */
|
||||
while (wait (&status) != pid)
|
||||
/* Do nothing. */ ;
|
||||
|
||||
errno = 0; /* mvdir printed the system error message. */
|
||||
return status != 0 ? -1 : 0;
|
||||
}
|
||||
#else /* no MVDIR */
|
||||
error (1, 0, "internal error: cannot move directories");
|
||||
#endif /* no MVDIR */
|
||||
}
|
||||
else
|
||||
{
|
||||
/* We don't check existence_error because the systems which need it
|
||||
have rename(). */
|
||||
if (link (from, to) == 0 && (unlink (from) == 0 || errno == ENOENT))
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
141
contrib/cvs/lib/savecwd.c
Normal file
141
contrib/cvs/lib/savecwd.c
Normal file
@ -0,0 +1,141 @@
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef STDC_HEADERS
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_FCNTL_H
|
||||
# include <fcntl.h>
|
||||
#else
|
||||
# include <sys/file.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_DIRECT_H
|
||||
# include <direct.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_IO_H
|
||||
# include <io.h>
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
# ifndef errno
|
||||
extern int errno;
|
||||
#endif
|
||||
|
||||
#include "savecwd.h"
|
||||
#include "error.h"
|
||||
|
||||
char *xgetwd __PROTO((void));
|
||||
|
||||
/* Record the location of the current working directory in CWD so that
|
||||
the program may change to other directories and later use restore_cwd
|
||||
to return to the recorded location. This function may allocate
|
||||
space using malloc (via xgetwd) or leave a file descriptor open;
|
||||
use free_cwd to perform the necessary free or close. Upon failure,
|
||||
no memory is allocated, any locally opened file descriptors are
|
||||
closed; return non-zero -- in that case, free_cwd need not be
|
||||
called, but doing so is ok. Otherwise, return zero. */
|
||||
|
||||
int
|
||||
save_cwd (cwd)
|
||||
struct saved_cwd *cwd;
|
||||
{
|
||||
static int have_working_fchdir = 1;
|
||||
|
||||
cwd->desc = -1;
|
||||
cwd->name = NULL;
|
||||
|
||||
if (have_working_fchdir)
|
||||
{
|
||||
#ifdef HAVE_FCHDIR
|
||||
cwd->desc = open (".", O_RDONLY);
|
||||
if (cwd->desc < 0)
|
||||
{
|
||||
error (0, errno, "cannot open current directory");
|
||||
return 1;
|
||||
}
|
||||
|
||||
# if __sun__ || sun
|
||||
/* On SunOS 4, fchdir returns EINVAL if accounting is enabled,
|
||||
so we have to fall back to chdir. */
|
||||
if (fchdir (cwd->desc))
|
||||
{
|
||||
if (errno == EINVAL)
|
||||
{
|
||||
close (cwd->desc);
|
||||
cwd->desc = -1;
|
||||
have_working_fchdir = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
error (0, errno, "current directory");
|
||||
close (cwd->desc);
|
||||
cwd->desc = -1;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
# endif /* __sun__ || sun */
|
||||
#else
|
||||
#define fchdir(x) (abort (), 0)
|
||||
have_working_fchdir = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!have_working_fchdir)
|
||||
{
|
||||
cwd->name = xgetwd ();
|
||||
if (cwd->name == NULL)
|
||||
{
|
||||
error (0, errno, "cannot get current directory");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Change to recorded location, CWD, in directory hierarchy.
|
||||
If "saved working directory", NULL))
|
||||
*/
|
||||
|
||||
int
|
||||
restore_cwd (cwd, dest)
|
||||
const struct saved_cwd *cwd;
|
||||
const char *dest;
|
||||
{
|
||||
int fail = 0;
|
||||
if (cwd->desc >= 0)
|
||||
{
|
||||
if (fchdir (cwd->desc))
|
||||
{
|
||||
error (0, errno, "cannot return to %s",
|
||||
(dest ? dest : "saved working directory"));
|
||||
fail = 1;
|
||||
}
|
||||
}
|
||||
else if (chdir (cwd->name) < 0)
|
||||
{
|
||||
error (0, errno, "%s", cwd->name);
|
||||
fail = 1;
|
||||
}
|
||||
return fail;
|
||||
}
|
||||
|
||||
void
|
||||
free_cwd (cwd)
|
||||
struct saved_cwd *cwd;
|
||||
{
|
||||
if (cwd->desc >= 0)
|
||||
close (cwd->desc);
|
||||
if (cwd->name)
|
||||
free (cwd->name);
|
||||
}
|
||||
|
20
contrib/cvs/lib/savecwd.h
Normal file
20
contrib/cvs/lib/savecwd.h
Normal file
@ -0,0 +1,20 @@
|
||||
#ifndef SAVE_CWD_H
|
||||
#define SAVE_CWD_H 1
|
||||
|
||||
struct saved_cwd
|
||||
{
|
||||
int desc;
|
||||
char *name;
|
||||
};
|
||||
|
||||
#if defined (__GNUC__) || (defined (__STDC__) && __STDC__)
|
||||
#define __PROTO(args) args
|
||||
#else
|
||||
#define __PROTO(args) ()
|
||||
#endif /* GCC. */
|
||||
|
||||
int save_cwd __PROTO((struct saved_cwd *cwd));
|
||||
int restore_cwd __PROTO((const struct saved_cwd *cwd, const char *dest));
|
||||
void free_cwd __PROTO((struct saved_cwd *cwd));
|
||||
|
||||
#endif /* SAVE_CWD_H */
|
414
contrib/cvs/lib/sighandle.c
Normal file
414
contrib/cvs/lib/sighandle.c
Normal file
@ -0,0 +1,414 @@
|
||||
/* sighandle.c -- Library routines for manipulating chains of signal handlers
|
||||
Copyright (C) 1992 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
/* Written by Paul Sander, HaL Computer Systems, Inc. <paul@hal.com>
|
||||
Brian Berliner <berliner@Sun.COM> added POSIX support */
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* signal.c -- This file contains code that manipulates chains of signal
|
||||
* handlers.
|
||||
*
|
||||
* Facilities are provided to register a signal handler for
|
||||
* any specific signal. When a signal is received, all of the
|
||||
* registered signal handlers are invoked in the reverse order
|
||||
* in which they are registered. Note that the signal handlers
|
||||
* must not themselves make calls to the signal handling
|
||||
* facilities.
|
||||
*
|
||||
* $CVSid: @(#)sighandle.c 1.13 94/10/07 $
|
||||
*
|
||||
*************************************************************************/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
#include "system.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdio.h>
|
||||
#include <signal.h>
|
||||
|
||||
/* Add prototype support. */
|
||||
#ifndef PROTO
|
||||
#if defined (USE_PROTOTYPES) ? USE_PROTOTYPES : defined (__STDC__)
|
||||
#define PROTO(ARGS) ARGS
|
||||
#else
|
||||
#define PROTO(ARGS) ()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef STDC_HEADERS
|
||||
#include <stdlib.h>
|
||||
#else
|
||||
#if __STDC__
|
||||
char *calloc(unsigned nelem, unsigned size);
|
||||
char *malloc(unsigned size);
|
||||
#else
|
||||
char *calloc();
|
||||
char *malloc();
|
||||
#endif /* __STDC__ */
|
||||
#endif /* STDC_HEADERS */
|
||||
|
||||
/* Define the highest signal number (usually) */
|
||||
#ifndef SIGMAX
|
||||
#define SIGMAX 64
|
||||
#endif
|
||||
|
||||
/* Define linked list of signal handlers structure */
|
||||
struct SIG_hlist {
|
||||
RETSIGTYPE (*handler)();
|
||||
struct SIG_hlist *next;
|
||||
};
|
||||
|
||||
/*
|
||||
* Define array of lists of signal handlers. Note that this depends on
|
||||
* the implementation to initialize each element to a null pointer.
|
||||
*/
|
||||
|
||||
static struct SIG_hlist **SIG_handlers;
|
||||
|
||||
/* Define array of default signal vectors */
|
||||
|
||||
#ifdef POSIX_SIGNALS
|
||||
static struct sigaction *SIG_defaults;
|
||||
#else
|
||||
#ifdef BSD_SIGNALS
|
||||
static struct sigvec *SIG_defaults;
|
||||
#else
|
||||
static RETSIGTYPE (**SIG_defaults) PROTO ((int));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Critical section housekeeping */
|
||||
static int SIG_crSectNest = 0; /* Nesting level */
|
||||
#ifdef POSIX_SIGNALS
|
||||
static sigset_t SIG_crSectMask; /* Signal mask */
|
||||
#else
|
||||
static int SIG_crSectMask; /* Signal mask */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Initialize the signal handler arrays
|
||||
*/
|
||||
|
||||
static int SIG_init()
|
||||
{
|
||||
int i;
|
||||
#ifdef POSIX_SIGNALS
|
||||
sigset_t sigset_test;
|
||||
#endif
|
||||
|
||||
if (SIG_defaults && SIG_handlers) /* already allocated */
|
||||
return (0);
|
||||
|
||||
#ifdef POSIX_SIGNALS
|
||||
(void) sigfillset(&sigset_test);
|
||||
for (i = 1; i < SIGMAX && sigismember(&sigset_test, i) == 1; i++)
|
||||
;
|
||||
if (i < SIGMAX)
|
||||
i = SIGMAX;
|
||||
i++;
|
||||
if (!SIG_defaults)
|
||||
SIG_defaults = (struct sigaction *)
|
||||
calloc(i, sizeof(struct sigaction));
|
||||
(void) sigemptyset(&SIG_crSectMask);
|
||||
#else
|
||||
i = SIGMAX+1;
|
||||
#ifdef BSD_SIGNALS
|
||||
if (!SIG_defaults)
|
||||
SIG_defaults = (struct sigvec *)
|
||||
calloc(i, sizeof(struct sigvec));
|
||||
#else
|
||||
if (!SIG_defaults)
|
||||
SIG_defaults = (RETSIGTYPE (**) PROTO ((int)) )
|
||||
calloc(i, sizeof(RETSIGTYPE (**) PROTO ((int)) ));
|
||||
#endif
|
||||
SIG_crSectMask = 0;
|
||||
#endif
|
||||
if (!SIG_handlers)
|
||||
SIG_handlers = (struct SIG_hlist **)
|
||||
calloc(i, sizeof(struct SIG_hlist *));
|
||||
return (!SIG_defaults || !SIG_handlers);
|
||||
}
|
||||
|
||||
/*
|
||||
* The following invokes each signal handler in the reverse order in which
|
||||
* they were registered.
|
||||
*/
|
||||
static RETSIGTYPE SIG_handle PROTO ((int));
|
||||
|
||||
static RETSIGTYPE SIG_handle(sig)
|
||||
int sig;
|
||||
{
|
||||
struct SIG_hlist *this;
|
||||
|
||||
/* Dispatch signal handlers */
|
||||
this = SIG_handlers[sig];
|
||||
while (this != (struct SIG_hlist *) NULL)
|
||||
{
|
||||
(*this->handler)(sig);
|
||||
this = this->next;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* The following registers a signal handler. If the handler is already
|
||||
* registered, it is not registered twice, nor is the order in which signal
|
||||
* handlers are invoked changed. If this is the first signal handler
|
||||
* registered for a given signal, the old sigvec structure is saved for
|
||||
* restoration later.
|
||||
*/
|
||||
|
||||
int SIG_register(sig,fn)
|
||||
int sig;
|
||||
RETSIGTYPE (*fn)();
|
||||
{
|
||||
int val;
|
||||
struct SIG_hlist *this;
|
||||
#ifdef POSIX_SIGNALS
|
||||
struct sigaction act;
|
||||
sigset_t sigset_mask, sigset_omask;
|
||||
#else
|
||||
#ifdef BSD_SIGNALS
|
||||
struct sigvec vec;
|
||||
int mask;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Initialize */
|
||||
if (SIG_init() != 0)
|
||||
return (-1);
|
||||
val = 0;
|
||||
|
||||
/* Block this signal while we look at handler chain */
|
||||
#ifdef POSIX_SIGNALS
|
||||
(void) sigemptyset(&sigset_mask);
|
||||
(void) sigaddset(&sigset_mask, sig);
|
||||
(void) sigprocmask(SIG_BLOCK, &sigset_mask, &sigset_omask);
|
||||
#else
|
||||
#ifdef BSD_SIGNALS
|
||||
mask = sigblock(sigmask(sig));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* See if this handler was already registered */
|
||||
this = SIG_handlers[sig];
|
||||
while (this != (struct SIG_hlist *) NULL)
|
||||
{
|
||||
if (this->handler == fn) break;
|
||||
this = this->next;
|
||||
}
|
||||
|
||||
/* Register the new handler only if it is not already registered. */
|
||||
if (this == (struct SIG_hlist *) NULL)
|
||||
{
|
||||
|
||||
/*
|
||||
* If this is the first handler registered for this signal,
|
||||
* set up the signal handler dispatcher
|
||||
*/
|
||||
|
||||
if (SIG_handlers[sig] == (struct SIG_hlist *) NULL)
|
||||
{
|
||||
#ifdef POSIX_SIGNALS
|
||||
act.sa_handler = SIG_handle;
|
||||
(void) sigemptyset(&act.sa_mask);
|
||||
act.sa_flags = 0;
|
||||
val = sigaction(sig, &act, &SIG_defaults[sig]);
|
||||
#else
|
||||
#ifdef BSD_SIGNALS
|
||||
memset (&vec, 0, sizeof (vec));
|
||||
vec.sv_handler = SIG_handle;
|
||||
val = sigvec(sig, &vec, &SIG_defaults[sig]);
|
||||
#else
|
||||
if ((SIG_defaults[sig] = signal(sig, SIG_handle)) == SIG_ERR)
|
||||
val = -1;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
/* If not, register it */
|
||||
if ((val == 0) && (this == (struct SIG_hlist *) NULL))
|
||||
{
|
||||
this = (struct SIG_hlist *)
|
||||
malloc(sizeof(struct SIG_hlist));
|
||||
if (this == NULL)
|
||||
{
|
||||
val = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
this->handler = fn;
|
||||
this->next = SIG_handlers[sig];
|
||||
SIG_handlers[sig] = this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Unblock the signal */
|
||||
#ifdef POSIX_SIGNALS
|
||||
(void) sigprocmask(SIG_SETMASK, &sigset_omask, NULL);
|
||||
#else
|
||||
#ifdef BSD_SIGNALS
|
||||
(void) sigsetmask(mask);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
/*
|
||||
* The following deregisters a signal handler. If the last signal handler for
|
||||
* a given signal is deregistered, the default sigvec information is restored.
|
||||
*/
|
||||
|
||||
int SIG_deregister(sig,fn)
|
||||
int sig;
|
||||
RETSIGTYPE (*fn)();
|
||||
{
|
||||
int val;
|
||||
struct SIG_hlist *this;
|
||||
struct SIG_hlist *last;
|
||||
#ifdef POSIX_SIGNALS
|
||||
sigset_t sigset_mask, sigset_omask;
|
||||
#else
|
||||
#ifdef BSD_SIGNALS
|
||||
int mask;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Initialize */
|
||||
if (SIG_init() != 0)
|
||||
return (-1);
|
||||
val = 0;
|
||||
last = (struct SIG_hlist *) NULL;
|
||||
|
||||
/* Block this signal while we look at handler chain */
|
||||
#ifdef POSIX_SIGNALS
|
||||
(void) sigemptyset(&sigset_mask);
|
||||
(void) sigaddset(&sigset_mask, sig);
|
||||
(void) sigprocmask(SIG_BLOCK, &sigset_mask, &sigset_omask);
|
||||
#else
|
||||
#ifdef BSD_SIGNALS
|
||||
mask = sigblock(sigmask(sig));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Search for the signal handler */
|
||||
this = SIG_handlers[sig];
|
||||
while ((this != (struct SIG_hlist *) NULL) && (this->handler != fn))
|
||||
{
|
||||
last = this;
|
||||
this = this->next;
|
||||
}
|
||||
|
||||
/* If it was registered, remove it */
|
||||
if (this != (struct SIG_hlist *) NULL)
|
||||
{
|
||||
if (last == (struct SIG_hlist *) NULL)
|
||||
{
|
||||
SIG_handlers[sig] = this->next;
|
||||
}
|
||||
else
|
||||
{
|
||||
last->next = this->next;
|
||||
}
|
||||
free((char *) this);
|
||||
}
|
||||
|
||||
/* Restore default behavior if there are no registered handlers */
|
||||
if (SIG_handlers[sig] == (struct SIG_hlist *) NULL)
|
||||
{
|
||||
#ifdef POSIX_SIGNALS
|
||||
val = sigaction(sig, &SIG_defaults[sig],
|
||||
(struct sigaction *) NULL);
|
||||
#else
|
||||
#ifdef BSD_SIGNALS
|
||||
val = sigvec(sig, &SIG_defaults[sig], (struct sigvec *) NULL);
|
||||
#else
|
||||
if (signal(sig, SIG_defaults[sig]) == SIG_ERR)
|
||||
val = -1;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Unblock the signal */
|
||||
#ifdef POSIX_SIGNALS
|
||||
(void) sigprocmask(SIG_SETMASK, &sigset_omask, NULL);
|
||||
#else
|
||||
#ifdef BSD_SIGNALS
|
||||
(void) sigsetmask(mask);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
/*
|
||||
* The following begins a critical section.
|
||||
*/
|
||||
|
||||
void SIG_beginCrSect()
|
||||
{
|
||||
if (SIG_init() == 0)
|
||||
{
|
||||
if (SIG_crSectNest == 0)
|
||||
{
|
||||
#ifdef POSIX_SIGNALS
|
||||
sigset_t sigset_mask;
|
||||
|
||||
(void) sigfillset(&sigset_mask);
|
||||
(void) sigprocmask(SIG_SETMASK,
|
||||
&sigset_mask, &SIG_crSectMask);
|
||||
#else
|
||||
#ifdef BSD_SIGNALS
|
||||
SIG_crSectMask = sigblock(~0);
|
||||
#else
|
||||
/* TBD */
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
SIG_crSectNest++;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* The following ends a critical section.
|
||||
*/
|
||||
|
||||
void SIG_endCrSect()
|
||||
{
|
||||
if (SIG_init() == 0)
|
||||
{
|
||||
SIG_crSectNest--;
|
||||
if (SIG_crSectNest == 0)
|
||||
{
|
||||
#ifdef POSIX_SIGNALS
|
||||
(void) sigprocmask(SIG_SETMASK, &SIG_crSectMask, NULL);
|
||||
#else
|
||||
#ifdef BSD_SIGNALS
|
||||
(void) sigsetmask(SIG_crSectMask);
|
||||
#else
|
||||
/* TBD */
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
43
contrib/cvs/lib/strdup.c
Normal file
43
contrib/cvs/lib/strdup.c
Normal file
@ -0,0 +1,43 @@
|
||||
/* strdup.c -- return a newly allocated copy of a string
|
||||
Copyright (C) 1990 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#ifdef STDC_HEADERS
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#else
|
||||
char *malloc ();
|
||||
char *strcpy ();
|
||||
#endif
|
||||
|
||||
/* Return a newly allocated copy of STR,
|
||||
or 0 if out of memory. */
|
||||
|
||||
char *
|
||||
strdup (str)
|
||||
char *str;
|
||||
{
|
||||
char *newstr;
|
||||
|
||||
newstr = (char *) malloc (strlen (str) + 1);
|
||||
if (newstr)
|
||||
strcpy (newstr, str);
|
||||
return newstr;
|
||||
}
|
813
contrib/cvs/lib/strerror.c
Normal file
813
contrib/cvs/lib/strerror.c
Normal file
@ -0,0 +1,813 @@
|
||||
/* Extended support for using errno values.
|
||||
Copyright (C) 1992 Free Software Foundation, Inc.
|
||||
Written by Fred Fish. fnf@cygnus.com
|
||||
|
||||
This file is part of the libiberty library.
|
||||
Libiberty is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
Libiberty is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with libiberty; see the file COPYING.LIB. If
|
||||
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#ifndef NEED_sys_errlist
|
||||
/* Note that errno.h (not sure what OS) or stdio.h (BSD 4.4, at least)
|
||||
might declare sys_errlist in a way that the compiler might consider
|
||||
incompatible with our later declaration, perhaps by using const
|
||||
attributes. So we hide the declaration in errno.h (if any) using a
|
||||
macro. */
|
||||
#define sys_errlist sys_errlist__
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
#ifndef NEED_sys_errlist
|
||||
#undef sys_errlist
|
||||
#endif
|
||||
|
||||
/* Routines imported from standard C runtime libraries. */
|
||||
|
||||
#ifdef __STDC__
|
||||
#include <stddef.h>
|
||||
extern void *malloc (size_t size); /* 4.10.3.3 */
|
||||
extern void *memset (void *s, int c, size_t n); /* 4.11.6.1 */
|
||||
#else /* !__STDC__ */
|
||||
extern char *malloc (); /* Standard memory allocater */
|
||||
extern char *memset ();
|
||||
#endif /* __STDC__ */
|
||||
|
||||
#ifndef MAX
|
||||
# define MAX(a,b) ((a) > (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
/* Translation table for errno values. See intro(2) in most UNIX systems
|
||||
Programmers Reference Manuals.
|
||||
|
||||
Note that this table is generally only accessed when it is used at runtime
|
||||
to initialize errno name and message tables that are indexed by errno
|
||||
value.
|
||||
|
||||
Not all of these errnos will exist on all systems. This table is the only
|
||||
thing that should have to be updated as new error numbers are introduced.
|
||||
It's sort of ugly, but at least its portable. */
|
||||
|
||||
struct error_info
|
||||
{
|
||||
int value; /* The numeric value from <errno.h> */
|
||||
char *name; /* The equivalent symbolic value */
|
||||
#ifdef NEED_sys_errlist
|
||||
char *msg; /* Short message about this value */
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifdef NEED_sys_errlist
|
||||
# define ENTRY(value, name, msg) {value, name, msg}
|
||||
#else
|
||||
# define ENTRY(value, name, msg) {value, name}
|
||||
#endif
|
||||
|
||||
static const struct error_info error_table[] =
|
||||
{
|
||||
#if defined (EPERM)
|
||||
ENTRY(EPERM, "EPERM", "Not owner"),
|
||||
#endif
|
||||
#if defined (ENOENT)
|
||||
ENTRY(ENOENT, "ENOENT", "No such file or directory"),
|
||||
#endif
|
||||
#if defined (ESRCH)
|
||||
ENTRY(ESRCH, "ESRCH", "No such process"),
|
||||
#endif
|
||||
#if defined (EINTR)
|
||||
ENTRY(EINTR, "EINTR", "Interrupted system call"),
|
||||
#endif
|
||||
#if defined (EIO)
|
||||
ENTRY(EIO, "EIO", "I/O error"),
|
||||
#endif
|
||||
#if defined (ENXIO)
|
||||
ENTRY(ENXIO, "ENXIO", "No such device or address"),
|
||||
#endif
|
||||
#if defined (E2BIG)
|
||||
ENTRY(E2BIG, "E2BIG", "Arg list too long"),
|
||||
#endif
|
||||
#if defined (ENOEXEC)
|
||||
ENTRY(ENOEXEC, "ENOEXEC", "Exec format error"),
|
||||
#endif
|
||||
#if defined (EBADF)
|
||||
ENTRY(EBADF, "EBADF", "Bad file number"),
|
||||
#endif
|
||||
#if defined (ECHILD)
|
||||
ENTRY(ECHILD, "ECHILD", "No child processes"),
|
||||
#endif
|
||||
#if defined (EWOULDBLOCK) /* Put before EAGAIN, sometimes aliased */
|
||||
ENTRY(EWOULDBLOCK, "EWOULDBLOCK", "Operation would block"),
|
||||
#endif
|
||||
#if defined (EAGAIN)
|
||||
ENTRY(EAGAIN, "EAGAIN", "No more processes"),
|
||||
#endif
|
||||
#if defined (ENOMEM)
|
||||
ENTRY(ENOMEM, "ENOMEM", "Not enough space"),
|
||||
#endif
|
||||
#if defined (EACCES)
|
||||
ENTRY(EACCES, "EACCES", "Permission denied"),
|
||||
#endif
|
||||
#if defined (EFAULT)
|
||||
ENTRY(EFAULT, "EFAULT", "Bad address"),
|
||||
#endif
|
||||
#if defined (ENOTBLK)
|
||||
ENTRY(ENOTBLK, "ENOTBLK", "Block device required"),
|
||||
#endif
|
||||
#if defined (EBUSY)
|
||||
ENTRY(EBUSY, "EBUSY", "Device busy"),
|
||||
#endif
|
||||
#if defined (EEXIST)
|
||||
ENTRY(EEXIST, "EEXIST", "File exists"),
|
||||
#endif
|
||||
#if defined (EXDEV)
|
||||
ENTRY(EXDEV, "EXDEV", "Cross-device link"),
|
||||
#endif
|
||||
#if defined (ENODEV)
|
||||
ENTRY(ENODEV, "ENODEV", "No such device"),
|
||||
#endif
|
||||
#if defined (ENOTDIR)
|
||||
ENTRY(ENOTDIR, "ENOTDIR", "Not a directory"),
|
||||
#endif
|
||||
#if defined (EISDIR)
|
||||
ENTRY(EISDIR, "EISDIR", "Is a directory"),
|
||||
#endif
|
||||
#if defined (EINVAL)
|
||||
ENTRY(EINVAL, "EINVAL", "Invalid argument"),
|
||||
#endif
|
||||
#if defined (ENFILE)
|
||||
ENTRY(ENFILE, "ENFILE", "File table overflow"),
|
||||
#endif
|
||||
#if defined (EMFILE)
|
||||
ENTRY(EMFILE, "EMFILE", "Too many open files"),
|
||||
#endif
|
||||
#if defined (ENOTTY)
|
||||
ENTRY(ENOTTY, "ENOTTY", "Not a typewriter"),
|
||||
#endif
|
||||
#if defined (ETXTBSY)
|
||||
ENTRY(ETXTBSY, "ETXTBSY", "Text file busy"),
|
||||
#endif
|
||||
#if defined (EFBIG)
|
||||
ENTRY(EFBIG, "EFBIG", "File too large"),
|
||||
#endif
|
||||
#if defined (ENOSPC)
|
||||
ENTRY(ENOSPC, "ENOSPC", "No space left on device"),
|
||||
#endif
|
||||
#if defined (ESPIPE)
|
||||
ENTRY(ESPIPE, "ESPIPE", "Illegal seek"),
|
||||
#endif
|
||||
#if defined (EROFS)
|
||||
ENTRY(EROFS, "EROFS", "Read-only file system"),
|
||||
#endif
|
||||
#if defined (EMLINK)
|
||||
ENTRY(EMLINK, "EMLINK", "Too many links"),
|
||||
#endif
|
||||
#if defined (EPIPE)
|
||||
ENTRY(EPIPE, "EPIPE", "Broken pipe"),
|
||||
#endif
|
||||
#if defined (EDOM)
|
||||
ENTRY(EDOM, "EDOM", "Math argument out of domain of func"),
|
||||
#endif
|
||||
#if defined (ERANGE)
|
||||
ENTRY(ERANGE, "ERANGE", "Math result not representable"),
|
||||
#endif
|
||||
#if defined (ENOMSG)
|
||||
ENTRY(ENOMSG, "ENOMSG", "No message of desired type"),
|
||||
#endif
|
||||
#if defined (EIDRM)
|
||||
ENTRY(EIDRM, "EIDRM", "Identifier removed"),
|
||||
#endif
|
||||
#if defined (ECHRNG)
|
||||
ENTRY(ECHRNG, "ECHRNG", "Channel number out of range"),
|
||||
#endif
|
||||
#if defined (EL2NSYNC)
|
||||
ENTRY(EL2NSYNC, "EL2NSYNC", "Level 2 not synchronized"),
|
||||
#endif
|
||||
#if defined (EL3HLT)
|
||||
ENTRY(EL3HLT, "EL3HLT", "Level 3 halted"),
|
||||
#endif
|
||||
#if defined (EL3RST)
|
||||
ENTRY(EL3RST, "EL3RST", "Level 3 reset"),
|
||||
#endif
|
||||
#if defined (ELNRNG)
|
||||
ENTRY(ELNRNG, "ELNRNG", "Link number out of range"),
|
||||
#endif
|
||||
#if defined (EUNATCH)
|
||||
ENTRY(EUNATCH, "EUNATCH", "Protocol driver not attached"),
|
||||
#endif
|
||||
#if defined (ENOCSI)
|
||||
ENTRY(ENOCSI, "ENOCSI", "No CSI structure available"),
|
||||
#endif
|
||||
#if defined (EL2HLT)
|
||||
ENTRY(EL2HLT, "EL2HLT", "Level 2 halted"),
|
||||
#endif
|
||||
#if defined (EDEADLK)
|
||||
ENTRY(EDEADLK, "EDEADLK", "Deadlock condition"),
|
||||
#endif
|
||||
#if defined (ENOLCK)
|
||||
ENTRY(ENOLCK, "ENOLCK", "No record locks available"),
|
||||
#endif
|
||||
#if defined (EBADE)
|
||||
ENTRY(EBADE, "EBADE", "Invalid exchange"),
|
||||
#endif
|
||||
#if defined (EBADR)
|
||||
ENTRY(EBADR, "EBADR", "Invalid request descriptor"),
|
||||
#endif
|
||||
#if defined (EXFULL)
|
||||
ENTRY(EXFULL, "EXFULL", "Exchange full"),
|
||||
#endif
|
||||
#if defined (ENOANO)
|
||||
ENTRY(ENOANO, "ENOANO", "No anode"),
|
||||
#endif
|
||||
#if defined (EBADRQC)
|
||||
ENTRY(EBADRQC, "EBADRQC", "Invalid request code"),
|
||||
#endif
|
||||
#if defined (EBADSLT)
|
||||
ENTRY(EBADSLT, "EBADSLT", "Invalid slot"),
|
||||
#endif
|
||||
#if defined (EDEADLOCK)
|
||||
ENTRY(EDEADLOCK, "EDEADLOCK", "File locking deadlock error"),
|
||||
#endif
|
||||
#if defined (EBFONT)
|
||||
ENTRY(EBFONT, "EBFONT", "Bad font file format"),
|
||||
#endif
|
||||
#if defined (ENOSTR)
|
||||
ENTRY(ENOSTR, "ENOSTR", "Device not a stream"),
|
||||
#endif
|
||||
#if defined (ENODATA)
|
||||
ENTRY(ENODATA, "ENODATA", "No data available"),
|
||||
#endif
|
||||
#if defined (ETIME)
|
||||
ENTRY(ETIME, "ETIME", "Timer expired"),
|
||||
#endif
|
||||
#if defined (ENOSR)
|
||||
ENTRY(ENOSR, "ENOSR", "Out of streams resources"),
|
||||
#endif
|
||||
#if defined (ENONET)
|
||||
ENTRY(ENONET, "ENONET", "Machine is not on the network"),
|
||||
#endif
|
||||
#if defined (ENOPKG)
|
||||
ENTRY(ENOPKG, "ENOPKG", "Package not installed"),
|
||||
#endif
|
||||
#if defined (EREMOTE)
|
||||
ENTRY(EREMOTE, "EREMOTE", "Object is remote"),
|
||||
#endif
|
||||
#if defined (ENOLINK)
|
||||
ENTRY(ENOLINK, "ENOLINK", "Link has been severed"),
|
||||
#endif
|
||||
#if defined (EADV)
|
||||
ENTRY(EADV, "EADV", "Advertise error"),
|
||||
#endif
|
||||
#if defined (ESRMNT)
|
||||
ENTRY(ESRMNT, "ESRMNT", "Srmount error"),
|
||||
#endif
|
||||
#if defined (ECOMM)
|
||||
ENTRY(ECOMM, "ECOMM", "Communication error on send"),
|
||||
#endif
|
||||
#if defined (EPROTO)
|
||||
ENTRY(EPROTO, "EPROTO", "Protocol error"),
|
||||
#endif
|
||||
#if defined (EMULTIHOP)
|
||||
ENTRY(EMULTIHOP, "EMULTIHOP", "Multihop attempted"),
|
||||
#endif
|
||||
#if defined (EDOTDOT)
|
||||
ENTRY(EDOTDOT, "EDOTDOT", "RFS specific error"),
|
||||
#endif
|
||||
#if defined (EBADMSG)
|
||||
ENTRY(EBADMSG, "EBADMSG", "Not a data message"),
|
||||
#endif
|
||||
#if defined (ENAMETOOLONG)
|
||||
ENTRY(ENAMETOOLONG, "ENAMETOOLONG", "File name too long"),
|
||||
#endif
|
||||
#if defined (EOVERFLOW)
|
||||
ENTRY(EOVERFLOW, "EOVERFLOW", "Value too large for defined data type"),
|
||||
#endif
|
||||
#if defined (ENOTUNIQ)
|
||||
ENTRY(ENOTUNIQ, "ENOTUNIQ", "Name not unique on network"),
|
||||
#endif
|
||||
#if defined (EBADFD)
|
||||
ENTRY(EBADFD, "EBADFD", "File descriptor in bad state"),
|
||||
#endif
|
||||
#if defined (EREMCHG)
|
||||
ENTRY(EREMCHG, "EREMCHG", "Remote address changed"),
|
||||
#endif
|
||||
#if defined (ELIBACC)
|
||||
ENTRY(ELIBACC, "ELIBACC", "Can not access a needed shared library"),
|
||||
#endif
|
||||
#if defined (ELIBBAD)
|
||||
ENTRY(ELIBBAD, "ELIBBAD", "Accessing a corrupted shared library"),
|
||||
#endif
|
||||
#if defined (ELIBSCN)
|
||||
ENTRY(ELIBSCN, "ELIBSCN", ".lib section in a.out corrupted"),
|
||||
#endif
|
||||
#if defined (ELIBMAX)
|
||||
ENTRY(ELIBMAX, "ELIBMAX", "Attempting to link in too many shared libraries"),
|
||||
#endif
|
||||
#if defined (ELIBEXEC)
|
||||
ENTRY(ELIBEXEC, "ELIBEXEC", "Cannot exec a shared library directly"),
|
||||
#endif
|
||||
#if defined (EILSEQ)
|
||||
ENTRY(EILSEQ, "EILSEQ", "Illegal byte sequence"),
|
||||
#endif
|
||||
#if defined (ENOSYS)
|
||||
ENTRY(ENOSYS, "ENOSYS", "Operation not applicable"),
|
||||
#endif
|
||||
#if defined (ELOOP)
|
||||
ENTRY(ELOOP, "ELOOP", "Too many symbolic links encountered"),
|
||||
#endif
|
||||
#if defined (ERESTART)
|
||||
ENTRY(ERESTART, "ERESTART", "Interrupted system call should be restarted"),
|
||||
#endif
|
||||
#if defined (ESTRPIPE)
|
||||
ENTRY(ESTRPIPE, "ESTRPIPE", "Streams pipe error"),
|
||||
#endif
|
||||
#if defined (ENOTEMPTY)
|
||||
ENTRY(ENOTEMPTY, "ENOTEMPTY", "Directory not empty"),
|
||||
#endif
|
||||
#if defined (EUSERS)
|
||||
ENTRY(EUSERS, "EUSERS", "Too many users"),
|
||||
#endif
|
||||
#if defined (ENOTSOCK)
|
||||
ENTRY(ENOTSOCK, "ENOTSOCK", "Socket operation on non-socket"),
|
||||
#endif
|
||||
#if defined (EDESTADDRREQ)
|
||||
ENTRY(EDESTADDRREQ, "EDESTADDRREQ", "Destination address required"),
|
||||
#endif
|
||||
#if defined (EMSGSIZE)
|
||||
ENTRY(EMSGSIZE, "EMSGSIZE", "Message too long"),
|
||||
#endif
|
||||
#if defined (EPROTOTYPE)
|
||||
ENTRY(EPROTOTYPE, "EPROTOTYPE", "Protocol wrong type for socket"),
|
||||
#endif
|
||||
#if defined (ENOPROTOOPT)
|
||||
ENTRY(ENOPROTOOPT, "ENOPROTOOPT", "Protocol not available"),
|
||||
#endif
|
||||
#if defined (EPROTONOSUPPORT)
|
||||
ENTRY(EPROTONOSUPPORT, "EPROTONOSUPPORT", "Protocol not supported"),
|
||||
#endif
|
||||
#if defined (ESOCKTNOSUPPORT)
|
||||
ENTRY(ESOCKTNOSUPPORT, "ESOCKTNOSUPPORT", "Socket type not supported"),
|
||||
#endif
|
||||
#if defined (EOPNOTSUPP)
|
||||
ENTRY(EOPNOTSUPP, "EOPNOTSUPP", "Operation not supported on transport endpoint"),
|
||||
#endif
|
||||
#if defined (EPFNOSUPPORT)
|
||||
ENTRY(EPFNOSUPPORT, "EPFNOSUPPORT", "Protocol family not supported"),
|
||||
#endif
|
||||
#if defined (EAFNOSUPPORT)
|
||||
ENTRY(EAFNOSUPPORT, "EAFNOSUPPORT", "Address family not supported by protocol"),
|
||||
#endif
|
||||
#if defined (EADDRINUSE)
|
||||
ENTRY(EADDRINUSE, "EADDRINUSE", "Address already in use"),
|
||||
#endif
|
||||
#if defined (EADDRNOTAVAIL)
|
||||
ENTRY(EADDRNOTAVAIL, "EADDRNOTAVAIL","Cannot assign requested address"),
|
||||
#endif
|
||||
#if defined (ENETDOWN)
|
||||
ENTRY(ENETDOWN, "ENETDOWN", "Network is down"),
|
||||
#endif
|
||||
#if defined (ENETUNREACH)
|
||||
ENTRY(ENETUNREACH, "ENETUNREACH", "Network is unreachable"),
|
||||
#endif
|
||||
#if defined (ENETRESET)
|
||||
ENTRY(ENETRESET, "ENETRESET", "Network dropped connection because of reset"),
|
||||
#endif
|
||||
#if defined (ECONNABORTED)
|
||||
ENTRY(ECONNABORTED, "ECONNABORTED", "Software caused connection abort"),
|
||||
#endif
|
||||
#if defined (ECONNRESET)
|
||||
ENTRY(ECONNRESET, "ECONNRESET", "Connection reset by peer"),
|
||||
#endif
|
||||
#if defined (ENOBUFS)
|
||||
ENTRY(ENOBUFS, "ENOBUFS", "No buffer space available"),
|
||||
#endif
|
||||
#if defined (EISCONN)
|
||||
ENTRY(EISCONN, "EISCONN", "Transport endpoint is already connected"),
|
||||
#endif
|
||||
#if defined (ENOTCONN)
|
||||
ENTRY(ENOTCONN, "ENOTCONN", "Transport endpoint is not connected"),
|
||||
#endif
|
||||
#if defined (ESHUTDOWN)
|
||||
ENTRY(ESHUTDOWN, "ESHUTDOWN", "Cannot send after transport endpoint shutdown"),
|
||||
#endif
|
||||
#if defined (ETOOMANYREFS)
|
||||
ENTRY(ETOOMANYREFS, "ETOOMANYREFS", "Too many references: cannot splice"),
|
||||
#endif
|
||||
#if defined (ETIMEDOUT)
|
||||
ENTRY(ETIMEDOUT, "ETIMEDOUT", "Connection timed out"),
|
||||
#endif
|
||||
#if defined (ECONNREFUSED)
|
||||
ENTRY(ECONNREFUSED, "ECONNREFUSED", "Connection refused"),
|
||||
#endif
|
||||
#if defined (EHOSTDOWN)
|
||||
ENTRY(EHOSTDOWN, "EHOSTDOWN", "Host is down"),
|
||||
#endif
|
||||
#if defined (EHOSTUNREACH)
|
||||
ENTRY(EHOSTUNREACH, "EHOSTUNREACH", "No route to host"),
|
||||
#endif
|
||||
#if defined (EALREADY)
|
||||
ENTRY(EALREADY, "EALREADY", "Operation already in progress"),
|
||||
#endif
|
||||
#if defined (EINPROGRESS)
|
||||
ENTRY(EINPROGRESS, "EINPROGRESS", "Operation now in progress"),
|
||||
#endif
|
||||
#if defined (ESTALE)
|
||||
ENTRY(ESTALE, "ESTALE", "Stale NFS file handle"),
|
||||
#endif
|
||||
#if defined (EUCLEAN)
|
||||
ENTRY(EUCLEAN, "EUCLEAN", "Structure needs cleaning"),
|
||||
#endif
|
||||
#if defined (ENOTNAM)
|
||||
ENTRY(ENOTNAM, "ENOTNAM", "Not a XENIX named type file"),
|
||||
#endif
|
||||
#if defined (ENAVAIL)
|
||||
ENTRY(ENAVAIL, "ENAVAIL", "No XENIX semaphores available"),
|
||||
#endif
|
||||
#if defined (EISNAM)
|
||||
ENTRY(EISNAM, "EISNAM", "Is a named type file"),
|
||||
#endif
|
||||
#if defined (EREMOTEIO)
|
||||
ENTRY(EREMOTEIO, "EREMOTEIO", "Remote I/O error"),
|
||||
#endif
|
||||
ENTRY(0, NULL, NULL)
|
||||
};
|
||||
|
||||
/* Translation table allocated and initialized at runtime. Indexed by the
|
||||
errno value to find the equivalent symbolic value. */
|
||||
|
||||
static char **error_names;
|
||||
static int num_error_names = 0;
|
||||
|
||||
/* Translation table allocated and initialized at runtime, if it does not
|
||||
already exist in the host environment. Indexed by the errno value to find
|
||||
the descriptive string.
|
||||
|
||||
We don't export it for use in other modules because even though it has the
|
||||
same name, it differs from other implementations in that it is dynamically
|
||||
initialized rather than statically initialized. */
|
||||
|
||||
#ifdef NEED_sys_errlist
|
||||
|
||||
static int sys_nerr;
|
||||
static char **sys_errlist;
|
||||
|
||||
#else
|
||||
|
||||
extern int sys_nerr;
|
||||
extern char *sys_errlist[];
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
|
||||
NAME
|
||||
|
||||
init_error_tables -- initialize the name and message tables
|
||||
|
||||
SYNOPSIS
|
||||
|
||||
static void init_error_tables ();
|
||||
|
||||
DESCRIPTION
|
||||
|
||||
Using the error_table, which is initialized at compile time, generate
|
||||
the error_names and the sys_errlist (if needed) tables, which are
|
||||
indexed at runtime by a specific errno value.
|
||||
|
||||
BUGS
|
||||
|
||||
The initialization of the tables may fail under low memory conditions,
|
||||
in which case we don't do anything particularly useful, but we don't
|
||||
bomb either. Who knows, it might succeed at a later point if we free
|
||||
some memory in the meantime. In any case, the other routines know
|
||||
how to deal with lack of a table after trying to initialize it. This
|
||||
may or may not be considered to be a bug, that we don't specifically
|
||||
warn about this particular failure mode.
|
||||
|
||||
*/
|
||||
|
||||
static void
|
||||
init_error_tables ()
|
||||
{
|
||||
const struct error_info *eip;
|
||||
int nbytes;
|
||||
|
||||
/* If we haven't already scanned the error_table once to find the maximum
|
||||
errno value, then go find it now. */
|
||||
|
||||
if (num_error_names == 0)
|
||||
{
|
||||
for (eip = error_table; eip -> name != NULL; eip++)
|
||||
{
|
||||
if (eip -> value >= num_error_names)
|
||||
{
|
||||
num_error_names = eip -> value + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Now attempt to allocate the error_names table, zero it out, and then
|
||||
initialize it from the statically initialized error_table. */
|
||||
|
||||
if (error_names == NULL)
|
||||
{
|
||||
nbytes = num_error_names * sizeof (char *);
|
||||
if ((error_names = (char **) malloc (nbytes)) != NULL)
|
||||
{
|
||||
memset (error_names, 0, nbytes);
|
||||
for (eip = error_table; eip -> name != NULL; eip++)
|
||||
{
|
||||
error_names[eip -> value] = eip -> name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef NEED_sys_errlist
|
||||
|
||||
/* Now attempt to allocate the sys_errlist table, zero it out, and then
|
||||
initialize it from the statically initialized error_table. */
|
||||
|
||||
if (sys_errlist == NULL)
|
||||
{
|
||||
nbytes = num_error_names * sizeof (char *);
|
||||
if ((sys_errlist = (char **) malloc (nbytes)) != NULL)
|
||||
{
|
||||
memset (sys_errlist, 0, nbytes);
|
||||
sys_nerr = num_error_names;
|
||||
for (eip = error_table; eip -> name != NULL; eip++)
|
||||
{
|
||||
sys_errlist[eip -> value] = eip -> msg;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
NAME
|
||||
|
||||
errno_max -- return the max errno value
|
||||
|
||||
SYNOPSIS
|
||||
|
||||
int errno_max ();
|
||||
|
||||
DESCRIPTION
|
||||
|
||||
Returns the maximum errno value for which a corresponding symbolic
|
||||
name or message is available. Note that in the case where
|
||||
we use the sys_errlist supplied by the system, it is possible for
|
||||
there to be more symbolic names than messages, or vice versa.
|
||||
In fact, the manual page for perror(3C) explicitly warns that one
|
||||
should check the size of the table (sys_nerr) before indexing it,
|
||||
since new error codes may be added to the system before they are
|
||||
added to the table. Thus sys_nerr might be smaller than value
|
||||
implied by the largest errno value defined in <errno.h>.
|
||||
|
||||
We return the maximum value that can be used to obtain a meaningful
|
||||
symbolic name or message.
|
||||
|
||||
*/
|
||||
|
||||
int
|
||||
errno_max ()
|
||||
{
|
||||
int maxsize;
|
||||
|
||||
if (error_names == NULL)
|
||||
{
|
||||
init_error_tables ();
|
||||
}
|
||||
maxsize = MAX (sys_nerr, num_error_names);
|
||||
return (maxsize - 1);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
NAME
|
||||
|
||||
strerror -- map an error number to an error message string
|
||||
|
||||
SYNOPSIS
|
||||
|
||||
char *strerror (int errnoval)
|
||||
|
||||
DESCRIPTION
|
||||
|
||||
Maps an errno number to an error message string, the contents of
|
||||
which are implementation defined. On systems which have the external
|
||||
variables sys_nerr and sys_errlist, these strings will be the same
|
||||
as the ones used by perror().
|
||||
|
||||
If the supplied error number is within the valid range of indices
|
||||
for the sys_errlist, but no message is available for the particular
|
||||
error number, then returns the string "Error NUM", where NUM is the
|
||||
error number.
|
||||
|
||||
If the supplied error number is not a valid index into sys_errlist,
|
||||
returns NULL.
|
||||
|
||||
The returned string is only guaranteed to be valid only until the
|
||||
next call to strerror.
|
||||
|
||||
*/
|
||||
|
||||
char *
|
||||
strerror (errnoval)
|
||||
int errnoval;
|
||||
{
|
||||
char *msg;
|
||||
static char buf[32];
|
||||
|
||||
#ifdef NEED_sys_errlist
|
||||
|
||||
if (error_names == NULL)
|
||||
{
|
||||
init_error_tables ();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
if ((errnoval < 0) || (errnoval >= sys_nerr))
|
||||
{
|
||||
/* Out of range, just return NULL */
|
||||
msg = NULL;
|
||||
}
|
||||
else if ((sys_errlist == NULL) || (sys_errlist[errnoval] == NULL))
|
||||
{
|
||||
/* In range, but no sys_errlist or no entry at this index. */
|
||||
sprintf (buf, "Error %d", errnoval);
|
||||
msg = buf;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* In range, and a valid message. Just return the message. */
|
||||
msg = sys_errlist[errnoval];
|
||||
}
|
||||
|
||||
return (msg);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
NAME
|
||||
|
||||
strerrno -- map an error number to a symbolic name string
|
||||
|
||||
SYNOPSIS
|
||||
|
||||
char *strerrno (int errnoval)
|
||||
|
||||
DESCRIPTION
|
||||
|
||||
Given an error number returned from a system call (typically
|
||||
returned in errno), returns a pointer to a string containing the
|
||||
symbolic name of that error number, as found in <errno.h>.
|
||||
|
||||
If the supplied error number is within the valid range of indices
|
||||
for symbolic names, but no name is available for the particular
|
||||
error number, then returns the string "Error NUM", where NUM is
|
||||
the error number.
|
||||
|
||||
If the supplied error number is not within the range of valid
|
||||
indices, then returns NULL.
|
||||
|
||||
BUGS
|
||||
|
||||
The contents of the location pointed to are only guaranteed to be
|
||||
valid until the next call to strerrno.
|
||||
|
||||
*/
|
||||
|
||||
char *
|
||||
strerrno (errnoval)
|
||||
int errnoval;
|
||||
{
|
||||
char *name;
|
||||
static char buf[32];
|
||||
|
||||
if (error_names == NULL)
|
||||
{
|
||||
init_error_tables ();
|
||||
}
|
||||
|
||||
if ((errnoval < 0) || (errnoval >= num_error_names))
|
||||
{
|
||||
/* Out of range, just return NULL */
|
||||
name = NULL;
|
||||
}
|
||||
else if ((error_names == NULL) || (error_names[errnoval] == NULL))
|
||||
{
|
||||
/* In range, but no error_names or no entry at this index. */
|
||||
sprintf (buf, "Error %d", errnoval);
|
||||
name = buf;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* In range, and a valid name. Just return the name. */
|
||||
name = error_names[errnoval];
|
||||
}
|
||||
|
||||
return (name);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
NAME
|
||||
|
||||
strtoerrno -- map a symbolic errno name to a numeric value
|
||||
|
||||
SYNOPSIS
|
||||
|
||||
int strtoerrno (char *name)
|
||||
|
||||
DESCRIPTION
|
||||
|
||||
Given the symbolic name of a error number, map it to an errno value.
|
||||
If no translation is found, returns 0.
|
||||
|
||||
*/
|
||||
|
||||
int
|
||||
strtoerrno (name)
|
||||
char *name;
|
||||
{
|
||||
int errnoval = 0;
|
||||
|
||||
if (name != NULL)
|
||||
{
|
||||
if (error_names == NULL)
|
||||
{
|
||||
init_error_tables ();
|
||||
}
|
||||
for (errnoval = 0; errnoval < num_error_names; errnoval++)
|
||||
{
|
||||
if ((error_names[errnoval] != NULL) &&
|
||||
(strcmp (name, error_names[errnoval]) == 0))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (errnoval == num_error_names)
|
||||
{
|
||||
errnoval = 0;
|
||||
}
|
||||
}
|
||||
return (errnoval);
|
||||
}
|
||||
|
||||
|
||||
/* A simple little main that does nothing but print all the errno translations
|
||||
if MAIN is defined and this file is compiled and linked. */
|
||||
|
||||
#ifdef MAIN
|
||||
|
||||
main ()
|
||||
{
|
||||
int errn;
|
||||
int errnmax;
|
||||
char *name;
|
||||
char *msg;
|
||||
char *strerrno ();
|
||||
char *strerror ();
|
||||
|
||||
errnmax = errno_max ();
|
||||
printf ("%d entries in names table.\n", num_error_names);
|
||||
printf ("%d entries in messages table.\n", sys_nerr);
|
||||
printf ("%d is max useful index.\n", errnmax);
|
||||
|
||||
/* Keep printing values until we get to the end of *both* tables, not
|
||||
*either* table. Note that knowing the maximum useful index does *not*
|
||||
relieve us of the responsibility of testing the return pointer for
|
||||
NULL. */
|
||||
|
||||
for (errn = 0; errn <= errnmax; errn++)
|
||||
{
|
||||
name = strerrno (errn);
|
||||
name = (name == NULL) ? "<NULL>" : name;
|
||||
msg = strerror (errn);
|
||||
msg = (msg == NULL) ? "<NULL>" : msg;
|
||||
printf ("%-4d%-18s%s\n", errn, name, msg);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
80
contrib/cvs/lib/strippath.c
Normal file
80
contrib/cvs/lib/strippath.c
Normal file
@ -0,0 +1,80 @@
|
||||
/* strippath.c -- remove unnecessary components from a path specifier
|
||||
Copyright (C) 1992 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#if STDC_HEADERS || HAVE_STRING_H
|
||||
#include <string.h>
|
||||
/* An ANSI string.h and pre-ANSI memory.h might conflict. */
|
||||
#if !STDC_HEADERS && HAVE_MEMORY_H
|
||||
#include <memory.h>
|
||||
#endif /* not STDC_HEADERS and HAVE_MEMORY_H */
|
||||
#else /* not STDC_HJEADERS and not HAVE_STRING_H */
|
||||
#include <strings.h>
|
||||
/* memory.h and strings.h conflict on some systems. */
|
||||
#endif /* not STDC_HEADERS and not HAVE_STRING_H */
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#if __STDC__
|
||||
static void remove_component(char *beginc, char *endc);
|
||||
void strip_trailing_slashes(char *path);
|
||||
#else
|
||||
static void remove_component();
|
||||
void strip_trailing_slashes();
|
||||
#endif /* __STDC__ */
|
||||
|
||||
/* Remove unnecessary components from PATH. */
|
||||
|
||||
void
|
||||
strip_path (path)
|
||||
char *path;
|
||||
{
|
||||
int stripped = 0;
|
||||
char *cp, *slash;
|
||||
|
||||
for (cp = path; (slash = strchr(cp, '/')) != NULL; cp = slash)
|
||||
{
|
||||
*slash = '\0';
|
||||
if ((!*cp && (cp != path || stripped)) ||
|
||||
strcmp(cp, ".") == 0 || strcmp(cp, "/") == 0)
|
||||
{
|
||||
stripped = 1;
|
||||
remove_component(cp, slash);
|
||||
slash = cp;
|
||||
}
|
||||
else
|
||||
{
|
||||
*slash++ = '/';
|
||||
}
|
||||
}
|
||||
strip_trailing_slashes(path);
|
||||
}
|
||||
|
||||
/* Remove the component delimited by BEGINC and ENDC from the path */
|
||||
|
||||
static void
|
||||
remove_component (beginc, endc)
|
||||
char *beginc;
|
||||
char *endc;
|
||||
{
|
||||
for (endc++; *endc; endc++)
|
||||
*beginc++ = *endc;
|
||||
*beginc = '\0';
|
||||
}
|
44
contrib/cvs/lib/stripslash.c
Normal file
44
contrib/cvs/lib/stripslash.c
Normal file
@ -0,0 +1,44 @@
|
||||
/* stripslash.c -- remove trailing slashes from a string
|
||||
Copyright (C) 1990 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#if STDC_HEADERS || HAVE_STRING_H
|
||||
#include <string.h>
|
||||
/* An ANSI string.h and pre-ANSI memory.h might conflict. */
|
||||
#if !STDC_HEADERS && HAVE_MEMORY_H
|
||||
#include <memory.h>
|
||||
#endif /* not STDC_HEADERS and HAVE_MEMORY_H */
|
||||
#else /* not STDC_HJEADERS and not HAVE_STRING_H */
|
||||
#include <strings.h>
|
||||
/* memory.h and strings.h conflict on some systems. */
|
||||
#endif /* not STDC_HEADERS and not HAVE_STRING_H */
|
||||
|
||||
/* Remove trailing slashes from PATH. */
|
||||
|
||||
void
|
||||
strip_trailing_slashes (path)
|
||||
char *path;
|
||||
{
|
||||
int last;
|
||||
|
||||
last = strlen (path) - 1;
|
||||
while (last > 0 && path[last] == '/')
|
||||
path[last--] = '\0';
|
||||
}
|
40
contrib/cvs/lib/strstr.c
Normal file
40
contrib/cvs/lib/strstr.c
Normal file
@ -0,0 +1,40 @@
|
||||
/******************************************************************************
|
||||
* *
|
||||
* s t r s t r *
|
||||
* *
|
||||
* Find the first occurrence of a string in another string. *
|
||||
* *
|
||||
* Format: *
|
||||
* return = strstr(Source,What); *
|
||||
* *
|
||||
* Parameters: *
|
||||
* *
|
||||
* Returns: *
|
||||
* *
|
||||
* Scope: PUBLIC *
|
||||
* *
|
||||
******************************************************************************/
|
||||
|
||||
char *strstr(Source, What)
|
||||
register const char *Source;
|
||||
register const char *What;
|
||||
{
|
||||
register char WhatChar;
|
||||
register char SourceChar;
|
||||
register long Length;
|
||||
|
||||
|
||||
if ((WhatChar = *What++) != 0) {
|
||||
Length = strlen(What);
|
||||
do {
|
||||
do {
|
||||
if ((SourceChar = *Source++) == 0) {
|
||||
return (0);
|
||||
}
|
||||
} while (SourceChar != WhatChar);
|
||||
} while (strncmp(Source, What, Length) != 0);
|
||||
Source--;
|
||||
}
|
||||
return ((char *)Source);
|
||||
|
||||
}/*strstr*/
|
100
contrib/cvs/lib/strtoul.c
Normal file
100
contrib/cvs/lib/strtoul.c
Normal file
@ -0,0 +1,100 @@
|
||||
/*
|
||||
* strtol : convert a string to long.
|
||||
*
|
||||
* Andy Wilson, 2-Oct-89.
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#ifndef ULONG_MAX
|
||||
#define ULONG_MAX ((unsigned long)(~0L)) /* 0xFFFFFFFF */
|
||||
#endif
|
||||
|
||||
extern int errno;
|
||||
|
||||
unsigned long
|
||||
strtoul(s, ptr, base)
|
||||
const char *s; char **ptr; int base;
|
||||
{
|
||||
unsigned long total = 0;
|
||||
unsigned digit;
|
||||
const char *start=s;
|
||||
int did_conversion=0;
|
||||
int overflow = 0;
|
||||
int negate = 0;
|
||||
unsigned long maxdiv, maxrem;
|
||||
|
||||
if (s==NULL)
|
||||
{
|
||||
errno = ERANGE;
|
||||
if (!ptr)
|
||||
*ptr = (char *)start;
|
||||
return 0L;
|
||||
}
|
||||
|
||||
while (isspace(*s))
|
||||
s++;
|
||||
if (*s == '+')
|
||||
s++;
|
||||
else if (*s == '-')
|
||||
s++, negate = 1;
|
||||
if (base==0 || base==16) /* the 'base==16' is for handling 0x */
|
||||
{
|
||||
int tmp;
|
||||
|
||||
/*
|
||||
* try to infer base from the string
|
||||
*/
|
||||
if (*s != '0')
|
||||
tmp = 10; /* doesn't start with 0 - assume decimal */
|
||||
else if (s[1] == 'X' || s[1] == 'x')
|
||||
tmp = 16, s += 2; /* starts with 0x or 0X - hence hex */
|
||||
else
|
||||
tmp = 8; /* starts with 0 - hence octal */
|
||||
if (base==0)
|
||||
base = (int)tmp;
|
||||
}
|
||||
|
||||
maxdiv = ULONG_MAX / base;
|
||||
maxrem = ULONG_MAX % base;
|
||||
|
||||
while ((digit = *s) != '\0')
|
||||
{
|
||||
if (digit >= '0' && digit < ('0'+base))
|
||||
digit -= '0';
|
||||
else
|
||||
if (base > 10)
|
||||
{
|
||||
if (digit >= 'a' && digit < ('a'+(base-10)))
|
||||
digit = digit - 'a' + 10;
|
||||
else if (digit >= 'A' && digit < ('A'+(base-10)))
|
||||
digit = digit - 'A' + 10;
|
||||
else
|
||||
break;
|
||||
}
|
||||
else
|
||||
break;
|
||||
did_conversion = 1;
|
||||
if (total > maxdiv
|
||||
|| (total == maxdiv && digit > maxrem))
|
||||
overflow = 1;
|
||||
total = (total * base) + digit;
|
||||
s++;
|
||||
}
|
||||
if (overflow)
|
||||
{
|
||||
errno = ERANGE;
|
||||
if (ptr != NULL)
|
||||
*ptr = (char *)s;
|
||||
return (ULONG_MAX);
|
||||
}
|
||||
if (ptr != NULL)
|
||||
*ptr = (char *) ((did_conversion) ? (char *)s : (char *)start);
|
||||
return negate ? -total : total;
|
||||
}
|
468
contrib/cvs/lib/system.h
Normal file
468
contrib/cvs/lib/system.h
Normal file
@ -0,0 +1,468 @@
|
||||
/* system-dependent definitions for CVS.
|
||||
Copyright (C) 1989-1992 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
/* $CVSid: @(#)system.h 1.18 94/09/25 $ */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#ifdef STAT_MACROS_BROKEN
|
||||
#undef S_ISBLK
|
||||
#undef S_ISCHR
|
||||
#undef S_ISDIR
|
||||
#undef S_ISREG
|
||||
#undef S_ISFIFO
|
||||
#undef S_ISLNK
|
||||
#undef S_ISSOCK
|
||||
#undef S_ISMPB
|
||||
#undef S_ISMPC
|
||||
#undef S_ISNWK
|
||||
#endif
|
||||
|
||||
/* Not all systems have S_IFMT, but we probably want to use it if we
|
||||
do. See ChangeLog for a more detailed discussion. */
|
||||
|
||||
#if !defined(S_ISBLK) && defined(S_IFBLK)
|
||||
# if defined(S_IFMT)
|
||||
# define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
|
||||
# else
|
||||
# define S_ISBLK(m) ((m) & S_IFBLK)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(S_ISCHR) && defined(S_IFCHR)
|
||||
# if defined(S_IFMT)
|
||||
# define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
|
||||
# else
|
||||
# define S_ISCHR(m) ((m) & S_IFCHR)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(S_ISDIR) && defined(S_IFDIR)
|
||||
# if defined(S_IFMT)
|
||||
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
|
||||
# else
|
||||
# define S_ISDIR(m) ((m) & S_IFDIR)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(S_ISREG) && defined(S_IFREG)
|
||||
# if defined(S_IFMT)
|
||||
# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
|
||||
# else
|
||||
# define S_ISREG(m) ((m) & S_IFREG)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(S_ISFIFO) && defined(S_IFIFO)
|
||||
# if defined(S_IFMT)
|
||||
# define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
|
||||
# else
|
||||
# define S_ISFIFO(m) ((m) & S_IFIFO)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(S_ISLNK) && defined(S_IFLNK)
|
||||
# if defined(S_IFMT)
|
||||
# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
|
||||
# else
|
||||
# define S_ISLNK(m) ((m) & S_IFLNK)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(S_ISSOCK) && defined(S_IFSOCK)
|
||||
# if defined(S_IFMT)
|
||||
# define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
|
||||
# else
|
||||
# define S_ISSOCK(m) ((m) & S_IFSOCK)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(S_ISMPB) && defined(S_IFMPB) /* V7 */
|
||||
# if defined(S_IFMT)
|
||||
# define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB)
|
||||
# define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC)
|
||||
# else
|
||||
# define S_ISMPB(m) ((m) & S_IFMPB)
|
||||
# define S_ISMPC(m) ((m) & S_IFMPC)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(S_ISNWK) && defined(S_IFNWK) /* HP/UX */
|
||||
# if defined(S_IFMT)
|
||||
# define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
|
||||
# else
|
||||
# define S_ISNWK(m) ((m) & S_IFNWK)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_MKFIFO)
|
||||
#define mkfifo(path, mode) (mknod ((path), (mode) | S_IFIFO, 0))
|
||||
#endif
|
||||
|
||||
#ifdef NEED_DECOY_PERMISSIONS /* OS/2, really */
|
||||
|
||||
#define S_IRUSR S_IREAD
|
||||
#define S_IWUSR S_IWRITE
|
||||
#define S_IXUSR S_IEXEC
|
||||
#define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR)
|
||||
#define S_IRGRP S_IREAD
|
||||
#define S_IWGRP S_IWRITE
|
||||
#define S_IXGRP S_IEXEC
|
||||
#define S_IRWXG (S_IRGRP | S_IWGRP | S_IXGRP)
|
||||
#define S_IROTH S_IREAD
|
||||
#define S_IWOTH S_IWRITE
|
||||
#define S_IXOTH S_IEXEC
|
||||
#define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH)
|
||||
|
||||
#else /* ! NEED_DECOY_PERMISSIONS */
|
||||
|
||||
#ifndef S_IRUSR
|
||||
#define S_IRUSR 0400
|
||||
#define S_IWUSR 0200
|
||||
#define S_IXUSR 0100
|
||||
/* Read, write, and execute by owner. */
|
||||
#define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
|
||||
|
||||
#define S_IRGRP (S_IRUSR >> 3) /* Read by group. */
|
||||
#define S_IWGRP (S_IWUSR >> 3) /* Write by group. */
|
||||
#define S_IXGRP (S_IXUSR >> 3) /* Execute by group. */
|
||||
/* Read, write, and execute by group. */
|
||||
#define S_IRWXG (S_IRWXU >> 3)
|
||||
|
||||
#define S_IROTH (S_IRGRP >> 3) /* Read by others. */
|
||||
#define S_IWOTH (S_IWGRP >> 3) /* Write by others. */
|
||||
#define S_IXOTH (S_IXGRP >> 3) /* Execute by others. */
|
||||
/* Read, write, and execute by others. */
|
||||
#define S_IRWXO (S_IRWXG >> 3)
|
||||
#endif /* !def S_IRUSR */
|
||||
#endif /* NEED_DECOY_PERMISSIONS */
|
||||
|
||||
#if defined(POSIX) || defined(HAVE_UNISTD_H)
|
||||
#include <unistd.h>
|
||||
#include <limits.h>
|
||||
#else
|
||||
off_t lseek ();
|
||||
#endif
|
||||
|
||||
#if TIME_WITH_SYS_TIME
|
||||
# include <sys/time.h>
|
||||
# include <time.h>
|
||||
#else
|
||||
# if HAVE_SYS_TIME_H
|
||||
# include <sys/time.h>
|
||||
# else
|
||||
# include <time.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_IO_H
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_DIRECT_H
|
||||
#include <direct.h>
|
||||
#endif
|
||||
|
||||
#ifdef timezone
|
||||
#undef timezone /* needed for sgi */
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_TIMEB_H
|
||||
#include <sys/timeb.h>
|
||||
#else
|
||||
struct timeb {
|
||||
time_t time; /* Seconds since the epoch */
|
||||
unsigned short millitm; /* Field not used */
|
||||
short timezone;
|
||||
short dstflag; /* Field not used */
|
||||
};
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_FTIME) && !defined(HAVE_TIMEZONE)
|
||||
#if !defined(timezone)
|
||||
extern long timezone;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
** MAXPATHLEN and PATH_MAX
|
||||
**
|
||||
** On most systems MAXPATHLEN is defined in sys/param.h to be 1024. Of
|
||||
** those that this is not true, again most define PATH_MAX in limits.h
|
||||
** or sys/limits.h which usually gets included by limits.h. On the few
|
||||
** remaining systems that neither statement is true, _POSIX_PATH_MAX
|
||||
** is defined.
|
||||
**
|
||||
** So:
|
||||
** 1. If PATH_MAX is defined just use it.
|
||||
** 2. If MAXPATHLEN is defined but not PATH_MAX, then define
|
||||
** PATH_MAX in terms of MAXPATHLEN.
|
||||
** 3. If neither is defined, include limits.h and check for
|
||||
** PATH_MAX again.
|
||||
** 3.1 If we now have PATHSIZE, define PATH_MAX in terms of that.
|
||||
** and ignore the rest. Since _POSIX_PATH_MAX (checked for
|
||||
** next) is the *most* restrictive (smallest) value, if we
|
||||
** trust _POSIX_PATH_MAX, several of our buffers are too small.
|
||||
** 4. If PATH_MAX is still not defined but _POSIX_PATH_MAX is,
|
||||
** then define PATH_MAX in terms of _POSIX_PATH_MAX.
|
||||
** 5. And if even _POSIX_PATH_MAX doesn't exist just put in
|
||||
** a reasonable value.
|
||||
** *. All in all, this is an excellent argument for using pathconf()
|
||||
** when at all possible. Or better yet, dynamically allocate
|
||||
** our buffers and use getcwd() not getwd().
|
||||
**
|
||||
** This works on:
|
||||
** Sun Sparc 10 SunOS 4.1.3 & Solaris 1.2
|
||||
** HP 9000/700 HP/UX 8.07 & HP/UX 9.01
|
||||
** Tektronix XD88/10 UTekV 3.2e
|
||||
** IBM RS6000 AIX 3.2
|
||||
** Dec Alpha OSF 1 ????
|
||||
** Intel 386 BSDI BSD/386
|
||||
** Intel 386 SCO OpenServer Release 5
|
||||
** Apollo Domain 10.4
|
||||
** NEC SVR4
|
||||
*/
|
||||
|
||||
/* On MOST systems this will get you MAXPATHLEN.
|
||||
Windows NT doesn't have this file, tho. */
|
||||
#ifdef HAVE_SYS_PARAM_H
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
|
||||
#ifndef PATH_MAX
|
||||
# ifdef MAXPATHLEN
|
||||
# define PATH_MAX MAXPATHLEN
|
||||
# else
|
||||
# include <limits.h>
|
||||
# ifndef PATH_MAX
|
||||
# ifdef PATHSIZE
|
||||
# define PATH_MAX PATHSIZE
|
||||
# else /* no PATHSIZE */
|
||||
# ifdef _POSIX_PATH_MAX
|
||||
# define PATH_MAX _POSIX_PATH_MAX
|
||||
# else
|
||||
# define PATH_MAX 1024
|
||||
# endif /* no _POSIX_PATH_MAX */
|
||||
# endif /* no PATHSIZE */
|
||||
# endif /* no PATH_MAX */
|
||||
# endif /* MAXPATHLEN */
|
||||
#endif /* PATH_MAX */
|
||||
|
||||
|
||||
/* The NeXT (without _POSIX_SOURCE, which we don't want) has a utime.h
|
||||
which doesn't define anything. It would be cleaner to have configure
|
||||
check for struct utimbuf, but for now I'm checking NeXT here (so I don't
|
||||
have to debug the configure check across all the machines). */
|
||||
#if defined (HAVE_UTIME_H) && !defined (NeXT)
|
||||
#include <utime.h>
|
||||
#elif defined (HAVE_SYS_UTIME_H)
|
||||
# include <sys/utime.h>
|
||||
#else
|
||||
#ifndef ALTOS
|
||||
struct utimbuf
|
||||
{
|
||||
long actime;
|
||||
long modtime;
|
||||
};
|
||||
#endif
|
||||
int utime ();
|
||||
#endif
|
||||
|
||||
#if STDC_HEADERS || HAVE_STRING_H
|
||||
# include <string.h>
|
||||
/* An ANSI string.h and pre-ANSI memory.h might conflict. */
|
||||
# if !STDC_HEADERS && HAVE_MEMORY_H
|
||||
# include <memory.h>
|
||||
# endif /* not STDC_HEADERS and HAVE_MEMORY_H */
|
||||
#else /* not STDC_HEADERS and not HAVE_STRING_H */
|
||||
# include <strings.h>
|
||||
/* memory.h and strings.h conflict on some systems. */
|
||||
#endif /* not STDC_HEADERS and not HAVE_STRING_H */
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
/* Not all systems set the same error code on a non-existent-file
|
||||
error. This tries to ask the question somewhat portably.
|
||||
On systems that don't have ENOTEXIST, this should behave just like
|
||||
x == ENOENT. "x" is probably errno, of course. */
|
||||
|
||||
#ifdef ENOTEXIST
|
||||
# ifdef EOS2ERR
|
||||
# define existence_error(x) \
|
||||
(((x) == ENOTEXIST) || ((x) == ENOENT) || ((x) == EOS2ERR))
|
||||
# else
|
||||
# define existence_error(x) \
|
||||
(((x) == ENOTEXIST) || ((x) == ENOENT))
|
||||
# endif
|
||||
#else
|
||||
# ifdef EVMSERR
|
||||
# define existence_error(x) \
|
||||
((x) == ENOENT || (x) == EINVAL || (x) == EVMSERR)
|
||||
# else
|
||||
# define existence_error(x) ((x) == ENOENT)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef STDC_HEADERS
|
||||
#include <stdlib.h>
|
||||
#else
|
||||
char *getenv ();
|
||||
char *malloc ();
|
||||
char *realloc ();
|
||||
char *calloc ();
|
||||
extern int errno;
|
||||
#endif
|
||||
|
||||
/* SunOS4 apparently does not define this in stdlib.h. */
|
||||
#ifndef EXIT_FAILURE
|
||||
#define EXIT_FAILURE 1
|
||||
#endif
|
||||
|
||||
#if defined(USG) || defined(POSIX)
|
||||
char *getcwd ();
|
||||
#else
|
||||
char *getwd ();
|
||||
#endif
|
||||
|
||||
/* check for POSIX signals */
|
||||
#if defined(HAVE_SIGACTION) && defined(HAVE_SIGPROCMASK)
|
||||
# define POSIX_SIGNALS
|
||||
#endif
|
||||
|
||||
/* MINIX 1.6 doesn't properly support sigaction */
|
||||
#if defined(_MINIX)
|
||||
# undef POSIX_SIGNALS
|
||||
#endif
|
||||
|
||||
/* If !POSIX, try for BSD.. Reason: 4.4BSD implements these as wrappers */
|
||||
#if !defined(POSIX_SIGNALS)
|
||||
# if defined(HAVE_SIGVEC) && defined(HAVE_SIGSETMASK) && defined(HAVE_SIGBLOCK)
|
||||
# define BSD_SIGNALS
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Under OS/2, this must be included _after_ stdio.h; that's why we do
|
||||
it here. */
|
||||
#ifdef USE_OWN_TCPIP_H
|
||||
#include "tcpip.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_FCNTL_H
|
||||
#include <fcntl.h>
|
||||
#else
|
||||
#include <sys/file.h>
|
||||
#endif
|
||||
|
||||
#ifndef SEEK_SET
|
||||
#define SEEK_SET 0
|
||||
#define SEEK_CUR 1
|
||||
#define SEEK_END 2
|
||||
#endif
|
||||
|
||||
#ifndef F_OK
|
||||
#define F_OK 0
|
||||
#define X_OK 1
|
||||
#define W_OK 2
|
||||
#define R_OK 4
|
||||
#endif
|
||||
|
||||
#if HAVE_DIRENT_H
|
||||
# include <dirent.h>
|
||||
# define NAMLEN(dirent) strlen((dirent)->d_name)
|
||||
#else
|
||||
# define dirent direct
|
||||
# define NAMLEN(dirent) (dirent)->d_namlen
|
||||
# if HAVE_SYS_NDIR_H
|
||||
# include <sys/ndir.h>
|
||||
# endif
|
||||
# if HAVE_SYS_DIR_H
|
||||
# include <sys/dir.h>
|
||||
# endif
|
||||
# if HAVE_NDIR_H
|
||||
# include <ndir.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Convert B 512-byte blocks to kilobytes if K is nonzero,
|
||||
otherwise return it unchanged. */
|
||||
#define convert_blocks(b, k) ((k) ? ((b) + 1) / 2 : (b))
|
||||
|
||||
#ifndef S_ISLNK
|
||||
#define lstat stat
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Some UNIX distributions don't include these in their stat.h Defined here
|
||||
* because "config.h" is always included last.
|
||||
*/
|
||||
#ifndef S_IWRITE
|
||||
#define S_IWRITE 0000200 /* write permission, owner */
|
||||
#endif
|
||||
#ifndef S_IWGRP
|
||||
#define S_IWGRP 0000020 /* write permission, grougroup */
|
||||
#endif
|
||||
#ifndef S_IWOTH
|
||||
#define S_IWOTH 0000002 /* write permission, other */
|
||||
#endif
|
||||
|
||||
/* Under MS-DOS and its derivatives (like Windows NT), mkdir takes only one
|
||||
argument; permission is handled very differently on those systems than in
|
||||
in Unix. So we leave such systems a hook on which they can hang their
|
||||
own definitions. */
|
||||
#ifndef CVS_MKDIR
|
||||
#define CVS_MKDIR mkdir
|
||||
#endif
|
||||
|
||||
/* Some file systems are case-insensitive. If FOLD_FN_CHAR is
|
||||
#defined, it maps the character C onto its "canonical" form. In a
|
||||
case-insensitive system, it would map all alphanumeric characters
|
||||
to lower case. Under Windows NT, / and \ are both path component
|
||||
separators, so FOLD_FN_CHAR would map them both to /. */
|
||||
#ifndef FOLD_FN_CHAR
|
||||
#define FOLD_FN_CHAR(c) (c)
|
||||
#define fnfold(filename) (filename)
|
||||
#define fncmp strcmp
|
||||
#endif
|
||||
|
||||
/* Different file systems have different path component separators.
|
||||
For the VMS port we might need to abstract further back than this. */
|
||||
#ifndef ISDIRSEP
|
||||
#define ISDIRSEP(c) ((c) == '/')
|
||||
#endif
|
||||
|
||||
|
||||
/* On some systems, lines in text files should be terminated with CRLF,
|
||||
not just LF, and the read and write routines do this translation
|
||||
for you. LINES_CRLF_TERMINATED is #defined on such systems.
|
||||
- OPEN_BINARY is the flag to pass to the open function for
|
||||
untranslated I/O.
|
||||
- FOPEN_BINARY_READ is the string to pass to fopen to get
|
||||
untranslated reading.
|
||||
- FOPEN_BINARY_WRITE is the string to pass to fopen to get
|
||||
untranslated writing. */
|
||||
#if LINES_CRLF_TERMINATED
|
||||
#define OPEN_BINARY (O_BINARY)
|
||||
#define FOPEN_BINARY_READ ("rb")
|
||||
#define FOPEN_BINARY_WRITE ("wb")
|
||||
#else
|
||||
#define OPEN_BINARY (0)
|
||||
#define FOPEN_BINARY_READ ("r")
|
||||
#define FOPEN_BINARY_WRITE ("w")
|
||||
#endif
|
25
contrib/cvs/lib/valloc.c
Normal file
25
contrib/cvs/lib/valloc.c
Normal file
@ -0,0 +1,25 @@
|
||||
/* valloc -- return memory aligned to the page size. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "system.h"
|
||||
|
||||
#ifndef HAVE_GETPAGESIZE
|
||||
#define getpagesize() 4096
|
||||
#endif
|
||||
|
||||
void *
|
||||
valloc (bytes)
|
||||
size_t bytes;
|
||||
{
|
||||
long pagesize;
|
||||
char *ret;
|
||||
|
||||
pagesize = getpagesize ();
|
||||
ret = (char *) malloc (bytes + pagesize - 1);
|
||||
if (ret)
|
||||
ret = (char *) ((long) (ret + pagesize - 1) &~ (pagesize - 1));
|
||||
return ret;
|
||||
}
|
171
contrib/cvs/lib/vasprintf.c
Normal file
171
contrib/cvs/lib/vasprintf.c
Normal file
@ -0,0 +1,171 @@
|
||||
/* Like vsprintf but provides a pointer to malloc'd storage, which must
|
||||
be freed by the caller.
|
||||
Copyright (C) 1994 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the libiberty library.
|
||||
Libiberty is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
Libiberty is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with libiberty; see the file COPYING.LIB. If
|
||||
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#ifdef __STDC__
|
||||
#include <stdarg.h>
|
||||
#else
|
||||
#include <varargs.h>
|
||||
#endif
|
||||
|
||||
extern int abs ();
|
||||
|
||||
#ifdef TEST
|
||||
int global_total_width;
|
||||
#endif
|
||||
|
||||
unsigned long strtoul ();
|
||||
char *malloc ();
|
||||
|
||||
static int
|
||||
int_vasprintf (result, format, args)
|
||||
char **result;
|
||||
const char *format;
|
||||
va_list *args;
|
||||
{
|
||||
const char *p = format;
|
||||
/* Add one to make sure that it is never zero, which might cause malloc
|
||||
to return NULL. */
|
||||
int total_width = strlen (format) + 1;
|
||||
va_list ap;
|
||||
|
||||
memcpy (&ap, args, sizeof (va_list));
|
||||
|
||||
while (*p != '\0')
|
||||
{
|
||||
if (*p++ == '%')
|
||||
{
|
||||
while (strchr ("-+ #0", *p))
|
||||
++p;
|
||||
if (*p == '*')
|
||||
{
|
||||
++p;
|
||||
total_width += abs (va_arg (ap, int));
|
||||
}
|
||||
else
|
||||
total_width += strtoul (p, &p, 10);
|
||||
if (*p == '.')
|
||||
{
|
||||
++p;
|
||||
if (*p == '*')
|
||||
{
|
||||
++p;
|
||||
total_width += abs (va_arg (ap, int));
|
||||
}
|
||||
else
|
||||
total_width += strtoul (p, &p, 10);
|
||||
}
|
||||
while (strchr ("hlL", *p))
|
||||
++p;
|
||||
/* Should be big enough for any format specifier except %s. */
|
||||
total_width += 30;
|
||||
switch (*p)
|
||||
{
|
||||
case 'd':
|
||||
case 'i':
|
||||
case 'o':
|
||||
case 'u':
|
||||
case 'x':
|
||||
case 'X':
|
||||
case 'c':
|
||||
(void) va_arg (ap, int);
|
||||
break;
|
||||
case 'f':
|
||||
case 'e':
|
||||
case 'E':
|
||||
case 'g':
|
||||
case 'G':
|
||||
(void) va_arg (ap, double);
|
||||
break;
|
||||
case 's':
|
||||
total_width += strlen (va_arg (ap, char *));
|
||||
break;
|
||||
case 'p':
|
||||
case 'n':
|
||||
(void) va_arg (ap, char *);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifdef TEST
|
||||
global_total_width = total_width;
|
||||
#endif
|
||||
*result = malloc (total_width);
|
||||
if (*result != NULL)
|
||||
return vsprintf (*result, format, *args);
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
vasprintf (result, format, args)
|
||||
char **result;
|
||||
const char *format;
|
||||
va_list args;
|
||||
{
|
||||
return int_vasprintf (result, format, &args);
|
||||
}
|
||||
|
||||
#ifdef TEST
|
||||
void
|
||||
checkit
|
||||
#ifdef __STDC__
|
||||
(const char* format, ...)
|
||||
#else
|
||||
(va_alist)
|
||||
va_dcl
|
||||
#endif
|
||||
{
|
||||
va_list args;
|
||||
char *result;
|
||||
|
||||
#ifdef __STDC__
|
||||
va_start (args, format);
|
||||
#else
|
||||
char *format;
|
||||
va_start (args);
|
||||
format = va_arg (args, char *);
|
||||
#endif
|
||||
vasprintf (&result, format, args);
|
||||
if (strlen (result) < global_total_width)
|
||||
printf ("PASS: ");
|
||||
else
|
||||
printf ("FAIL: ");
|
||||
printf ("%d %s\n", global_total_width, result);
|
||||
}
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
checkit ("%d", 0x12345678);
|
||||
checkit ("%200d", 5);
|
||||
checkit ("%.300d", 6);
|
||||
checkit ("%100.150d", 7);
|
||||
checkit ("%s", "jjjjjjjjjiiiiiiiiiiiiiiioooooooooooooooooppppppppppppaa\n\
|
||||
777777777777777777333333333333366666666666622222222222777777777777733333");
|
||||
checkit ("%f%s%d%s", 1.0, "foo", 77, "asdjffffffffffffffiiiiiiiiiiixxxxx");
|
||||
}
|
||||
#endif /* TEST */
|
32
contrib/cvs/lib/wait.h
Normal file
32
contrib/cvs/lib/wait.h
Normal file
@ -0,0 +1,32 @@
|
||||
/* wait.h -- POSIX macros for evaluating exit statuses
|
||||
Copyright (C) 1990 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#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)
|
||||
#define WIFSIGNALED(w) (((w) & 0xff) != 0x7f && ((w) & 0xff) != 0)
|
||||
#define WIFEXITED(w) (((w) & 0xff) == 0)
|
||||
|
||||
#define WSTOPSIG(w) (((w) >> 8) & 0xff)
|
||||
#define WTERMSIG(w) ((w) & 0x7f)
|
||||
#define WEXITSTATUS(w) (((w) >> 8) & 0xff)
|
||||
#endif
|
76
contrib/cvs/lib/waitpid.c
Normal file
76
contrib/cvs/lib/waitpid.c
Normal file
@ -0,0 +1,76 @@
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "system.h"
|
||||
#include "wait.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
struct unreaped {
|
||||
pid_t pid;
|
||||
int status;
|
||||
};
|
||||
static struct unreaped *unreaped;
|
||||
static int n;
|
||||
|
||||
static struct unreaped *ualloc (oldptr, n)
|
||||
struct unreaped *oldptr;
|
||||
int n;
|
||||
{
|
||||
n *= sizeof (struct unreaped);
|
||||
if (n == 0)
|
||||
n = 1;
|
||||
if (oldptr)
|
||||
oldptr = (struct unreaped *) realloc ((char *) oldptr, n);
|
||||
else
|
||||
oldptr = (struct unreaped *) malloc (n);
|
||||
if (oldptr == 0)
|
||||
{
|
||||
fprintf (stderr, "cannot allocate %d bytes\n", n);
|
||||
exit (1);
|
||||
}
|
||||
return oldptr;
|
||||
}
|
||||
|
||||
pid_t waitpid (pid, status, options)
|
||||
pid_t pid;
|
||||
int *status;
|
||||
int options;
|
||||
{
|
||||
int i;
|
||||
|
||||
/* initialize */
|
||||
if (unreaped == 0)
|
||||
{
|
||||
unreaped = ualloc (unreaped, 1);
|
||||
unreaped[0].pid = 0;
|
||||
n = 1;
|
||||
}
|
||||
|
||||
for (i = 0; unreaped[i].pid; i++)
|
||||
if (unreaped[i].pid == pid)
|
||||
{
|
||||
*status = unreaped[i].status;
|
||||
while (unreaped[i].pid)
|
||||
{
|
||||
unreaped[i] = unreaped[i+1];
|
||||
i++;
|
||||
}
|
||||
n--;
|
||||
return pid;
|
||||
}
|
||||
|
||||
while (1)
|
||||
{
|
||||
pid_t p = wait3 (status, options, (struct rusage *) 0);
|
||||
|
||||
if (p == 0 || p == -1 || p == pid)
|
||||
return p;
|
||||
|
||||
n++;
|
||||
unreaped = ualloc (unreaped, n);
|
||||
unreaped[n-1].pid = p;
|
||||
unreaped[n-1].status = *status;
|
||||
}
|
||||
}
|
79
contrib/cvs/lib/xgetwd.c
Normal file
79
contrib/cvs/lib/xgetwd.c
Normal file
@ -0,0 +1,79 @@
|
||||
/* xgetwd.c -- return current directory with unlimited length
|
||||
Copyright (C) 1992 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
/* Derived from xgetcwd.c in e.g. the GNU sh-utils. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include "system.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#ifndef errno
|
||||
extern int errno;
|
||||
#endif
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifndef HAVE_GETWD
|
||||
char *getwd ();
|
||||
#define GETWD(buf, max) getwd (buf)
|
||||
#else
|
||||
char *getcwd ();
|
||||
#define GETWD(buf, max) getcwd (buf, max)
|
||||
#endif
|
||||
|
||||
/* Amount by which to increase buffer size when allocating more space. */
|
||||
#define PATH_INCR 32
|
||||
|
||||
char *xmalloc ();
|
||||
char *xrealloc ();
|
||||
|
||||
/* Return the current directory, newly allocated, arbitrarily long.
|
||||
Return NULL and set errno on error. */
|
||||
|
||||
char *
|
||||
xgetwd ()
|
||||
{
|
||||
char *cwd;
|
||||
char *ret;
|
||||
unsigned path_max;
|
||||
|
||||
errno = 0;
|
||||
path_max = (unsigned) PATH_MAX;
|
||||
path_max += 2; /* The getcwd docs say to do this. */
|
||||
|
||||
cwd = xmalloc (path_max);
|
||||
|
||||
errno = 0;
|
||||
while ((ret = GETWD (cwd, path_max)) == NULL && errno == ERANGE)
|
||||
{
|
||||
path_max += PATH_INCR;
|
||||
cwd = xrealloc (cwd, path_max);
|
||||
errno = 0;
|
||||
}
|
||||
|
||||
if (ret == NULL)
|
||||
{
|
||||
int save_errno = errno;
|
||||
free (cwd);
|
||||
errno = save_errno;
|
||||
return NULL;
|
||||
}
|
||||
return cwd;
|
||||
}
|
42
contrib/cvs/lib/yesno.c
Normal file
42
contrib/cvs/lib/yesno.c
Normal file
@ -0,0 +1,42 @@
|
||||
/* yesno.c -- read a yes/no response from stdin
|
||||
Copyright (C) 1990 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
/* Read one line from standard input
|
||||
and return nonzero if that line begins with y or Y,
|
||||
otherwise return 0. */
|
||||
|
||||
int
|
||||
yesno ()
|
||||
{
|
||||
int c;
|
||||
int rv;
|
||||
|
||||
fflush (stderr);
|
||||
fflush (stdout);
|
||||
c = getchar ();
|
||||
rv = (c == 'y') || (c == 'Y');
|
||||
while (c != EOF && c != '\n')
|
||||
c = getchar ();
|
||||
|
||||
return rv;
|
||||
}
|
141
contrib/cvs/man/ChangeLog
Normal file
141
contrib/cvs/man/ChangeLog
Normal file
@ -0,0 +1,141 @@
|
||||
Wed Mar 13 17:06:39 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* cvsinit.8: Removed.
|
||||
* Makefile.in, cvs.1, cvs.5: Remove references to cvsinit.
|
||||
|
||||
Tue Feb 13 22:30:54 1996 Samuel Tardieu <sam@inf.enst.fr>
|
||||
|
||||
* Makefile.in: Remove reference to mkmodules.1
|
||||
|
||||
Mon Feb 12 16:30:40 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* cvs.1, cvsinit.8: Remove references to mkmodules, rm, sort
|
||||
* cvs.5: Remove references to mkmodules.
|
||||
* mkmodules.1: Removed.
|
||||
|
||||
Tue Jan 30 18:32:27 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* Makefile.in: Revise comment regarding install and installdirs.
|
||||
|
||||
Tue Nov 14 15:47:44 1995 Greg A. Woods <woods@most.weird.com>
|
||||
|
||||
* cvs.5:
|
||||
- list filenames in alpha sort order
|
||||
- describe the cvswrappers file
|
||||
- describe the taginfo file
|
||||
- fix cvsinit chapter number
|
||||
(This is by no means complete -- it's just stuff I noticed.)
|
||||
|
||||
* cvs.1: put the filenames in alpha sort order
|
||||
|
||||
* cvsinit.8: remove the .pl extension from filenames
|
||||
|
||||
Wed Oct 18 11:07:07 1995 Vince Demarco <vdemarco@bou.shl.com>
|
||||
|
||||
* cvs.1 (Flag): Updated the CVSROOT/wrappers stuff. Everyone seems
|
||||
to think this is a NEXT specific thing it isn't.
|
||||
|
||||
Tue Oct 17 17:38:27 1995 Warren Jones <wjones@tc.fluke.com>
|
||||
|
||||
* cvs.1: Change \. to \&. at start of line.
|
||||
|
||||
Tue Oct 3 13:43:33 1995 Del <del@matra.com.au>
|
||||
|
||||
* cvs.1: Updated man page for all the new features of 1.6
|
||||
(including some that were missed in 1.5 and 1.4.xx). This includes:
|
||||
- -f and -z global options.
|
||||
- tag -F, and -r options.
|
||||
- rtag -F options
|
||||
- CVSROOT/taginfo and CVSROOT/wrappers files (the latter could use a touch
|
||||
up because I don't really understand how wrappers work or why anyone would
|
||||
use them -- I haven't ever played with a NEXT.
|
||||
- export -k option
|
||||
- New environment variables CVS_IGNORE_REMOTE_ROOT, CVS_RSH, CVS_SERVER, and
|
||||
CVSWRAPPERS. I left CVS_CLIENT_LOG, CVS_CLIENT_PORT, and CVS_SERVER_SLEEP
|
||||
undocumented because these appear to be for testing / debugging only.
|
||||
Note that TMPDIR, HOME and PATH are used as well and strictly speaking
|
||||
should be documented.
|
||||
- New files ~/.cvsrc and ~/.cvswrappers
|
||||
|
||||
Tue Aug 15 08:13:14 1995 Karl Fogel <kfogel@floss.cyclic.com>
|
||||
|
||||
* Makefile.in (MANFILES): include $MAN8FILES too, so they get
|
||||
tarred up in the distribution just like anything else.
|
||||
|
||||
Mon Jul 24 19:11:15 1995 James Kingdon <kingdon@harvey.cyclic.com>
|
||||
|
||||
* cvs.1: Remove references to -q and -Q command options.
|
||||
|
||||
Fri Jul 14 23:30:33 1995 Jim Blandy <jimb@totoro.cyclic.com>
|
||||
|
||||
* Makefile.in (prefix): Don't forget to give this a value.
|
||||
|
||||
Sun Jul 9 21:22:56 1995 Karl Fogel <kfogel@floss.cyclic.com>
|
||||
|
||||
Greg Woods' change:
|
||||
|
||||
* cvsbug.8, cvsinit.8: new files.
|
||||
|
||||
Sun Jul 9 19:03:00 1995 Greg A. Woods <woods@most.weird.com>
|
||||
|
||||
* cvs.1: document 'cvs status [-qQ]'
|
||||
- note reference to cvsinit(8) and cvsbug(8)
|
||||
(from previous local changes)
|
||||
|
||||
* Makefile.in: add support for installing in man8, and new cvsbug
|
||||
and cvsinit pages (from previous local changes)
|
||||
|
||||
Sat May 27 08:46:00 1995 Jim Meyering (meyering@comco.com)
|
||||
|
||||
* Makefile.in (Makefile): Regenerate only Makefile in current
|
||||
directory when Makefile.in is out of date. Depend on ../config.status.
|
||||
|
||||
Fri Apr 28 22:51:31 1995 Jim Blandy <jimb@totoro.bio.indiana.edu>
|
||||
|
||||
* Makefile.in (DISTFILES): Updated.
|
||||
(dist-dir): Renamed from dist; changed to work with DISTDIR
|
||||
variable passed from parent.
|
||||
|
||||
Fri Jul 15 12:58:14 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
|
||||
|
||||
* Makefile.in (install): Do not depend upon installdirs.
|
||||
|
||||
Sat Dec 18 01:23:13 1993 david d zuhn (zoo@monad.armadillo.com)
|
||||
|
||||
* Makefile.in (VPATH): don't use $(srcdir), but @srcdir@ instead
|
||||
|
||||
Mon Jun 14 12:20:33 1993 david d `zoo' zuhn (zoo at rtl.cygnus.com)
|
||||
|
||||
* Makefile.in (install): remove parentdir support
|
||||
|
||||
Mon Aug 31 01:42:43 1992 david d [zoo] zuhn (zoo at cirdan.cygnus.com)
|
||||
|
||||
* Makefile.in (install): create $(man1dir) and $(man5dir) before
|
||||
installing the man pages
|
||||
|
||||
Wed Feb 26 18:04:40 1992 K. Richard Pixley (rich@cygnus.com)
|
||||
|
||||
* Makefile.in, configure.in: removed traces of namesubdir,
|
||||
-subdirs, $(subdir), $(unsubdir), some rcs triggers. Forced
|
||||
copyrights to '92, changed some from Cygnus to FSF.
|
||||
|
||||
Tue Dec 10 04:07:08 1991 K. Richard Pixley (rich at rtl.cygnus.com)
|
||||
|
||||
* Makefile.in: infodir belongs in datadir.
|
||||
|
||||
Tue Dec 10 03:59:10 1991 K. Richard Pixley (rich at cygnus.com)
|
||||
|
||||
* cvs.man: small correction to an explanation of an example.
|
||||
|
||||
Thu Dec 5 22:45:59 1991 K. Richard Pixley (rich at rtl.cygnus.com)
|
||||
|
||||
* Makefile.in: idestdir and ddestdir go away. Added copyrights
|
||||
and shift gpl to v2. Added ChangeLog if it didn't exist. docdir
|
||||
and mandir now keyed off datadir by default.
|
||||
|
||||
Wed Nov 27 02:46:20 1991 K. Richard Pixley (rich at sendai)
|
||||
|
||||
* brought Makefile.in's up to standards.text.
|
||||
|
||||
* fresh changelog.
|
||||
|
96
contrib/cvs/man/Makefile.in
Normal file
96
contrib/cvs/man/Makefile.in
Normal file
@ -0,0 +1,96 @@
|
||||
# Makefile for GNU CVS documentation.
|
||||
# Do not use this makefile directly, but only from `../Makefile'.
|
||||
# Copyright (C) 1986-1992 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
SHELL = /bin/sh
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
MAN1FILES = cvs.1
|
||||
MAN5FILES = cvs.5
|
||||
MAN8FILES = cvsbug.8
|
||||
MANFILES = $(MAN1FILES) $(MAN5FILES) $(MAN8FILES)
|
||||
|
||||
DISTFILES = .cvsignore ChangeLog Makefile.in $(MANFILES)
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = $(INSTALL)
|
||||
prefix = @prefix@
|
||||
mandir = $(prefix)/man
|
||||
man1dir = $(mandir)/man1
|
||||
man5dir = $(mandir)/man5
|
||||
man8dir = $(mandir)/man8
|
||||
|
||||
all:
|
||||
.PHONY: all
|
||||
|
||||
# This used to depend on installdirs, but someone took it out (I think
|
||||
# maybe it is/was some kind of Cygnus convention to not depend on installdirs;
|
||||
# I'm not sure). I don't know what the pro(s) and con(s) are.
|
||||
install: all
|
||||
for f in $(MAN1FILES); do \
|
||||
$(INSTALL_DATA) $(srcdir)/$$f $(man1dir)/$$f; \
|
||||
done
|
||||
for f in $(MAN5FILES); do \
|
||||
$(INSTALL_DATA) $(srcdir)/$$f $(man5dir)/$$f; \
|
||||
done
|
||||
for f in $(MAN8FILES); do \
|
||||
$(INSTALL_DATA) $(srcdir)/$$f $(man8dir)/$$f; \
|
||||
done
|
||||
|
||||
installdirs:
|
||||
$(SHELL) $(top_srcdir)/mkinstalldirs $(man1dir) $(man5dir) $(man8dir)
|
||||
|
||||
.PHONY: install installdirs
|
||||
|
||||
tags:
|
||||
.PHONY: tags
|
||||
|
||||
TAGS:
|
||||
.PHONY: TAGS
|
||||
|
||||
ls:
|
||||
@true
|
||||
.PHONY: ls
|
||||
|
||||
clean:
|
||||
.PHONY: clean
|
||||
|
||||
distclean: clean
|
||||
rm -f Makefile
|
||||
.PHONY: distclean
|
||||
|
||||
realclean: distclean
|
||||
.PHONY: realclean
|
||||
|
||||
dist-dir:
|
||||
mkdir ${DISTDIR}
|
||||
for i in ${DISTFILES}; do \
|
||||
ln $(srcdir)/$${i} ${DISTDIR}; \
|
||||
done
|
||||
.PHONY: dist-dir
|
||||
|
||||
subdir = man
|
||||
Makefile: ../config.status Makefile.in
|
||||
cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
|
||||
|
||||
#../config.status: ../configure
|
||||
# cd .. ; $(SHELL) config.status --recheck
|
||||
|
||||
#../configure: ../configure.in
|
||||
# cd $(top_srcdir) ; autoconf
|
2181
contrib/cvs/man/cvs.1
Normal file
2181
contrib/cvs/man/cvs.1
Normal file
File diff suppressed because it is too large
Load Diff
325
contrib/cvs/man/cvs.5
Normal file
325
contrib/cvs/man/cvs.5
Normal file
@ -0,0 +1,325 @@
|
||||
.TH cvs 5 "12 February 1992"
|
||||
.\" Full space in nroff; half space in troff
|
||||
.de SP
|
||||
.if n .sp
|
||||
.if t .sp .5
|
||||
..
|
||||
.SH NAME
|
||||
cvs \- Concurrent Versions System support files
|
||||
.SH SYNOPSIS
|
||||
.hy 0
|
||||
.na
|
||||
.TP
|
||||
.B $CVSROOT/CVSROOT/commitinfo,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
|
||||
.B cvs
|
||||
is a system for providing source control to hierarchical collections
|
||||
of source directories. Commands and procedures for using \fBcvs\fP
|
||||
are described in
|
||||
.BR cvs ( 1 ).
|
||||
.SP
|
||||
.B cvs
|
||||
manages \fIsource repositories\fP, the directories containing master
|
||||
copies of the revision-controlled files, by copying particular
|
||||
revisions of the files to (and modifications back from) developers'
|
||||
private \fIworking directories\fP. In terms of file structure, each
|
||||
individual source repository is an immediate subdirectory of
|
||||
\fB$CVSROOT\fP.
|
||||
.SP
|
||||
The files described here are supporting files; they do not have to
|
||||
exist for \fBcvs\fP to operate, but they allow you to make \fBcvs\fP
|
||||
operation more flexible.
|
||||
.SP
|
||||
You can use the `\|modules\|' file to define symbolic names for
|
||||
collections of source maintained with \fBcvs\fP. If there is no
|
||||
`\|modules\|' file, developers must specify complete path names
|
||||
(absolute, or relative to \fB$CVSROOT\fP) for the files they wish to
|
||||
manage with \fBcvs\fP commands.
|
||||
.SP
|
||||
You can use the `\|commitinfo\|' file to define programs to execute
|
||||
whenever `\|\fBcvs commit\fP\|' is about to execute.
|
||||
These programs are used for ``pre-commit'' checking to verify that the
|
||||
modified, added, and removed files are really ready to be committed.
|
||||
Some uses for this check might be to turn off a portion (or all) of the
|
||||
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 ,
|
||||
which writes a log entry for changes in the repository.
|
||||
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
|
||||
editing/validating `\|\fBcvs commit\fP\|' log entries.
|
||||
This is most useful when used with a `\|rcsinfo\|' forms specification, as
|
||||
it can verify that the proper fields of the form have been filled in by the
|
||||
user committing the change.
|
||||
.SP
|
||||
You can use the `\|cvsignore\|' file to specify the default list of
|
||||
files to ignore during \fBupdate\fP.
|
||||
.SP
|
||||
You can use the `\|history\|' file to record the \fBcvs\fP commands
|
||||
that affect the repository.
|
||||
The creation of this file enables history logging.
|
||||
.SH FILES
|
||||
.TP
|
||||
.B modules
|
||||
The `\|modules\|' file records your definitions of names for
|
||||
collections of source code. \fBcvs\fP will use these definitions if
|
||||
you use \fBcvs\fP to check in a file with the right format to
|
||||
`\|\fB$CVSROOT/CVSROOT/modules,v\fP\|'.
|
||||
.SP
|
||||
The `\|modules\|' file may contain blank lines and comments (lines
|
||||
beginning with `\|\fB#\fP\|') as well as module definitions.
|
||||
Long lines can be continued on the next line by specifying a backslash
|
||||
(``\e'') as the last character on the line.
|
||||
.SP
|
||||
A \fImodule definition\fP is a single line of the `\|modules\|' file,
|
||||
in either of two formats. In both cases, \fImname\fP represents the
|
||||
symbolic module name, and the remainder of the line is its definition.
|
||||
.SP
|
||||
\fImname\fP \fB\-a\fP \fIaliases\fP\|.\|.\|.
|
||||
.br
|
||||
This represents the simplest way of defining a module \fImname\fP.
|
||||
The `\|\fB\-a\fP\|' flags the definition as a simple alias: \fBcvs\fP
|
||||
will treat any use of \fImname\fP (as a command argument) as if the list
|
||||
of names \fIaliases\fP had been specified instead. \fIaliases\fP may
|
||||
contain either other module names or paths. When you use paths in
|
||||
\fIaliases\fP, `\|\fBcvs checkout\fP\|' creates all intermediate
|
||||
directories in the working directory, just as if the path had been
|
||||
specified explicitly in the \fBcvs\fP arguments.
|
||||
.SP
|
||||
.nf
|
||||
\fImname\fP [ \fIoptions\fP ] \fIdir\fP [ \fIfiles\fP\|.\|.\|. ] [ \fB&\fP\fImodule\fP\|.\|.\|. ]
|
||||
.fi
|
||||
.SP
|
||||
In the simplest case, this form of module definition reduces to
|
||||
`\|\fImname dir\fP\|'. This defines all the files in directory
|
||||
\fIdir\fP as module \fImname\fP. \fIdir\fP is a relative path (from
|
||||
\fB$CVSROOT\fP) to a directory of source in one of the source
|
||||
repositories. In this case, on \fBcheckout\fP, a single directory
|
||||
called \fImname\fP is created as a working directory; no intermediate
|
||||
directory levels are used by default, even if \fIdir\fP was a path
|
||||
involving several directory levels.
|
||||
.SP
|
||||
By explicitly specifying \fIfiles\fP in the module definition after
|
||||
\fIdir\fP, you can select particular files from directory
|
||||
\fIdir\fP. The sample definition for \fBmodules\fP is an example of
|
||||
a module defined with a single file from a particular directory. Here
|
||||
is another example:
|
||||
.SP
|
||||
.nf
|
||||
.ft B
|
||||
m4test unsupported/gnu/m4 foreach.m4 forloop.m4
|
||||
.ft P
|
||||
.fi
|
||||
.SP
|
||||
With this definition, executing `\|\fBcvs checkout m4test\fP\|'
|
||||
will create a single working directory `\|m4test\|' containing the two
|
||||
files listed, which both come from a common directory several levels
|
||||
deep in the \fBcvs\fP source repository.
|
||||
.SP
|
||||
A module definition can refer to other modules by including
|
||||
`\|\fB&\fP\fImodule\fP\|' in its definition. \fBcheckout\fP creates
|
||||
a subdirectory for each such \fImodule\fP, in your working directory.
|
||||
.br
|
||||
.I
|
||||
New in \fBcvs\fP 1.3;
|
||||
avoid this feature if sharing module definitions with older versions
|
||||
of \fBcvs\fP.
|
||||
.SP
|
||||
Finally, you can use one or more of the following \fIoptions\fP in
|
||||
module definitions:
|
||||
.SP
|
||||
\&`\|\fB\-d\fP \fIname\fP\|', to name the working directory something
|
||||
other than the module name.
|
||||
.br
|
||||
.I
|
||||
New in \fBcvs\fP 1.3;
|
||||
avoid this feature if sharing module definitions with older versions
|
||||
of \fBcvs\fP.
|
||||
.SP
|
||||
\&`\|\fB\-i\fP \fIprog\fP\|' allows you to specify a program \fIprog\fP
|
||||
to run whenever files in a module are committed. \fIprog\fP runs with a
|
||||
single argument, the full pathname of the affected directory in a
|
||||
source repository. The `\|commitinfo\|', `\|loginfo\|', and
|
||||
`\|editinfo\|' files provide other ways to call a program on \fBcommit\fP.
|
||||
.SP
|
||||
`\|\fB\-o\fP \fIprog\fP\|' allows you to specify a program \fIprog\fP
|
||||
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.
|
||||
.SP
|
||||
`\|\fB\-u\fP \fIprog\fP\|' allows you to specify a program \fIprog\fP
|
||||
to run whenever `\|\fBcvs update\fP\|' is executed from the top-level
|
||||
directory of the checked-out module. \fIprog\fP runs with a
|
||||
single argument, the full path to the source repository for this module.
|
||||
.TP
|
||||
\&\fBcommitinfo\fP, \fBloginfo\fP, \fBrcsinfo\fP, \fBeditinfo\fP
|
||||
These files all specify programs to call at different points in the
|
||||
`\|\fBcvs commit\fP\|' process. They have a common structure.
|
||||
Each line is a pair of fields: a regular expression, separated by
|
||||
whitespace from a filename or command-line template.
|
||||
Whenever one of the regular expression matches a directory name in the
|
||||
repository, the rest of the line is used.
|
||||
If the line begins with a \fB#\fP character, the entire line is considered
|
||||
a comment and is ignored.
|
||||
Whitespace between the fields is also ignored.
|
||||
.SP
|
||||
For `\|loginfo\|', the rest of the
|
||||
line is a command-line template to execute.
|
||||
The templates can include not only
|
||||
a program name, but whatever list of arguments you wish. If you write
|
||||
`\|\fB%s\fP\|' somewhere on the argument list, \fBcvs\fP supplies, at
|
||||
that point, the list of files affected by the \fBcommit\fP.
|
||||
The first entry in the list is the relative path within the source
|
||||
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
|
||||
list of arguments you wish.
|
||||
The full path to the current source repository is appended to the template,
|
||||
followed by the file names of any files involved in the commit (added,
|
||||
removed, and modified files).
|
||||
.SP
|
||||
For `\|rcsinfo\|', the rest of the line is the full path to a file that
|
||||
should be loaded into the log message template.
|
||||
.SP
|
||||
For `\|editinfo\|', the rest of the line is a command-line template to
|
||||
execute.
|
||||
The template can include not only a program name, but whatever
|
||||
list of arguments you wish.
|
||||
The full path to the current log message template file is appended to the
|
||||
template.
|
||||
.SP
|
||||
You can use one of two special strings instead of a regular
|
||||
expression: `\|\fBALL\fP\|' specifies a command line template that
|
||||
must always be executed, and `\|\fBDEFAULT\fP\|' specifies a command
|
||||
line template to use if no regular expression is a match.
|
||||
.SP
|
||||
The `\|commitinfo\|' file contains commands to execute \fIbefore\fP any
|
||||
other \fBcommit\fP activity, to allow you to check any conditions that
|
||||
must be satisfied before \fBcommit\fP can proceed. The rest of the
|
||||
\fBcommit\fP will execute only if all selected commands from this file
|
||||
exit with exit status \fB0\fP.
|
||||
.SP
|
||||
The `\|rcsinfo\|' file allows you to specify \fIlog templates\fP for
|
||||
the \fBcommit\fP logging session; you can use this to provide a form
|
||||
to edit when filling out the \fBcommit\fP log. The field after the
|
||||
regular expression, in this file, contains filenames (of files
|
||||
containing the logging forms) rather than command templates.
|
||||
.SP
|
||||
The `\|editinfo\|' file allows you to execute a script \fIbefore the
|
||||
commit starts\fP, but after the log information is recorded. These
|
||||
"edit" scripts can verify information recorded in the log file. If
|
||||
the edit script exits wth a non-zero exit status, the commit is aborted.
|
||||
.SP
|
||||
The `\|loginfo\|' file contains commands to execute \fIat the end\fP
|
||||
of a commit. The text specified as a commit log message is piped
|
||||
through the command; typical uses include sending mail, filing an
|
||||
article in a newsgroup, or appending to a central file.
|
||||
.TP
|
||||
\&\fBcvsignore\fP, \fB.cvsignore\fP
|
||||
The default list of files (or
|
||||
.BR sh ( 1 )
|
||||
file name patterns) to ignore during `\|\fBcvs update\fP\|'.
|
||||
At startup time, \fBcvs\fP loads the compiled in default list of file name
|
||||
patterns (see
|
||||
.BR cvs ( 1 )).
|
||||
Then the per-repository list included in \fB$CVSROOT/CVSROOT/cvsignore\fP
|
||||
is loaded, if it exists.
|
||||
Then the per-user list is loaded from `\|$HOME/.cvsignore\|'.
|
||||
Finally, as \fBcvs\fP traverses through your directories, it will load any
|
||||
per-directory `\|.cvsignore\|' files whenever it finds one.
|
||||
These per-directory files are only valid for exactly the directory that
|
||||
contains them, not for any sub-directories.
|
||||
.TP
|
||||
.B history
|
||||
Create this file in \fB$CVSROOT/CVSROOT\fP to enable history logging
|
||||
(see the description of `\|\fBcvs history\fP\|').
|
||||
.SH "SEE ALSO"
|
||||
.BR cvs ( 1 ),
|
||||
.SH COPYING
|
||||
Copyright \(co 1992 Cygnus Support, Brian Berliner, and Jeff Polk
|
||||
.PP
|
||||
Permission is granted to make and distribute verbatim copies of
|
||||
this manual provided the copyright notice and this permission notice
|
||||
are preserved on all copies.
|
||||
.PP
|
||||
Permission is granted to copy and distribute modified versions of this
|
||||
manual under the conditions for verbatim copying, provided that the
|
||||
entire resulting derived work is distributed under the terms of a
|
||||
permission notice identical to this one.
|
||||
.PP
|
||||
Permission is granted to copy and distribute translations of this
|
||||
manual into another language, under the above conditions for modified
|
||||
versions, except that this permission notice may be included in
|
||||
translations approved by the Free Software Foundation instead of in
|
||||
the original English.
|
269
contrib/cvs/man/cvsbug.8
Normal file
269
contrib/cvs/man/cvsbug.8
Normal file
@ -0,0 +1,269 @@
|
||||
.\" -*- nroff -*-
|
||||
.\" ---------------------------------------------------------------------------
|
||||
.\" man page for send-pr (by Heinz G. Seidl, hgs@cygnus.com)
|
||||
.\" updated Feb 1993 for GNATS 3.00 by Jeffrey Osier, jeffrey@cygnus.com
|
||||
.\"
|
||||
.\" This file is part of the Problem Report Management System (GNATS)
|
||||
.\" Copyright 1992 Cygnus Support
|
||||
.\"
|
||||
.\" This program is free software; you can redistribute it and/or
|
||||
.\" modify it under the terms of the GNU General Public
|
||||
.\" License as published by the Free Software Foundation; either
|
||||
.\" version 2 of the License, or (at your option) any later version.
|
||||
.\"
|
||||
.\" This program is distributed in the hope that it will be useful,
|
||||
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
.\" General Public License for more details.
|
||||
.\"
|
||||
.\" You should have received a copy of the GNU Library General Public
|
||||
.\" License along with this program; if not, write to the Free
|
||||
.\" Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
|
||||
.\"
|
||||
.\" ---------------------------------------------------------------------------
|
||||
.nh
|
||||
.TH CVSBUG 1 xVERSIONx "February 1993"
|
||||
.SH NAME
|
||||
cvsbug \- send problem report (PR) about CVS to a central support site
|
||||
.SH SYNOPSIS
|
||||
.B cvsbug
|
||||
[
|
||||
.I site
|
||||
]
|
||||
[
|
||||
.B \-f
|
||||
.I problem-report
|
||||
]
|
||||
[
|
||||
.B \-t
|
||||
.I mail-address
|
||||
]
|
||||
.br
|
||||
.in +0.8i
|
||||
[
|
||||
.B \-P
|
||||
]
|
||||
[
|
||||
.B \-L
|
||||
]
|
||||
[
|
||||
.B \-\-request-id
|
||||
]
|
||||
[
|
||||
.B \-v
|
||||
]
|
||||
.SH DESCRIPTION
|
||||
.B cvsbug
|
||||
is a tool used to submit
|
||||
.I problem reports
|
||||
.\" SITE ADMINISTRATORS - change this if you use a local default
|
||||
(PRs) to a central support site. In most cases the correct
|
||||
.I site
|
||||
will be the default. This argument indicates the support site which
|
||||
is responsible for the category of problem involved. Some sites may
|
||||
use a local address as a default.
|
||||
.I site
|
||||
values are defined by using the
|
||||
.BR aliases (5).
|
||||
.LP
|
||||
.B cvsbug
|
||||
invokes an editor on a problem report template (after trying to fill
|
||||
in some fields with reasonable default values). When you exit the
|
||||
editor,
|
||||
.B cvsbug
|
||||
sends the completed form to the
|
||||
.I Problem Report Management System
|
||||
(\fBGNATS\fR) at a central support site. At the support site, the PR
|
||||
is assigned a unique number and is stored in the \fBGNATS\fR database
|
||||
according to its category and submitter-id. \fBGNATS\fR automatically
|
||||
replies with an acknowledgement, citing the category and the PR
|
||||
number.
|
||||
.LP
|
||||
To ensure that a PR is handled promptly, it should contain your (unique)
|
||||
\fIsubmitter-id\fR and one of the available \fIcategories\fR to identify the
|
||||
problem area. (Use
|
||||
.B `cvsbug -L'
|
||||
to see a list of categories.)
|
||||
.LP
|
||||
The
|
||||
.B cvsbug
|
||||
template at your site should already be customized with your
|
||||
submitter-id (running `\|\fBinstall-sid\fP \fIsubmitter-id\fP\|' to
|
||||
accomplish this is part of the installation procedures for
|
||||
.BR cvsbug ).
|
||||
If this hasn't been done, see your system administrator for your
|
||||
submitter-id, or request one from your support site by invoking
|
||||
.B `cvsbug \-\-request\-id'.
|
||||
If your site does not distinguish between different user sites, or if
|
||||
you are not affiliated with the support site, use
|
||||
.B `net'
|
||||
for this field.
|
||||
.LP
|
||||
The more precise your problem description and the more complete your
|
||||
information, the faster your support team can solve your problems.
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.BI \-f " problem-report"
|
||||
specify a file (\fIproblem-report\fR) which already contains a
|
||||
complete problem report.
|
||||
.B cvsbug
|
||||
sends the contents of the file without invoking the editor. If
|
||||
the value for
|
||||
.I problem-report
|
||||
is
|
||||
.BR `\|\-\|' ,
|
||||
then
|
||||
.B cvsbug
|
||||
reads from standard input.
|
||||
.TP
|
||||
.BI \-t " mail-address"
|
||||
Change mail address at the support site for problem reports. The
|
||||
default
|
||||
.I mail-address
|
||||
is the address used for the default
|
||||
.IR site .
|
||||
Use the
|
||||
.I site
|
||||
argument rather than this option in nearly all cases.
|
||||
.TP
|
||||
.B \-P
|
||||
print the form specified by the environment variable
|
||||
.B PR_FORM
|
||||
on standard output. If
|
||||
.B PR_FORM
|
||||
is not set, print the standard blank PR template. No mail is sent.
|
||||
.TP
|
||||
.B -L
|
||||
print the list of available categories. No mail is sent.
|
||||
.TP
|
||||
.B \-\-request\-id
|
||||
sends mail to the default support site, or
|
||||
.I site
|
||||
if specified, with a request for your
|
||||
.IR submitter-id .
|
||||
If you are
|
||||
not affiliated with
|
||||
.IR site ,
|
||||
use a
|
||||
.I submitter-id
|
||||
of
|
||||
.BR net \|'.
|
||||
.TP
|
||||
.B \-v
|
||||
Display the
|
||||
.B cvsbug
|
||||
version number.
|
||||
.LP
|
||||
Note: use
|
||||
.B cvsbug
|
||||
to submit problem reports rather than mailing them directly. Using
|
||||
both the template and
|
||||
.B cvsbug
|
||||
itself will help ensure all necessary information will reach the
|
||||
support site.
|
||||
.SH ENVIRONMENT
|
||||
The environment variable
|
||||
.B EDITOR
|
||||
specifies the editor to invoke on the template.
|
||||
.br
|
||||
default:
|
||||
.B vi
|
||||
.sp
|
||||
If the environment variable
|
||||
.B PR_FORM
|
||||
is set, then its value is used as the file name of the template for
|
||||
your problem-report editing session. You can use this to start with a
|
||||
partially completed form (for example, a form with the identification
|
||||
fields already completed).
|
||||
.SH "HOW TO FILL OUT A PROBLEM REPORT"
|
||||
Problem reports have to be in a particular form so that a program can
|
||||
easily manage them. Please remember the following guidelines:
|
||||
.IP \(bu 3m
|
||||
describe only
|
||||
.B one problem
|
||||
with each problem report.
|
||||
.IP \(bu 3m
|
||||
For follow-up mail, use the same subject line as the one in the automatic
|
||||
acknowledgent. It consists of category, PR number and the original synopsis
|
||||
line. This allows the support site to relate several mail messages to a
|
||||
particular PR and to record them automatically.
|
||||
.IP \(bu 3m
|
||||
Please try to be as accurate as possible in the subject and/or synopsis line.
|
||||
.IP \(bu 3m
|
||||
The subject and the synopsis line are not confidential. This is
|
||||
because open-bugs lists are compiled from them. Avoid confidential
|
||||
information there.
|
||||
.LP
|
||||
See the GNU
|
||||
.B Info
|
||||
file
|
||||
.B cvsbug.info
|
||||
or the document \fIReporting Problems With cvsbug\fR\ for detailed
|
||||
information on reporting problems
|
||||
.SH "HOW TO SUBMIT TEST CASES, CODE, ETC."
|
||||
Submit small code samples with the PR. Contact the support site for
|
||||
instructions on submitting larger test cases and problematic source
|
||||
code.
|
||||
.SH FILES
|
||||
.ta \w'/tmp/pbad$$ 'u
|
||||
/tmp/p$$ copy of PR used in editing session
|
||||
.br
|
||||
/tmp/pf$$ copy of empty PR form, for testing purposes
|
||||
.br
|
||||
/tmp/pbad$$ file for rejected PRs
|
||||
.SH EMACS USER INTERFACE
|
||||
An Emacs user interface for
|
||||
.B cvsbug
|
||||
with completion of field values is part of the
|
||||
.B cvsbug
|
||||
distribution (invoked with
|
||||
.BR "M-x cvsbug" ).
|
||||
See the file
|
||||
.B cvsbug.info
|
||||
or the ASCII file
|
||||
.B INSTALL
|
||||
in the top level directory of the distribution for configuration and
|
||||
installation information. The Emacs LISP template file is
|
||||
.B cvsbug-el.in
|
||||
and is installed as
|
||||
.BR cvsbug.el .
|
||||
.SH INSTALLATION AND CONFIGURATION
|
||||
See
|
||||
.B cvsbug.info
|
||||
or
|
||||
.B INSTALL
|
||||
for installation instructions.
|
||||
.SH SEE ALSO
|
||||
.I Reporting Problems Using cvsbug
|
||||
(also installed as the GNU Info file
|
||||
.BR cvsbug.info ).
|
||||
.LP
|
||||
.BR gnats (l),
|
||||
.BR query-pr (1),
|
||||
.BR edit-pr (1),
|
||||
.BR gnats (8),
|
||||
.BR queue-pr (8),
|
||||
.BR at-pr (8),
|
||||
.BR mkcat (8),
|
||||
.BR mkdist (8).
|
||||
.SH AUTHORS
|
||||
Jeffrey Osier, Brendan Kehoe, Jason Merrill, Heinz G. Seidl (Cygnus
|
||||
Support)
|
||||
.SH COPYING
|
||||
Copyright (c) 1992, 1993 Free Software Foundation, Inc.
|
||||
.PP
|
||||
Permission is granted to make and distribute verbatim copies of
|
||||
this manual provided the copyright notice and this permission notice
|
||||
are preserved on all copies.
|
||||
.PP
|
||||
Permission is granted to copy and distribute modified versions of this
|
||||
manual under the conditions for verbatim copying, provided that the
|
||||
entire resulting derived work is distributed under the terms of a
|
||||
permission notice identical to this one.
|
||||
.PP
|
||||
Permission is granted to copy and distribute translations of this
|
||||
manual into another language, under the above conditions for modified
|
||||
versions, except that this permission notice may be included in
|
||||
translations approved by the Free Software Foundation instead of in
|
||||
the original English.
|
||||
|
32
contrib/cvs/mkinstalldirs
Executable file
32
contrib/cvs/mkinstalldirs
Executable file
@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
# mkinstalldirs --- make directory hierarchy
|
||||
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
|
||||
# Created: 1993-05-16
|
||||
# Last modified: 1994-03-25
|
||||
# Public domain
|
||||
|
||||
errstatus=0
|
||||
|
||||
for file in ${1+"$@"} ; do
|
||||
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
|
||||
shift
|
||||
|
||||
pathcomp=
|
||||
for d in ${1+"$@"} ; do
|
||||
pathcomp="$pathcomp$d"
|
||||
case "$pathcomp" in
|
||||
-* ) pathcomp=./$pathcomp ;;
|
||||
esac
|
||||
|
||||
if test ! -d "$pathcomp"; then
|
||||
echo "mkdir $pathcomp" 1>&2
|
||||
mkdir "$pathcomp" || errstatus=$?
|
||||
fi
|
||||
|
||||
pathcomp="$pathcomp/"
|
||||
done
|
||||
done
|
||||
|
||||
exit $errstatus
|
||||
|
||||
# mkinstalldirs ends here
|
1373
contrib/cvs/src/ChangeLog
Normal file
1373
contrib/cvs/src/ChangeLog
Normal file
File diff suppressed because it is too large
Load Diff
524
contrib/cvs/src/ChangeLog-9194
Normal file
524
contrib/cvs/src/ChangeLog-9194
Normal file
@ -0,0 +1,524 @@
|
||||
Thu Sep 15 08:20:23 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
|
||||
|
||||
* subr.c (run_setup, run_args): Check USE_PROTOTYPES if defined
|
||||
instead of __STDC__, just like cvs.h does.
|
||||
|
||||
Thu Sep 15 00:14:58 1994 david d `zoo' zuhn <zoo@monad.armadillo.com>
|
||||
|
||||
* main.c: rename nocvsrc to use_cvsrc, don`t read ~/.cvsrc when -H
|
||||
has been seen
|
||||
|
||||
Wed Sep 14 21:55:17 1994 david d `zoo' zuhn <zoo@monad.armadillo.com>
|
||||
|
||||
* cvs.h, subr.c: use size_t for xmalloc, xrealloc, and xstrdup
|
||||
parameters
|
||||
|
||||
* cvsrc.c: optimize away two calls of getenv
|
||||
|
||||
* commit.c, subr.c: use mode_t for file mode values (Thanks to jtc@cygnus.com)
|
||||
|
||||
* main.c: update copyrights in -v message
|
||||
|
||||
Tue Sep 6 10:29:13 1994 J.T. Conklin (jtc@rtl.cygnus.com)
|
||||
|
||||
* hash.c (hashp): Replace hash function with one from p436 of the
|
||||
Dragon book (via libg++'s hash.cc) which has *much* better
|
||||
behavior.
|
||||
|
||||
Wed Aug 17 09:37:44 1994 J.T. Conklin (jtc@cygnus.com)
|
||||
|
||||
* find_names.c (find_dirs): Use 4.4BSD filesystem feature (it
|
||||
contains the file type in the dirent structure) to avoid
|
||||
stat'ing each file.
|
||||
|
||||
Tue Aug 16 11:15:12 1994 J.T. Conklin (jtc@cygnus.com)
|
||||
|
||||
* rcs.h (struct rcsnode): add symbols_data field.
|
||||
* rcs.c (RCS_parsercsfile_i): store value of rcs symbols in
|
||||
symbols_data instead of parsing it.
|
||||
(RCS_symbols): New function used for lazy symbols parsing.
|
||||
Build a list out of symbols_data and store it in symbols if it
|
||||
hasn't been done already, and return the list of symbols.
|
||||
(RCS_gettag, RCS_magicrev, RCS_nodeisbranch, RCS_whatbranch):
|
||||
Use RCS_symbols.
|
||||
* status.c: (status_fileproc): Use RCS_symbols.
|
||||
|
||||
Thu Jul 14 13:02:51 1994 david d `zoo' zuhn (zoo@monad.armadillo.com)
|
||||
|
||||
* src/diff.c (diff_fileproc): add support for "cvs diff -N" which
|
||||
allows for adding or removing files via patches. (from
|
||||
K. Richard Pixley <rich@cygnus.com>)
|
||||
|
||||
Wed Jul 13 10:52:56 1994 J.T. Conklin (jtc@phishhead.cygnus.com)
|
||||
|
||||
* cvs.h: Add macro CVSRFLPAT, a string containing a shell wildcard
|
||||
expression that matches read lock files.
|
||||
* lock.c (readers_exist): Reorganized to use CVSRFLPAT and to not
|
||||
compute the full pathname unless the file matches.
|
||||
|
||||
* rcs.h: Add macro RCSPAT, a string containing a shell wildcard
|
||||
expression that matches RCS files.
|
||||
* find_names.c (find_rcs, find_dirs): Use RCSPAT.
|
||||
|
||||
Fri Jul 8 07:02:08 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
|
||||
|
||||
* entries.c (Register): Pass two arguments to write_ent_proc, in
|
||||
accordance with its declaration.
|
||||
|
||||
Thu Jun 30 09:08:57 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
|
||||
|
||||
* logmsg.c (do_editor): Fix typo ("c)continue" -> "c)ontinue").
|
||||
|
||||
Thu Jun 23 18:28:12 1994 J.T. Conklin (jtc@phishhead.cygnus.com)
|
||||
|
||||
* find_names.c (find_rcs, find_dirs): use fnmatch instead of
|
||||
re_comp/re_exec for wildcard matching.
|
||||
* lock.c (readers_exist): Likewise.
|
||||
|
||||
Fri May 20 08:13:10 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
|
||||
|
||||
* modules.c (do_module): If something is aliased to itself, print
|
||||
an error message rather than recursing.
|
||||
|
||||
Fri May 6 19:25:28 1994 david d zuhn (zoo@monad.armadillo.com)
|
||||
|
||||
* cvsrc.c (read_cvsrc): use open_file for error checking
|
||||
|
||||
Sat Feb 26 10:59:37 1994 david d zuhn (zoo@monad.armadillo.com)
|
||||
|
||||
* import.c: use $TMPDIR if available, instead of relying on /tmp
|
||||
|
||||
Mon Jan 24 19:10:03 1994 david d zuhn (zoo@monad.armadillo.com)
|
||||
|
||||
* update.c (joining): compare join_rev1 with NULL instead of
|
||||
casting pointer to an int
|
||||
|
||||
* options.h: remove S_IWRITE, S_IWGRP, S_IWOTH macros
|
||||
|
||||
* logmsg.c: #if 0 around gethostbyname prototype
|
||||
|
||||
* hash.c (printnode), find_names.c (add_entries_proc),
|
||||
entries.c (write_ent_proc): correct declaration for function
|
||||
(added void *closure)
|
||||
|
||||
* cvs.h: header include order reorganization: First include the
|
||||
program config headers (config.h, options.h). Then include any
|
||||
system headers (stdio.h, unistd.h). Last, get the program
|
||||
headers and any cvs supplied library support
|
||||
|
||||
* commit.c: use xstrdup instead of strdup
|
||||
|
||||
* cvs.h: redefined USE(var) macro; comment after an #endif
|
||||
|
||||
* all .c files: remove the semicolon from after the USE(var)
|
||||
|
||||
Sat Dec 18 00:17:27 1993 david d zuhn (zoo@monad.armadillo.com)
|
||||
|
||||
* cvs.h: include errno.h if available, otherwise declare errno if
|
||||
it's not somehow else defined
|
||||
|
||||
* commit.c (checkaddfile): remove unused file argument from
|
||||
RCS_nodeisbranch call
|
||||
|
||||
* rcs.c (RCS_nodeisbranch): remove file from arguments (was unused)
|
||||
|
||||
* rcs.h (RCS_nodeisbranch): remove file from prototype
|
||||
|
||||
* main.c: don't use rcsid when printing version number (the CVS
|
||||
version number is independent of the repository that it comes
|
||||
from)
|
||||
|
||||
* hash.c (printlist, printnode): use %p to print pointers, not %x
|
||||
(avoids gcc format warnings)
|
||||
|
||||
* cvs.h: define USE if GCC 2, to avoid unused variable warning
|
||||
|
||||
* all .c files: use USE(rcsid)
|
||||
|
||||
* Makefile.in (VPATH): don't use $(srcdir), but @srcdir@ instead
|
||||
(COMMON_OBJECTS): define, and use in several places
|
||||
(OBJECTS): reorder alphabetically
|
||||
|
||||
* hash.c (nodetypestring): handle default return value better
|
||||
|
||||
* modules.c (do_module): remove extra argument to ign_dir_add
|
||||
|
||||
* main.c (main): initialize cvs_update_env to 0 (zero)
|
||||
|
||||
* modules.c (do_module): return error code when ignoring directory
|
||||
(instead of a bare return). error code should be zero here
|
||||
|
||||
* cvs.h: add prototypes for ignore_directory, ign_dir_add
|
||||
|
||||
* ignore.c: add comments about ignore_directory
|
||||
|
||||
* root.c (Name_Root): remove unused variables has_cvsadm and path
|
||||
|
||||
* checkin.c (Checkin): only use -m<message> when message is non-NULL
|
||||
|
||||
* cvsrc.c (read_cvsrc): make sure homeinit is never used while
|
||||
uninitialized (could have happened if getenv("HOME") had failed)
|
||||
|
||||
* cvs.h: include unistd.h if available
|
||||
|
||||
Fri Dec 17 23:54:58 1993 david d zuhn (zoo@monad.armadillo.com)
|
||||
|
||||
* all files: now use strchr, strrchr, and memset instead of index,
|
||||
rindex, and bzero respectively
|
||||
|
||||
Sat Dec 11 09:50:03 1993 david d zuhn (zoo@monad.armadillo.com)
|
||||
|
||||
* version.c (version_string): bump to +104z
|
||||
|
||||
* Makefile.in: set standard directory variables, CC, and other
|
||||
variables needed to be able to do 'make all' in this directory
|
||||
|
||||
* import.c: implement -k<subst> options, for setting the RCS
|
||||
keyword expansion mode
|
||||
|
||||
* all files: use PROTO() macro for ANSI function prototypes
|
||||
instead of #ifdef __STDC__/#else/#endif around two sets of
|
||||
declarations
|
||||
|
||||
Thu Nov 18 19:02:51 1993 K. Richard Pixley (rich@sendai.cygnus.com)
|
||||
|
||||
* add.c (add), import.c (import), commit.c (commit): change
|
||||
xmalloc & strcpy to xstrdup.
|
||||
|
||||
* commit.c (remove_file): correct another static buffer problem.
|
||||
|
||||
Wed Nov 10 15:01:34 1993 K. Richard Pixley (rich@sendai.cygnus.com)
|
||||
|
||||
* recurse.c (start_recursion): directories in repository but not
|
||||
in working directory should be added to dirlist. Fixes "update
|
||||
-d dir" case.
|
||||
|
||||
* version.c (version_string): bump to +103r.
|
||||
|
||||
* commit.c (checkaddfile): mkdir attic only if it does not already
|
||||
exist. comment changes. changed diagnostic about adding on a
|
||||
branch. if a file is added on a branch, remove and replace the
|
||||
internal representation of that rcs file.
|
||||
|
||||
Tue Nov 9 18:02:01 1993 K. Richard Pixley (rich@sendai.cygnus.com)
|
||||
|
||||
* add.c (add): if a file is being added on a branch, then say so;
|
||||
add quotes around file names in error messages.
|
||||
|
||||
Thu Nov 4 16:58:33 1993 K. Richard Pixley (rich@sendai.cygnus.com)
|
||||
|
||||
* version.c (version_string): bump to +102r.
|
||||
|
||||
* recurse.c (unroll_files_proc, addfile): new files, forward
|
||||
decls, and prototypes.
|
||||
(recursion_frame): new struct.
|
||||
(start_recursion): rewrite to handle the case of "file1 file2
|
||||
dir1/file3".
|
||||
|
||||
* rcs.c (RCS_parsercsfile): trap and error out on the case where
|
||||
getrcskey tells us it hit an error while reading the file.
|
||||
|
||||
* commit.c (lock_filesdoneproc): add comment about untrapped error
|
||||
condition.
|
||||
|
||||
* hash.c (addnode): comment change.
|
||||
|
||||
* subr.c: add comment about caching.
|
||||
|
||||
* sanity.sh: updated copyright.
|
||||
|
||||
Wed Nov 3 14:49:15 1993 K. Richard Pixley (rich@sendai.cygnus.com)
|
||||
|
||||
* version.c (version_string): bump to +101r.
|
||||
|
||||
* hash.c (walklist): add a closure for called routines. All
|
||||
callers, callees, and prototypes changed.
|
||||
|
||||
* hash.c (nodetypestring, printnode, printlist): new functions for
|
||||
dumping lists & nodes.
|
||||
|
||||
* tag.c (tag_fileproc): fatal out on failure to set tag.
|
||||
|
||||
Tue Nov 2 14:26:38 1993 K. Richard Pixley (rich@sendai.cygnus.com)
|
||||
|
||||
* version.c (version_string): bump version to +99.
|
||||
|
||||
Mon Nov 1 15:54:51 1993 K. Richard Pixley (rich@sendai.cygnus.com)
|
||||
|
||||
Change buffer allocation for check in messages from static to
|
||||
dynamic.
|
||||
* add.c (add): dynamically allocate message.
|
||||
(build_entry): check (message != NULL) now that message is a
|
||||
pointer.
|
||||
* commit.c (got_message, commit, commit_fileproc,
|
||||
commit_filesdoneproc, commit_direntproc): removed. Replaced by
|
||||
(message != NULL). Dynamically allocate message.
|
||||
* cvs.h: adjust do_editor prototype and forward decl.
|
||||
(MAXMESGLEN): removed.
|
||||
* import.c (import): dynamically allocate message.
|
||||
* logmsg.c (do_editor): change return type to char *. Remove
|
||||
message parameter. Slight optimization to algorythm for
|
||||
removing CVSEDITPREFIX lines. Add comment about fgets lossage.
|
||||
|
||||
* subr.c (xmalloc): change error message to print number of bytes
|
||||
we were attempting to allocate.
|
||||
|
||||
Fri Oct 29 14:22:02 1993 K. Richard Pixley (rich@sendai.cygnus.com)
|
||||
|
||||
* add.c (add): prevent adding a directory if there exists a dead
|
||||
file of the same name.
|
||||
|
||||
* sanity.sh: update argument to diff from "+ignore-file" to
|
||||
"--exclude=".
|
||||
|
||||
* Makefile.in (TAGS): extend to work from an objdir.
|
||||
|
||||
Mon Oct 18 18:45:45 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
|
||||
|
||||
* tag.c, rtag.c: change the default actions to make writing over
|
||||
existing tags harder (but not impossible)
|
||||
|
||||
Thu Oct 14 18:00:53 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
|
||||
|
||||
CVS/Root changes from Mark Baushke (mdb@cisco.com)
|
||||
|
||||
* Makefile.in: added new file called root.c
|
||||
|
||||
* create_adm.c: will create CVS/Root at the same time that the
|
||||
other CVS files are being created
|
||||
|
||||
* cvs.h: new CVSADM_ROOT define plus new function externs
|
||||
|
||||
* main.c: default to using CVS/Root contents for CVSROOT
|
||||
if neither the environment variable or the command line
|
||||
"-d" switch is given. If either are given, perform a
|
||||
sanity check that this directory belongs to that repository.
|
||||
|
||||
* update.c: if CVS/Root does not exist, then create it
|
||||
during an update -- this may be removed if CVS/Root becomes a
|
||||
standard feature
|
||||
|
||||
* root.c: implement new functions to manipulate CVS/Root
|
||||
[this may be integrated with other utility functions in
|
||||
a future revision if CVS/Root becomes a standard feature.]
|
||||
|
||||
Wed Sep 29 17:01:40 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
|
||||
|
||||
* patch.c (patch_fileproc): output an Index: line for each file
|
||||
|
||||
Mon Sep 6 18:40:22 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
|
||||
|
||||
* cvs.h: wrap definition of PATH_MAX in #ifndef PATH_MAX/#endif
|
||||
|
||||
Tue Aug 9 21:52:10 1994 Mark Eichin (eichin@cygnus.com)
|
||||
|
||||
* commit.c (remove_file): actually allocate space for the
|
||||
filename, not just the directory.
|
||||
|
||||
Tue Jul 6 19:05:37 1993 david d `zoo' zuhn (zoo@cygnus.com)
|
||||
|
||||
* diff.c: patches to print an Index: line
|
||||
|
||||
Mon Jun 14 12:19:35 1993 david d `zoo' zuhn (zoo at rtl.cygnus.com)
|
||||
|
||||
* Makefile.in: update install target
|
||||
|
||||
Tue Jun 1 17:03:05 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
|
||||
|
||||
* Makefile.in: link cvs against libiberty
|
||||
|
||||
Wed May 19 14:10:34 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
|
||||
|
||||
* ignore.c: add code for keeping lists of directories to ignore.
|
||||
|
||||
* modules.c: new syntax for modules file, !dirname is added to
|
||||
the list of directories to ignore
|
||||
|
||||
* update.c: don't process directories on the ignore list
|
||||
|
||||
Tue Apr 6 14:22:48 1993 Ian Lance Taylor (ian@cygnus.com)
|
||||
|
||||
* cvs.h: Removed gethostname prototype, since it is unnecessary
|
||||
and does not match prototype in <unistd.h> on HP/UX.
|
||||
|
||||
Mon Mar 22 23:25:16 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
|
||||
|
||||
* Makefile.in: rename installtest to installcheck
|
||||
|
||||
Mon Feb 1 12:53:34 1993 K. Richard Pixley (rich@rtl.cygnus.com)
|
||||
|
||||
* Makefile.in (check, installtest): set RCSBIN so that we
|
||||
explicitly test the appropriate version of rcs as well.
|
||||
|
||||
Fri Jan 29 13:37:35 1993 K. Richard Pixley (rich@rtl.cygnus.com)
|
||||
|
||||
* version.c: bump version to +2.
|
||||
|
||||
Thu Jan 28 18:11:34 1993 K. Richard Pixley (rich@rtl.cygnus.com)
|
||||
|
||||
* import.c (update_rcs_file): if a file was dead, be sure to check
|
||||
in the new version.
|
||||
|
||||
* update.c (checkout_file): if file_is_dead and we *did* have an
|
||||
entry, scratch it.
|
||||
|
||||
Tue Jan 26 16:16:48 1993 K. Richard Pixley (rich@rtl.cygnus.com)
|
||||
|
||||
* sanity.sh: parcel into pieces for easier truncation when
|
||||
debugging.
|
||||
|
||||
* update.c (checkout_file): print the "no longer pertinent"
|
||||
message only if there was a user file.
|
||||
|
||||
Wed Jan 20 17:08:09 1993 K. Richard Pixley (rich@rtl.cygnus.com)
|
||||
|
||||
* update.c (checkout_file): remove unused variable s.
|
||||
(join_file): remove unused variables rev & baserev. Fix a typo.
|
||||
|
||||
* commit.c (commit_fileproc): remove unused variable magicbranch.
|
||||
|
||||
* sanity.sh: bring back test 45 even though it fails. Update
|
||||
tests against imported files.
|
||||
|
||||
* add.c (add_directory): move declaration of unused variable.
|
||||
|
||||
* Makefile.in (xxx): when building in this directory, pass CC for
|
||||
the recursion.
|
||||
|
||||
Mon Jan 18 13:48:33 1993 K. Richard Pixley (rich@cygnus.com)
|
||||
|
||||
* commit.c (remove_file): fix for files removed in trunk
|
||||
immediately after import.
|
||||
|
||||
* commit.c (remove_file): initialize some variables. Otherwise we
|
||||
end up free'ing some rather inconvenient things.
|
||||
|
||||
Wed Jan 13 15:55:36 1993 K. Richard Pixley (rich@rtl.cygnus.com)
|
||||
|
||||
* Makefile.in (check, install, installtest): use the sanity test.
|
||||
|
||||
* sanity.el: make into real functions and bind to sun keys.
|
||||
|
||||
* sanity.sh: bring back to working order. Add test for death
|
||||
after import.
|
||||
|
||||
Tue Dec 22 17:45:19 1992 K. Richard Pixley (rich@cygnus.com)
|
||||
|
||||
* commit.c (remove_file): when checking in a dead revision to a
|
||||
branch as we are creating the branch, do not lock the underlying
|
||||
revision. Also free some malloc'd memory.
|
||||
|
||||
Wed Dec 2 13:09:48 1992 K. Richard Pixley (rich@cygnus.com)
|
||||
|
||||
* RCS-patches: new file.
|
||||
|
||||
Fri Nov 27 20:12:48 1992 K. Richard Pixley (rich@rtl.cygnus.com)
|
||||
|
||||
Added support for adding previously removed files, as well as
|
||||
adding and removing files in branches.
|
||||
|
||||
* add.c (build_entry): add new argument, tag, so as to store in
|
||||
Entries the per directory sticky tag under which a file is
|
||||
added. Changed prototype and caller.
|
||||
(build_entry): Do not prevent file additions if the file exists
|
||||
in the Attic.
|
||||
(add): if the file being adding was previously dead, say so, and
|
||||
mark the Entries file with the addition.
|
||||
* checkin.c (Checkin): adding with a tag no longer means to add,
|
||||
then tag. Hence, remove the tagging operation.
|
||||
* classify.c (Classify_File): if the base RCS version is dead,
|
||||
then the file is being added. If a file being added already
|
||||
exists in the attic, and the base RCS version is NOT dead, then
|
||||
we have a conflict.
|
||||
* commit.c (checkaddfile): add the list of srcfiles to calling
|
||||
convention. Change prototype and callers.
|
||||
(remove_file): add message and list of srcfiles to calling
|
||||
convention. Change prototype and callers. When removing a file
|
||||
with a tag, remove the tag only when the tag does not represent
|
||||
a branch. Remove files by committing dead revisions in the
|
||||
appropriate branch. When removing files from the trunk, also
|
||||
move the RCS file into the Attic.
|
||||
(check_fileproc): when adding, and looking for previously
|
||||
existing RCS files, do not look in the Attic.
|
||||
(commit_fileproc): adding files with tags now implies adding the
|
||||
file on a branch with that tag.
|
||||
(checkaddfile): When adding a file on a branch, in addition to
|
||||
creating the rcs file in the Attic, also create a dead, initial
|
||||
revision on the trunk and stub in a magic branch tag.
|
||||
* cvs.h (joining, gca): added prototypes.
|
||||
* rcs.c (RCS_getbranch): now global rather than static.
|
||||
remove prototype and forward decl.
|
||||
(parse_rcs_proc): use RCS_addnode.
|
||||
(RCS_addnode): new function.
|
||||
(RCS_parsercsfile): recognize the new RCS revision
|
||||
newphrase, "dead". Mark the node for the revision.
|
||||
(RCS_gettag): requesting the head of a file in the attic now
|
||||
returns the head of the file in the attic rather than NULL.
|
||||
(RCS_isbranch): use RCS_nodeisbranch.
|
||||
(RCS_nodeisbranch): new function.
|
||||
(RCS_isdead): new function.
|
||||
* rcs.h (RCSDEAD): new macro for new rcs keyword.
|
||||
(struct rcsversnode): new field to flag dead revisions.
|
||||
(RCS_nodeisbranch, RCS_isdead, RCS_addnode): new functions,
|
||||
new prototypes, new externs.
|
||||
(RCS_getbranch): now global, so prototype and extern moved
|
||||
to here.
|
||||
* subr.c (gca): new function.
|
||||
* update.c (join_file): add entries list to calling
|
||||
convention. Caller changed.
|
||||
(update): also search the Attic when joining.
|
||||
(checkout_file): when joining, checkout dead revisions too. If
|
||||
a file has died across an update then say so.
|
||||
(join_file): support joins of dead files against live ones, live
|
||||
files against dead ones, and added files. Change the semantic
|
||||
of a join with only rev specified to mean join specified rev
|
||||
against checked out files via the greatest common ancestor of
|
||||
the specified rev and the base rev of the checked out files.
|
||||
(joining): new function.
|
||||
* vers_ts.c (Version_TS): ALWAYS get the rcs version number.
|
||||
|
||||
* update.c (update): write the 'C' letter for conflicts.
|
||||
|
||||
* cvs.h (ParseTag): remove duplicate extern.
|
||||
|
||||
* add.c (add_directory): do not prompt for interactive
|
||||
verification before adding a directory. Doing so prevents
|
||||
scripted testing.
|
||||
|
||||
Wed Feb 26 18:04:40 1992 K. Richard Pixley (rich@cygnus.com)
|
||||
|
||||
* Makefile.in, configure.in: removed traces of namesubdir,
|
||||
-subdirs, $(subdir), $(unsubdir), some rcs triggers. Forced
|
||||
copyrights to '92, changed some from Cygnus to FSF.
|
||||
|
||||
Tue Dec 10 01:24:40 1991 K. Richard Pixley (rich at cygnus.com)
|
||||
|
||||
* diff.c: do not pass an empty -r option to rcsdiff.
|
||||
|
||||
* update.c: fix bug where return code from rcsmerge wasn't being
|
||||
handled properly.
|
||||
|
||||
* main.c: "rm" and "delete" now synonyms for "remove".
|
||||
|
||||
* commit.c: abort if editor session fails, but remember to clear
|
||||
locks.
|
||||
|
||||
* Makefile.in: remove conf.h and checkin.configured on clean.
|
||||
infodir belongs in datadir.
|
||||
|
||||
Thu Dec 5 22:46:03 1991 K. Richard Pixley (rich at rtl.cygnus.com)
|
||||
|
||||
* Makefile.in: idestdir and ddestdir go away. Added copyrights
|
||||
and shift gpl to v2. Added ChangeLog if it didn't exist. docdir
|
||||
and mandir now keyed off datadir by default.
|
||||
|
||||
Wed Nov 27 02:47:13 1991 K. Richard Pixley (rich at sendai)
|
||||
|
||||
* brought Makefile.in's up to standards.text.
|
||||
|
||||
* fresh changelog.
|
||||
|
||||
|
||||
For older changes, there might be some relevant stuff in the bottom of
|
||||
the NEWS file, but I'm afraid probably a lot of them are lost in the
|
||||
mists of time.
|
3731
contrib/cvs/src/ChangeLog-9395
Normal file
3731
contrib/cvs/src/ChangeLog-9395
Normal file
File diff suppressed because it is too large
Load Diff
198
contrib/cvs/src/Makefile.in
Normal file
198
contrib/cvs/src/Makefile.in
Normal file
@ -0,0 +1,198 @@
|
||||
# Makefile for GNU CVS program.
|
||||
# Do not use this makefile directly, but only from `../Makefile'.
|
||||
# Copyright (C) 1986, 1988-1990 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
# $CVSid: @(#)Makefile.in 1.19 94/09/29 $
|
||||
|
||||
SHELL = /bin/sh
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
# Where to install the executables.
|
||||
bindir = $(exec_prefix)/bin
|
||||
|
||||
# Where to put the system-wide .cvsrc file
|
||||
libdir = $(prefix)/lib
|
||||
|
||||
# Where to put the manual pages.
|
||||
mandir = $(prefix)/man
|
||||
|
||||
# Use cp if you don't have install.
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
|
||||
LIBS = @LIBS@
|
||||
|
||||
SOURCES = add.c admin.c checkin.c checkout.c classify.c client.c commit.c \
|
||||
create_adm.c cvsrc.c diff.c edit.c entries.c error.c expand_path.c \
|
||||
fileattr.c find_names.c hash.c history.c ignore.c import.c \
|
||||
lock.c log.c login.c logmsg.c main.c mkmodules.c modules.c myndbm.c no_diff.c \
|
||||
parseinfo.c patch.c rcs.c rcscmds.c recurse.c release.c remove.c repos.c \
|
||||
root.c rtag.c scramble.c server.c status.c subr.c filesubr.c run.c \
|
||||
tag.c update.c watch.c wrapper.c vers_ts.c version.c
|
||||
|
||||
OBJECTS = add.o admin.o checkin.o checkout.o classify.o client.o commit.o \
|
||||
create_adm.o cvsrc.o diff.o edit.o entries.o expand_path.o \
|
||||
fileattr.o find_names.o hash.o history.o ignore.o import.o \
|
||||
lock.o log.o login.o logmsg.o main.o mkmodules.o modules.o myndbm.o no_diff.o \
|
||||
parseinfo.o patch.o rcs.o rcscmds.o recurse.o release.o remove.o repos.o \
|
||||
root.o rtag.o scramble.o server.o status.o tag.o update.o \
|
||||
watch.o wrapper.o vers_ts.o \
|
||||
subr.o filesubr.o run.o version.o error.o
|
||||
|
||||
HEADERS = cvs.h rcs.h hash.h myndbm.h \
|
||||
update.h server.h client.h error.h fileattr.h edit.h watch.h
|
||||
|
||||
TAGFILES = $(HEADERS) options.h.in $(SOURCES)
|
||||
|
||||
DISTFILES = .cvsignore Makefile.in ChangeLog ChangeLog-9395 ChangeLog-9194 \
|
||||
NOTES README-rm-add \
|
||||
sanity.sh cvsbug.sh $(TAGFILES)
|
||||
|
||||
PROGS = cvs cvsbug
|
||||
|
||||
DEFS = @DEFS@ @includeopt@
|
||||
|
||||
CC = @CC@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPPFLAGS =
|
||||
LDFLAGS = @LDFLAGS@
|
||||
|
||||
INCLUDES = -I. -I.. -I$(srcdir) -I$(top_srcdir)/lib
|
||||
.c.o:
|
||||
$(CC) $(CPPFLAGS) $(INCLUDES) $(DEFS) $(CFLAGS) -c $<
|
||||
|
||||
all: Makefile $(PROGS)
|
||||
.PHONY: all
|
||||
|
||||
saber_cvs:
|
||||
@cd ..; $(MAKE) saber SUBDIRS=src
|
||||
|
||||
lint:
|
||||
@cd ..; $(MAKE) lint SUBDIRS=src
|
||||
|
||||
# CYGNUS LOCAL: Do not depend upon installdirs
|
||||
install:
|
||||
@for prog in $(PROGS); do \
|
||||
echo Installing $$prog in $(bindir); \
|
||||
$(INSTALL) $$prog $(bindir)/$$prog ; \
|
||||
done
|
||||
|
||||
installdirs:
|
||||
$(SHELL) $(top_srcdir)/mkinstalldirs $(bindir)
|
||||
|
||||
.PHONY: install installdirs
|
||||
|
||||
installcheck:
|
||||
RCSBIN=$(bindir) ; export RCSBIN ; $(SHELL) $(srcdir)/sanity.sh $(bindir)/cvs
|
||||
.PHONY: installcheck
|
||||
|
||||
check: all
|
||||
if [ -x ../../rcs/src/rcs ] ; then \
|
||||
RCSBIN=`pwd`/../../rcs/src ; \
|
||||
export RCSBIN ; \
|
||||
fi ; \
|
||||
$(SHELL) $(srcdir)/sanity.sh `pwd`/cvs
|
||||
.PHONY: check
|
||||
|
||||
# I'm not sure there is any remaining reason for this to be separate from
|
||||
# `make check'.
|
||||
remotecheck: all
|
||||
$(SHELL) $(srcdir)/sanity.sh -r `pwd`/cvs
|
||||
.PHONY: remotecheck
|
||||
|
||||
tags: $(TAGFILES)
|
||||
ctags $(TAGFILES)
|
||||
|
||||
TAGS: $(TAGFILES)
|
||||
etags `for i in $(TAGFILES); do echo $(srcdir)/$$i; done`
|
||||
|
||||
ls:
|
||||
@echo $(DISTFILES)
|
||||
.PHONY: ls
|
||||
|
||||
clean:
|
||||
/bin/rm -f $(PROGS) *.o core check.log check.plog
|
||||
.PHONY: clean
|
||||
|
||||
distclean: clean
|
||||
rm -f tags TAGS Makefile options.h
|
||||
.PHONY: distclean
|
||||
|
||||
realclean: distclean
|
||||
.PHONY: realclean
|
||||
|
||||
dist-dir:
|
||||
mkdir ${DISTDIR}
|
||||
for i in ${DISTFILES}; do \
|
||||
ln $(srcdir)/$${i} ${DISTDIR}; \
|
||||
done
|
||||
.PHONY: dist-dir
|
||||
|
||||
# Linking rules.
|
||||
|
||||
$(PROGS): ../lib/libcvs.a
|
||||
|
||||
cvs: $(OBJECTS)
|
||||
$(CC) $(OBJECTS) ../lib/libcvs.a $(LIBS) $(LDFLAGS) -o $@
|
||||
|
||||
xlint: $(SOURCES)
|
||||
files= ; \
|
||||
for i in $(SOURCES) ; do \
|
||||
files="$$files $(srcdir)/$$i" ; \
|
||||
done ; \
|
||||
sh -c "lint $(DEFS) $(INCLUDES) $$files | grep -v \"possible pointer alignment problem\" \
|
||||
| grep -v \"argument closure unused\""
|
||||
|
||||
saber: $(SOURCES)
|
||||
# load $(CFLAGS) $(SOURCES)
|
||||
# load ../lib/libcvs.a $(LIBS)
|
||||
|
||||
cvsbug: cvsbug.sh
|
||||
echo > .fname \
|
||||
cvs-`sed < $(srcdir)/version.c \
|
||||
-e '/version_string/!d' \
|
||||
-e 's/[^0-9.]*\([0-9.]*\).*/\1/' \
|
||||
-e q`
|
||||
sed -e 's,xLIBDIRx,$(libdir)/cvs,g' \
|
||||
-e "s,xVERSIONx,`cat .fname`,g" $(srcdir)/$@.sh > $@-t
|
||||
rm -f .fname
|
||||
mv $@-t $@
|
||||
chmod a+x $@
|
||||
|
||||
# Compilation rules.
|
||||
|
||||
$(OBJECTS): $(HEADERS) options.h
|
||||
|
||||
subdir = src
|
||||
Makefile: ../config.status Makefile.in
|
||||
cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
|
||||
|
||||
options.h: ../config.status options.h.in
|
||||
cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
|
||||
|
||||
#../config.status: ../configure
|
||||
# cd .. ; $(SHELL) config.status --recheck
|
||||
|
||||
#../configure: ../configure.in
|
||||
# cd $(top_srcdir) ; autoconf
|
60
contrib/cvs/src/NOTES
Normal file
60
contrib/cvs/src/NOTES
Normal file
@ -0,0 +1,60 @@
|
||||
wishlist - Tue Nov 2 15:22:58 PST 1993
|
||||
|
||||
* bcopy -> memcpy & friends.
|
||||
** done 12/18/93
|
||||
|
||||
* remove static buffers.
|
||||
* replace list & node cache with recursive obstacks, (xmalloc,
|
||||
getnode, getlist)
|
||||
* check all io functions for error return codes. also check all
|
||||
system calls.
|
||||
* error check mkdir.
|
||||
|
||||
---
|
||||
Old notes...
|
||||
|
||||
* All sizing limits are gone. The rest of these items were incidental
|
||||
in that effort.
|
||||
|
||||
* login name from history was duplicated. taught existing routine to
|
||||
cache and use that instead. Also add routines to cache uid, pid,
|
||||
etc.
|
||||
|
||||
* ign strings were never freed. Now they are.
|
||||
|
||||
* there was a printf("... %s ...", cp) vs *cp bug in history.c. Now
|
||||
fixed.
|
||||
|
||||
* The environment variables TMPDIR, HOME, and LOGNAME were not
|
||||
honored. Now they are.
|
||||
|
||||
* extra line inserted by do_editor() is gone. Then obviated. Editor
|
||||
is now called exactly once per checkin.
|
||||
|
||||
* revised editor behaviour. Never use /dev/tty. If the editor
|
||||
session fails, we haven't yet done anything. Therefor the user can
|
||||
safely rerun cvs and we should just fail. Also use the editor for
|
||||
initial log messages on added files. Also omit the confirmation
|
||||
when adding directories. Adding directories will require an
|
||||
explicit "commit" step soon. Make it possible to prevent null login
|
||||
messages using #define REQUIRE_LOG_MESSAGES
|
||||
|
||||
* prototypes for all callbacks.
|
||||
|
||||
* all callbacks get ref pointers.
|
||||
|
||||
* do_recursion/start_recursion now use recusion_frame's rather than a
|
||||
list of a lot of pointers and global variables.
|
||||
|
||||
* corrected types on status_dirproc().
|
||||
|
||||
* CONFIRM_DIRECTORY_ADDS
|
||||
|
||||
* re_comp was innappropriate in a few places. I've eliminated it.
|
||||
|
||||
* FORCE_MESSAGE_ON_ADD
|
||||
|
||||
* So I built a regression test. Let's call it a sanity check to be
|
||||
less ambitious. It exposed that cvs is difficult to call from
|
||||
scripts.
|
||||
|
31
contrib/cvs/src/README-rm-add
Normal file
31
contrib/cvs/src/README-rm-add
Normal file
@ -0,0 +1,31 @@
|
||||
WHAT THE "DEATH SUPPORT" FEATURES DO:
|
||||
|
||||
(Some of the death support stuff is documented in the main manual, but
|
||||
this file is for stuff which noone has gotten around to adding to the
|
||||
main manual yet).
|
||||
|
||||
CVS with death support can record when a file is active, or alive, and
|
||||
when it is removed, or dead. With this facility you can record the
|
||||
history of a file, including the fact that at some point in its life
|
||||
the file was removed and then later added.
|
||||
|
||||
Files can now be added or removed in a branch and later merged
|
||||
into the trunk.
|
||||
|
||||
cvs update -A
|
||||
touch a b c
|
||||
cvs add a b c ; cvs ci -m "added" a b c
|
||||
cvs tag -b branchtag
|
||||
cvs update -r branchtag
|
||||
touch d ; cvs add d
|
||||
rm a ; cvs rm a
|
||||
cvs ci -m "added d, removed a"
|
||||
cvs update -A
|
||||
cvs update -jbranchtag
|
||||
|
||||
Added and removed files may also be merged between branches.
|
||||
|
||||
Files removed in the trunk may be merged into branches.
|
||||
|
||||
Files added on the trunk are a special case. They cannot be merged
|
||||
into a branch. Instead, simply branch the file by hand.
|
514
contrib/cvs/src/add.c
Normal file
514
contrib/cvs/src/add.c
Normal file
@ -0,0 +1,514 @@
|
||||
/*
|
||||
* Copyright (c) 1992, Brian Berliner and Jeff Polk
|
||||
* Copyright (c) 1989-1992, Brian Berliner
|
||||
*
|
||||
* You may distribute under the terms of the GNU General Public License as
|
||||
* specified in the README file that comes with the CVS 1.4 kit.
|
||||
*
|
||||
* Add
|
||||
*
|
||||
* Adds a file or directory to the RCS source repository. For a file,
|
||||
* the entry is marked as "needing to be added" in the user's own CVS
|
||||
* directory, and really added to the repository when it is committed.
|
||||
* For a directory, it is added at the appropriate place in the source
|
||||
* repository and a CVS directory is generated within the directory.
|
||||
*
|
||||
* The -m option is currently the only supported option. Some may wish to
|
||||
* supply standard "rcs" options here, but I've found that this causes more
|
||||
* trouble than anything else.
|
||||
*
|
||||
* The user files or directories must already exist. For a directory, it must
|
||||
* not already have a CVS file in it.
|
||||
*
|
||||
* An "add" on a file that has been "remove"d but not committed will cause the
|
||||
* file to be resurrected.
|
||||
*/
|
||||
|
||||
#include "cvs.h"
|
||||
#include "savecwd.h"
|
||||
|
||||
static int add_directory PROTO((char *repository, char *dir));
|
||||
static int build_entry PROTO((char *repository, char *user, char *options,
|
||||
char *message, List * entries, char *tag));
|
||||
|
||||
static const char *const add_usage[] =
|
||||
{
|
||||
"Usage: %s %s [-k rcs-kflag] [-m message] files...\n",
|
||||
"\t-k\tUse \"rcs-kflag\" to add the file with the specified kflag.\n",
|
||||
"\t-m\tUse \"message\" for the creation log.\n",
|
||||
NULL
|
||||
};
|
||||
|
||||
int
|
||||
add (argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
{
|
||||
char *message = NULL;
|
||||
char *user;
|
||||
int i;
|
||||
char *repository;
|
||||
int c;
|
||||
int err = 0;
|
||||
int added_files = 0;
|
||||
char *options = NULL;
|
||||
List *entries;
|
||||
Vers_TS *vers;
|
||||
|
||||
if (argc == 1 || argc == -1)
|
||||
usage (add_usage);
|
||||
|
||||
wrap_setup ();
|
||||
|
||||
/* parse args */
|
||||
optind = 1;
|
||||
while ((c = getopt (argc, argv, "k:m:")) != -1)
|
||||
{
|
||||
switch (c)
|
||||
{
|
||||
case 'k':
|
||||
if (options)
|
||||
free (options);
|
||||
options = RCS_check_kflag (optarg);
|
||||
break;
|
||||
|
||||
case 'm':
|
||||
message = xstrdup (optarg);
|
||||
break;
|
||||
case '?':
|
||||
default:
|
||||
usage (add_usage);
|
||||
break;
|
||||
}
|
||||
}
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
|
||||
if (argc <= 0)
|
||||
usage (add_usage);
|
||||
|
||||
/* find the repository associated with our current dir */
|
||||
repository = Name_Repository ((char *) NULL, (char *) NULL);
|
||||
|
||||
#ifdef CLIENT_SUPPORT
|
||||
if (client_active)
|
||||
{
|
||||
int i;
|
||||
start_server ();
|
||||
ign_setup ();
|
||||
if (options) send_arg(options);
|
||||
option_with_arg ("-m", message);
|
||||
for (i = 0; i < argc; ++i)
|
||||
/* FIXME: Does this erroneously call Create_Admin in error
|
||||
conditions which are only detected once the server gets its
|
||||
hands on things? */
|
||||
if (isdir (argv[i]))
|
||||
{
|
||||
char *tag;
|
||||
char *date;
|
||||
char *rcsdir = xmalloc (strlen (repository)
|
||||
+ strlen (argv[i]) + 10);
|
||||
|
||||
/* before we do anything else, see if we have any
|
||||
per-directory tags */
|
||||
ParseTag (&tag, &date);
|
||||
|
||||
sprintf (rcsdir, "%s/%s", repository, argv[i]);
|
||||
|
||||
Create_Admin (argv[i], argv[i], rcsdir, tag, date);
|
||||
|
||||
if (tag)
|
||||
free (tag);
|
||||
if (date)
|
||||
free (date);
|
||||
free (rcsdir);
|
||||
}
|
||||
send_file_names (argc, argv, SEND_EXPAND_WILD);
|
||||
send_files (argc, argv, 0, 0);
|
||||
send_to_server ("add\012", 0);
|
||||
return get_responses_and_close ();
|
||||
}
|
||||
#endif
|
||||
|
||||
entries = Entries_Open (0);
|
||||
|
||||
/* walk the arg list adding files/dirs */
|
||||
for (i = 0; i < argc; i++)
|
||||
{
|
||||
int begin_err = err;
|
||||
int begin_added_files = added_files;
|
||||
|
||||
user = argv[i];
|
||||
strip_trailing_slashes (user);
|
||||
if (strchr (user, '/') != NULL)
|
||||
{
|
||||
error (0, 0,
|
||||
"cannot add files with '/' in their name; %s not added", user);
|
||||
err++;
|
||||
continue;
|
||||
}
|
||||
|
||||
vers = Version_TS (repository, options, (char *) NULL, (char *) NULL,
|
||||
user, 0, 0, entries, (RCSNode *) NULL);
|
||||
if (vers->vn_user == NULL)
|
||||
{
|
||||
/* No entry available, ts_rcs is invalid */
|
||||
if (vers->vn_rcs == NULL)
|
||||
{
|
||||
/* There is no RCS file either */
|
||||
if (vers->ts_user == NULL)
|
||||
{
|
||||
/* There is no user file either */
|
||||
error (0, 0, "nothing known about %s", user);
|
||||
err++;
|
||||
}
|
||||
else if (!isdir (user) || wrap_name_has (user, WRAP_TOCVS))
|
||||
{
|
||||
/*
|
||||
* See if a directory exists in the repository with
|
||||
* the same name. If so, blow this request off.
|
||||
*/
|
||||
char dname[PATH_MAX];
|
||||
(void) sprintf (dname, "%s/%s", repository, user);
|
||||
if (isdir (dname))
|
||||
{
|
||||
error (0, 0,
|
||||
"cannot add file `%s' since the directory",
|
||||
user);
|
||||
error (0, 0, "`%s' already exists in the repository",
|
||||
dname);
|
||||
error (1, 0, "illegal filename overlap");
|
||||
}
|
||||
|
||||
/* There is a user file, so build the entry for it */
|
||||
if (build_entry (repository, user, vers->options,
|
||||
message, entries, vers->tag) != 0)
|
||||
err++;
|
||||
else
|
||||
{
|
||||
added_files++;
|
||||
if (!quiet)
|
||||
{
|
||||
if (vers->tag)
|
||||
error (0, 0, "\
|
||||
scheduling %s `%s' for addition on branch `%s'",
|
||||
(wrap_name_has (user, WRAP_TOCVS)
|
||||
? "wrapper"
|
||||
: "file"),
|
||||
user, vers->tag);
|
||||
else
|
||||
error (0, 0, "scheduling %s `%s' for addition",
|
||||
(wrap_name_has (user, WRAP_TOCVS)
|
||||
? "wrapper"
|
||||
: "file"),
|
||||
user);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (RCS_isdead (vers->srcfile, vers->vn_rcs))
|
||||
{
|
||||
if (isdir (user) && !wrap_name_has (user, WRAP_TOCVS))
|
||||
{
|
||||
error (0, 0, "the directory `%s' cannot be added because a file of the", user);
|
||||
error (1, 0, "same name already exists in the repository.");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (vers->tag)
|
||||
error (0, 0, "file `%s' will be added on branch `%s' from version %s",
|
||||
user, vers->tag, vers->vn_rcs);
|
||||
else
|
||||
error (0, 0, "version %s of `%s' will be resurrected",
|
||||
vers->vn_rcs, user);
|
||||
Register (entries, user, "0", vers->ts_user, NULL,
|
||||
vers->tag, NULL, NULL);
|
||||
++added_files;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* There is an RCS file already, so somebody else must've
|
||||
* added it
|
||||
*/
|
||||
error (0, 0, "%s added independently by second party", user);
|
||||
err++;
|
||||
}
|
||||
}
|
||||
else if (vers->vn_user[0] == '0' && vers->vn_user[1] == '\0')
|
||||
{
|
||||
|
||||
/*
|
||||
* An entry for a new-born file, ts_rcs is dummy, but that is
|
||||
* inappropriate here
|
||||
*/
|
||||
error (0, 0, "%s has already been entered", user);
|
||||
err++;
|
||||
}
|
||||
else if (vers->vn_user[0] == '-')
|
||||
{
|
||||
/* An entry for a removed file, ts_rcs is invalid */
|
||||
if (vers->ts_user == NULL)
|
||||
{
|
||||
/* There is no user file (as it should be) */
|
||||
if (vers->vn_rcs == NULL)
|
||||
{
|
||||
|
||||
/*
|
||||
* There is no RCS file, so somebody else must've removed
|
||||
* it from under us
|
||||
*/
|
||||
error (0, 0,
|
||||
"cannot resurrect %s; RCS file removed by second party", user);
|
||||
err++;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
/*
|
||||
* There is an RCS file, so remove the "-" from the
|
||||
* version number and restore the file
|
||||
*/
|
||||
char *tmp = xmalloc (strlen (user) + 50);
|
||||
|
||||
(void) strcpy (tmp, vers->vn_user + 1);
|
||||
(void) strcpy (vers->vn_user, tmp);
|
||||
(void) sprintf (tmp, "Resurrected %s", user);
|
||||
Register (entries, user, vers->vn_user, tmp, vers->options,
|
||||
vers->tag, vers->date, vers->ts_conflict);
|
||||
free (tmp);
|
||||
|
||||
/* XXX - bugs here; this really resurrect the head */
|
||||
/* Note that this depends on the Register above actually
|
||||
having written Entries, or else it won't really
|
||||
check the file out. */
|
||||
if (update (2, argv + i - 1) == 0)
|
||||
{
|
||||
error (0, 0, "%s, version %s, resurrected", user,
|
||||
vers->vn_user);
|
||||
}
|
||||
else
|
||||
{
|
||||
error (0, 0, "could not resurrect %s", user);
|
||||
err++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* The user file shouldn't be there */
|
||||
error (0, 0, "%s should be removed and is still there (or is back again)", user);
|
||||
err++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* A normal entry, ts_rcs is valid, so it must already be there */
|
||||
error (0, 0, "%s already exists, with version number %s", user,
|
||||
vers->vn_user);
|
||||
err++;
|
||||
}
|
||||
freevers_ts (&vers);
|
||||
|
||||
/* passed all the checks. Go ahead and add it if its a directory */
|
||||
if (begin_err == err
|
||||
&& isdir (user)
|
||||
&& !wrap_name_has (user, WRAP_TOCVS))
|
||||
{
|
||||
err += add_directory (repository, user);
|
||||
continue;
|
||||
}
|
||||
#ifdef SERVER_SUPPORT
|
||||
if (server_active && begin_added_files != added_files)
|
||||
server_checked_in (user, ".", repository);
|
||||
#endif
|
||||
}
|
||||
if (added_files)
|
||||
error (0, 0, "use 'cvs commit' to add %s permanently",
|
||||
(added_files == 1) ? "this file" : "these files");
|
||||
|
||||
Entries_Close (entries);
|
||||
|
||||
if (message)
|
||||
free (message);
|
||||
|
||||
return (err);
|
||||
}
|
||||
|
||||
/*
|
||||
* The specified user file is really a directory. So, let's make sure that
|
||||
* it is created in the RCS source repository, and that the user's directory
|
||||
* is updated to include a CVS directory.
|
||||
*
|
||||
* Returns 1 on failure, 0 on success.
|
||||
*/
|
||||
static int
|
||||
add_directory (repository, dir)
|
||||
char *repository;
|
||||
char *dir;
|
||||
{
|
||||
char rcsdir[PATH_MAX];
|
||||
struct saved_cwd cwd;
|
||||
char message[PATH_MAX + 100];
|
||||
char *tag, *date;
|
||||
|
||||
if (strchr (dir, '/') != NULL)
|
||||
{
|
||||
error (0, 0,
|
||||
"directory %s not added; must be a direct sub-directory", dir);
|
||||
return (1);
|
||||
}
|
||||
if (strcmp (dir, CVSADM) == 0)
|
||||
{
|
||||
error (0, 0, "cannot add a `%s' directory", CVSADM);
|
||||
return (1);
|
||||
}
|
||||
|
||||
/* before we do anything else, see if we have any per-directory tags */
|
||||
ParseTag (&tag, &date);
|
||||
|
||||
/* now, remember where we were, so we can get back */
|
||||
if (save_cwd (&cwd))
|
||||
return (1);
|
||||
if (chdir (dir) < 0)
|
||||
{
|
||||
error (0, errno, "cannot chdir to %s", dir);
|
||||
return (1);
|
||||
}
|
||||
#ifdef SERVER_SUPPORT
|
||||
if (!server_active && isfile (CVSADM))
|
||||
#else
|
||||
if (isfile (CVSADM))
|
||||
#endif
|
||||
{
|
||||
error (0, 0, "%s/%s already exists", dir, CVSADM);
|
||||
goto out;
|
||||
}
|
||||
|
||||
(void) sprintf (rcsdir, "%s/%s", repository, dir);
|
||||
if (isfile (rcsdir) && !isdir (rcsdir))
|
||||
{
|
||||
error (0, 0, "%s is not a directory; %s not added", rcsdir, dir);
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* setup the log message */
|
||||
(void) sprintf (message, "Directory %s added to the repository\n", rcsdir);
|
||||
if (tag)
|
||||
{
|
||||
(void) strcat (message, "--> Using per-directory sticky tag `");
|
||||
(void) strcat (message, tag);
|
||||
(void) strcat (message, "'\n");
|
||||
}
|
||||
if (date)
|
||||
{
|
||||
(void) strcat (message, "--> Using per-directory sticky date `");
|
||||
(void) strcat (message, date);
|
||||
(void) strcat (message, "'\n");
|
||||
}
|
||||
|
||||
if (!isdir (rcsdir))
|
||||
{
|
||||
mode_t omask;
|
||||
Node *p;
|
||||
List *ulist;
|
||||
|
||||
#if 0
|
||||
char line[MAXLINELEN];
|
||||
|
||||
(void) printf ("Add directory %s to the repository (y/n) [n] ? ",
|
||||
rcsdir);
|
||||
(void) fflush (stdout);
|
||||
clearerr (stdin);
|
||||
if (fgets (line, sizeof (line), stdin) == NULL ||
|
||||
(line[0] != 'y' && line[0] != 'Y'))
|
||||
{
|
||||
error (0, 0, "directory %s not added", rcsdir);
|
||||
goto out;
|
||||
}
|
||||
#endif
|
||||
|
||||
omask = umask (cvsumask);
|
||||
if (CVS_MKDIR (rcsdir, 0777) < 0)
|
||||
{
|
||||
error (0, errno, "cannot mkdir %s", rcsdir);
|
||||
(void) umask (omask);
|
||||
goto out;
|
||||
}
|
||||
(void) umask (omask);
|
||||
|
||||
/*
|
||||
* Set up an update list with a single title node for Update_Logfile
|
||||
*/
|
||||
ulist = getlist ();
|
||||
p = getnode ();
|
||||
p->type = UPDATE;
|
||||
p->delproc = update_delproc;
|
||||
p->key = xstrdup ("- New directory");
|
||||
p->data = (char *) T_TITLE;
|
||||
(void) addnode (ulist, p);
|
||||
Update_Logfile (rcsdir, message, (char *) NULL, (FILE *) NULL, ulist);
|
||||
dellist (&ulist);
|
||||
}
|
||||
|
||||
#ifdef SERVER_SUPPORT
|
||||
if (!server_active)
|
||||
Create_Admin (".", dir, rcsdir, tag, date);
|
||||
#else
|
||||
Create_Admin (".", dir, rcsdir, tag, date);
|
||||
#endif
|
||||
if (tag)
|
||||
free (tag);
|
||||
if (date)
|
||||
free (date);
|
||||
|
||||
(void) printf ("%s", message);
|
||||
out:
|
||||
if (restore_cwd (&cwd, NULL))
|
||||
exit (EXIT_FAILURE);
|
||||
free_cwd (&cwd);
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Builds an entry for a new file and sets up "CVS/file",[pt] by
|
||||
* interrogating the user. Returns non-zero on error.
|
||||
*/
|
||||
static int
|
||||
build_entry (repository, user, options, message, entries, tag)
|
||||
char *repository;
|
||||
char *user;
|
||||
char *options;
|
||||
char *message;
|
||||
List *entries;
|
||||
char *tag;
|
||||
{
|
||||
char fname[PATH_MAX];
|
||||
char line[MAXLINELEN];
|
||||
FILE *fp;
|
||||
|
||||
if (noexec)
|
||||
return (0);
|
||||
|
||||
/*
|
||||
* The requested log is read directly from the user and stored in the
|
||||
* file user,t. If the "message" argument is set, use it as the
|
||||
* initial creation log (which typically describes the file).
|
||||
*/
|
||||
(void) sprintf (fname, "%s/%s%s", CVSADM, user, CVSEXT_LOG);
|
||||
fp = open_file (fname, "w+");
|
||||
if (message && fputs (message, fp) == EOF)
|
||||
error (1, errno, "cannot write to %s", fname);
|
||||
if (fclose(fp) == EOF)
|
||||
error(1, errno, "cannot close %s", fname);
|
||||
|
||||
/*
|
||||
* Create the entry now, since this allows the user to interrupt us above
|
||||
* without needing to clean anything up (well, we could clean up the
|
||||
* ,t file, but who cares).
|
||||
*/
|
||||
(void) sprintf (line, "Initial %s", user);
|
||||
Register (entries, user, "0", line, options, tag, (char *) 0, (char *) 0);
|
||||
return (0);
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user