From owner-svn-ports-all@freebsd.org Sun Feb 2 14:05:56 2020 Return-Path: Delivered-To: svn-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6E68322F21B; Sun, 2 Feb 2020 14:05:56 +0000 (UTC) (envelope-from swills@FreeBSD.org) Received: from mouf.net (mouf.net [IPv6:2607:fc50:0:4400:216:3eff:fe69:33b3]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mouf.net", Issuer "mouf.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 489Xmh2H6lz49pv; Sun, 2 Feb 2020 14:05:56 +0000 (UTC) (envelope-from swills@FreeBSD.org) Received: from lrrr.mouf.net (cpe-76-182-16-135.nc.res.rr.com [76.182.16.135]) (authenticated bits=0) by mouf.net (8.14.9/8.14.9) with ESMTP id 012E5lRH078907 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Sun, 2 Feb 2020 14:05:53 GMT (envelope-from swills@FreeBSD.org) Subject: Re: svn commit: r524884 - head/mail/py-mail-parser To: Sunpoet Po-Chuan Hsieh , ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org References: <202002021101.012B11G4079551@repo.freebsd.org> From: Steve Wills Message-ID: <86b5ba05-4c4e-404e-3951-3914ce42b3be@FreeBSD.org> Date: Sun, 2 Feb 2020 09:05:41 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <202002021101.012B11G4079551@repo.freebsd.org> Content-Type: multipart/mixed; boundary="------------21763923296280EA4C626F38" Content-Language: en-US X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mouf.net [199.48.129.64]); Sun, 02 Feb 2020 14:05:53 +0000 (UTC) X-Spam-Status: No, score=0.3 required=4.5 tests=KHOP_HELO_FCRDNS autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mouf.net X-Virus-Scanned: clamav-milter 0.99.2 at mouf.net X-Virus-Status: Clean X-Rspamd-Queue-Id: 489Xmh2H6lz49pv X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.99 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.987,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2020 14:05:56 -0000 This is a multi-part message in MIME format. --------------21763923296280EA4C626F38 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit 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? > > - 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 > 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. Thanks, Steve --------------21763923296280EA4C626F38 Content-Type: text/x-patch; charset=UTF-8; name="py-mail-parser-rev0.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="py-mail-parser-rev0.diff" diff --git mail/py-mail-parser/Makefile mail/py-mail-parser/Makefile index cab6f3660603..ecdf8eb36cd8 100644 --- mail/py-mail-parser/Makefile +++ mail/py-mail-parser/Makefile @@ -23,7 +23,4 @@ USE_PYTHON= autoplist concurrent distutils NO_ARCH= yes -post-patch: - @${REINPLACE_CMD} -e "s|==|>=|; /ipaddress/ s|$$|; python_version < '3.3'|" ${WRKSRC}/requirements.txt - .include diff --git mail/py-mail-parser/files/patch-requirements.txt mail/py-mail-parser/files/patch-requirements.txt new file mode 100644 index 000000000000..71a2fb5c7240 --- /dev/null +++ mail/py-mail-parser/files/patch-requirements.txt @@ -0,0 +1,11 @@ +--- requirements.txt.orig 2020-01-27 00:11:06 UTC ++++ requirements.txt +@@ -1,3 +1,3 @@ +-ipaddress==1.0.23 +-simplejson==3.17.0 +-six==1.14.0 +\ No newline at end of file ++ipaddress>=1.0.23; python_version < '3.3' ++simplejson>=3.17.0 ++six>=1.14.0 +\ No newline at end of file --------------21763923296280EA4C626F38--