abuild: don't error out immediately in postcheck()

Store exit code in the variable 'e', then return it, if there are no
errors then it will return 0 as that is the default value, otherwise it
will return 1 and error out as previously
This commit is contained in:
Leo 2020-07-01 21:58:25 -03:00 committed by Natanael Copa
parent cd004c0232
commit 29a3433b43
1 changed files with 11 additions and 11 deletions

View File

@ -727,19 +727,19 @@ targz() {
}
postcheck() {
local dir="$1" name="$2" i=
local dir="$1" name="$2" i= 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"
return 1
e=1
fi
done
if [ -d "$dir"/usr/var ]; then
error "Found /usr/var, localstatedir is most likely wrong"
return 1
e=1
fi
fi
@ -747,10 +747,10 @@ postcheck() {
# any circunstance, packages installing to it are 100% sure a packaging error
if [ -e "$dir"/lib64 ]; then
error "Packages must not put anything under /lib64, use /lib instead"
return 1
e=1
elif [ -e "$dir"/usr/lib64 ]; then
error "Packages must not put anything under /usr/lib64, use /usr/lib instead"
return 1
e=1
fi
# remove *.la files if libtool is not set
@ -762,7 +762,7 @@ postcheck() {
if [ -e "$dir"/usr/lib/charset.alias ] \
&& ! options_has "charset.alias"; then
error "Found /usr/lib/charset.alias"
return 1
e=1
fi
# look for /etc/init.d and /etc/conf.d
if [ -e "$dir"/etc/init.d -o -e "$dir"/etc/conf.d ] \
@ -790,7 +790,7 @@ postcheck() {
if [ -n "$i" ]; then
error "Found uncompressed man pages:"
echo "$i"
return 1
e=1
fi
fi
# check directory permissions
@ -806,7 +806,7 @@ postcheck() {
if [ -n "$i" ]; then
error "Found non-PIE files that has SUID:"
echo "$i"
return 1
e=1
fi
# test suid bit on executable
if ! options_has "suid"; then
@ -815,7 +815,7 @@ postcheck() {
if [ -n "$i" ]; then
error "Found executable files with SUID bit set:"
echo "$i"
return 1
e=1
fi
fi
@ -825,10 +825,10 @@ postcheck() {
if [ -n "$res" ]; then
error "Found textrels:"
echo "$res"
return 1
e=1
fi
fi
return 0
return $e
}
pre_split() {