commit:     3262576e57dc88108b7ce603a2e575c6fdf89e9b
Author:     William Hubbs <williamh <AT> gentoo <DOT> org>
AuthorDate: Mon Dec  7 01:41:03 2020 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Mon Dec  7 01:43:50 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3262576e

dev-lang/go: add way to have portage rebuild  software written in Go

This adds the @golang-rebuild set to portage to allow rebuilding all
known Go software in the tree.

This change only affects the live ebuild, but I will be adding it to
other versions.

Signed-off-by: William Hubbs <williamh <AT> gentoo.org>

 dev-lang/go/files/go-sets.conf | 7 +++++++
 dev-lang/go/go-9999.ebuild     | 6 ++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/dev-lang/go/files/go-sets.conf b/dev-lang/go/files/go-sets.conf
new file mode 100644
index 00000000000..01ad4a8b3d4
--- /dev/null
+++ b/dev-lang/go/files/go-sets.conf
@@ -0,0 +1,7 @@
+# Installed packages that inherit from known Go related eclasses.
+# This is useful after a dev-lang/go version change to rebuild all
+# software written in Go.
+[golang-rebuild]
+class = portage.sets.dbapi.VariableSet
+variable = INHERITED
+includes = golang-base golang-build golang-vcs golang-vcs-snapshot go-module

diff --git a/dev-lang/go/go-9999.ebuild b/dev-lang/go/go-9999.ebuild
index c81e94e1235..1157708bdb5 100644
--- a/dev-lang/go/go-9999.ebuild
+++ b/dev-lang/go/go-9999.ebuild
@@ -178,6 +178,10 @@ src_install()
        done
        einstalldocs
 
+       # install the @golang-rebuild set for Portage
+       insinto /usr/share/portage/config/sets
+       newins "${FILESDIR}"/go-sets.conf go.conf
+
        if [[ ${CHOST} == *-darwin* ]] ; then
                # fix install_name for test object (binutils_test) on Darwin, it
                # is never used in real circumstances
@@ -189,8 +193,6 @@ src_install()
 
 pkg_postinst() {
        [[ -z ${REPLACING_VERSIONS} ]] && return
-       has_version "<sys-apps/portage-3.0.9" && return
-
        einfo "After ${CATEGORY}/${PN} is updated it is recommended to rebuild"
        einfo "all packages compiled with previous versions of 
${CATEGORY}/${PN}"
        einfo "due to the static linking nature of go."

Reply via email to