diff options
author | Stefano Lattarini <stefano.lattarini@gmail.com> | 2012-11-21 14:13:02 +0100 |
---|---|---|
committer | Stefano Lattarini <stefano.lattarini@gmail.com> | 2012-11-21 14:13:02 +0100 |
commit | cb6a19d9d0c46ddf03b2494333bed2c3d7dc1e15 (patch) | |
tree | 721527736aebfef6dc894cbf4306a565f04a3626 /lib/am | |
parent | ab49d2bc115ba121b00ac06229d4044a004f67e9 (diff) | |
parent | 8d1a542296ca5d9137644387ebe1611239e41018 (diff) | |
download | automake-cb6a19d9d0c46ddf03b2494333bed2c3d7dc1e15.tar.gz |
Merge branch 'maint'
* maint:
tests: fix a spurious failure when $PYTHON is in the environment
python tests: support PEP-3147 installation layout
python: uninstall cater to PEP-3147
tests: improve a comment
tests: honour $PYTHON override
tests: typofix in message
news: document fix for bug#8847 (PEP-3147, __pycache__)
python: improve support for modern python (CPython 3.2 and PyPy)
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Diffstat (limited to 'lib/am')
-rw-r--r-- | lib/am/python.am | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/lib/am/python.am b/lib/am/python.am index f9b7790c8..143245e87 100644 --- a/lib/am/python.am +++ b/lib/am/python.am @@ -95,19 +95,37 @@ endif %?INSTALL% ## -------------- ## if %?INSTALL% + +?FIRST?am__pep3147_tweak = \ +?FIRST? sed -e 's|\.py$$||' -e 's|[^/]*$$|__pycache__/&.*.py|' + .PHONY uninstall-am: uninstall-%DIR%PYTHON uninstall-%DIR%PYTHON: @$(NORMAL_UNINSTALL) @list='$(%DIR%_PYTHON)'; test -n "$(%NDIR%dir)" || list=; \ -?BASE? files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ -?!BASE? $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \ - test -n "$$files" || exit 0; \ +?BASE? py_files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ +?!BASE? $(am__nobase_strip_setup); py_files=`$(am__nobase_strip)`; \ + test -n "$$py_files" || exit 0; \ dir='$(DESTDIR)$(%NDIR%dir)'; \ ## Also remove the .pyc and .pyo byte compiled versions. - filesc=`echo "$$files" | sed 's|$$|c|'`; \ - fileso=`echo "$$files" | sed 's|$$|o|'`; \ +## This is somewhat tricky, because for newer pythons we have to take +## PEP-3147 into account. + pyc_files=`echo "$$py_files" | sed 's|$$|c|'`; \ + pyo_files=`echo "$$py_files" | sed 's|$$|o|'`; \ + py_files_pep3147=`echo "$$py_files" | $(am__pep3147_tweak)`; \ + echo "$$py_files_pep3147";\ + pyc_files_pep3147=`echo "$$py_files_pep3147" | sed 's|$$|c|'`; \ + pyo_files_pep3147=`echo "$$py_files_pep3147" | sed 's|$$|o|'`; \ st=0; \ - for files in "$$files" "$$filesc" "$$fileso"; do \ + for files in \ + "$$py_files" \ + "$$pyc_files" \ + "$$pyo_files" \ +## Installation of '.py' files is not influenced by PEP-3147, so it +## is correct *not* to have $pyfiles_pep3147 here. + "$$pyc_files_pep3147" \ + "$$pyo_files_pep3147" \ + ; do \ $(am__uninstall_files_from_dir) || st=$$?; \ done; \ exit $$st |