All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-python2][PATCH 1/1] python: use update-alternatives for python link
@ 2021-07-06 18:18 Joe Slater
  2021-07-09 12:07 ` [oe] " Martin Jansa
  0 siblings, 1 reply; 4+ messages in thread
From: Joe Slater @ 2021-07-06 18:18 UTC (permalink / raw)
  To: openembedded-devel; +Cc: joe.slater, randy.macleod

Make the link of python to python2.7 an alternative.  This
allows python3 to provide a link if we are not around, but
makes our link override any python3 provides, assuming he
uses the default priority.

Signed-off-by: Joe Slater <joe.slater@windriver.com>
---
 recipes-devtools/python/python_2.7.18.bb | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/recipes-devtools/python/python_2.7.18.bb b/recipes-devtools/python/python_2.7.18.bb
index 7350562..3faf154 100644
--- a/recipes-devtools/python/python_2.7.18.bb
+++ b/recipes-devtools/python/python_2.7.18.bb
@@ -34,7 +34,14 @@ SRC_URI += " \
 
 S = "${WORKDIR}/Python-${PV}"
 
-inherit autotools multilib_header python-dir pythonnative ptest
+inherit autotools multilib_header python-dir pythonnative ptest update-alternatives
+
+# Make 'python' an alternative so that if python3 also provides it, we will be the default.
+#
+ALTERNATIVE_${PN}-core = "python"
+ALTERNATIVE_LINK_NAME[python] = "${bindir}/python"
+ALTERNATIVE_TARGET[python] = "${bindir}/python${PYTHON_MAJMIN}"
+ALTERNATIVE_PRIORITY[python] = "50"
 
 EXTRA_OECONF += "--with-system-ffi"
 
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-07-20 13:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-06 18:18 [meta-python2][PATCH 1/1] python: use update-alternatives for python link Joe Slater
2021-07-09 12:07 ` [oe] " Martin Jansa
2021-07-19 21:45   ` Joe Slater
2021-07-20 13:40     ` Martin Jansa

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.