diff options
author | B. Watson <urchlay@slackware.uk> | 2023-12-15 21:11:34 -0500 |
---|---|---|
committer | B. Watson <urchlay@slackware.uk> | 2023-12-15 21:11:34 -0500 |
commit | d221257bc87189a8a0e47e38ccd8de224cdb4754 (patch) | |
tree | 530fdec4ac7f5ba8983e2235be36e7487320cb58 /sbopkglint.d/50-icons.t.sh | |
parent | b86efd8389fa6b8e7d0974bf02c029474caeab8f (diff) | |
download | sbo-maintainer-tools-d221257bc87189a8a0e47e38ccd8de224cdb4754.tar.gz |
sbopkglint: only check images directly in /usr/share/pixmaps, not subdirs.
Diffstat (limited to 'sbopkglint.d/50-icons.t.sh')
-rw-r--r-- | sbopkglint.d/50-icons.t.sh | 28 |
1 files changed, 19 insertions, 9 deletions
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.$$ |