1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
4 # @ECLASS: fdo-mime.eclass
6 # freedesktop-bugs@gentoo.org
8 # Original author: foser <foser@gentoo.org>
9 # @BLURB: Utility eclass to update the desktop mime info as laid out in the freedesktop specs & implementations
11 # This eclass is DEPRECATED. Please use xdg-utils or xdg instead.
13 # @FUNCTION: fdo-mime_desktop_database_update
15 # Updates the desktop database.
16 # Generates a list of mimetypes linked to applications that can handle them
17 fdo-mime_desktop_database_update() {
18 has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
19 has "${EAPI:-0}" 0 1 2 && ! use prefix && EROOT="${ROOT}"
20 if [ -x "${EPREFIX}/usr/bin/update-desktop-database" ]
22 einfo "Updating desktop mime database ..."
23 "${EPREFIX}/usr/bin/update-desktop-database" -q "${EROOT}usr/share/applications"
27 # @FUNCTION: fdo-mime_mime_database_update
29 # Update the mime database.
30 # Creates a general list of mime types from several sources
31 fdo-mime_mime_database_update() {
32 has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
33 has "${EAPI:-0}" 0 1 2 && ! use prefix && EROOT="${ROOT}"
34 if [ -x "${EPREFIX}/usr/bin/update-mime-database" ]
36 einfo "Updating shared mime info database ..."
37 "${EPREFIX}/usr/bin/update-mime-database" "${EROOT}usr/share/mime"