public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH] gnome2*.eclass: Move the preinst conditional out of gnome2_schemas_update
@ 2017-07-08 19:55 Michał Górny
  0 siblings, 0 replies; only message in thread
From: Michał Górny @ 2017-07-08 19:55 UTC (permalink / raw
  To: gentoo-dev; +Cc: gnome, Michał Górny

Move the GNOME2_ECLASS_GLIB_SCHEMAS conditional from
gnome2_schemas_update straight into the implementation of gnome2.eclass
postinst/postrm.

This variable is set in preinst to indicate whether any files were
installed. However, the updater itself does not use the list in any way
and updates all the schemas anyway.

Therefore, avoid requiring the ebuilds to explicitly define
preinst/postinst when it is known that the package installs schemas,
and instead let gnome2_schemas_update called in postinst/postrm update
schemas unconditionally.
---
 eclass/gnome2-utils.eclass | 5 -----
 eclass/gnome2.eclass       | 8 ++++++--
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/eclass/gnome2-utils.eclass b/eclass/gnome2-utils.eclass
index a89b9885c391..9b4296c11fad 100644
--- a/eclass/gnome2-utils.eclass
+++ b/eclass/gnome2-utils.eclass
@@ -381,11 +381,6 @@ gnome2_schemas_update() {
 		return
 	fi
 
-	if [[ -z ${GNOME2_ECLASS_GLIB_SCHEMAS} ]]; then
-		debug-print "No GSettings schemas to update"
-		return
-	fi
-
 	ebegin "Updating GSettings schemas"
 	${updater} --allow-any-name "$@" "${EROOT%/}/usr/share/glib-2.0/schemas" &>/dev/null
 	eend $?
diff --git a/eclass/gnome2.eclass b/eclass/gnome2.eclass
index cb233e747605..d2b45ad560b3 100644
--- a/eclass/gnome2.eclass
+++ b/eclass/gnome2.eclass
@@ -340,7 +340,9 @@ gnome2_pkg_postinst() {
 	if [[ -n ${GNOME2_ECLASS_ICONS} ]]; then
 		gnome2_icon_cache_update
 	fi
-	gnome2_schemas_update
+	if [[ -z ${GNOME2_ECLASS_GLIB_SCHEMAS} ]]; then
+		gnome2_schemas_update
+	fi
 	gnome2_scrollkeeper_update
 	gnome2_gdk_pixbuf_update
 
@@ -362,7 +364,9 @@ gnome2_pkg_postrm() {
 	if [[ -n ${GNOME2_ECLASS_ICONS} ]]; then
 		gnome2_icon_cache_update
 	fi
-	gnome2_schemas_update
+	if [[ -z ${GNOME2_ECLASS_GLIB_SCHEMAS} ]]; then
+		gnome2_schemas_update
+	fi
 	gnome2_scrollkeeper_update
 
 	if [[ ${#GNOME2_ECLASS_GIO_MODULES[@]} -gt 0 ]]; then
-- 
2.13.2



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-07-08 19:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-08 19:55 [gentoo-dev] [PATCH] gnome2*.eclass: Move the preinst conditional out of gnome2_schemas_update Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox