commit:     224ac9a7692fc0cc66fe4fc2e63eed6596663c9f
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 21 13:44:29 2020 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Sat Nov 21 13:44:29 2020 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=224ac9a7

scripts/bootstrap-prefix: avoid unnecessary rebuilds in stage1

Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 scripts/bootstrap-prefix.sh | 32 +++++++++++++++++++++++---------
 1 file changed, 23 insertions(+), 9 deletions(-)

diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
index ca029edc21..e7f4ff194d 100755
--- a/scripts/bootstrap-prefix.sh
+++ b/scripts/bootstrap-prefix.sh
@@ -1383,28 +1383,42 @@ bootstrap_stage1() {
        # packages following (e.g. zlib builds 64-bits)
 
        # don't rely on $MAKE, if make == gmake packages that call 'make' fail
-       [[ $(make --version 2>&1) == *GNU" Make "4* ]] \
+       [[ -x ${ROOT}/tmp/usr/bin/make ]] \
+               || [[ $(make --version 2>&1) == *GNU" Make "4* ]] \
                || (bootstrap_make) || return 1
        [[ ${OFFLINE_MODE} ]] || [[ -x ${ROOT}/tmp/usr/bin/openssl ]] \
                || (bootstrap_libressl) # do not fail if this fails, we'll try 
without
        [[ ${OFFLINE_MODE} ]] || type -P wget > /dev/null \
                || (bootstrap_wget) || return 1
-       [[ $(sed --version 2>&1) == *GNU* ]] || (bootstrap_sed) || return 1
+       [[ -x ${ROOT}/tmp/usr/bin/sed ]] \
+               || [[ $(sed --version 2>&1) == *GNU* ]] \
+               || (bootstrap_sed) || return 1
        type -P xz > /dev/null || (bootstrap_xz) || return 1
        type -P bzip2 > /dev/null || (bootstrap_bzip2) || return 1
-       [[ $(patch --version 2>&1) == *"patch 2."[6-9]*GNU* ]] \
+       [[ -x ${ROOT}/tmp/usr/bin/patch ]] \
+               || [[ $(patch --version 2>&1) == *"patch 2."[6-9]*GNU* ]] \
                || (bootstrap_patch) || return 1
-       [[ $(m4 --version 2>&1) == *GNU*1.4.1?* ]] || (bootstrap_m4) || return 1
+       [[ -x ${ROOT}/tmp/usr/bin/m4 ]] \
+               || [[ $(m4 --version 2>&1) == *GNU*1.4.1?* ]] \
+               || (bootstrap_m4) || return 1
        [[ -x ${ROOT}/tmp/usr/bin/bison ]] \
                || [[ $(bison --version 2>&1) == *GNU" "Bison") "2.[3-7]* ]] \
                || [[ $(bison --version 2>&1) == *GNU" "Bison") "[3-9]* ]] \
                || (bootstrap_bison) || return 1
-       [[ $(uniq --version 2>&1) == *"(GNU coreutils) "[6789]* ]] \
+       [[ -x ${ROOT}/tmp/usr/bin/uniq ]] \
+               || [[ $(uniq --version 2>&1) == *"(GNU coreutils) "[6789]* ]] \
                || (bootstrap_coreutils) || return 1
-       [[ $(find --version 2>&1) == *GNU* ]] || (bootstrap_findutils) || 
return 1
-       [[ $(tar --version 2>&1) == *GNU* ]] || (bootstrap_tar) || return 1
-       [[ $(grep --version 2>&1) == *GNU* ]] || (bootstrap_grep) || return 1
-       [[ $(awk --version < /dev/null 2>&1) == *GNU" Awk "[456789]* ]] \
+       [[ -x ${ROOT}/tmp/usr/bin/find ]] \
+               || [[ $(find --version 2>&1) == *GNU* ]] \
+               || (bootstrap_findutils) || return 1
+       [[ -x ${ROOT}/tmp/usr/bin/tar ]] \
+               || [[ $(tar --version 2>&1) == *GNU* ]] \
+               || (bootstrap_tar) || return 1
+       [[ -x ${ROOT}/tmp/usr/bin/grep ]] \
+               || [[ $(grep --version 2>&1) == *GNU* ]] \
+               || (bootstrap_grep) || return 1
+       [[ -x ${ROOT}/tmp/usr/bin/gawk ]] \
+               || [[ $(awk --version < /dev/null 2>&1) == *GNU" Awk "[456789]* 
]] \
                || bootstrap_gawk || return 1
        # always build our own bash, for we don't know what devilish thing
        # we're working with now, bug #650284

Reply via email to