--- ccache-2.4-r4.ebuild 2006-09-13 15:14:23.000000000 +0200 +++ ccache-2.4-r5.ebuild 2006-09-13 22:19:23.000000000 +0200 @@ -27,7 +27,7 @@ do_links() { insinto /usr/lib/ccache/bin for a in ${CHOST}-{gcc,g++,c++} gcc c++ g++; do - dosym /usr/bin/${a} /usr/lib/ccache/bin/${a} + dosym /usr/bin/ccache /usr/lib/ccache/bin/${a} done } @@ -53,24 +53,26 @@ dodir /root/.ccache keepdir /root/.ccache fi - if [[ ${ROOT} = "/" ]] ; then - einfo "Scanning for compiler front-ends..." - do_links - else - ewarn "Install is incomplete; you must run the following commands:" - ewarn " # ccache-config --install-links" - ewarn " # ccache-config --install-links ${CHOST}" - ewarn "after booting or chrooting to ${ROOT} to complete installation." - fi } pkg_preinst() { - # Portage doesn't handle replacing a non-empty dir with a file! - [[ -d "${ROOT}/usr/lib/ccache" ]] && rm -fr "${ROOT}/usr/lib/ccache" - [[ -d "${ROOT}/usr/lib/ccache.backup" ]] && rm -fr "${ROOT}/usr/lib/ccache.backup" + if [[ ${ROOT} = "/" ]] ; then + einfo "Scanning for compiler front-ends..." + do_links + else + ewarn "Install is incomplete; you must run the following commands:" + ewarn " # ccache-config --install-links" + ewarn " # ccache-config --install-links ${CHOST}" + ewarn "after booting or chrooting to ${ROOT} to complete installation." + fi } pkg_postinst() { + # nuke broken symlinks from previous versions that shouldn't exist + for i in cc ${CHOST}-cc ; do + [[ -L "${ROOT}/usr/lib/ccache/bin/${i}" ]] && rm -rf "${ROOT}/usr/lib/ccache/bin/${i}" + done + einfo "To use ccache with **non-Portage** C compiling, add" einfo "/usr/lib/ccache/bin to the beginning of your path, before /usr/bin." einfo "Portage 2.0.46-r11+ will automatically take advantage of ccache with"