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