vp-build/common/hooks/post-install/03-remove-empty-dirs.sh
John e351f6b462 hooks/post-install/03-remove-empty-dirs.sh: use find -delete instead of rmdir -p
rmdir -p could end up deleting even /destdir when a empty package would
not have any subpackages with a i686 masterdir.
2019-10-22 16:58:09 +02:00

11 lines
318 B
Bash

# This hooks removes empty dirs and warns about them.
hook() {
if [ -d "${PKGDESTDIR}" ]; then
find "${PKGDESTDIR}" -mindepth 1 -type d -empty -print -delete|sort -r|while read f; do
_dir="${f##${PKGDESTDIR}}"
msg_warn "$pkgver: removed empty dir: ${_dir}\n"
done
fi
}