summaryrefslogtreecommitdiff
path: root/eclass/fdo-mime.eclass
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /eclass/fdo-mime.eclass
reinit the tree, so we can have metadata
Diffstat (limited to 'eclass/fdo-mime.eclass')
-rw-r--r--eclass/fdo-mime.eclass39
1 files changed, 39 insertions, 0 deletions
diff --git a/eclass/fdo-mime.eclass b/eclass/fdo-mime.eclass
new file mode 100644
index 000000000000..8e51d8a69df1
--- /dev/null
+++ b/eclass/fdo-mime.eclass
@@ -0,0 +1,39 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# @ECLASS: fdo-mime.eclass
+# @MAINTAINER:
+# freedesktop-bugs@gentoo.org
+# @AUTHOR:
+# Original author: foser <foser@gentoo.org>
+# @BLURB: Utility eclass to update the desktop mime info as laid out in the freedesktop specs & implementations
+# @DESCRIPTION:
+# This eclass is DEPRECATED. Please use xdg-utils or xdg instead.
+
+# @FUNCTION: fdo-mime_desktop_database_update
+# @DESCRIPTION:
+# Updates the desktop database.
+# Generates a list of mimetypes linked to applications that can handle them
+fdo-mime_desktop_database_update() {
+ has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
+ has "${EAPI:-0}" 0 1 2 && ! use prefix && EROOT="${ROOT}"
+ if [ -x "${EPREFIX}/usr/bin/update-desktop-database" ]
+ then
+ einfo "Updating desktop mime database ..."
+ "${EPREFIX}/usr/bin/update-desktop-database" -q "${EROOT}usr/share/applications"
+ fi
+}
+
+# @FUNCTION: fdo-mime_mime_database_update
+# @DESCRIPTION:
+# Update the mime database.
+# Creates a general list of mime types from several sources
+fdo-mime_mime_database_update() {
+ has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
+ has "${EAPI:-0}" 0 1 2 && ! use prefix && EROOT="${ROOT}"
+ if [ -x "${EPREFIX}/usr/bin/update-mime-database" ]
+ then
+ einfo "Updating shared mime info database ..."
+ "${EPREFIX}/usr/bin/update-mime-database" "${EROOT}usr/share/mime"
+ fi
+}