diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2015-10-23 14:32:25 +0200 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2015-10-27 11:11:01 +0100 |
commit | 745bac6697bd8f5a0547467de908c7cee8d0362e (patch) | |
tree | f78592b2a2874882169aa4d6a3c2cd01a5c83a5e /scripts | |
parent | edfb6917affca03768de321cb46591826bc8973a (diff) | |
download | ptxdist-745bac6697bd8f5a0547467de908c7cee8d0362e.tar.gz ptxdist-745bac6697bd8f5a0547467de908c7cee8d0362e.tar.xz |
ptxd_make_world_install_python_cleanup: fix race condition
If the while loop returns early, then 'find' can fail with a 'broken pipe'
error.
Add an error message to indicate the origin of the failure.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/lib/ptxd_make_world_install.sh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/lib/ptxd_make_world_install.sh b/scripts/lib/ptxd_make_world_install.sh index 09eebd941..e4db1e8fb 100644 --- a/scripts/lib/ptxd_make_world_install.sh +++ b/scripts/lib/ptxd_make_world_install.sh @@ -25,13 +25,14 @@ ptxd_make_world_install_python_cleanup() { 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 # not python3 or already handled - return + continue fi mv -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 && - check_pipe_status + check_pipe_status || + ptxd_bailout "Cache cleanup for Python3 packages failed!" } export -f ptxd_make_world_install_python_cleanup |