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

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