Gentoo Archives: gentoo-commits

From: "Ali Polatel (hawking)" <hawking@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in eclass: python.eclass
Date: Thu, 29 May 2008 15:24:42
Message-Id: E1K1jzX-0000nZ-Hf@stork.gentoo.org
1 hawking 08/05/29 15:24:35
2
3 Modified: python.eclass
4 Log:
5 Make python_mod_optimize ROOT aware.
6
7 Revision Changes Path
8 1.36 eclass/python.eclass
9
10 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/python.eclass?rev=1.36&view=markup
11 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/python.eclass?rev=1.36&content-type=text/plain
12 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/python.eclass?r1=1.35&r2=1.36
13
14 Index: python.eclass
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo-x86/eclass/python.eclass,v
17 retrieving revision 1.35
18 retrieving revision 1.36
19 diff -u -r1.35 -r1.36
20 --- python.eclass 29 May 2008 14:10:48 -0000 1.35
21 +++ python.eclass 29 May 2008 15:24:35 -0000 1.36
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/python.eclass,v 1.35 2008/05/29 14:10:48 hawking Exp $
26 +# $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.36 2008/05/29 15:24:35 hawking Exp $
27
28 # @ECLASS: python.eclass
29 # @MAINTAINER:
30 @@ -168,12 +168,20 @@
31 # in the supplied directory
32 #
33 # Example:
34 -# python_mod_optimize ${ROOT}usr/share/codegen
35 +# python_mod_optimize /usr/share/codegen
36 python_mod_optimize() {
37 - local myroot
38 + local mydirs myfiles myroot path
39 # strip trailing slash
40 myroot="${ROOT%/}"
41
42 + # respect ROOT
43 + for path in $@; do
44 + [ ! -e "${myroot}/${path}" ] && ewarn "${myroot}/${path} doesn't exist!"
45 + [ -d "${myroot}/${path#/}" ] && mydirs="${mydirs} ${myroot}/${path#/}"
46 + # Files are passed to python_mod_compile which is ROOT-aware
47 + [ -f "${myroot}/${path}" ] && myfiles="${myfiles} ${path}"
48 + done
49 +
50 # allow compiling for older python versions
51 if [ -n "${PYTHON_OVERRIDE_PYVER}" ]; then
52 PYVER=${PYTHON_OVERRIDE_PYVER}
53 @@ -189,8 +197,19 @@
54 fi
55
56 ebegin "Byte compiling python modules for python-${PYVER} .."
57 - python${PYVER} ${myroot}/usr/$(get_libdir)/python${PYVER}/compileall.py ${compileopts} $@
58 - python${PYVER} -O ${myroot}/usr/$(get_libdir)/python${PYVER}/compileall.py ${compileopts} $@
59 + if [ -n "${mydirs}" ]; then
60 + python${PYVER} \
61 + ${myroot}/usr/$(get_libdir)/python${PYVER}/compileall.py \
62 + ${compileopts} ${mydirs}
63 + python${PYVER} -O \
64 + ${myroot}/usr/$(get_libdir)/python${PYVER}/compileall.py \
65 + ${compileopts} ${mydirs}
66 + fi
67 +
68 + if [ -n "${myfiles}" ]; then
69 + python_mod_compile ${myfiles}
70 + fi
71 +
72 eend $?
73 }
74
75
76
77
78 --
79 gentoo-commits@l.g.o mailing list