Skip to content

Commit

Permalink
Simplify the find expression
Browse files Browse the repository at this point in the history
The `find` expression was a bit complex to grok and it did not remove the
`__pycache__` directories. It also missed removing the C-extension tests `*.so`
files.
  • Loading branch information
RobertDeRose committed Oct 16, 2024
1 parent 8f2e9c5 commit 2d4d8c5
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions Dockerfile-linux.template
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,9 @@ RUN set -eux; \
cd /; \
rm -rf /usr/src/python; \
\
find /usr/local -depth \
\( \
\( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \
-o \( -type f -a \( -name '*.pyc' -o -name '*.pyo' -o -name 'libpython*.a' \) \) \
\) -exec rm -rf '{}' + \
; \
find /usr/local -type d \( -name test -o -name idle_test -o -name __pycache__ \) -exec rm -rf '{}' +; \
find /usr/local -type f -name libpython3*.a -delete; \
find /usr/local -type f -name *test*.so -delete; \
\
{{ if is_alpine then ( -}}
find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \
Expand Down

0 comments on commit 2d4d8c5

Please sign in to comment.