sys-devel/binutils-config: always reregster all toolchains
authorSergei Trofimovich <slyfox@gentoo.org>
Fri, 22 May 2020 13:37:31 +0000 (14:37 +0100)
committerSergei Trofimovich <slyfox@gentoo.org>
Fri, 22 May 2020 13:37:48 +0000 (14:37 +0100)
New binutils-config version can affects list and positions
of symlinks installed. Always perform reregistration.

Package-Manager: Portage-2.3.99, Repoman-2.3.22
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
sys-devel/binutils-config/binutils-config-9999.ebuild

index fdc08708627109617c8b52e29b8746773ec7c488..d284d9330ece4649a15fe3baaa49c1770f86d524 100644 (file)
@@ -33,14 +33,11 @@ src_install() {
        use prefix && eprefixify "${ED}"/usr/bin/${PN}
 }
 
-pkg_preinst() {
-       # Force a refresh when upgrading from an older version that symlinked
-       # in all the libs & includes that binutils-libs handles. #528088
-       if has_version "<${CATEGORY}/${PN}-5" ; then
-               local bc current
-               bc="${ED}/usr/bin/binutils-config"
-               if current=$("${bc}" -c) ; then
-                       "${bc}" "${current}"
-               fi
-       fi
+pkg_postinst() {
+       # Re-register all targets. USE flags or new versions can change
+       # installed symlinks.
+       local x
+       for x in $(binutils-config -C -l 2>/dev/null | awk '$NF == "*" { print $2 }') ; do
+               binutils-config ${x}
+       done
 }