Gentoo Archives: gentoo-python

From: "Michał Górny" <mgorny@g.o>
To: gentoo-python@l.g.o
Cc: python@g.o, "Michał Górny" <mgorny@g.o>
Subject: [gentoo-python] [PATCH python-exec] Read Python2/3 choices from files rather than symlinks
Date: Sun, 15 Nov 2015 09:40:47
Message-Id: 1447580439-17877-1-git-send-email-mgorny@gentoo.org
1 The new eselect-python version has moved python[23] selection into
2 regular files, to replace /usr/bin/python[23] symlinks with python-exec.
3 Update python-exec appropriately.
4 ---
5 src/python-exec-c.c | 6 ++----
6 1 file changed, 2 insertions(+), 4 deletions(-)
7
8 [This is a followup for eselect-python changes in how python[23] choice
9 is stored.]
10
11 diff --git a/src/python-exec-c.c b/src/python-exec-c.c
12 index 8ee5dd2..a9a2f73 100644
13 --- a/src/python-exec-c.c
14 +++ b/src/python-exec-c.c
15 @@ -369,12 +369,10 @@ int main(int argc, char* argv[])
16 execute(scriptbuf, argv);
17 if (try_file(bufpy, fnpos, EPREFIX "/etc/env.d/python/config", max_epython_len))
18 execute(scriptbuf, argv);
19 -#ifdef HAVE_READLINK
20 - if (try_symlink(bufpy, fnpos, EPREFIX "/usr/bin/python2", max_epython_len))
21 + if (try_file(bufpy, fnpos, EPREFIX "/etc/env.d/python/python2", max_epython_len))
22 execute(scriptbuf, argv);
23 - if (try_symlink(bufpy, fnpos, EPREFIX "/usr/bin/python3", max_epython_len))
24 + if (try_file(bufpy, fnpos, EPREFIX "/etc/env.d/python/python3", max_epython_len))
25 execute(scriptbuf, argv);
26 -#endif
27
28 for (i = python_impls; *i; ++i)
29 {
30 --
31 2.6.3