aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFunda Wang <fwang@mageia.org>2011-07-06 05:50:13 +0000
committerFunda Wang <fwang@mageia.org>2011-07-06 05:50:13 +0000
commit0932515fd3934d60b28b98a6c7e0eddb769f5ce3 (patch)
tree45a301194f2f7f8a566264910e4ca61fcba21564
parentac6820baf548b5bc524dc3fa472d135b86808442 (diff)
downloadrpm-setup-0932515fd3934d60b28b98a6c7e0eddb769f5ce3.tar
rpm-setup-0932515fd3934d60b28b98a6c7e0eddb769f5ce3.tar.gz
rpm-setup-0932515fd3934d60b28b98a6c7e0eddb769f5ce3.tar.bz2
rpm-setup-0932515fd3934d60b28b98a6c7e0eddb769f5ce3.tar.xz
rpm-setup-0932515fd3934d60b28b98a6c7e0eddb769f5ce3.zip
1.134: add mimehandler autoprov for desktop files1.134
-rw-r--r--Makefile.am1
-rw-r--r--NEWS3
-rw-r--r--configure.ac2
-rwxr-xr-xdesktop-file.prov23
-rwxr-xr-xfind-provides.in6
5 files changed, 34 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am
index 2da8498..b4d4666 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -50,6 +50,7 @@ pkg_scripts = \
pkgconfigdeps.sh \
pythoneggs.py \
rubygems.rb \
+ desktop-file.prov \
fontconfig.prov
pkg_gscripts = \
diff --git a/NEWS b/NEWS
index 75012ae..2d61645 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+Version 1.134 - 6 June 2011, by Funda Wang
+- add mimehandler autoprov for desktop files
+
Version 1.133 - 30 May 2011, by Pascal Terjan
- default to core section
diff --git a/configure.ac b/configure.ac
index c0295fb..6c6c163 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4,7 +4,7 @@
# $Id: configure.ac 271266 2010-11-04 10:43:28Z fwang $
AC_PREREQ(2.59)
-AC_INIT(rpm-mageia-setup, 1.133, pterjan@mageia.org)
+AC_INIT(rpm-mageia-setup, 1.134, pterjan@mageia.org)
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE(1.9 -Wno-portability)
AC_CONFIG_SRCDIR
diff --git a/desktop-file.prov b/desktop-file.prov
new file mode 100755
index 0000000..5b159ae
--- /dev/null
+++ b/desktop-file.prov
@@ -0,0 +1,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
+
diff --git a/find-provides.in b/find-provides.in
index 3fdf3cf..cdfd147 100755
--- a/find-provides.in
+++ b/find-provides.in
@@ -81,6 +81,12 @@ done | sort -u
&& test ${PIPESTATUS[2]} -ne 0 && echo 'error: @RPMVENDORDIR@/pkgconfigdeps.sh failed' >&2 && exit 1
#
+# --- mimehandler
+[ -x @RPMVENDORDIR@/desktop-file.prov ] &&
+ echo "$filelist" | tr '[:blank:]' \\n | @RPMVENDORDIR@/desktop-file.prov --provides | sort -u \
+ && test ${PIPESTATUS[2]} -ne 0 && echo 'error: @RPMVENDORDIR@/desktop-file.prov failed' >&2 && exit 1
+
+#
# --- fonts
[ -x @RPMVENDORDIR@/fontconfig.prov ] &&
echo "$filelist" | tr '[:blank:]' \\n | @RPMVENDORDIR@/fontconfig.prov --provides | sort -u \