Gentoo Archives: gentoo-commits

From: "Arfrever Frehtes Taifersar Arahesis (arfrever)" <arfrever@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in eclass: distutils.eclass
Date: Fri, 11 Sep 2009 12:24:31
Message-Id: E1Mm5Az-00015m-GL@stork.gentoo.org
1 arfrever 09/09/11 12:24:29
2
3 Modified: distutils.eclass
4 Log:
5 Fix detection of ez_setup in distutils_src_prepare(). Improve distutils_pkg_postinst() and distutils_pkg_postrm().
6
7 Revision Changes Path
8 1.63 eclass/distutils.eclass
9
10 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.63&view=markup
11 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.63&content-type=text/plain
12 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?r1=1.62&r2=1.63
13
14 Index: distutils.eclass
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v
17 retrieving revision 1.62
18 retrieving revision 1.63
19 diff -u -r1.62 -r1.63
20 --- distutils.eclass 9 Sep 2009 19:26:00 -0000 1.62
21 +++ distutils.eclass 11 Sep 2009 12:24:29 -0000 1.63
22 @@ -1,6 +1,6 @@
23 # Copyright 1999-2009 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.62 2009/09/09 19:26:00 arfrever Exp $
26 +# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.63 2009/09/11 12:24:29 arfrever Exp $
27
28 # @ECLASS: distutils.eclass
29 # @MAINTAINER:
30 @@ -66,10 +66,10 @@
31
32 # Delete ez_setup files to prevent packages from installing
33 # setuptools on their own.
34 - local ez_setup_py_existence
35 - [[ -f ez_setup.py ]] && ez_setup_py_existence="1"
36 + local ez_setup_existence
37 + [[ -d ez_setup || -f ez_setup.py ]] && ez_setup_existence="1"
38 rm -fr ez_setup*
39 - if [[ "${ez_setup_py_existence}" == "1" ]]; then
40 + if [[ "${ez_setup_existence}" == "1" ]]; then
41 echo "def use_setuptools(*args, **kwargs): pass" > ez_setup.py
42 fi
43
44 @@ -174,12 +174,13 @@
45 fi
46 }
47
48 -# @FUNCTION: distutils_pkg_postrm
49 +# @FUNCTION: distutils_pkg_postinst
50 # @DESCRIPTION:
51 -# Generic pyc/pyo cleanup script. This function is exported.
52 -distutils_pkg_postrm() {
53 - if [[ "${EBUILD_PHASE}" != "postrm" ]]; then
54 - die "${FUNCNAME}() can be used only in pkg_postrm() phase"
55 +# This is a generic optimization, you should override it if your package
56 +# installs modules in another directory. This function is exported.
57 +distutils_pkg_postinst() {
58 + if [[ "${EBUILD_PHASE}" != "postinst" ]]; then
59 + die "${FUNCNAME}() can be used only in pkg_postinst() phase"
60 fi
61
62 local pylibdir pymod
63 @@ -191,30 +192,23 @@
64 done
65 fi
66
67 - if [[ -n "${PYTHON_MODNAME}" ]]; then
68 + if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
69 for pymod in ${PYTHON_MODNAME}; do
70 - for pylibdir in "${ROOT}"/usr/$(get_libdir)/python*; do
71 - if [[ -d "${pylibdir}/site-packages/${pymod}" ]]; then
72 - if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
73 - python_mod_cleanup "${pymod}"
74 - else
75 - python_mod_cleanup "${pylibdir#${ROOT}}/site-packages/${pymod}"
76 - fi
77 - fi
78 - done
79 + python_mod_optimize "${pymod}"
80 done
81 else
82 - python_mod_cleanup
83 + for pymod in ${PYTHON_MODNAME}; do
84 + python_mod_optimize "$(python_get_sitedir)/${pymod}"
85 + done
86 fi
87 }
88
89 -# @FUNCTION: distutils_pkg_postinst
90 +# @FUNCTION: distutils_pkg_postrm
91 # @DESCRIPTION:
92 -# This is a generic optimization, you should override it if your package
93 -# installs modules in another directory. This function is exported.
94 -distutils_pkg_postinst() {
95 - if [[ "${EBUILD_PHASE}" != "postinst" ]]; then
96 - die "${FUNCNAME}() can be used only in pkg_postinst() phase"
97 +# Generic pyc/pyo cleanup script. This function is exported.
98 +distutils_pkg_postrm() {
99 + if [[ "${EBUILD_PHASE}" != "postrm" ]]; then
100 + die "${FUNCNAME}() can be used only in pkg_postrm() phase"
101 fi
102
103 local pylibdir pymod
104 @@ -226,15 +220,20 @@
105 done
106 fi
107
108 - if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
109 + if [[ -n "${PYTHON_MODNAME}" ]]; then
110 for pymod in ${PYTHON_MODNAME}; do
111 - python_mod_optimize "${pymod}"
112 + if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
113 + python_mod_cleanup "${pymod}"
114 + else
115 + for pylibdir in "${ROOT}"/usr/$(get_libdir)/python*; do
116 + if [[ -d "${pylibdir}/site-packages/${pymod}" ]]; then
117 + python_mod_cleanup "${pylibdir#${ROOT}}/site-packages/${pymod}"
118 + fi
119 + done
120 + fi
121 done
122 else
123 - python_version
124 - for pymod in ${PYTHON_MODNAME}; do
125 - python_mod_optimize "/usr/$(get_libdir)/python${PYVER}/site-packages/${pymod}"
126 - done
127 + python_mod_cleanup
128 fi
129 }