summaryrefslogtreecommitdiff
blob: 545544d89feb369b40948d17d91a6b2d41f42910 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From: Lukas Fleischer
Subject: python: Properly uninstall __pycache__ in subdirectories
Date: Sun, 20 May 2018 17:28:51 +0200

When uninstalling __pycache__ files in a subdirectory "sub", the
Makefile incorrectly removed the files from __pycache__/sub/ instead of
sub/__pycache__/.

* lib/am/python.am (uninstall-%DIR%PYTHON): Use the correct path when
uninstalling byte-compiled files installed in '__pycache__'
subdirectories.

Source: https://lists.gnu.org/archive/html/automake-patches/2018-05/msg00000.html
Reviewed-by: Andreas K. Hüttel <dilfridge@gentoo.org>
---
 lib/am/python.am | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -ruN automake-1.16.1.orig/lib/am/python.am automake-1.16.1/lib/am/python.am
--- automake-1.16.1.orig/lib/am/python.am	2018-02-26 21:38:27.000000000 +0100
+++ automake-1.16.1/lib/am/python.am	2020-01-19 05:35:01.212177206 +0100
@@ -97,7 +97,7 @@
 if %?INSTALL%
 
 ?FIRST?am__pep3147_tweak = \
-?FIRST?  sed -e 's|\.py$$||' -e 's|[^/]*$$|&.*.pyc\n&.*.pyo|'
+?FIRST?  sed -e 's|\.py$$||' -e 's|[^/]*$$|__pycache__/&.*.pyc\n__pycache__/&.*.pyo|'
 
 .PHONY uninstall-am: uninstall-%DIR%PYTHON
 uninstall-%DIR%PYTHON:
@@ -116,7 +116,7 @@
 	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=$$?; \