From 0dba383818c23844d957ce673fb398208c1aba49 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Sat, 3 Aug 2024 03:30:23 -0400 Subject: sbopkglint: detect "empty" packages. --- sbopkglint.d/pre-doinst.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 -- cgit v1.2.3