$etc||="$ENV{SS}/etc"; $rc="$etc/portage/bashrc"; wf(">$rc",'') if(!-e $rc); addon($rc,'#',"ppatch auto",qq(_ppatch(){ local p i PPATCH PPATCHLIST="" PPATCHDIR="\${PPATCH_ROOT:-\${PORTAGE_CONFIGROOT:-\$ROOT}}/usr/ppatch" PPATCHRC=' ' [ -n "\$CATEGORY" -a -n "\$PN" -a "\$CATEGORY" != virtual ] && for PPATCH in \$CATEGORY/\$PN \$PN \$PROVIDE ; do\ PPATCH="\$PPATCHDIR/\$PPATCH/\$EBUILD_PHASE\${EBUILD_PHASE:+/}" [ -e "\$PPATCH" ] && i="`readlink -f \$PPATCH`" || i="\${PPATCH//\\/\\///}" p="" for p in \$PPATCHLIST; do [[ "\$p" == "\$i" ]] && break; done [[ "\$p" == "\$i" ]] && [[ -n "\$p" ]] && continue PPATCHLIST="\$PPATCHLIST \$i" p="\$PPATCH" while true; do for i in "\$p"/*bashrc ; do i="\${i//\\/\\///}" [[ -e "\$i" ]] && [[ -n "\${PPATCHRC##* \$i *}" ]] && PPATCHRC+="\$i " && . \$i done i="\$p" p="\${p%/*}" [[ "\$p" < "\$PPATCHDIR" || "\$p" == "\$i" ]] && break done if [ -n "\$EBUILD_PHASE" -a -e "\$PPATCH" ] && ! ( [[ \${EAPI:-1} -gt 1 ]] && [[ \$EBUILD_PHASE == compile ]] && [[ "`readlink -f "\$PPATCH"`" == "`readlink -f "\$PPATCH/../prepare"`" ]] ) ; then export PPATCH PPATCHDIR S `p-patch \$PPATCH || die "ppatch failed: \$PPATCH"` fi done } _ppatch),0);