public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Marty E. Plummer" <hanetzer@startmail.com>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] [PATCH 2/4] gnome2-utils.eclass: make EAPI 7 ready
Date: Wed, 20 Jun 2018 19:43:58 -0500	[thread overview]
Message-ID: <20180621004357.gcva3es33l625bwo@proprietary-killer> (raw)
In-Reply-To: <1529479530.2506.1.camel@gentoo.org>

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




  parent reply	other threads:[~2018-06-21  0:45 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180621004357.gcva3es33l625bwo@proprietary-killer \
    --to=hanetzer@startmail.com \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox