aboutsummaryrefslogtreecommitdiffstats
path: root/include/prereq.mk
diff options
context:
space:
mode:
authorPetr Štetiar <ynezz@true.cz>2019-03-20 09:52:58 +0100
committerPetr Štetiar <ynezz@true.cz>2019-07-26 08:09:16 +0200
commit3b68fb57c938af3948ae4c2da61501183fbef649 (patch)
tree80b7edef9aa1cf1d443edc05739301ba99f39faa /include/prereq.mk
parent19938c8de7a062626796f53a2805608c0dd4edbd (diff)
downloadupstream-3b68fb57c938af3948ae4c2da61501183fbef649.tar.gz
upstream-3b68fb57c938af3948ae4c2da61501183fbef649.tar.bz2
upstream-3b68fb57c938af3948ae4c2da61501183fbef649.zip
build: cleanup possibly dangling Python 2 host symlink
When bumping buildroot to Python 3, we need to assure, that Python symlink in staging bin directory points to Python >= 3.5 as well. We can't rely completly just on SetupHostCommand as its executed only in cases when the $(STAGING_DIR_HOST)/bin/python doesn't already exist, so we need to remove it before running SetupHostCommand. Acked-by: Yousong Zhou <yszhou4tech@gmail.com> Signed-off-by: Petr Štetiar <ynezz@true.cz>
Diffstat (limited to 'include/prereq.mk')
-rw-r--r--include/prereq.mk12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/prereq.mk b/include/prereq.mk
index 0f0f253744..83ac21242c 100644
--- a/include/prereq.mk
+++ b/include/prereq.mk
@@ -66,6 +66,18 @@ define RequireHeader
$$(eval $$(call Require,$(1),$(2)))
endef
+define CleanupPython2
+ define Require/python2-cleanup
+ if [ -f "$(STAGING_DIR_HOST)/bin/python" ] && \
+ $(STAGING_DIR_HOST)/bin/python -V 2>&1 | \
+ grep -q 'Python 2'; then \
+ rm $(STAGING_DIR_HOST)/bin/python; \
+ fi
+ endef
+
+ $$(eval $$(call Require,python2-cleanup))
+endef
+
define QuoteHostCommand
'$(subst ','"'"',$(strip $(1)))'
endef