net-fs/openafs-kernel: remove vulnerable versions
[gentoo.git] / eclass / fdo-mime.eclass
1 # Copyright 1999-2011 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 # @ECLASS: fdo-mime.eclass
6 # @MAINTAINER:
7 # freedesktop-bugs@gentoo.org
8 # @AUTHOR:
9 # Original author: foser <foser@gentoo.org>
10 # @BLURB: Utility eclass to update the desktop mime info as laid out in the freedesktop specs & implementations
11
12 # @FUNCTION: fdo-mime_desktop_database_update
13 # @DESCRIPTION:
14 # Updates the desktop database.
15 # Generates a list of mimetypes linked to applications that can handle them
16 fdo-mime_desktop_database_update() {
17         has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
18         has "${EAPI:-0}" 0 1 2 && ! use prefix && EROOT="${ROOT}"
19         if [ -x "${EPREFIX}/usr/bin/update-desktop-database" ]
20         then
21                 einfo "Updating desktop mime database ..."
22                 "${EPREFIX}/usr/bin/update-desktop-database" -q "${EROOT}usr/share/applications"
23         fi
24 }
25
26 # @FUNCTION: fdo-mime_mime_database_update
27 # @DESCRIPTION:
28 # Update the mime database.
29 # Creates a general list of mime types from several sources
30 fdo-mime_mime_database_update() {
31         has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
32         has "${EAPI:-0}" 0 1 2 && ! use prefix && EROOT="${ROOT}"
33         if [ -x "${EPREFIX}/usr/bin/update-mime-database" ]
34         then
35                 einfo "Updating shared mime info database ..."
36                 "${EPREFIX}/usr/bin/update-mime-database" "${EROOT}usr/share/mime"
37         fi
38 }