| 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.14 2004/06/25 00:39:48 vapier Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.15 2005/02/13 14:05:54 eradicator 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. |
| … | |
… | |
| 11 | # python_version() - sets PYVER/PYVER_MAJOR/PYVER_MINOR |
11 | # python_version() - sets PYVER/PYVER_MAJOR/PYVER_MINOR |
| 12 | # python_tkinter_exists() - Checks for tkinter support in python |
12 | # python_tkinter_exists() - Checks for tkinter support in python |
| 13 | # python_mod_exists() - Checks if a python module exists |
13 | # python_mod_exists() - Checks if a python module exists |
| 14 | # python_mod_compile() - Compiles a .py file to a .pyc/.pyo |
14 | # python_mod_compile() - Compiles a .py file to a .pyc/.pyo |
| 15 | # python_mod_optimize() - Generates .pyc/.pyo precompiled scripts |
15 | # python_mod_optimize() - Generates .pyc/.pyo precompiled scripts |
| 16 | # python_mod_cleanup() - Goes through /usr/lib/python* to remove |
16 | # python_mod_cleanup() - Goes through /usr/lib*/python* to remove |
| 17 | # orphaned *.pyc *.pyo |
17 | # orphaned *.pyc *.pyo |
| 18 | # python_makesym() - Makes /usr/bin/python symlinks |
18 | # python_makesym() - Makes /usr/bin/python symlinks |
| 19 | |
19 | |
| 20 | inherit alternatives |
20 | inherit alternatives |
| 21 | |
21 | |
| … | |
… | |
| 178 | if [ $# -gt 0 ]; then |
178 | if [ $# -gt 0 ]; then |
| 179 | for path in $@; do |
179 | for path in $@; do |
| 180 | SEARCH_PATH="${SEARCH_PATH} ${myroot}/${path#/}" |
180 | SEARCH_PATH="${SEARCH_PATH} ${myroot}/${path#/}" |
| 181 | done |
181 | done |
| 182 | else |
182 | else |
| 183 | for path in ${myroot}/usr/lib/python*/site-packages; do |
183 | for path in ${myroot}/usr/lib*/python*/site-packages; do |
| 184 | SEARCH_PATH="${SEARCH_PATH} ${path}" |
184 | SEARCH_PATH="${SEARCH_PATH} ${path}" |
| 185 | done |
185 | done |
| 186 | fi |
186 | fi |
| 187 | |
187 | |
| 188 | for path in ${SEARCH_PATH}; do |
188 | for path in ${SEARCH_PATH}; do |
| … | |
… | |
| 198 | for dir in $(find ${path} -type d | sort -r); do |
198 | for dir in $(find ${path} -type d | sort -r); do |
| 199 | rmdir ${dir} 2>/dev/null |
199 | rmdir ${dir} 2>/dev/null |
| 200 | done |
200 | done |
| 201 | done |
201 | done |
| 202 | } |
202 | } |
| 203 | |
|
|
| 204 | |
|
|