From 5220f663e45743cefbc94bb31e26509b88c92c8a Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Fri, 12 May 2023 21:12:32 -0400 Subject: sbolint: check TMP PKG OUTPUT; sbopkglint: check empty man dirs. --- sbopkglint.d/05-basic-sanity.t.sh | 2 +- sbopkglint.d/30-manpages.t.sh | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'sbopkglint.d') diff --git a/sbopkglint.d/05-basic-sanity.t.sh b/sbopkglint.d/05-basic-sanity.t.sh index cfdf9cd..0600036 100644 --- a/sbopkglint.d/05-basic-sanity.t.sh +++ b/sbopkglint.d/05-basic-sanity.t.sh @@ -165,5 +165,5 @@ brokenlinks="$( find -L . -type l \! -lname '/*' )" # 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. -emptydirs="$( find . -type d -a -empty | grep -v 'var\>' )" +emptydirs="$( find . -type d -a -empty | grep -v '^\./var\>' )" [ -n "$emptydirs" ] && note "package contains empty dirs, are these necessary?" && ls -ld $emptydirs diff --git a/sbopkglint.d/30-manpages.t.sh b/sbopkglint.d/30-manpages.t.sh index 30c3841..7ab56d4 100644 --- a/sbopkglint.d/30-manpages.t.sh +++ b/sbopkglint.d/30-manpages.t.sh @@ -91,6 +91,7 @@ check_locale_dir() { if [ -d usr/man ]; then find usr/man -type f > .manpages.$$ find usr/man -mindepth 1 -type d > .mandirs.$$ + find usr/man -type d -a -empty > .manemptydirs.$$ while read d; do [ "$( stat -c '%a %U %G' "$d" )" != "755 root root" ] && BADDIRPERMS+="$d " @@ -113,7 +114,12 @@ if [ -d usr/man ]; then esac done < .manpages.$$ - rm -f .manpages.$$ .mandirs.$$ + if [ -s .manemptydirs.$$ ]; then + warn "empty dir(s) in /usr/man:" + cat .manemptydirs.$$ + fi + + rm -f .manpages.$$ .mandirs.$$ manemptydirs.$$ [ -n "$BADPERMS" ] && warn "bad man page owner/permissions (should be 0644, root:root)" && ls -ld $BADPERMS [ -n "$BADDIRPERMS" ] && warn "bad man directory owner/permissions (should be 0755, root:root)" && ls -ld $BADDIRPERMS -- cgit v1.2.3