| 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.30 2007/02/03 00:18:52 kloeri Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.31 2007/02/03 02:10:23 kloeri 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. |
| … | |
… | |
| 215 | done |
215 | done |
| 216 | fi |
216 | fi |
| 217 | |
217 | |
| 218 | for path in ${SEARCH_PATH}; do |
218 | for path in ${SEARCH_PATH}; do |
| 219 | einfo "Cleaning orphaned Python bytecode from ${path} .." |
219 | einfo "Cleaning orphaned Python bytecode from ${path} .." |
| 220 | for obj in $(find ${path} -name *.pyc); do |
220 | for obj in $(find ${path} -name *.py[co]); do |
| 221 | src_py="${obj%c}" |
221 | src_py="${obj%[co]}" |
| 222 | if [ ! -f "${src_py}" ]; then |
222 | if [ ! -f "${src_py}" ]; then |
| 223 | einfo "Purging ${src_py}[co]" |
223 | einfo "Purging ${src_py}[co]" |
| 224 | rm -f ${src_py}[co] |
224 | rm -f ${src_py}[co] |
| 225 | fi |
225 | fi |
| 226 | done |
226 | done |