Blame SOURCES/automake-1.16-pep3147-tweak-fix.patch

979a31
diff --git a/lib/am/python.am b/lib/am/python.am
979a31
index 21e6f842c..e29ecfcd0 100644
979a31
--- a/lib/am/python.am
979a31
+++ b/lib/am/python.am
979a31
@@ -97,7 +97,7 @@ endif %?INSTALL%
979a31
 if %?INSTALL%
979a31
 
979a31
 ?FIRST?am__pep3147_tweak = \
979a31
-?FIRST?  sed -e 's|\.py$$||' -e 's|[^/]*$$|&.*.pyc\n&.*.pyo|'
979a31
+?FIRST?  sed -e 's|\.py$$||' -e 's|[^/]*$$|__pycache__/&.*.py|'
979a31
 
979a31
 .PHONY uninstall-am: uninstall-%DIR%PYTHON
979a31
 uninstall-%DIR%PYTHON:
979a31
@@ -108,19 +108,26 @@ uninstall-%DIR%PYTHON:
979a31
 	test -n "$$py_files" || exit 0; \
979a31
 	dir='$(DESTDIR)$(%NDIR%dir)'; \
979a31
 ## Also remove the .pyc and .pyo byte compiled versions.
979a31
+## This is somewhat tricky, because for newer pythons we have to take
979a31
+## PEP-3147 into account.
979a31
 	pyc_files=`echo "$$py_files" | sed 's|$$|c|'`; \
979a31
 	pyo_files=`echo "$$py_files" | sed 's|$$|o|'`; \
979a31
+	py_files_pep3147=`echo "$$py_files" | $(am__pep3147_tweak)`; \
979a31
+	echo "$$py_files_pep3147";\
979a31
+	pyc_files_pep3147=`echo "$$py_files_pep3147" | sed 's|$$|c|'`; \
979a31
+	pyo_files_pep3147=`echo "$$py_files_pep3147" | sed 's|$$|o|'`; \
979a31
 	st=0; \
979a31
-	for files in "$$py_files" "$$pyc_files" "$$pyo_files"; do \
979a31
+	for files in \
979a31
+	  "$$py_files" \
979a31
+	  "$$pyc_files" \
979a31
+	  "$$pyo_files" \
979a31
+## Installation of '.py' files is not influenced by PEP-3147, so it
979a31
+## is correct *not* to have $pyfiles_pep3147 here.
979a31
+	  "$$pyc_files_pep3147" \
979a31
+	  "$$pyo_files_pep3147" \
979a31
+	; do \
979a31
 	  $(am__uninstall_files_from_dir) || st=$$?; \
979a31
 	done; \
979a31
-## This is somewhat tricky, because for newer pythons we have to take PEP-3147
979a31
-## into account.  Avoid exceeding the command-line length limit.
979a31
-	dir='$(DESTDIR)$(%NDIR%dir)/__pycache__'; \
979a31
-	echo "$$py_files" | $(am__pep3147_tweak) | $(am__base_list) | \
979a31
-	  while read files; do \
979a31
-	    $(am__uninstall_files_from_dir) || st=$$?; \
979a31
-	  done || exit $$?; \
979a31
 	exit $$st
979a31
 endif %?INSTALL%
979a31