From a69bdc0ef63343373773995f7e87d11a29ed4259 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Sat, 16 Sep 2023 16:48:04 -0400 Subject: sbopkglint: refactor gzip detection. --- sbopkglint.d/30-manpages.t.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'sbopkglint.d/30-manpages.t.sh') diff --git a/sbopkglint.d/30-manpages.t.sh b/sbopkglint.d/30-manpages.t.sh index 4264d86..0bc4a96 100644 --- a/sbopkglint.d/30-manpages.t.sh +++ b/sbopkglint.d/30-manpages.t.sh @@ -35,9 +35,7 @@ check_gzipped_page() { BADPERMS+="$f " fi - if [ "$( file -L -b --mime-type "$f" )" != "application/gzip" ]; then - NOTGZIPPED+="$f " - fi + is_gzipped "$f" || NOTGZIPPED+="$f " # I have ~42,000 man pages on my dev box, file(1) fails to identify # 12 of them as troff, but adding the check for .T catches them all. @@ -134,7 +132,7 @@ if [ -d usr/man ]; then [ -n "$BADDIRPERMS" ] && warn "bad man directory owner/permissions (should be 0755, root:root)" && ls -ld $BADDIRPERMS [ -n "$BADDIRS" ] && warn "bad directory names in /usr/man:" && ls -ld $BADDIRS [ -n "$BADNAMES" ] && warn "bad man page names (not *.gz):" && ls -ld $BADNAMES - [ -n "$NOTGZIPPED" ] && warn "non-gzip (but named *.gz) man pages:" && ls -ld $NOTGZIPPED + [ -n "$NOTGZIPPED" ] && warn "non-gzipiped (but named *.gz) man pages:" && ls -ld $NOTGZIPPED [ -n "$NONTROFF" ] && warn "invalid man pages (not troff):" && ls -ld $NONTROFF [ -n "$WRONGSECT" ] && warn "man pages in wrong section:" && ls -ld $WRONGSECT fi -- cgit v1.2.3