aboutsummaryrefslogtreecommitdiffstats
path: root/desktop-file.prov
blob: 5b159ae9a3232462e7e25dceb4d04638d45d64b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh
#
# Transform desktop mimetype info into RPM mimehandler(type) provides
#
# Author: Richard Hughes <richard@hughsie.com>
# Based on other provides scripts from RPM

OLD_IFS="$IFS"
while read instfile ; do
	case "$instfile" in
	*.desktop)
		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
		;;
	esac
done
IFS=$OLD_IFS