dev-util/ccache: Use dev-util/shadowman for postinst/prerm
authorMichał Górny <mgorny@gentoo.org>
Thu, 10 Aug 2017 19:38:37 +0000 (21:38 +0200)
committerMichał Górny <mgorny@gentoo.org>
Sat, 26 Aug 2017 13:36:53 +0000 (15:36 +0200)
dev-util/ccache/ccache-3.3.4-r1.ebuild

index 2fd005d880417daf6150d2107940752cb987966b..56fe73b6cea6b6fb975fe27d79119eb61840ef49 100644 (file)
@@ -11,12 +11,13 @@ SRC_URI="https://samba.org/ftp/ccache/${P}.tar.xz"
 
 LICENSE="GPL-3"
 SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~x64-solaris ~x86-solaris"
+KEYWORDS="~amd64 ~x86"
 IUSE=""
 
 DEPEND="app-arch/xz-utils
        sys-libs/zlib"
 RDEPEND="${DEPEND}
+       dev-util/shadowman
        sys-apps/gentoo-functions"
 
 src_prepare() {
@@ -52,18 +53,17 @@ ccache now supports sys-devel/clang and dev-lang/icc, too!"
 }
 
 pkg_prerm() {
-       if [[ -z ${REPLACED_BY_VERSION} ]] ; then
-               "${EROOT}"/usr/bin/ccache-config --remove-links
-               "${EROOT}"/usr/bin/ccache-config --remove-links ${CHOST}
+       if [[ -z ${REPLACED_BY_VERSION} && ${ROOT} == / ]] ; then
+               eselect compiler-shadow remove ccache
        fi
 }
 
 pkg_postinst() {
-       "${EROOT}"/usr/bin/ccache-config --install-links
-       "${EROOT}"/usr/bin/ccache-config --install-links ${CHOST}
+       if [[ ${ROOT} == / ]]; then
+               eselect compiler-shadow update ccache
+       fi
 
        # nuke broken symlinks from previous versions that shouldn't exist
-       rm -f "${EROOT}"/usr/lib/ccache/bin/${CHOST}-cc || die
        rm -rf "${EROOT}"/usr/lib/ccache.backup || die
 
        readme.gentoo_print_elog