common/hooks: new hooks moved from xbps-src.

This commit is contained in:
Juan RP 2014-02-12 17:26:40 +01:00
parent 8dd409bc58
commit 2daaa82b63
3 changed files with 281 additions and 0 deletions

View file

@ -0,0 +1,10 @@
# 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
}