diff options
-rw-r--r-- | Makefile.am | 1 | ||||
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rwxr-xr-x | desktop-file.prov | 23 | ||||
-rwxr-xr-x | find-provides.in | 6 |
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 = \ @@ -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 \ |