common/hooks: Fix hooks when build_style=meta

This commit is contained in:
mid-kid 2015-11-26 22:27:55 +01:00
parent f5a64d0ecf
commit f68bfd6575
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() {
if [ -d "${PKGDESTDIR}" ]; then
find ${PKGDESTDIR} -type f -name '*.py[co]' -delete find ${PKGDESTDIR} -type f -name '*.py[co]' -delete
fi
} }

View File

@ -1,6 +1,7 @@
# This hooks removes empty dirs and warns about them. # This hooks removes empty dirs and warns about them.
hook() { hook() {
if [ -d "${PKGDESTDIR}" ]; then
find "${PKGDESTDIR}" -type d -empty|sort -r|while read f; do find "${PKGDESTDIR}" -type d -empty|sort -r|while read f; do
_dir="${f##${PKGDESTDIR}}" _dir="${f##${PKGDESTDIR}}"
[ -z "${_dir}" ] && continue [ -z "${_dir}" ] && continue
@ -9,4 +10,5 @@ hook() {
done done
# Create PKGDESTDIR in case it has been removed previously. # Create PKGDESTDIR in case it has been removed previously.
mkdir -p ${PKGDESTDIR} mkdir -p ${PKGDESTDIR}
fi
} }