summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavol Rusnak <stick@gk2.sk>2010-03-17 16:02:46 +0100
committerPanu Matilainen <pmatilai@redhat.com>2010-06-11 10:27:50 +0300
commit7cf5cde7737eab947dba86568279421718169bfd (patch)
tree98bc5c1b602352f8bf72f75efa2599e8688398fd
parentda7b8f42229b48d906b678d5757fc7000278413e (diff)
downloadrpm-7cf5cde7737eab947dba86568279421718169bfd.tar.gz
Don't process desktop files without Type=Application and Exec= line
(cherry picked from commit 3b96dfb29ab75a4f7f37713a93ec39460c158ef0)
-rwxr-xr-xscripts/desktop-file.prov10
1 files changed, 6 insertions, 4 deletions
diff --git a/scripts/desktop-file.prov b/scripts/desktop-file.prov
index abb79f990..5b159ae9a 100755
--- a/scripts/desktop-file.prov
+++ b/scripts/desktop-file.prov
@@ -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