aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authoraz <az@FreeBSD.org>2007-10-08 19:53:15 +0800
committeraz <az@FreeBSD.org>2007-10-08 19:53:15 +0800
commit8112acd40d312d06bf9d616adbdd760abc9f4040 (patch)
tree5655c9b7babb27464bf169385de0a4f27d11f39c /mail
parent7e309e10ef6b6f7a8e192b8b089a63009b0e82df (diff)
downloadfreebsd-ports-gnome-8112acd40d312d06bf9d616adbdd760abc9f4040.tar.gz
freebsd-ports-gnome-8112acd40d312d06bf9d616adbdd760abc9f4040.tar.zst
freebsd-ports-gnome-8112acd40d312d06bf9d616adbdd760abc9f4040.zip
- Fix with python25+
PR: ports/116885, ports/116914 Submitted by: Philip M.Gollucci <pgollucci at p6m7g8.com>
Diffstat (limited to 'mail')
-rw-r--r--mail/svnmailer/Makefile9
-rw-r--r--mail/svnmailer/files/py25-src-lib-svnmailer-notifier-_base.py45
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):