etcupdate: Prefer POSIX -depth to BSD -d

This is in preparation for building an etcupdate tree on non-FreeBSD
when building release images. The -d option is documented as a
BSD-specific equivalent to the POSIX -depth primary. Whilst GNU find
sort of accepts it in an attempt to be compatible, it still doesn't
permit it coming before the paths, unlike BSD find, and prints a
deprecation warning either way. Thus, use the equivalent POSIX -depth to
ensure it works correctly and without warning everywhere.

Reviewed by:	jhb
Obtained from:	CheriBSD
Differential Revision:	https://reviews.freebsd.org/D35856
This commit is contained in:
Jessica Clarke 2022-08-09 22:57:22 +01:00
parent f377243996
commit c5e30fbdb7

View file

@ -225,7 +225,7 @@ build_tree()
find $1 -type f -size 0 -delete || return 1
# Trim empty directories.
find -d $1 -type d -empty -delete || return 1
find $1 -depth -type d -empty -delete || return 1
return 0
)