commit:     29f4de200d9916a117ec1658c87fad73f3a513e2
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Tue Jun  8 09:12:19 2021 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Tue Jun  8 09:12:19 2021 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=29f4de20

scripts/bootstrap-prefix: fix g++ wrapper

In 2dfc27192fbe00e4661ca06a0b18f09a4137dd50 the executable name was
fixed, so it wasn't dependant on PATH, however, it broke g++ for that
would still call gcc.  Fix that now.

Mask GCC-11 during stage2 and stage3 for bug #788613.

Bug: https://bugs.gentoo.org/788613
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 scripts/bootstrap-prefix.sh | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
index 97ffa2233d..8fab4abf44 100755
--- a/scripts/bootstrap-prefix.sh
+++ b/scripts/bootstrap-prefix.sh
@@ -450,6 +450,12 @@ bootstrap_setup() {
        ACCEPT_KEYWORDS="~${ARCH}-linux"
        EOF
 
+       # bug #788613 avoid gcc-11 during stage 2/3 prior sync/emerge -e
+       is-rap && cat >> "${ROOT}"/etc/portage/make.profile/package.mask <<-EOF
+       # during bootstrap mask, bug #788613
+       >=sys-devel/gcc-11
+       EOF
+
        # Use package.use to disable in the portage tree to be shared between
        # stage2 and stage3. The hack will be undone during tree sync in stage3.
        cat >> "${ROOT}"/etc/portage/make.profile/package.use <<-EOF
@@ -1355,8 +1361,8 @@ bootstrap_libressl() {
 
 bootstrap_stage_host_gentoo() {
        if ! is-rap ; then
-               einfo "Shortcut only supports prefix-standalone, but we are 
bootstrapping"
-               einfo "prefix-rpath. Do nothing."
+               einfo "Shortcut only supports prefix-standalone, but we "
+               einfo "are bootstrapping prefix-rpath.  Do nothing."
                return 0
        fi
        
@@ -1479,7 +1485,11 @@ bootstrap_stage1() {
                                        PATH="${ORIGINAL_PATH}" export PATH
                                        exec "$(type -P gcc)" "\$@"
                                EOF
-                               cp "${ROOT}"/tmp/usr/local/bin/g{cc,++}
+                               cat >> "${ROOT}"/tmp/usr/local/bin/g++ <<-EOF
+                                       #! /bin/sh
+                                       PATH="${ORIGINAL_PATH}" export PATH
+                                       exec "$(type -P g++)" "\$@"
+                               EOF
                                chmod 755 "${ROOT}"/tmp/usr/local/bin/g{cc,++}
                        fi
                        ;;
@@ -1906,7 +1916,11 @@ bootstrap_stage3() {
        }
 
        # pre_emerge_pkgs relies on stage 2 portage.
-       pre_emerge_pkgs() { is-rap && without_stack_emerge_pkgs "$@" || 
with_stack_emerge_pkgs "$@"; }
+       pre_emerge_pkgs() {
+               is-rap \
+                       && without_stack_emerge_pkgs "$@" \
+                       || with_stack_emerge_pkgs "$@"
+       }
 
        # Some packages fail to properly depend on sys-apps/texinfo.
        # We don't really need that package, so we fake it instead,

Reply via email to