diff options
author | B. Watson <yalhcru@gmail.com> | 2022-04-05 13:15:03 -0400 |
---|---|---|
committer | B. Watson <yalhcru@gmail.com> | 2022-04-05 13:15:03 -0400 |
commit | 6c1acea4bd4a1f1c8329c7160b8d72f5ad2c108c (patch) | |
tree | 35f60b1c799f35934041b3c5b9b5a91fcb3fbf69 /sbopkglint.d/35-desktop.t.sh | |
parent | 70b820c65b75cf49ced30db31eead3bad717f7ec (diff) | |
download | sbo-maintainer-tools-6c1acea4bd4a1f1c8329c7160b8d72f5ad2c108c.tar.gz |
support usr/share/applications/screensavers
Diffstat (limited to 'sbopkglint.d/35-desktop.t.sh')
-rw-r--r-- | sbopkglint.d/35-desktop.t.sh | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/sbopkglint.d/35-desktop.t.sh b/sbopkglint.d/35-desktop.t.sh index 9650ef4..03f52de 100644 --- a/sbopkglint.d/35-desktop.t.sh +++ b/sbopkglint.d/35-desktop.t.sh @@ -13,14 +13,16 @@ BADPERMS="" BADDESKTOP="" NONDESKTOP="" -if [ -d usr/share/applications ]; then - # doinst.sh creates this, don't check here now that we have a doinst test. - #[ -e "usr/share/applications/mimeinfo.cache" ] || warn "doinst.sh is missing update-desktop-database" - for f in usr/share/applications/*; do +check_desktop_dir() { + local dir="$1" + [ -d "$dir" ] || return + + for f in $dir/*; do [ -e "$f" ] || continue [ "$f" = "usr/share/applications/mimeinfo.cache" ] && continue + [ "$f" = "usr/share/applications/screensavers" ] && continue [ "$( stat -Lc '%a %U %G' "$f" )" = "644 root root" ] || BADPERMS+="$f " case "$f" in @@ -28,8 +30,13 @@ if [ -d usr/share/applications ]; then *) NONDESKTOP+="$f " ;; esac done +} + +for dir in usr/share/applications usr/share/applications/screensavers; do + check_desktop_dir "$dir" +done + - [ -n "$BADPERMS" ] && warn "bad permissions/owner on .desktop files (should be 0644 root:root):" && ls -ld $BADPERMS - [ -n "$BADDESKTOP" ] && warn ".desktop files fail to validate:" && ls -ld $BADDESKTOP - [ -n "$NONDESKTOP" ] && warn "unknown file (not .desktop) in desktop dir:" && ls -ld $NONDESKTOP -fi +[ -n "$BADPERMS" ] && warn "bad permissions/owner on .desktop files (should be 0644 root:root):" && ls -ld $BADPERMS +[ -n "$BADDESKTOP" ] && warn ".desktop files fail to validate:" && ls -ld $BADDESKTOP +[ -n "$NONDESKTOP" ] && warn "unknown file (not .desktop) in desktop dir:" && ls -ld $NONDESKTOP |