void-packages/common/hooks/post-install/03-remove-empty-dirs.sh
Juan RP f4019408ca hooks/remote-empty-dirs: switch back to my version that really works.
I'm not sure how the guy that submitted the PR tested it, but IT
DOES NOT WORK AS HE EXPECTED.
2015-04-26 09:46:02 +02:00

13 lines
382 B
Bash

# This hooks removes empty dirs and warns about them.
hook() {
for f in $(find ${PKGDESTDIR} -type d -empty|sort -r); do
_dir="${f##${PKGDESTDIR}}"
[ -z "${_dir}" ] && continue
rmdir --ignore-fail-on-non-empty -p "$f" &>/dev/null
msg_warn "$pkgver: removed empty dir: ${_dir}\n"
done
# Create PKGDESTDIR in case it has been removed previously.
mkdir -p ${PKGDESTDIR}
}