summaryrefslogtreecommitdiffstats
path: root/scripts/lib
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2016-05-24 09:53:43 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2016-05-26 08:15:08 +0200
commit5b2dedffccbd34350b9c5812ca1e9bfe1dd40ee4 (patch)
tree74ae52a6c1064f902d0d113de80c53acbc643ab5 /scripts/lib
parente24d7a79ae627400cda87dc62ddf06970ec5786b (diff)
downloadptxdist-5b2dedffccbd34350b9c5812ca1e9bfe1dd40ee4.tar.gz
ptxdist-5b2dedffccbd34350b9c5812ca1e9bfe1dd40ee4.tar.xz
ptxd_make_world_install_python_cleanup: prefer *.pyc in __pycache__ over existing (packaged) *.pyc files
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'scripts/lib')
-rw-r--r--scripts/lib/ptxd_make_world_install.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/lib/ptxd_make_world_install.sh b/scripts/lib/ptxd_make_world_install.sh
index f26bdc7a1..6ce68480d 100644
--- a/scripts/lib/ptxd_make_world_install.sh
+++ b/scripts/lib/ptxd_make_world_install.sh
@@ -27,14 +27,14 @@ ptxd_make_world_install_python_cleanup() {
chmod -x "${file}"
done &&
find "${pkg_pkg_dir}" -type d -name bin -prune -o -name "*.py" -print | while read file; do
- if [ -e "${file}c" -o ! -d "$(dirname "${file}")/__pycache__" ]; then
+ if [ ! -d "$(dirname "${file}")/__pycache__" ]; then
# not python3 or already handled
continue
fi
- mv -v "$(dirname "${file}")/__pycache__/$(basename "${file%py}")"cpython-??.pyc "${file}c" || return
+ cp -v "$(dirname "${file}")/__pycache__/$(basename "${file%py}")"cpython-??.pyc "${file}c" || return
done &&
check_pipe_status &&
- find "${pkg_pkg_dir}" -type d -name __pycache__ -print0 | xargs -0 rm -vrf &&
+ find "${pkg_pkg_dir}" -type d -name __pycache__ -print0 | xargs -0 rm -rf &&
check_pipe_status ||
ptxd_bailout "Cache cleanup for Python3 packages failed!"
}