diff options
author | Gilles Dartiguelongue <eva@gentoo.org> | 2015-11-24 18:42:27 +0100 |
---|---|---|
committer | Gilles Dartiguelongue <eva@gentoo.org> | 2015-11-24 22:57:19 +0100 |
commit | c0281b06f69edc9a8be219be3cf07fae96dc417e (patch) | |
tree | 1a91b08163fe600e6369b0a787d7221dd35e02c4 /eclass/xdg.eclass | |
parent | xdg-utils.eclass: use $HOME instead of $T (diff) | |
download | gentoo-c0281b06f69edc9a8be219be3cf07fae96dc417e.tar.gz gentoo-c0281b06f69edc9a8be219be3cf07fae96dc417e.tar.bz2 gentoo-c0281b06f69edc9a8be219be3cf07fae96dc417e.zip |
xdg*.eclass: move phase related logic to xdg.eclass
Diffstat (limited to 'eclass/xdg.eclass')
-rw-r--r-- | eclass/xdg.eclass | 34 |
1 files changed, 27 insertions, 7 deletions
diff --git a/eclass/xdg.eclass b/eclass/xdg.eclass index 799d6a2076ad..18138587b143 100644 --- a/eclass/xdg.eclass +++ b/eclass/xdg.eclass @@ -37,25 +37,45 @@ xdg_src_prepare() { # @FUNCTION: xdg_pkg_preinst # @DESCRIPTION: -# Finds .desktop and mime info files for later handling in pkg_postinst +# Finds .desktop and mime info files for later handling in pkg_postinst. +# Locations are stored in XDG_ECLASS_DESKTOPFILES and XDG_ECLASS_MIMEINFOFILES +# respectively. xdg_pkg_preinst() { - xdg_desktopfiles_savelist - xdg_mimeinfo_savelist + export XDG_ECLASS_DESKTOPFILES=( $(cd "${D}" && find 'usr/share/applications' -type f -print0 2> /dev/null) ) + export XDG_ECLASS_MIMEINFOFILES=( $(cd "${D}" && find 'usr/share/mime' -type f -print0 2> /dev/null) ) } # @FUNCTION: xdg_pkg_postinst # @DESCRIPTION: # Handle desktop and mime info database updates. xdg_pkg_postinst() { - xdg_desktop_database_update - xdg_mimeinfo_database_update + if [[ -n "${XDG_ECLASS_DESKTOPFILES}" ]]; then + xdg_desktop_database_update + else + debug-print "No .desktop files to add to database" + fi + + if [[ -n "${XDG_ECLASS_MIMEINFOFILES}" ]]; then + xdg_mimeinfo_database_update + else + debug-print "No mime info files to add to database" + fi } # @FUNCTION: xdg_pkg_postrm # @DESCRIPTION: # Handle desktop and mime info database updates. xdg_pkg_postrm() { - xdg_desktop_database_update - xdg_mimeinfo_database_update + if [[ -n "${XDG_ECLASS_DESKTOPFILES}" ]]; then + xdg_desktop_database_update + else + debug-print "No .desktop files to add to database" + fi + + if [[ -n "${XDG_ECLASS_MIMEINFOFILES}" ]]; then + xdg_mimeinfo_database_update + else + debug-print "No mime info files to add to database" + fi } |