Don't process desktop files without Type=Application and Exec= line

This commit is contained in:
Pavol Rusnak 2010-03-17 16:02:46 +01:00 committed by Panu Matilainen
parent ed74161b7e
commit 3b96dfb29a
1 changed files with 6 additions and 4 deletions

View File

@ -9,11 +9,13 @@ OLD_IFS="$IFS"
while read instfile ; do
case "$instfile" in
*.desktop)
mime=`cat "$instfile" | grep MimeType= | cut -d'=' -f2`
IFS=';'
if ! grep -q '^Type=Application$' "$instfile"; then continue; fi
if ! grep -q '^Exec=' "$instfile"; then continue; fi
mime=`grep '^MimeType=' "$instfile" | cut -d'=' -f2`
IFS=';'
for type in $mime ; do
echo 'mimehandler('$type')'
done
echo 'mimehandler('$type')'
done
;;
esac
done