commit:     0799fdf5c54ed473a45973eda6d3a63fd33fd7c9
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 18:49:39 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0799fdf5

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 3dc9e8e..10c8c42 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