Gentoo Archives: gentoo-commits

From: Mart Raudsepp <leio@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Mon, 11 Feb 2019 17:18:56
Message-Id: 1549905236.0d3868010666fe2ce95c307028b42d401da73d67.leio@gentoo
1 commit: 0d3868010666fe2ce95c307028b42d401da73d67
2 Author: Marty E. Plummer <hanetzer <AT> startmail <DOT> com>
3 AuthorDate: Tue Jan 1 22:19:13 2019 +0000
4 Commit: Mart Raudsepp <leio <AT> gentoo <DOT> org>
5 CommitDate: Mon Feb 11 17:13:56 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0d386801
7
8 gnome2.eclass: move icon handling code to xdg.eclass
9
10 Package-Manager: Portage-2.3.51, Repoman 2.3.11
11 Signed-off-by: Marty E. Plummer <hanetzer <AT> startmail.com>
12 Signed-off-by: Mart Raudsepp <leio <AT> gentoo.org>
13
14 eclass/gnome2.eclass | 9 +--------
15 eclass/xdg.eclass | 33 +++++++++++++++++++++++++--------
16 2 files changed, 26 insertions(+), 16 deletions(-)
17
18 diff --git a/eclass/gnome2.eclass b/eclass/gnome2.eclass
19 index f741a041c27..d19bd0b9ac6 100644
20 --- a/eclass/gnome2.eclass
21 +++ b/eclass/gnome2.eclass
22 @@ -1,4 +1,4 @@
23 -# Copyright 1999-2015 Gentoo Foundation
24 +# Copyright 1999-2019 Gentoo Authors
25 # Distributed under the terms of the GNU General Public License v2
26
27 # @ECLASS: gnome2.eclass
28 @@ -316,7 +316,6 @@ gnome2_src_install() {
29 gnome2_pkg_preinst() {
30 xdg_pkg_preinst
31 gnome2_gconf_savelist
32 - gnome2_icon_savelist
33 gnome2_schemas_savelist
34 gnome2_scrollkeeper_savelist
35 gnome2_gdk_pixbuf_savelist
36 @@ -338,9 +337,6 @@ gnome2_pkg_preinst() {
37 gnome2_pkg_postinst() {
38 xdg_pkg_postinst
39 gnome2_gconf_install
40 - if [[ -n ${GNOME2_ECLASS_ICONS} ]]; then
41 - gnome2_icon_cache_update
42 - fi
43 if [[ -n ${GNOME2_ECLASS_GLIB_SCHEMAS} ]]; then
44 gnome2_schemas_update
45 fi
46 @@ -362,9 +358,6 @@ gnome2_pkg_postinst() {
47 # Handle scrollkeeper, GSettings, Icons, desktop and mime database updates.
48 gnome2_pkg_postrm() {
49 xdg_pkg_postrm
50 - if [[ -n ${GNOME2_ECLASS_ICONS} ]]; then
51 - gnome2_icon_cache_update
52 - fi
53 if [[ -n ${GNOME2_ECLASS_GLIB_SCHEMAS} ]]; then
54 gnome2_schemas_update
55 fi
56
57 diff --git a/eclass/xdg.eclass b/eclass/xdg.eclass
58 index 9ee771223dc..5ed4739f86a 100644
59 --- a/eclass/xdg.eclass
60 +++ b/eclass/xdg.eclass
61 @@ -1,4 +1,4 @@
62 -# Copyright 1999-2015 Gentoo Foundation
63 +# Copyright 1999-2019 Gentoo Authors
64 # Distributed under the terms of the GNU General Public License v2
65
66 # @ECLASS: xdg.eclass
67 @@ -9,7 +9,7 @@
68 # @SUPPORTED_EAPIS: 4 5 6
69 # @BLURB: Provides phases for XDG compliant packages.
70 # @DESCRIPTION:
71 -# Utility eclass to update the desktop and shared mime info as laid
72 +# Utility eclass to update the desktop, icon and shared mime info as laid
73 # out in the freedesktop specs & implementations
74
75 inherit xdg-utils
76 @@ -40,9 +40,9 @@ xdg_src_prepare() {
77
78 # @FUNCTION: xdg_pkg_preinst
79 # @DESCRIPTION:
80 -# Finds .desktop and mime info files for later handling in pkg_postinst.
81 -# Locations are stored in XDG_ECLASS_DESKTOPFILES and XDG_ECLASS_MIMEINFOFILES
82 -# respectively.
83 +# Finds .desktop, icon and mime info files for later handling in pkg_postinst.
84 +# Locations are stored in XDG_ECLASS_DESKTOPFILES, XDG_ECLASS_ICONFILES
85 +# and XDG_ECLASS_MIMEINFOFILES respectively.
86 xdg_pkg_preinst() {
87 local f
88
89 @@ -51,17 +51,22 @@ xdg_pkg_preinst() {
90 XDG_ECLASS_DESKTOPFILES+=( ${f} )
91 done < <(cd "${D}" && find 'usr/share/applications' -type f -print0 2>/dev/null)
92
93 + XDG_ECLASS_ICONFILES=()
94 + while IFS= read -r -d '' f; do
95 + XDG_ECLASS_ICONFILES+=( ${f} )
96 + done < <(cd "${D}" && find 'usr/share/icons' -type f -print0 2>/dev/null)
97 +
98 XDG_ECLASS_MIMEINFOFILES=()
99 while IFS= read -r -d '' f; do
100 XDG_ECLASS_MIMEINFOFILES+=( ${f} )
101 done < <(cd "${D}" && find 'usr/share/mime' -type f -print0 2>/dev/null)
102
103 - export XDG_ECLASS_DESKTOPFILES XDG_ECLASS_MIMEINFOFILES
104 + export XDG_ECLASS_DESKTOPFILES XDG_ECLASS_ICONFILES XDG_ECLASS_MIMEINFOFILES
105 }
106
107 # @FUNCTION: xdg_pkg_postinst
108 # @DESCRIPTION:
109 -# Handle desktop and mime info database updates.
110 +# Handle desktop, icon and mime info database updates.
111 xdg_pkg_postinst() {
112 if [[ ${#XDG_ECLASS_DESKTOPFILES[@]} -gt 0 ]]; then
113 xdg_desktop_database_update
114 @@ -69,6 +74,12 @@ xdg_pkg_postinst() {
115 debug-print "No .desktop files to add to database"
116 fi
117
118 + if [[ ${#XDG_ECLASS_ICONFILES[@]} -gt 0 ]]; then
119 + xdg_icon_cache_update
120 + else
121 + debug-print "No icon files to add to cache"
122 + fi
123 +
124 if [[ ${#XDG_ECLASS_MIMEINFOFILES[@]} -gt 0 ]]; then
125 xdg_mimeinfo_database_update
126 else
127 @@ -78,7 +89,7 @@ xdg_pkg_postinst() {
128
129 # @FUNCTION: xdg_pkg_postrm
130 # @DESCRIPTION:
131 -# Handle desktop and mime info database updates.
132 +# Handle desktop, icon and mime info database updates.
133 xdg_pkg_postrm() {
134 if [[ ${#XDG_ECLASS_DESKTOPFILES[@]} -gt 0 ]]; then
135 xdg_desktop_database_update
136 @@ -86,6 +97,12 @@ xdg_pkg_postrm() {
137 debug-print "No .desktop files to add to database"
138 fi
139
140 + if [[ ${#XDG_ECLASS_ICONFILES[@]} -gt 0 ]]; then
141 + xdg_icon_cache_update
142 + else
143 + debug-print "No icon files to add to cache"
144 + fi
145 +
146 if [[ ${#XDG_ECLASS_MIMEINFOFILES[@]} -gt 0 ]]; then
147 xdg_mimeinfo_database_update
148 else