FreeBSD Bugzilla – Attachment 191744 Details for
Bug 226857
[PATCH] mail/py-milter: Update to 1.0.2, follow move to github
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
update to 1.0.2 and add Python 3 support (by patching)
py-milter-1.0.2.diff (text/plain), 11.86 KB, created by
Peter Wullinger
on 2018-03-22 22:18:11 UTC
(
hide
)
Description:
update to 1.0.2 and add Python 3 support (by patching)
Filename:
MIME Type:
Creator:
Peter Wullinger
Created:
2018-03-22 22:18:11 UTC
Size:
11.86 KB
patch
obsolete
>Index: mail/py-milter/Makefile >=================================================================== >--- mail/py-milter/Makefile (Revision 465315) >+++ mail/py-milter/Makefile (Arbeitskopie) >@@ -2,13 +2,13 @@ > # $FreeBSD$ > > PORTNAME= milter >-PORTVERSION= 1.0 >-PORTREVISION= 4 >+PORTVERSION= 1.0.2 >+PORTREVISION= 0 > CATEGORIES= mail python >-MASTER_SITES= SF/${PYPORTNAME}/${PYPORTNAME}/${DISTNAME} >+MASTER_SITES= GH > PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} > DISTNAME= ${PYPORTNAME}-${PORTVERSION} >-DIST_SUBDIR= python >+# DIST_SUBDIR= python > > MAINTAINER= estartu@augusta.de > COMMENT= Python interface to Sendmail milter API >@@ -22,11 +22,22 @@ > .endif > > PYPORTNAME= ${PKGNAMEPREFIX:C/[0-9]+-//}${PORTNAME} >+GH_ACCOUNT= sdgathman >+GH_PROJECT= ${PYPORTNAME} >+GH_TAGNAME= ${GH_PROJECT}-${PORTVERSION} > >-USES= python:2.7 >-USE_PYTHON= distutils autoplist >+USES= python >+ >+USE_GITHUB= yes >+USE_PYTHON= distutils autoplist flavors > > post-install: > ${STRIP_CMD} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/milter.so > >-.include <bsd.port.mk> >+.include <bsd.port.pre.mk> >+ >+.if ${FLAVOR:Upy27:Mpy3*} >+EXTRA_PATCHES = ${PATCHDIR}/extra-patch-miltermodule.c >+.endif >+ >+.include <bsd.port.post.mk> >Index: mail/py-milter/distinfo >=================================================================== >--- mail/py-milter/distinfo (Revision 465315) >+++ mail/py-milter/distinfo (Arbeitskopie) >@@ -1,2 +1,3 @@ >-SHA256 (python/pymilter-1.0.tar.gz) = 93a8f31b06c4a7f04e6f9b69f8d7357ba750819e6348177536b23255616e8937 >-SIZE (python/pymilter-1.0.tar.gz) = 1014442 >+TIMESTAMP = 1521752301 >+SHA256 (pymilter-1.0.2_GH0.tar.gz) = f513053f5fc9b0c31d886d8412a411bdc958786a673d7071b1bd521498b01153 >+SIZE (pymilter-1.0.2_GH0.tar.gz) = 1022535 >Index: mail/py-milter/files/extra-patch-miltermodule.c >=================================================================== >--- mail/py-milter/files/extra-patch-miltermodule.c (nicht existent) >+++ mail/py-milter/files/extra-patch-miltermodule.c (Arbeitskopie) >@@ -0,0 +1,172 @@ >+--- miltermodule.c.orig 2016-12-13 19:17:34 UTC >++++ miltermodule.c >+@@ -343,7 +343,7 @@ static struct MilterCallback { >+ { NULL , NULL } >+ }; >+ >+-staticforward struct smfiDesc description; /* forward declaration */ >++static struct smfiDesc description; /* forward declaration */ >+ >+ static PyObject *MilterError; >+ /* The interpreter instance that called milter.main */ >+@@ -355,7 +355,7 @@ typedef struct { >+ >+ static milter_Diag diag; >+ >+-staticforward PyTypeObject milter_ContextType; >++static PyTypeObject milter_ContextType; >+ >+ typedef struct { >+ PyObject_HEAD >+@@ -700,7 +700,7 @@ _generic_wrapper(milter_ContextObject *s >+ result = PyEval_CallObject(cb, arglist); >+ Py_DECREF(arglist); >+ if (result == NULL) return _report_exception(self); >+- if (!PyInt_Check(result)) { >++ if (!PyLong_Check(result)) { >+ const struct MilterCallback *p; >+ const char *cbname = "milter"; >+ char buf[40]; >+@@ -715,7 +715,7 @@ _generic_wrapper(milter_ContextObject *s >+ PyErr_SetString(MilterError,buf); >+ return _report_exception(self); >+ } >+- retval = PyInt_AS_LONG(result); >++ retval = PyLong_AS_LONG(result); >+ Py_DECREF(result); >+ _release_thread(self->t); >+ return retval; >+@@ -732,7 +732,7 @@ makeipaddr(struct sockaddr_in *addr) { >+ sprintf(buf, "%d.%d.%d.%d", >+ (int) (x>>24) & 0xff, (int) (x>>16) & 0xff, >+ (int) (x>> 8) & 0xff, (int) (x>> 0) & 0xff); >+- return PyString_FromString(buf); >++ return PyUnicode_FromString(buf); >+ } >+ >+ #ifdef HAVE_IPV6_SUPPORT >+@@ -740,8 +740,8 @@ static PyObject * >+ makeip6addr(struct sockaddr_in6 *addr) { >+ char buf[100]; /* must be at least INET6_ADDRSTRLEN + 1 */ >+ const char *s = inet_ntop(AF_INET6, &addr->sin6_addr, buf, sizeof buf); >+- if (s) return PyString_FromString(s); >+- return PyString_FromString("inet6:unknown"); >++ if (s) return PyUnicode_FromString(s); >++ return PyUnicode_FromString("inet6:unknown"); >+ } >+ #endif >+ >+@@ -832,7 +832,7 @@ generic_env_wrapper(SMFICTX *ctx, PyObje >+ for (i=0;i<count;i++) { >+ /* There's some error checking performed in do_mkvalue() for a string */ >+ /* that's not currently done here - it probably should be */ >+- PyObject *o = PyString_FromStringAndSize(argv[i], strlen(argv[i])); >++ PyObject *o = PyUnicode_FromStringAndSize(argv[i], strlen(argv[i])); >+ if (o == NULL) { /* out of memory */ >+ Py_DECREF(arglist); >+ return _report_exception(self); >+@@ -889,7 +889,7 @@ milter_wrap_body(SMFICTX *ctx, u_char *b >+ c = _get_context(ctx); >+ if (!c) return SMFIS_TEMPFAIL; >+ /* Unclear whether this should be s#, z#, or t# */ >+- arglist = Py_BuildValue("(Os#)", c, bodyp, bodylen); >++ arglist = Py_BuildValue("(Oy#)", c, bodyp, bodylen); >+ return _generic_wrapper(c, body_callback, arglist); >+ } >+ >+@@ -963,7 +963,7 @@ milter_wrap_negotiate(SMFICTX *ctx, >+ int i; >+ for (i = 0; i < 4; ++i) { >+ *pa[i] = (i <= len) >+- ? PyInt_AsUnsignedLongMask(PyList_GET_ITEM(optlist,i)) >++ ? PyLong_AsUnsignedLongMask(PyList_GET_ITEM(optlist,i)) >+ : fa[i]; >+ } >+ if (PyErr_Occurred()) { >+@@ -1551,11 +1551,6 @@ static PyMethodDef context_methods[] = { >+ { NULL, NULL } >+ }; >+ >+-static PyObject * >+-milter_Context_getattr(PyObject *self, char *name) { >+- return Py_FindMethod(context_methods, self, name); >+-} >+- >+ static struct smfiDesc description = { /* Set some reasonable defaults */ >+ "pythonfilter", >+ SMFI_VERSION, >+@@ -1604,14 +1599,13 @@ static PyMethodDef milter_methods[] = { >+ }; >+ >+ static PyTypeObject milter_ContextType = { >+- PyObject_HEAD_INIT(&PyType_Type) >+- 0, >+- "milterContext", >++ PyVarObject_HEAD_INIT(&PyType_Type,0) >++ "milter.Context", >+ sizeof(milter_ContextObject), >+ 0, >+ milter_Context_dealloc, /* tp_dealloc */ >+ 0, /* tp_print */ >+- milter_Context_getattr, /* tp_getattr */ >++ 0, /* tp_getattr */ >+ 0, /* tp_setattr */ >+ 0, /* tp_compare */ >+ 0, /* tp_repr */ >+@@ -1625,6 +1619,13 @@ static PyTypeObject milter_ContextType = >+ 0, /* tp_setattro */ >+ 0, /* tp_as_buffer */ >+ Py_TPFLAGS_DEFAULT, /* tp_flags */ >++ NULL, /* Documentation string */ >++ 0, /* call function for all accessible objects */ >++ 0, /* delete references to contained objects */ >++ 0, /* rich comparisons */ >++ 0, /* weak reference enabler */ >++ 0, 0, /* Iterators */ >++ context_methods, /* Attribute descriptor and subclassing stuff */ >+ }; >+ >+ static const char milter_documentation[] = >+@@ -1634,17 +1635,31 @@ Libmilter is currently marked FFR, and n >+ See <sendmailsource>/libmilter/README for details on setting it up.\n"; >+ >+ static void setitem(PyObject *d,const char *name,long val) { >+- PyObject *v = PyInt_FromLong(val); >++ PyObject *v = PyLong_FromLong(val); >+ PyDict_SetItemString(d,name,v); >+ Py_DECREF(v); >+ } >+ >+-void >+-initmilter(void) { >++static struct PyModuleDef moduledef = { >++ PyModuleDef_HEAD_INIT, >++ "milter", /* m_name */ >++ milter_documentation,/* m_doc */ >++ -1, /* m_size */ >++ milter_methods, /* m_methods */ >++ NULL, /* m_reload */ >++ NULL, /* m_traverse */ >++ NULL, /* m_clear */ >++ NULL, /* m_free */ >++}; >++ >++PyMODINIT_FUNC PyInit_milter(void) { >+ PyObject *m, *d; >+ >+- m = Py_InitModule4("milter", milter_methods, milter_documentation, >+- (PyObject*)NULL, PYTHON_API_VERSION); >++ if (PyType_Ready(&milter_ContextType) < 0) >++ return NULL; >++ >++ m = PyModule_Create(&moduledef); >++ if (m == NULL) return NULL; >+ d = PyModule_GetDict(m); >+ MilterError = PyErr_NewException("milter.error", NULL, NULL); >+ PyDict_SetItemString(d,"error", MilterError); >+@@ -1710,4 +1725,5 @@ initmilter(void) { >+ setitem(d,"DISCARD", SMFIS_DISCARD); >+ setitem(d,"ACCEPT", SMFIS_ACCEPT); >+ setitem(d,"TEMPFAIL", SMFIS_TEMPFAIL); >++ return m; >+ } > >Eigenschaftsänderungen: mail/py-milter/files/extra-patch-miltermodule.c >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:keywords >## -0,0 +1 ## >+Id >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: mail/py-milter/files/patch-Milter-dns.py >=================================================================== >--- mail/py-milter/files/patch-Milter-dns.py (nicht existent) >+++ mail/py-milter/files/patch-Milter-dns.py (Arbeitskopie) >@@ -0,0 +1,13 @@ >+--- Milter/dns.py.orig 2016-12-13 19:17:34 UTC >++++ Milter/dns.py >+@@ -26,8 +26,8 @@ def DNSLookup(name, qtype): >+ # A RR as dotted quad. For consistency, this driver should >+ # return both as binary string. >+ return [((a['name'], a['typename']), a['data']) for a in resp.answers] >+- except IOError, x: >+- raise DNSError, str(x) >++ except IOError as x: >++ raise DNSError(str(x)) >+ >+ class Session(object): >+ """A Session object has a simple cache with no TTL that is valid > >Eigenschaftsänderungen: mail/py-milter/files/patch-Milter-dns.py >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: mail/py-milter/files/patch-Milter-dsn.py >=================================================================== >--- mail/py-milter/files/patch-Milter-dsn.py (nicht existent) >+++ mail/py-milter/files/patch-Milter-dsn.py (Arbeitskopie) >@@ -0,0 +1,19 @@ >+--- Milter/dsn.py.orig 2016-12-13 19:17:34 UTC >++++ Milter/dsn.py >+@@ -142,13 +142,13 @@ def send_dsn(mailfrom,receiver,msg=None, >+ if badrcpts: >+ return badrcpts >+ return None # success >+- except smtplib.SMTPRecipientsRefused,x: >++ except smtplib.SMTPRecipientsRefused as x: >+ if len(x.recipients) == 1: >+ return x.recipients.values()[0] # permanent error >+ return x.recipients >+- except smtplib.SMTPSenderRefused,x: >++ except smtplib.SMTPSenderRefused as x: >+ return x.args[:2] # does not accept DSN >+- except smtplib.SMTPDataError,x: >++ except smtplib.SMTPDataError as x: >+ return x.args # permanent error >+ except smtplib.SMTPException: >+ pass # any other error, try next MX > >Eigenschaftsänderungen: mail/py-milter/files/patch-Milter-dsn.py >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: mail/py-milter/files/patch-miltermodule.c >=================================================================== >--- mail/py-milter/files/patch-miltermodule.c (Revision 465315) >+++ mail/py-milter/files/patch-miltermodule.c (nicht existent) >@@ -1,11 +0,0 @@ >---- miltermodule.c.orig 2013-03-15 20:50:01 UTC >-+++ miltermodule.c >-@@ -285,7 +285,7 @@ $ python setup.py help >- * published. Unfortunately I know of no good way to do this >- * other than with OS-specific tests. >- */ >--#if defined(__FreeBSD_kernel__) || defined(__linux__) >-+#if defined(__FreeBSD__) || defined(__linux__) >- #define HAVE_IPV6_RFC2553 >- #include <arpa/inet.h> >- #endif > >Eigenschaftsänderungen: mail/py-milter/files/patch-miltermodule.c >___________________________________________________________________ >Deleted: fbsd:nokeywords >## -1 +0,0 ## >-yes >\ No newline at end of property >Deleted: svn:eol-style >## -1 +0,0 ## >-native >\ No newline at end of property >Deleted: svn:mime-type >## -1 +0,0 ## >-text/plain >\ No newline at end of property
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 226857
: 191744