| 1 | # Copyright 1999-2008 Gentoo Foundation |
1 | # Copyright 1999-2008 Gentoo Foundation |
| 2 | # Distributed under the terms of the GNU General Public License v2 |
2 | # Distributed under the terms of the GNU General Public License v2 |
| 3 | # $Header: /var/cvsroot/gentoo-x86/eclass/fdo-mime.eclass,v 1.10 2011/04/21 21:21:26 eva Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/fdo-mime.eclass,v 1.11 2011/08/09 18:43:05 darkside Exp $ |
| 4 | |
4 | |
| 5 | # @ECLASS: fdo-mime.eclass |
5 | # @ECLASS: fdo-mime.eclass |
| 6 | # @MAINTAINER: freedesktop-bugs@gentoo.org |
6 | # @MAINTAINER: freedesktop-bugs@gentoo.org |
| 7 | # |
7 | # |
| 8 | # |
8 | # |
| … | |
… | |
| 13 | # @FUNCTION: fdo-mime_desktop_database_update |
13 | # @FUNCTION: fdo-mime_desktop_database_update |
| 14 | # @DESCRIPTION: |
14 | # @DESCRIPTION: |
| 15 | # Updates the desktop database. |
15 | # Updates the desktop database. |
| 16 | # Generates a list of mimetypes linked to applications that can handle them |
16 | # Generates a list of mimetypes linked to applications that can handle them |
| 17 | fdo-mime_desktop_database_update() { |
17 | fdo-mime_desktop_database_update() { |
|
|
18 | has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX= |
| 18 | if [ -x "/usr/bin/update-desktop-database" ] |
19 | if [ -x "${EPREFIX}/usr/bin/update-desktop-database" ] |
| 19 | then |
20 | then |
| 20 | einfo "Updating desktop mime database ..." |
21 | einfo "Updating desktop mime database ..." |
| 21 | "/usr/bin/update-desktop-database" -q "${ROOT}/usr/share/applications" |
22 | "${EPREFIX}/usr/bin/update-desktop-database" -q "${EROOT}/usr/share/applications" |
| 22 | fi |
23 | fi |
| 23 | } |
24 | } |
| 24 | |
25 | |
| 25 | # @FUNCTION: fdo-mime_mime_database_update |
26 | # @FUNCTION: fdo-mime_mime_database_update |
| 26 | # @DESCRIPTION: |
27 | # @DESCRIPTION: |
| 27 | # Update the mime database. |
28 | # Update the mime database. |
| 28 | # Creates a general list of mime types from several sources |
29 | # Creates a general list of mime types from several sources |
| 29 | fdo-mime_mime_database_update() { |
30 | fdo-mime_mime_database_update() { |
|
|
31 | has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX= |
| 30 | if [ -x "/usr/bin/update-mime-database" ] |
32 | if [ -x "${EPREFIX}/usr/bin/update-mime-database" ] |
| 31 | then |
33 | then |
| 32 | einfo "Updating shared mime info database ..." |
34 | einfo "Updating shared mime info database ..." |
| 33 | "/usr/bin/update-mime-database" "${ROOT}/usr/share/mime" |
35 | "${EPREFIX}/usr/bin/update-mime-database" "${EROOT%/}/usr/share/mime" |
| 34 | fi |
36 | fi |
| 35 | } |
37 | } |