diff options
author | Maurice van der Pot <griffon26@gentoo.org> | 2008-09-23 20:17:39 +0000 |
---|---|---|
committer | Maurice van der Pot <griffon26@gentoo.org> | 2008-09-23 20:17:39 +0000 |
commit | 82954f7c8eee0cc84be6c5570db1a05b6c5ee0a1 (patch) | |
tree | 9a15dacea4d5aa9ca350200b863570936fa2073c /net-im | |
parent | Fix accidental ebuild removal (#233852). (diff) | |
download | gentoo-2-82954f7c8eee0cc84be6c5570db1a05b6c5ee0a1.tar.gz gentoo-2-82954f7c8eee0cc84be6c5570db1a05b6c5ee0a1.tar.bz2 gentoo-2-82954f7c8eee0cc84be6c5570db1a05b6c5ee0a1.zip |
Add some patches to pymsn-t for bug #238085
(Portage version: 2.2_rc8/cvs/Linux 2.6.26.2 x86_64)
Diffstat (limited to 'net-im')
-rw-r--r-- | net-im/pymsn-t/ChangeLog | 11 | ||||
-rw-r--r-- | net-im/pymsn-t/files/pymsn-t-0.11.3-delete-reactor.patch | 10 | ||||
-rw-r--r-- | net-im/pymsn-t/files/pymsn-t-0.11.3-remove-pid.patch | 41 | ||||
-rw-r--r-- | net-im/pymsn-t/files/pymsn-t-0.11.3-unexpected-xfr.patch | 44 | ||||
-rw-r--r-- | net-im/pymsn-t/pymsn-t-0.11.3-r2.ebuild | 74 |
5 files changed, 179 insertions, 1 deletions
diff --git a/net-im/pymsn-t/ChangeLog b/net-im/pymsn-t/ChangeLog index 118da1cd1990..ef6e04378e8d 100644 --- a/net-im/pymsn-t/ChangeLog +++ b/net-im/pymsn-t/ChangeLog @@ -1,6 +1,15 @@ # ChangeLog for net-im/pymsn-t # Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-im/pymsn-t/ChangeLog,v 1.15 2008/09/17 21:23:55 maekke Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-im/pymsn-t/ChangeLog,v 1.16 2008/09/23 20:17:38 griffon26 Exp $ + +*pymsn-t-0.11.3-r2 (23 Sep 2008) + + 23 Sep 2008; Maurice van der Pot <griffon26@gentoo.org> + +files/pymsn-t-0.11.3-delete-reactor.patch, + +files/pymsn-t-0.11.3-remove-pid.patch, + +files/pymsn-t-0.11.3-unexpected-xfr.patch, +pymsn-t-0.11.3-r2.ebuild: + Added some patches provided by Dennis Schridde <lindevel@gmx.net> that a.o. + fix an error when connecting (see bug #238085). 17 Sep 2008; Markus Meier <maekke@gentoo.org> pymsn-t-0.11.3-r1.ebuild: amd64/x86 stable, bug #237886 diff --git a/net-im/pymsn-t/files/pymsn-t-0.11.3-delete-reactor.patch b/net-im/pymsn-t/files/pymsn-t-0.11.3-delete-reactor.patch new file mode 100644 index 000000000000..19ad24f3a8fd --- /dev/null +++ b/net-im/pymsn-t/files/pymsn-t-0.11.3-delete-reactor.patch @@ -0,0 +1,10 @@ +--- pymsn-t/src/main.py 2008-09-19 10:53:30.000000000 +0200 ++++ pymsn-t/src/main.py 2008-09-19 10:55:55.000000000 +0200 +@@ -72,7 +72,6 @@ + + if config.reactor: + # They picked their own reactor. Lets install it. +- del sys.modules["twisted.internet.reactor"] + if config.reactor == "epoll": + from twisted.internet import epollreactor + epollreactor.install() diff --git a/net-im/pymsn-t/files/pymsn-t-0.11.3-remove-pid.patch b/net-im/pymsn-t/files/pymsn-t-0.11.3-remove-pid.patch new file mode 100644 index 000000000000..fb85d043d6f5 --- /dev/null +++ b/net-im/pymsn-t/files/pymsn-t-0.11.3-remove-pid.patch @@ -0,0 +1,41 @@ +--- pymsn-t/src/main.py 2008-04-04 17:45:43.000000000 +0400 ++++ pymsn-t/src/main.py 2008-08-05 17:44:17.000000000 +0400 +@@ -91,6 +91,7 @@ + from twisted.words.xish.domish import Element + from twisted.words.protocols.jabber import component + from twisted.words.protocols.jabber.jid import internJID ++from twisted.python import log + + from debug import LogEvent, INFO, WARN, ERROR + +@@ -352,13 +353,29 @@ + pf = open(config.pid, "w") + pf.write("%s\n" % pid) + pf.close() ++ ++ def removePID(self, pidfile): ++ # Remove a PID file ++ if not pidfile: ++ return ++ try: ++ os.unlink(pidfile) ++ except OSError, e: ++ if e.errno == errno.EACCES or e.errno == errno.EPERM: ++ log.msg("Warning: No permission to delete pid file") ++ else: ++ log.msg("Failed to unlink PID file:") ++ log.deferr() ++ except: ++ log.msg("Failed to unlink PID file:") ++ log.deferr() + + def shuttingDown(self): + self.transportSvc.removeMe() + # Keep the transport running for another 3 seconds + def cb(ignored=None): + if config.pid: +- twistd.removePID(config.pid) ++ self.removePID(config.pid) + d = Deferred() + d.addCallback(cb) + reactor.callLater(3.0, d.callback, None) diff --git a/net-im/pymsn-t/files/pymsn-t-0.11.3-unexpected-xfr.patch b/net-im/pymsn-t/files/pymsn-t-0.11.3-unexpected-xfr.patch new file mode 100644 index 000000000000..7d93d975852e --- /dev/null +++ b/net-im/pymsn-t/files/pymsn-t-0.11.3-unexpected-xfr.patch @@ -0,0 +1,44 @@ +--- pymsn-t/src/legacy/glue.py 2008-09-19 10:53:30.000000000 +0200 ++++ pymsn-t/src/legacy/glue.py 2008-09-19 10:52:38.000000000 +0200 +@@ -379,7 +379,13 @@ + self.session.removeMe() + + def connectionLost(self, reason): +- LogEvent(INFO, self.jabberID) ++ LogEvent(INFO, self.jabberID) ++ # If we got a second referral, don't really log out but let the next NS ++ # try to log us in ++ if reason.type == error.ConnectionDone and self.gotadditionalXFR != 0: ++ LogEvent(INFO, self.ident) ++ self.gotadditionalXFR = 0 ++ return + if reason.type != error.ConnectionDone: + text = lang.get(self.session.lang).msnDisconnected % reason + self.session.sendMessage(to=self.jabberID, fro=config.jid, body=text) +--- pymsn-t/src/legacy/msn/msn.py 2008-09-19 10:53:30.000000000 +0200 ++++ pymsn-t/src/legacy/msn/msn.py 2008-09-19 10:52:38.000000000 +0200 +@@ -1347,7 +1347,9 @@ + port = MSN_PORT + + if not self._fireCallback(id, host, int(port), params[4]): +- raise MSNProtocolError, "Got XFR (referral) that I didn't ask for .. should this happen?" # debug ++ #raise MSNProtocolError, "Got XFR (referral) that I didn't ask for .. should this happen?" # debug ++ self.factory.msncon.gotadditionalXFR = 1 ++ self.factory.msncon.connectors.append(reactor.connectTCP(host, int(port), self.factory, bindAddress=(self.factory.msncon.BINDADDRESS, 0))) + + def handle_RNG(self, params): + checkParamLen(len(params), 6, 'RNG') +--- pymsn-t/src/legacy/msn/msnw.py 2008-09-19 10:53:30.000000000 +0200 ++++ pymsn-t/src/legacy/msn/msnw.py 2008-09-19 10:52:38.000000000 +0200 +@@ -67,8 +67,9 @@ + LogEvent(INFO, self.ident) + + def _gotNotificationReferral(self, (host, port)): +- self.timeout.cancel() +- self.timeout = None ++ if self.timeout != None: ++ self.timeout.cancel() ++ self.timeout = None + # Create the NotificationClient + self.notificationFactory = msn.NotificationFactory() + self.notificationFactory.userHandle = self.username diff --git a/net-im/pymsn-t/pymsn-t-0.11.3-r2.ebuild b/net-im/pymsn-t/pymsn-t-0.11.3-r2.ebuild new file mode 100644 index 000000000000..76cf7e108392 --- /dev/null +++ b/net-im/pymsn-t/pymsn-t-0.11.3-r2.ebuild @@ -0,0 +1,74 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-im/pymsn-t/pymsn-t-0.11.3-r2.ebuild,v 1.1 2008/09/23 20:17:38 griffon26 Exp $ + +NEED_PYTHON=2.3 + +inherit eutils multilib python + +MY_PN="pymsnt" +S=${WORKDIR}/${MY_PN}-${PV} +DESCRIPTION="Python based jabber transport for MSN" +HOMEPAGE="http://msn-transport.jabberstudio.org/" +SRC_URI="http://msn-transport.jabberstudio.org/tarballs/${MY_PN}-${PV}.tar.gz" +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~x86" +IUSE="" + +DEPEND="net-im/jabber-base" +RDEPEND="${DEPEND} + >=dev-python/twisted-2.5.0 + >=dev-python/twisted-words-0.5.0 + >=dev-python/twisted-web-0.7.0 + >=dev-python/imaging-1.1" + +src_unpack() { + unpack ${A} && cd "${S}" || die "unpack failed" + epatch "${FILESDIR}/${P}-protocol-version.patch" + epatch "${FILESDIR}/${P}-unexpected-xfr.patch" + epatch "${FILESDIR}/${P}-remove-pid.patch" + epatch "${FILESDIR}/${P}-delete-reactor.patch" +} + +src_install() { + local inspath + + python_version + inspath=/usr/$(get_libdir)/python${PYVER}/site-packages/${PN} + insinto ${inspath} + doins -r data src + newins PyMSNt.py ${PN}.py + + insinto /etc/jabber + newins config-example.xml ${PN}.xml + fperms 600 /etc/jabber/${PN}.xml + fowners jabber:jabber /etc/jabber/${PN}.xml + dosed \ + "s:<!-- <spooldir>[^\<]*</spooldir> -->:<spooldir>/var/spool/jabber</spooldir>:" \ + /etc/jabber/${PN}.xml + dosed \ + "s:<pid>[^\<]*</pid>:<pid>/var/run/jabber/${PN}.pid</pid>:" \ + /etc/jabber/${PN}.xml + dosed \ + "s:<host>[^\<]*</host>:<host>example.org</host>:" \ + /etc/jabber/${PN}.xml + dosed \ + "s:<jid>msn</jid>:<jid>msn.example.org</jid>:" \ + /etc/jabber/${PN}.xml + + newinitd "${FILESDIR}/${PN}-0.11.2-initd" ${PN} + dosed "s:INSPATH:${inspath}:" /etc/init.d/${PN} +} + +pkg_postinst() { + python_version + python_mod_optimize /usr/$(get_libdir)/python${PYVER}/site-packages/${PN} + + elog "A sample configuration file has been installed in /etc/jabber/${PN}.xml." + elog "Please edit it and the configuration of your Jabber server to match." +} + +pkg_postrm() { + python_mod_cleanup /usr/$(get_libdir)/python*/site-packages/${PN} +} |