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>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user