commit: 38401400615050684b8902f831abccee0bd551ed Author: Anna Vyalkova <cyber+gentoo <AT> sysrq <DOT> in> AuthorDate: Thu Jun 30 13:08:08 2022 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Thu Jun 30 16:10:55 2022 +0000 URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=38401400
bootstrap-prefix.sh: fix coreutils check It should be inverted. Also bootstrap coreutils only when needed. Signed-off-by: Anna Vyalkova <cyber+gentoo <AT> sysrq.in> Closes: https://github.com/gentoo/prefix/pull/11 Signed-off-by: Sam James <sam <AT> gentoo.org> scripts/bootstrap-prefix.sh | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh index fbf7af3b68..5670f37bc2 100755 --- a/scripts/bootstrap-prefix.sh +++ b/scripts/bootstrap-prefix.sh @@ -1542,20 +1542,19 @@ bootstrap_stage1() { || [[ $(bison --version 2>&1) == *GNU" "Bison") "2.[3-7]* ]] \ || [[ $(bison --version 2>&1) == *GNU" "Bison") "[3-9]* ]] \ || (bootstrap_bison) || return 1 - if [[ -x ${ROOT}/tmp/usr/bin/uniq ]]; then + if [[ ! -x ${ROOT}/tmp/usr/bin/uniq ]]; then # If the system has a uniq, let's use it to test whether # coreutils is new enough (and GNU). if [[ $(uniq --version 2>&1) == *"(GNU coreutils) "[6789]* ]]; then CP="cp" + else + (bootstrap_coreutils) || return 1 fi fi - # But for e.g. OpenBSD, it isn't going to be, so if our test failed, - # bootstrap coreutils. - if [[ -z ${CP} ]] ; then - CP="${ROOT}/tmp/bin/cp" - (bootstrap_coreutils) || return 1 - fi + # But for e.g. BSD, it isn't going to be, so if our test failed, + # use bootstrapped coreutils. + [[ -z ${CP} ]] && CP="${ROOT}/tmp/bin/cp" [[ -x ${ROOT}/tmp/usr/bin/find ]] \ || [[ $(find --version 2>&1) == *GNU* ]] \
