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: signature.asc
Description: This is a digitally signed message part

Reply via email to