Add patch to avoid exception in git browser. The underlying issue seems to be a race; if the spawned git log command finishes before trac kills it, the os.kill() throws an exception which is not caught. Simply catch and ignore the exception. I sent the patch to trac-devel@.diff -r1.63 -r1.64 pkgsrc/www/trac/Makefile
(gdt)
@@ -1,17 +1,18 @@ | @@ -1,17 +1,18 @@ | |||
1 | # $NetBSD: Makefile,v 1.63 2014/01/25 10:45:22 wiz Exp $ | 1 | # $NetBSD: Makefile,v 1.64 2014/03/11 17:41:44 gdt Exp $ | |
2 | 2 | |||
3 | DISTNAME= Trac-1.0.1 | 3 | DISTNAME= Trac-1.0.1 | |
4 | PKGNAME= ${DISTNAME:tl} | 4 | PKGNAME= ${DISTNAME:tl} | |
5 | PKGREVISION= 1 | |||
5 | CATEGORIES= devel www | 6 | CATEGORIES= devel www | |
6 | MASTER_SITES= http://ftp.edgewall.org/pub/trac/ \ | 7 | MASTER_SITES= http://ftp.edgewall.org/pub/trac/ \ | |
7 | ftp://ftp.edgewall.org/pub/trac/ | 8 | ftp://ftp.edgewall.org/pub/trac/ | |
8 | 9 | |||
9 | MAINTAINER= gdt@NetBSD.org | 10 | MAINTAINER= gdt@NetBSD.org | |
10 | HOMEPAGE= http://trac.edgewall.org/ | 11 | HOMEPAGE= http://trac.edgewall.org/ | |
11 | COMMENT= Repository browser, wiki, and issue tracking system | 12 | COMMENT= Repository browser, wiki, and issue tracking system | |
12 | LICENSE= modified-bsd | 13 | LICENSE= modified-bsd | |
13 | 14 | |||
14 | # Maintainer notes: | 15 | # Maintainer notes: | |
15 | # | 16 | # | |
16 | # This package is similar to wip/trac, which in turn structurally | 17 | # This package is similar to wip/trac, which in turn structurally | |
17 | # matches www/ja-trac. Ideally, www/trac and ja-trac would converge. | 18 | # matches www/ja-trac. Ideally, www/trac and ja-trac would converge. |
@@ -1,5 +1,6 @@ | @@ -1,5 +1,6 @@ | |||
1 | $NetBSD: distinfo,v 1.32 2014/01/21 22:29:33 gdt Exp $ | 1 | $NetBSD: distinfo,v 1.33 2014/03/11 17:41:44 gdt Exp $ | |
2 | 2 | |||
3 | SHA1 (Trac-1.0.1.tar.gz) = b4fffeb171a64299597be616002aee44054673f6 | 3 | SHA1 (Trac-1.0.1.tar.gz) = b4fffeb171a64299597be616002aee44054673f6 | |
4 | RMD160 (Trac-1.0.1.tar.gz) = db9abe8f7e52b28aa933187fd2be40bb4a544617 | 4 | RMD160 (Trac-1.0.1.tar.gz) = db9abe8f7e52b28aa933187fd2be40bb4a544617 | |
5 | Size (Trac-1.0.1.tar.gz) = 3479896 bytes | 5 | Size (Trac-1.0.1.tar.gz) = 3479896 bytes | |
6 | SHA1 (patch-tracopt_versioncontrol_git_PyGIT.py) = e0ccdbe2c6a0dc83009460a214763d9d5eccdf04 |
$NetBSD: patch-tracopt_versioncontrol_git_PyGIT.py,v 1.1 2014/03/11 17:41:44 gdt Exp $
The git browser can fail if the git log process has already exited when
trac tries to terminate it (resulting in a python exception).
This patch should be applied upstream; Reported to trac-devel@ on 2014-03-11.
--- tracopt/versioncontrol/git/PyGIT.py.orig 2013-02-01 00:47:41.000000000 +0000
+++ tracopt/versioncontrol/git/PyGIT.py
@@ -913,7 +913,11 @@ class Storage(object):
except ValueError:
break
f.close()
- terminate(p[0])
+ # The process may or may not have finished.
+ try:
+ terminate(p[0])
+ except:
+ pass
p[0].wait()
p[:] = []
while True:
@@ -930,7 +934,10 @@ class Storage(object):
if p:
p[0].stdout.close()
- terminate(p[0])
+ try:
+ terminate(p[0])
+ except:
+ pass
p[0].wait()
def last_change(self, sha, path, historian=None):