Mailing List Archive

[PATCH 02/28] python-utils-r1.eclass: Use 'dosym -r' in EAPI 8
Signed-off-by: Micha? Górny <mgorny@gentoo.org>
---
eclass/python-utils-r1.eclass | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index bab4be0f521d..e164b9c20eb9 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -544,6 +544,8 @@ python_get_scriptdir() {
_python_ln_rel() {
debug-print-function ${FUNCNAME} "${@}"

+ [[ ${EAPI} == [67] ]] || die "${FUNCNAME} banned in EAPI ${EAPI}"
+
local target=${1}
local symname=${2}

@@ -712,8 +714,13 @@ python_newexe() {
)

# install the wrapper
- _python_ln_rel "${ED%/}"/usr/lib/python-exec/python-exec2 \
- "${ED%/}/${wrapd}/${newfn}" || die
+ if [[ ${EAPI} != [67] ]]; then
+ dosym -r /usr/lib/python-exec/python-exec2 \
+ "${wrapd}/${newfn}"
+ else
+ _python_ln_rel "${ED%/}"/usr/lib/python-exec/python-exec2 \
+ "${ED%/}/${wrapd}/${newfn}" || die
+ fi

# don't use this at home, just call python_doscript() instead
if [[ ${_PYTHON_REWRITE_SHEBANG} ]]; then
--
2.32.0
Re: [PATCH 02/28] python-utils-r1.eclass: Use 'dosym -r' in EAPI 8 [ In reply to ]
>>>>> On Sun, 20 Jun 2021, Micha? Górny wrote:

> @@ -712,8 +714,13 @@ python_newexe() {
> )
>
> # install the wrapper
> - _python_ln_rel "${ED%/}"/usr/lib/python-exec/python-exec2 \
> - "${ED%/}/${wrapd}/${newfn}" || die
> + if [[ ${EAPI} != [67] ]]; then
> + dosym -r /usr/lib/python-exec/python-exec2 \
> + "${wrapd}/${newfn}"
> + else
> + _python_ln_rel "${ED%/}"/usr/lib/python-exec/python-exec2 \
> + "${ED%/}/${wrapd}/${newfn}" || die
> + fi

Wouldn't it be cleaner to inherit eapi8-dosym.eclass in EAPIs 6 and 7
instead? Then dosym -r could be used unconditionally, and function
_python_ln_rel could be dropped altogether?

Same for python-r1.eclass (patch 20/28) and distutils-r1.eclass
(patch 27/28).

Ulrich
Re: [PATCH 02/28] python-utils-r1.eclass: Use 'dosym -r' in EAPI 8 [ In reply to ]
On Sun, 2021-06-20 at 14:48 +0200, Ulrich Mueller wrote:
> > > > > > On Sun, 20 Jun 2021, Micha? Górny wrote:
>
> > @@ -712,8 +714,13 @@ python_newexe() {
> >   )
> >  
> >   # install the wrapper
> > - _python_ln_rel "${ED%/}"/usr/lib/python-exec/python-exec2 \
> > - "${ED%/}/${wrapd}/${newfn}" || die
> > + if [[ ${EAPI} != [67] ]]; then
> > + dosym -r /usr/lib/python-exec/python-exec2 \
> > + "${wrapd}/${newfn}"
> > + else
> > + _python_ln_rel "${ED%/}"/usr/lib/python-
> > exec/python-exec2 \
> > + "${ED%/}/${wrapd}/${newfn}" || die
> > + fi
>
> Wouldn't it be cleaner to inherit eapi8-dosym.eclass in EAPIs 6 and 7
> instead? Then dosym -r could be used unconditionally, and function
> _python_ln_rel could be dropped altogether?
>
> Same for python-r1.eclass (patch 20/28) and distutils-r1.eclass
> (patch 27/28).

Hmm, I suppose that makes sense. Thanks!

--
Best regards,
Micha? Górny