1
0
mirror of https://github.com/home-assistant/supervisor.git synced 2025-12-20 02:18:59 +00:00

Use find to delete files recursively (#4732)

* Use find to delete files recursively

Instead of using rm -rf use find to delete files recursively. This
has the added benefit that we do not need to rely on shell expansion.

In particular, shell expansion caused the --one-file-system flag to
not work as intended: The idea was that the content of a (left-over)
bind mounted directory would not get deleted. However, since shell
expansion passed the directory to rm, rm happily deleted also files in
that bind mounted directory.

* Pass arguments correctly

* Fix argument order and stderr output

* Improve error handling

Log with exception level if there is an OS level error. Decode the
stderr output correctly.

* Remove unnecessary newline
This commit is contained in:
Stefan Agner
2023-11-27 17:36:30 +01:00
committed by GitHub
parent cb03d039f4
commit 3d5bd2adef
2 changed files with 14 additions and 8 deletions

View File

@@ -15,7 +15,7 @@ WORKDIR /usr/src
RUN \
set -x \
&& apk add --no-cache \
coreutils \
findutils \
eudev \
eudev-libs \
git \