public inbox for gentoo-python@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-python] [PATCH eselect-python 1/2] Store per-version interpreter preference in a file as well.
@ 2012-11-01 11:54 Michał Górny
  2012-11-01 11:54 ` [gentoo-python] [PATCH eselect-python 2/2] Re-set the same interpreters on 'update --if-unset' Michał Górny
       [not found] ` <CAJ0EP41Ww9GKYto8A8gX-L+D2=3+MFhYHmUZXZNvm+Ni5ApSbw@mail.gmail.com>
  0 siblings, 2 replies; 12+ messages in thread
From: Michał Górny @ 2012-11-01 11:54 UTC (permalink / raw
  To: gentoo-python; +Cc: python, Michał Górny

The idea is very simple: /etc/env.d/python/python[23] with a one-line
value similar to the main interpreter /config file.

That should be simpler & more reliable than reading a symlink. And at
some point we can replace the symlink with an $EPYTHON-aware wrapper
as well.
---
 python.eselect | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/python.eselect b/python.eselect
index f72e5cc..8d4858a 100644
--- a/python.eselect
+++ b/python.eselect
@@ -117,6 +117,10 @@ set_scripts_and_symlinks() {
 
 		pushd "${INTERPRETER_PATH}" 1> /dev/null
 
+		# store pythonX preferred interpreter in a file as well
+		echo "${target}" > "${ENV_D_PATH}/python/${target%.*}"
+
+		# create pythonX -> pythonX.Y symlink
 		ln -nfs "${target}" "${target%.*}"
 		if [[ "${SET_MAIN_ACTIVE_PYTHON_INTERPRETER}" == "1" ]]; then
 			set_python "${target}"
-- 
1.7.12.4



^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2012-11-03 21:31 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-01 11:54 [gentoo-python] [PATCH eselect-python 1/2] Store per-version interpreter preference in a file as well Michał Górny
2012-11-01 11:54 ` [gentoo-python] [PATCH eselect-python 2/2] Re-set the same interpreters on 'update --if-unset' Michał Górny
     [not found] ` <CAJ0EP41Ww9GKYto8A8gX-L+D2=3+MFhYHmUZXZNvm+Ni5ApSbw@mail.gmail.com>
2012-11-01 18:48   ` [gentoo-python] Re: [PATCH eselect-python 1/2] Store per-version interpreter preference in a file as well Mike Gilbert
2012-11-01 20:59     ` Michał Górny
2012-11-01 21:27     ` Michał Górny
2012-11-01 22:42       ` Brian Harring
2012-11-02  9:03         ` Michał Górny
2012-11-03  3:35           ` Brian Harring
2012-11-03  7:33             ` Michał Górny
2012-11-03 11:47               ` Brian Harring
2012-11-03 15:55                 ` Mike Gilbert
2012-11-03 21:31                   ` Brian Harring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox