commit:     80eb2be65ae1daeee53ee497f12aa832ce6af1e0
Author:     Gilles Dartiguelongue <eva <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 24 17:52:06 2015 +0000
Commit:     Gilles Dartiguelongue <eva <AT> gentoo <DOT> org>
CommitDate: Tue Nov 24 21:57:25 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=80eb2be6

xdg-utils.eclass: add phase check

 eclass/xdg-utils.eclass | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/eclass/xdg-utils.eclass b/eclass/xdg-utils.eclass
index 5c76557..ff22b39 100644
--- a/eclass/xdg-utils.eclass
+++ b/eclass/xdg-utils.eclass
@@ -69,6 +69,10 @@ xdg_environment_reset() {
 xdg_desktop_database_update() {
        local updater="${EROOT}${DESKTOP_DATABASE_UPDATE_BIN}"
 
+       if [[ ${EBUILD_PHASE} != post* ]] ; then
+               die "xdg_desktop_database_update must be used in pkg_post* 
phases."
+       fi
+
        if [[ ! -x "${updater}" ]] ; then
                debug-print "${updater} is not executable"
                return
@@ -86,6 +90,10 @@ xdg_desktop_database_update() {
 xdg_mimeinfo_database_update() {
        local updater="${EROOT}${MIMEINFO_DATABASE_UPDATE_BIN}"
 
+       if [[ ${EBUILD_PHASE} != post* ]] ; then
+               die "xdg_mimeinfo_database_update must be used in pkg_post* 
phases."
+       fi
+
        if [[ ! -x "${updater}" ]] ; then
                debug-print "${updater} is not executable"
                return

Reply via email to