| 1 | # Copyright 1999-2004 Gentoo Foundation |
1 | # Copyright 1999-2004 Gentoo Foundation |
| 2 | # Distributed under the terms of the GNU General Public License v2 |
2 | # Distributed under the terms of the GNU General Public License v2 |
| 3 | # $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.16 2005/04/20 15:43:37 liquidx Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.17 2005/04/23 03:40:10 pythonhead Exp $ |
| 4 | # |
4 | # |
| 5 | # Author: Alastair Tse <liquidx@gentoo.org> |
5 | # Author: Alastair Tse <liquidx@gentoo.org> |
| 6 | # |
6 | # |
| 7 | # A Utility Eclass that should be inherited by anything that deals with |
7 | # A Utility Eclass that should be inherited by anything that deals with |
| 8 | # Python or Python modules. |
8 | # Python or Python modules. |
| … | |
… | |
| 48 | python_version() { |
48 | python_version() { |
| 49 | local tmpstr |
49 | local tmpstr |
| 50 | python=${python:-/usr/bin/python} |
50 | python=${python:-/usr/bin/python} |
| 51 | tmpstr="$(${python} -V 2>&1 )" |
51 | tmpstr="$(${python} -V 2>&1 )" |
| 52 | export PYVER_ALL="${tmpstr#Python }" |
52 | export PYVER_ALL="${tmpstr#Python }" |
| 53 | |
53 | export PYVER_MAJOR=$(echo ${PYVER_ALL} | cut -d. -f1) |
| 54 | export PYVER="${PYVER_ALL%.*}" |
54 | export PYVER_MINOR=$(echo ${PYVER_ALL} | cut -d. -f2) |
| 55 | export PYVER_MAJOR="${PYVER%.*}" |
55 | export PYVER_MICRO=$(echo ${PYVER_ALL} | cut -d. -f3-) |
| 56 | export PYVER_MINOR="${PYVER##*.}" |
56 | export PYVER="${PYVER_MAJOR}.${PYVER_MINOR}" |
| 57 | export PYVER_MICRO="${PYVER_ALL##*.}" |
|
|
| 58 | } |
57 | } |
| 59 | |
58 | |
| 60 | # |
59 | # |
| 61 | # name: python_makesym |
60 | # name: python_makesym |
| 62 | # desc: run without arguments, it will create the /usr/bin/python symlinks |
61 | # desc: run without arguments, it will create the /usr/bin/python symlinks |