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 B89FE138334 for ; Wed, 27 Jun 2018 01:29:48 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A862DE09A2; Wed, 27 Jun 2018 01:28:45 +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 BC891E0991 for ; Wed, 27 Jun 2018 01:28:44 +0000 (UTC) From: "Marty E. Plummer" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=startmail.com; s=2017-11; t=1530062923; bh=QeH6jgfcysUh9GUulZxyu1wjJWGD1WKm6luL4GajclQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U4BlKRBfpRWXiG0u7Xvx7kW9o9JUVq+PtAyZ4O8dmETchmqt5MXBFMVm0Z9BovVYY U8pTsyBLc+IR2s3rtrl1M1UbP5k6t6Q/pgsW3g7g3WN4++O1BqLNFmHn3oyA6mlMRV a0MZTmbThG8oejyXF8Z10+DI6EgTAUxYqwfDpuE316Q8cf/0xSSUFSGXN+LkcKIwjm Il5PQgjPkUcLHytUdrJq9ccdRgJKBKmfhLHZr1X8aqIG4HBeKoCPtahr7wURxYauBY yGTe+vlt2rMqubb152OQRfivhk2fYWKgFKbJb1iE/onk50OdhsU6Y5ZY3klbtvhMnw 4nNnrIyHGIj3A== To: gentoo-dev@lists.gentoo.org Cc: "Marty E. Plummer" Subject: [gentoo-dev] [PATCH 02/10] gnome2.eclass: move icon handling code to xdg.eclass Date: Tue, 26 Jun 2018 20:27:26 -0500 Message-Id: <20180627012734.1319-3-hanetzer@startmail.com> In-Reply-To: <20180627012734.1319-1-hanetzer@startmail.com> References: <20180627012734.1319-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: 7559615c-ed3b-46c9-b076-0c74f24c4030 X-Archives-Hash: 8577c1291b7d7f29fa64309a2f25458a Package-Manager: Portage-2.3.40, Repoman-2.3.9 --- eclass/gnome2.eclass | 9 +-------- eclass/xdg.eclass | 31 ++++++++++++++++++++++++------- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/eclass/gnome2.eclass b/eclass/gnome2.eclass index 6db6d08b14e..c4418df92bb 100644 --- a/eclass/gnome2.eclass +++ b/eclass/gnome2.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2015 Gentoo Foundation +# Copyright 1999-2018 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # @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..2a4e1f81abf 100644 --- a/eclass/xdg.eclass +++ b/eclass/xdg.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2015 Gentoo Foundation +# Copyright 1999-2018 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # @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_ICONFILES +# and XDG_ECLASS_MIMEINFOFILES respectively. xdg_pkg_preinst() { local f @@ -50,17 +50,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 '' 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 @@ -68,6 +73,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 @@ -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_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 -- 2.17.1