if [ "$EBUILD_PHASE" = unpack ]; then /bin/rm -f "${BUILDDIR}/.autopatched" elif [ "$EBUILD_PHASE" = compile ]; then if [ ! -e "${BUILDDIR}/.autopatched" ]; then for patch in /etc/portage/package.patches/${CATEGORY}/${PN}/*.patch.[0-9]; do if [ -r "$patch" ]; then strip="${patch##*.}" einfo "Applying autopatch ${patch##*/}" /usr/bin/patch "-d${S}" "-p${strip}" -N -f <"${patch}" >/dev/null retcode=$? eend "${retcode}" if [ "${retcode}" -ne 0 ]; then die "Autopatch application failed (S=${S}, strip=${strip})" fi fi done if [ -e "/etc/portage/package.patches/${CATEGORY}/${PN}/bashrc" ]; then einfo "Running bashrc for ${CATEGORY}/${PN}" . "/etc/portage/package.patches/${CATEGORY}/${PN}/bashrc" fi >"${BUILDDIR}/.autopatched" fi fi