diff options
-rw-r--r-- | sbopkglint.d/pre-doinst.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sbopkglint.d/pre-doinst.sh b/sbopkglint.d/pre-doinst.sh index 24a5815..c374b8f 100644 --- a/sbopkglint.d/pre-doinst.sh +++ b/sbopkglint.d/pre-doinst.sh @@ -38,3 +38,19 @@ find_warnfiles "package contains actual symlinks:" \ -P . -type l [ -f install/slack-desc ] || warn "required file install/slack-desc is missing" + +# Next test is supposed to complain if the package is "empty". What +# "empty" means is, there's nothing in the package outside of usr/doc +# and install/. This happens when a SlackBuild doesn't do error checking +# (no "set -e" or "|| exit 1" tests) and the 'make' or whatever it +# does fails, undetected. +# This is a stopgap, really. If someone submits a SlackBuild that doesn't +# do any error checking, it will always create a package and exit +# with 0 status (success)... if it does something more complex than +# build/install a single tarball, part of it might succeed and another +# part might fail. There's no way to detect a situation like that in +# the general case. + +if [ "$( find . -type d -maxdepth 2 -a \! \( -path ./usr -o -path ./usr/doc -o -path . -o -path ./install \) )" = "" ]; then + warn "package is empty (contains nothing outside of install/ and/or usr/doc)" +fi |