Gentoo Archives: gentoo-dev

From: "Marty E. Plummer" <hanetzer@×××××××××.com>
To: "Michał Górny" <mgorny@g.o>
Cc: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [PATCH 4/4] gnome2.eclass: move icon handling code to xdg.eclass
Date: Wed, 20 Jun 2018 09:05:41
Message-Id: 20180620090434.hyyatgvswxdfzilv@proprietary-killer
In Reply to: Re: [gentoo-dev] [PATCH 4/4] gnome2.eclass: move icon handling code to xdg.eclass by "Michał Górny"
1 On Wed, Jun 20, 2018 at 09:27:54AM +0200, Michał Górny wrote:
2 > W dniu śro, 20.06.2018 o godzinie 02∶10 -0500, użytkownik Marty E.
3 > Plummer napisał:
4 > > ---
5 > > eclass/gnome2.eclass | 7 -------
6 > > eclass/xdg.eclass | 27 ++++++++++++++++++++++-----
7 > > 2 files changed, 22 insertions(+), 12 deletions(-)
8 > >
9 > > diff --git a/eclass/gnome2.eclass b/eclass/gnome2.eclass
10 > > index 6db6d08b14e..5b81cb4f01a 100644
11 > > --- a/eclass/gnome2.eclass
12 > > +++ b/eclass/gnome2.eclass
13 > > @@ -315,7 +315,6 @@ gnome2_src_install() {
14 > > gnome2_pkg_preinst() {
15 > > xdg_pkg_preinst
16 > > gnome2_gconf_savelist
17 > > - gnome2_icon_savelist
18 > > gnome2_schemas_savelist
19 > > gnome2_scrollkeeper_savelist
20 > > gnome2_gdk_pixbuf_savelist
21 > > @@ -337,9 +336,6 @@ gnome2_pkg_preinst() {
22 > > gnome2_pkg_postinst() {
23 > > xdg_pkg_postinst
24 > > gnome2_gconf_install
25 > > - if [[ -n ${GNOME2_ECLASS_ICONS} ]]; then
26 > > - gnome2_icon_cache_update
27 > > - fi
28 > > if [[ -n ${GNOME2_ECLASS_GLIB_SCHEMAS} ]]; then
29 > > gnome2_schemas_update
30 > > fi
31 > > @@ -361,9 +357,6 @@ gnome2_pkg_postinst() {
32 > > # Handle scrollkeeper, GSettings, Icons, desktop and mime database updates.
33 > > gnome2_pkg_postrm() {
34 > > xdg_pkg_postrm
35 > > - if [[ -n ${GNOME2_ECLASS_ICONS} ]]; then
36 > > - gnome2_icon_cache_update
37 > > - fi
38 > > if [[ -n ${GNOME2_ECLASS_GLIB_SCHEMAS} ]]; then
39 > > gnome2_schemas_update
40 > > fi
41 > > diff --git a/eclass/xdg.eclass b/eclass/xdg.eclass
42 > > index fd4816b8447..29830a5ee15 100644
43 > > --- a/eclass/xdg.eclass
44 > > +++ b/eclass/xdg.eclass
45 > > @@ -39,9 +39,9 @@ xdg_src_prepare() {
46 > >
47 > > # @FUNCTION: xdg_pkg_preinst
48 > > # @DESCRIPTION:
49 > > -# Finds .desktop and mime info files for later handling in pkg_postinst.
50 > > -# Locations are stored in XDG_ECLASS_DESKTOPFILES and XDG_ECLASS_MIMEINFOFILES
51 > > -# respectively.
52 > > +# Finds .desktop, icon, and mime info files for later handling in pkg_postinst.
53 > > +# Locations are stored in XDG_ECLASS_DESKTOPFILES, XDG_ECLASS_ICONS and
54 > > +# XDG_ECLASS_MIMEINFOFILES respectively.
55 > > xdg_pkg_preinst() {
56 > > local f
57 > >
58 > > @@ -50,6 +50,11 @@ xdg_pkg_preinst() {
59 > > XDG_ECLASS_DESKTOPFILES+=( ${f} )
60 > > done < <(cd "${D}" && find 'usr/share/applications' -type f -print0 2>/dev/null)
61 > >
62 > > + XDG_ECLASS_ICONS=()
63 > > + while IFS= read -r -d '' f; do
64 > > + XDG_ECLASS_ICONS+=( ${f} )
65 > > + done < <(cd "${D}" && find 'usr/share/icons' -type f -print0 2>/dev/null)
66 >
67 > If you inline it anyway, why add xdg_*_savelist for it?
68 >
69 Too keep a stub that still 'works' for ebuilds using
70 gnome2_icon_savelist from gnome2-utils.eclass.
71 > > +
72 > > XDG_ECLASS_MIMEINFOFILES=()
73 > > while IFS= read -r -d '' f; do
74 > > XDG_ECLASS_MIMEINFOFILES+=( ${f} )
75 > > @@ -60,7 +65,7 @@ xdg_pkg_preinst() {
76 > >
77 > > # @FUNCTION: xdg_pkg_postinst
78 > > # @DESCRIPTION:
79 > > -# Handle desktop and mime info database updates.
80 > > +# Handle desktop, icon and mime info database updates.
81 > > xdg_pkg_postinst() {
82 > > if [[ ${#XDG_ECLASS_DESKTOPFILES[@]} -gt 0 ]]; then
83 > > xdg_desktop_database_update
84 > > @@ -68,6 +73,12 @@ xdg_pkg_postinst() {
85 > > debug-print "No .desktop files to add to database"
86 > > fi
87 > >
88 > > + if [[ ${#XDG_ECLASS_ICONS[@]} -gt 0 ]]; then
89 > > + xdg_icon_cache_update
90 > > + else
91 > > + debug-print "No icon files to add to database"
92 > > + fi
93 > > +
94 > > if [[ ${#XDG_ECLASS_MIMEINFOFILES[@]} -gt 0 ]]; then
95 > > xdg_mimeinfo_database_update
96 > > else
97 > > @@ -77,7 +88,7 @@ xdg_pkg_postinst() {
98 > >
99 > > # @FUNCTION: xdg_pkg_postrm
100 > > # @DESCRIPTION:
101 > > -# Handle desktop and mime info database updates.
102 > > +# Handle desktop, icon and mime info database updates.
103 > > xdg_pkg_postrm() {
104 > > if [[ ${#XDG_ECLASS_DESKTOPFILES[@]} -gt 0 ]]; then
105 > > xdg_desktop_database_update
106 > > @@ -85,6 +96,12 @@ xdg_pkg_postrm() {
107 > > debug-print "No .desktop files to add to database"
108 > > fi
109 > >
110 > > + if [[ ${#XDG_ECLASS_ICONS[@]} -gt 0 ]]; then
111 > > + xdg_icon_cache_update
112 > > + else
113 > > + debug-print "No icon files to add to database"
114 > > + fi
115 > > +
116 > > if [[ ${#XDG_ECLASS_MIMEINFOFILES[@]} -gt 0 ]]; then
117 > > xdg_mimeinfo_database_update
118 > > else
119 >
120 > --
121 > Best regards,
122 > Michał Górny

Replies