hooks/post-install: new hook (pkglint) to abort if pkg contains forbidden dirs.

This commit is contained in:
Juan RP 2014-03-19 16:32:12 +01:00
parent a143550d3a
commit fb777453b9

View file

@ -0,0 +1,21 @@
# This hook checks for common issues related to void.
hook() {
local error=0
for f in bin sbin lib lib32; do
if [ -d ${PKGDESTDIR}/${f} ]; then
msg_red "${pkgver}: /${f} directory is not allowed, use /usr/${f}.\n"
error=1
fi
done
for f in sys dev home root run var/run tmp usr/lib64 usr/local; do
if [ -d ${PKGDESTDIR}/${f} ]; then
msg_red "${pkgver}: /${f} directory is not allowed, remove it!\n"
error=1
fi
done
if [ $error -gt 0 ]; then
msg_error "${pkgver}: cannot continue with installation!\n"
fi
}