[PATCH 00/10] {gnome2,xdg}{,-utils}.eclass: EAPI 7 work

classic Classic list List threaded Threaded
19 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH 00/10] {gnome2,xdg}{,-utils}.eclass: EAPI 7 work

Marty E. Plummer
Round four. I think I've finally got everything covered properly.
Flipped a lot of has ${EAPI} 6 stuff to [[ ${EAPI:-0} == [012345] ]]
negations as the former version would require adding new EAPI versions
until the end of time. This way you have a finite list of unsupported
EAPIs

Marty E. Plummer (10):
  gnome2-utils: move icon functions into xdg-utils
  gnome2.eclass: move icon handling code to xdg.eclass
  xdg-utils.eclass: make EAPI 7 ready
  gnome2-utils.eclass: make EAPI 7 ready
  xdg.eclass: make EAPI 7 ready
  gnome2.eclass: make EAPI 7 ready
  xdg-utils.eclass: enable EAPI 7
  gnome2-utils.eclass: enable EAPI 7
  xdg.eclass: enable EAPI 7
  gnome2.eclass: enable EAPI 7

 eclass/gnome2-utils.eclass | 154 +++++++++++++++----------------------
 eclass/gnome2.eclass       |  23 ++----
 eclass/xdg-utils.eclass    |  72 +++++++++++++++--
 eclass/xdg.eclass          |  36 ++++++---
 4 files changed, 164 insertions(+), 121 deletions(-)

--
2.17.1


Reply | Threaded
Open this post in threaded view
|

[PATCH 01/10] gnome2-utils: move icon functions into xdg-utils

Marty E. Plummer
Kept some dummy stub functions in place in order to maintain
functionality of existing ebuilds.

Package-Manager: Portage-2.3.40, Repoman-2.3.9
---
 eclass/gnome2-utils.eclass | 56 ++---------------------------------
 eclass/xdg-utils.eclass    | 60 +++++++++++++++++++++++++++++++++++++-
 2 files changed, 62 insertions(+), 54 deletions(-)

diff --git a/eclass/gnome2-utils.eclass b/eclass/gnome2-utils.eclass
index 65076ae2d61..1597ac4ad08 100644
--- a/eclass/gnome2-utils.eclass
+++ b/eclass/gnome2-utils.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 # @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:
@@ -221,53 +215,9 @@ gnome2_icon_savelist() {
 # @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. Please use xdg_icon_cache_update from xdg-utils.eclass
 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
+ xdg_icon_cache_update
 }
 
 # @FUNCTION: gnome2_omf_fix
diff --git a/eclass/xdg-utils.eclass b/eclass/xdg-utils.eclass
index ac075185d8e..f9088d9c348 100644
--- a/eclass/xdg-utils.eclass
+++ b/eclass/xdg-utils.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 # @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:
@@ -82,6 +88,58 @@ xdg_desktop_database_update() {
  eend $?
 }
 
+# @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


Reply | Threaded
Open this post in threaded view
|

[PATCH 02/10] gnome2.eclass: move icon handling code to xdg.eclass

Marty E. Plummer
In reply to this post by Marty E. Plummer
Package-Manager: Portage-2.3.40, Repoman-2.3.9
---
 eclass/gnome2.eclass |  9 +--------
 eclass/xdg.eclass    | 31 ++++++++++++++++++++++++-------
 2 files changed, 25 insertions(+), 15 deletions(-)

diff --git a/eclass/gnome2.eclass b/eclass/gnome2.eclass
index 6db6d08b14e..c4418df92bb 100644
--- a/eclass/gnome2.eclass
+++ b/eclass/gnome2.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 # @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..2a4e1f81abf 100644
--- a/eclass/xdg.eclass
+++ b/eclass/xdg.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 # @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_ICONFILES
+# and XDG_ECLASS_MIMEINFOFILES respectively.
 xdg_pkg_preinst() {
  local f
 
@@ -50,17 +50,22 @@ xdg_pkg_preinst() {
  XDG_ECLASS_DESKTOPFILES+=( ${f} )
  done < <(cd "${D}" && find 'usr/share/applications' -type f -print0 2>/dev/null)
 
+ XDG_ECLASS_ICONFILES=()
+ while IFS= read -r '' f; do
+ XDG_ECLASS_ICONFILES+=( ${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} )
  done < <(cd "${D}" && find 'usr/share/mime' -type f -print0 2>/dev/null)
 
- export XDG_ECLASS_DESKTOPFILES XDG_ECLASS_MIMEINFOFILES
+ export XDG_ECLASS_DESKTOPFILES XDG_ECLASS_ICONFILES XDG_ECLASS_MIMEINFOFILES
 }
 
 # @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_ICONFILES[@]} -gt 0 ]]; then
+ xdg_icon_cache_update
+ else
+ debug-print "No icon files to add to cache"
+ 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_ICONFILES[@]} -gt 0 ]]; then
+ xdg_icon_cache_update
+ else
+ debug-print "No icon files to add to cache"
+ fi
+
  if [[ ${#XDG_ECLASS_MIMEINFOFILES[@]} -gt 0 ]]; then
  xdg_mimeinfo_database_update
  else
--
2.17.1


Reply | Threaded
Open this post in threaded view
|

[PATCH 03/10] xdg-utils.eclass: make EAPI 7 ready

Marty E. Plummer
In reply to this post by Marty E. Plummer
Use ${EROOT%/} whereever possible, as the tools and directories which
are used with it are already prefixed with a /
Use BROOT to specify path to update-mime-database and friends, setting
that to EROOT when not EAPI 7

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

diff --git a/eclass/xdg-utils.eclass b/eclass/xdg-utils.eclass
index f9088d9c348..9e4d4638e38 100644
--- a/eclass/xdg-utils.eclass
+++ b/eclass/xdg-utils.eclass
@@ -72,7 +72,8 @@ 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}"
+ [[ ${EAPI:-0} == [0123456] ]] && BROOT=${EROOT}
+ local updater="${BROOT%/}${DESKTOP_DATABASE_UPDATE_BIN}"
 
  if [[ ${EBUILD_PHASE} != post* ]] ; then
  die "xdg_desktop_database_update must be used in pkg_post* phases."
@@ -84,7 +85,7 @@ xdg_desktop_database_update() {
  fi
 
  ebegin "Updating .desktop files database"
- "${updater}" -q "${EROOT}${DESKTOP_DATABASE_DIR}"
+ "${updater}" -q "${EROOT%/}${DESKTOP_DATABASE_DIR}"
  eend $?
 }
 
@@ -93,8 +94,8 @@ xdg_desktop_database_update() {
 # 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}"
+ [[ ${EAPI:-0} == [0123456] ]] && BROOT=${EROOT}
+ local updater="${BROOT%/}${GTK_UPDATE_ICON_CACHE}"
 
  if [[ ! -x "${updater}" ]]; then
  debug-print "${updater} is not executable"
@@ -145,7 +146,8 @@ xdg_icon_cache_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}"
+ [[ ${EAPI:-0} == [0123456] ]] && BROOT=${EROOT}
+ local updater="${BROOT%/}${MIMEINFO_DATABASE_UPDATE_BIN}"
 
  if [[ ${EBUILD_PHASE} != post* ]] ; then
  die "xdg_mimeinfo_database_update must be used in pkg_post* phases."
@@ -157,6 +159,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


Reply | Threaded
Open this post in threaded view
|

[PATCH 04/10] gnome2-utils.eclass: make EAPI 7 ready

Marty E. Plummer
In reply to this post by 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.

Drop EAPI 0-2 support as no in-tree ebuilds use it to simplify the
ROOT/EROOT/BROOT logic.

Use BROOT to specify path to executable files, setting that to EROOT
when not EAPI 7

Package-Manager: Portage-2.3.40, Repoman-2.3.9
---
 eclass/gnome2-utils.eclass | 100 ++++++++++++++++++++++---------------
 1 file changed, 61 insertions(+), 39 deletions(-)

diff --git a/eclass/gnome2-utils.eclass b/eclass/gnome2-utils.eclass
index 1597ac4ad08..6bd3cebac2d 100644
--- a/eclass/gnome2-utils.eclass
+++ b/eclass/gnome2-utils.eclass
@@ -76,9 +76,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
@@ -95,7 +92,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 [[ ${EAPI:-0} != [012345] ]]; then
  # Try to cover the packages honoring this variable, bug #508124
  export GST_INSPECT="$(type -P true)"
 
@@ -110,7 +107,6 @@ gnome2_environment_reset() {
 # in the GNOME2_ECLASS_SCHEMAS environment variable.
 # This function should be called from pkg_preinst.
 gnome2_gconf_savelist() {
- has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
  pushd "${ED}" > /dev/null || die
  export GNOME2_ECLASS_SCHEMAS=$(find 'etc/gconf/schemas/' -name '*.schemas' 2> /dev/null)
  popd > /dev/null || die
@@ -122,8 +118,8 @@ gnome2_gconf_savelist() {
 # using gconftool-2.
 # 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}"
+ [[ ${EAPI:-0} == [0123456] ]] && BROOT=${EROOT}
+ local updater="${BROOT%/}${GCONFTOOL_BIN}"
 
  if [[ ! -x "${updater}" ]]; then
  debug-print "${updater} is not executable"
@@ -143,9 +139,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
 
@@ -163,8 +159,8 @@ gnome2_gconf_install() {
 # Removes schema files previously installed by the current ebuild from Gconf's
 # database.
 gnome2_gconf_uninstall() {
- has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
- local updater="${EROOT}${GCONFTOOL_BIN}"
+ [[ ${EAPI:-0} == [0123456] ]] && BROOT=${EROOT}
+ local updater="${BROOT%/}${GCONFTOOL_BIN}"
 
  if [[ ! -x "${updater}" ]]; then
  debug-print "${updater} is not executable"
@@ -183,9 +179,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
 
@@ -206,10 +202,15 @@ gnome2_gconf_uninstall() {
 # gnome2_icon_cache_update conditionally.
 # This function should be called from pkg_preinst.
 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
+ if [[ ${EAPI:-0} == [0123456] ]]; then
+ 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
+ else
+ eerror "gnome2_icon_savelist is banned in EAPI ${EAPI}"
+ eerror "please migrate to the related functions in xdg-utils and xdg"
+ die
+ fi
 }
 
 # @FUNCTION: gnome2_icon_cache_update
@@ -217,7 +218,13 @@ gnome2_icon_savelist() {
 # Updates Gtk+ icon cache files under /usr/share/icons.
 # Deprecated. Please use xdg_icon_cache_update from xdg-utils.eclass
 gnome2_icon_cache_update() {
- xdg_icon_cache_update
+ if [[ ${EAPI:-0} == [0123456] ]]; then
+ xdg_icon_cache_update
+ else
+ eerror "gnome2_icon_cache_update is banned in EAPI ${EAPI}"
+ eerror "please migrate to xdg_icon_cache_update in xdg-utils"
+ die
+ fi
 }
 
 # @FUNCTION: gnome2_omf_fix
@@ -277,7 +284,6 @@ gnome2_omf_fix() {
 # in the GNOME2_ECLASS_SCROLLS environment variable.
 # This function should be called from pkg_preinst.
 gnome2_scrollkeeper_savelist() {
- has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
  pushd "${ED}" > /dev/null || die
  export GNOME2_ECLASS_SCROLLS=$(find 'usr/share/omf' -type f -name "*.omf" 2> /dev/null)
  popd > /dev/null || die
@@ -288,8 +294,8 @@ gnome2_scrollkeeper_savelist() {
 # Updates the global scrollkeeper database.
 # 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}"
+ [[ ${EAPI:-0} == [0123456] ]] && BROOT=${EROOT}
+ local updater="${BROOT%/}${SCROLLKEEPER_UPDATE_BIN}"
 
  if [[ ! -x "${updater}" ]] ; then
  debug-print "${updater} is not executable"
@@ -302,7 +308,7 @@ gnome2_scrollkeeper_update() {
  fi
 
  ebegin "Updating scrollkeeper database ..."
- "${updater}" -q -p "${EROOT}${SCROLLKEEPER_DIR}"
+ "${updater}" -q -p "${EROOT%/}${SCROLLKEEPER_DIR}"
  eend $?
 }
 
@@ -313,7 +319,6 @@ gnome2_scrollkeeper_update() {
 # implementations that call gnome2_schemas_update conditionally.
 # This function should be called from pkg_preinst.
 gnome2_schemas_savelist() {
- has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
  pushd "${ED}" > /dev/null || die
  export GNOME2_ECLASS_GLIB_SCHEMAS=$(find 'usr/share/glib-2.0/schemas' -name '*.gschema.xml' 2>/dev/null)
  popd > /dev/null || die
@@ -325,8 +330,8 @@ gnome2_schemas_savelist() {
 # Updates GSettings schemas.
 # 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}"
+ [[ ${EAPI:-0} == [0123456] ]] && BROOT=${EROOT}
+ local updater="${BROOT%/}${GLIB_COMPILE_SCHEMAS}"
 
  if [[ ! -x ${updater} ]]; then
  debug-print "${updater} is not executable"
@@ -344,7 +349,6 @@ gnome2_schemas_update() {
 # GNOME2_ECLASS_GDK_PIXBUF_LOADERS variable.
 # This function should be called from pkg_preinst.
 gnome2_gdk_pixbuf_savelist() {
- has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
  pushd "${ED}" > /dev/null || die
  export GNOME2_ECLASS_GDK_PIXBUF_LOADERS=$(find usr/lib*/gdk-pixbuf-2.0 -type f 2>/dev/null)
  popd > /dev/null || die
@@ -356,11 +360,11 @@ gnome2_gdk_pixbuf_savelist() {
 # Updates gdk-pixbuf loader cache if GNOME2_ECLASS_GDK_PIXBUF_LOADERS has some.
 # 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"
+ [[ ${EAPI:-0} == [0123456] ]] && BROOT=${EROOT}
+ local updater="${BROOT%/}/usr/bin/${CHOST}-gdk-pixbuf-query-loaders"
 
  if [[ ! -x ${updater} ]]; then
- updater="${EROOT}/usr/bin/gdk-pixbuf-query-loaders"
+ updater="${BROOT%/}/usr/bin/gdk-pixbuf-query-loaders"
  fi
 
  if [[ ! -x ${updater} ]]; then
@@ -377,7 +381,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 $?
 }
@@ -387,11 +391,20 @@ gnome2_gdk_pixbuf_update() {
 # @DESCRIPTION:
 # Updates gtk2 immodules/gdk-pixbuf loaders listing.
 gnome2_query_immodules_gtk2() {
- local updater=${EPREFIX}/usr/bin/${CHOST}-gtk-query-immodules-2.0
- [[ ! -x ${updater} ]] && updater=${EPREFIX}/usr/bin/gtk-query-immodules-2.0
+ [[ ${EAPI:-0} == [0123456] ]] && BROOT=${EROOT}
+ local updater=${BROOT%/}/usr/bin/${CHOST}-gtk-query-immodules-2.0
+
+ if [[ ! -x ${updater} ]]; then
+ updater="${BROOT%/}/usr/bin/gtk-query-immodules-2.0"
+ fi
+
+ if [[ ! -x ${updater} ]]; then
+ debug-print "${updater} is not executable"
+ return
+ fi
 
  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 $?
 }
@@ -401,11 +414,20 @@ gnome2_query_immodules_gtk2() {
 # @DESCRIPTION:
 # Updates gtk3 immodules/gdk-pixbuf loaders listing.
 gnome2_query_immodules_gtk3() {
- local updater=${EPREFIX}/usr/bin/${CHOST}-gtk-query-immodules-3.0
- [[ ! -x ${updater} ]] && updater=${EPREFIX}/usr/bin/gtk-query-immodules-3.0
+ [[ ${EAPI:-0} == [0123456] ]] && BROOT=${EROOT}
+ local updater=${BROOT%/}/usr/bin/${CHOST}-gtk-query-immodules-3.0
+
+ if [[ -x ${updater} ]]; then
+ updater=${BROOT%/}/usr/bin/gtk-query-immodules-3.0
+ fi
+
+ if [[ ! -x ${updater} ]]; then
+ debug-print "${updater} is not executable"
+ return
+ fi
 
  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 $?
 }
@@ -416,11 +438,11 @@ gnome2_query_immodules_gtk3() {
 # Updates glib's gio modules cache.
 # 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"
+ [[ ${EAPI:-0} == [0123456] ]] && BROOT=${EROOT}
+ local updater="${BROOT%/}/usr/bin/${CHOST}-gio-querymodules"
 
  if [[ ! -x ${updater} ]]; then
- updater="${EROOT}/usr/bin/gio-querymodules"
+ updater="${BROOT%/}/usr/bin/gio-querymodules"
  fi
 
  if [[ ! -x ${updater} ]]; then
--
2.17.1


Reply | Threaded
Open this post in threaded view
|

[PATCH 05/10] xdg.eclass: make EAPI 7 ready

Marty E. Plummer
In reply to this post by Marty E. Plummer
Add dev-util/desktop-file-utils and x11-misc/shared-mime-info to BDEPEND
as a number of executables which will need to be executed on the build
host are included in them.

Package-Manager: Portage-2.3.40, Repoman-2.3.9
---
 eclass/xdg.eclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/eclass/xdg.eclass b/eclass/xdg.eclass
index 2a4e1f81abf..fc4bee30ca5 100644
--- a/eclass/xdg.eclass
+++ b/eclass/xdg.eclass
@@ -26,6 +26,7 @@ DEPEND="
  dev-util/desktop-file-utils
  x11-misc/shared-mime-info
 "
+[[ ${EAPI:-0} == [0123456] ]] || BDEPEND="${DEPEND}"
 fi
 
 # @FUNCTION: xdg_src_prepare
@@ -34,7 +35,7 @@ fi
 xdg_src_prepare() {
  xdg_environment_reset
 
- has ${EAPI:-0} 6 && default
+ [[ ${EAPI:-0} == [012345] ]] || default
 }
 
 # @FUNCTION: xdg_pkg_preinst
--
2.17.1


Reply | Threaded
Open this post in threaded view
|

[PATCH 06/10] gnome2.eclass: make EAPI 7 ready

Marty E. Plummer
In reply to this post by Marty E. Plummer
Package-Manager: Portage-2.3.40, Repoman-2.3.9
---
 eclass/gnome2.eclass | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/eclass/gnome2.eclass b/eclass/gnome2.eclass
index c4418df92bb..57eafcd451b 100644
--- a/eclass/gnome2.eclass
+++ b/eclass/gnome2.eclass
@@ -256,7 +256,7 @@ gnome2_src_install() {
  # create bogus directories in /var/lib/
  if has ${EAPI:-0} 4 5; then
  dodir "${sk_tmp_dir}" || die "dodir failed"
- emake DESTDIR="${D}" "scrollkeeper_localstate_dir=${ED}${sk_tmp_dir} " "$@" install || die "install failed"
+ emake DESTDIR="${D}" "scrollkeeper_localstate_dir=${ED%/}${sk_tmp_dir} " "$@" install || die "install failed"
  else
  default
  fi
@@ -282,14 +282,14 @@ gnome2_src_install() {
 
  # Do not keep /var/lib/scrollkeeper because:
  # 1. The scrollkeeper database is regenerated at pkg_postinst()
- # 2. ${ED}/var/lib/scrollkeeper contains only indexes for the current pkg
+ # 2. ${ED%/}/var/lib/scrollkeeper contains only indexes for the current pkg
  #    thus it makes no sense if pkg_postinst ISN'T run for some reason.
- rm -rf "${ED}${sk_tmp_dir}"
- rmdir "${ED}/var/lib" 2>/dev/null
- rmdir "${ED}/var" 2>/dev/null
+ rm -rf "${ED%/}${sk_tmp_dir}"
+ rmdir "${ED%/}/var/lib" 2>/dev/null
+ rmdir "${ED%/}/var" 2>/dev/null
 
  # Make sure this one doesn't get in the portage db
- rm -fr "${ED}/usr/share/applications/mimeinfo.cache"
+ rm -fr "${ED%/}/usr/share/applications/mimeinfo.cache"
 
  # Delete all .la files
  if has ${EAPI:-0} 4; then
--
2.17.1


Reply | Threaded
Open this post in threaded view
|

[PATCH 07/10] xdg-utils.eclass: enable EAPI 7

Marty E. Plummer
In reply to this post by Marty E. Plummer
Package-Manager: Portage-2.3.40, Repoman-2.3.9
---
 eclass/xdg-utils.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/xdg-utils.eclass b/eclass/xdg-utils.eclass
index 9e4d4638e38..a947aad58d6 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
 
--
2.17.1


Reply | Threaded
Open this post in threaded view
|

[PATCH 08/10] gnome2-utils.eclass: enable EAPI 7

Marty E. Plummer
In reply to this post by Marty E. Plummer
Package-Manager: Portage-2.3.40, Repoman-2.3.9
---
 eclass/gnome2-utils.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/gnome2-utils.eclass b/eclass/gnome2-utils.eclass
index 6bd3cebac2d..ee570fe9c66 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
 
--
2.17.1


Reply | Threaded
Open this post in threaded view
|

[PATCH 09/10] xdg.eclass: enable EAPI 7

Marty E. Plummer
In reply to this post by Marty E. Plummer
Package-Manager: Portage-2.3.40, Repoman-2.3.9
---
 eclass/xdg.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/xdg.eclass b/eclass/xdg.eclass
index fc4bee30ca5..78164993eb5 100644
--- a/eclass/xdg.eclass
+++ b/eclass/xdg.eclass
@@ -14,7 +14,7 @@
 inherit xdg-utils
 
 case "${EAPI:-0}" in
- 4|5|6)
+ 4|5|6|7)
  EXPORT_FUNCTIONS src_prepare pkg_preinst pkg_postinst pkg_postrm
  ;;
  *) die "EAPI=${EAPI} is not supported" ;;
--
2.17.1


Reply | Threaded
Open this post in threaded view
|

[PATCH 10/10] gnome2.eclass: enable EAPI 7

Marty E. Plummer
In reply to this post by Marty E. Plummer
Package-Manager: Portage-2.3.40, Repoman-2.3.9
---
 eclass/gnome2.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/gnome2.eclass b/eclass/gnome2.eclass
index 57eafcd451b..d49a9c21baf 100644
--- a/eclass/gnome2.eclass
+++ b/eclass/gnome2.eclass
@@ -22,7 +22,7 @@ case "${EAPI:-0}" in
  4|5)
  EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install pkg_preinst pkg_postinst pkg_postrm
  ;;
- 6)
+ 6|7)
  EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install pkg_preinst pkg_postinst pkg_postrm
  ;;
  *) die "EAPI=${EAPI} is not supported" ;;
--
2.17.1


Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 05/10] xdg.eclass: make EAPI 7 ready

Ulrich Mueller-2
In reply to this post by Marty E. Plummer
>>>>> On Tue, 26 Jun 2018, Marty E Plummer wrote:

> Add dev-util/desktop-file-utils and x11-misc/shared-mime-info to BDEPEND
> as a number of executables which will need to be executed on the build
> host are included in them.

> Package-Manager: Portage-2.3.40, Repoman-2.3.9
> ---
>  eclass/xdg.eclass | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

> diff --git a/eclass/xdg.eclass b/eclass/xdg.eclass
> index 2a4e1f81abf..fc4bee30ca5 100644
> --- a/eclass/xdg.eclass
> +++ b/eclass/xdg.eclass
> @@ -26,6 +26,7 @@ DEPEND="
>   dev-util/desktop-file-utils
>   x11-misc/shared-mime-info
>  "
> +[[ ${EAPI:-0} == [0123456] ]] || BDEPEND="${DEPEND}"

Are these also needed in DEPEND? If not, you should set DEPEND="" in
EAPI 7.

Ulrich

attachment0 (501 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 05/10] xdg.eclass: make EAPI 7 ready

Michał Górny-5
W dniu śro, 27.06.2018 o godzinie 06∶58 +0200, użytkownik Ulrich Mueller
napisał:

> > > > > > On Tue, 26 Jun 2018, Marty E Plummer wrote:
> > Add dev-util/desktop-file-utils and x11-misc/shared-mime-info to BDEPEND
> > as a number of executables which will need to be executed on the build
> > host are included in them.
> > Package-Manager: Portage-2.3.40, Repoman-2.3.9
> > ---
> >  eclass/xdg.eclass | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > diff --git a/eclass/xdg.eclass b/eclass/xdg.eclass
> > index 2a4e1f81abf..fc4bee30ca5 100644
> > --- a/eclass/xdg.eclass
> > +++ b/eclass/xdg.eclass
> > @@ -26,6 +26,7 @@ DEPEND="
> >   dev-util/desktop-file-utils
> >   x11-misc/shared-mime-info
> >  "
> > +[[ ${EAPI:-0} == [0123456] ]] || BDEPEND="${DEPEND}"
>
> Are these also needed in DEPEND? If not, you should set DEPEND="" in
> EAPI 7.
>
Technically, they don't belong in either because they're run
in pkg_post* phases only.

--
Best regards,
Michał Górny

signature.asc (981 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 05/10] xdg.eclass: make EAPI 7 ready

Marty E. Plummer
On Wed, Jun 27, 2018 at 08:37:04AM +0200, Michał Górny wrote:

> W dniu śro, 27.06.2018 o godzinie 06∶58 +0200, użytkownik Ulrich Mueller
> napisał:
> > > > > > > On Tue, 26 Jun 2018, Marty E Plummer wrote:
> > > Add dev-util/desktop-file-utils and x11-misc/shared-mime-info to BDEPEND
> > > as a number of executables which will need to be executed on the build
> > > host are included in them.
> > > Package-Manager: Portage-2.3.40, Repoman-2.3.9
> > > ---
> > >  eclass/xdg.eclass | 3 ++-
> > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > > diff --git a/eclass/xdg.eclass b/eclass/xdg.eclass
> > > index 2a4e1f81abf..fc4bee30ca5 100644
> > > --- a/eclass/xdg.eclass
> > > +++ b/eclass/xdg.eclass
> > > @@ -26,6 +26,7 @@ DEPEND="
> > >   dev-util/desktop-file-utils
> > >   x11-misc/shared-mime-info
> > >  "
> > > +[[ ${EAPI:-0} == [0123456] ]] || BDEPEND="${DEPEND}"
> >
> > Are these also needed in DEPEND? If not, you should set DEPEND="" in
> > EAPI 7.
> >
>
> Technically, they don't belong in either because they're run
> in pkg_post* phases only.
>
Huh. well, should there not be some way to specify that they are needed
for the pkg_post* phases or should I just drop them entirely?
> --
> Best regards,
> Michał Górny



Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 02/10] gnome2.eclass: move icon handling code to xdg.eclass

Pacho Ramos
In reply to this post by Marty E. Plummer
El mar, 26-06-2018 a las 20:27 -0500, Marty E. Plummer escribió:
> Package-Manager: Portage-2.3.40, Repoman-2.3.9
> ---
>  eclass/gnome2.eclass |  9 +--------
gnome2.eclass would also need to fix this regression in eapi6 (https://bugs.gent
oo.org/613364) and to deprecate ltprune.eclass usage (https://bugs.gentoo.org/65
8638)

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 02/10] gnome2.eclass: move icon handling code to xdg.eclass

Marty E. Plummer
On Wed, Jun 27, 2018 at 06:42:23PM +0200, Pacho Ramos wrote:
> El mar, 26-06-2018 a las 20:27 -0500, Marty E. Plummer escribió:
> > Package-Manager: Portage-2.3.40, Repoman-2.3.9
> > ---
> >  eclass/gnome2.eclass |  9 +--------
> gnome2.eclass would also need to fix this regression in eapi6
> (https://bugs.gentoo.org/613364) and to deprecate ltprune.eclass usage
> (https://bugs.gentoo.org/658638)
>
Good to know, I could probably look into that after this gets fully
approved, since I don't want to juggle too many patches with that many
different goals.

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 05/10] xdg.eclass: make EAPI 7 ready

Marty E. Plummer
In reply to this post by Michał Górny-5
On Wed, Jun 27, 2018 at 08:37:04AM +0200, Michał Górny wrote:

> W dniu śro, 27.06.2018 o godzinie 06∶58 +0200, użytkownik Ulrich Mueller
> napisał:
> > > > > > > On Tue, 26 Jun 2018, Marty E Plummer wrote:
> > > Add dev-util/desktop-file-utils and x11-misc/shared-mime-info to BDEPEND
> > > as a number of executables which will need to be executed on the build
> > > host are included in them.
> > > Package-Manager: Portage-2.3.40, Repoman-2.3.9
> > > ---
> > >  eclass/xdg.eclass | 3 ++-
> > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > > diff --git a/eclass/xdg.eclass b/eclass/xdg.eclass
> > > index 2a4e1f81abf..fc4bee30ca5 100644
> > > --- a/eclass/xdg.eclass
> > > +++ b/eclass/xdg.eclass
> > > @@ -26,6 +26,7 @@ DEPEND="
> > >   dev-util/desktop-file-utils
> > >   x11-misc/shared-mime-info
> > >  "
> > > +[[ ${EAPI:-0} == [0123456] ]] || BDEPEND="${DEPEND}"
> >
> > Are these also needed in DEPEND? If not, you should set DEPEND="" in
> > EAPI 7.
> >
>
> Technically, they don't belong in either because they're run
> in pkg_post* phases only.
>
https://projects.gentoo.org/pms/7/pms.html#x1-680008.1
According to this, if I read it right, pkg_{pre,post}{inst,rm} deps
should go into PDEPEND; is that still correct in terms of EAPI7 and
such?
> --
> Best regards,
> Michał Górny



Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 01/10] gnome2-utils: move icon functions into xdg-utils

Hans de Graaff-2
In reply to this post by Marty E. Plummer
On Tue, 2018-06-26 at 20:27 -0500, Marty E. Plummer wrote:
>
>  # Updates Gtk+ icon cache files under /usr/share/icons.
> -# This function should be called from pkg_postinst and pkg_postrm.
> +# Deprecated. Please use xdg_icon_cache_update from xdg-utils.eclass
>  gnome2_icon_cache_update() {

This would be a good candidate for an eqawarn message. Not sure how
many people will catch this deprecation in the documentation.

Hans

signature.asc (499 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 01/10] gnome2-utils: move icon functions into xdg-utils

Marty E. Plummer
On Sun, Jul 15, 2018 at 08:22:02AM +0200, Hans de Graaff wrote:

> On Tue, 2018-06-26 at 20:27 -0500, Marty E. Plummer wrote:
> >
> >  # Updates Gtk+ icon cache files under /usr/share/icons.
> > -# This function should be called from pkg_postinst and pkg_postrm.
> > +# Deprecated. Please use xdg_icon_cache_update from xdg-utils.eclass
> >  gnome2_icon_cache_update() {
>
> This would be a good candidate for an eqawarn message. Not sure how
> many people will catch this deprecation in the documentation.
>
> Hans
Later patch in the series causes this function to error out on EAPI 7+,
along with a message. I had previously had the same idea, but the ml
thought it would be a bad idea for n amount of currently working ebuilds
to just start yelling out of nowhere. Just force the migration when
updating to EAPI 7 and we're good :)