public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH 1/4] xdg-utils.eclass: make EAPI 7 ready
@ 2018-06-20  7:10 Marty E. Plummer
  2018-06-20  7:10 ` [gentoo-dev] [PATCH 2/4] gnome2-utils.eclass: " Marty E. Plummer
                   ` (3 more replies)
  0 siblings, 4 replies; 24+ messages in thread
From: Marty E. Plummer @ 2018-06-20  7:10 UTC (permalink / raw
  To: gentoo-dev; +Cc: Marty E. Plummer

Use ${EROOT%/} whereever possible, as the tools and directories which
are used with it are already prefixed with a /

Package-Manager: Portage-2.3.40, Repoman-2.3.9
---
 eclass/xdg-utils.eclass | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/eclass/xdg-utils.eclass b/eclass/xdg-utils.eclass
index ac075185d8e..8dba5ed6861 100644
--- a/eclass/xdg-utils.eclass
+++ b/eclass/xdg-utils.eclass
@@ -15,7 +15,7 @@
 #  * XDG mime information database management
 
 case "${EAPI:-0}" in
-	0|1|2|3|4|5|6) ;;
+	0|1|2|3|4|5|6|7) ;;
 	*) die "EAPI=${EAPI} is not supported" ;;
 esac
 
@@ -66,7 +66,7 @@ xdg_environment_reset() {
 # Updates the .desktop files database.
 # Generates a list of mimetypes linked to applications that can handle them
 xdg_desktop_database_update() {
-	local updater="${EROOT}${DESKTOP_DATABASE_UPDATE_BIN}"
+	local updater="${EROOT%/}${DESKTOP_DATABASE_UPDATE_BIN}"
 
 	if [[ ${EBUILD_PHASE} != post* ]] ; then
 		die "xdg_desktop_database_update must be used in pkg_post* phases."
@@ -78,7 +78,7 @@ xdg_desktop_database_update() {
 	fi
 
 	ebegin "Updating .desktop files database"
-	"${updater}" -q "${EROOT}${DESKTOP_DATABASE_DIR}"
+	"${updater}" -q "${EROOT%/}${DESKTOP_DATABASE_DIR}"
 	eend $?
 }
 
@@ -87,7 +87,7 @@ xdg_desktop_database_update() {
 # Update the mime database.
 # Creates a general list of mime types from several sources
 xdg_mimeinfo_database_update() {
-	local updater="${EROOT}${MIMEINFO_DATABASE_UPDATE_BIN}"
+	local updater="${EROOT%/}${MIMEINFO_DATABASE_UPDATE_BIN}"
 
 	if [[ ${EBUILD_PHASE} != post* ]] ; then
 		die "xdg_mimeinfo_database_update must be used in pkg_post* phases."
@@ -99,6 +99,6 @@ xdg_mimeinfo_database_update() {
 	fi
 
 	ebegin "Updating shared mime info database"
-	"${updater}" "${EROOT}${MIMEINFO_DATABASE_DIR}"
+	"${updater}" "${EROOT%/}${MIMEINFO_DATABASE_DIR}"
 	eend $?
 }
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [gentoo-dev] [PATCH 2/4] gnome2-utils.eclass: make EAPI 7 ready
  2018-06-20  7:10 [gentoo-dev] [PATCH 1/4] xdg-utils.eclass: make EAPI 7 ready Marty E. Plummer
@ 2018-06-20  7:10 ` Marty E. Plummer
  2018-06-20  7:25   ` Michał Górny
  2018-06-20  7:10 ` [gentoo-dev] [PATCH 3/4] gnome2-utils: move icon functions into xdg-utils Marty E. Plummer
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 24+ messages in thread
From: Marty E. Plummer @ 2018-06-20  7:10 UTC (permalink / raw
  To: gentoo-dev; +Cc: Marty E. Plummer

Use ${EROOT%/} whereever possible, as most of the directories and files
used in conjunction with it have a leading /; add missing leading /
where apropriate.

Package-Manager: Portage-2.3.40, Repoman-2.3.9
---
 eclass/gnome2-utils.eclass | 41 ++++++++++++++++++--------------------
 1 file changed, 19 insertions(+), 22 deletions(-)

diff --git a/eclass/gnome2-utils.eclass b/eclass/gnome2-utils.eclass
index 65076ae2d61..14fb9e7420c 100644
--- a/eclass/gnome2-utils.eclass
+++ b/eclass/gnome2-utils.eclass
@@ -18,7 +18,7 @@
 inherit eutils xdg-utils
 
 case "${EAPI:-0}" in
-	0|1|2|3|4|5|6) ;;
+	0|1|2|3|4|5|6|7) ;;
 	*) die "EAPI=${EAPI} is not supported" ;;
 esac
 
@@ -82,9 +82,6 @@ esac
 # @DESCRIPTION:
 # List of gdk-pixbuf loaders provided by the package
 
-DEPEND=">=sys-apps/sed-4"
-
-
 # @FUNCTION: gnome2_environment_reset
 # @DESCRIPTION:
 # Reset various variables inherited from root's evironment to a reasonable
@@ -101,7 +98,7 @@ gnome2_environment_reset() {
 	# Ensure we don't rely on dconf/gconf while building, bug #511946
 	export GSETTINGS_BACKEND="memory"
 
-	if has ${EAPI:-0} 6; then
+	if has ${EAPI:-0} 6 7; then
 		# Try to cover the packages honoring this variable, bug #508124
 		export GST_INSPECT="$(type -P true)"
 
@@ -129,7 +126,7 @@ gnome2_gconf_savelist() {
 # This function should be called from pkg_postinst.
 gnome2_gconf_install() {
 	has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
-	local updater="${EROOT}${GCONFTOOL_BIN}"
+	local updater="${EROOT%/}${GCONFTOOL_BIN}"
 
 	if [[ ! -x "${updater}" ]]; then
 		debug-print "${updater} is not executable"
@@ -149,9 +146,9 @@ gnome2_gconf_install() {
 
 	local F
 	for F in ${GNOME2_ECLASS_SCHEMAS}; do
-		if [[ -e "${EROOT}${F}" ]]; then
+		if [[ -e "${EROOT%/}${F}" ]]; then
 			debug-print "Installing schema: ${F}"
-			"${updater}" --makefile-install-rule "${EROOT}${F}" 1>/dev/null
+			"${updater}" --makefile-install-rule "${EROOT%/}${F}" 1>/dev/null
 		fi
 	done
 
@@ -170,7 +167,7 @@ gnome2_gconf_install() {
 # database.
 gnome2_gconf_uninstall() {
 	has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
-	local updater="${EROOT}${GCONFTOOL_BIN}"
+	local updater="${EROOT%/}${GCONFTOOL_BIN}"
 
 	if [[ ! -x "${updater}" ]]; then
 		debug-print "${updater} is not executable"
@@ -189,9 +186,9 @@ gnome2_gconf_uninstall() {
 
 	local F
 	for F in ${GNOME2_ECLASS_SCHEMAS}; do
-		if [[ -e "${EROOT}${F}" ]]; then
+		if [[ -e "${EROOT%/}${F}" ]]; then
 			debug-print "Uninstalling gconf schema: ${F}"
-			"${updater}" --makefile-uninstall-rule "${EROOT}${F}" 1>/dev/null
+			"${updater}" --makefile-uninstall-rule "${EROOT%/}${F}" 1>/dev/null
 		fi
 	done
 
@@ -224,7 +221,7 @@ gnome2_icon_savelist() {
 # This function should be called from pkg_postinst and pkg_postrm.
 gnome2_icon_cache_update() {
 	has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
-	local updater="${EROOT}${GTK_UPDATE_ICON_CACHE}"
+	local updater="${EROOT%/}${GTK_UPDATE_ICON_CACHE}"
 
 	if [[ ! -x "${updater}" ]] ; then
 		debug-print "${updater} is not executable"
@@ -339,7 +336,7 @@ gnome2_scrollkeeper_savelist() {
 # This function should be called from pkg_postinst and pkg_postrm.
 gnome2_scrollkeeper_update() {
 	has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
-	local updater="${EROOT}${SCROLLKEEPER_UPDATE_BIN}"
+	local updater="${EROOT%/}${SCROLLKEEPER_UPDATE_BIN}"
 
 	if [[ ! -x "${updater}" ]] ; then
 		debug-print "${updater} is not executable"
@@ -352,7 +349,7 @@ gnome2_scrollkeeper_update() {
 	fi
 
 	ebegin "Updating scrollkeeper database ..."
-	"${updater}" -q -p "${EROOT}${SCROLLKEEPER_DIR}"
+	"${updater}" -q -p "${EROOT%/}${SCROLLKEEPER_DIR}"
 	eend $?
 }
 
@@ -376,7 +373,7 @@ gnome2_schemas_savelist() {
 # This function should be called from pkg_postinst and pkg_postrm.
 gnome2_schemas_update() {
 	has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
-	local updater="${EROOT}${GLIB_COMPILE_SCHEMAS}"
+	local updater="${EROOT%/}${GLIB_COMPILE_SCHEMAS}"
 
 	if [[ ! -x ${updater} ]]; then
 		debug-print "${updater} is not executable"
@@ -407,10 +404,10 @@ gnome2_gdk_pixbuf_savelist() {
 # This function should be called from pkg_postinst and pkg_postrm.
 gnome2_gdk_pixbuf_update() {
 	has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
-	local updater="${EROOT}/usr/bin/${CHOST}-gdk-pixbuf-query-loaders"
+	local updater="${EROOT%/}/usr/bin/${CHOST}-gdk-pixbuf-query-loaders"
 
 	if [[ ! -x ${updater} ]]; then
-		updater="${EROOT}/usr/bin/gdk-pixbuf-query-loaders"
+		updater="${EROOT%/}/usr/bin/gdk-pixbuf-query-loaders"
 	fi
 
 	if [[ ! -x ${updater} ]]; then
@@ -427,7 +424,7 @@ gnome2_gdk_pixbuf_update() {
 	local tmp_file=$(emktemp)
 	${updater} 1> "${tmp_file}" &&
 	chmod 0644 "${tmp_file}" &&
-	cp -f "${tmp_file}" "${EROOT}usr/$(get_libdir)/gdk-pixbuf-2.0/2.10.0/loaders.cache" &&
+	cp -f "${tmp_file}" "${EROOT%/}/usr/$(get_libdir)/gdk-pixbuf-2.0/2.10.0/loaders.cache" &&
 	rm "${tmp_file}" # don't replace this with mv, required for SELinux support
 	eend $?
 }
@@ -441,7 +438,7 @@ gnome2_query_immodules_gtk2() {
 	[[ ! -x ${updater} ]] && updater=${EPREFIX}/usr/bin/gtk-query-immodules-2.0
 
 	ebegin "Updating gtk2 input method module cache"
-	GTK_IM_MODULE_FILE="${EROOT}usr/$(get_libdir)/gtk-2.0/2.10.0/immodules.cache" \
+	GTK_IM_MODULE_FILE="${EROOT%/}/usr/$(get_libdir)/gtk-2.0/2.10.0/immodules.cache" \
 		"${updater}" --update-cache
 	eend $?
 }
@@ -455,7 +452,7 @@ gnome2_query_immodules_gtk3() {
 	[[ ! -x ${updater} ]] && updater=${EPREFIX}/usr/bin/gtk-query-immodules-3.0
 
 	ebegin "Updating gtk3 input method module cache"
-	GTK_IM_MODULE_FILE="${EROOT}usr/$(get_libdir)/gtk-3.0/3.0.0/immodules.cache" \
+	GTK_IM_MODULE_FILE="${EROOT%/}/usr/$(get_libdir)/gtk-3.0/3.0.0/immodules.cache" \
 		"${updater}" --update-cache
 	eend $?
 }
@@ -467,10 +464,10 @@ gnome2_query_immodules_gtk3() {
 # This function should be called from pkg_postinst and pkg_postrm.
 gnome2_giomodule_cache_update() {
 	has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
-	local updater="${EROOT}/usr/bin/${CHOST}-gio-querymodules"
+	local updater="${EROOT%/}/usr/bin/${CHOST}-gio-querymodules"
 
 	if [[ ! -x ${updater} ]]; then
-		updater="${EROOT}/usr/bin/gio-querymodules"
+		updater="${EROOT%/}/usr/bin/gio-querymodules"
 	fi
 
 	if [[ ! -x ${updater} ]]; then
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [gentoo-dev] [PATCH 3/4] gnome2-utils: move icon functions into xdg-utils
  2018-06-20  7:10 [gentoo-dev] [PATCH 1/4] xdg-utils.eclass: make EAPI 7 ready Marty E. Plummer
  2018-06-20  7:10 ` [gentoo-dev] [PATCH 2/4] gnome2-utils.eclass: " Marty E. Plummer
@ 2018-06-20  7:10 ` Marty E. Plummer
  2018-06-20  7:27   ` Michał Górny
  2018-06-20  7:10 ` [gentoo-dev] [PATCH 4/4] gnome2.eclass: move icon handling code to xdg.eclass Marty E. Plummer
  2018-06-20 13:03 ` [gentoo-dev] [PATCH 1/4] xdg-utils.eclass: make EAPI 7 ready Jason Zaman
  3 siblings, 1 reply; 24+ messages in thread
From: Marty E. Plummer @ 2018-06-20  7:10 UTC (permalink / raw
  To: gentoo-dev; +Cc: Marty E. Plummer

Kept some dummy stub functions in place in order to maintain
functionality of existing ebuilds, along with a QA warning to migrate
from one eclass to the other.
---
 eclass/gnome2-utils.eclass | 73 ++++++----------------------------
 eclass/xdg-utils.eclass    | 80 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 91 insertions(+), 62 deletions(-)

diff --git a/eclass/gnome2-utils.eclass b/eclass/gnome2-utils.eclass
index 14fb9e7420c..a355f0f4f13 100644
--- a/eclass/gnome2-utils.eclass
+++ b/eclass/gnome2-utils.eclass
@@ -40,12 +40,6 @@ esac
 # Path to scrollkeeper-update
 : ${SCROLLKEEPER_UPDATE_BIN:="/usr/bin/scrollkeeper-update"}
 
-# @ECLASS-VARIABLE: GTK_UPDATE_ICON_CACHE
-# @INTERNAL
-# @DESCRIPTION:
-# Path to gtk-update-icon-cache
-: ${GTK_UPDATE_ICON_CACHE:="/usr/bin/gtk-update-icon-cache"}
-
 # @ECLASS-VARIABLE: GLIB_COMPILE_SCHEMAS
 # @INTERNAL
 # @DESCRIPTION:
@@ -203,68 +197,23 @@ gnome2_gconf_uninstall() {
 
 # @FUNCTION: gnome2_icon_savelist
 # @DESCRIPTION:
-# Find the icons that are about to be installed and save their location
-# in the GNOME2_ECLASS_ICONS environment variable. This is only
-# necessary for eclass implementations that call
-# gnome2_icon_cache_update conditionally.
-# This function should be called from pkg_preinst.
+# Deprecated. Use xdg_icon_savelist from xdg-utils.eclass instead.
 gnome2_icon_savelist() {
-	has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
-	pushd "${ED}" > /dev/null || die
-	export GNOME2_ECLASS_ICONS=$(find 'usr/share/icons' -maxdepth 1 -mindepth 1 -type d 2> /dev/null)
-	popd > /dev/null || die
+	eqawarn "QA warning: gnome2_icon_savelist has been moved to xdg-utils.eclass"
+	eqawarn "and is now called xdg_icon_savelist. Please migrate your ebuild and"
+	eqawarn "eclasses to use it"
+	xdg_icon_savelist
+	GNOME2_ECLASS_ICONS="${XDG_ECLASS_ICONS}"
 }
 
 # @FUNCTION: gnome2_icon_cache_update
 # @DESCRIPTION:
-# Updates Gtk+ icon cache files under /usr/share/icons.
-# This function should be called from pkg_postinst and pkg_postrm.
+# Deprecated. Use xdg_icon_cache_update from xdg-utils.eclass instead.
 gnome2_icon_cache_update() {
-	has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
-	local updater="${EROOT%/}${GTK_UPDATE_ICON_CACHE}"
-
-	if [[ ! -x "${updater}" ]] ; then
-		debug-print "${updater} is not executable"
-		return
-	fi
-
-	ebegin "Updating icons cache"
-
-	local retval=0
-	local fails=( )
-
-	for dir in "${EROOT%/}"/usr/share/icons/*
-	do
-		if [[ -f "${dir}/index.theme" ]] ; then
-			local rv=0
-
-			"${updater}" -qf "${dir}"
-			rv=$?
-
-			if [[ ! $rv -eq 0 ]] ; then
-				debug-print "Updating cache failed on ${dir}"
-
-				# Add to the list of failures
-				fails+=( "${dir}" )
-
-				retval=2
-			fi
-		elif [[ $(ls "${dir}") = "icon-theme.cache" ]]; then
-			# Clear stale cache files after theme uninstallation
-			rm "${dir}/icon-theme.cache"
-		fi
-
-		if [[ -z $(ls "${dir}") ]]; then
-			# Clear empty theme directories after theme uninstallation
-			rmdir "${dir}"
-		fi
-	done
-
-	eend ${retval}
-
-	for f in "${fails[@]}" ; do
-		eerror "Failed to update cache with icon $f"
-	done
+	eqawarn "QA warning: gnome2_icon_cache_update has been moved to xdg-utils.eclass"
+	eqawarn "and is now called xdg_icon_cache_update. Please migrate your ebuild and"
+	eqawarn "eclasses to use it"
+	xdg_icon_cache_update
 }
 
 # @FUNCTION: gnome2_omf_fix
diff --git a/eclass/xdg-utils.eclass b/eclass/xdg-utils.eclass
index 8dba5ed6861..37e1893a701 100644
--- a/eclass/xdg-utils.eclass
+++ b/eclass/xdg-utils.eclass
@@ -31,6 +31,12 @@ esac
 # Directory where .desktop files database is stored
 : ${DESKTOP_DATABASE_DIR="/usr/share/applications"}
 
+# @ECLASS-VARIABLE: GTK_UPDATE_ICON_CACHE
+# @INTERNAL
+# @DESCRIPTION:
+# Path to gtk-update-icon-cache
+: ${GTK_UPDATE_ICON_CACHE:="/usr/bin/gtk-update-icon-cache"}
+
 # @ECLASS-VARIABLE: MIMEINFO_DATABASE_UPDATE_BIN
 # @INTERNAL
 # @DESCRIPTION:
@@ -43,6 +49,12 @@ esac
 # Directory where .desktop files database is stored
 : ${MIMEINFO_DATABASE_DIR:="/usr/share/mime"}
 
+# @ECLASS-VARIABLE: XDG_ECLASS_ICONS
+# @INTERNAL
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# List of icons provided by the package
+
 # @FUNCTION: xdg_environment_reset
 # @DESCRIPTION:
 # Clean up environment for clean builds.
@@ -82,6 +94,74 @@ xdg_desktop_database_update() {
 	eend $?
 }
 
+# @FUNCTION: xdg_icon_savelist
+# @DESCRIPTION:
+# Find the icons that are about to be installed and save their location
+# in the XDG_ECLASS_ICONS environment variable. This is only
+# necessary for eclass implementations that call
+# xdg_icon_cache_update conditionally.
+# This function should be called from pkg_preinst.
+xdg_icon_savelist() {
+	XDG_ECLASS_ICONS=()
+	while IFS= read -r -d '' f; do
+		XDG_ECLASS_ICONS+=( ${f} )
+	done < <(cd "${D}" && find 'usr/share/icons' -type f -print0 2>/dev/null)
+
+	export XDG_ECLASS_ICONS
+}
+
+# @FUNCTION: xdg_icon_cache_update
+# @DESCRIPTION:
+# Updates Gtk+ icon cache files under /usr/share/icons.
+# This function should be called from pkg_postinst and pkg_postrm.
+xdg_icon_cache_update() {
+	has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
+	local updater="${EROOT%/}${GTK_UPDATE_ICON_CACHE}"
+
+	if [[ ! -x "${updater}" ]] ; then
+		debug-print "${updater} is not executable"
+		return
+	fi
+
+	ebegin "Updating icons cache"
+
+	local retval=0
+	local fails=( )
+
+	for dir in "${EROOT%/}"/usr/share/icons/*
+	do
+		if [[ -f "${dir}/index.theme" ]] ; then
+			local rv=0
+
+			"${updater}" -qf "${dir}"
+			rv=$?
+
+			if [[ ! $rv -eq 0 ]] ; then
+				debug-print "Updating cache failed on ${dir}"
+
+				# Add to the list of failures
+				fails+=( "${dir}" )
+
+				retval=2
+			fi
+		elif [[ $(ls "${dir}") = "icon-theme.cache" ]]; then
+			# Clear stale cache files after theme uninstallation
+			rm "${dir}/icon-theme.cache"
+		fi
+
+		if [[ -z $(ls "${dir}") ]]; then
+			# Clear empty theme directories after theme uninstallation
+			rmdir "${dir}"
+		fi
+	done
+
+	eend ${retval}
+
+	for f in "${fails[@]}" ; do
+		eerror "Failed to update cache with icon $f"
+	done
+}
+
 # @FUNCTION: xdg_mimeinfo_database_update
 # @DESCRIPTION:
 # Update the mime database.
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [gentoo-dev] [PATCH 4/4] gnome2.eclass: move icon handling code to xdg.eclass
  2018-06-20  7:10 [gentoo-dev] [PATCH 1/4] xdg-utils.eclass: make EAPI 7 ready Marty E. Plummer
  2018-06-20  7:10 ` [gentoo-dev] [PATCH 2/4] gnome2-utils.eclass: " Marty E. Plummer
  2018-06-20  7:10 ` [gentoo-dev] [PATCH 3/4] gnome2-utils: move icon functions into xdg-utils Marty E. Plummer
@ 2018-06-20  7:10 ` Marty E. Plummer
  2018-06-20  7:27   ` Michał Górny
  2018-06-20 13:03 ` [gentoo-dev] [PATCH 1/4] xdg-utils.eclass: make EAPI 7 ready Jason Zaman
  3 siblings, 1 reply; 24+ messages in thread
From: Marty E. Plummer @ 2018-06-20  7:10 UTC (permalink / raw
  To: gentoo-dev; +Cc: Marty E. Plummer

---
 eclass/gnome2.eclass |  7 -------
 eclass/xdg.eclass    | 27 ++++++++++++++++++++++-----
 2 files changed, 22 insertions(+), 12 deletions(-)

diff --git a/eclass/gnome2.eclass b/eclass/gnome2.eclass
index 6db6d08b14e..5b81cb4f01a 100644
--- a/eclass/gnome2.eclass
+++ b/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..29830a5ee15 100644
--- a/eclass/xdg.eclass
+++ b/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_ICONS and
+# XDG_ECLASS_MIMEINFOFILES respectively.
 xdg_pkg_preinst() {
 	local f
 
@@ -50,6 +50,11 @@ xdg_pkg_preinst() {
 		XDG_ECLASS_DESKTOPFILES+=( ${f} )
 	done < <(cd "${D}" && find 'usr/share/applications' -type f -print0 2>/dev/null)
 
+	XDG_ECLASS_ICONS=()
+	while IFS= read -r -d '' f; do
+		XDG_ECLASS_ICONS+=( ${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} )
@@ -60,7 +65,7 @@ xdg_pkg_preinst() {
 
 # @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_ICONS[@]} -gt 0 ]]; then
+		xdg_icon_cache_update
+	else
+		debug-print "No icon files to add to database"
+	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_ICONS[@]} -gt 0 ]]; then
+		xdg_icon_cache_update
+	else
+		debug-print "No icon files to add to database"
+	fi
+
 	if [[ ${#XDG_ECLASS_MIMEINFOFILES[@]} -gt 0 ]]; then
 		xdg_mimeinfo_database_update
 	else
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* Re: [gentoo-dev] [PATCH 2/4] gnome2-utils.eclass: make EAPI 7 ready
  2018-06-20  7:10 ` [gentoo-dev] [PATCH 2/4] gnome2-utils.eclass: " Marty E. Plummer
@ 2018-06-20  7:25   ` Michał Górny
  2018-06-20  9:00     ` Marty E. Plummer
  2018-06-21  0:43     ` Marty E. Plummer
  0 siblings, 2 replies; 24+ messages in thread
From: Michał Górny @ 2018-06-20  7:25 UTC (permalink / raw
  To: gentoo-dev; +Cc: Marty E. Plummer

[-- Attachment #1: Type: text/plain, Size: 7008 bytes --]

W dniu śro, 20.06.2018 o godzinie 02∶10 -0500, użytkownik Marty E.
Plummer napisał:
> Use ${EROOT%/} whereever possible, as most of the directories and files
> used in conjunction with it have a leading /; add missing leading /
> where apropriate.
> 
> Package-Manager: Portage-2.3.40, Repoman-2.3.9
> ---
>  eclass/gnome2-utils.eclass | 41 ++++++++++++++++++--------------------
>  1 file changed, 19 insertions(+), 22 deletions(-)
> 
> diff --git a/eclass/gnome2-utils.eclass b/eclass/gnome2-utils.eclass
> index 65076ae2d61..14fb9e7420c 100644
> --- a/eclass/gnome2-utils.eclass
> +++ b/eclass/gnome2-utils.eclass
> @@ -18,7 +18,7 @@
>  inherit eutils xdg-utils
>  
>  case "${EAPI:-0}" in
> -	0|1|2|3|4|5|6) ;;
> +	0|1|2|3|4|5|6|7) ;;
>  	*) die "EAPI=${EAPI} is not supported" ;;
>  esac
>  
> @@ -82,9 +82,6 @@ esac
>  # @DESCRIPTION:
>  # List of gdk-pixbuf loaders provided by the package
>  
> -DEPEND=">=sys-apps/sed-4"
> -
> -
>  # @FUNCTION: gnome2_environment_reset
>  # @DESCRIPTION:
>  # Reset various variables inherited from root's evironment to a reasonable
> @@ -101,7 +98,7 @@ gnome2_environment_reset() {
>  	# Ensure we don't rely on dconf/gconf while building, bug #511946
>  	export GSETTINGS_BACKEND="memory"
>  
> -	if has ${EAPI:-0} 6; then
> +	if has ${EAPI:-0} 6 7; then
>  		# Try to cover the packages honoring this variable, bug #508124
>  		export GST_INSPECT="$(type -P true)"
>  
> @@ -129,7 +126,7 @@ gnome2_gconf_savelist() {
>  # This function should be called from pkg_postinst.
>  gnome2_gconf_install() {
>  	has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
> -	local updater="${EROOT}${GCONFTOOL_BIN}"
> +	local updater="${EROOT%/}${GCONFTOOL_BIN}"
>  
>  	if [[ ! -x "${updater}" ]]; then
>  		debug-print "${updater} is not executable"
> @@ -149,9 +146,9 @@ gnome2_gconf_install() {
>  
>  	local F
>  	for F in ${GNOME2_ECLASS_SCHEMAS}; do
> -		if [[ -e "${EROOT}${F}" ]]; then
> +		if [[ -e "${EROOT%/}${F}" ]]; then
>  			debug-print "Installing schema: ${F}"
> -			"${updater}" --makefile-install-rule "${EROOT}${F}" 1>/dev/null
> +			"${updater}" --makefile-install-rule "${EROOT%/}${F}" 1>/dev/null
>  		fi
>  	done
>  
> @@ -170,7 +167,7 @@ gnome2_gconf_install() {
>  # database.
>  gnome2_gconf_uninstall() {
>  	has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
> -	local updater="${EROOT}${GCONFTOOL_BIN}"
> +	local updater="${EROOT%/}${GCONFTOOL_BIN}"
>  
>  	if [[ ! -x "${updater}" ]]; then
>  		debug-print "${updater} is not executable"
> @@ -189,9 +186,9 @@ gnome2_gconf_uninstall() {
>  
>  	local F
>  	for F in ${GNOME2_ECLASS_SCHEMAS}; do
> -		if [[ -e "${EROOT}${F}" ]]; then
> +		if [[ -e "${EROOT%/}${F}" ]]; then
>  			debug-print "Uninstalling gconf schema: ${F}"
> -			"${updater}" --makefile-uninstall-rule "${EROOT}${F}" 1>/dev/null
> +			"${updater}" --makefile-uninstall-rule "${EROOT%/}${F}" 1>/dev/null
>  		fi
>  	done
>  
> @@ -224,7 +221,7 @@ gnome2_icon_savelist() {
>  # This function should be called from pkg_postinst and pkg_postrm.
>  gnome2_icon_cache_update() {
>  	has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
> -	local updater="${EROOT}${GTK_UPDATE_ICON_CACHE}"
> +	local updater="${EROOT%/}${GTK_UPDATE_ICON_CACHE}"
>  
>  	if [[ ! -x "${updater}" ]] ; then
>  		debug-print "${updater} is not executable"
> @@ -339,7 +336,7 @@ gnome2_scrollkeeper_savelist() {
>  # This function should be called from pkg_postinst and pkg_postrm.
>  gnome2_scrollkeeper_update() {
>  	has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
> -	local updater="${EROOT}${SCROLLKEEPER_UPDATE_BIN}"
> +	local updater="${EROOT%/}${SCROLLKEEPER_UPDATE_BIN}"
>  
>  	if [[ ! -x "${updater}" ]] ; then
>  		debug-print "${updater} is not executable"
> @@ -352,7 +349,7 @@ gnome2_scrollkeeper_update() {
>  	fi
>  
>  	ebegin "Updating scrollkeeper database ..."
> -	"${updater}" -q -p "${EROOT}${SCROLLKEEPER_DIR}"
> +	"${updater}" -q -p "${EROOT%/}${SCROLLKEEPER_DIR}"
>  	eend $?
>  }
>  
> @@ -376,7 +373,7 @@ gnome2_schemas_savelist() {
>  # This function should be called from pkg_postinst and pkg_postrm.
>  gnome2_schemas_update() {
>  	has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
> -	local updater="${EROOT}${GLIB_COMPILE_SCHEMAS}"
> +	local updater="${EROOT%/}${GLIB_COMPILE_SCHEMAS}"
>  
>  	if [[ ! -x ${updater} ]]; then
>  		debug-print "${updater} is not executable"
> @@ -407,10 +404,10 @@ gnome2_gdk_pixbuf_savelist() {
>  # This function should be called from pkg_postinst and pkg_postrm.
>  gnome2_gdk_pixbuf_update() {
>  	has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
> -	local updater="${EROOT}/usr/bin/${CHOST}-gdk-pixbuf-query-loaders"
> +	local updater="${EROOT%/}/usr/bin/${CHOST}-gdk-pixbuf-query-loaders"
>  
>  	if [[ ! -x ${updater} ]]; then
> -		updater="${EROOT}/usr/bin/gdk-pixbuf-query-loaders"
> +		updater="${EROOT%/}/usr/bin/gdk-pixbuf-query-loaders"
>  	fi
>  
>  	if [[ ! -x ${updater} ]]; then
> @@ -427,7 +424,7 @@ gnome2_gdk_pixbuf_update() {
>  	local tmp_file=$(emktemp)
>  	${updater} 1> "${tmp_file}" &&
>  	chmod 0644 "${tmp_file}" &&
> -	cp -f "${tmp_file}" "${EROOT}usr/$(get_libdir)/gdk-pixbuf-2.0/2.10.0/loaders.cache" &&
> +	cp -f "${tmp_file}" "${EROOT%/}/usr/$(get_libdir)/gdk-pixbuf-2.0/2.10.0/loaders.cache" &&
>  	rm "${tmp_file}" # don't replace this with mv, required for SELinux support
>  	eend $?
>  }
> @@ -441,7 +438,7 @@ gnome2_query_immodules_gtk2() {
>  	[[ ! -x ${updater} ]] && updater=${EPREFIX}/usr/bin/gtk-query-immodules-2.0
>  
>  	ebegin "Updating gtk2 input method module cache"
> -	GTK_IM_MODULE_FILE="${EROOT}usr/$(get_libdir)/gtk-2.0/2.10.0/immodules.cache" \
> +	GTK_IM_MODULE_FILE="${EROOT%/}/usr/$(get_libdir)/gtk-2.0/2.10.0/immodules.cache" \
>  		"${updater}" --update-cache
>  	eend $?
>  }
> @@ -455,7 +452,7 @@ gnome2_query_immodules_gtk3() {
>  	[[ ! -x ${updater} ]] && updater=${EPREFIX}/usr/bin/gtk-query-immodules-3.0
>  
>  	ebegin "Updating gtk3 input method module cache"
> -	GTK_IM_MODULE_FILE="${EROOT}usr/$(get_libdir)/gtk-3.0/3.0.0/immodules.cache" \
> +	GTK_IM_MODULE_FILE="${EROOT%/}/usr/$(get_libdir)/gtk-3.0/3.0.0/immodules.cache" \
>  		"${updater}" --update-cache
>  	eend $?
>  }
> @@ -467,10 +464,10 @@ gnome2_query_immodules_gtk3() {
>  # This function should be called from pkg_postinst and pkg_postrm.
>  gnome2_giomodule_cache_update() {
>  	has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
> -	local updater="${EROOT}/usr/bin/${CHOST}-gio-querymodules"
> +	local updater="${EROOT%/}/usr/bin/${CHOST}-gio-querymodules"
>  
>  	if [[ ! -x ${updater} ]]; then
> -		updater="${EROOT}/usr/bin/gio-querymodules"
> +		updater="${EROOT%/}/usr/bin/gio-querymodules"
>  	fi
>  
>  	if [[ ! -x ${updater} ]]; then

Move this *after* you've changed API of this eclass.
-- 
Best regards,
Michał Górny

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 963 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [gentoo-dev] [PATCH 3/4] gnome2-utils: move icon functions into xdg-utils
  2018-06-20  7:10 ` [gentoo-dev] [PATCH 3/4] gnome2-utils: move icon functions into xdg-utils Marty E. Plummer
@ 2018-06-20  7:27   ` Michał Górny
  2018-06-20  9:03     ` Marty E. Plummer
  0 siblings, 1 reply; 24+ messages in thread
From: Michał Górny @ 2018-06-20  7:27 UTC (permalink / raw
  To: gentoo-dev; +Cc: Marty E. Plummer

[-- Attachment #1: Type: text/plain, Size: 7099 bytes --]

W dniu śro, 20.06.2018 o godzinie 02∶10 -0500, użytkownik Marty E.
Plummer napisał:
> Kept some dummy stub functions in place in order to maintain
> functionality of existing ebuilds, along with a QA warning to migrate
> from one eclass to the other.
> ---
>  eclass/gnome2-utils.eclass | 73 ++++++----------------------------
>  eclass/xdg-utils.eclass    | 80 ++++++++++++++++++++++++++++++++++++++
>  2 files changed, 91 insertions(+), 62 deletions(-)
> 
> diff --git a/eclass/gnome2-utils.eclass b/eclass/gnome2-utils.eclass
> index 14fb9e7420c..a355f0f4f13 100644
> --- a/eclass/gnome2-utils.eclass
> +++ b/eclass/gnome2-utils.eclass
> @@ -40,12 +40,6 @@ esac
>  # Path to scrollkeeper-update
>  : ${SCROLLKEEPER_UPDATE_BIN:="/usr/bin/scrollkeeper-update"}
>  
> -# @ECLASS-VARIABLE: GTK_UPDATE_ICON_CACHE
> -# @INTERNAL
> -# @DESCRIPTION:
> -# Path to gtk-update-icon-cache
> -: ${GTK_UPDATE_ICON_CACHE:="/usr/bin/gtk-update-icon-cache"}
> -
>  # @ECLASS-VARIABLE: GLIB_COMPILE_SCHEMAS
>  # @INTERNAL
>  # @DESCRIPTION:
> @@ -203,68 +197,23 @@ gnome2_gconf_uninstall() {
>  
>  # @FUNCTION: gnome2_icon_savelist
>  # @DESCRIPTION:
> -# Find the icons that are about to be installed and save their location
> -# in the GNOME2_ECLASS_ICONS environment variable. This is only
> -# necessary for eclass implementations that call
> -# gnome2_icon_cache_update conditionally.
> -# This function should be called from pkg_preinst.
> +# Deprecated. Use xdg_icon_savelist from xdg-utils.eclass instead.
>  gnome2_icon_savelist() {
> -	has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
> -	pushd "${ED}" > /dev/null || die
> -	export GNOME2_ECLASS_ICONS=$(find 'usr/share/icons' -maxdepth 1 -mindepth 1 -type d 2> /dev/null)
> -	popd > /dev/null || die
> +	eqawarn "QA warning: gnome2_icon_savelist has been moved to xdg-utils.eclass"
> +	eqawarn "and is now called xdg_icon_savelist. Please migrate your ebuild and"
> +	eqawarn "eclasses to use it"
> +	xdg_icon_savelist
> +	GNOME2_ECLASS_ICONS="${XDG_ECLASS_ICONS}"
>  }
>  
>  # @FUNCTION: gnome2_icon_cache_update
>  # @DESCRIPTION:
> -# Updates Gtk+ icon cache files under /usr/share/icons.
> -# This function should be called from pkg_postinst and pkg_postrm.
> +# Deprecated. Use xdg_icon_cache_update from xdg-utils.eclass instead.
>  gnome2_icon_cache_update() {
> -	has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
> -	local updater="${EROOT%/}${GTK_UPDATE_ICON_CACHE}"
> -
> -	if [[ ! -x "${updater}" ]] ; then
> -		debug-print "${updater} is not executable"
> -		return
> -	fi
> -
> -	ebegin "Updating icons cache"
> -
> -	local retval=0
> -	local fails=( )
> -
> -	for dir in "${EROOT%/}"/usr/share/icons/*
> -	do
> -		if [[ -f "${dir}/index.theme" ]] ; then
> -			local rv=0
> -
> -			"${updater}" -qf "${dir}"
> -			rv=$?
> -
> -			if [[ ! $rv -eq 0 ]] ; then
> -				debug-print "Updating cache failed on ${dir}"
> -
> -				# Add to the list of failures
> -				fails+=( "${dir}" )
> -
> -				retval=2
> -			fi
> -		elif [[ $(ls "${dir}") = "icon-theme.cache" ]]; then
> -			# Clear stale cache files after theme uninstallation
> -			rm "${dir}/icon-theme.cache"
> -		fi
> -
> -		if [[ -z $(ls "${dir}") ]]; then
> -			# Clear empty theme directories after theme uninstallation
> -			rmdir "${dir}"
> -		fi
> -	done
> -
> -	eend ${retval}
> -
> -	for f in "${fails[@]}" ; do
> -		eerror "Failed to update cache with icon $f"
> -	done
> +	eqawarn "QA warning: gnome2_icon_cache_update has been moved to xdg-utils.eclass"
> +	eqawarn "and is now called xdg_icon_cache_update. Please migrate your ebuild and"
> +	eqawarn "eclasses to use it"
> +	xdg_icon_cache_update
>  }
>  
>  # @FUNCTION: gnome2_omf_fix

1. Why not make those two fatal in EAPI 7?

2. I don't think suddenly having a lot of ebuilds eqawarn about this
in existing EAPIs is going to be productive.

> diff --git a/eclass/xdg-utils.eclass b/eclass/xdg-utils.eclass
> index 8dba5ed6861..37e1893a701 100644
> --- a/eclass/xdg-utils.eclass
> +++ b/eclass/xdg-utils.eclass
> @@ -31,6 +31,12 @@ esac
>  # Directory where .desktop files database is stored
>  : ${DESKTOP_DATABASE_DIR="/usr/share/applications"}
>  
> +# @ECLASS-VARIABLE: GTK_UPDATE_ICON_CACHE
> +# @INTERNAL
> +# @DESCRIPTION:
> +# Path to gtk-update-icon-cache
> +: ${GTK_UPDATE_ICON_CACHE:="/usr/bin/gtk-update-icon-cache"}
> +
>  # @ECLASS-VARIABLE: MIMEINFO_DATABASE_UPDATE_BIN
>  # @INTERNAL
>  # @DESCRIPTION:
> @@ -43,6 +49,12 @@ esac
>  # Directory where .desktop files database is stored
>  : ${MIMEINFO_DATABASE_DIR:="/usr/share/mime"}
>  
> +# @ECLASS-VARIABLE: XDG_ECLASS_ICONS
> +# @INTERNAL
> +# @DEFAULT_UNSET
> +# @DESCRIPTION:
> +# List of icons provided by the package
> +
>  # @FUNCTION: xdg_environment_reset
>  # @DESCRIPTION:
>  # Clean up environment for clean builds.
> @@ -82,6 +94,74 @@ xdg_desktop_database_update() {
>  	eend $?
>  }
>  
> +# @FUNCTION: xdg_icon_savelist
> +# @DESCRIPTION:
> +# Find the icons that are about to be installed and save their location
> +# in the XDG_ECLASS_ICONS environment variable. This is only
> +# necessary for eclass implementations that call
> +# xdg_icon_cache_update conditionally.
> +# This function should be called from pkg_preinst.
> +xdg_icon_savelist() {
> +	XDG_ECLASS_ICONS=()
> +	while IFS= read -r -d '' f; do
> +		XDG_ECLASS_ICONS+=( ${f} )
> +	done < <(cd "${D}" && find 'usr/share/icons' -type f -print0 2>/dev/null)
> +
> +	export XDG_ECLASS_ICONS
> +}
> +
> +# @FUNCTION: xdg_icon_cache_update
> +# @DESCRIPTION:
> +# Updates Gtk+ icon cache files under /usr/share/icons.
> +# This function should be called from pkg_postinst and pkg_postrm.
> +xdg_icon_cache_update() {
> +	has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
> +	local updater="${EROOT%/}${GTK_UPDATE_ICON_CACHE}"
> +
> +	if [[ ! -x "${updater}" ]] ; then
> +		debug-print "${updater} is not executable"
> +		return
> +	fi
> +
> +	ebegin "Updating icons cache"
> +
> +	local retval=0
> +	local fails=( )
> +
> +	for dir in "${EROOT%/}"/usr/share/icons/*
> +	do
> +		if [[ -f "${dir}/index.theme" ]] ; then
> +			local rv=0
> +
> +			"${updater}" -qf "${dir}"
> +			rv=$?
> +
> +			if [[ ! $rv -eq 0 ]] ; then
> +				debug-print "Updating cache failed on ${dir}"
> +
> +				# Add to the list of failures
> +				fails+=( "${dir}" )
> +
> +				retval=2
> +			fi
> +		elif [[ $(ls "${dir}") = "icon-theme.cache" ]]; then
> +			# Clear stale cache files after theme uninstallation
> +			rm "${dir}/icon-theme.cache"
> +		fi
> +
> +		if [[ -z $(ls "${dir}") ]]; then
> +			# Clear empty theme directories after theme uninstallation
> +			rmdir "${dir}"
> +		fi
> +	done
> +
> +	eend ${retval}
> +
> +	for f in "${fails[@]}" ; do
> +		eerror "Failed to update cache with icon $f"
> +	done
> +}
> +
>  # @FUNCTION: xdg_mimeinfo_database_update
>  # @DESCRIPTION:
>  # Update the mime database.

-- 
Best regards,
Michał Górny

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 963 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [gentoo-dev] [PATCH 4/4] gnome2.eclass: move icon handling code to xdg.eclass
  2018-06-20  7:10 ` [gentoo-dev] [PATCH 4/4] gnome2.eclass: move icon handling code to xdg.eclass Marty E. Plummer
@ 2018-06-20  7:27   ` Michał Górny
  2018-06-20  9:04     ` Marty E. Plummer
  0 siblings, 1 reply; 24+ messages in thread
From: Michał Górny @ 2018-06-20  7:27 UTC (permalink / raw
  To: gentoo-dev; +Cc: Marty E. Plummer

[-- Attachment #1: Type: text/plain, Size: 3927 bytes --]

W dniu śro, 20.06.2018 o godzinie 02∶10 -0500, użytkownik Marty E.
Plummer napisał:
> ---
>  eclass/gnome2.eclass |  7 -------
>  eclass/xdg.eclass    | 27 ++++++++++++++++++++++-----
>  2 files changed, 22 insertions(+), 12 deletions(-)
> 
> diff --git a/eclass/gnome2.eclass b/eclass/gnome2.eclass
> index 6db6d08b14e..5b81cb4f01a 100644
> --- a/eclass/gnome2.eclass
> +++ b/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..29830a5ee15 100644
> --- a/eclass/xdg.eclass
> +++ b/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_ICONS and
> +# XDG_ECLASS_MIMEINFOFILES respectively.
>  xdg_pkg_preinst() {
>  	local f
>  
> @@ -50,6 +50,11 @@ xdg_pkg_preinst() {
>  		XDG_ECLASS_DESKTOPFILES+=( ${f} )
>  	done < <(cd "${D}" && find 'usr/share/applications' -type f -print0 2>/dev/null)
>  
> +	XDG_ECLASS_ICONS=()
> +	while IFS= read -r -d '' f; do
> +		XDG_ECLASS_ICONS+=( ${f} )
> +	done < <(cd "${D}" && find 'usr/share/icons' -type f -print0 2>/dev/null)

If you inline it anyway, why add xdg_*_savelist for it?

> +
>  	XDG_ECLASS_MIMEINFOFILES=()
>  	while IFS= read -r -d '' f; do
>  		XDG_ECLASS_MIMEINFOFILES+=( ${f} )
> @@ -60,7 +65,7 @@ xdg_pkg_preinst() {
>  
>  # @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_ICONS[@]} -gt 0 ]]; then
> +		xdg_icon_cache_update
> +	else
> +		debug-print "No icon files to add to database"
> +	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_ICONS[@]} -gt 0 ]]; then
> +		xdg_icon_cache_update
> +	else
> +		debug-print "No icon files to add to database"
> +	fi
> +
>  	if [[ ${#XDG_ECLASS_MIMEINFOFILES[@]} -gt 0 ]]; then
>  		xdg_mimeinfo_database_update
>  	else

-- 
Best regards,
Michał Górny

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 963 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [gentoo-dev] [PATCH 2/4] gnome2-utils.eclass: make EAPI 7 ready
  2018-06-20  7:25   ` Michał Górny
@ 2018-06-20  9:00     ` Marty E. Plummer
  2018-06-21  0:43     ` Marty E. Plummer
  1 sibling, 0 replies; 24+ messages in thread
From: Marty E. Plummer @ 2018-06-20  9:00 UTC (permalink / raw
  To: gentoo-dev

On Wed, Jun 20, 2018 at 09:25:30AM +0200, Michał Górny wrote:
> W dniu śro, 20.06.2018 o godzinie 02∶10 -0500, użytkownik Marty E.
> Plummer napisał:
> > Use ${EROOT%/} whereever possible, as most of the directories and files
> > used in conjunction with it have a leading /; add missing leading /
> > where apropriate.
> > 
> > Package-Manager: Portage-2.3.40, Repoman-2.3.9
> > ---
> >  eclass/gnome2-utils.eclass | 41 ++++++++++++++++++--------------------
> >  1 file changed, 19 insertions(+), 22 deletions(-)
> > 
> > diff --git a/eclass/gnome2-utils.eclass b/eclass/gnome2-utils.eclass
> > index 65076ae2d61..14fb9e7420c 100644
> > --- a/eclass/gnome2-utils.eclass
> > +++ b/eclass/gnome2-utils.eclass
> > @@ -18,7 +18,7 @@
> >  inherit eutils xdg-utils
> >  
> >  case "${EAPI:-0}" in
> > -	0|1|2|3|4|5|6) ;;
> > +	0|1|2|3|4|5|6|7) ;;
> >  	*) die "EAPI=${EAPI} is not supported" ;;
> >  esac
> >  
> > @@ -82,9 +82,6 @@ esac
> >  # @DESCRIPTION:
> >  # List of gdk-pixbuf loaders provided by the package
> >  
> > -DEPEND=">=sys-apps/sed-4"
> > -
> > -
> >  # @FUNCTION: gnome2_environment_reset
> >  # @DESCRIPTION:
> >  # Reset various variables inherited from root's evironment to a reasonable
> > @@ -101,7 +98,7 @@ gnome2_environment_reset() {
> >  	# Ensure we don't rely on dconf/gconf while building, bug #511946
> >  	export GSETTINGS_BACKEND="memory"
> >  
> > -	if has ${EAPI:-0} 6; then
> > +	if has ${EAPI:-0} 6 7; then
> >  		# Try to cover the packages honoring this variable, bug #508124
> >  		export GST_INSPECT="$(type -P true)"
> >  
> > @@ -129,7 +126,7 @@ gnome2_gconf_savelist() {
> >  # This function should be called from pkg_postinst.
> >  gnome2_gconf_install() {
> >  	has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
> > -	local updater="${EROOT}${GCONFTOOL_BIN}"
> > +	local updater="${EROOT%/}${GCONFTOOL_BIN}"
> >  
> >  	if [[ ! -x "${updater}" ]]; then
> >  		debug-print "${updater} is not executable"
> > @@ -149,9 +146,9 @@ gnome2_gconf_install() {
> >  
> >  	local F
> >  	for F in ${GNOME2_ECLASS_SCHEMAS}; do
> > -		if [[ -e "${EROOT}${F}" ]]; then
> > +		if [[ -e "${EROOT%/}${F}" ]]; then
> >  			debug-print "Installing schema: ${F}"
> > -			"${updater}" --makefile-install-rule "${EROOT}${F}" 1>/dev/null
> > +			"${updater}" --makefile-install-rule "${EROOT%/}${F}" 1>/dev/null
> >  		fi
> >  	done
> >  
> > @@ -170,7 +167,7 @@ gnome2_gconf_install() {
> >  # database.
> >  gnome2_gconf_uninstall() {
> >  	has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
> > -	local updater="${EROOT}${GCONFTOOL_BIN}"
> > +	local updater="${EROOT%/}${GCONFTOOL_BIN}"
> >  
> >  	if [[ ! -x "${updater}" ]]; then
> >  		debug-print "${updater} is not executable"
> > @@ -189,9 +186,9 @@ gnome2_gconf_uninstall() {
> >  
> >  	local F
> >  	for F in ${GNOME2_ECLASS_SCHEMAS}; do
> > -		if [[ -e "${EROOT}${F}" ]]; then
> > +		if [[ -e "${EROOT%/}${F}" ]]; then
> >  			debug-print "Uninstalling gconf schema: ${F}"
> > -			"${updater}" --makefile-uninstall-rule "${EROOT}${F}" 1>/dev/null
> > +			"${updater}" --makefile-uninstall-rule "${EROOT%/}${F}" 1>/dev/null
> >  		fi
> >  	done
> >  
> > @@ -224,7 +221,7 @@ gnome2_icon_savelist() {
> >  # This function should be called from pkg_postinst and pkg_postrm.
> >  gnome2_icon_cache_update() {
> >  	has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
> > -	local updater="${EROOT}${GTK_UPDATE_ICON_CACHE}"
> > +	local updater="${EROOT%/}${GTK_UPDATE_ICON_CACHE}"
> >  
> >  	if [[ ! -x "${updater}" ]] ; then
> >  		debug-print "${updater} is not executable"
> > @@ -339,7 +336,7 @@ gnome2_scrollkeeper_savelist() {
> >  # This function should be called from pkg_postinst and pkg_postrm.
> >  gnome2_scrollkeeper_update() {
> >  	has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
> > -	local updater="${EROOT}${SCROLLKEEPER_UPDATE_BIN}"
> > +	local updater="${EROOT%/}${SCROLLKEEPER_UPDATE_BIN}"
> >  
> >  	if [[ ! -x "${updater}" ]] ; then
> >  		debug-print "${updater} is not executable"
> > @@ -352,7 +349,7 @@ gnome2_scrollkeeper_update() {
> >  	fi
> >  
> >  	ebegin "Updating scrollkeeper database ..."
> > -	"${updater}" -q -p "${EROOT}${SCROLLKEEPER_DIR}"
> > +	"${updater}" -q -p "${EROOT%/}${SCROLLKEEPER_DIR}"
> >  	eend $?
> >  }
> >  
> > @@ -376,7 +373,7 @@ gnome2_schemas_savelist() {
> >  # This function should be called from pkg_postinst and pkg_postrm.
> >  gnome2_schemas_update() {
> >  	has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
> > -	local updater="${EROOT}${GLIB_COMPILE_SCHEMAS}"
> > +	local updater="${EROOT%/}${GLIB_COMPILE_SCHEMAS}"
> >  
> >  	if [[ ! -x ${updater} ]]; then
> >  		debug-print "${updater} is not executable"
> > @@ -407,10 +404,10 @@ gnome2_gdk_pixbuf_savelist() {
> >  # This function should be called from pkg_postinst and pkg_postrm.
> >  gnome2_gdk_pixbuf_update() {
> >  	has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
> > -	local updater="${EROOT}/usr/bin/${CHOST}-gdk-pixbuf-query-loaders"
> > +	local updater="${EROOT%/}/usr/bin/${CHOST}-gdk-pixbuf-query-loaders"
> >  
> >  	if [[ ! -x ${updater} ]]; then
> > -		updater="${EROOT}/usr/bin/gdk-pixbuf-query-loaders"
> > +		updater="${EROOT%/}/usr/bin/gdk-pixbuf-query-loaders"
> >  	fi
> >  
> >  	if [[ ! -x ${updater} ]]; then
> > @@ -427,7 +424,7 @@ gnome2_gdk_pixbuf_update() {
> >  	local tmp_file=$(emktemp)
> >  	${updater} 1> "${tmp_file}" &&
> >  	chmod 0644 "${tmp_file}" &&
> > -	cp -f "${tmp_file}" "${EROOT}usr/$(get_libdir)/gdk-pixbuf-2.0/2.10.0/loaders.cache" &&
> > +	cp -f "${tmp_file}" "${EROOT%/}/usr/$(get_libdir)/gdk-pixbuf-2.0/2.10.0/loaders.cache" &&
> >  	rm "${tmp_file}" # don't replace this with mv, required for SELinux support
> >  	eend $?
> >  }
> > @@ -441,7 +438,7 @@ gnome2_query_immodules_gtk2() {
> >  	[[ ! -x ${updater} ]] && updater=${EPREFIX}/usr/bin/gtk-query-immodules-2.0
> >  
> >  	ebegin "Updating gtk2 input method module cache"
> > -	GTK_IM_MODULE_FILE="${EROOT}usr/$(get_libdir)/gtk-2.0/2.10.0/immodules.cache" \
> > +	GTK_IM_MODULE_FILE="${EROOT%/}/usr/$(get_libdir)/gtk-2.0/2.10.0/immodules.cache" \
> >  		"${updater}" --update-cache
> >  	eend $?
> >  }
> > @@ -455,7 +452,7 @@ gnome2_query_immodules_gtk3() {
> >  	[[ ! -x ${updater} ]] && updater=${EPREFIX}/usr/bin/gtk-query-immodules-3.0
> >  
> >  	ebegin "Updating gtk3 input method module cache"
> > -	GTK_IM_MODULE_FILE="${EROOT}usr/$(get_libdir)/gtk-3.0/3.0.0/immodules.cache" \
> > +	GTK_IM_MODULE_FILE="${EROOT%/}/usr/$(get_libdir)/gtk-3.0/3.0.0/immodules.cache" \
> >  		"${updater}" --update-cache
> >  	eend $?
> >  }
> > @@ -467,10 +464,10 @@ gnome2_query_immodules_gtk3() {
> >  # This function should be called from pkg_postinst and pkg_postrm.
> >  gnome2_giomodule_cache_update() {
> >  	has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
> > -	local updater="${EROOT}/usr/bin/${CHOST}-gio-querymodules"
> > +	local updater="${EROOT%/}/usr/bin/${CHOST}-gio-querymodules"
> >  
> >  	if [[ ! -x ${updater} ]]; then
> > -		updater="${EROOT}/usr/bin/gio-querymodules"
> > +		updater="${EROOT%/}/usr/bin/gio-querymodules"
> >  	fi
> >  
> >  	if [[ ! -x ${updater} ]]; then
> 
> Move this *after* you've changed API of this eclass.
Could you please elaborate what you mean?
> -- 
> Best regards,
> Michał Górny




^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [gentoo-dev] [PATCH 3/4] gnome2-utils: move icon functions into xdg-utils
  2018-06-20  7:27   ` Michał Górny
@ 2018-06-20  9:03     ` Marty E. Plummer
  2018-06-20  9:18       ` Michał Górny
  0 siblings, 1 reply; 24+ messages in thread
From: Marty E. Plummer @ 2018-06-20  9:03 UTC (permalink / raw
  To: gentoo-dev

On Wed, Jun 20, 2018 at 09:27:01AM +0200, Michał Górny wrote:
> W dniu śro, 20.06.2018 o godzinie 02∶10 -0500, użytkownik Marty E.
> Plummer napisał:
> > Kept some dummy stub functions in place in order to maintain
> > functionality of existing ebuilds, along with a QA warning to migrate
> > from one eclass to the other.
> > ---
> >  eclass/gnome2-utils.eclass | 73 ++++++----------------------------
> >  eclass/xdg-utils.eclass    | 80 ++++++++++++++++++++++++++++++++++++++
> >  2 files changed, 91 insertions(+), 62 deletions(-)
> > 
> > diff --git a/eclass/gnome2-utils.eclass b/eclass/gnome2-utils.eclass
> > index 14fb9e7420c..a355f0f4f13 100644
> > --- a/eclass/gnome2-utils.eclass
> > +++ b/eclass/gnome2-utils.eclass
> > @@ -40,12 +40,6 @@ esac
> >  # Path to scrollkeeper-update
> >  : ${SCROLLKEEPER_UPDATE_BIN:="/usr/bin/scrollkeeper-update"}
> >  
> > -# @ECLASS-VARIABLE: GTK_UPDATE_ICON_CACHE
> > -# @INTERNAL
> > -# @DESCRIPTION:
> > -# Path to gtk-update-icon-cache
> > -: ${GTK_UPDATE_ICON_CACHE:="/usr/bin/gtk-update-icon-cache"}
> > -
> >  # @ECLASS-VARIABLE: GLIB_COMPILE_SCHEMAS
> >  # @INTERNAL
> >  # @DESCRIPTION:
> > @@ -203,68 +197,23 @@ gnome2_gconf_uninstall() {
> >  
> >  # @FUNCTION: gnome2_icon_savelist
> >  # @DESCRIPTION:
> > -# Find the icons that are about to be installed and save their location
> > -# in the GNOME2_ECLASS_ICONS environment variable. This is only
> > -# necessary for eclass implementations that call
> > -# gnome2_icon_cache_update conditionally.
> > -# This function should be called from pkg_preinst.
> > +# Deprecated. Use xdg_icon_savelist from xdg-utils.eclass instead.
> >  gnome2_icon_savelist() {
> > -	has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
> > -	pushd "${ED}" > /dev/null || die
> > -	export GNOME2_ECLASS_ICONS=$(find 'usr/share/icons' -maxdepth 1 -mindepth 1 -type d 2> /dev/null)
> > -	popd > /dev/null || die
> > +	eqawarn "QA warning: gnome2_icon_savelist has been moved to xdg-utils.eclass"
> > +	eqawarn "and is now called xdg_icon_savelist. Please migrate your ebuild and"
> > +	eqawarn "eclasses to use it"
> > +	xdg_icon_savelist
> > +	GNOME2_ECLASS_ICONS="${XDG_ECLASS_ICONS}"
> >  }
> >  
> >  # @FUNCTION: gnome2_icon_cache_update
> >  # @DESCRIPTION:
> > -# Updates Gtk+ icon cache files under /usr/share/icons.
> > -# This function should be called from pkg_postinst and pkg_postrm.
> > +# Deprecated. Use xdg_icon_cache_update from xdg-utils.eclass instead.
> >  gnome2_icon_cache_update() {
> > -	has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
> > -	local updater="${EROOT%/}${GTK_UPDATE_ICON_CACHE}"
> > -
> > -	if [[ ! -x "${updater}" ]] ; then
> > -		debug-print "${updater} is not executable"
> > -		return
> > -	fi
> > -
> > -	ebegin "Updating icons cache"
> > -
> > -	local retval=0
> > -	local fails=( )
> > -
> > -	for dir in "${EROOT%/}"/usr/share/icons/*
> > -	do
> > -		if [[ -f "${dir}/index.theme" ]] ; then
> > -			local rv=0
> > -
> > -			"${updater}" -qf "${dir}"
> > -			rv=$?
> > -
> > -			if [[ ! $rv -eq 0 ]] ; then
> > -				debug-print "Updating cache failed on ${dir}"
> > -
> > -				# Add to the list of failures
> > -				fails+=( "${dir}" )
> > -
> > -				retval=2
> > -			fi
> > -		elif [[ $(ls "${dir}") = "icon-theme.cache" ]]; then
> > -			# Clear stale cache files after theme uninstallation
> > -			rm "${dir}/icon-theme.cache"
> > -		fi
> > -
> > -		if [[ -z $(ls "${dir}") ]]; then
> > -			# Clear empty theme directories after theme uninstallation
> > -			rmdir "${dir}"
> > -		fi
> > -	done
> > -
> > -	eend ${retval}
> > -
> > -	for f in "${fails[@]}" ; do
> > -		eerror "Failed to update cache with icon $f"
> > -	done
> > +	eqawarn "QA warning: gnome2_icon_cache_update has been moved to xdg-utils.eclass"
> > +	eqawarn "and is now called xdg_icon_cache_update. Please migrate your ebuild and"
> > +	eqawarn "eclasses to use it"
> > +	xdg_icon_cache_update
> >  }
> >  
> >  # @FUNCTION: gnome2_omf_fix
> 
> 1. Why not make those two fatal in EAPI 7?
> 
Sounds ok. There can currently be no EAPI 7 ebuilds for this, so any
ebuild which updates their eapi can do the migration then.
> 2. I don't think suddenly having a lot of ebuilds eqawarn about this
> in existing EAPIs is going to be productive.
> 
Reasonable. I wasn't thinking in terms of that, since I wasn't making it
fatal in EAPI 7. Is there a non-ugly way to do multiline die statements?
> > diff --git a/eclass/xdg-utils.eclass b/eclass/xdg-utils.eclass
> > index 8dba5ed6861..37e1893a701 100644
> > --- a/eclass/xdg-utils.eclass
> > +++ b/eclass/xdg-utils.eclass
> > @@ -31,6 +31,12 @@ esac
> >  # Directory where .desktop files database is stored
> >  : ${DESKTOP_DATABASE_DIR="/usr/share/applications"}
> >  
> > +# @ECLASS-VARIABLE: GTK_UPDATE_ICON_CACHE
> > +# @INTERNAL
> > +# @DESCRIPTION:
> > +# Path to gtk-update-icon-cache
> > +: ${GTK_UPDATE_ICON_CACHE:="/usr/bin/gtk-update-icon-cache"}
> > +
> >  # @ECLASS-VARIABLE: MIMEINFO_DATABASE_UPDATE_BIN
> >  # @INTERNAL
> >  # @DESCRIPTION:
> > @@ -43,6 +49,12 @@ esac
> >  # Directory where .desktop files database is stored
> >  : ${MIMEINFO_DATABASE_DIR:="/usr/share/mime"}
> >  
> > +# @ECLASS-VARIABLE: XDG_ECLASS_ICONS
> > +# @INTERNAL
> > +# @DEFAULT_UNSET
> > +# @DESCRIPTION:
> > +# List of icons provided by the package
> > +
> >  # @FUNCTION: xdg_environment_reset
> >  # @DESCRIPTION:
> >  # Clean up environment for clean builds.
> > @@ -82,6 +94,74 @@ xdg_desktop_database_update() {
> >  	eend $?
> >  }
> >  
> > +# @FUNCTION: xdg_icon_savelist
> > +# @DESCRIPTION:
> > +# Find the icons that are about to be installed and save their location
> > +# in the XDG_ECLASS_ICONS environment variable. This is only
> > +# necessary for eclass implementations that call
> > +# xdg_icon_cache_update conditionally.
> > +# This function should be called from pkg_preinst.
> > +xdg_icon_savelist() {
> > +	XDG_ECLASS_ICONS=()
> > +	while IFS= read -r -d '' f; do
> > +		XDG_ECLASS_ICONS+=( ${f} )
> > +	done < <(cd "${D}" && find 'usr/share/icons' -type f -print0 2>/dev/null)
> > +
> > +	export XDG_ECLASS_ICONS
> > +}
> > +
> > +# @FUNCTION: xdg_icon_cache_update
> > +# @DESCRIPTION:
> > +# Updates Gtk+ icon cache files under /usr/share/icons.
> > +# This function should be called from pkg_postinst and pkg_postrm.
> > +xdg_icon_cache_update() {
> > +	has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
> > +	local updater="${EROOT%/}${GTK_UPDATE_ICON_CACHE}"
> > +
> > +	if [[ ! -x "${updater}" ]] ; then
> > +		debug-print "${updater} is not executable"
> > +		return
> > +	fi
> > +
> > +	ebegin "Updating icons cache"
> > +
> > +	local retval=0
> > +	local fails=( )
> > +
> > +	for dir in "${EROOT%/}"/usr/share/icons/*
> > +	do
> > +		if [[ -f "${dir}/index.theme" ]] ; then
> > +			local rv=0
> > +
> > +			"${updater}" -qf "${dir}"
> > +			rv=$?
> > +
> > +			if [[ ! $rv -eq 0 ]] ; then
> > +				debug-print "Updating cache failed on ${dir}"
> > +
> > +				# Add to the list of failures
> > +				fails+=( "${dir}" )
> > +
> > +				retval=2
> > +			fi
> > +		elif [[ $(ls "${dir}") = "icon-theme.cache" ]]; then
> > +			# Clear stale cache files after theme uninstallation
> > +			rm "${dir}/icon-theme.cache"
> > +		fi
> > +
> > +		if [[ -z $(ls "${dir}") ]]; then
> > +			# Clear empty theme directories after theme uninstallation
> > +			rmdir "${dir}"
> > +		fi
> > +	done
> > +
> > +	eend ${retval}
> > +
> > +	for f in "${fails[@]}" ; do
> > +		eerror "Failed to update cache with icon $f"
> > +	done
> > +}
> > +
> >  # @FUNCTION: xdg_mimeinfo_database_update
> >  # @DESCRIPTION:
> >  # Update the mime database.
> 
> -- 
> Best regards,
> Michał Górny




^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [gentoo-dev] [PATCH 4/4] gnome2.eclass: move icon handling code to xdg.eclass
  2018-06-20  7:27   ` Michał Górny
@ 2018-06-20  9:04     ` Marty E. Plummer
  2018-06-20  9:19       ` Michał Górny
  0 siblings, 1 reply; 24+ messages in thread
From: Marty E. Plummer @ 2018-06-20  9:04 UTC (permalink / raw
  To: Michał Górny; +Cc: gentoo-dev

On Wed, Jun 20, 2018 at 09:27:54AM +0200, Michał Górny wrote:
> W dniu śro, 20.06.2018 o godzinie 02∶10 -0500, użytkownik Marty E.
> Plummer napisał:
> > ---
> >  eclass/gnome2.eclass |  7 -------
> >  eclass/xdg.eclass    | 27 ++++++++++++++++++++++-----
> >  2 files changed, 22 insertions(+), 12 deletions(-)
> > 
> > diff --git a/eclass/gnome2.eclass b/eclass/gnome2.eclass
> > index 6db6d08b14e..5b81cb4f01a 100644
> > --- a/eclass/gnome2.eclass
> > +++ b/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..29830a5ee15 100644
> > --- a/eclass/xdg.eclass
> > +++ b/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_ICONS and
> > +# XDG_ECLASS_MIMEINFOFILES respectively.
> >  xdg_pkg_preinst() {
> >  	local f
> >  
> > @@ -50,6 +50,11 @@ xdg_pkg_preinst() {
> >  		XDG_ECLASS_DESKTOPFILES+=( ${f} )
> >  	done < <(cd "${D}" && find 'usr/share/applications' -type f -print0 2>/dev/null)
> >  
> > +	XDG_ECLASS_ICONS=()
> > +	while IFS= read -r -d '' f; do
> > +		XDG_ECLASS_ICONS+=( ${f} )
> > +	done < <(cd "${D}" && find 'usr/share/icons' -type f -print0 2>/dev/null)
> 
> If you inline it anyway, why add xdg_*_savelist for it?
> 
Too keep a stub that still 'works' for ebuilds using
gnome2_icon_savelist from gnome2-utils.eclass.
> > +
> >  	XDG_ECLASS_MIMEINFOFILES=()
> >  	while IFS= read -r -d '' f; do
> >  		XDG_ECLASS_MIMEINFOFILES+=( ${f} )
> > @@ -60,7 +65,7 @@ xdg_pkg_preinst() {
> >  
> >  # @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_ICONS[@]} -gt 0 ]]; then
> > +		xdg_icon_cache_update
> > +	else
> > +		debug-print "No icon files to add to database"
> > +	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_ICONS[@]} -gt 0 ]]; then
> > +		xdg_icon_cache_update
> > +	else
> > +		debug-print "No icon files to add to database"
> > +	fi
> > +
> >  	if [[ ${#XDG_ECLASS_MIMEINFOFILES[@]} -gt 0 ]]; then
> >  		xdg_mimeinfo_database_update
> >  	else
> 
> -- 
> Best regards,
> Michał Górny




^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [gentoo-dev] [PATCH 3/4] gnome2-utils: move icon functions into xdg-utils
  2018-06-20  9:03     ` Marty E. Plummer
@ 2018-06-20  9:18       ` Michał Górny
  0 siblings, 0 replies; 24+ messages in thread
From: Michał Górny @ 2018-06-20  9:18 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 4961 bytes --]

W dniu śro, 20.06.2018 o godzinie 04∶03 -0500, użytkownik Marty E.
Plummer napisał:
> On Wed, Jun 20, 2018 at 09:27:01AM +0200, Michał Górny wrote:
> > W dniu śro, 20.06.2018 o godzinie 02∶10 -0500, użytkownik Marty E.
> > Plummer napisał:
> > > Kept some dummy stub functions in place in order to maintain
> > > functionality of existing ebuilds, along with a QA warning to migrate
> > > from one eclass to the other.
> > > ---
> > >  eclass/gnome2-utils.eclass | 73 ++++++----------------------------
> > >  eclass/xdg-utils.eclass    | 80 ++++++++++++++++++++++++++++++++++++++
> > >  2 files changed, 91 insertions(+), 62 deletions(-)
> > > 
> > > diff --git a/eclass/gnome2-utils.eclass b/eclass/gnome2-utils.eclass
> > > index 14fb9e7420c..a355f0f4f13 100644
> > > --- a/eclass/gnome2-utils.eclass
> > > +++ b/eclass/gnome2-utils.eclass
> > > @@ -40,12 +40,6 @@ esac
> > >  # Path to scrollkeeper-update
> > >  : ${SCROLLKEEPER_UPDATE_BIN:="/usr/bin/scrollkeeper-update"}
> > >  
> > > -# @ECLASS-VARIABLE: GTK_UPDATE_ICON_CACHE
> > > -# @INTERNAL
> > > -# @DESCRIPTION:
> > > -# Path to gtk-update-icon-cache
> > > -: ${GTK_UPDATE_ICON_CACHE:="/usr/bin/gtk-update-icon-cache"}
> > > -
> > >  # @ECLASS-VARIABLE: GLIB_COMPILE_SCHEMAS
> > >  # @INTERNAL
> > >  # @DESCRIPTION:
> > > @@ -203,68 +197,23 @@ gnome2_gconf_uninstall() {
> > >  
> > >  # @FUNCTION: gnome2_icon_savelist
> > >  # @DESCRIPTION:
> > > -# Find the icons that are about to be installed and save their location
> > > -# in the GNOME2_ECLASS_ICONS environment variable. This is only
> > > -# necessary for eclass implementations that call
> > > -# gnome2_icon_cache_update conditionally.
> > > -# This function should be called from pkg_preinst.
> > > +# Deprecated. Use xdg_icon_savelist from xdg-utils.eclass instead.
> > >  gnome2_icon_savelist() {
> > > -	has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
> > > -	pushd "${ED}" > /dev/null || die
> > > -	export GNOME2_ECLASS_ICONS=$(find 'usr/share/icons' -maxdepth 1 -mindepth 1 -type d 2> /dev/null)
> > > -	popd > /dev/null || die
> > > +	eqawarn "QA warning: gnome2_icon_savelist has been moved to xdg-utils.eclass"
> > > +	eqawarn "and is now called xdg_icon_savelist. Please migrate your ebuild and"
> > > +	eqawarn "eclasses to use it"
> > > +	xdg_icon_savelist
> > > +	GNOME2_ECLASS_ICONS="${XDG_ECLASS_ICONS}"
> > >  }
> > >  
> > >  # @FUNCTION: gnome2_icon_cache_update
> > >  # @DESCRIPTION:
> > > -# Updates Gtk+ icon cache files under /usr/share/icons.
> > > -# This function should be called from pkg_postinst and pkg_postrm.
> > > +# Deprecated. Use xdg_icon_cache_update from xdg-utils.eclass instead.
> > >  gnome2_icon_cache_update() {
> > > -	has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
> > > -	local updater="${EROOT%/}${GTK_UPDATE_ICON_CACHE}"
> > > -
> > > -	if [[ ! -x "${updater}" ]] ; then
> > > -		debug-print "${updater} is not executable"
> > > -		return
> > > -	fi
> > > -
> > > -	ebegin "Updating icons cache"
> > > -
> > > -	local retval=0
> > > -	local fails=( )
> > > -
> > > -	for dir in "${EROOT%/}"/usr/share/icons/*
> > > -	do
> > > -		if [[ -f "${dir}/index.theme" ]] ; then
> > > -			local rv=0
> > > -
> > > -			"${updater}" -qf "${dir}"
> > > -			rv=$?
> > > -
> > > -			if [[ ! $rv -eq 0 ]] ; then
> > > -				debug-print "Updating cache failed on ${dir}"
> > > -
> > > -				# Add to the list of failures
> > > -				fails+=( "${dir}" )
> > > -
> > > -				retval=2
> > > -			fi
> > > -		elif [[ $(ls "${dir}") = "icon-theme.cache" ]]; then
> > > -			# Clear stale cache files after theme uninstallation
> > > -			rm "${dir}/icon-theme.cache"
> > > -		fi
> > > -
> > > -		if [[ -z $(ls "${dir}") ]]; then
> > > -			# Clear empty theme directories after theme uninstallation
> > > -			rmdir "${dir}"
> > > -		fi
> > > -	done
> > > -
> > > -	eend ${retval}
> > > -
> > > -	for f in "${fails[@]}" ; do
> > > -		eerror "Failed to update cache with icon $f"
> > > -	done
> > > +	eqawarn "QA warning: gnome2_icon_cache_update has been moved to xdg-utils.eclass"
> > > +	eqawarn "and is now called xdg_icon_cache_update. Please migrate your ebuild and"
> > > +	eqawarn "eclasses to use it"
> > > +	xdg_icon_cache_update
> > >  }
> > >  
> > >  # @FUNCTION: gnome2_omf_fix
> > 
> > 1. Why not make those two fatal in EAPI 7?
> > 
> 
> Sounds ok. There can currently be no EAPI 7 ebuilds for this, so any
> ebuild which updates their eapi can do the migration then.
> > 2. I don't think suddenly having a lot of ebuilds eqawarn about this
> > in existing EAPIs is going to be productive.
> > 
> 
> Reasonable. I wasn't thinking in terms of that, since I wasn't making it
> fatal in EAPI 7. Is there a non-ugly way to do multiline die statements?
> > > 

You just do multi-line eerror, followed by short die.

-- 
Best regards,
Michał Górny

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 963 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [gentoo-dev] [PATCH 4/4] gnome2.eclass: move icon handling code to xdg.eclass
  2018-06-20  9:04     ` Marty E. Plummer
@ 2018-06-20  9:19       ` Michał Górny
  2018-06-20 10:07         ` Marty E. Plummer
  0 siblings, 1 reply; 24+ messages in thread
From: Michał Górny @ 2018-06-20  9:19 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 3095 bytes --]

W dniu śro, 20.06.2018 o godzinie 04∶04 -0500, użytkownik Marty E.
Plummer napisał:
> On Wed, Jun 20, 2018 at 09:27:54AM +0200, Michał Górny wrote:
> > W dniu śro, 20.06.2018 o godzinie 02∶10 -0500, użytkownik Marty E.
> > Plummer napisał:
> > > ---
> > >  eclass/gnome2.eclass |  7 -------
> > >  eclass/xdg.eclass    | 27 ++++++++++++++++++++++-----
> > >  2 files changed, 22 insertions(+), 12 deletions(-)
> > > 
> > > diff --git a/eclass/gnome2.eclass b/eclass/gnome2.eclass
> > > index 6db6d08b14e..5b81cb4f01a 100644
> > > --- a/eclass/gnome2.eclass
> > > +++ b/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..29830a5ee15 100644
> > > --- a/eclass/xdg.eclass
> > > +++ b/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_ICONS and
> > > +# XDG_ECLASS_MIMEINFOFILES respectively.
> > >  xdg_pkg_preinst() {
> > >  	local f
> > >  
> > > @@ -50,6 +50,11 @@ xdg_pkg_preinst() {
> > >  		XDG_ECLASS_DESKTOPFILES+=( ${f} )
> > >  	done < <(cd "${D}" && find 'usr/share/applications' -type f -print0 2>/dev/null)
> > >  
> > > +	XDG_ECLASS_ICONS=()
> > > +	while IFS= read -r -d '' f; do
> > > +		XDG_ECLASS_ICONS+=( ${f} )
> > > +	done < <(cd "${D}" && find 'usr/share/icons' -type f -print0 2>/dev/null)
> > 
> > If you inline it anyway, why add xdg_*_savelist for it?
> > 
> 
> Too keep a stub that still 'works' for ebuilds using
> gnome2_icon_savelist from gnome2-utils.eclass.
> > > +

But given it's unnecessary... you could also keep the stub in gnome2-
utils and not introduce additional unnecessary stub.

-- 
Best regards,
Michał Górny

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 963 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [gentoo-dev] [PATCH 4/4] gnome2.eclass: move icon handling code to xdg.eclass
  2018-06-20  9:19       ` Michał Górny
@ 2018-06-20 10:07         ` Marty E. Plummer
  2018-06-20 10:11           ` Michał Górny
  0 siblings, 1 reply; 24+ messages in thread
From: Marty E. Plummer @ 2018-06-20 10:07 UTC (permalink / raw
  To: gentoo-dev

On Wed, Jun 20, 2018 at 11:19:29AM +0200, Michał Górny wrote:
> W dniu śro, 20.06.2018 o godzinie 04∶04 -0500, użytkownik Marty E.
> Plummer napisał:
> > On Wed, Jun 20, 2018 at 09:27:54AM +0200, Michał Górny wrote:
> > > W dniu śro, 20.06.2018 o godzinie 02∶10 -0500, użytkownik Marty E.
> > > Plummer napisał:
> > > > ---
> > > >  eclass/gnome2.eclass |  7 -------
> > > >  eclass/xdg.eclass    | 27 ++++++++++++++++++++++-----
> > > >  2 files changed, 22 insertions(+), 12 deletions(-)
> > > > 
> > > > diff --git a/eclass/gnome2.eclass b/eclass/gnome2.eclass
> > > > index 6db6d08b14e..5b81cb4f01a 100644
> > > > --- a/eclass/gnome2.eclass
> > > > +++ b/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..29830a5ee15 100644
> > > > --- a/eclass/xdg.eclass
> > > > +++ b/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_ICONS and
> > > > +# XDG_ECLASS_MIMEINFOFILES respectively.
> > > >  xdg_pkg_preinst() {
> > > >  	local f
> > > >  
> > > > @@ -50,6 +50,11 @@ xdg_pkg_preinst() {
> > > >  		XDG_ECLASS_DESKTOPFILES+=( ${f} )
> > > >  	done < <(cd "${D}" && find 'usr/share/applications' -type f -print0 2>/dev/null)
> > > >  
> > > > +	XDG_ECLASS_ICONS=()
> > > > +	while IFS= read -r -d '' f; do
> > > > +		XDG_ECLASS_ICONS+=( ${f} )
> > > > +	done < <(cd "${D}" && find 'usr/share/icons' -type f -print0 2>/dev/null)
> > > 
> > > If you inline it anyway, why add xdg_*_savelist for it?
> > > 
> > 
> > Too keep a stub that still 'works' for ebuilds using
> > gnome2_icon_savelist from gnome2-utils.eclass.
> > > > +
> 
> But given it's unnecessary... you could also keep the stub in gnome2-
> utils and not introduce additional unnecessary stub.
>
Fair. Given that, should I allow the stub to keep working in EAPI 7,
then?
> -- 
> Best regards,
> Michał Górny




^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [gentoo-dev] [PATCH 4/4] gnome2.eclass: move icon handling code to xdg.eclass
  2018-06-20 10:07         ` Marty E. Plummer
@ 2018-06-20 10:11           ` Michał Górny
  0 siblings, 0 replies; 24+ messages in thread
From: Michał Górny @ 2018-06-20 10:11 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 3669 bytes --]

W dniu śro, 20.06.2018 o godzinie 05∶07 -0500, użytkownik Marty E.
Plummer napisał:
> On Wed, Jun 20, 2018 at 11:19:29AM +0200, Michał Górny wrote:
> > W dniu śro, 20.06.2018 o godzinie 04∶04 -0500, użytkownik Marty E.
> > Plummer napisał:
> > > On Wed, Jun 20, 2018 at 09:27:54AM +0200, Michał Górny wrote:
> > > > W dniu śro, 20.06.2018 o godzinie 02∶10 -0500, użytkownik Marty E.
> > > > Plummer napisał:
> > > > > ---
> > > > >  eclass/gnome2.eclass |  7 -------
> > > > >  eclass/xdg.eclass    | 27 ++++++++++++++++++++++-----
> > > > >  2 files changed, 22 insertions(+), 12 deletions(-)
> > > > > 
> > > > > diff --git a/eclass/gnome2.eclass b/eclass/gnome2.eclass
> > > > > index 6db6d08b14e..5b81cb4f01a 100644
> > > > > --- a/eclass/gnome2.eclass
> > > > > +++ b/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..29830a5ee15 100644
> > > > > --- a/eclass/xdg.eclass
> > > > > +++ b/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_ICONS and
> > > > > +# XDG_ECLASS_MIMEINFOFILES respectively.
> > > > >  xdg_pkg_preinst() {
> > > > >  	local f
> > > > >  
> > > > > @@ -50,6 +50,11 @@ xdg_pkg_preinst() {
> > > > >  		XDG_ECLASS_DESKTOPFILES+=( ${f} )
> > > > >  	done < <(cd "${D}" && find 'usr/share/applications' -type f -print0 2>/dev/null)
> > > > >  
> > > > > +	XDG_ECLASS_ICONS=()
> > > > > +	while IFS= read -r -d '' f; do
> > > > > +		XDG_ECLASS_ICONS+=( ${f} )
> > > > > +	done < <(cd "${D}" && find 'usr/share/icons' -type f -print0 2>/dev/null)
> > > > 
> > > > If you inline it anyway, why add xdg_*_savelist for it?
> > > > 
> > > 
> > > Too keep a stub that still 'works' for ebuilds using
> > > gnome2_icon_savelist from gnome2-utils.eclass.
> > > > > +
> > 
> > But given it's unnecessary... you could also keep the stub in gnome2-
> > utils and not introduce additional unnecessary stub.
> > 
> 
> Fair. Given that, should I allow the stub to keep working in EAPI 7,
> then?
> > 

Nope.

-- 
Best regards,
Michał Górny

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 963 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [gentoo-dev] [PATCH 1/4] xdg-utils.eclass: make EAPI 7 ready
  2018-06-20  7:10 [gentoo-dev] [PATCH 1/4] xdg-utils.eclass: make EAPI 7 ready Marty E. Plummer
                   ` (2 preceding siblings ...)
  2018-06-20  7:10 ` [gentoo-dev] [PATCH 4/4] gnome2.eclass: move icon handling code to xdg.eclass Marty E. Plummer
@ 2018-06-20 13:03 ` Jason Zaman
  2018-06-20 19:31   ` James Le Cuirot
  2018-06-20 22:21   ` Marty E. Plummer
  3 siblings, 2 replies; 24+ messages in thread
From: Jason Zaman @ 2018-06-20 13:03 UTC (permalink / raw
  To: gentoo-dev; +Cc: Marty E. Plummer

On Wed, Jun 20, 2018 at 02:10:50AM -0500, Marty E. Plummer wrote:
> Use ${EROOT%/} whereever possible, as the tools and directories which
> are used with it are already prefixed with a /
> 
> Package-Manager: Portage-2.3.40, Repoman-2.3.9
> ---
>  eclass/xdg-utils.eclass | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/eclass/xdg-utils.eclass b/eclass/xdg-utils.eclass
> index ac075185d8e..8dba5ed6861 100644
> --- a/eclass/xdg-utils.eclass
> +++ b/eclass/xdg-utils.eclass
> @@ -15,7 +15,7 @@
>  #  * XDG mime information database management
>  
>  case "${EAPI:-0}" in
> -	0|1|2|3|4|5|6) ;;
> +	0|1|2|3|4|5|6|7) ;;
>  	*) die "EAPI=${EAPI} is not supported" ;;
>  esac
>  
> @@ -66,7 +66,7 @@ xdg_environment_reset() {
>  # Updates the .desktop files database.
>  # Generates a list of mimetypes linked to applications that can handle them
>  xdg_desktop_database_update() {
> -	local updater="${EROOT}${DESKTOP_DATABASE_UPDATE_BIN}"
> +	local updater="${EROOT%/}${DESKTOP_DATABASE_UPDATE_BIN}"

Shouldn't things like this be $BROOT since they're being run? $EROOT
might be a different architecture that may or may not run at all on the
build machine.

-- Jason

>  	if [[ ${EBUILD_PHASE} != post* ]] ; then
>  		die "xdg_desktop_database_update must be used in pkg_post* phases."
> @@ -78,7 +78,7 @@ xdg_desktop_database_update() {
>  	fi
>  
>  	ebegin "Updating .desktop files database"
> -	"${updater}" -q "${EROOT}${DESKTOP_DATABASE_DIR}"
> +	"${updater}" -q "${EROOT%/}${DESKTOP_DATABASE_DIR}"
>  	eend $?
>  }
>  
> @@ -87,7 +87,7 @@ xdg_desktop_database_update() {
>  # Update the mime database.
>  # Creates a general list of mime types from several sources
>  xdg_mimeinfo_database_update() {
> -	local updater="${EROOT}${MIMEINFO_DATABASE_UPDATE_BIN}"
> +	local updater="${EROOT%/}${MIMEINFO_DATABASE_UPDATE_BIN}"
>  
>  	if [[ ${EBUILD_PHASE} != post* ]] ; then
>  		die "xdg_mimeinfo_database_update must be used in pkg_post* phases."
> @@ -99,6 +99,6 @@ xdg_mimeinfo_database_update() {
>  	fi
>  
>  	ebegin "Updating shared mime info database"
> -	"${updater}" "${EROOT}${MIMEINFO_DATABASE_DIR}"
> +	"${updater}" "${EROOT%/}${MIMEINFO_DATABASE_DIR}"
>  	eend $?
>  }
> -- 
> 2.17.1
> 
> 


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [gentoo-dev] [PATCH 1/4] xdg-utils.eclass: make EAPI 7 ready
  2018-06-20 13:03 ` [gentoo-dev] [PATCH 1/4] xdg-utils.eclass: make EAPI 7 ready Jason Zaman
@ 2018-06-20 19:31   ` James Le Cuirot
  2018-06-20 22:21   ` Marty E. Plummer
  1 sibling, 0 replies; 24+ messages in thread
From: James Le Cuirot @ 2018-06-20 19:31 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 1204 bytes --]

On Wed, 20 Jun 2018 21:03:44 +0800
Jason Zaman <perfinion@gentoo.org> wrote:

> On Wed, Jun 20, 2018 at 02:10:50AM -0500, Marty E. Plummer wrote:
> > Use ${EROOT%/} whereever possible, as the tools and directories which
> > are used with it are already prefixed with a /
> > 
> > Package-Manager: Portage-2.3.40, Repoman-2.3.9
> > ---
> >  eclass/xdg-utils.eclass | 10 +++++-----
> >  1 file changed, 5 insertions(+), 5 deletions(-)
> > 
> > diff --git a/eclass/xdg-utils.eclass b/eclass/xdg-utils.eclass
> > index ac075185d8e..8dba5ed6861 100644
> > --- a/eclass/xdg-utils.eclass
> > +++ b/eclass/xdg-utils.eclass
> > @@ -66,7 +66,7 @@ xdg_environment_reset() {
> >  # Updates the .desktop files database.
> >  # Generates a list of mimetypes linked to applications that can handle them
> >  xdg_desktop_database_update() {
> > -	local updater="${EROOT}${DESKTOP_DATABASE_UPDATE_BIN}"
> > +	local updater="${EROOT%/}${DESKTOP_DATABASE_UPDATE_BIN}"  
> 
> Shouldn't things like this be $BROOT since they're being run? $EROOT
> might be a different architecture that may or may not run at all on the
> build machine.

+1

-- 
James Le Cuirot (chewi)
Gentoo Linux Developer

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 981 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [gentoo-dev] [PATCH 1/4] xdg-utils.eclass: make EAPI 7 ready
  2018-06-20 13:03 ` [gentoo-dev] [PATCH 1/4] xdg-utils.eclass: make EAPI 7 ready Jason Zaman
  2018-06-20 19:31   ` James Le Cuirot
@ 2018-06-20 22:21   ` Marty E. Plummer
  2018-06-20 22:33     ` James Le Cuirot
  1 sibling, 1 reply; 24+ messages in thread
From: Marty E. Plummer @ 2018-06-20 22:21 UTC (permalink / raw
  To: Jason Zaman; +Cc: gentoo-dev

On Wed, Jun 20, 2018 at 09:03:44PM +0800, Jason Zaman wrote:
> On Wed, Jun 20, 2018 at 02:10:50AM -0500, Marty E. Plummer wrote:
> > Use ${EROOT%/} whereever possible, as the tools and directories which
> > are used with it are already prefixed with a /
> > 
> > Package-Manager: Portage-2.3.40, Repoman-2.3.9
> > ---
> >  eclass/xdg-utils.eclass | 10 +++++-----
> >  1 file changed, 5 insertions(+), 5 deletions(-)
> > 
> > diff --git a/eclass/xdg-utils.eclass b/eclass/xdg-utils.eclass
> > index ac075185d8e..8dba5ed6861 100644
> > --- a/eclass/xdg-utils.eclass
> > +++ b/eclass/xdg-utils.eclass
> > @@ -15,7 +15,7 @@
> >  #  * XDG mime information database management
> >  
> >  case "${EAPI:-0}" in
> > -	0|1|2|3|4|5|6) ;;
> > +	0|1|2|3|4|5|6|7) ;;
> >  	*) die "EAPI=${EAPI} is not supported" ;;
> >  esac
> >  
> > @@ -66,7 +66,7 @@ xdg_environment_reset() {
> >  # Updates the .desktop files database.
> >  # Generates a list of mimetypes linked to applications that can handle them
> >  xdg_desktop_database_update() {
> > -	local updater="${EROOT}${DESKTOP_DATABASE_UPDATE_BIN}"
> > +	local updater="${EROOT%/}${DESKTOP_DATABASE_UPDATE_BIN}"
> 
> Shouldn't things like this be $BROOT since they're being run? $EROOT
> might be a different architecture that may or may not run at all on the
> build machine.
> 
Good point, but here's a question; if EROOT=${ROOT%/}${EPREFIX}, how do
we use BROOT here? EBROOT? Or longhand ${BROOT%/}${EPREFIX} ? I think
that may be a use case that got missed in the EAPI 7 discussions.
> -- Jason
> 
> >  	if [[ ${EBUILD_PHASE} != post* ]] ; then
> >  		die "xdg_desktop_database_update must be used in pkg_post* phases."
> > @@ -78,7 +78,7 @@ xdg_desktop_database_update() {
> >  	fi
> >  
> >  	ebegin "Updating .desktop files database"
> > -	"${updater}" -q "${EROOT}${DESKTOP_DATABASE_DIR}"
> > +	"${updater}" -q "${EROOT%/}${DESKTOP_DATABASE_DIR}"
> >  	eend $?
> >  }
> >  
> > @@ -87,7 +87,7 @@ xdg_desktop_database_update() {
> >  # Update the mime database.
> >  # Creates a general list of mime types from several sources
> >  xdg_mimeinfo_database_update() {
> > -	local updater="${EROOT}${MIMEINFO_DATABASE_UPDATE_BIN}"
> > +	local updater="${EROOT%/}${MIMEINFO_DATABASE_UPDATE_BIN}"
> >  
> >  	if [[ ${EBUILD_PHASE} != post* ]] ; then
> >  		die "xdg_mimeinfo_database_update must be used in pkg_post* phases."
> > @@ -99,6 +99,6 @@ xdg_mimeinfo_database_update() {
> >  	fi
> >  
> >  	ebegin "Updating shared mime info database"
> > -	"${updater}" "${EROOT}${MIMEINFO_DATABASE_DIR}"
> > +	"${updater}" "${EROOT%/}${MIMEINFO_DATABASE_DIR}"
> >  	eend $?
> >  }
> > -- 
> > 2.17.1
> > 
> > 


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [gentoo-dev] [PATCH 1/4] xdg-utils.eclass: make EAPI 7 ready
  2018-06-20 22:21   ` Marty E. Plummer
@ 2018-06-20 22:33     ` James Le Cuirot
  2018-06-20 23:01       ` Marty E. Plummer
  0 siblings, 1 reply; 24+ messages in thread
From: James Le Cuirot @ 2018-06-20 22:33 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 1616 bytes --]

On Wed, 20 Jun 2018 17:21:09 -0500
"Marty E. Plummer" <hanetzer@startmail.com> wrote:

> On Wed, Jun 20, 2018 at 09:03:44PM +0800, Jason Zaman wrote:
> > On Wed, Jun 20, 2018 at 02:10:50AM -0500, Marty E. Plummer wrote:  
> > > Use ${EROOT%/} whereever possible, as the tools and directories which
> > > are used with it are already prefixed with a /
> > > 
> > > Package-Manager: Portage-2.3.40, Repoman-2.3.9
> > > ---
> > >  eclass/xdg-utils.eclass | 10 +++++-----
> > >  1 file changed, 5 insertions(+), 5 deletions(-)
> > > 
> > > diff --git a/eclass/xdg-utils.eclass b/eclass/xdg-utils.eclass
> > > index ac075185d8e..8dba5ed6861 100644
> > > --- a/eclass/xdg-utils.eclass
> > > +++ b/eclass/xdg-utils.eclass
> > > @@ -66,7 +66,7 @@ xdg_environment_reset() {
> > >  # Updates the .desktop files database.
> > >  # Generates a list of mimetypes linked to applications that can handle them
> > >  xdg_desktop_database_update() {
> > > -	local updater="${EROOT}${DESKTOP_DATABASE_UPDATE_BIN}"
> > > +	local updater="${EROOT%/}${DESKTOP_DATABASE_UPDATE_BIN}"  
> > 
> > Shouldn't things like this be $BROOT since they're being run? $EROOT
> > might be a different architecture that may or may not run at all on the
> > build machine.
> >   
> Good point, but here's a question; if EROOT=${ROOT%/}${EPREFIX}, how do
> we use BROOT here? EBROOT? Or longhand ${BROOT%/}${EPREFIX} ? I think
> that may be a use case that got missed in the EAPI 7 discussions.

BROOT is already prefixed as BROOT without a prefix would just be /.

-- 
James Le Cuirot (chewi)
Gentoo Linux Developer

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 981 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [gentoo-dev] [PATCH 1/4] xdg-utils.eclass: make EAPI 7 ready
  2018-06-20 22:33     ` James Le Cuirot
@ 2018-06-20 23:01       ` Marty E. Plummer
  2018-06-21  2:38         ` Jason Zaman
  0 siblings, 1 reply; 24+ messages in thread
From: Marty E. Plummer @ 2018-06-20 23:01 UTC (permalink / raw
  To: gentoo-dev

On Wed, Jun 20, 2018 at 11:33:53PM +0100, James Le Cuirot wrote:
> On Wed, 20 Jun 2018 17:21:09 -0500
> "Marty E. Plummer" <hanetzer@startmail.com> wrote:
> 
> > On Wed, Jun 20, 2018 at 09:03:44PM +0800, Jason Zaman wrote:
> > > On Wed, Jun 20, 2018 at 02:10:50AM -0500, Marty E. Plummer wrote:  
> > > > Use ${EROOT%/} whereever possible, as the tools and directories which
> > > > are used with it are already prefixed with a /
> > > > 
> > > > Package-Manager: Portage-2.3.40, Repoman-2.3.9
> > > > ---
> > > >  eclass/xdg-utils.eclass | 10 +++++-----
> > > >  1 file changed, 5 insertions(+), 5 deletions(-)
> > > > 
> > > > diff --git a/eclass/xdg-utils.eclass b/eclass/xdg-utils.eclass
> > > > index ac075185d8e..8dba5ed6861 100644
> > > > --- a/eclass/xdg-utils.eclass
> > > > +++ b/eclass/xdg-utils.eclass
> > > > @@ -66,7 +66,7 @@ xdg_environment_reset() {
> > > >  # Updates the .desktop files database.
> > > >  # Generates a list of mimetypes linked to applications that can handle them
> > > >  xdg_desktop_database_update() {
> > > > -	local updater="${EROOT}${DESKTOP_DATABASE_UPDATE_BIN}"
> > > > +	local updater="${EROOT%/}${DESKTOP_DATABASE_UPDATE_BIN}"  
> > > 
> > > Shouldn't things like this be $BROOT since they're being run? $EROOT
> > > might be a different architecture that may or may not run at all on the
> > > build machine.
> > >   
> > Good point, but here's a question; if EROOT=${ROOT%/}${EPREFIX}, how do
> > we use BROOT here? EBROOT? Or longhand ${BROOT%/}${EPREFIX} ? I think
> > that may be a use case that got missed in the EAPI 7 discussions.
> 
> BROOT is already prefixed as BROOT without a prefix would just be /.
> 
I don't follow. Its my understanding that BROOT ~= ROOT for most
situations. But consider this setup:
Ubuntu amd64 with Gentoo Prefix, emerging a native arm @system to
/mnt/arm EPREFIX = /home/user/gentoo.

In this situation, ROOT=/mnt/arm, EROOT=/mnt/arm, but what is BROOT? /,
or /home/usr/gentoo?
> -- 
> James Le Cuirot (chewi)
> Gentoo Linux Developer




^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [gentoo-dev] [PATCH 2/4] gnome2-utils.eclass: make EAPI 7 ready
  2018-06-20  7:25   ` Michał Górny
  2018-06-20  9:00     ` Marty E. Plummer
@ 2018-06-21  0:43     ` Marty E. Plummer
  1 sibling, 0 replies; 24+ messages in thread
From: Marty E. Plummer @ 2018-06-21  0:43 UTC (permalink / raw
  To: gentoo-dev

On Wed, Jun 20, 2018 at 09:25:30AM +0200, Michał Górny wrote:
> W dniu śro, 20.06.2018 o godzinie 02∶10 -0500, użytkownik Marty E.
> Plummer napisał:
> > Use ${EROOT%/} whereever possible, as most of the directories and files
> > used in conjunction with it have a leading /; add missing leading /
> > where apropriate.
> > 
> > Package-Manager: Portage-2.3.40, Repoman-2.3.9
> > ---
> >  eclass/gnome2-utils.eclass | 41 ++++++++++++++++++--------------------
> >  1 file changed, 19 insertions(+), 22 deletions(-)
> > 
> > diff --git a/eclass/gnome2-utils.eclass b/eclass/gnome2-utils.eclass
> > index 65076ae2d61..14fb9e7420c 100644
> > --- a/eclass/gnome2-utils.eclass
> > +++ b/eclass/gnome2-utils.eclass
> > @@ -18,7 +18,7 @@
> >  inherit eutils xdg-utils
> >  
> >  case "${EAPI:-0}" in
> > -	0|1|2|3|4|5|6) ;;
> > +	0|1|2|3|4|5|6|7) ;;
> >  	*) die "EAPI=${EAPI} is not supported" ;;
> >  esac
> >  
> > @@ -82,9 +82,6 @@ esac
> >  # @DESCRIPTION:
> >  # List of gdk-pixbuf loaders provided by the package
> >  
> > -DEPEND=">=sys-apps/sed-4"
> > -
> > -
> >  # @FUNCTION: gnome2_environment_reset
> >  # @DESCRIPTION:
> >  # Reset various variables inherited from root's evironment to a reasonable
> > @@ -101,7 +98,7 @@ gnome2_environment_reset() {
> >  	# Ensure we don't rely on dconf/gconf while building, bug #511946
> >  	export GSETTINGS_BACKEND="memory"
> >  
> > -	if has ${EAPI:-0} 6; then
> > +	if has ${EAPI:-0} 6 7; then
> >  		# Try to cover the packages honoring this variable, bug #508124
> >  		export GST_INSPECT="$(type -P true)"
> >  
> > @@ -129,7 +126,7 @@ gnome2_gconf_savelist() {
> >  # This function should be called from pkg_postinst.
> >  gnome2_gconf_install() {
> >  	has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
> > -	local updater="${EROOT}${GCONFTOOL_BIN}"
> > +	local updater="${EROOT%/}${GCONFTOOL_BIN}"
> >  
> >  	if [[ ! -x "${updater}" ]]; then
> >  		debug-print "${updater} is not executable"
> > @@ -149,9 +146,9 @@ gnome2_gconf_install() {
> >  
> >  	local F
> >  	for F in ${GNOME2_ECLASS_SCHEMAS}; do
> > -		if [[ -e "${EROOT}${F}" ]]; then
> > +		if [[ -e "${EROOT%/}${F}" ]]; then
> >  			debug-print "Installing schema: ${F}"
> > -			"${updater}" --makefile-install-rule "${EROOT}${F}" 1>/dev/null
> > +			"${updater}" --makefile-install-rule "${EROOT%/}${F}" 1>/dev/null
> >  		fi
> >  	done
> >  
> > @@ -170,7 +167,7 @@ gnome2_gconf_install() {
> >  # database.
> >  gnome2_gconf_uninstall() {
> >  	has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
> > -	local updater="${EROOT}${GCONFTOOL_BIN}"
> > +	local updater="${EROOT%/}${GCONFTOOL_BIN}"
> >  
> >  	if [[ ! -x "${updater}" ]]; then
> >  		debug-print "${updater} is not executable"
> > @@ -189,9 +186,9 @@ gnome2_gconf_uninstall() {
> >  
> >  	local F
> >  	for F in ${GNOME2_ECLASS_SCHEMAS}; do
> > -		if [[ -e "${EROOT}${F}" ]]; then
> > +		if [[ -e "${EROOT%/}${F}" ]]; then
> >  			debug-print "Uninstalling gconf schema: ${F}"
> > -			"${updater}" --makefile-uninstall-rule "${EROOT}${F}" 1>/dev/null
> > +			"${updater}" --makefile-uninstall-rule "${EROOT%/}${F}" 1>/dev/null
> >  		fi
> >  	done
> >  
> > @@ -224,7 +221,7 @@ gnome2_icon_savelist() {
> >  # This function should be called from pkg_postinst and pkg_postrm.
> >  gnome2_icon_cache_update() {
> >  	has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
> > -	local updater="${EROOT}${GTK_UPDATE_ICON_CACHE}"
> > +	local updater="${EROOT%/}${GTK_UPDATE_ICON_CACHE}"
> >  
> >  	if [[ ! -x "${updater}" ]] ; then
> >  		debug-print "${updater} is not executable"
> > @@ -339,7 +336,7 @@ gnome2_scrollkeeper_savelist() {
> >  # This function should be called from pkg_postinst and pkg_postrm.
> >  gnome2_scrollkeeper_update() {
> >  	has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
> > -	local updater="${EROOT}${SCROLLKEEPER_UPDATE_BIN}"
> > +	local updater="${EROOT%/}${SCROLLKEEPER_UPDATE_BIN}"
> >  
> >  	if [[ ! -x "${updater}" ]] ; then
> >  		debug-print "${updater} is not executable"
> > @@ -352,7 +349,7 @@ gnome2_scrollkeeper_update() {
> >  	fi
> >  
> >  	ebegin "Updating scrollkeeper database ..."
> > -	"${updater}" -q -p "${EROOT}${SCROLLKEEPER_DIR}"
> > +	"${updater}" -q -p "${EROOT%/}${SCROLLKEEPER_DIR}"
> >  	eend $?
> >  }
> >  
> > @@ -376,7 +373,7 @@ gnome2_schemas_savelist() {
> >  # This function should be called from pkg_postinst and pkg_postrm.
> >  gnome2_schemas_update() {
> >  	has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
> > -	local updater="${EROOT}${GLIB_COMPILE_SCHEMAS}"
> > +	local updater="${EROOT%/}${GLIB_COMPILE_SCHEMAS}"
> >  
> >  	if [[ ! -x ${updater} ]]; then
> >  		debug-print "${updater} is not executable"
> > @@ -407,10 +404,10 @@ gnome2_gdk_pixbuf_savelist() {
> >  # This function should be called from pkg_postinst and pkg_postrm.
> >  gnome2_gdk_pixbuf_update() {
> >  	has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
> > -	local updater="${EROOT}/usr/bin/${CHOST}-gdk-pixbuf-query-loaders"
> > +	local updater="${EROOT%/}/usr/bin/${CHOST}-gdk-pixbuf-query-loaders"
> >  
> >  	if [[ ! -x ${updater} ]]; then
> > -		updater="${EROOT}/usr/bin/gdk-pixbuf-query-loaders"
> > +		updater="${EROOT%/}/usr/bin/gdk-pixbuf-query-loaders"
> >  	fi
> >  
> >  	if [[ ! -x ${updater} ]]; then
> > @@ -427,7 +424,7 @@ gnome2_gdk_pixbuf_update() {
> >  	local tmp_file=$(emktemp)
> >  	${updater} 1> "${tmp_file}" &&
> >  	chmod 0644 "${tmp_file}" &&
> > -	cp -f "${tmp_file}" "${EROOT}usr/$(get_libdir)/gdk-pixbuf-2.0/2.10.0/loaders.cache" &&
> > +	cp -f "${tmp_file}" "${EROOT%/}/usr/$(get_libdir)/gdk-pixbuf-2.0/2.10.0/loaders.cache" &&
> >  	rm "${tmp_file}" # don't replace this with mv, required for SELinux support
> >  	eend $?
> >  }
> > @@ -441,7 +438,7 @@ gnome2_query_immodules_gtk2() {
> >  	[[ ! -x ${updater} ]] && updater=${EPREFIX}/usr/bin/gtk-query-immodules-2.0
> >  
> >  	ebegin "Updating gtk2 input method module cache"
> > -	GTK_IM_MODULE_FILE="${EROOT}usr/$(get_libdir)/gtk-2.0/2.10.0/immodules.cache" \
> > +	GTK_IM_MODULE_FILE="${EROOT%/}/usr/$(get_libdir)/gtk-2.0/2.10.0/immodules.cache" \
> >  		"${updater}" --update-cache
> >  	eend $?
> >  }
> > @@ -455,7 +452,7 @@ gnome2_query_immodules_gtk3() {
> >  	[[ ! -x ${updater} ]] && updater=${EPREFIX}/usr/bin/gtk-query-immodules-3.0
> >  
> >  	ebegin "Updating gtk3 input method module cache"
> > -	GTK_IM_MODULE_FILE="${EROOT}usr/$(get_libdir)/gtk-3.0/3.0.0/immodules.cache" \
> > +	GTK_IM_MODULE_FILE="${EROOT%/}/usr/$(get_libdir)/gtk-3.0/3.0.0/immodules.cache" \
> >  		"${updater}" --update-cache
> >  	eend $?
> >  }
> > @@ -467,10 +464,10 @@ gnome2_query_immodules_gtk3() {
> >  # This function should be called from pkg_postinst and pkg_postrm.
> >  gnome2_giomodule_cache_update() {
> >  	has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
> > -	local updater="${EROOT}/usr/bin/${CHOST}-gio-querymodules"
> > +	local updater="${EROOT%/}/usr/bin/${CHOST}-gio-querymodules"
> >  
> >  	if [[ ! -x ${updater} ]]; then
> > -		updater="${EROOT}/usr/bin/gio-querymodules"
> > +		updater="${EROOT%/}/usr/bin/gio-querymodules"
> >  	fi
> >  
> >  	if [[ ! -x ${updater} ]]; then
> 
> Move this *after* you've changed API of this eclass.
Another thought I had; according to the qa reports site, gnome2-utils[1]
and gnome2[2] have as their lowest EAPI 4 and 5 respectively. I was
thinking to drop support for those EAPIs, in order to be able to drop
the explicit low EAPI lack of support for prefix (ED and EROOT); would
make the ROOT/EROOT vs BROOT logic a bit simpler. Thoughts?

[1] https://qa-reports.gentoo.org/output/eapi-per-eclass/gnome2-utils.eclass/
[2] https://qa-reports.gentoo.org/output/eapi-per-eclass/gnome2.eclass/
> -- 
> Best regards,
> Michał Górny




^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [gentoo-dev] [PATCH 1/4] xdg-utils.eclass: make EAPI 7 ready
  2018-06-20 23:01       ` Marty E. Plummer
@ 2018-06-21  2:38         ` Jason Zaman
  2018-06-21  2:41           ` M. J. Everitt
  0 siblings, 1 reply; 24+ messages in thread
From: Jason Zaman @ 2018-06-21  2:38 UTC (permalink / raw
  To: gentoo-dev

On Wed, Jun 20, 2018 at 06:01:10PM -0500, Marty E. Plummer wrote:
> On Wed, Jun 20, 2018 at 11:33:53PM +0100, James Le Cuirot wrote:
> > On Wed, 20 Jun 2018 17:21:09 -0500
> > "Marty E. Plummer" <hanetzer@startmail.com> wrote:
> > 
> > > On Wed, Jun 20, 2018 at 09:03:44PM +0800, Jason Zaman wrote:
> > > > On Wed, Jun 20, 2018 at 02:10:50AM -0500, Marty E. Plummer wrote:  
> > > > > Use ${EROOT%/} whereever possible, as the tools and directories which
> > > > > are used with it are already prefixed with a /
> > > > > 
> > > > > Package-Manager: Portage-2.3.40, Repoman-2.3.9
> > > > > ---
> > > > >  eclass/xdg-utils.eclass | 10 +++++-----
> > > > >  1 file changed, 5 insertions(+), 5 deletions(-)
> > > > > 
> > > > > diff --git a/eclass/xdg-utils.eclass b/eclass/xdg-utils.eclass
> > > > > index ac075185d8e..8dba5ed6861 100644
> > > > > --- a/eclass/xdg-utils.eclass
> > > > > +++ b/eclass/xdg-utils.eclass
> > > > > @@ -66,7 +66,7 @@ xdg_environment_reset() {
> > > > >  # Updates the .desktop files database.
> > > > >  # Generates a list of mimetypes linked to applications that can handle them
> > > > >  xdg_desktop_database_update() {
> > > > > -	local updater="${EROOT}${DESKTOP_DATABASE_UPDATE_BIN}"
> > > > > +	local updater="${EROOT%/}${DESKTOP_DATABASE_UPDATE_BIN}"  
> > > > 
> > > > Shouldn't things like this be $BROOT since they're being run? $EROOT
> > > > might be a different architecture that may or may not run at all on the
> > > > build machine.
> > > >   
> > > Good point, but here's a question; if EROOT=${ROOT%/}${EPREFIX}, how do
> > > we use BROOT here? EBROOT? Or longhand ${BROOT%/}${EPREFIX} ? I think
> > > that may be a use case that got missed in the EAPI 7 discussions.
> > 
> > BROOT is already prefixed as BROOT without a prefix would just be /.
> > 
> I don't follow. Its my understanding that BROOT ~= ROOT for most
> situations. But consider this setup:
> Ubuntu amd64 with Gentoo Prefix, emerging a native arm @system to
> /mnt/arm EPREFIX = /home/user/gentoo.
> 
> In this situation, ROOT=/mnt/arm, EROOT=/mnt/arm, but what is BROOT? /,
> or /home/usr/gentoo?

https://dev.gentoo.org/~mgorny/articles/the-ultimate-guide-to-eapi-7.html#broot-variable-for-bdepend

Basically BROOT already contains EPREFIX or BPREFIX or whatever it would
be called. There is like no need for an un-prefixed BROOT so its just
merged in. so you should just need "${BROOT}/usr/bin/update-mime-database"

-- Jason

> > -- 
> > James Le Cuirot (chewi)
> > Gentoo Linux Developer
> 
> 
> 


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [gentoo-dev] [PATCH 1/4] xdg-utils.eclass: make EAPI 7 ready
  2018-06-21  2:38         ` Jason Zaman
@ 2018-06-21  2:41           ` M. J. Everitt
  2018-06-21  3:09             ` Marty E. Plummer
  0 siblings, 1 reply; 24+ messages in thread
From: M. J. Everitt @ 2018-06-21  2:41 UTC (permalink / raw
  To: gentoo-dev


[-- Attachment #1.1: Type: text/plain, Size: 2609 bytes --]

On 21/06/18 03:38, Jason Zaman wrote:
> On Wed, Jun 20, 2018 at 06:01:10PM -0500, Marty E. Plummer wrote:
>> On Wed, Jun 20, 2018 at 11:33:53PM +0100, James Le Cuirot wrote:
>>> On Wed, 20 Jun 2018 17:21:09 -0500
>>> "Marty E. Plummer" <hanetzer@startmail.com> wrote:
>>>
>>>> On Wed, Jun 20, 2018 at 09:03:44PM +0800, Jason Zaman wrote:
>>>>> On Wed, Jun 20, 2018 at 02:10:50AM -0500, Marty E. Plummer wrote:  
>>>>>> Use ${EROOT%/} whereever possible, as the tools and directories which
>>>>>> are used with it are already prefixed with a /
>>>>>>
>>>>>> Package-Manager: Portage-2.3.40, Repoman-2.3.9
>>>>>> ---
>>>>>>  eclass/xdg-utils.eclass | 10 +++++-----
>>>>>>  1 file changed, 5 insertions(+), 5 deletions(-)
>>>>>>
>>>>>> diff --git a/eclass/xdg-utils.eclass b/eclass/xdg-utils.eclass
>>>>>> index ac075185d8e..8dba5ed6861 100644
>>>>>> --- a/eclass/xdg-utils.eclass
>>>>>> +++ b/eclass/xdg-utils.eclass
>>>>>> @@ -66,7 +66,7 @@ xdg_environment_reset() {
>>>>>>  # Updates the .desktop files database.
>>>>>>  # Generates a list of mimetypes linked to applications that can handle them
>>>>>>  xdg_desktop_database_update() {
>>>>>> -	local updater="${EROOT}${DESKTOP_DATABASE_UPDATE_BIN}"
>>>>>> +	local updater="${EROOT%/}${DESKTOP_DATABASE_UPDATE_BIN}"  
>>>>> Shouldn't things like this be $BROOT since they're being run? $EROOT
>>>>> might be a different architecture that may or may not run at all on the
>>>>> build machine.
>>>>>   
>>>> Good point, but here's a question; if EROOT=${ROOT%/}${EPREFIX}, how do
>>>> we use BROOT here? EBROOT? Or longhand ${BROOT%/}${EPREFIX} ? I think
>>>> that may be a use case that got missed in the EAPI 7 discussions.
>>> BROOT is already prefixed as BROOT without a prefix would just be /.
>>>
>> I don't follow. Its my understanding that BROOT ~= ROOT for most
>> situations. But consider this setup:
>> Ubuntu amd64 with Gentoo Prefix, emerging a native arm @system to
>> /mnt/arm EPREFIX = /home/user/gentoo.
>>
>> In this situation, ROOT=/mnt/arm, EROOT=/mnt/arm, but what is BROOT? /,
>> or /home/usr/gentoo?
> https://dev.gentoo.org/~mgorny/articles/the-ultimate-guide-to-eapi-7.html#broot-variable-for-bdepend
>
> Basically BROOT already contains EPREFIX or BPREFIX or whatever it would
> be called. There is like no need for an un-prefixed BROOT so its just
> merged in. so you should just need "${BROOT}/usr/bin/update-mime-database"
>
> -- Jason
>
>>> -- 
>>> James Le Cuirot (chewi)
>>> Gentoo Linux Developer
>>
>>
Obligatory n00b question .. how does this work in EAPI <= 6 ?! :D


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [gentoo-dev] [PATCH 1/4] xdg-utils.eclass: make EAPI 7 ready
  2018-06-21  2:41           ` M. J. Everitt
@ 2018-06-21  3:09             ` Marty E. Plummer
  2018-06-21  9:00               ` James Le Cuirot
  0 siblings, 1 reply; 24+ messages in thread
From: Marty E. Plummer @ 2018-06-21  3:09 UTC (permalink / raw
  To: gentoo-dev

On Thu, Jun 21, 2018 at 03:41:02AM +0100, M. J. Everitt wrote:
> On 21/06/18 03:38, Jason Zaman wrote:
> > On Wed, Jun 20, 2018 at 06:01:10PM -0500, Marty E. Plummer wrote:
> >> On Wed, Jun 20, 2018 at 11:33:53PM +0100, James Le Cuirot wrote:
> >>> On Wed, 20 Jun 2018 17:21:09 -0500
> >>> "Marty E. Plummer" <hanetzer@startmail.com> wrote:
> >>>
> >>>> On Wed, Jun 20, 2018 at 09:03:44PM +0800, Jason Zaman wrote:
> >>>>> On Wed, Jun 20, 2018 at 02:10:50AM -0500, Marty E. Plummer wrote:  
> >>>>>> Use ${EROOT%/} whereever possible, as the tools and directories which
> >>>>>> are used with it are already prefixed with a /
> >>>>>>
> >>>>>> Package-Manager: Portage-2.3.40, Repoman-2.3.9
> >>>>>> ---
> >>>>>>  eclass/xdg-utils.eclass | 10 +++++-----
> >>>>>>  1 file changed, 5 insertions(+), 5 deletions(-)
> >>>>>>
> >>>>>> diff --git a/eclass/xdg-utils.eclass b/eclass/xdg-utils.eclass
> >>>>>> index ac075185d8e..8dba5ed6861 100644
> >>>>>> --- a/eclass/xdg-utils.eclass
> >>>>>> +++ b/eclass/xdg-utils.eclass
> >>>>>> @@ -66,7 +66,7 @@ xdg_environment_reset() {
> >>>>>>  # Updates the .desktop files database.
> >>>>>>  # Generates a list of mimetypes linked to applications that can handle them
> >>>>>>  xdg_desktop_database_update() {
> >>>>>> -	local updater="${EROOT}${DESKTOP_DATABASE_UPDATE_BIN}"
> >>>>>> +	local updater="${EROOT%/}${DESKTOP_DATABASE_UPDATE_BIN}"  
> >>>>> Shouldn't things like this be $BROOT since they're being run? $EROOT
> >>>>> might be a different architecture that may or may not run at all on the
> >>>>> build machine.
> >>>>>   
> >>>> Good point, but here's a question; if EROOT=${ROOT%/}${EPREFIX}, how do
> >>>> we use BROOT here? EBROOT? Or longhand ${BROOT%/}${EPREFIX} ? I think
> >>>> that may be a use case that got missed in the EAPI 7 discussions.
> >>> BROOT is already prefixed as BROOT without a prefix would just be /.
> >>>
> >> I don't follow. Its my understanding that BROOT ~= ROOT for most
> >> situations. But consider this setup:
> >> Ubuntu amd64 with Gentoo Prefix, emerging a native arm @system to
> >> /mnt/arm EPREFIX = /home/user/gentoo.
> >>
> >> In this situation, ROOT=/mnt/arm, EROOT=/mnt/arm, but what is BROOT? /,
> >> or /home/usr/gentoo?
> > https://dev.gentoo.org/~mgorny/articles/the-ultimate-guide-to-eapi-7.html#broot-variable-for-bdepend
> >
> > Basically BROOT already contains EPREFIX or BPREFIX or whatever it would
> > be called. There is like no need for an un-prefixed BROOT so its just
> > merged in. so you should just need "${BROOT}/usr/bin/update-mime-database"
> >
> > -- Jason
> >
> >>> -- 
> >>> James Le Cuirot (chewi)
> >>> Gentoo Linux Developer
> >>
> >>
> Obligatory n00b question .. how does this work in EAPI <= 6 ?! :D
> 
I would guess something like has eapi 7 || ROOT = BROOT or whatever. Use
BROOT by default and if the EAPI doesn't support it set ROOT to BROOT or
somat.




^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [gentoo-dev] [PATCH 1/4] xdg-utils.eclass: make EAPI 7 ready
  2018-06-21  3:09             ` Marty E. Plummer
@ 2018-06-21  9:00               ` James Le Cuirot
  0 siblings, 0 replies; 24+ messages in thread
From: James Le Cuirot @ 2018-06-21  9:00 UTC (permalink / raw
  To: gentoo-dev

On Wed, 20 Jun 2018 22:09:21 -0500
"Marty E. Plummer" <hanetzer@startmail.com> wrote:

> On Thu, Jun 21, 2018 at 03:41:02AM +0100, M. J. Everitt wrote:
> > On 21/06/18 03:38, Jason Zaman wrote:  
> > > On Wed, Jun 20, 2018 at 06:01:10PM -0500, Marty E. Plummer
> > > wrote:  
> > >> On Wed, Jun 20, 2018 at 11:33:53PM +0100, James Le Cuirot
> > >> wrote:  
> > >>> On Wed, 20 Jun 2018 17:21:09 -0500
> > >>> "Marty E. Plummer" <hanetzer@startmail.com> wrote:
> > >>>  
> > >>>> On Wed, Jun 20, 2018 at 09:03:44PM +0800, Jason Zaman wrote:  
> > >>>>> On Wed, Jun 20, 2018 at 02:10:50AM -0500, Marty E. Plummer
> > >>>>> wrote:    
> > >>>>>> Use ${EROOT%/} whereever possible, as the tools and
> > >>>>>> directories which are used with it are already prefixed with
> > >>>>>> a /
> > >>>>>>
> > >>>>>> Package-Manager: Portage-2.3.40, Repoman-2.3.9
> > >>>>>> ---
> > >>>>>>  eclass/xdg-utils.eclass | 10 +++++-----
> > >>>>>>  1 file changed, 5 insertions(+), 5 deletions(-)
> > >>>>>>
> > >>>>>> diff --git a/eclass/xdg-utils.eclass
> > >>>>>> b/eclass/xdg-utils.eclass index ac075185d8e..8dba5ed6861
> > >>>>>> 100644 --- a/eclass/xdg-utils.eclass
> > >>>>>> +++ b/eclass/xdg-utils.eclass
> > >>>>>> @@ -66,7 +66,7 @@ xdg_environment_reset() {
> > >>>>>>  # Updates the .desktop files database.
> > >>>>>>  # Generates a list of mimetypes linked to applications that
> > >>>>>> can handle them xdg_desktop_database_update() {
> > >>>>>> -	local
> > >>>>>> updater="${EROOT}${DESKTOP_DATABASE_UPDATE_BIN}"
> > >>>>>> +	local
> > >>>>>> updater="${EROOT%/}${DESKTOP_DATABASE_UPDATE_BIN}"    
> > >>>>> Shouldn't things like this be $BROOT since they're being run?
> > >>>>> $EROOT might be a different architecture that may or may not
> > >>>>> run at all on the build machine.
> > >>>>>     
> > >>>> Good point, but here's a question; if
> > >>>> EROOT=${ROOT%/}${EPREFIX}, how do we use BROOT here? EBROOT?
> > >>>> Or longhand ${BROOT%/}${EPREFIX} ? I think that may be a use
> > >>>> case that got missed in the EAPI 7 discussions.  
> > >>> BROOT is already prefixed as BROOT without a prefix would just
> > >>> be /. 
> > >> I don't follow. Its my understanding that BROOT ~= ROOT for most
> > >> situations. But consider this setup:
> > >> Ubuntu amd64 with Gentoo Prefix, emerging a native arm @system to
> > >> /mnt/arm EPREFIX = /home/user/gentoo.
> > >>
> > >> In this situation, ROOT=/mnt/arm, EROOT=/mnt/arm, but what is
> > >> BROOT? /, or /home/usr/gentoo?  
> > > https://dev.gentoo.org/~mgorny/articles/the-ultimate-guide-to-eapi-7.html#broot-variable-for-bdepend
> > >
> > > Basically BROOT already contains EPREFIX or BPREFIX or whatever
> > > it would be called. There is like no need for an un-prefixed
> > > BROOT so its just merged in. so you should just need
> > > "${BROOT}/usr/bin/update-mime-database"
> > >
> > Obligatory n00b question .. how does this work in EAPI <= 6 ?! :D
> >   
> I would guess something like has eapi 7 || ROOT = BROOT or whatever.
> Use BROOT by default and if the EAPI doesn't support it set ROOT to
> BROOT or somat.

There was no variable for BROOT before EAPI 7, that's why we created
one! There was an internal Portage variable called
PORTAGE_OVERRIDE_EPREFIX, which is basically what BROOT gets set to now
but you should not use this in an eclass. I guess the safest fallback
would be EPREFIX. This would be technically wrong for cross-prefix
builds but unlikely to cause a problem in practise. Don't do
${BROOT-${EPREFIX}} though because BROOT is usually empty anyway.

-- 
James Le Cuirot (chewi)
Gentoo Linux Developer


^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2018-06-21  9:00 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-20  7:10 [gentoo-dev] [PATCH 1/4] xdg-utils.eclass: make EAPI 7 ready Marty E. Plummer
2018-06-20  7:10 ` [gentoo-dev] [PATCH 2/4] gnome2-utils.eclass: " Marty E. Plummer
2018-06-20  7:25   ` Michał Górny
2018-06-20  9:00     ` Marty E. Plummer
2018-06-21  0:43     ` Marty E. Plummer
2018-06-20  7:10 ` [gentoo-dev] [PATCH 3/4] gnome2-utils: move icon functions into xdg-utils Marty E. Plummer
2018-06-20  7:27   ` Michał Górny
2018-06-20  9:03     ` Marty E. Plummer
2018-06-20  9:18       ` Michał Górny
2018-06-20  7:10 ` [gentoo-dev] [PATCH 4/4] gnome2.eclass: move icon handling code to xdg.eclass Marty E. Plummer
2018-06-20  7:27   ` Michał Górny
2018-06-20  9:04     ` Marty E. Plummer
2018-06-20  9:19       ` Michał Górny
2018-06-20 10:07         ` Marty E. Plummer
2018-06-20 10:11           ` Michał Górny
2018-06-20 13:03 ` [gentoo-dev] [PATCH 1/4] xdg-utils.eclass: make EAPI 7 ready Jason Zaman
2018-06-20 19:31   ` James Le Cuirot
2018-06-20 22:21   ` Marty E. Plummer
2018-06-20 22:33     ` James Le Cuirot
2018-06-20 23:01       ` Marty E. Plummer
2018-06-21  2:38         ` Jason Zaman
2018-06-21  2:41           ` M. J. Everitt
2018-06-21  3:09             ` Marty E. Plummer
2018-06-21  9:00               ` James Le Cuirot

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