aboutsummaryrefslogtreecommitdiff
path: root/sbopkglint.d
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2024-10-08 23:46:23 -0400
committerB. Watson <urchlay@slackware.uk>2024-10-08 23:46:23 -0400
commite5e8fdba799158bada636f4d82253afd8f7be07b (patch)
tree5fdce709baeb8e6a6fe49b0c353a77149e728519 /sbopkglint.d
parent221cefc280616835569df64e154fbb685a2abfe4 (diff)
downloadsbo-maintainer-tools-e5e8fdba799158bada636f4d82253afd8f7be07b.tar.gz
sbopkglint: complain louder if an empty /bin /usr/bin /sbin /usr/sbin exists.
Diffstat (limited to 'sbopkglint.d')
-rw-r--r--sbopkglint.d/05-basic-sanity.t.sh16
1 files changed, 15 insertions, 1 deletions
diff --git a/sbopkglint.d/05-basic-sanity.t.sh b/sbopkglint.d/05-basic-sanity.t.sh
index 8267b83..d5d3569 100644
--- a/sbopkglint.d/05-basic-sanity.t.sh
+++ b/sbopkglint.d/05-basic-sanity.t.sh
@@ -203,8 +203,22 @@ find_warnfiles "package contains broken relative symlinks:" \
# 20230320 bkw: empty directories. this isn't an error, just a note, and
# we ignore any empty dirs under /var because lots of packages need these.
+# 20241008 bkw: ignore empty bin sbin usr/bin usr/sbin, these are caught below.
find_warnfiles --note "package contains empty dirs, are these necessary?" \
- . -type d -a -empty -a \! -path "./var/*"
+ . -type d -a -empty \
+ -a \! -path "./var/*" \
+ -a \! -path ./bin \
+ -a \! -path ./sbin \
+ -a \! -path ./usr/bin \
+ -a \! -path ./usr/sbin
+
+# 20241008 bkw: if any of /bin /sbin /usr/bin or /usr/sbin exists, they must
+# not be empty.
+for i in bin sbin usr/bin usr/sbin; do
+ if [ -e $i -a -z "$( ls -bld $i/* 2>/dev/null )" ]; then
+ warn "package contains empty $i directory, this is probably a bug in the script."
+ fi
+done
find_warnfiles "package contains files owned by UID/GID >= 1000" \
. \( -uid +999 -o -gid +999 \)