diff options
Diffstat (limited to 'eclass/gnome2-utils.eclass')
-rw-r--r-- | eclass/gnome2-utils.eclass | 48 |
1 files changed, 22 insertions, 26 deletions
diff --git a/eclass/gnome2-utils.eclass b/eclass/gnome2-utils.eclass index 06683a7467f8..06643db0f605 100644 --- a/eclass/gnome2-utils.eclass +++ b/eclass/gnome2-utils.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2019 Gentoo Authors +# Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: gnome2-utils.eclass @@ -15,8 +15,9 @@ # * scrollkeeper (old Gnome help system) management [[ ${EAPI:-0} == [012345] ]] && inherit multilib -[[ ${EAPI:-0} == [0123456] ]] && inherit eutils -inherit xdg-utils +# eutils.eclass: emktemp +# xdg-utils.eclass: xdg_environment_reset, xdg_icon_cache_update +inherit eutils xdg-utils case "${EAPI:-0}" in 0|1|2|3|4|5|6|7) ;; @@ -122,7 +123,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" @@ -136,15 +137,15 @@ gnome2_gconf_install() { # We are ready to install the GCONF Scheme now unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL - export GCONF_CONFIG_SOURCE="$("${updater}" --get-default-source | sed "s;:/;:${ROOT};")" + export GCONF_CONFIG_SOURCE="$("${updater}" --get-default-source | sed "s;:/;:${ROOT%/}/;")" einfo "Installing GNOME 2 GConf schemas" 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,7 +164,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" @@ -176,15 +177,15 @@ gnome2_gconf_uninstall() { fi unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL - export GCONF_CONFIG_SOURCE="$("${updater}" --get-default-source | sed "s;:/;:${ROOT};")" + export GCONF_CONFIG_SOURCE="$("${updater}" --get-default-source | sed "s;:/;:${ROOT%/}/;")" einfo "Uninstalling GNOME 2 GConf schemas" 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 @@ -266,7 +267,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" @@ -279,7 +280,7 @@ gnome2_scrollkeeper_update() { fi ebegin "Updating scrollkeeper database ..." - "${updater}" -q -p "${EROOT}${SCROLLKEEPER_DIR}" + "${updater}" -q -p "${EROOT%/}${SCROLLKEEPER_DIR}" eend $? } @@ -297,13 +298,12 @@ gnome2_schemas_savelist() { } # @FUNCTION: gnome2_schemas_update -# @USAGE: gnome2_schemas_update # @DESCRIPTION: # 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}" + local updater="${EROOT%/}${GLIB_COMPILE_SCHEMAS}" if [[ ! -x ${updater} ]]; then debug-print "${updater} is not executable" @@ -328,16 +328,15 @@ gnome2_gdk_pixbuf_savelist() { } # @FUNCTION: gnome2_gdk_pixbuf_update -# @USAGE: gnome2_gdk_pixbuf_update # @DESCRIPTION: # 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" + 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 @@ -354,13 +353,12 @@ 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 $? } # @FUNCTION: gnome2_query_immodules_gtk2 -# @USAGE: gnome2_query_immodules_gtk2 # @DESCRIPTION: # Updates gtk2 immodules/gdk-pixbuf loaders listing. gnome2_query_immodules_gtk2() { @@ -368,13 +366,12 @@ 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 $? } # @FUNCTION: gnome2_query_immodules_gtk3 -# @USAGE: gnome2_query_immodules_gtk3 # @DESCRIPTION: # Updates gtk3 immodules/gdk-pixbuf loaders listing. gnome2_query_immodules_gtk3() { @@ -382,22 +379,21 @@ 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 $? } # @FUNCTION: gnome2_giomodule_cache_update -# @USAGE: gnome2_giomodule_cache_update # @DESCRIPTION: # 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" + 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 |