1 |
# $Id$ |
# $Id$ |
2 |
|
|
3 |
|
SDEPEND="${SDEPEND} |
4 |
|
>= dev-lang/python-2.7" |
5 |
|
|
6 |
# get the major.minor current installed python version |
# get the major.minor current installed python version |
7 |
# -> ex 2.4 |
# -> ex 2.4 |
8 |
get_python_version() |
get_python_version() |
9 |
{ |
{ |
10 |
# PYVER="$(python -V 2>&1 | cut -d' ' -f2 | cut -d. -f1-2)" |
local pyver |
11 |
PYVER=$(python -c "import sys ; print sys.version[:3]") |
# pyver="$(python -V 2>&1 | cut -d' ' -f2 | cut -d. -f1-2)" |
12 |
[[ -z ${PYVER} ]] && return 1 |
pyver=$(python -c "import sys ; print sys.version[:3]") |
13 |
echo "${PYVER}" |
[[ -z ${pyver} ]] && return 1 |
14 |
|
echo "${pyver}" |
15 |
return 0 |
return 0 |
16 |
} |
} |
17 |
|
|
19 |
{ |
{ |
20 |
local pylib |
local pylib |
21 |
pylib=$(python -c 'from distutils import sysconfig; print sysconfig.get_python_lib()') |
pylib=$(python -c 'from distutils import sysconfig; print sysconfig.get_python_lib()') |
22 |
|
[[ -z ${pylib} ]] && return 1 |
23 |
echo "${pylib}" |
echo "${pylib}" |
24 |
return 0 |
return 0 |
25 |
} |
} |
28 |
{ |
{ |
29 |
local pyinc |
local pyinc |
30 |
pyinc=$(python -c 'from distutils import sysconfig; print sysconfig.get_python_inc()') |
pyinc=$(python -c 'from distutils import sysconfig; print sysconfig.get_python_inc()') |
31 |
|
[[ -z ${pyinc} ]] && return 1 |
32 |
echo "${pyinc}" |
echo "${pyinc}" |
33 |
return 0 |
return 0 |
34 |
} |
} |