Bug 107891 - Latest PythonTwisted update breaks jabber-icq-transport
Summary: Latest PythonTwisted update breaks jabber-icq-transport
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Renato Botelho
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-13 23:10 UTC by neil
Modified: 2007-01-15 12:03 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description neil 2007-01-13 23:10:33 UTC
Following the latest PythonTwisted update, attempting to start
jabber-pyicq-transport gives:

Starting jabber_pyicq.
Traceback (most recent call last):
  File "/usr/local/lib/jabber/pyicq/PyICQt.py", line 16, in ?
    main.main()
  File "/usr/local/lib/jabber/pyicq/src/main.py", line 443, in main
    app = App()
  File "/usr/local/lib/jabber/pyicq/src/main.py", line 393, in __init__
    twistd.checkPID(config.pid)
AttributeError: 'module' object has no attribute 'checkPID'
Comment 1 Edwin Groothuis freebsd_committer 2007-01-13 23:12:20 UTC
State Changed
From-To: open->feedback

Which port is PythonTwisted coming from?
Comment 2 neil 2007-01-14 12:16:36 UTC
PythonTwisted refers to a number of ports which are a dependency of
jabber-icq-transport, i.e. py-twistedCore, py-twistedWeb and
py-twistedWords, all of which have received updates.

Although one, or more, of these packages breaks jabber-icq-transport it
is jabber-icq-transport itself that needs to be updated. garga is
usually very efficient at doing this when given a bug report.
Comment 3 Renato Botelho freebsd_committer 2007-01-14 19:23:46 UTC
Responsible Changed
From-To: freebsd-ports-bugs->garga

I'll take it.
Comment 4 Renato Botelho freebsd_committer 2007-01-14 19:52:12 UTC
I found the problem, twisted.scripts.twistd was moved to
twisted.scripts._twistd_unix.

Here is a patch, could you test it for me and give me a feedback before I
commit this change?

Index: Makefile
===================================================================
RCS file: /home/pcvs/ports/net-im/jabber-pyicq/Makefile,v
retrieving revision 1.17
diff -u -r1.17 Makefile
--- Makefile	1 Oct 2006 11:56:59 -0000	1.17
+++ Makefile	14 Jan 2007 19:21:38 -0000
@@ -6,6 +6,7 @@
 
 PORTNAME=	pyicq
 PORTVERSION=	0.8
+PORTREVISION=	1
 CATEGORIES=	net-im
 MASTER_SITES=	http://www.blathersource.org/download.php/pyicq-t/
 PKGNAMEPREFIX=	jabber-
@@ -62,6 +63,7 @@
 		${WRKSRC}/src/main.py
 	@${REINPLACE_CMD} -i "" 's|^#!.*$$|#!${LOCAL_PYTHON}|' \
 		${WRKSRC}/PyICQt.py
+	@${RM} -f ${WRKSRC}/src/main.py.orig
 
 do-install:
 	${MKDIR} ${INST_DIR}/src ${INST_DIR}/data
Index: files/patch-src_main.py
===================================================================
RCS file: files/patch-src_main.py
diff -N files/patch-src_main.py
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-src_main.py	14 Jan 2007 19:21:38 -0000
@@ -0,0 +1,37 @@
+--- src/main.py.orig	Sun Jan 14 17:17:30 2007
++++ src/main.py	Sun Jan 14 17:18:08 2007
+@@ -89,7 +89,7 @@
+ 	import signal
+ 	signal.signal(signal.SIGHUP, reloadConfig)
+ 	# Load scripts for PID and daemonizing
+-	from twisted.scripts import twistd
++	from twisted.scripts._twistd_unix import checkPID, removePID, daemonize
+ 
+ selectWarning = "Unable to install any good reactors (kqueue, cf, epoll, poll).\nWe fell back to using select. You may have scalability problems.\nThis reactor will not support more than 1024 connections +at a time.  You may silence this message by choosing 'select' or 'default' as your reactor in the transport config."
+ if config.reactor and len(config.reactor) > 0:
+@@ -390,14 +390,14 @@
+ 		if config.pid and os.name != "posix":
+ 			config.pid = ""
+ 		if config.pid:
+-			twistd.checkPID(config.pid)
++			checkPID(config.pid)
+ 
+ 		# Do any auto-update stuff
+ 		xdb.housekeep()
+ 
+ 		# Daemonise the process and write the PID file
+ 		if daemonizeme and os.name == "posix":
+-			twistd.daemonize()
++			daemonize()
+ 		if config.pid:
+ 			self.writePID()
+ 
+@@ -431,7 +431,7 @@
+ 		self.transportSvc.removeMe()
+ 		def cb(ignored=None):
+ 			if config.pid:
+-				twistd.removePID(config.pid)
++				removePID(config.pid)
+ 		d = Deferred()
+ 		d.addCallback(cb)
+ 		reactor.callLater(3.0, d.callback, None)

Thanks
-- 
Renato Botelho <garga @ FreeBSD.org>
               <freebsd @ galle.com.br>
GnuPG Key: http://www.FreeBSD.org/~garga/pubkey.asc

In good speaking, should not the mind of the speaker
know the truth of the matter about which he is to speak?
		-- Plato
Comment 5 Renato Botelho freebsd_committer 2007-01-14 21:42:46 UTC
I found the problem, and here is a patch. Could you test it for me?

http://people.freebsd.org/~garga/patches/jabber/jabber-pyicq.diff

Let me know if it's working and i can commit it.

Thanks
Comment 6 Renato Botelho freebsd_committer 2007-01-14 21:56:48 UTC
I got a new version of the change to make it working in 2.4 and 2.5

You can get both here:

http://people.freebsd.org/~garga/patches/jabber/

Please, test and let me know if it work.

Thanks
Comment 7 neil 2007-01-14 22:42:24 UTC
Tested both patches against Twisted-2.5

They apply cleanly, build and start transport without errors.

Will upstream be fixing the sources?
Comment 8 dfilter service freebsd_committer 2007-01-15 11:52:04 UTC
garga       2007-01-15 11:51:58 UTC

  FreeBSD ports repository

  Modified files:
    net-im/jabber-pyicq  Makefile 
  Added files:
    net-im/jabber-pyicq/files patch-src_main.py 
  Log:
  - Patch to work with py-twisted 2.5.0
  - Bump PORTREVISION
  
  PR:             ports/107891
  Submitted by:   Neil Darlow <neil@darlow.co.uk>
  Obtained from:  py-transports maillist (Lars T. Mikkelsen)
  
  Revision  Changes    Path
  1.18      +2 -0      ports/net-im/jabber-pyicq/Makefile
  1.5       +14 -0     ports/net-im/jabber-pyicq/files/patch-src_main.py (new)
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 9 Renato Botelho freebsd_committer 2007-01-15 12:03:57 UTC
State Changed
From-To: feedback->closed

Committed. Thanks!