bin/python3 symlink for python3X ports
Hello! It is common to have both python-2 and python-3 packages installed. To help transition it is convenient to have bin/python to point to python-2 binary. Now for every X in python3X we have a bin/python3.X binary. So for every new python3.X release one should change shebang line in scripts. I propose to tweak python3X ports so they create bin/python3 symlink pointing to the installed python3.X binary so that people can always use 'python3' name. What do you think? Thanks! ___ freebsd-python@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-python To unsubscribe, send any mail to "freebsd-python-unsubscr...@freebsd.org"
Re: bin/python3 symlink for python3X ports
On 26 Sep 2012 08:13, "Dmitry Sivachenko" wrote: > > Hello! > > It is common to have both python-2 and python-3 packages installed. > To help transition it is convenient to have bin/python to point to python-2 binary. > > Now for every X in python3X we have a bin/python3.X binary. > > So for every new python3.X release one should change shebang line in scripts. > > I propose to tweak python3X ports so they create bin/python3 symlink pointing to the installed python3.X binary so that people can always use 'python3' name. > > What do you think? I think it's a great idea, at least minimising weird breakage when python is updated. Have you a patch? Also, what do other OSes do? Chris ___ freebsd-python@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-python To unsubscribe, send any mail to "freebsd-python-unsubscr...@freebsd.org"
Re: bin/python3 symlink for python3X ports
Chris Rees wrote on 26.09.2012 13:03: On 26 Sep 2012 08:13, "Dmitry Sivachenko" wrote: Hello! It is common to have both python-2 and python-3 packages installed. To help transition it is convenient to have bin/python to point to python-2 binary. Now for every X in python3X we have a bin/python3.X binary. So for every new python3.X release one should change shebang line in scripts. I propose to tweak python3X ports so they create bin/python3 symlink pointing to the installed python3.X binary so that people can always use 'python3' name. What do you think? I think it's a great idea, at least minimising weird breakage when python is updated. Have you a patch? Also, what do other OSes do? Chris AFAIK, linuces has python2 and python3 symlinks. So this is generally common idea. And I +1 for it. -- Regards, Ruslan Tinderboxing kills... the drives. ___ freebsd-python@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-python To unsubscribe, send any mail to "freebsd-python-unsubscr...@freebsd.org"
Re: bin/python3 symlink for python3X ports
On 26.09.2012 13:07, Ruslan Mahmatkhanov wrote: Chris Rees wrote on 26.09.2012 13:03: On 26 Sep 2012 08:13, "Dmitry Sivachenko" wrote: Hello! It is common to have both python-2 and python-3 packages installed. To help transition it is convenient to have bin/python to point to python-2 binary. Now for every X in python3X we have a bin/python3.X binary. So for every new python3.X release one should change shebang line in scripts. I propose to tweak python3X ports so they create bin/python3 symlink pointing to the installed python3.X binary so that people can always use 'python3' name. What do you think? I think it's a great idea, at least minimising weird breakage when python is updated. Have you a patch? Also, what do other OSes do? I don't have a patch but I can make one if you like. I don't use other OSes so I have no idea what do they do with that problem and I don't see any reason why should we bother... ___ freebsd-python@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-python To unsubscribe, send any mail to "freebsd-python-unsubscr...@freebsd.org"
Re: bin/python3 symlink for python3X ports
On 26.09.2012 13:03, Chris Rees wrote: Also, what do other OSes do? I found one linux box near me: {zamarashka}/usr/bin# ls -la python* lrwxrwxrwx 1 root root 9 Apr 17 21:20 python -> python2.7 lrwxrwxrwx 1 root root 9 Apr 17 21:20 python2 -> python2.7 -rwxr-xr-x 1 root root 2989480 Aug 1 09:40 python2.7 -rwxr-xr-x 1 root root1652 Aug 1 09:40 python2.7-config lrwxrwxrwx 1 root root 16 Apr 17 21:20 python2-config -> python2.7-config lrwxrwxrwx 1 root root 9 Apr 15 09:13 python3 -> python3.2 lrwxrwxrwx 1 root root 11 May 3 19:52 python3.2 -> python3.2mu -rwxr-xr-x 1 root root 2954048 May 3 19:52 python3.2mu lrwxrwxrwx 1 root root 11 Apr 15 09:13 python3mu -> python3.2mu lrwxrwxrwx 1 root root 16 Apr 17 21:20 python-config -> python2.7-config ___ freebsd-python@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-python To unsubscribe, send any mail to "freebsd-python-unsubscr...@freebsd.org"
Re: bin/python3 symlink for python3X ports
Dmitry Sivachenko wrote on 26.09.2012 13:14: On 26.09.2012 13:07, Ruslan Mahmatkhanov wrote: Chris Rees wrote on 26.09.2012 13:03: On 26 Sep 2012 08:13, "Dmitry Sivachenko" wrote: Hello! It is common to have both python-2 and python-3 packages installed. To help transition it is convenient to have bin/python to point to python-2 binary. Now for every X in python3X we have a bin/python3.X binary. So for every new python3.X release one should change shebang line in scripts. I propose to tweak python3X ports so they create bin/python3 symlink pointing to the installed python3.X binary so that people can always use 'python3' name. What do you think? I think it's a great idea, at least minimising weird breakage when python is updated. Have you a patch? Also, what do other OSes do? I don't have a patch but I can make one if you like. Please do. I don't use other OSes so I have no idea what do they do with that problem and I don't see any reason why should we bother... To no reinvent the wheel, for example. And because many software installers (setup.py, f.e.) are somewhat linux-centric: they looking for python2 or python3 binary (that we change to ${PYTHON_CMD} in our Makefile's). -- Regards, Ruslan Tinderboxing kills... the drives. ___ freebsd-python@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-python To unsubscribe, send any mail to "freebsd-python-unsubscr...@freebsd.org"
Re: bin/python3 symlink for python3X ports
On 26.09.2012 13:20, Ruslan Mahmatkhanov wrote: Dmitry Sivachenko wrote on 26.09.2012 13:14: I don't have a patch but I can make one if you like. Please do. Please consider the attached patch. Index: pkg-plist === --- pkg-plist (revision 304891) +++ pkg-plist (working copy) @@ -6,8 +6,10 @@ bin/pydoc3-%%PYVER%% %%IF_DEFAULT%%bin/python bin/python%%PYVER%% +bin/python%%PYMAJOR%% %%IF_DEFAULT%%bin/python-config bin/python%%PYVER%%-config +bin/python%%PYMAJOR%%-config %%IF_DEFAULT%%bin/python-shared bin/python-shared%%PYVER%% %%IF_DEFAULT%%bin/python-shared-config Index: Makefile === --- Makefile(revision 304891) +++ Makefile(working copy) @@ -7,7 +7,7 @@ PORTNAME= python32 PORTVERSION= 3.2.3 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES=lang python ipv6 MASTER_SITES= ${PYTHON_MASTER_SITES} MASTER_SITE_SUBDIR=${PYTHON_MASTER_SITE_SUBDIR} @@ -30,12 +30,14 @@ USE_PYTHON=yes PYTHON_VERSION=python3.2 +PYTHON_MAJOR= 3 PYTHON_NO_DEPENDS= yes PYABIVER= # default empty, for after appending SHARED_WRKSRC= ${PYTHON_WRKSRC}/portbld.shared PLIST_SUB= PYVER=${PYTHON_VERSION:S/python//} \ + PYMAJOR=${PYTHON_MAJOR} \ PYVER_WITHPAT=${PORTVERSION:S/.rc/rc/} \ PYABIVER=${PYABIVER} EXAMPLESDIR= ${PREFIX}/share/examples/${PYTHON_VERSION} @@ -215,6 +217,10 @@ done .endif +.for file in python python-config + cd ${LOCALBASE}/bin && ${LN} -sf ${file:S/python/${PYTHON_VERSION}/} ${file:S/python/python${PYTHON_MAJOR}/} +.endfor + .if !defined(NOPORTDATA) @${MKDIR} ${DATADIR} @cd ${PYTHON_WRKSRC}; ${TAR} -cf - Tools | \ ___ freebsd-python@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-python To unsubscribe, send any mail to "freebsd-python-unsubscr...@freebsd.org"
Re: bin/python3 symlink for python3X ports
On Wed, Sep 26, 2012 at 7:18 PM, Dmitry Sivachenko wrote: > On 26.09.2012 13:20, Ruslan Mahmatkhanov wrote: >> >> Dmitry Sivachenko wrote on 26.09.2012 13:14: >>> >>> I don't have a patch but I can make one if you like. >> >> >> Please do. >> > > Please consider the attached patch. > I think this patch is good. And I am thinking about also modifying other lang/python{2,3}X ports, thus we may need to beware of confliction on bin/python{2,3} between lang/python2X or lang/python3X ports. It is not so common but still possible to have more then one lang/python2X or lang/python3X ports installed. Maybe we can use the same logic of bin/python installation (first wins). Li-Wen -- Li-Wen Hsu http://lwhsu.org ___ freebsd-python@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-python To unsubscribe, send any mail to "freebsd-python-unsubscr...@freebsd.org"
Re: bin/python3 symlink for python3X ports
On 9/26/12 5:00 PM, Li-Wen Hsu wrote: I think this patch is good. And I am thinking about also modifying other lang/python{2,3}X ports, thus we may need to beware of confliction on bin/python{2,3} between lang/python2X or lang/python3X ports. It is not so common but still possible to have more then one lang/python2X or lang/python3X ports installed. Maybe we can use the same logic of bin/python installation (first wins). I actually dislike the current "first wins" logic. I hit that problem recently. I think this choice should be done via make.conf variable (with some default value hardcoded in bsd.python.mk). The resulting packages should not depend on the order two pythons are installed in. (probaly defaulting python -> python2.X is the proper choice). Let maintainers take the final decision and implement it though. ___ freebsd-python@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-python To unsubscribe, send any mail to "freebsd-python-unsubscr...@freebsd.org"
Re: bin/python3 symlink for python3X ports
Dmitry Sivachenko wrote on 26.09.2012 15:18: On 26.09.2012 13:20, Ruslan Mahmatkhanov wrote: Dmitry Sivachenko wrote on 26.09.2012 13:14: I don't have a patch but I can make one if you like. Please do. Please consider the attached patch. The patch seems good to me. The only thing: I'd rather define ${PYTHON_MAJOR} (or ${PYTHON_MAJOR_VER}) in bsd.python.mk to make it reusable when USE_PYTHON is used (sorry for the pun). PYTHON_MAJOR_VER=${PYTHON_VER:R} because there will be other ports that need it. And as Li-Wen said, there should be the same change for python2. And it needs an exp-run, I believe. -- Regards, Ruslan Tinderboxing kills... the drives. ___ freebsd-python@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-python To unsubscribe, send any mail to "freebsd-python-unsubscr...@freebsd.org"