Hi,

In python.port.mk there is
.if ${MODPY_MAJOR_VERSION} == 2
MODPY_BIN_SUFFIX =
.elif ${MODPY_MAJOR_VERSION} == 3
MODPY_BIN_SUFFIX =      -3
.endif

So guarding the rename in Makefile with if ${FLAVOR:Mpython3} is
useless. And the day we'll switch to py3, having those if will even be
a problem.

Here's a diff to remove them (those I found).

Would it make sense to define something in python.port.mk to unify
that? Currently it's done in many different ways.

Comments? OK?

Cheers,
Daniel

? .cvsignore
Index: audio/py-mutagen/Makefile
===================================================================
RCS file: /cvs/ports/audio/py-mutagen/Makefile,v
retrieving revision 1.18
diff -u -p -r1.18 Makefile
--- audio/py-mutagen/Makefile   30 Aug 2016 17:08:05 -0000      1.18
+++ audio/py-mutagen/Makefile   6 Nov 2016 19:50:43 -0000
@@ -41,12 +41,10 @@ MAKE_ENV =          LC_CTYPE="en_US.UTF-8"
 do-test:
        ${MODPY_TEST_TARGET}
 
-.if ${FLAVOR:Mpython3}
 post-install:
 .for i in mid3cp mid3iconv mid3v2 moggsplit mutagen-inspect mutagen-pony
        mv ${PREFIX}/bin/$i ${PREFIX}/bin/$i${MODPY_BIN_SUFFIX}
        mv ${PREFIX}/man/man1/$i.1 ${PREFIX}/man/man1/$i${MODPY_BIN_SUFFIX}.1
 .endfor
-.endif
 
 .include <bsd.port.mk>
Index: devel/py-argcomplete/Makefile
===================================================================
RCS file: /cvs/ports/devel/py-argcomplete/Makefile,v
retrieving revision 1.5
diff -u -p -r1.5 Makefile
--- devel/py-argcomplete/Makefile       28 Aug 2016 10:55:38 -0000      1.5
+++ devel/py-argcomplete/Makefile       6 Nov 2016 19:50:49 -0000
@@ -18,12 +18,10 @@ MODPY_SETUPTOOLS =  Yes
 FLAVORS =              python3
 FLAVOR ?=
 
-.if ${FLAVOR:Mpython3}
 post-install:
        for i in ${PREFIX}/bin/*; do \
                mv $${i} $${i}${MODPY_BIN_SUFFIX} ;\
        done
-.endif
 
 do-test:
        cd ${WRKSRC}/test && ${MODPY_BIN} test.py
Index: devel/py-babel/Makefile
===================================================================
RCS file: /cvs/ports/devel/py-babel/Makefile,v
retrieving revision 1.20
diff -u -p -r1.20 Makefile
--- devel/py-babel/Makefile     27 Apr 2016 12:37:30 -0000      1.20
+++ devel/py-babel/Makefile     6 Nov 2016 19:50:49 -0000
@@ -26,11 +26,9 @@ TEST_DEPENDS=                ${RUN_DEPENDS} \
 FLAVORS=               python3
 FLAVOR?=
 
-.if ${FLAVOR:Mpython3}
 post-install:
        mv ${PREFIX}/bin/pybabel \
                ${PREFIX}/bin/pybabel${MODPY_BIN_SUFFIX}
-.endif
 
 do-test:
        cd ${WRKSRC} && ${MODPY_BIN} -m pytest
Index: devel/py-codestyle/Makefile
===================================================================
RCS file: /cvs/ports/devel/py-codestyle/Makefile,v
retrieving revision 1.2
diff -u -p -r1.2 Makefile
--- devel/py-codestyle/Makefile 6 Nov 2016 07:31:09 -0000       1.2
+++ devel/py-codestyle/Makefile 6 Nov 2016 19:50:49 -0000
@@ -23,9 +23,7 @@ MODPY_SETUPTOOLS =    Yes
 FLAVORS =              python3
 FLAVOR ?=
 
-.if ${FLAVOR:Mpython3}
 post-install:
        mv ${PREFIX}/bin/pycodestyle 
${PREFIX}/bin/pycodestyle${MODPY_BIN_SUFFIX}
-.endif
 
 .include <bsd.port.mk>
Index: devel/py-isort/Makefile
===================================================================
RCS file: /cvs/ports/devel/py-isort/Makefile,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 Makefile
--- devel/py-isort/Makefile     1 Sep 2016 11:19:05 -0000       1.1.1.1
+++ devel/py-isort/Makefile     6 Nov 2016 19:50:50 -0000
@@ -25,9 +25,7 @@ FLAVOR ?=
 
 NO_TEST =              Yes
 
-.if ${FLAVOR:Mpython3}
 post-install:
        mv ${PREFIX}/bin/isort ${PREFIX}/bin/isort${MODPY_BIN_SUFFIX}
-.endif
 
 .include <bsd.port.mk>
Index: devel/py-jsonschema/Makefile
===================================================================
RCS file: /cvs/ports/devel/py-jsonschema/Makefile,v
retrieving revision 1.4
diff -u -p -r1.4 Makefile
--- devel/py-jsonschema/Makefile        14 May 2016 15:09:56 -0000      1.4
+++ devel/py-jsonschema/Makefile        6 Nov 2016 19:50:50 -0000
@@ -29,10 +29,8 @@ TEST_DEPENDS =               ${RUN_DEPENDS} \
                        devel/py-test${MODPY_FLAVOR} \
                        devel/py-mock${MODPY_FLAVOR}
 
-.if ${FLAVOR:Mpython3}
 post-install:
        mv ${PREFIX}/bin/jsonschema ${PREFIX}/bin/jsonschema${MODPY_BIN_SUFFIX}
-.endif
 
 do-test:
        cd ${WRKSRC}/jsonschema && \
Index: devel/py-logilab-common/Makefile
===================================================================
RCS file: /cvs/ports/devel/py-logilab-common/Makefile,v
retrieving revision 1.17
diff -u -p -r1.17 Makefile
--- devel/py-logilab-common/Makefile    3 Jul 2016 14:55:53 -0000       1.17
+++ devel/py-logilab-common/Makefile    6 Nov 2016 19:50:50 -0000
@@ -35,9 +35,7 @@ MODPY_SETUPTOOLS =    Yes
 do-test:
        @cd ${WRKSRC} && ${MODPY_BIN} bin/pytest
 
-.if ${FLAVOR:Mpython3}
 post-install:
        mv ${PREFIX}/bin/pytest ${PREFIX}/bin/pytest${MODPY_BIN_SUFFIX}
-.endif
 
 .include <bsd.port.mk>
Index: devel/py-nose/Makefile
===================================================================
RCS file: /cvs/ports/devel/py-nose/Makefile,v
retrieving revision 1.36
diff -u -p -r1.36 Makefile
--- devel/py-nose/Makefile      5 Oct 2016 17:06:28 -0000       1.36
+++ devel/py-nose/Makefile      6 Nov 2016 19:50:50 -0000
@@ -38,12 +38,10 @@ post-install:
                find . ! -type d -exec ${INSTALL_DATA} {} \
                        ${PREFIX}/share/examples/${MODPY_PY_PREFIX}nose/{} \;
        rm ${PREFIX}/bin/nosetests-${MODPY_VERSION}
-.if ${FLAVOR:Mpython3}
        mv ${PREFIX}/bin/nosetests \
                ${PREFIX}/bin/nosetests${MODPY_BIN_SUFFIX}
        mv ${PREFIX}/man/man1/nosetests.1 \
                ${PREFIX}/man/man1/nosetests${MODPY_BIN_SUFFIX}.1
-.endif
 
 
 do-test:
Index: devel/py-robotframework/Makefile
===================================================================
RCS file: /cvs/ports/devel/py-robotframework/Makefile,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 Makefile
--- devel/py-robotframework/Makefile    2 Sep 2016 17:02:36 -0000       1.1.1.1
+++ devel/py-robotframework/Makefile    6 Nov 2016 19:50:50 -0000
@@ -21,12 +21,10 @@ FLAVOR ?=
 MODULES =              lang/python
 TEST_DEPENDS =         ${FULLPKGNAME}:${FULLPKGPATH}
 
-.if ${FLAVOR:Mpython3}
 post-install:
 .for i in pybot rebot robot
        mv ${PREFIX}/bin/$i ${PREFIX}/bin/$i${MODPY_BIN_SUFFIX}
 .endfor
-.endif
 
 # There is also a suite of acceptance tests, but they are *very* slow and
 # it asks the user to type things and click stuff.
Index: devel/py-test/Makefile
===================================================================
RCS file: /cvs/ports/devel/py-test/Makefile,v
retrieving revision 1.19
diff -u -p -r1.19 Makefile
--- devel/py-test/Makefile      13 Oct 2016 10:54:54 -0000      1.19
+++ devel/py-test/Makefile      6 Nov 2016 19:50:50 -0000
@@ -33,9 +33,7 @@ TEST_DEPENDS=         ${RUN_DEPENDS} \
 TEST_DEPENDS +=                devel/py-twisted/core
 .endif
 
-.if ${FLAVOR:Mpython3}
 post-install:
        mv ${PREFIX}/bin/py.test ${PREFIX}/bin/py.test${MODPY_BIN_SUFFIX}
-.endif
 
 .include <bsd.port.mk>
Index: devel/py-tox/Makefile
===================================================================
RCS file: /cvs/ports/devel/py-tox/Makefile,v
retrieving revision 1.2
diff -u -p -r1.2 Makefile
--- devel/py-tox/Makefile       1 Nov 2016 22:17:54 -0000       1.2
+++ devel/py-tox/Makefile       6 Nov 2016 19:50:50 -0000
@@ -28,10 +28,8 @@ FLAVOR ?=
 # some tests need HOME to be writable
 PORTHOME =             /tmp
 
-.if ${FLAVOR:Mpython3}
 post-install:
        mv ${PREFIX}/bin/tox ${PREFIX}/bin/tox${MODPY_BIN_SUFFIX}
        mv ${PREFIX}/bin/tox-quickstart 
${PREFIX}/bin/tox-quickstart${MODPY_BIN_SUFFIX}
-.endif
 
 .include <bsd.port.mk>
Index: devel/py-uncompyle6/Makefile
===================================================================
RCS file: /cvs/ports/devel/py-uncompyle6/Makefile,v
retrieving revision 1.5
diff -u -p -r1.5 Makefile
--- devel/py-uncompyle6/Makefile        4 Nov 2016 07:13:36 -0000       1.5
+++ devel/py-uncompyle6/Makefile        6 Nov 2016 19:50:50 -0000
@@ -28,10 +28,8 @@ FLAVOR ?=
 
 NO_TEST =              Yes
 
-.if ${FLAVOR:Mpython3}
 post-install:
        mv ${PREFIX}/bin/pydisassemble 
${PREFIX}/bin/pydisassemble${MODPY_BIN_SUFFIX}
        mv ${PREFIX}/bin/uncompyle6 ${PREFIX}/bin/uncompyle6${MODPY_BIN_SUFFIX}
-.endif
 
 .include <bsd.port.mk>
Index: devel/py-xdis/Makefile
===================================================================
RCS file: /cvs/ports/devel/py-xdis/Makefile,v
retrieving revision 1.5
diff -u -p -r1.5 Makefile
--- devel/py-xdis/Makefile      4 Nov 2016 07:12:33 -0000       1.5
+++ devel/py-xdis/Makefile      6 Nov 2016 19:50:50 -0000
@@ -26,10 +26,8 @@ MODPY_SETUPTOOLS =   Yes
 FLAVORS =              python3
 FLAVOR ?=
 
-.if ${FLAVOR:Mpython3}
 post-install:
        mv ${PREFIX}/bin/pydisasm ${PREFIX}/bin/pydisasm${MODPY_BIN_SUFFIX}
-.endif
 
 do-test:
        cd ${WRKSRC} && \
Index: graphics/py-Pillow/Makefile
===================================================================
RCS file: /cvs/ports/graphics/py-Pillow/Makefile,v
retrieving revision 1.20
diff -u -p -r1.20 Makefile
--- graphics/py-Pillow/Makefile 19 Oct 2016 13:30:16 -0000      1.20
+++ graphics/py-Pillow/Makefile 6 Nov 2016 19:50:54 -0000
@@ -49,9 +49,7 @@ INCL_DIR=             ${MODPY_INCDIR:S/${LOCALBASE}
 post-install:
        ${INSTALL_DATA_DIR} ${WRKINST}${MODPY_INCDIR}
        ${INSTALL_DATA} ${WRKSRC}/libImaging/{ImPlatform,Imaging}.h 
${WRKINST}${MODPY_INCDIR}
-.if ${FLAVOR:Mpython3}
        for s in ${PREFIX}/bin/*; do mv $$s $$s${MODPY_BIN_SUFFIX}; done
-.endif
 
 do-test:
        cd ${WRKSRC}; ${MODPY_BIN} ./selftest.py --installed
Index: security/py-crypto/Makefile
===================================================================
RCS file: /cvs/ports/security/py-crypto/Makefile,v
retrieving revision 1.36
diff -u -p -r1.36 Makefile
--- security/py-crypto/Makefile 20 Mar 2016 16:12:26 -0000      1.36
+++ security/py-crypto/Makefile 6 Nov 2016 19:51:04 -0000
@@ -42,9 +42,7 @@ do-install:
        @${MODPY_INSTALL_TARGET}
        ${INSTALL_DATA_DIR} ${DOCSDIR}
        ${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR}
-.if ${FLAVOR:Mpython3}
        mv ${PREFIX}/share/doc/py-crypto ${PREFIX}/share/doc/py3-crypto
-.endif
 
 do-test: fake
        cd ${WRKSRC} && ${MAKE_ENV} \
Index: security/py-keyring/Makefile
===================================================================
RCS file: /cvs/ports/security/py-keyring/Makefile,v
retrieving revision 1.10
diff -u -p -r1.10 Makefile
--- security/py-keyring/Makefile        27 Aug 2016 17:40:17 -0000      1.10
+++ security/py-keyring/Makefile        6 Nov 2016 19:51:04 -0000
@@ -29,9 +29,7 @@ TEST_DEPENDS=         devel/py-test${MODPY_FLAV
 FLAVORS =              python3
 FLAVOR ?=
 
-.if ${FLAVOR:Mpython3}
 post-install:
        mv ${PREFIX}/bin/keyring ${PREFIX}/bin/keyring-${MODPY_VERSION}
-.endif
 
 .include <bsd.port.mk>
Index: security/py-rsa/Makefile
===================================================================
RCS file: /cvs/ports/security/py-rsa/Makefile,v
retrieving revision 1.5
diff -u -p -r1.5 Makefile
--- security/py-rsa/Makefile    26 May 2016 09:57:47 -0000      1.5
+++ security/py-rsa/Makefile    6 Nov 2016 19:51:04 -0000
@@ -25,12 +25,10 @@ TEST_DEPENDS=               ${RUN_DEPENDS} \
 FLAVORS=               python3
 FLAVOR ?=
 
-.if ${FLAVOR:Mpython3}
 post-install:
        for i in ${PREFIX}/bin/*; do \
                mv $${i} $${i}${MODPY_BIN_SUFFIX} ;\
        done
-.endif
 
 do-test:
        cd ${WRKSRC} && ${MODPY_BIN} -m pytest
Index: textproc/py-chardet/Makefile
===================================================================
RCS file: /cvs/ports/textproc/py-chardet/Makefile,v
retrieving revision 1.6
diff -u -p -r1.6 Makefile
--- textproc/py-chardet/Makefile        4 Jan 2016 12:18:06 -0000       1.6
+++ textproc/py-chardet/Makefile        6 Nov 2016 19:51:08 -0000
@@ -22,9 +22,7 @@ NO_TEST=      Yes
 FLAVORS =      python3
 FLAVOR ?=
 
-.if ${FLAVOR:Mpython3}
 post-install:
        mv ${PREFIX}/bin/chardetect ${PREFIX}/bin/chardetect${MODPY_BIN_SUFFIX}
-.endif
 
 .include <bsd.port.mk>
Index: textproc/py-demjson/Makefile
===================================================================
RCS file: /cvs/ports/textproc/py-demjson/Makefile,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 Makefile
--- textproc/py-demjson/Makefile        2 Sep 2016 14:12:20 -0000       1.1.1.1
+++ textproc/py-demjson/Makefile        6 Nov 2016 19:51:08 -0000
@@ -26,9 +26,7 @@ do-test:
 .endif
        cd ${WRKSRC}/test && ${MODPY_BIN} -m unittest test_demjson
 
-.if ${FLAVOR:Mpython3}
 post-install:
        mv ${PREFIX}/bin/jsonlint ${PREFIX}/bin/jsonlint${MODPY_BIN_SUFFIX}
-.endif
 
 .include <bsd.port.mk>
Index: textproc/py-docutils/Makefile
===================================================================
RCS file: /cvs/ports/textproc/py-docutils/Makefile,v
retrieving revision 1.21
diff -u -p -r1.21 Makefile
--- textproc/py-docutils/Makefile       7 Jan 2016 08:26:19 -0000       1.21
+++ textproc/py-docutils/Makefile       6 Nov 2016 19:51:08 -0000
@@ -27,12 +27,10 @@ pre-build:
        mv ${WRKSRC}/tools/rst${file}{.py,}
 .endfor
 
-.if ${FLAVOR:Mpython3}
 post-install:
        for i in ${PREFIX}/bin/*; do \
                mv $${i} $${i}${MODPY_BIN_SUFFIX} ;\
        done
-.endif
 
 do-test:
        cd ${WRKSRC}/test${MODPY_BIN_SUFFIX:S/-//} && ${MODPY_BIN} ./alltests.py
Index: textproc/py-pygments/Makefile
===================================================================
RCS file: /cvs/ports/textproc/py-pygments/Makefile,v
retrieving revision 1.23
diff -u -p -r1.23 Makefile
--- textproc/py-pygments/Makefile       31 May 2016 06:06:20 -0000      1.23
+++ textproc/py-pygments/Makefile       6 Nov 2016 19:51:08 -0000
@@ -25,10 +25,8 @@ TEST_DEPENDS=        devel/py-nose${MODPY_FLAVO
 FLAVORS=       python3
 FLAVOR ?=
 
-.if ${FLAVOR:Mpython3}
 post-install:
        mv ${PREFIX}/bin/pygmentize ${PREFIX}/bin/pygmentize${MODPY_BIN_SUFFIX}
-.endif
 
 do-test:
        cd ${WRKSRC}/tests && ${MAKE_ENV} \
Index: textproc/py-sphinx/Makefile
===================================================================
RCS file: /cvs/ports/textproc/py-sphinx/Makefile,v
retrieving revision 1.20
diff -u -p -r1.20 Makefile
--- textproc/py-sphinx/Makefile 6 Nov 2016 06:54:56 -0000       1.20
+++ textproc/py-sphinx/Makefile 6 Nov 2016 19:51:09 -0000
@@ -46,9 +46,7 @@ DOCS =                ${PREFIX}/share/doc/${MODPY_PY_P
 post-install:
        ${INSTALL_DATA_DIR} ${DOCS}
        cd ${WRKSRC}/doc/_build/html && pax -rw * ${DOCS}
-.if ${FLAVOR:Mpython3}
        cd ${PREFIX}/bin && find . -name '*' -exec mv {} {}${MODPY_BIN_SUFFIX} 
\;
-.endif
 
 do-test:
        cd ${WRKSRC} && env SPHINX_TEST_TEMPDIR=${WRKDIR} \
Index: www/py-flask/Makefile
===================================================================
RCS file: /cvs/ports/www/py-flask/Makefile,v
retrieving revision 1.19
diff -u -p -r1.19 Makefile
--- www/py-flask/Makefile       2 Nov 2016 16:50:02 -0000       1.19
+++ www/py-flask/Makefile       6 Nov 2016 19:51:10 -0000
@@ -45,9 +45,7 @@ post-install:
        ${INSTALL_DATA_DIR} ${PREFIX}/share/examples/${MODPY_PY_PREFIX}flask
        cd ${WRKSRC}/examples && pax -rw * \
            ${PREFIX}/share/examples/${MODPY_PY_PREFIX}flask
-.if ${FLAVOR:Mpython3}
        mv ${PREFIX}/bin/flask ${PREFIX}/bin/flask${MODPY_BIN_SUFFIX}
-.endif
 
 do-test:
        cd ${WRKSRC} && LC_ALL=C.UTF-8 ${MODPY_BIN} -m pytest tests examples
Index: www/py-gunicorn/Makefile
===================================================================
RCS file: /cvs/ports/www/py-gunicorn/Makefile,v
retrieving revision 1.15
diff -u -p -r1.15 Makefile
--- www/py-gunicorn/Makefile    13 Jun 2016 08:44:52 -0000      1.15
+++ www/py-gunicorn/Makefile    6 Nov 2016 19:51:10 -0000
@@ -30,11 +30,9 @@ TEST_DEPENDS =               devel/py-test${MODPY_FLA
 TEST_DEPENDS +=                devel/py-mock
 .endif
 
-.if ${FLAVOR:Mpython3}
 post-install:
        for i in ${PREFIX}/bin/*; do \
                mv $${i} $${i}${MODPY_BIN_SUFFIX} ;\
        done
-.endif
 
 .include <bsd.port.mk>
Index: www/py-mako/Makefile
===================================================================
RCS file: /cvs/ports/www/py-mako/Makefile,v
retrieving revision 1.18
diff -u -p -r1.18 Makefile
--- www/py-mako/Makefile        29 Sep 2015 10:52:55 -0000      1.18
+++ www/py-mako/Makefile        6 Nov 2016 19:51:10 -0000
@@ -31,10 +31,8 @@ TEST_DEPENDS =       devel/py-nose${MODPY_FLAV
 
 MODPY_SETUPTOOLS = Yes
 
-.if ${FLAVOR:Mpython3}
 post-install:
        mv ${PREFIX}/bin/mako-render \
                ${PREFIX}/bin/mako-render${MODPY_BIN_SUFFIX}
-.endif
 
 .include <bsd.port.mk>


Reply via email to