Index: app-emacs/emacs-common-gentoo/emacs-common-gentoo-1.5.ebuild =================================================================== RCS file: /var/cvsroot/gentoo-x86/app-emacs/emacs-common-gentoo/emacs-common-gentoo-1.5.ebuild,v retrieving revision 1.11 diff -u -r1.11 emacs-common-gentoo-1.5.ebuild --- app-emacs/emacs-common-gentoo/emacs-common-gentoo-1.5.ebuild 5 Jun 2015 12:07:06 -0000 1.11 +++ app-emacs/emacs-common-gentoo/emacs-common-gentoo-1.5.ebuild 11 Jul 2015 14:17:41 -0000 @@ -70,13 +70,17 @@ } pkg_preinst() { - # make sure that site-gentoo.el exists since site-start.el requires it - if [[ ! -d ${EROOT}${SITELISP} ]]; then - mv "${ED}${SITELISP}"/site-gentoo.el{.orig,} || die - else - elisp-site-regen - rm "${ED}${SITELISP}/site-gentoo.el.orig" || die - cp "${EROOT}${SITELISP}/site-gentoo.el" "${ED}${SITELISP}/" || die + # To support portage-multilib (multilib-overlay), only do this once + # because pkg_preinst() will be called multiple times. + if [[ ! -f ${ED}${SITELISP}/site-gentoo.el ]]; then + # make sure that site-gentoo.el exists since site-start.el requires it. + if [[ ! -d ${EROOT}${SITELISP} ]]; then + mv "${ED}${SITELISP}"/site-gentoo.el{.orig,} || die + else + elisp-site-regen + rm "${ED}${SITELISP}/site-gentoo.el.orig" || die + cp "${EROOT}${SITELISP}/site-gentoo.el" "${ED}${SITELISP}/" || die + fi fi if use games; then