From 80eb2be65ae1daeee53ee497f12aa832ce6af1e0 Mon Sep 17 00:00:00 2001 From: Gilles Dartiguelongue Date: Tue, 24 Nov 2015 18:52:06 +0100 Subject: [PATCH] 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 5c765578f925..ff22b39ce110 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 -- 2.26.2