Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 145167
Collapse All | Expand All

(-)ccache-2.4-r4.ebuild (-13 / +15 lines)
Lines 27-33 Link Here
27
do_links() {
27
do_links() {
28
	insinto /usr/lib/ccache/bin
28
	insinto /usr/lib/ccache/bin
29
	for a in ${CHOST}-{gcc,g++,c++} gcc c++ g++; do
29
	for a in ${CHOST}-{gcc,g++,c++} gcc c++ g++; do
30
	  dosym /usr/bin/${a} /usr/lib/ccache/bin/${a}
30
	    dosym /usr/bin/ccache /usr/lib/ccache/bin/${a}
31
	done
31
	done
32
}
32
}
33
33
Lines 53-76 Link Here
53
		dodir /root/.ccache
53
		dodir /root/.ccache
54
		keepdir /root/.ccache
54
		keepdir /root/.ccache
55
	fi
55
	fi
56
	if [[ ${ROOT} = "/" ]] ; then
57
	  einfo "Scanning for compiler front-ends..."
58
	  do_links
59
	else
60
	  ewarn "Install is incomplete; you must run the following commands:"
61
	  ewarn " # ccache-config --install-links"
62
	  ewarn " # ccache-config --install-links ${CHOST}"
63
	 ewarn "after booting or chrooting to ${ROOT} to complete installation."
64
	fi
65
}
56
}
66
57
67
pkg_preinst() {
58
pkg_preinst() {
68
	# Portage doesn't handle replacing a non-empty dir with a file!
59
	if [[ ${ROOT} = "/" ]] ; then
69
	[[ -d "${ROOT}/usr/lib/ccache" ]] && rm -fr "${ROOT}/usr/lib/ccache"
60
	    einfo "Scanning for compiler front-ends..."
70
	[[ -d "${ROOT}/usr/lib/ccache.backup" ]] && rm -fr "${ROOT}/usr/lib/ccache.backup"
61
	    do_links
62
	else
63
	    ewarn "Install is incomplete; you must run the following commands:"
64
	    ewarn " # ccache-config --install-links"
65
	    ewarn " # ccache-config --install-links ${CHOST}"
66
	    ewarn "after booting or chrooting to ${ROOT} to complete installation."
67
	fi
71
}
68
}
72
69
73
pkg_postinst() {
70
pkg_postinst() {
71
	# nuke broken symlinks from previous versions that shouldn't exist
72
	for i in cc ${CHOST}-cc ; do
73
	    [[ -L "${ROOT}/usr/lib/ccache/bin/${i}" ]] && rm -rf "${ROOT}/usr/lib/ccache/bin/${i}"
74
	done
75
74
	einfo "To use ccache with **non-Portage** C compiling, add"
76
	einfo "To use ccache with **non-Portage** C compiling, add"
75
	einfo "/usr/lib/ccache/bin to the beginning of your path, before /usr/bin."
77
	einfo "/usr/lib/ccache/bin to the beginning of your path, before /usr/bin."
76
	einfo "Portage 2.0.46-r11+ will automatically take advantage of ccache with"
78
	einfo "Portage 2.0.46-r11+ will automatically take advantage of ccache with"

Return to bug 145167