Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: python@g.o, "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH 3/4] python-utils-r1.eclass: python_moduleinto, allow package dot-notation
Date: Wed, 10 May 2017 14:11:33
Message-Id: 20170510140837.5245-4-mgorny@gentoo.org
In Reply to: [gentoo-dev] [PATCH] python-utils-r1, _moduleinto: doc fixup & dot-notation by "Michał Górny"
1 Allow specifying the relative package destination using the dot-notation
2 used by Python itself (e.g. 'foo.bar') in addition to the directory form
3 ('foo/bar'). Since dot can not be used in Python package names, this
4 change is backwards-compatible.
5 ---
6 eclass/python-utils-r1.eclass | 6 ++++--
7 1 file changed, 4 insertions(+), 2 deletions(-)
8
9 diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
10 index c594cb46b5f3..863051337f0b 100644
11 --- a/eclass/python-utils-r1.eclass
12 +++ b/eclass/python-utils-r1.eclass
13 @@ -810,7 +810,9 @@ python_newscript() {
14 # The <new-path> can either be an absolute target system path (in which
15 # case it needs to start with a slash, and ${ED} will be prepended to
16 # it) or relative to the implementation's site-packages directory
17 -# (then it must not start with a slash).
18 +# (then it must not start with a slash). The relative path can be
19 +# specified either using the Python package notation (separated by dots)
20 +# or the directory notation (using slashes).
21 #
22 # When not set explicitly, the modules are installed to the top
23 # site-packages directory.
24 @@ -867,7 +869,7 @@ python_domodule() {
25 local PYTHON_SITEDIR=${PYTHON_SITEDIR}
26 [[ ${PYTHON_SITEDIR} ]] || python_export PYTHON_SITEDIR
27
28 - d=${PYTHON_SITEDIR#${EPREFIX}}/${python_moduleroot}
29 + d=${PYTHON_SITEDIR#${EPREFIX}}/${python_moduleroot//.//}
30 fi
31
32 (
33 --
34 2.13.0