From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id B58B0138334 for ; Wed, 20 Jun 2018 07:13:22 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id F16A9E09C6; Wed, 20 Jun 2018 07:12:01 +0000 (UTC) Received: from mx-out1.startmail.com (mx-out1.startmail.com [145.131.90.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 5B90FE094B for ; Wed, 20 Jun 2018 07:12:00 +0000 (UTC) From: "Marty E. Plummer" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=startmail.com; s=2017-11; t=1529478718; bh=8e34FJ5qLqKs8i1zbQUKbJ/Zy33I6LnIyT7JRPkR64M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lIBcLbopqxM2/Dm5B9QBz5X1vQPUAiRFi9PktQDTNLkit6cZYPUmldJ2ipyKCJ4Ep gRbmMZoflqIDAxgzn4GlFdUcYdvatt1vyqL8X4Nqc1MJxKDeJgTu39jcnQjuH2nc3T n+pSxQpg7/VnPtxNXCL/TnUOk8hBB8DQqwhMpeTori9ExW6/C5ZimWr6lOuFCMW3Kl T3SodVzV+ehzFNx4rrxxisY7EJt4MobUIAkumWDvnrimbqtJ5ZMqqI3Af+DOdqNofN VnOhMafKtyGt/tdWfi/CNvjaG7WzqsJ8sB63qfyYpsR8fB1fpidI+Z5vbkDvCvshvc M5i1bUWNymDvw== To: gentoo-dev@lists.gentoo.org Cc: "Marty E. Plummer" Subject: [gentoo-dev] [PATCH 4/4] gnome2.eclass: move icon handling code to xdg.eclass Date: Wed, 20 Jun 2018 02:10:53 -0500 Message-Id: <20180620071053.11589-4-hanetzer@startmail.com> In-Reply-To: <20180620071053.11589-1-hanetzer@startmail.com> References: <20180620071053.11589-1-hanetzer@startmail.com> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Archives-Salt: fe87d9d6-099a-4eea-a572-ac099df0e0e6 X-Archives-Hash: 820af7b40aae1239733f2375ed6be07b --- 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