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

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