From d221257bc87189a8a0e47e38ccd8de224cdb4754 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Fri, 15 Dec 2023 21:11:34 -0500 Subject: sbopkglint: only check images directly in /usr/share/pixmaps, not subdirs. --- sbopkglint.d/50-icons.t.sh | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) (limited to 'sbopkglint.d/50-icons.t.sh') diff --git a/sbopkglint.d/50-icons.t.sh b/sbopkglint.d/50-icons.t.sh index 2296e9d..61703e2 100644 --- a/sbopkglint.d/50-icons.t.sh +++ b/sbopkglint.d/50-icons.t.sh @@ -35,6 +35,9 @@ check_image() { local ext="$( echo "$bn" | sed 's,.*\.\([^.]*\)$,\1,' )" [ "$ext" = "$f" ] && ext="" + [ "$( stat -Lc '%a %U %G' "$i" )" = "644 root root" ] || \ + ls -bld "$i" >> .badperms.$$ + [ "$bn" = "theme" -o "$bn" = "icon-theme.cache" -o "$bn" = "index.theme" ] && return mime="$( file -L -zS -b --mime-type "$f" )" @@ -71,15 +74,17 @@ check_image() { fi } -for icondir in usr/share/pixmaps usr/share/icons/hicolor; do - if [ -d "$icondir" ]; then - find -L "$icondir" -type f | while read i; do - check_image "$i" - [ "$( stat -Lc '%a %U %G' "$i" )" = "644 root root" ] || \ - ls -bld "$i" >> .badperms.$$ - done - fi -done +if [ -d usr/share/icons/hicolor ]; then + find -L usr/share/icons/hicolor -type f | while read i; do + check_image "$i" + done +fi + +if [ -d usr/share/pixmaps ]; then + find -L usr/share/pixmaps -type f -maxdepth 1 | while read i; do + check_image "$i" + done +fi [ -s .nonimages.$$ ] && warn "non-image files in icon dirs:" && cat .nonimages.$$ @@ -88,4 +93,9 @@ if [ -s .badperms.$$ ]; then cat .badperms.$$ fi +# this isn't (yet?) a fatal error, but at least let the user know something's up. +if [ -d usr/share/pixmaps/hicolor ]; then + note "Icons are in /usr/share/pixmaps/hicolor, this is almost certainly WRONG!" +fi + rm -f .nonimages.$$ .badperms.$$ -- cgit v1.2.3