2014-02-12 11:55:42 +00:00
|
|
|
# This hooks removes empty dirs and warns about them.
|
|
|
|
|
|
|
|
hook() {
|
2015-04-25 11:26:18 +00:00
|
|
|
find ${PKGDESTDIR} -type d -empty -print0|sort -z -r|while IFS="" read f; do
|
2014-02-12 11:55:42 +00:00
|
|
|
_dir="${f##${PKGDESTDIR}}"
|
|
|
|
[ -z "${_dir}" ] && continue
|
2015-04-25 11:26:18 +00:00
|
|
|
rmdir --ignore-fail-on-non-empty -p "$f" # &>/dev/null
|
2014-02-12 11:55:42 +00:00
|
|
|
msg_warn "$pkgver: removed empty dir: ${_dir}\n"
|
|
|
|
done
|
2014-03-18 06:54:12 +00:00
|
|
|
# Create PKGDESTDIR in case it has been removed previously.
|
|
|
|
mkdir -p ${PKGDESTDIR}
|
2014-02-12 11:55:42 +00:00
|
|
|
}
|