diff options
author | B. Watson <urchlay@slackware.uk> | 2023-02-03 19:25:38 -0500 |
---|---|---|
committer | B. Watson <urchlay@slackware.uk> | 2023-02-03 19:25:38 -0500 |
commit | d0a889c066c90e5df14fc56881ff2aa4f0367719 (patch) | |
tree | 15f176313cd2226dc9c3c64d53b3543b2843c5c6 /sbopkglint.d | |
parent | 7dd4e0458809ed4d835d94aeaaf349d04a091abd (diff) | |
download | sbo-maintainer-tools-d0a889c066c90e5df14fc56881ff2aa4f0367719.tar.gz |
sbopkglint: make INSTALL check smarter, relax empty file check in doc dir.
Diffstat (limited to 'sbopkglint.d')
-rw-r--r-- | sbopkglint.d/10-docs.t.sh | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/sbopkglint.d/10-docs.t.sh b/sbopkglint.d/10-docs.t.sh index 26e0255..1e9e02a 100644 --- a/sbopkglint.d/10-docs.t.sh +++ b/sbopkglint.d/10-docs.t.sh @@ -27,12 +27,12 @@ if [ -d "$DOCDIR" ]; then badpermfiles="$( find $DOCDIR -mindepth 1 -type f -a \! -perm -444 )" badpermdirs="$( find $DOCDIR -mindepth 1 -type d -a \! -perm 0755 )" badowners="$( find $DOCDIR -mindepth 1 -user root -a -group root -o -print )" - empty="$( find $DOCDIR -mindepth 1 -empty )" + empty="$( find $DOCDIR -mindepth 1 -maxdepth 1 -empty )" bogus="$( find $DOCDIR -mindepth 1 -maxdepth 1 -type f -a \( -name INSTALL -o -name INSTALL.\* \) )" files="$( find $DOCDIR -type f -perm /111 )" for f in $files; do - head -1 $f | grep -q '^#!' && continue; # script file + head -1 $f | grep -q '^#!' && continue; # script file, +x is OK badpermfiles+=" $f" done @@ -40,7 +40,16 @@ if [ -d "$DOCDIR" ]; then [ -n "$badpermdirs" ] && warn "bad directory perms (should be 755) in doc dir:" && ls -ld $badpermdirs [ -n "$badowners" ] && warn "bad ownership (should be root:root) in doc dir:" && ls -ld $badowners [ -n "$empty" ] && warn "empty files/dirs in doc dir: $empty" - [ -n "$bogus" ] && [ -z "$INSTALL_DOCS_OK" ] && warn "useless-looking install instructions in doc dir: $bogus" + + if [ -z "$INSTALL_DOCS_OK" -a -n "$bogus" ]; then + for i in $bogus; do + if grep -q 'generic installation instructions' $i; then + warn "generic install instructions found, useless, please remove: $i" + else + note "install instructions found, is this relevant for binary package users?: $i" + fi + done + fi fi # allow /usr/doc/HTML to exist, though we don't check its contents here. |