Merge pull request #3057 from mid-kid/fix-hooks-meta

common/hooks: Fix hooks when build_style=meta
This commit is contained in:
Juan RP 2015-11-27 06:31:01 +01:00
commit 8e2a42ecbf
3 changed files with 14 additions and 10 deletions

View file

@ -1,7 +1,7 @@
# This hook removes perl pod/.packlist files. # This hook removes perl pod/.packlist files.
hook() { hook() {
if [ "$pkgname" != "perl" ]; then if [ "$pkgname" != "perl" -a -d "${PKGDESTDIR}" ]; then
find ${PKGDESTDIR} -type f -name perllocal.pod -delete find ${PKGDESTDIR} -type f -name perllocal.pod -delete
find ${PKGDESTDIR} -type f -name .packlist -delete find ${PKGDESTDIR} -type f -name .packlist -delete
fi fi

View file

@ -1,5 +1,7 @@
# This hook removes python bytecode files (.py[co]). # This hook removes python bytecode files (.py[co]).
hook() { hook() {
find ${PKGDESTDIR} -type f -name '*.py[co]' -delete if [ -d "${PKGDESTDIR}" ]; then
find ${PKGDESTDIR} -type f -name '*.py[co]' -delete
fi
} }

View file

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