abuild: extend fhs check

This commit is contained in:
Sertonix 2024-03-26 21:55:53 +01:00
parent ec11f495cd
commit 08d2d81587
1 changed files with 9 additions and 6 deletions

View File

@ -781,15 +781,18 @@ targz() {
}
postcheck() {
local dir="$1" name="$2" i= e=0
local dir="$1" name="$2" i= j= e=0
msg "Running postcheck for $name"
# checking for FHS compat
if ! options_has "!fhs"; then
for i in "$dir"/srv/* "$dir"/usr/local/* "$dir"/opt/*; do
if [ -e "$i" ]; then
error "Packages must not put anything under /srv, /usr/local or /opt"
e=1
fi
for i in srv usr/local opt run var/run tmp var/tmp var/lock var/empty home sys proc mnt dev; do
for j in "$dir"/"$i"/* "$dir"/"$i"/.[!.]* "$dir"/"$i"/..?*; do
if [ -L "$j" ] || [ -e "$j" ]; then
error "Packages must not put anything under /$i"
e=1
break
fi
done
done
if [ -d "$dir"/usr/var ]; then
error "Found /usr/var, localstatedir is most likely wrong"