summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@lfos.de>2020-01-29 18:12:29 -0800
committerKarl Berry <karl@freefriends.org>2020-01-29 18:12:29 -0800
commit6207236f9bf29dc84b892e482439591b5cf9603b (patch)
tree5f95aaa9b8497daaf67840f12da78b79effc8bd2
parentb279a0d46dfeca1ca40057c3c910ab1657d60be5 (diff)
downloadautomake-6207236f9bf29dc84b892e482439591b5cf9603b.tar.gz
python: properly uninstall __pycache__ in subdirectories
This change finishes fixing automake bug#32088: https://debbugs.gnu.org/32088 * lib/am/python.am (uninstall-%DIR%PYTHON): Uninstall byte-compiled files in a '__pycache__' subdirectory from sub/__pycache__/, not __pycache__/sub/. (am__pep3147_tweak): prefix __pycache__ here, for both .pyc and .pyo. https://lists.gnu.org/archive/html/automake-patches/2018-05/msg00000.html * t/instmany-python.sh (limit): increase to 4500, following Andreas Huettel, https://debbugs.gnu.org/32088#11.
-rw-r--r--lib/am/python.am4
-rw-r--r--t/instmany-python.sh2
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/am/python.am b/lib/am/python.am
index 09332e20b..6346a7e5f 100644
--- a/lib/am/python.am
+++ b/lib/am/python.am
@@ -97,7 +97,7 @@ endif %?INSTALL%
if %?INSTALL%
?FIRST?am__pep3147_tweak = \
-?FIRST? sed -e 's|\.py$$||' -e 's|[^/]*$$|&.*.pyc &.*.pyo|'
+?FIRST? sed -e 's|\.py$$||' -e 's|[^/]*$$|__pycache__/&.*.pyc __pycache__/&.*.pyo|'
.PHONY uninstall-am: uninstall-%DIR%PYTHON
uninstall-%DIR%PYTHON:
@@ -116,7 +116,7 @@ uninstall-%DIR%PYTHON:
done; \
## This is somewhat tricky, because for newer pythons we have to take PEP-3147
## into account. Avoid exceeding the command-line length limit.
- dir='$(DESTDIR)$(%NDIR%dir)/__pycache__'; \
+ dir='$(DESTDIR)$(%NDIR%dir)'; \
echo "$$py_files" | $(am__pep3147_tweak) | $(am__base_list) | \
while read files; do \
$(am__uninstall_files_from_dir) || st=$$?; \
diff --git a/t/instmany-python.sh b/t/instmany-python.sh
index f1f82d990..dce3594b5 100644
--- a/t/instmany-python.sh
+++ b/t/instmany-python.sh
@@ -21,7 +21,7 @@
required='python'
. test-init.sh
-limit=2500
+limit=4500
subdir=long_subdir_name_with_many_characters
nfiles=81
list=$(seq_ 1 $nfiles)