xdg-utils.eclass: add phase check
authorGilles Dartiguelongue <eva@gentoo.org>
Tue, 24 Nov 2015 17:52:06 +0000 (18:52 +0100)
committerGilles Dartiguelongue <eva@gentoo.org>
Tue, 24 Nov 2015 21:57:25 +0000 (22:57 +0100)
eclass/xdg-utils.eclass

index 5c765578f925595ae38baff1b8cc7bdf688e8ace..ff22b39ce11096c5fff6115cb8dc40d3fcd74cc6 100644 (file)
@@ -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