]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
python: properly uninstall __pycache__ in subdirectories
authorLukas Fleischer <lfleischer@lfos.de>
Thu, 30 Jan 2020 02:12:29 +0000 (18:12 -0800)
committerKarl Berry <karl@freefriends.org>
Thu, 30 Jan 2020 02:12:29 +0000 (18:12 -0800)
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.

lib/am/python.am
t/instmany-python.sh

index 09332e20b9ec3373080eac0b21bf9e83217f92e8..6346a7e5fc9f82486dd21dc41109617c86afa78b 100644 (file)
@@ -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=$$?; \
index f1f82d99029704281202b87a12180fce3cb03f3c..dce3594b51e9328b962abef03a1b0e544add4fd8 100644 (file)
@@ -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)