diff options
author | Andrej Zverev <az@FreeBSD.org> | 2007-10-08 11:53:15 +0000 |
---|---|---|
committer | Andrej Zverev <az@FreeBSD.org> | 2007-10-08 11:53:15 +0000 |
commit | b2096595f0ccd9771864599e1cb8d8be13f02973 (patch) | |
tree | 947d80cf849f1e525f9f78cd953d841a97b1233d | |
parent | 01618ada8d4db1ec5d629224cd32554ad5acb6b5 (diff) | |
download | ports-b2096595f0ccd9771864599e1cb8d8be13f02973.tar.gz ports-b2096595f0ccd9771864599e1cb8d8be13f02973.zip |
- Fix with python25+
PR: ports/116885, ports/116914
Submitted by: Philip M.Gollucci <pgollucci at p6m7g8.com>
Notes
Notes:
svn path=/head/; revision=201088
-rw-r--r-- | mail/svnmailer/Makefile | 9 | ||||
-rw-r--r-- | mail/svnmailer/files/py25-src-lib-svnmailer-notifier-_base.py | 45 |
2 files changed, 53 insertions, 1 deletions
diff --git a/mail/svnmailer/Makefile b/mail/svnmailer/Makefile index 6b48d8f17b56..e03412b7d440 100644 --- a/mail/svnmailer/Makefile +++ b/mail/svnmailer/Makefile @@ -22,6 +22,13 @@ USE_PYDISTUTILS= yes PORTDOCS= index.html perlig.css perlig.jpg perlig_docs.css \ perlig_offline.css right.gif up.gif +.include <bsd.port.pre.mk> + +pre-patch: +.if ${PYTHON_REL} >= 250 +EXTRA_PATCHES= ${FILESDIR}/py25-src-lib-svnmailer-notifier-_base.py +.endif + post-patch: @${REINPLACE_CMD} -e "1s|^.*|#!${PYTHON_CMD}|" ${WRKSRC}/setup.py @${REINPLACE_CMD} -e "1s|^.*|#!${PYTHON_CMD}|" ${WRKSRC}/src/svn-mailer @@ -32,4 +39,4 @@ post-install: cd ${WRKSRC}/docs; ${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR} .endif -.include <bsd.port.mk> +.include <bsd.port.post.mk> diff --git a/mail/svnmailer/files/py25-src-lib-svnmailer-notifier-_base.py b/mail/svnmailer/files/py25-src-lib-svnmailer-notifier-_base.py new file mode 100644 index 000000000000..c0284187fa6a --- /dev/null +++ b/mail/svnmailer/files/py25-src-lib-svnmailer-notifier-_base.py @@ -0,0 +1,45 @@ +--- src/lib/svnmailer/notifier/_base.py.orig Mon Apr 17 14:29:06 2006 ++++ src/lib/svnmailer/notifier/_base.py Mon Oct 8 15:36:25 2007 +@@ -345,7 +345,6 @@ + @return: The two encodings + @rtype: C{tuple} of C{str} + """ +- from encodings import exceptions + + enc1 = enc2 = default + if not change.wasAdded() or change.wasCopied(): +@@ -353,7 +352,7 @@ + enc1 = self._getContentEncoding( + change.getBasePath(), change.getBaseRevision() + ) +- except exceptions.LookupError: ++ except LookupError: + # fall back + pass + +@@ -364,7 +363,7 @@ + enc2 = self._getContentEncoding( + change.path, change.revision + ) +- except exceptions.LookupError: ++ except LookupError: + # fall back + pass + +@@ -389,7 +388,6 @@ + @exception encodings.exception.LookupError: The specified encoding + is not implemented or no encoding was specified + """ +- from encodings import exceptions + + # first try the svn:mime-type + enc = self.getEncodingFromMimeType(path, revision) +@@ -427,7 +425,7 @@ + codecs.lookup(enc) + return enc + +- raise exceptions.LookupError("No Encoding configured") ++ raise LookupError("No Encoding configured") + + + def getEncodingFromMimeType(self, path, revision): |