This is the mail archive of the
gnats-devel@sourceware.cygnus.com
mailing list for the GNATS project.
gnatsd accepting new PRs
- To: Bob Manson <bmanson@juniper.net>
- Subject: gnatsd accepting new PRs
- From: Rick Macdonald <rickm@vsl.com>
- Date: Mon, 23 Aug 1999 11:55:06 -0600 (MDT)
- cc: gnats-devel@sourceware.cygnus.com, bug-gnats@gnu.org, Tony Parent <tony.parent@lsil.com>
Bob - back in April, Tony Parent contributed a patch to allow gnatsd to
accept new PRs directly. This is a feature that everyone has wanted for a
long long time. One benefit is that front-ends can notify the user
immediately of the new PR number.
I don't suppose that this ever got picked up? The patch probably wouldn't
match your new code now.
Here are the notes that Tony last sent, just to give you an idea of what
was done. I have the "version 3" of the actual patch, if you want it. I
never installed the patch itself, but I gave a little bit of feedback to
the first couple of attempts to help Tony as he was doing it.
--- snip ---
Here is version 3 of a patch to gnats-3.110 that changes gnatsd so that it
can create new PR's directly. It adds a new command to gnatsd "crte" that
takes a PR text followed by a "." on a line by itself.
The basic difference from version 2 of this patch is that I no longer use
setjmp/longjmp in punt(). The code is still in there, but is turned off
for now via a #ifdef. I left the setjmp/longjmp in just in case. You may
discard this if you don't want it. Not using setjmp/longjmp makes the
gnats() function in file-pr.c more convuluted, but hopefully more
portable.
Procedure:
- Check for db lock. -- print error and return if locked
- Lock db if unlocked.
- Read in text.
- Call gnats() function from file-pr to create new PR
- Unlock db.
- Print out PR number. (Return PR # to client.)
Some things I had to change:
Makefile -- to add file-pr.o to gnatsd
cmds.c -- to add the command. Other changes in this file include a
quite
flag so reset and unlock don't print out stuff if an error
occured, and the addition of the crte command to the help
function.
file-pr -- Changed the function "gnats()" to return an integer. This is
the new PR number or -1 if none. It used to return void so
all previous calls will simply discard this value. Therefore
this should be safe.
gnatsd.c -- Added the command to the list of possible commands.
...RickM...