void-packages/common/hooks/post-install/03-remove-empty-dirs.sh

11 lines
318 B
Bash
Raw Normal View History

# 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
}