commit:     0718a38e9dec1aff622d0a6ccb777c3d22db3cbc
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 27 00:33:07 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Apr 27 00:33:07 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0718a38e

toolchain.eclass: record EGIT_VERSION correctly in gcc --version for live 
ebuilds

Without this, gcc --version ends up only showing the commit resulting from
applying our patches on top.

With this fixed, gcc --version shows both the upstream commit & the commit hash
after applying patches.

Signed-off-by: Sam James <sam <AT> gentoo.org>

 eclass/toolchain.eclass | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index fab34914ab3f..16ce534d3465 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -649,6 +649,11 @@ toolchain_src_unpack() {
        if tc_is_live ; then
                git-r3_src_unpack
 
+               # Needed for gcc --version to include the upstream commit used
+               # rather than only the commit after we apply our patches.
+               # It includes both with this.
+               echo "${EGIT_VERSION}" > "${S}"/gcc/REVISION || die
+
                if [[ -z ${PATCH_VER} ]] && ! use vanilla ; then
                        toolchain_fetch_git_patches
                fi

Reply via email to