mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-24 04:59:14 -07:00
gnome2.eclass: move icon handling code to xdg.eclass
Package-Manager: Portage-2.3.51, Repoman 2.3.11 Signed-off-by: Marty E. Plummer <hanetzer@startmail.com> Signed-off-by: Mart Raudsepp <leio@gentoo.org>
This commit is contained in:
committed by
Mart Raudsepp
parent
a506c07df0
commit
0d38680106
@@ -1,4 +1,4 @@
|
||||
# Copyright 1999-2015 Gentoo Foundation
|
||||
# Copyright 1999-2019 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
# @ECLASS: gnome2.eclass
|
||||
@@ -316,7 +316,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
|
||||
@@ -338,9 +337,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
|
||||
@@ -362,9 +358,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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 1999-2015 Gentoo Foundation
|
||||
# Copyright 1999-2019 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
# @ECLASS: xdg.eclass
|
||||
@@ -9,7 +9,7 @@
|
||||
# @SUPPORTED_EAPIS: 4 5 6
|
||||
# @BLURB: Provides phases for XDG compliant packages.
|
||||
# @DESCRIPTION:
|
||||
# Utility eclass to update the desktop and shared mime info as laid
|
||||
# Utility eclass to update the desktop, icon and shared mime info as laid
|
||||
# out in the freedesktop specs & implementations
|
||||
|
||||
inherit xdg-utils
|
||||
@@ -40,9 +40,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_ICONFILES
|
||||
# and XDG_ECLASS_MIMEINFOFILES respectively.
|
||||
xdg_pkg_preinst() {
|
||||
local f
|
||||
|
||||
@@ -51,17 +51,22 @@ xdg_pkg_preinst() {
|
||||
XDG_ECLASS_DESKTOPFILES+=( ${f} )
|
||||
done < <(cd "${D}" && find 'usr/share/applications' -type f -print0 2>/dev/null)
|
||||
|
||||
XDG_ECLASS_ICONFILES=()
|
||||
while IFS= read -r -d '' f; do
|
||||
XDG_ECLASS_ICONFILES+=( ${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} )
|
||||
done < <(cd "${D}" && find 'usr/share/mime' -type f -print0 2>/dev/null)
|
||||
|
||||
export XDG_ECLASS_DESKTOPFILES XDG_ECLASS_MIMEINFOFILES
|
||||
export XDG_ECLASS_DESKTOPFILES XDG_ECLASS_ICONFILES XDG_ECLASS_MIMEINFOFILES
|
||||
}
|
||||
|
||||
# @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
|
||||
@@ -69,6 +74,12 @@ xdg_pkg_postinst() {
|
||||
debug-print "No .desktop files to add to database"
|
||||
fi
|
||||
|
||||
if [[ ${#XDG_ECLASS_ICONFILES[@]} -gt 0 ]]; then
|
||||
xdg_icon_cache_update
|
||||
else
|
||||
debug-print "No icon files to add to cache"
|
||||
fi
|
||||
|
||||
if [[ ${#XDG_ECLASS_MIMEINFOFILES[@]} -gt 0 ]]; then
|
||||
xdg_mimeinfo_database_update
|
||||
else
|
||||
@@ -78,7 +89,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
|
||||
@@ -86,6 +97,12 @@ xdg_pkg_postrm() {
|
||||
debug-print "No .desktop files to add to database"
|
||||
fi
|
||||
|
||||
if [[ ${#XDG_ECLASS_ICONFILES[@]} -gt 0 ]]; then
|
||||
xdg_icon_cache_update
|
||||
else
|
||||
debug-print "No icon files to add to cache"
|
||||
fi
|
||||
|
||||
if [[ ${#XDG_ECLASS_MIMEINFOFILES[@]} -gt 0 ]]; then
|
||||
xdg_mimeinfo_database_update
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user