Blame scripts/desktop-file.prov

2ff057
#!/bin/sh
2ff057
#
2ff057
# Transform desktop mimetype info into RPM mimehandler(type) provides
2ff057
#
2ff057
# Author: Richard Hughes <richard@hughsie.com>
2ff057
# Based on other provides scripts from RPM
2ff057
2ff057
OLD_IFS="$IFS"
2ff057
while read instfile ; do
2ff057
	case "$instfile" in
2ff057
	*.desktop)
2ff057
		if ! grep -q '^Type=Application$' "$instfile"; then continue; fi
2ff057
		if ! grep -q '^Exec=' "$instfile"; then continue; fi
2ff057
		echo "application()"
2ff057
		echo "application(${instfile##*/applications/})"
2ff057
		mime=`grep '^MimeType=' "$instfile" | cut -d'=' -f2`
2ff057
		IFS=';'
2ff057
		for type in $mime ; do
2ff057
			echo 'mimehandler('$type')'
2ff057
		done
2ff057
		;;
2ff057
	esac
2ff057
done
2ff057
IFS=$OLD_IFS
2ff057