diff options
author | khorben <khorben@pkgsrc.org> | 2021-06-02 21:06:03 +0000 |
---|---|---|
committer | khorben <khorben@pkgsrc.org> | 2021-06-02 21:06:03 +0000 |
commit | dd081fab9b83b55f241e0a390cb6a7fa34b02187 (patch) | |
tree | 174ece930155c8610105fa465f832eace505d42d | |
parent | cf24966b7e1b70c867daf9c0a3d3a2cbb4dc434b (diff) | |
download | pkgsrc-dd081fab9b83b55f241e0a390cb6a7fa34b02187.tar.gz |
py-flask-sendmail: improve and import a couple fixes
The updated patches:
- fix the suppressing of messages when testing or disabled in configuration;
- import what should be a better fix when piping messages to sendmail(1).
Bumps PKGREVISION.
-rw-r--r-- | www/py-flask-sendmail/Makefile | 3 | ||||
-rw-r--r-- | www/py-flask-sendmail/PLIST | 2 | ||||
-rw-r--r-- | www/py-flask-sendmail/distinfo | 5 | ||||
-rw-r--r-- | www/py-flask-sendmail/patches/patch-flask__sendmail_connection.py | 20 | ||||
-rw-r--r-- | www/py-flask-sendmail/patches/patch-flask__sendmail_message.py | 22 |
5 files changed, 40 insertions, 12 deletions
diff --git a/www/py-flask-sendmail/Makefile b/www/py-flask-sendmail/Makefile index f2551148218..076d7f34391 100644 --- a/www/py-flask-sendmail/Makefile +++ b/www/py-flask-sendmail/Makefile @@ -1,7 +1,8 @@ -# $NetBSD: Makefile,v 1.1 2021/05/27 22:25:05 khorben Exp $ +# $NetBSD: Makefile,v 1.2 2021/06/02 21:06:03 khorben Exp $ DISTNAME= Flask-Sendmail-0.1 PKGNAME= ${PYPKGPREFIX}-${DISTNAME:tl} +PKGREVISION= 1 CATEGORIES= www python MASTER_SITES= ${MASTER_SITE_PYPI:=F/Flask-Sendmail/} diff --git a/www/py-flask-sendmail/PLIST b/www/py-flask-sendmail/PLIST index f13b8acd820..02b4cd435be 100644 --- a/www/py-flask-sendmail/PLIST +++ b/www/py-flask-sendmail/PLIST @@ -1,4 +1,4 @@ -@comment $NetBSD: PLIST,v 1.1 2021/05/27 22:25:05 khorben Exp $ +@comment $NetBSD: PLIST,v 1.2 2021/06/02 21:06:03 khorben Exp $ ${PYSITELIB}/${EGG_INFODIR}/PKG-INFO ${PYSITELIB}/${EGG_INFODIR}/SOURCES.txt ${PYSITELIB}/${EGG_INFODIR}/dependency_links.txt diff --git a/www/py-flask-sendmail/distinfo b/www/py-flask-sendmail/distinfo index aee8d8eefcd..5bf21f5df72 100644 --- a/www/py-flask-sendmail/distinfo +++ b/www/py-flask-sendmail/distinfo @@ -1,7 +1,8 @@ -$NetBSD: distinfo,v 1.1 2021/05/27 22:25:05 khorben Exp $ +$NetBSD: distinfo,v 1.2 2021/06/02 21:06:03 khorben Exp $ SHA1 (Flask-Sendmail-0.1.tar.gz) = 6ac44c275a3d9dce4ed3d028335537ed19e67cef RMD160 (Flask-Sendmail-0.1.tar.gz) = 7b79b89250b9376ff5f9f2f1d1b3b0508c861a6a SHA512 (Flask-Sendmail-0.1.tar.gz) = c341d841a5ea2ff06d60361bf323fd3d9bce1b332143da415534e9176d797fbd5bd59ea9b7563a81e35dbe93dcbb6d957f02df61bd191b385eb834638133aecd Size (Flask-Sendmail-0.1.tar.gz) = 3410 bytes -SHA1 (patch-flask__sendmail_connection.py) = 8ec1db04739ffe9d41006c68b3670f97a39ae8cc +SHA1 (patch-flask__sendmail_connection.py) = bcc2161f5f1d5bcaa67a67b319554e3d41ee0e97 +SHA1 (patch-flask__sendmail_message.py) = 7aa1f56237e7ae3704eb98060dded53222ed29a1 diff --git a/www/py-flask-sendmail/patches/patch-flask__sendmail_connection.py b/www/py-flask-sendmail/patches/patch-flask__sendmail_connection.py index 3219f908cd6..f9a58003fb9 100644 --- a/www/py-flask-sendmail/patches/patch-flask__sendmail_connection.py +++ b/www/py-flask-sendmail/patches/patch-flask__sendmail_connection.py @@ -1,15 +1,19 @@ -$NetBSD: patch-flask__sendmail_connection.py,v 1.1 2021/05/27 22:25:05 khorben Exp $ +$NetBSD: patch-flask__sendmail_connection.py,v 1.2 2021/06/02 21:06:03 khorben Exp $ -Fix type error when sending messages +Do not send messages when testing or disabled in configuration + +Submitted upstream in PR #12 (at +https://github.com/ajford/flask-sendmail/pull/12). --- flask_sendmail/connection.py.orig 2012-04-23 02:11:53.000000000 +0000 +++ flask_sendmail/connection.py -@@ -20,7 +20,7 @@ class Connection(object): +@@ -18,6 +18,9 @@ class Connection(object): + pass + def send(self, message): ++ if self.suppress: ++ return 0 ++ sm = Popen([self.mail.mailer, self.mail.mailer_flags], stdin=PIPE, stdout=PIPE, stderr=STDOUT) -- sm.stdin.write(message.dump()) -+ sm.stdin.write(message.dump().encode()) - sm.communicate() - - return sm.returncode + sm.stdin.write(message.dump()) diff --git a/www/py-flask-sendmail/patches/patch-flask__sendmail_message.py b/www/py-flask-sendmail/patches/patch-flask__sendmail_message.py new file mode 100644 index 00000000000..34b2af69f47 --- /dev/null +++ b/www/py-flask-sendmail/patches/patch-flask__sendmail_message.py @@ -0,0 +1,22 @@ +$NetBSD: patch-flask__sendmail_message.py,v 1.1 2021/06/02 21:06:03 khorben Exp $ + +Fix for Python 3 + +From commit cc55636201554d1cf8516bb5bf0326bb498d03a7 in the flask-sendmail-ng +fork at https://github.com/ncrocfer/flask-sendmail-ng. + +--- flask_sendmail/message.py.orig 2012-04-23 02:41:10.000000000 +0000 ++++ flask_sendmail/message.py +@@ -99,7 +99,11 @@ class Message(object): + if self.reply_to: + msg['Reply-To'] = self.reply_to + +- return msg.as_string() ++ msg_str = msg.as_string() ++ if sys.version_info >= (3,0) and isinstance(msg_str, str): ++ return msg_str.encode(self.charset or 'utf-8') ++ else: ++ return msg_str + + def send(self, connection): + """ |