Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Feb 2020 22:38:01 +0800
From:      Po-Chuan Hsieh <sunpoet@freebsd.org>
To:        Steve Wills <swills@freebsd.org>
Cc:        ports-committers@freebsd.org, svn-ports-all@freebsd.org,  svn-ports-head@freebsd.org
Subject:   Re: svn commit: r524884 - head/mail/py-mail-parser
Message-ID:  <CAMHz58SRbxLXJA7O4Ru983GhXug-uD8H2cXeJPyb53M9%2BQwbbw@mail.gmail.com>
In-Reply-To: <86b5ba05-4c4e-404e-3951-3914ce42b3be@FreeBSD.org>
References:  <202002021101.012B11G4079551@repo.freebsd.org> <86b5ba05-4c4e-404e-3951-3914ce42b3be@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi Steve,

On Sun, Feb 2, 2020 at 10:05 PM Steve Wills <swills@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAMHz58SRbxLXJA7O4Ru983GhXug-uD8H2cXeJPyb53M9%2BQwbbw>