Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Feb 2020 09:05:41 -0500
From:      Steve Wills <swills@FreeBSD.org>
To:        Sunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org>, 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:  <86b5ba05-4c4e-404e-3951-3914ce42b3be@FreeBSD.org>
In-Reply-To: <202002021101.012B11G4079551@repo.freebsd.org>
References:  <202002021101.012B11G4079551@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <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.

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 <bsd.port.mk>
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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86b5ba05-4c4e-404e-3951-3914ce42b3be>