savannah-hackers-public
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Savannah-hackers-public] Re: ciabot.py fixes


From: Sylvain Beucler
Subject: [Savannah-hackers-public] Re: ciabot.py fixes
Date: Sun, 8 Aug 2010 23:58:12 +0200
User-agent: Mutt/1.5.20 (2009-06-14)

Hello,

On Sun, Aug 01, 2010 at 12:38:25AM +0200, Sylvain Beucler wrote:
> On Sat, Jul 31, 2010 at 04:52:47PM -0400, Eric Raymond wrote:
> > Sylvain Beucler <address@hidden>:
> > > Hello,
> > > 
> > > contrib/ciabot/ciabot.py is outdated, and
> > > http://www.catb.org/~esr/ciabot/ciabot.py is 500.
> > > What should I do? :)
> > > 
> > > Nevertheless, I got a patch from the mailing list archive, and the
> > > current result has 2 bugs:
> > > 
> > > - it looks for 'xmlrpc' instead of 'ciabot.xmlrpc' in the config
> > > 
> > > - it does not strip the mail headers before sending XML to the XML-RPC
> > >   service
> > > 
> > > I can send patches, but it's probably better that I do a diff on your
> > > latest release rather than what I currently have.
> > > 
> > > -- 
> > > Sylvain
> > 
> > Latest version enclosed.  Sorry about the 500; it's some kind of config 
> > error
> > at ibiblio.
> 
> Thanks, and here's the patch.
> 
> I suspect that renaming to 'ciabot.py.txt' would help working around the
> ibiblio config issue.

Here's another patch that escapes the XML, otherwise commits than
include '&' characters get rejected.

--- ciabot.py-esr       2010-07-31 22:32:47.000000000 +0000
+++ ciabot.py   2010-08-08 21:54:57.000000000 +0000
@@ -48,6 +48,7 @@
 #
 
 import os, sys, commands, socket, urllib
+from xml.sax.saxutils import escape
 
 # Changeset URL prefix for your repo: when the commit ID is appended
 # to this, it should point at a CGI that will display the commit
@@ -134,6 +136,8 @@
     files=do("git diff-tree -r --name-only '"+ merged +"' | sed -e '1d' -e 
's-.*-<file>&</file>-'")
     metainfo = do("git log -1 '--pretty=format:%an <%ae>%n%at%n%s' " + merged)
     (author, ts, logmsg) = metainfo.split("\n")
+    logmsg = escape(logmsg)
+    author = escape(author)
 
     # This discards the part of the authors addrsss after @.
     # Might be be nice to ship the full email address, if not

Regards,

-- 
Sylvain



reply via email to

[Prev in Thread] Current Thread [Next in Thread]