aboutsummaryrefslogtreecommitdiff
path: root/sbopkglint.d/50-icons.t.sh
diff options
context:
space:
mode:
Diffstat (limited to 'sbopkglint.d/50-icons.t.sh')
-rw-r--r--sbopkglint.d/50-icons.t.sh28
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.$$