Index: head/net/py-bittorrent/Makefile =================================================================== --- head/net/py-bittorrent/Makefile (revision 123479) +++ head/net/py-bittorrent/Makefile (revision 123480) @@ -1,68 +1,70 @@ # New ports collection makefile for: BitTorrent # Date created: Sun Mar 16 06:34:12 UTC 2003 # Whom: Mario Sergio Fujikawa Ferreira # # $FreeBSD$ # PORTNAME= BitTorrent PORTVERSION= 3.4.2 -PORTREVISION= 1 +PORTREVISION= 2 PORTEPOCH= 1 CATEGORIES?= net python MASTER_SITES= ${MASTER_SITE_SOURCEFORGE_EXTENDED} MASTER_SITE_SUBDIR= ${PORTNAME:L} PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} #DISTNAME= ${PORTNAME}-${PORTVERSION:C/\.(.)$/\1/} MAINTAINER= lioux@FreeBSD.org COMMENT?= A peer-to-peer tool for distributing files written in Python -BROKEN= Does not work with python 2.4 - USE_PYTHON= yes USE_PYDISTUTILS= yes USE_REINPLACE= yes CONFLICTS= py??-*[Bb]it[Tt]orrent* py??-*[Bb]it[Tt]ornado* btqueue* PORTDOCS= BUILD.windows.txt INSTALL.unix.txt LICENSE.txt \ README.txt credits.txt # required for GUI .ifndef(WITHOUT_GUI) RUN_DEPENDS+= ${PYTHON_SITELIBDIR}/wxPython/__init__.py:${PORTSDIR}/x11-toolkits/py-wxPython PLIST_SUB+= GUI='' PLIST_FILES+= \ bin/btcompletedirgui.py \ bin/btdownloadgui.py .else EXTRA_PATCHES+= ${FILESDIR}/extra-nogui-patch-setup.py .endif pre-everything:: .ifndef(WITHOUT_GUI) @${ECHO_MSG} '===> Define WITHOUT_GUI to disable GUI installation' .endif + +post-extract: +# patch to work with python 2.4 + @${CP} ${FILESDIR}/zurllib.py ${WRKSRC}/BitTorrent post-patch: @${FIND} ${WRKSRC} -type f | \ ${XARGS} -x -n 10 \ ${REINPLACE_CMD} -E \ -e 's|/usr/bin/env python2|${LOCALBASE}/bin/python|' .ifdef(WITHOUT_GUI) @${REINPLACE_CMD} -E \ -e 's|btdownloadgui.py|btdownloadcurses.py|' \ ${WRKSRC}/INSTALL.unix.txt .endif post-install: .ifndef(NOPORTDOCS) @${MKDIR} ${DOCSDIR} .for file in ${PORTDOCS} @${INSTALL_DATA} ${WRKSRC}/${file} ${DOCSDIR} .endfor .endif .include Property changes on: head/net/py-bittorrent/Makefile ___________________________________________________________________ Modified: cvs2svn:cvs-rev ## -1 +1 ## -1.16 \ No newline at end of property +1.17 \ No newline at end of property Index: head/net/py-bittorrent/files/zurllib.py =================================================================== --- head/net/py-bittorrent/files/zurllib.py (nonexistent) +++ head/net/py-bittorrent/files/zurllib.py (revision 123480) @@ -0,0 +1,61 @@ +# Written by John Hoffman +# see LICENSE.txt for license information + +from httplib import HTTPConnection +from urlparse import urlparse +import socket +from gzip import GzipFile +from StringIO import StringIO +from urllib import quote, unquote +from __init__ import version + +MAX_REDIRECTS = 10 + +class urlopen: + def __init__(self, url): + self.tries = 0 + self._open(url) + + def _open(self, url): + self.tries += 1 + if self.tries > MAX_REDIRECTS: + raise IOError, ('http error', 500, + "Internal Server Error: Redirect Recursion") + (scheme, netloc, path, pars, query, fragment) = urlparse(url) + if scheme != 'http': + raise IOError, ('url error', 'unknown url type', scheme, url) + url = path + if pars: + url += ';'+pars + if query: + url += '?'+query +# if fragment: + self.connection = HTTPConnection(netloc) + self.connection.request('GET', url, None, + { 'User-Agent': 'BitTorrent/' + version, + 'Accept-Encoding': 'gzip' } ) + self.response = self.connection.getresponse() + status = self.response.status + if status in (301,302): + try: + self.connection.close() + except: + pass + self._open(self.response.getheader('Location')) + return + if status != 200: + raise IOError, ('http error', status, self.response.reason) + + def read(self): + data = self.response.read() + if self.response.getheader('Content-Encoding','').find('gzip') >= 0: + try: + compressed = StringIO(data) + f = GzipFile(fileobj = compressed) + data = f.read() + except: + raise IOError, ('http error', 'got corrupt response') + return data + + def close(self): + self.connection.close() Property changes on: head/net/py-bittorrent/files/zurllib.py ___________________________________________________________________ Added: cvs2svn:cvs-rev ## -0,0 +1 ## +1.1 \ No newline at end of property Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Index: head/net/py-bittorrent-devel/Makefile =================================================================== --- head/net/py-bittorrent-devel/Makefile (revision 123479) +++ head/net/py-bittorrent-devel/Makefile (revision 123480) @@ -1,68 +1,70 @@ # New ports collection makefile for: BitTorrent # Date created: Sun Mar 16 06:34:12 UTC 2003 # Whom: Mario Sergio Fujikawa Ferreira # # $FreeBSD$ # PORTNAME= BitTorrent PORTVERSION= 3.4.2 -PORTREVISION= 1 +PORTREVISION= 2 PORTEPOCH= 1 CATEGORIES?= net python MASTER_SITES= ${MASTER_SITE_SOURCEFORGE_EXTENDED} MASTER_SITE_SUBDIR= ${PORTNAME:L} PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} #DISTNAME= ${PORTNAME}-${PORTVERSION:C/\.(.)$/\1/} MAINTAINER= lioux@FreeBSD.org COMMENT?= A peer-to-peer tool for distributing files written in Python -BROKEN= Does not work with python 2.4 - USE_PYTHON= yes USE_PYDISTUTILS= yes USE_REINPLACE= yes CONFLICTS= py??-*[Bb]it[Tt]orrent* py??-*[Bb]it[Tt]ornado* btqueue* PORTDOCS= BUILD.windows.txt INSTALL.unix.txt LICENSE.txt \ README.txt credits.txt # required for GUI .ifndef(WITHOUT_GUI) RUN_DEPENDS+= ${PYTHON_SITELIBDIR}/wxPython/__init__.py:${PORTSDIR}/x11-toolkits/py-wxPython PLIST_SUB+= GUI='' PLIST_FILES+= \ bin/btcompletedirgui.py \ bin/btdownloadgui.py .else EXTRA_PATCHES+= ${FILESDIR}/extra-nogui-patch-setup.py .endif pre-everything:: .ifndef(WITHOUT_GUI) @${ECHO_MSG} '===> Define WITHOUT_GUI to disable GUI installation' .endif + +post-extract: +# patch to work with python 2.4 + @${CP} ${FILESDIR}/zurllib.py ${WRKSRC}/BitTorrent post-patch: @${FIND} ${WRKSRC} -type f | \ ${XARGS} -x -n 10 \ ${REINPLACE_CMD} -E \ -e 's|/usr/bin/env python2|${LOCALBASE}/bin/python|' .ifdef(WITHOUT_GUI) @${REINPLACE_CMD} -E \ -e 's|btdownloadgui.py|btdownloadcurses.py|' \ ${WRKSRC}/INSTALL.unix.txt .endif post-install: .ifndef(NOPORTDOCS) @${MKDIR} ${DOCSDIR} .for file in ${PORTDOCS} @${INSTALL_DATA} ${WRKSRC}/${file} ${DOCSDIR} .endfor .endif .include Property changes on: head/net/py-bittorrent-devel/Makefile ___________________________________________________________________ Modified: cvs2svn:cvs-rev ## -1 +1 ## -1.16 \ No newline at end of property +1.17 \ No newline at end of property Index: head/net/py-bittorrent-devel/files/zurllib.py =================================================================== --- head/net/py-bittorrent-devel/files/zurllib.py (nonexistent) +++ head/net/py-bittorrent-devel/files/zurllib.py (revision 123480) @@ -0,0 +1,61 @@ +# Written by John Hoffman +# see LICENSE.txt for license information + +from httplib import HTTPConnection +from urlparse import urlparse +import socket +from gzip import GzipFile +from StringIO import StringIO +from urllib import quote, unquote +from __init__ import version + +MAX_REDIRECTS = 10 + +class urlopen: + def __init__(self, url): + self.tries = 0 + self._open(url) + + def _open(self, url): + self.tries += 1 + if self.tries > MAX_REDIRECTS: + raise IOError, ('http error', 500, + "Internal Server Error: Redirect Recursion") + (scheme, netloc, path, pars, query, fragment) = urlparse(url) + if scheme != 'http': + raise IOError, ('url error', 'unknown url type', scheme, url) + url = path + if pars: + url += ';'+pars + if query: + url += '?'+query +# if fragment: + self.connection = HTTPConnection(netloc) + self.connection.request('GET', url, None, + { 'User-Agent': 'BitTorrent/' + version, + 'Accept-Encoding': 'gzip' } ) + self.response = self.connection.getresponse() + status = self.response.status + if status in (301,302): + try: + self.connection.close() + except: + pass + self._open(self.response.getheader('Location')) + return + if status != 200: + raise IOError, ('http error', status, self.response.reason) + + def read(self): + data = self.response.read() + if self.response.getheader('Content-Encoding','').find('gzip') >= 0: + try: + compressed = StringIO(data) + f = GzipFile(fileobj = compressed) + data = f.read() + except: + raise IOError, ('http error', 'got corrupt response') + return data + + def close(self): + self.connection.close() Property changes on: head/net/py-bittorrent-devel/files/zurllib.py ___________________________________________________________________ Added: cvs2svn:cvs-rev ## -0,0 +1 ## +1.1 \ No newline at end of property Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Index: head/net/py-kenosis-bittorrent/Makefile =================================================================== --- head/net/py-kenosis-bittorrent/Makefile (revision 123479) +++ head/net/py-kenosis-bittorrent/Makefile (revision 123480) @@ -1,68 +1,70 @@ # New ports collection makefile for: BitTorrent # Date created: Sun Mar 16 06:34:12 UTC 2003 # Whom: Mario Sergio Fujikawa Ferreira # # $FreeBSD$ # PORTNAME= BitTorrent PORTVERSION= 3.4.2 -PORTREVISION= 1 +PORTREVISION= 2 PORTEPOCH= 1 CATEGORIES?= net python MASTER_SITES= ${MASTER_SITE_SOURCEFORGE_EXTENDED} MASTER_SITE_SUBDIR= ${PORTNAME:L} PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} #DISTNAME= ${PORTNAME}-${PORTVERSION:C/\.(.)$/\1/} MAINTAINER= lioux@FreeBSD.org COMMENT?= A peer-to-peer tool for distributing files written in Python -BROKEN= Does not work with python 2.4 - USE_PYTHON= yes USE_PYDISTUTILS= yes USE_REINPLACE= yes CONFLICTS= py??-*[Bb]it[Tt]orrent* py??-*[Bb]it[Tt]ornado* btqueue* PORTDOCS= BUILD.windows.txt INSTALL.unix.txt LICENSE.txt \ README.txt credits.txt # required for GUI .ifndef(WITHOUT_GUI) RUN_DEPENDS+= ${PYTHON_SITELIBDIR}/wxPython/__init__.py:${PORTSDIR}/x11-toolkits/py-wxPython PLIST_SUB+= GUI='' PLIST_FILES+= \ bin/btcompletedirgui.py \ bin/btdownloadgui.py .else EXTRA_PATCHES+= ${FILESDIR}/extra-nogui-patch-setup.py .endif pre-everything:: .ifndef(WITHOUT_GUI) @${ECHO_MSG} '===> Define WITHOUT_GUI to disable GUI installation' .endif + +post-extract: +# patch to work with python 2.4 + @${CP} ${FILESDIR}/zurllib.py ${WRKSRC}/BitTorrent post-patch: @${FIND} ${WRKSRC} -type f | \ ${XARGS} -x -n 10 \ ${REINPLACE_CMD} -E \ -e 's|/usr/bin/env python2|${LOCALBASE}/bin/python|' .ifdef(WITHOUT_GUI) @${REINPLACE_CMD} -E \ -e 's|btdownloadgui.py|btdownloadcurses.py|' \ ${WRKSRC}/INSTALL.unix.txt .endif post-install: .ifndef(NOPORTDOCS) @${MKDIR} ${DOCSDIR} .for file in ${PORTDOCS} @${INSTALL_DATA} ${WRKSRC}/${file} ${DOCSDIR} .endfor .endif .include Property changes on: head/net/py-kenosis-bittorrent/Makefile ___________________________________________________________________ Modified: cvs2svn:cvs-rev ## -1 +1 ## -1.16 \ No newline at end of property +1.17 \ No newline at end of property Index: head/net/py-kenosis-bittorrent/files/zurllib.py =================================================================== --- head/net/py-kenosis-bittorrent/files/zurllib.py (nonexistent) +++ head/net/py-kenosis-bittorrent/files/zurllib.py (revision 123480) @@ -0,0 +1,61 @@ +# Written by John Hoffman +# see LICENSE.txt for license information + +from httplib import HTTPConnection +from urlparse import urlparse +import socket +from gzip import GzipFile +from StringIO import StringIO +from urllib import quote, unquote +from __init__ import version + +MAX_REDIRECTS = 10 + +class urlopen: + def __init__(self, url): + self.tries = 0 + self._open(url) + + def _open(self, url): + self.tries += 1 + if self.tries > MAX_REDIRECTS: + raise IOError, ('http error', 500, + "Internal Server Error: Redirect Recursion") + (scheme, netloc, path, pars, query, fragment) = urlparse(url) + if scheme != 'http': + raise IOError, ('url error', 'unknown url type', scheme, url) + url = path + if pars: + url += ';'+pars + if query: + url += '?'+query +# if fragment: + self.connection = HTTPConnection(netloc) + self.connection.request('GET', url, None, + { 'User-Agent': 'BitTorrent/' + version, + 'Accept-Encoding': 'gzip' } ) + self.response = self.connection.getresponse() + status = self.response.status + if status in (301,302): + try: + self.connection.close() + except: + pass + self._open(self.response.getheader('Location')) + return + if status != 200: + raise IOError, ('http error', status, self.response.reason) + + def read(self): + data = self.response.read() + if self.response.getheader('Content-Encoding','').find('gzip') >= 0: + try: + compressed = StringIO(data) + f = GzipFile(fileobj = compressed) + data = f.read() + except: + raise IOError, ('http error', 'got corrupt response') + return data + + def close(self): + self.connection.close() Property changes on: head/net/py-kenosis-bittorrent/files/zurllib.py ___________________________________________________________________ Added: cvs2svn:cvs-rev ## -0,0 +1 ## +1.1 \ No newline at end of property Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Index: head/net-p2p/py-bittorrent/Makefile =================================================================== --- head/net-p2p/py-bittorrent/Makefile (revision 123479) +++ head/net-p2p/py-bittorrent/Makefile (revision 123480) @@ -1,68 +1,70 @@ # New ports collection makefile for: BitTorrent # Date created: Sun Mar 16 06:34:12 UTC 2003 # Whom: Mario Sergio Fujikawa Ferreira # # $FreeBSD$ # PORTNAME= BitTorrent PORTVERSION= 3.4.2 -PORTREVISION= 1 +PORTREVISION= 2 PORTEPOCH= 1 CATEGORIES?= net python MASTER_SITES= ${MASTER_SITE_SOURCEFORGE_EXTENDED} MASTER_SITE_SUBDIR= ${PORTNAME:L} PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} #DISTNAME= ${PORTNAME}-${PORTVERSION:C/\.(.)$/\1/} MAINTAINER= lioux@FreeBSD.org COMMENT?= A peer-to-peer tool for distributing files written in Python -BROKEN= Does not work with python 2.4 - USE_PYTHON= yes USE_PYDISTUTILS= yes USE_REINPLACE= yes CONFLICTS= py??-*[Bb]it[Tt]orrent* py??-*[Bb]it[Tt]ornado* btqueue* PORTDOCS= BUILD.windows.txt INSTALL.unix.txt LICENSE.txt \ README.txt credits.txt # required for GUI .ifndef(WITHOUT_GUI) RUN_DEPENDS+= ${PYTHON_SITELIBDIR}/wxPython/__init__.py:${PORTSDIR}/x11-toolkits/py-wxPython PLIST_SUB+= GUI='' PLIST_FILES+= \ bin/btcompletedirgui.py \ bin/btdownloadgui.py .else EXTRA_PATCHES+= ${FILESDIR}/extra-nogui-patch-setup.py .endif pre-everything:: .ifndef(WITHOUT_GUI) @${ECHO_MSG} '===> Define WITHOUT_GUI to disable GUI installation' .endif + +post-extract: +# patch to work with python 2.4 + @${CP} ${FILESDIR}/zurllib.py ${WRKSRC}/BitTorrent post-patch: @${FIND} ${WRKSRC} -type f | \ ${XARGS} -x -n 10 \ ${REINPLACE_CMD} -E \ -e 's|/usr/bin/env python2|${LOCALBASE}/bin/python|' .ifdef(WITHOUT_GUI) @${REINPLACE_CMD} -E \ -e 's|btdownloadgui.py|btdownloadcurses.py|' \ ${WRKSRC}/INSTALL.unix.txt .endif post-install: .ifndef(NOPORTDOCS) @${MKDIR} ${DOCSDIR} .for file in ${PORTDOCS} @${INSTALL_DATA} ${WRKSRC}/${file} ${DOCSDIR} .endfor .endif .include Property changes on: head/net-p2p/py-bittorrent/Makefile ___________________________________________________________________ Modified: cvs2svn:cvs-rev ## -1 +1 ## -1.16 \ No newline at end of property +1.17 \ No newline at end of property Index: head/net-p2p/py-bittorrent/files/zurllib.py =================================================================== --- head/net-p2p/py-bittorrent/files/zurllib.py (nonexistent) +++ head/net-p2p/py-bittorrent/files/zurllib.py (revision 123480) @@ -0,0 +1,61 @@ +# Written by John Hoffman +# see LICENSE.txt for license information + +from httplib import HTTPConnection +from urlparse import urlparse +import socket +from gzip import GzipFile +from StringIO import StringIO +from urllib import quote, unquote +from __init__ import version + +MAX_REDIRECTS = 10 + +class urlopen: + def __init__(self, url): + self.tries = 0 + self._open(url) + + def _open(self, url): + self.tries += 1 + if self.tries > MAX_REDIRECTS: + raise IOError, ('http error', 500, + "Internal Server Error: Redirect Recursion") + (scheme, netloc, path, pars, query, fragment) = urlparse(url) + if scheme != 'http': + raise IOError, ('url error', 'unknown url type', scheme, url) + url = path + if pars: + url += ';'+pars + if query: + url += '?'+query +# if fragment: + self.connection = HTTPConnection(netloc) + self.connection.request('GET', url, None, + { 'User-Agent': 'BitTorrent/' + version, + 'Accept-Encoding': 'gzip' } ) + self.response = self.connection.getresponse() + status = self.response.status + if status in (301,302): + try: + self.connection.close() + except: + pass + self._open(self.response.getheader('Location')) + return + if status != 200: + raise IOError, ('http error', status, self.response.reason) + + def read(self): + data = self.response.read() + if self.response.getheader('Content-Encoding','').find('gzip') >= 0: + try: + compressed = StringIO(data) + f = GzipFile(fileobj = compressed) + data = f.read() + except: + raise IOError, ('http error', 'got corrupt response') + return data + + def close(self): + self.connection.close() Property changes on: head/net-p2p/py-bittorrent/files/zurllib.py ___________________________________________________________________ Added: cvs2svn:cvs-rev ## -0,0 +1 ## +1.1 \ No newline at end of property Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Index: head/net-p2p/py-bittorrent-devel/Makefile =================================================================== --- head/net-p2p/py-bittorrent-devel/Makefile (revision 123479) +++ head/net-p2p/py-bittorrent-devel/Makefile (revision 123480) @@ -1,68 +1,70 @@ # New ports collection makefile for: BitTorrent # Date created: Sun Mar 16 06:34:12 UTC 2003 # Whom: Mario Sergio Fujikawa Ferreira # # $FreeBSD$ # PORTNAME= BitTorrent PORTVERSION= 3.4.2 -PORTREVISION= 1 +PORTREVISION= 2 PORTEPOCH= 1 CATEGORIES?= net python MASTER_SITES= ${MASTER_SITE_SOURCEFORGE_EXTENDED} MASTER_SITE_SUBDIR= ${PORTNAME:L} PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} #DISTNAME= ${PORTNAME}-${PORTVERSION:C/\.(.)$/\1/} MAINTAINER= lioux@FreeBSD.org COMMENT?= A peer-to-peer tool for distributing files written in Python -BROKEN= Does not work with python 2.4 - USE_PYTHON= yes USE_PYDISTUTILS= yes USE_REINPLACE= yes CONFLICTS= py??-*[Bb]it[Tt]orrent* py??-*[Bb]it[Tt]ornado* btqueue* PORTDOCS= BUILD.windows.txt INSTALL.unix.txt LICENSE.txt \ README.txt credits.txt # required for GUI .ifndef(WITHOUT_GUI) RUN_DEPENDS+= ${PYTHON_SITELIBDIR}/wxPython/__init__.py:${PORTSDIR}/x11-toolkits/py-wxPython PLIST_SUB+= GUI='' PLIST_FILES+= \ bin/btcompletedirgui.py \ bin/btdownloadgui.py .else EXTRA_PATCHES+= ${FILESDIR}/extra-nogui-patch-setup.py .endif pre-everything:: .ifndef(WITHOUT_GUI) @${ECHO_MSG} '===> Define WITHOUT_GUI to disable GUI installation' .endif + +post-extract: +# patch to work with python 2.4 + @${CP} ${FILESDIR}/zurllib.py ${WRKSRC}/BitTorrent post-patch: @${FIND} ${WRKSRC} -type f | \ ${XARGS} -x -n 10 \ ${REINPLACE_CMD} -E \ -e 's|/usr/bin/env python2|${LOCALBASE}/bin/python|' .ifdef(WITHOUT_GUI) @${REINPLACE_CMD} -E \ -e 's|btdownloadgui.py|btdownloadcurses.py|' \ ${WRKSRC}/INSTALL.unix.txt .endif post-install: .ifndef(NOPORTDOCS) @${MKDIR} ${DOCSDIR} .for file in ${PORTDOCS} @${INSTALL_DATA} ${WRKSRC}/${file} ${DOCSDIR} .endfor .endif .include Property changes on: head/net-p2p/py-bittorrent-devel/Makefile ___________________________________________________________________ Modified: cvs2svn:cvs-rev ## -1 +1 ## -1.16 \ No newline at end of property +1.17 \ No newline at end of property Index: head/net-p2p/py-bittorrent-devel/files/zurllib.py =================================================================== --- head/net-p2p/py-bittorrent-devel/files/zurllib.py (nonexistent) +++ head/net-p2p/py-bittorrent-devel/files/zurllib.py (revision 123480) @@ -0,0 +1,61 @@ +# Written by John Hoffman +# see LICENSE.txt for license information + +from httplib import HTTPConnection +from urlparse import urlparse +import socket +from gzip import GzipFile +from StringIO import StringIO +from urllib import quote, unquote +from __init__ import version + +MAX_REDIRECTS = 10 + +class urlopen: + def __init__(self, url): + self.tries = 0 + self._open(url) + + def _open(self, url): + self.tries += 1 + if self.tries > MAX_REDIRECTS: + raise IOError, ('http error', 500, + "Internal Server Error: Redirect Recursion") + (scheme, netloc, path, pars, query, fragment) = urlparse(url) + if scheme != 'http': + raise IOError, ('url error', 'unknown url type', scheme, url) + url = path + if pars: + url += ';'+pars + if query: + url += '?'+query +# if fragment: + self.connection = HTTPConnection(netloc) + self.connection.request('GET', url, None, + { 'User-Agent': 'BitTorrent/' + version, + 'Accept-Encoding': 'gzip' } ) + self.response = self.connection.getresponse() + status = self.response.status + if status in (301,302): + try: + self.connection.close() + except: + pass + self._open(self.response.getheader('Location')) + return + if status != 200: + raise IOError, ('http error', status, self.response.reason) + + def read(self): + data = self.response.read() + if self.response.getheader('Content-Encoding','').find('gzip') >= 0: + try: + compressed = StringIO(data) + f = GzipFile(fileobj = compressed) + data = f.read() + except: + raise IOError, ('http error', 'got corrupt response') + return data + + def close(self): + self.connection.close() Property changes on: head/net-p2p/py-bittorrent-devel/files/zurllib.py ___________________________________________________________________ Added: cvs2svn:cvs-rev ## -0,0 +1 ## +1.1 \ No newline at end of property Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Index: head/net-p2p/py-kenosis-bittorrent/Makefile =================================================================== --- head/net-p2p/py-kenosis-bittorrent/Makefile (revision 123479) +++ head/net-p2p/py-kenosis-bittorrent/Makefile (revision 123480) @@ -1,68 +1,70 @@ # New ports collection makefile for: BitTorrent # Date created: Sun Mar 16 06:34:12 UTC 2003 # Whom: Mario Sergio Fujikawa Ferreira # # $FreeBSD$ # PORTNAME= BitTorrent PORTVERSION= 3.4.2 -PORTREVISION= 1 +PORTREVISION= 2 PORTEPOCH= 1 CATEGORIES?= net python MASTER_SITES= ${MASTER_SITE_SOURCEFORGE_EXTENDED} MASTER_SITE_SUBDIR= ${PORTNAME:L} PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} #DISTNAME= ${PORTNAME}-${PORTVERSION:C/\.(.)$/\1/} MAINTAINER= lioux@FreeBSD.org COMMENT?= A peer-to-peer tool for distributing files written in Python -BROKEN= Does not work with python 2.4 - USE_PYTHON= yes USE_PYDISTUTILS= yes USE_REINPLACE= yes CONFLICTS= py??-*[Bb]it[Tt]orrent* py??-*[Bb]it[Tt]ornado* btqueue* PORTDOCS= BUILD.windows.txt INSTALL.unix.txt LICENSE.txt \ README.txt credits.txt # required for GUI .ifndef(WITHOUT_GUI) RUN_DEPENDS+= ${PYTHON_SITELIBDIR}/wxPython/__init__.py:${PORTSDIR}/x11-toolkits/py-wxPython PLIST_SUB+= GUI='' PLIST_FILES+= \ bin/btcompletedirgui.py \ bin/btdownloadgui.py .else EXTRA_PATCHES+= ${FILESDIR}/extra-nogui-patch-setup.py .endif pre-everything:: .ifndef(WITHOUT_GUI) @${ECHO_MSG} '===> Define WITHOUT_GUI to disable GUI installation' .endif + +post-extract: +# patch to work with python 2.4 + @${CP} ${FILESDIR}/zurllib.py ${WRKSRC}/BitTorrent post-patch: @${FIND} ${WRKSRC} -type f | \ ${XARGS} -x -n 10 \ ${REINPLACE_CMD} -E \ -e 's|/usr/bin/env python2|${LOCALBASE}/bin/python|' .ifdef(WITHOUT_GUI) @${REINPLACE_CMD} -E \ -e 's|btdownloadgui.py|btdownloadcurses.py|' \ ${WRKSRC}/INSTALL.unix.txt .endif post-install: .ifndef(NOPORTDOCS) @${MKDIR} ${DOCSDIR} .for file in ${PORTDOCS} @${INSTALL_DATA} ${WRKSRC}/${file} ${DOCSDIR} .endfor .endif .include Property changes on: head/net-p2p/py-kenosis-bittorrent/Makefile ___________________________________________________________________ Modified: cvs2svn:cvs-rev ## -1 +1 ## -1.16 \ No newline at end of property +1.17 \ No newline at end of property Index: head/net-p2p/py-kenosis-bittorrent/files/zurllib.py =================================================================== --- head/net-p2p/py-kenosis-bittorrent/files/zurllib.py (nonexistent) +++ head/net-p2p/py-kenosis-bittorrent/files/zurllib.py (revision 123480) @@ -0,0 +1,61 @@ +# Written by John Hoffman +# see LICENSE.txt for license information + +from httplib import HTTPConnection +from urlparse import urlparse +import socket +from gzip import GzipFile +from StringIO import StringIO +from urllib import quote, unquote +from __init__ import version + +MAX_REDIRECTS = 10 + +class urlopen: + def __init__(self, url): + self.tries = 0 + self._open(url) + + def _open(self, url): + self.tries += 1 + if self.tries > MAX_REDIRECTS: + raise IOError, ('http error', 500, + "Internal Server Error: Redirect Recursion") + (scheme, netloc, path, pars, query, fragment) = urlparse(url) + if scheme != 'http': + raise IOError, ('url error', 'unknown url type', scheme, url) + url = path + if pars: + url += ';'+pars + if query: + url += '?'+query +# if fragment: + self.connection = HTTPConnection(netloc) + self.connection.request('GET', url, None, + { 'User-Agent': 'BitTorrent/' + version, + 'Accept-Encoding': 'gzip' } ) + self.response = self.connection.getresponse() + status = self.response.status + if status in (301,302): + try: + self.connection.close() + except: + pass + self._open(self.response.getheader('Location')) + return + if status != 200: + raise IOError, ('http error', status, self.response.reason) + + def read(self): + data = self.response.read() + if self.response.getheader('Content-Encoding','').find('gzip') >= 0: + try: + compressed = StringIO(data) + f = GzipFile(fileobj = compressed) + data = f.read() + except: + raise IOError, ('http error', 'got corrupt response') + return data + + def close(self): + self.connection.close() Property changes on: head/net-p2p/py-kenosis-bittorrent/files/zurllib.py ___________________________________________________________________ Added: cvs2svn:cvs-rev ## -0,0 +1 ## +1.1 \ No newline at end of property Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property