Use ${EROOT%/} whereever possible, as most of the directories and files
used in conjunction with it have a leading /; add missing leading /
where apropriate. Put sys-apps/sed into BDEPEND if EAPI 7, as it need to
be executable on CBUILD.Signed-off-by: Marty E. Plummer <[email protected]> Package-Manager: Portage-2.3.40, Repoman-2.3.9 --- eclass/gnome2-utils.eclass | 43 +++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/eclass/gnome2-utils.eclass b/eclass/gnome2-utils.eclass index 65076ae2d61..4204dac2956 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,8 +82,9 @@ esac # @DESCRIPTION: # List of gdk-pixbuf loaders provided by the package -DEPEND=">=sys-apps/sed-4" - +# sed needs to be executable on the build system +BDEPEND=">=sys-apps/sed-4" +[[ ${EAPI:-0} == [0123456] ]] && DEPEND="${BDEPEND}" # @FUNCTION: gnome2_environment_reset # @DESCRIPTION: @@ -101,7 +102,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 +130,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 +150,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 +171,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 +190,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 +225,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 +340,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 +353,7 @@ gnome2_scrollkeeper_update() { fi ebegin "Updating scrollkeeper database ..." - "${updater}" -q -p "${EROOT}${SCROLLKEEPER_DIR}" + "${updater}" -q -p "${EROOT%/}${SCROLLKEEPER_DIR}" eend $? } @@ -376,7 +377,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 +408,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 +428,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 +442,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 +456,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 +468,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
