---
eclass/gnome2.eclass | 7 -------
eclass/xdg.eclass | 27 ++++++++++++++++++++++-----
2 files changed, 22 insertions(+), 12 deletions(-)
diff --git a/eclass/gnome2.eclass b/eclass/gnome2.eclass
index 6db6d08b14e..5b81cb4f01a 100644
--- a/eclass/gnome2.eclass
+++ b/eclass/gnome2.eclass
@@ -315,7 +315,6 @@ gnome2_src_install() {
gnome2_pkg_preinst() {
xdg_pkg_preinst
gnome2_gconf_savelist
- gnome2_icon_savelist
gnome2_schemas_savelist
gnome2_scrollkeeper_savelist
gnome2_gdk_pixbuf_savelist
@@ -337,9 +336,6 @@ gnome2_pkg_preinst() {
gnome2_pkg_postinst() {
xdg_pkg_postinst
gnome2_gconf_install
- if [[ -n ${GNOME2_ECLASS_ICONS} ]]; then
- gnome2_icon_cache_update
- fi
if [[ -n ${GNOME2_ECLASS_GLIB_SCHEMAS} ]]; then
gnome2_schemas_update
fi
@@ -361,9 +357,6 @@ gnome2_pkg_postinst() {
# Handle scrollkeeper, GSettings, Icons, desktop and mime database updates.
gnome2_pkg_postrm() {
xdg_pkg_postrm
- if [[ -n ${GNOME2_ECLASS_ICONS} ]]; then
- gnome2_icon_cache_update
- fi
if [[ -n ${GNOME2_ECLASS_GLIB_SCHEMAS} ]]; then
gnome2_schemas_update
fi
diff --git a/eclass/xdg.eclass b/eclass/xdg.eclass
index fd4816b8447..29830a5ee15 100644
--- a/eclass/xdg.eclass
+++ b/eclass/xdg.eclass
@@ -39,9 +39,9 @@ xdg_src_prepare() {
# @FUNCTION: xdg_pkg_preinst
# @DESCRIPTION:
-# Finds .desktop and mime info files for later handling in pkg_postinst.
-# Locations are stored in XDG_ECLASS_DESKTOPFILES and XDG_ECLASS_MIMEINFOFILES
-# respectively.
+# Finds .desktop, icon, and mime info files for later handling in pkg_postinst.
+# Locations are stored in XDG_ECLASS_DESKTOPFILES, XDG_ECLASS_ICONS and
+# XDG_ECLASS_MIMEINFOFILES respectively.
xdg_pkg_preinst() {
local f
@@ -50,6 +50,11 @@ xdg_pkg_preinst() {
XDG_ECLASS_DESKTOPFILES+=( ${f} )
done < <(cd "${D}" && find 'usr/share/applications' -type f -print0
2>/dev/null)
+ XDG_ECLASS_ICONS=()
+ while IFS= read -r -d '' f; do
+ XDG_ECLASS_ICONS+=( ${f} )
+ done < <(cd "${D}" && find 'usr/share/icons' -type f -print0
2>/dev/null)
+
XDG_ECLASS_MIMEINFOFILES=()
while IFS= read -r -d '' f; do
XDG_ECLASS_MIMEINFOFILES+=( ${f} )
@@ -60,7 +65,7 @@ xdg_pkg_preinst() {
# @FUNCTION: xdg_pkg_postinst
# @DESCRIPTION:
-# Handle desktop and mime info database updates.
+# Handle desktop, icon and mime info database updates.
xdg_pkg_postinst() {
if [[ ${#XDG_ECLASS_DESKTOPFILES[@]} -gt 0 ]]; then
xdg_desktop_database_update
@@ -68,6 +73,12 @@ xdg_pkg_postinst() {
debug-print "No .desktop files to add to database"
fi
+ if [[ ${#XDG_ECLASS_ICONS[@]} -gt 0 ]]; then
+ xdg_icon_cache_update
+ else
+ debug-print "No icon files to add to database"
+ fi
+
if [[ ${#XDG_ECLASS_MIMEINFOFILES[@]} -gt 0 ]]; then
xdg_mimeinfo_database_update
else
@@ -77,7 +88,7 @@ xdg_pkg_postinst() {
# @FUNCTION: xdg_pkg_postrm
# @DESCRIPTION:
-# Handle desktop and mime info database updates.
+# Handle desktop, icon and mime info database updates.
xdg_pkg_postrm() {
if [[ ${#XDG_ECLASS_DESKTOPFILES[@]} -gt 0 ]]; then
xdg_desktop_database_update
@@ -85,6 +96,12 @@ xdg_pkg_postrm() {
debug-print "No .desktop files to add to database"
fi
+ if [[ ${#XDG_ECLASS_ICONS[@]} -gt 0 ]]; then
+ xdg_icon_cache_update
+ else
+ debug-print "No icon files to add to database"
+ fi
+
if [[ ${#XDG_ECLASS_MIMEINFOFILES[@]} -gt 0 ]]; then
xdg_mimeinfo_database_update
else
--
2.17.1