aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2024-08-03 03:30:23 -0400
committerB. Watson <urchlay@slackware.uk>2024-08-03 03:30:39 -0400
commit0dba383818c23844d957ce673fb398208c1aba49 (patch)
tree5e4656f694421890d4947fd2a064fb5aae66a328
parent2a64f2edaf9ed95687c051d8a2eeabb54d89d6aa (diff)
downloadsbo-maintainer-tools-0dba383818c23844d957ce673fb398208c1aba49.tar.gz
sbopkglint: detect "empty" packages.
-rw-r--r--sbopkglint.d/pre-doinst.sh16
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