[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Mimic the mail command with Jabber
From: |
Mark D. Baushke |
Subject: |
Re: Mimic the mail command with Jabber |
Date: |
Sun, 12 Feb 2006 05:47:33 -0800 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
=?iso-8859-2?q?Micha=B3_Wo=BCniak?= <address@hidden> writes:
> I am writing a short Python script to send CVS watch notification via
> Jabber rather than mail.
Note: You may wish to be careful not to write anything to STDERR from
your notify script. I believe such traffic may be possible to confuse
the run_popen() that is being used for the notify trigger. It might make
sense for this to eventually be converted to using a run_exec() method
to give it its own tty to avoid this kind of problem...
> All works well ATM, but I need to know, what *exactly* does CVS repo's
> engin output to the mail command through stdin.
CVS is an open source project. Feel free to read the sources. You want
to read the src/edit.c::notify_proc() function to see what it is going
to send to you.
fprintf (pipefp, "%s %s\n---\n", srepos, args->file);
fprintf (pipefp, "Triggered %s watch on %s\n", args->type, repository);
fprintf (pipefp, "By %s\n", args->who);
On the first line is the pathname for the directory in the repository
followed by a space followed by the name of the file for the
notification. This is followed by a literal line "---". This is followed
by a line which starts with "Triggered " and then the type ("edit",
"unedit", "commit", "temporary edit", "temporary unedit", "temporary
commit") followed by " watch on " followed by the pathname of the root
of the repository followed by a newline. This is followed by "By " and
then the user performing the operation and a newline.
> And, what is most important, what is the end-of-data marker here. It's
> not a newline, as the messages contain many lines.
When you reach the end-of-file on stdin, you will have found the
end-of-data marker.
The output of the notify trigger is intended to be human readable and
should be four lines total at present for each file.
Enjoy!
-- Mark
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)
iD8DBQFD7zx0Cg7APGsDnFERApeBAKCQ/6vgNN+rrUt4Sd2Vz5f4pVjrLwCg1SZo
T4BJ/WYOPb5Q+yHE0sSj+i4=
=tZH0
-----END PGP SIGNATURE-----