--- /usr/portage/eclass/texlive-common.eclass 2013-06-26 10:01:15.000000000 -0600 +++ texlive-common.eclass 2013-09-21 12:38:25.976209928 -0600 @@ -27,16 +27,17 @@ # configuration texlive-common_handle_config_files() { + has "${EAPI:-0}" 0 1 2 && ! use prefix && ED="${D}" && EPREFIX= # Handle config files properly - [ -d "${D}${TEXMF_PATH}" ] || return - cd "${D}${TEXMF_PATH}" + [ -d "${ED}${TEXMF_PATH}" ] || return + cd "${ED}${TEXMF_PATH}" for f in $(find . -name '*.cnf' -type f -o -name '*.cfg' -type f | sed -e "s:\./::g") ; do if [ "${f#*config}" != "${f}" -o "${f#doc}" != "${f}" ] ; then continue fi dodir /etc/texmf/$(dirname ${f}).d - einfo "Moving (and symlinking) ${TEXMF_PATH}/${f} to /etc/texmf/$(dirname ${f}).d" - mv "${D}/${TEXMF_PATH}/${f}" "${D}/etc/texmf/$(dirname ${f}).d" || die "mv ${f} failed." + einfo "Moving (and symlinking) ${EPREFIX}${TEXMF_PATH}/${f} to ${EPREFIX}/etc/texmf/$(dirname ${f}).d" + mv "${ED}/${TEXMF_PATH}/${f}" "${ED}/etc/texmf/$(dirname ${f}).d" || die "mv ${f} failed." dosym /etc/texmf/$(dirname ${f}).d/$(basename ${f}) ${TEXMF_PATH}/${f} done } @@ -66,6 +67,7 @@ # also do the fmtutil file parsing. texlive-common_do_symlinks() { + has "${EAPI:-0}" 0 1 2 && ! use prefix && ED="${D}" while [ $# != 0 ]; do case $1 in cont-??|metafun|mptopdf) @@ -78,7 +80,7 @@ if [ $1 = $2 ]; then einfo "Symlink $1 -> $2 skipped" - elif [ -e "${D}/usr/bin/$1" ]; + elif [ -e "${ED}/usr/bin/$1" ]; then einfo "Symlink $1 skipped (file exists)" else @@ -116,10 +118,11 @@ # correctly set for the file that it will point to. dobin_texmf_scripts() { + has "${EAPI:-0}" 0 1 2 && ! use prefix && ED="${D}" while [ $# -gt 0 ] ; do local trg=$(basename ${1} | sed 's,\.[^/]*$,,' | tr '[:upper:]' '[:lower:]') einfo "Installing ${1} as ${trg} bin wrapper" - [ -x "${D}/usr/share/${1}" ] || die "Trying to install a non existing or non executable symlink to /usr/bin: ${1}" + [ -x "${ED}/usr/share/${1}" ] || die "Trying to install a non existing or non executable symlink to /usr/bin: ${1}" dosym ../share/${1} /usr/bin/${trg} || die "failed to install ${1} as $trg" shift done @@ -132,9 +135,10 @@ # function helps in factorizing some code. etexmf-update() { + has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX= if has_version 'app-text/texlive-core' ; then - if [ "$ROOT" = "/" ] && [ -x /usr/sbin/texmf-update ] ; then - /usr/sbin/texmf-update + if [ "$ROOT" = "/" ] && [ -x "${EPREFIX}"/usr/sbin/texmf-update ] ; then + "${EPREFIX}"/usr/sbin/texmf-update else ewarn "Cannot run texmf-update for some reason." ewarn "Your texmf tree might be inconsistent with your configuration" @@ -150,10 +154,11 @@ # function helps in factorizing some code. efmtutil-sys() { + has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX= if has_version 'app-text/texlive-core' ; then - if [ "$ROOT" = "/" ] && [ -x /usr/bin/fmtutil-sys ] ; then + if [ "$ROOT" = "/" ] && [ -x "${EPREFIX}"/usr/bin/fmtutil-sys ] ; then einfo "Rebuilding formats" - /usr/bin/fmtutil-sys --all &> /dev/null + "${EPREFIX}"/usr/bin/fmtutil-sys --all &> /dev/null else ewarn "Cannot run fmtutil-sys for some reason." ewarn "Your formats might be inconsistent with your installed ${PN} version"