python,python3: Allow upgraded host setuptools/pip to be patched
authorJeffery To <jeffery.to@gmail.com>
Wed, 29 May 2019 17:48:29 +0000 (01:48 +0800)
committerJeffery To <jeffery.to@gmail.com>
Wed, 29 May 2019 17:48:29 +0000 (01:48 +0800)
This adds the current setuptools/pip version numbers to the indicator
files' names, which should allow upgraded versions to be patched.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
lang/python/python/Makefile
lang/python/python3/Makefile

index 20b8a1a7d87ffb224a848cbeff901041baa7f5f8..7f798ec9604c66dca82f54a86a308d0b62148cf8 100644 (file)
@@ -306,14 +306,16 @@ define Host/Install
        $(MAKE) -C $(HOST_BUILD_DIR) install
        $(INSTALL_DIR) $(HOST_PYTHON_DIR)/bin/
        $(INSTALL_BIN) $(HOST_BUILD_DIR)/Parser/pgen $(HOST_PYTHON_DIR)/bin/pgen2
-  ifeq ($(wildcard $(HOST_PYTHON_PKG_DIR)/.setuptools-patched),)
-       $(call HostPatchDir,$(HOST_PYTHON_PKG_DIR),./patches-setuptools,)
-       touch $(HOST_PYTHON_PKG_DIR)/.setuptools-patched
-  endif
-  ifeq ($(wildcard $(HOST_PYTHON_PKG_DIR)/.pip-patched),)
-       $(call HostPatchDir,$(HOST_PYTHON_PKG_DIR),./patches-pip,)
-       touch $(HOST_PYTHON_PKG_DIR)/.pip-patched
-  endif
+       $(if $(wildcard $(HOST_PYTHON_PKG_DIR)/.setuptools-patched-$(PYTHON_SETUPTOOLS_VERSION)),,
+               $(call HostPatchDir,$(HOST_PYTHON_PKG_DIR),./patches-setuptools,)
+               rm -f $(HOST_PYTHON_PKG_DIR)/.setuptools-patched-*
+               touch $(HOST_PYTHON_PKG_DIR)/.setuptools-patched-$(PYTHON_SETUPTOOLS_VERSION)
+       )
+       $(if $(wildcard $(HOST_PYTHON_PKG_DIR)/.pip-patched-$(PYTHON_PIP_VERSION)),,
+               $(call HostPatchDir,$(HOST_PYTHON_PKG_DIR),./patches-pip,)
+               rm -f $(HOST_PYTHON_PKG_DIR)/.pip-patched-*
+               touch $(HOST_PYTHON_PKG_DIR)/.pip-patched-$(PYTHON_PIP_VERSION)
+       )
 endef
 
 $(eval $(call HostBuild))
index 5b3dcf355420ca4cc115d58882dc10f1c7d283aa..0dd5a8e70f9dd9e099ffd1e3f27731969f26253a 100644 (file)
@@ -301,14 +301,16 @@ define Host/Install
        $(MAKE) -C $(HOST_BUILD_DIR) install
        $(INSTALL_DIR) $(HOST_PYTHON3_DIR)/bin/
        $(INSTALL_BIN) $(HOST_BUILD_DIR)/Parser/pgen $(HOST_PYTHON3_DIR)/bin/pgen3
-  ifeq ($(wildcard $(HOST_PYTHON3_PKG_DIR)/.setuptools-patched),)
-       $(call HostPatchDir,$(HOST_PYTHON3_PKG_DIR),./patches-setuptools,)
-       touch $(HOST_PYTHON3_PKG_DIR)/.setuptools-patched
-  endif
-  ifeq ($(wildcard $(HOST_PYTHON3_PKG_DIR)/.pip-patched),)
-       $(call HostPatchDir,$(HOST_PYTHON3_PKG_DIR),./patches-pip,)
-       touch $(HOST_PYTHON3_PKG_DIR)/.pip-patched
-  endif
+       $(if $(wildcard $(HOST_PYTHON3_PKG_DIR)/.setuptools-patched-$(PYTHON3_SETUPTOOLS_VERSION)),,
+               $(call HostPatchDir,$(HOST_PYTHON3_PKG_DIR),./patches-setuptools,)
+               rm -f $(HOST_PYTHON3_PKG_DIR)/.setuptools-patched-*
+               touch $(HOST_PYTHON3_PKG_DIR)/.setuptools-patched-$(PYTHON3_SETUPTOOLS_VERSION)
+       )
+       $(if $(wildcard $(HOST_PYTHON3_PKG_DIR)/.pip-patched-$(PYTHON3_PIP_VERSION)),,
+               $(call HostPatchDir,$(HOST_PYTHON3_PKG_DIR),./patches-pip,)
+               rm -f $(HOST_PYTHON3_PKG_DIR)/.pip-patched-*
+               touch $(HOST_PYTHON3_PKG_DIR)/.pip-patched-$(PYTHON3_PIP_VERSION)
+       )
 endef
 
 $(eval $(call HostBuild))