From: Marien Zwart Date: Wed, 23 Nov 2005 17:39:01 +0000 (+0000) Subject: version bump to 2.1.0 (bug 110388) with a lot of ebuild changes to fix part of bug... X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=96c06dc65dadc3202e16d35512dfed9c96b5ff03;p=gentoo.git version bump to 2.1.0 (bug 110388) with a lot of ebuild changes to fix part of bug 80639, taking over maintainership Package-Manager: portage-2.0.53_rc7 --- diff --git a/dev-python/twisted/ChangeLog b/dev-python/twisted/ChangeLog index c3465b62fb23..c26b48ca6f75 100644 --- a/dev-python/twisted/ChangeLog +++ b/dev-python/twisted/ChangeLog @@ -1,6 +1,16 @@ # ChangeLog for dev-python/twisted # Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-python/twisted/ChangeLog,v 1.51 2005/11/05 21:42:52 ferdy Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-python/twisted/ChangeLog,v 1.52 2005/11/23 17:39:00 marienz Exp $ + +*twisted-2.1.0 (23 Nov 2005) + + 23 Nov 2005; Marien Zwart + +files/twisted-2.1.0-trial-tests.patch, + +files/twisted-2.1.0-trial-tests2.patch, + +files/twisted-2.1.0-zsh-head.patch, +files/twistd.conf, + +files/twistd.init, metadata.xml, +twisted-2.1.0.ebuild: + version bump to 2.1.0 to fix bug 110388, and a lot of ebuild changes to fix + part of bug 80639. Taking over maintainership. 05 Nov 2005; Fernando J. Pereda twisted-2.0.0.ebuild: marked ~alpha wrt bug #110575 diff --git a/dev-python/twisted/files/digest-twisted-2.1.0 b/dev-python/twisted/files/digest-twisted-2.1.0 new file mode 100644 index 000000000000..a164b64b1b56 --- /dev/null +++ b/dev-python/twisted/files/digest-twisted-2.1.0 @@ -0,0 +1 @@ +MD5 0aa4b877c4e34750e52c9f0b93959913 Twisted-2.1.0.tar.bz2 1078044 diff --git a/dev-python/twisted/files/twistd.conf b/dev-python/twisted/files/twistd.conf new file mode 100644 index 000000000000..53788cd0017e --- /dev/null +++ b/dev-python/twisted/files/twistd.conf @@ -0,0 +1,7 @@ + +# These are passed to twistd. +# TWISTD_OPTS="--no_save --logfile=/var/log/twistd -y /etc/twistd.tac" +# TWISTD_OPTS="--no_save --logfile=/var/log/twistd -f /etc/twistd.tap" + +# Make any additions to PYTHONPATH the twistd needs here. +# PYTHONPATH="/path/to/extra/python/modules" diff --git a/dev-python/twisted/files/twistd.init b/dev-python/twisted/files/twistd.init new file mode 100644 index 000000000000..0f79667a8237 --- /dev/null +++ b/dev-python/twisted/files/twistd.init @@ -0,0 +1,24 @@ +#!/sbin/runscript + +depend() { + need net +} + +start() { + if [[ -z "${TWISTD_OPTS}" ]]; then + eerror "TWISTD_OPTS is not set!" + eerror "You need to configure twistd in /etc/conf.d/twistd." + return 1 + fi + ebegin "Starting twistd" + start-stop-daemon --start --quiet --pidfile /var/run/twistd.pid \ + --exec /usr/bin/twistd -- --pidfile /var/run/twistd.pid \ + ${TWISTD_OPTS} + eend $? "Failed to start twistd" +} + +stop() { + ebegin "Stopping twistd" + start-stop-daemon --stop --quiet --pidfile /var/run/twistd.pid + eend $? "Failed to stop twistd" +} diff --git a/dev-python/twisted/files/twisted-2.1.0-trial-tests.patch b/dev-python/twisted/files/twisted-2.1.0-trial-tests.patch new file mode 100644 index 000000000000..892b066eb8d8 --- /dev/null +++ b/dev-python/twisted/files/twisted-2.1.0-trial-tests.patch @@ -0,0 +1,359 @@ +Index: Twisted/twisted/trial/test/test_output.py +=================================================================== +--- Twisted/twisted/trial/test/test_output.py (revision 14794) ++++ Twisted/twisted/trial/test/test_output.py (revision 14797) +@@ -1,17 +1,14 @@ + from twisted.trial import unittest ++from twisted.trial.test import packages + from twisted.python import util + from twisted.internet import utils, reactor, interfaces +-import os, re ++import os, re, sys + +-def getTrialPath(): +- fp = os.path.abspath(unittest.__file__) +- trialPath = fp.split(os.sep)[:-3] + ['bin', 'trial'] +- return os.path.normpath(os.path.join(fp, os.pardir, os.pardir, +- os.pardir, 'bin', 'trial')) + +- + def runTrialWithEnv(env, *args): +- return utils.getProcessOutput(getTrialPath(), args=args, errortoo=1, ++ params = [ '-c', 'from twisted.scripts.trial import run; run()' ] ++ params.extend(args) ++ return utils.getProcessOutput(sys.executable, args=params, errortoo=1, + env=env) + + +@@ -27,16 +24,14 @@ + ## shell out for this stuff. + + debug = False ++ parent = "_testImportErrors" + +- def _getMockEnvironment(self): +- path = self._getMockPath() +- env = os.environ.copy() +- if not env.has_key('PYTHONPATH'): +- env['PYTHONPATH'] = path +- else: +- env['PYTHONPATH'] += os.pathsep + path +- return env ++ def setUp(self): ++ packages.setUp(self.parent) + ++ def tearDown(self): ++ packages.tearDown(self.parent) ++ + def _runTrial(self, env, *args): + d = runTrialWithEnv(env, *args) + if self.debug: +@@ -44,42 +39,29 @@ + return d + + def runTrial(self, *args): +- return self._runTrial(self._getMockEnvironment(), *args) ++ env = os.environ.copy() ++ env['PYTHONPATH'] = os.pathsep.join([self.parent] + sys.path) ++ return self._runTrial(env, *args) + + def runTrialPure(self, *args): +- return self._runTrial(os.environ, *args) +- ++ env = os.environ.copy() ++ env['PYTHONPATH'] = os.pathsep.join(sys.path) ++ return self._runTrial(env, *args) ++ + def _print(self, stuff): + print stuff + return stuff + +- def _getMockPath(self): +- from twisted.trial import test +- return os.path.normpath(util.sibpath(test.__file__, 'foo')) +- + def failUnlessIn(self, container, containee, *args, **kwargs): + # redefined to be useful in callbacks +- unittest.TestCase.failUnlessSubstring(self, containee, container, +- *args, **kwargs) ++ self.failUnlessSubstring(containee, container, *args, **kwargs) + return container + + def failIfIn(self, container, containee, *args, **kwargs): + # redefined to be useful in callbacks +- unittest.TestCase.failIfSubstring(self, containee, container, +- *args, **kwargs) ++ self.failIfSubstring(containee, container, *args, **kwargs) + return container + +- def test_trialFound(self): +- self.failUnless(os.path.isfile(getTrialPath()), getTrialPath()) +- +- def test_mockPathCorrect(self): +- # This doesn't test a feature. This tests that we are accurately finding +- # the directory with all of the mock modules and packages. +- path = self._getMockPath() +- self.failUnless(path.endswith('twisted/trial/test/foo'), +- 'got path: %r' % path) +- self.failUnless(os.path.isdir(path)) +- + def test_trialRun(self): + d = self.runTrial('--help') + d.addCallback(self.failUnless, 'trial') +@@ -155,7 +137,7 @@ + return d + + def test_nonRecurseImportErrors(self): +- d = self.runTrial('package2') ++ d = self.runTrial('-N', 'package2') + d.addCallback(self.failUnlessIn, 'IMPORT ERROR') + d.addCallback(self.failUnlessIn, "No module named frotz") + d.addCallback(self.failIfIn, ' python -lordvan@gentoo.org +marienz@gentoo.org + +Twisted is an asynchronous networking framework written in Python, +supporting TCP, UDP, multicast, SSL/TLS, serial communication and +more. It is used by most of the servers, clients and protocols that +are part of other Twisted projects. + diff --git a/dev-python/twisted/twisted-2.1.0.ebuild b/dev-python/twisted/twisted-2.1.0.ebuild new file mode 100644 index 000000000000..11e50683315d --- /dev/null +++ b/dev-python/twisted/twisted-2.1.0.ebuild @@ -0,0 +1,109 @@ +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-python/twisted/twisted-2.1.0.ebuild,v 1.1 2005/11/23 17:39:01 marienz Exp $ + +inherit eutils distutils versionator + +MY_P=Twisted-${PV} + +DESCRIPTION="An asynchronous networking framework written in Python" +HOMEPAGE="http://www.twistedmatrix.com/" +SRC_URI="http://tmrc.mit.edu/mirror/twisted/Twisted/$(get_version_component_range 1-2)/${MY_P}.tar.bz2" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~ppc ~sparc ~x86" +IUSE="gtk serial crypt" + +DEPEND=">=dev-lang/python-2.2 + >=net-zope/zopeinterface-3.0.1 + serial? ( dev-python/pyserial ) + crypt? ( >=dev-python/pyopenssl-0.5.1 ) + gtk? ( >=dev-python/pygtk-1.99 )" + +S="${WORKDIR}/${MY_P}" + +DOCS="CREDITS INSTALL NEWS README" + +src_unpack() { + unpack ${A} + cd "${S}" + epatch "${FILESDIR}/${P}-trial-tests.patch" + epatch "${FILESDIR}/${P}-trial-tests2.patch" + epatch "${FILESDIR}/${P}-zsh-head.patch" +} + +src_install() { + distutils_src_install + + # get rid of this to prevent collision-protect from killing us. it + # is regenerated in pkg_postinst. + rm "${D}/usr/$(get_libdir)"/python*/site-packages/twisted/plugins/dropin.cache + + # weird pattern to avoid installing the index.xhtml page + doman doc/man/*.? + insinto /usr/share/doc/${PF} + doins -r $(find doc -mindepth 1 -maxdepth 1 -not -name man) + + # workaround for a possible portage bug + mkdir -p "${D}/etc/conf.d/" + newconfd "${FILESDIR}/twistd.conf" twistd + newinitd "${FILESDIR}/twistd.init" twistd + + # zsh completion + insinto /usr/share/zsh/site-functions/ + doins twisted/python/_twisted_zsh_stub +} + +update_plugin_cache() { + python_version + local tpath="${ROOT}usr/$(get_libdir)/python${PYVER}/site-packages/twisted" + # we have to remove the cache or removed plugins won't be removed + # from the cache (http://twistedmatrix.com/bugs/issue926) + [[ -e "${tpath}/plugins/dropin.cache" ]] && rm -f "${tpath}/plugins/dropin.cache" + if [[ -e "${tpath}/plugin.py" ]]; then + # twisted is still installed, update. + # we have to use getPlugIns here for <=twisted-2.0.1 compatibility + einfo "Regenerating plugin cache" + python -c "from twisted.plugin import IPlugin, getPlugIns;list(getPlugIns(IPlugin))" + fi +} + +pkg_postinst() { + distutils_pkg_postinst + update_plugin_cache + einfo + einfo "If you upgraded from twisted 1.3 or earlier you may want to" + einfo + einfo " # emerge twisted-sumo" + einfo + einfo "to get all of the packages back." + einfo +} + +pkg_postrm() { + distutils_pkg_postrm + update_plugin_cache +} + +src_test() { + python_version + + if has_version ">=dev-lang/python-2.3"; then + "${python}" setup.py install --root="${T}/tests" --no-compile || die + else + "${python}" setup.py install --root="${T}/tests" || die + fi + + cd "${T}/tests/usr/$(get_libdir)/python${PYVER}/site-packages/" || die + + # prevent it from pulling in plugins from already installed + # twisted packages + rm twisted/plugins/__init__.py || die + + # an empty file doesn't work because the tests check for + # docstrings in all packages + echo "'''plugins stub'''" > twisted/plugins/__init__.py || die + + "${T}"/tests/usr/bin/trial twisted || die "trial failed" +}