Gentoo Archives: gentoo-dev

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

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-dev] [PATCH 4/4] gnome2.eclass: move icon handling code to xdg.eclass "Marty E. Plummer" <hanetzer@×××××××××.com>