diff options
author | drochner <drochner@pkgsrc.org> | 2012-10-17 18:36:42 +0000 |
---|---|---|
committer | drochner <drochner@pkgsrc.org> | 2012-10-17 18:36:42 +0000 |
commit | 3916d5bdbc8243c652a85c0e442e7f48f55bf9be (patch) | |
tree | c13bdf86928628b8bfaf77498033575539bb8197 /net | |
parent | e2b5a40f830e787420204b7ffb7900cf3c9df3fd (diff) | |
download | pkgsrc-3916d5bdbc8243c652a85c0e442e7f48f55bf9be.tar.gz |
add patch from upstream bug tracker to adapt to an API change
in recent "twisted"
makes the upnp server of "rhythmbox" work again, at least with its
own renderer and gupnp-av-cp
bump PKGREV
Diffstat (limited to 'net')
-rw-r--r-- | net/coherence/Makefile | 4 | ||||
-rw-r--r-- | net/coherence/distinfo | 4 | ||||
-rw-r--r-- | net/coherence/patches/patch-ab | 109 | ||||
-rw-r--r-- | net/coherence/patches/patch-ac | 61 |
4 files changed, 175 insertions, 3 deletions
diff --git a/net/coherence/Makefile b/net/coherence/Makefile index 0d636053b58..ed75fccc34d 100644 --- a/net/coherence/Makefile +++ b/net/coherence/Makefile @@ -1,9 +1,9 @@ -# $NetBSD: Makefile,v 1.5 2012/03/15 11:53:35 obache Exp $ +# $NetBSD: Makefile,v 1.6 2012/10/17 18:36:42 drochner Exp $ # DISTNAME= Coherence-0.6.6.2 PKGNAME= coherence-0.6.6.2 -PKGREVISION= 1 +PKGREVISION= 2 CATEGORIES= net MASTER_SITES= http://coherence.beebits.net/download/ diff --git a/net/coherence/distinfo b/net/coherence/distinfo index 958763f3d78..736e8c4457e 100644 --- a/net/coherence/distinfo +++ b/net/coherence/distinfo @@ -1,6 +1,8 @@ -$NetBSD: distinfo,v 1.3 2010/05/20 21:22:51 drochner Exp $ +$NetBSD: distinfo,v 1.4 2012/10/17 18:36:42 drochner Exp $ SHA1 (Coherence-0.6.6.2.tar.gz) = c8f3aedf6f393e400b012b9b79a45faf6bc3c809 RMD160 (Coherence-0.6.6.2.tar.gz) = f3cea9a846059723c846cb2254aae73ff1a6a5e9 Size (Coherence-0.6.6.2.tar.gz) = 364908 bytes SHA1 (patch-aa) = 3d0e0966a12bb6f42015dac259db085923135fae +SHA1 (patch-ab) = 54d3ab8e58a4412f4e3b5c263785468f58ac132b +SHA1 (patch-ac) = c10f363f6de78a9ae4d08956c6d2afa35d817cb4 diff --git a/net/coherence/patches/patch-ab b/net/coherence/patches/patch-ab new file mode 100644 index 00000000000..60626200e1c --- /dev/null +++ b/net/coherence/patches/patch-ab @@ -0,0 +1,109 @@ +$NetBSD: patch-ab,v 1.1 2012/10/17 18:36:42 drochner Exp $ + +http://coherence.beebits.net/ticket/360 + +--- coherence/upnp/core/utils.py.orig 2010-01-02 15:10:21.000000000 +0000 ++++ coherence/upnp/core/utils.py +@@ -517,48 +517,14 @@ class HeaderAwareHTTPClientFactory(clien + protocol = myHTTPPageGetter + noisy = False + +- def __init__(self, url, method='GET', postdata=None, headers=None, +- agent="Twisted PageGetter", timeout=0, cookies=None, +- followRedirect=True, redirectLimit=20): +- self.followRedirect = followRedirect +- self.redirectLimit = redirectLimit +- self._redirectCount = 0 +- self.timeout = timeout +- self.agent = agent +- +- if cookies is None: +- cookies = {} +- self.cookies = cookies +- if headers is not None: +- self.headers = InsensitiveDict(headers) +- else: +- self.headers = InsensitiveDict() +- if postdata is not None: +- self.headers.setdefault('Content-Length', len(postdata)) +- # just in case a broken http/1.1 decides to keep connection alive +- self.headers.setdefault("connection", "close") +- self.postdata = postdata +- self.method = method +- +- self.setURL(url) +- +- self.waiting = 1 +- self.deferred = defer.Deferred() +- self.response_headers = None +- + def buildProtocol(self, addr): +- p = protocol.ClientFactory.buildProtocol(self, addr) ++ p = client.HTTPClientFactory.buildProtocol(self, addr) + p.method = self.method + p.followRedirect = self.followRedirect +- if self.timeout: +- timeoutCall = reactor.callLater(self.timeout, p.timeout) +- self.deferred.addBoth(self._cancelTimeout, timeoutCall) + return p + + def page(self, page): +- if self.waiting: +- self.waiting = 0 +- self.deferred.callback((page, self.response_headers)) ++ client.HTTPClientFactory.page(self, (page, self.response_headers)) + + + class HeaderAwareHTTPDownloader(client.HTTPDownloader): +@@ -577,24 +543,22 @@ class HeaderAwareHTTPDownloader(client.H + self.requestedPartial = 0 + + ++ + def getPage(url, contextFactory=None, *args, **kwargs): +- """Download a web page as a string. ++ """ ++ Download a web page as a string. + + Download a page. Return a deferred, which will callback with a + page (as a string) or errback with a description of the error. + + See HTTPClientFactory to see what extra args can be passed. + """ +- scheme, host, port, path = client._parse(url) +- factory = HeaderAwareHTTPClientFactory(url, *args, **kwargs) +- if scheme == 'https': +- from twisted.internet import ssl +- if contextFactory is None: +- contextFactory = ssl.ClientContextFactory() +- reactor.connectSSL(host, port, factory, contextFactory) +- else: +- reactor.connectTCP(host, port, factory) +- return factory.deferred ++ kwargs['agent'] = "Coherence PageGetter" ++ return client._makeGetterFactory( ++ url, ++ HeaderAwareHTTPClientFactory, ++ contextFactory=contextFactory, ++ *args, **kwargs).deferred + + + def downloadPage(url, file, contextFactory=None, *args, **kwargs): +@@ -705,7 +669,7 @@ class StaticFile(static.File): + str(start), str(end), str(tsize))) + #print "StaticFile", start, end, tsize + +- request.setHeader('content-length', str(fsize)) ++ producer = self.makeProducer(request, f) + + if request.method == 'HEAD' or trans == False: + # pretend we're a HEAD request, so content-length +@@ -718,7 +682,7 @@ class StaticFile(static.File): + + # return data + # size is the byte position to stop sending, not how many bytes to send +- static.FileTransfer(f, size, request) ++ producer.start() + # and make sure the connection doesn't get closed + return server.NOT_DONE_YET + diff --git a/net/coherence/patches/patch-ac b/net/coherence/patches/patch-ac new file mode 100644 index 00000000000..7d308df97e2 --- /dev/null +++ b/net/coherence/patches/patch-ac @@ -0,0 +1,61 @@ +$NetBSD: patch-ac,v 1.1 2012/10/17 18:36:42 drochner Exp $ + +http://coherence.beebits.net/ticket/360 +(diff -U 0 to avoid RCS ID string) + +--- coherence/upnp/core/test/test_utils.py.orig 2010-01-02 16:10:20.000000000 +0100 ++++ coherence/upnp/core/test/test_utils.py 2012-10-17 19:43:26.000000000 +0200 +@@ -11,0 +12 @@ ++import os
+@@ -12,0 +14,4 @@ ++from twisted.python.filepath import FilePath
++from twisted.internet import reactor
++from twisted.web import static, server
++from twisted.protocols import policies
+@@ -14 +19 @@ +-from coherence.upnp.core.utils import *
++from coherence.upnp.core import utils
+@@ -124 +129 @@ +- newData = de_chunk_payload(testData)
++ newData = utils.de_chunk_payload(testData)
+@@ -128,0 +134,40 @@ ++class TestClient(unittest.TestCase):
++
++ def _listen(self, site):
++ return reactor.listenTCP(0, site, interface="127.0.0.1")
++
++ def setUp(self):
++ name = self.mktemp()
++ os.mkdir(name)
++ FilePath(name).child("file").setContent("0123456789")
++ r = static.File(name)
++ self.site = server.Site(r, timeout=None)
++ self.wrapper = policies.WrappingFactory(self.site)
++ self.port = self._listen(self.wrapper)
++ self.portno = self.port.getHost().port
++
++ def tearDown(self):
++ return self.port.stopListening()
++
++ def getURL(self, path):
++ return "http://127.0.0.1:%d/%s" % (self.portno, path)
++
++ def assertResponse(self, original, content, headers):
++ self.assertIsInstance(original, tuple)
++ self.assertEqual(original[0], content)
++ originalHeaders = original[1]
++ for header in headers:
++ self.assertIn(header, originalHeaders)
++ self.assertEqual(originalHeaders[header], headers[header])
++
++ def test_getPage(self):
++ content = '0123456789'
++ headers = {'accept-ranges': ['bytes'],
++ 'content-length': ['10'],
++ 'content-type': ['text/html']}
++ d = utils.getPage(self.getURL("file"))
++ d.addCallback(self.assertResponse, content, headers)
++ return d
++
++
++
|