From ae845a260c9d84f60499bed968a66a467679e199 Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Thu, 29 Jun 2023 15:27:40 +0800 Subject: python: Rework filespec install script * Support wildcards in install (`+`) paths * Add fourth parameter to set directory permissions If file permissions are given (third parameter), these will now apply to files only. * Add non-recursive set permissions command (`==`) * Be more strict about filespec format Blank lines and lines starting with `#` will be ignored. Other errors (unknown command, missing path parameter, etc.) will cause the script to exit. * Be more strict about ensuring paths exist for all commands * Avoid spawning subshells This also removes outdated filespec paths in the python3 package; these paths delete files that are no longer present. Signed-off-by: Jeffery To (cherry picked from commit 2ffb87726b93ffd73a5291d6db1bc3d13fbcde17) --- lang/python/python3/Makefile | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'lang/python/python3') diff --git a/lang/python/python3/Makefile b/lang/python/python3/Makefile index 45d14379c..304e24304 100644 --- a/lang/python/python3/Makefile +++ b/lang/python/python3/Makefile @@ -121,13 +121,15 @@ define Py3BasePackage PYTHON3_PACKAGES_DEPENDS+=$(1) endif PYTHON3_LIB_FILES_DEL+=$(2) - define Py3Package/$(1)/filespec - ifneq ($(2),) - $(subst $(space),$(newline),$(foreach lib_file,$(2),+|$(lib_file))) - -|/usr/lib/python$(PYTHON3_VERSION)/*/test - -|/usr/lib/python$(PYTHON3_VERSION)/*/tests - endif - endef + ifeq ($(2),) + Py3Package/$(1)/filespec= + else + define Py3Package/$(1)/filespec + $(foreach lib_file,$(2), + +|$(lib_file) + ) + endef + endif Py3Package/$(1)/install?=: endef @@ -240,24 +242,22 @@ PYTHON3_LIB_FILES_DEL+=$(PYTHON3_BASE_LIB_FILES) define Py3Package/python3-base/filespec +|/usr/bin/python$(PYTHON3_VERSION) -$(subst $(space),$(newline),$(foreach lib_file,$(PYTHON3_BASE_LIB_FILES),+|$(lib_file))) +$(foreach lib_file,$(PYTHON3_BASE_LIB_FILES), + +|$(lib_file) +) endef define Py3Package/python3-light/filespec +|/usr/lib/python$(PYTHON3_VERSION) -|/usr/lib/python$(PYTHON3_VERSION)/distutils/cygwinccompiler.py --|/usr/lib/python$(PYTHON3_VERSION)/distutils/command/wininst* -|/usr/lib/python$(PYTHON3_VERSION)/idlelib -|/usr/lib/python$(PYTHON3_VERSION)/tkinter -|/usr/lib/python$(PYTHON3_VERSION)/turtledemo --|/usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_test*.so --|/usr/lib/python$(PYTHON3_VERSION)/pdb.doc --|/usr/lib/python$(PYTHON3_VERSION)/test -|/usr/lib/python$(PYTHON3_VERSION)/webbrowser.py --|/usr/lib/python$(PYTHON3_VERSION)/*/test --|/usr/lib/python$(PYTHON3_VERSION)/*/tests -|/usr/lib/python$(PYTHON3_VERSION)/_osx_support.py -$(subst $(space),$(newline),$(foreach lib_file,$(PYTHON3_LIB_FILES_DEL),-|$(lib_file))) +$(foreach lib_file,$(filter /usr/lib/python$(PYTHON3_VERSION)/%,$(PYTHON3_LIB_FILES_DEL)), + -|$(lib_file) +) endef define Package/libpython3/install -- cgit