Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 296220 - app-admin/eselect-python: Add --python2 / --python3 options
Summary: app-admin/eselect-python: Add --python2 / --python3 options
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All All
: High enhancement (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2009-12-08 17:33 UTC by Arfrever Frehtes Taifersar Arahesis (RETIRED)
Modified: 2009-12-30 22:25 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2009-12-08 17:33:01 UTC
Some scripts (called not necessarily during installation) etc. need to be able to portably and reliably get:
 - Active version of Python
 - Active version of Python 2
 - Active version of Python 3

Currently it would be achievable by checking /etc/env.d/python/config and calling `readlink /usr/bin/python2` / `readlink /usr/bin/python3`, but scripts and python.eclass shouldn't rely on knowledge about such internals of app-admin/eselect-python, so I suggest that new versions of app-admin/eselect-python install a helper script, gentoo-python-config, which will support at least the following options:
  --help
  --print-active-python-version
  --print-active-python2-version
  --print-active-python3-version

Optionally also:
  --set-active-python-version
  --set-active-python2-version
  --set-active-python3-version

(gentoo-python-config would be wrapper for `eselect python` and readlink.)

Then a script or a function in python.eclass could contain e.g.:
python2_version="$(/usr/bin/gentoo-python-config --print-active-python2-version)"
Comment 1 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2009-12-10 22:07:00 UTC
After some thinking about it, I think that it will be better to add new options to some commands of `eselect python`.
Examples:
  eselect python show --python2
  eselect python show --python3
  eselect python set --python2 ${value}
  eselect python set --python3 ${value}
Comment 2 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2009-12-26 11:19:13 UTC
Fixed in r256.
Comment 3 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2009-12-30 22:25:52 UTC
Fixed in app-admin/eselect-python-20091230.