Index: pym/portage.py =================================================================== --- pym/portage.py (revision 2850) +++ pym/portage.py (working copy) @@ -2379,7 +2379,7 @@ sesandbox=actionmap[mydo]["args"][2], logfile=logfile) if phase_retval == os.EX_OK: if mydo == "install": - mycommand = " ".join([MISC_SH_BINARY, "install_qa_check"]) + mycommand = " ".join([MISC_SH_BINARY, "install_qa_check", "install_multilib_wrappers"]) return spawn(mycommand, mysettings, debug=debug, droppriv=actionmap[mydo]["args"][0], free=actionmap[mydo]["args"][1], Index: bin/misc-functions.sh =================================================================== --- bin/misc-functions.sh (revision 2850) +++ bin/misc-functions.sh (working copy) @@ -16,6 +16,28 @@ shift $# source /usr/lib/portage/bin/ebuild.sh +install_multilib_wrappers() { + MULTILIB_WRAPPER_MASK="${MULTILIB_WRAPPER_MASK:-*-config}" + save_IFS + IFS=":" + for mypath in ${PATH} ; do + restore_IFS + if [[ -d ${D}/${mypath} ]] ; then + dowrap=$(find ${D}${mypath} -type f -name "${MULTILIB_WRAPPER_MASK}" | sed -e "s:${D}/::" | \ + gawk ' + BEGIN { split("'"${MULTILIB_WRAPPER_IGNORE}"'", ignore); } + { for (idx in ignore) + if ($NF ~ "^"ignore[idx]"$") + next; + print; + }') + if [[ -n ${dowrap} ]] ; then + generate-multilib-wrapper ${D} ${dowrap} || die "generating multilib wrapper scripts failed" + fi + fi + done +} + install_qa_check() { prepall Index: bin/generate-multilib-wrapper =================================================================== --- bin/generate-multilib-wrapper (revision 0) +++ bin/generate-multilib-wrapper (revision 0) @@ -0,0 +1,43 @@ +#!/bin/bash +if [[ ${#} -lt 2 ]] ; then + echo "${0}: usage: ${0} [more files]" 1>&2 + exit 1 +fi + +myroot=${1} +shift +while [[ -n ${1} ]] ; do + script=$(basename ${1}) + if [[ -n ${MULTILIB_ABIS} ]] && \ + [[ ${MULTILIB_ABIS} != ${MULTILIB_ABIS/ /} ]] ; then + if ! [[ -e ${myroot}/${1}-${ABI} ]] ; then + mv -f "${myroot}/${1}" "${myroot}/${1}-${ABI}" || exit 2 + fi + + cat <<- EOF > "${myroot}/${1}" + #!/bin/bash + if [[ -n "\${ABI}" ]] ; then + abi="\${ABI}" + elif [[ -n "\${DEFAULT_ABI}" ]] ; then + abi="\${DEFAULT_ABI}" + EOF + + for x in ${MULTILIB_ABIS}; do + if [[ ${x} != ${DEFAULT_ABI} ]] ; then + myabis="${myabis:+${myabis} }${x}" + fi + done + + myabis="${DEFAULT_ABI} ${myabis}" + for myabi in ${myabis} ; do + cat <<- EOF >> "${myroot}/${1}" + elif [[ -f /${1}-${myabi} ]] ; then + abi="${myabi}" + EOF + done + + echo -e "fi\n\nexec "/${1}-\${abi}" \"\${@}\"" >> "${myroot}/${1}" + chmod $(stat -c '%a' "${myroot}/${1}-${ABI}") "${myroot}/${1}" || exit 3 + fi + shift +done