1 |
hawking 08/10/28 21:29:28 |
2 |
|
3 |
Modified: distutils.eclass |
4 |
Log: |
5 |
fix distutils_pkg_post{inst,rm}. |
6 |
|
7 |
Revision Changes Path |
8 |
1.54 eclass/distutils.eclass |
9 |
|
10 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.54&view=markup |
11 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.54&content-type=text/plain |
12 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?r1=1.53&r2=1.54 |
13 |
|
14 |
Index: distutils.eclass |
15 |
=================================================================== |
16 |
RCS file: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v |
17 |
retrieving revision 1.53 |
18 |
retrieving revision 1.54 |
19 |
diff -u -r1.53 -r1.54 |
20 |
--- distutils.eclass 27 Oct 2008 00:19:46 -0000 1.53 |
21 |
+++ distutils.eclass 28 Oct 2008 21:29:28 -0000 1.54 |
22 |
@@ -1,6 +1,6 @@ |
23 |
# Copyright 1999-2008 Gentoo Foundation |
24 |
# Distributed under the terms of the GNU General Public License v2 |
25 |
-# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.53 2008/10/27 00:19:46 hawking Exp $ |
26 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.54 2008/10/28 21:29:28 hawking Exp $ |
27 |
|
28 |
# @ECLASS: distutils.eclass |
29 |
# @MAINTAINER: |
30 |
@@ -95,17 +95,23 @@ |
31 |
# @DESCRIPTION: |
32 |
# Generic pyc/pyo cleanup script. This function is exported. |
33 |
distutils_pkg_postrm() { |
34 |
- if [ -z "${PYTHON_MODNAME}" ] && \ |
35 |
- [ -d ${ROOT}/usr/$(get_libdir)/python*/site-packages/${PN} ]; then |
36 |
- PYTHON_MODNAME=${PN} |
37 |
+ local moddir pylibdir pymod |
38 |
+ if [[ -z "${PYTHON_MODNAME}" ]]; then |
39 |
+ for pylibdir in "${ROOT}"/usr/$(get_libdir)/python*; do |
40 |
+ if [[ -d "${pylibdir}"/site-packages/${PN} ]]; then |
41 |
+ PYTHON_MODNAME=${PN} |
42 |
+ fi |
43 |
+ done |
44 |
fi |
45 |
|
46 |
if has_version ">=dev-lang/python-2.3"; then |
47 |
ebegin "Performing Python Module Cleanup .." |
48 |
- if [ -n "${PYTHON_MODNAME}" ]; then |
49 |
+ if [[ -n "${PYTHON_MODNAME}" ]]; then |
50 |
for pymod in ${PYTHON_MODNAME}; do |
51 |
- for moddir in "`ls -d --color=none -1 ${ROOT}usr/$(get_libdir)/python*/site-packages/${pymod} 2> /dev/null`"; do |
52 |
- python_mod_cleanup ${moddir} |
53 |
+ for pylibdir in "${ROOT}"/usr/$(get_libdir)/python*; do |
54 |
+ if [[ -d "${pylibdir}"/site-packages/${pymod} ]]; then |
55 |
+ python_mod_cleanup "${pylibdir#${ROOT}}"/site-packages/${pymod} |
56 |
+ fi |
57 |
done |
58 |
done |
59 |
else |
60 |
@@ -120,9 +126,13 @@ |
61 |
# This is a generic optimization, you should override it if your package |
62 |
# installs things in another directory. This function is exported |
63 |
distutils_pkg_postinst() { |
64 |
- if [ -z "${PYTHON_MODNAME}" ] && \ |
65 |
- [ -d ${ROOT}/usr/$(get_libdir)/python*/site-packages/${PN} ]; then |
66 |
- PYTHON_MODNAME=${PN} |
67 |
+ local pylibdir pymod |
68 |
+ if [[ -z "${PYTHON_MODNAME}" ]]; then |
69 |
+ for pylibdir in "${ROOT}"/usr/$(get_libdir)/python*; do |
70 |
+ if [[ -d "${pylibdir}"/site-packages/${PN} ]]; then |
71 |
+ PYTHON_MODNAME=${PN} |
72 |
+ fi |
73 |
+ done |
74 |
fi |
75 |
|
76 |
if has_version ">=dev-lang/python-2.3"; then |