svn commit: r524884 - head/mail/py-mail-parser

Po-Chuan Hsieh sunpoet at freebsd.org
Sun Feb 2 14:38:39 UTC 2020


Hi Steve,

On Sun, Feb 2, 2020 at 10:05 PM Steve Wills <swills at freebsd.org> wrote:

> Hi,
>
> On 2/2/20 6:01 AM, Sunpoet Po-Chuan Hsieh wrote:
> > Author: sunpoet
> > Date: Sun Feb  2 11:01:01 2020
> > New Revision: 524884
> > URL: https://svnweb.freebsd.org/changeset/ports/524884
> >
> > Log:
> >    Limit ipaddress for Python prior to 3.3
>
> This doesn't really say why this change was made. Could you explain
> more? I'm guessing it's because ipaddress is part of stdlib in 3.3 and
> later?
>

net/py-ipaddress is a port of the 3.3+ ipaddress module to 2.6, 2.7, 3.2.
And PY_IPADDRESS is set for python prior to 3.3.

from Mk/Uses/python.mk:
.if ${PYTHON_REL} < 3300
PY_IPADDRESS=   ${PYTHON_PKGNAMEPREFIX}ipaddress>=1.0.23:net/py-ipaddress@
${PY_FLAVOR}
.else
PY_IPADDRESS=
.endif


>
> >
> >    - Bump PORTREVISION for package change
> >
> > Modified:
> >    head/mail/py-mail-parser/Makefile
> >
> > Modified: head/mail/py-mail-parser/Makefile
> >
> ==============================================================================
> > --- head/mail/py-mail-parser/Makefile Sun Feb  2 11:00:56 2020
> (r524883)
> > +++ head/mail/py-mail-parser/Makefile Sun Feb  2 11:01:01 2020
> (r524884)
> > @@ -3,6 +3,7 @@
> >
> >   PORTNAME=   mail-parser
> >   PORTVERSION=        3.12.0
> > +PORTREVISION=        1
> >   CATEGORIES= mail python
> >   MASTER_SITES=       CHEESESHOP
> >   PKGNAMEPREFIX=      ${PYTHON_PKGNAMEPREFIX}
> > @@ -23,6 +24,6 @@ USE_PYTHON= autoplist concurrent distutils
> >   NO_ARCH=    yes
> >
> >   post-patch:
> > -     @${REINPLACE_CMD} -e 's|==|>=|' ${WRKSRC}/requirements.txt
> > +     @${REINPLACE_CMD} -e "s|==|>=|; /ipaddress/ s|$$|; python_version
> < '3.3'|" ${WRKSRC}/requirements.txt
> >
> >   .include <bsd.port.mk>
> >
>
> I think this would be better as a patch file than REINPLACE_CMD. Using
> sed can break silently. It can break in multiple ways, for example,
> cases where the sed is still there but does nothing are common. I've
> even seen cases where the code changes in such a way that the sed
> applied by a port Makefile did something different than it originally
> did. Patch files are easier to send upstream or even for upstream
> themselves to locate and adopt or modify. These are some of the reasons
> why the Porters Handbook says this should be done with patch:
>
> https://www.freebsd.org/doc/en/books/porters-handbook/slow-patch.html
>
> I've gone ahead and created a patch, see attached. I can open a Bugzilla
> PR or Phabricator review if you prefer. I also went ahead and opened a
> pull request upstream, assuming my understanding about ipaddress is
> correct.
>

I've changed it to a patch file in r524958.
Thanks.


>
> Thanks,
> Steve
>

Regards,
sunpoet


More information about the svn-ports-all mailing list