From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 99A13158041 for ; Sat, 30 Mar 2024 12:38:08 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id DDA5CE2A2E; Sat, 30 Mar 2024 12:38:07 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id C3A66E2A2E for ; Sat, 30 Mar 2024 12:38:07 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 10AE5342FA3 for ; Sat, 30 Mar 2024 12:38:07 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 7CFD51107 for ; Sat, 30 Mar 2024 12:38:05 +0000 (UTC) From: "Fabian Groffen" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Fabian Groffen" Message-ID: <1711802281.9473056957f34a82c177b7b42cd0c0617f43bdc5.grobian@gentoo> Subject: [gentoo-commits] repo/proj/prefix:master commit in: scripts/ X-VCS-Repository: repo/proj/prefix X-VCS-Files: scripts/bootstrap-prefix.sh X-VCS-Directories: scripts/ X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: 9473056957f34a82c177b7b42cd0c0617f43bdc5 X-VCS-Branch: master Date: Sat, 30 Mar 2024 12:38:05 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: b7b1bd9f-361d-4606-a6ec-fbb56e2f9d9c X-Archives-Hash: ec2e79373b6fef546434672aca9f478f commit: 9473056957f34a82c177b7b42cd0c0617f43bdc5 Author: Fabian Groffen gentoo org> AuthorDate: Sat Mar 30 12:38:01 2024 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Sat Mar 30 12:38:01 2024 +0000 URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=94730569 scripts/bootstrap-prefix: shellcheck Signed-off-by: Fabian Groffen gentoo.org> scripts/bootstrap-prefix.sh | 41 +++++++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh index 15e2c1098e..447f81274c 100755 --- a/scripts/bootstrap-prefix.sh +++ b/scripts/bootstrap-prefix.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -#shellcheck disable=SC2016,SC2030,SC2031,SC2038,SC2185,SC2120 +#shellcheck disable=SCSC1091,SC2016,SC2030,SC2031,SC2038,SC2185,SC2120 # Copyright 2006-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 @@ -1088,8 +1088,6 @@ bootstrap_python() { fix_config_sub - local myconf="" - case ${CHOST} in (x86_64-*-*|sparcv9-*-*) export CFLAGS="-m64" @@ -1103,7 +1101,9 @@ bootstrap_python() { *-linux*) # Bug 382263: make sure Python will know about the libdir in use for # the current arch - libdir="-L/usr/lib/$(gcc ${CFLAGS} -print-multi-os-directory)" + local -a flgarg + read -r -a flgarg <<< "${CFLAGS}" + libdir="-L/usr/lib/$(gcc "${flgarg[@]}" -print-multi-os-directory)" ;; x86_64-*-solaris*|sparcv9-*-solaris*) # Like above, make Python know where GCC's 64-bits @@ -1157,7 +1157,7 @@ bootstrap_python() { --disable-ipv6 \ --disable-shared \ --libdir="${ROOT}"/tmp/usr/lib \ - ${myconf} || return 1 + || return 1 emake || return 1 einfo "Installing ${A%.tar.*}" @@ -1178,7 +1178,7 @@ bootstrap_cmake_core() { einfo "Bootstrapping ${A%.tar.*}" - efetch https://github.com/Kitware/CMake/releases/download/v${PV}/${A} \ + efetch "https://github.com/Kitware/CMake/releases/download/v${PV}/${A}" \ || return 1 einfo "Unpacking ${A%.tar.*}" @@ -1186,7 +1186,7 @@ bootstrap_cmake_core() { rm -rf "${S}" mkdir -p "${S}" || return 1 cd "${S}" || return 1 - gzip -dc "${DISTDIR}"/${A} | tar -xf - + gzip -dc "${DISTDIR}/${A}" | tar -xf - [[ ${PIPESTATUS[*]} == '0 0' ]] || return 1 S="${S}"/cmake-${PV} cd "${S}" || return 1 @@ -1212,10 +1212,10 @@ bootstrap_cmake_core() { # later on, so kill it in the installed version ver=${A%-*} ; ver=${ver%.*} sed -i -e '/cmake_gnu_set_sysroot_flag/d' \ - "${ROOT}"/tmp/usr/share/${ver}/Modules/Platform/Apple-GNU-*.cmake || die + "${ROOT}/tmp/usr/share/${ver}/Modules/Platform"/Apple-GNU-*.cmake || die # disable isysroot usage with clang as well sed -i -e '/_SYSROOT_FLAG/d' \ - "${ROOT}"/tmp/usr/share/${ver}/Modules/Platform/Apple-Clang.cmake || die + "${ROOT}/tmp/usr/share/${ver}/Modules/Platform"/Apple-Clang.cmake || die einfo "${A%.tar.*} bootstrapped" } @@ -1231,7 +1231,7 @@ bootstrap_zlib_core() { einfo "Bootstrapping ${A%.tar.*}" - efetch ${DISTFILES_G_O}/distfiles/${A} || return 1 + efetch "${DISTFILES_G_O}/distfiles/${A}" || return 1 einfo "Unpacking ${A%.tar.*}" export S="${PORTAGE_TMPDIR}/zlib-${PV}" @@ -1242,7 +1242,7 @@ bootstrap_zlib_core() { *.tar.gz) decomp=gzip ;; *) decomp=bzip2 ;; esac - ${decomp} -dc "${DISTDIR}"/${A} | tar -xf - + ${decomp} -dc "${DISTDIR}/${A}" | tar -xf - [[ ${PIPESTATUS[*]} == '0 0' ]] || return 1 S="${S}"/zlib-${PV} cd "${S}" || return 1 @@ -1356,7 +1356,7 @@ bootstrap_make() { bootstrap_gnu make 4.2.1 || return 1 if [[ ${MAKE} == gmake ]] ; then # make make available as gmake - ( cd ${ROOT}/tmp/usr/bin && ln -s make gmake ) + ( cd "${ROOT}"/tmp/usr/bin && ln -s make gmake ) fi } @@ -1464,7 +1464,7 @@ bootstrap_stage1() { # See comments in do_tree(). local portroot=${PORTDIR%/*} - mkdir -p "${ROOT}"/tmp/${portroot#${ROOT}/} + mkdir -p "${ROOT}/tmp/${portroot#"${ROOT}"/}" for x in lib sbin bin; do mkdir -p "${ROOT}"/tmp/usr/${x} [[ -e ${ROOT}/tmp/${x} ]] || ( cd "${ROOT}"/tmp && ln -s usr/${x} ) @@ -1678,11 +1678,11 @@ bootstrap_stage1_log() { echo "CHOST: ${CHOST}" echo "IDENT: ${CHOST_IDENTIFY}" echo "===========================================" - } >> ${ROOT}/stage1.log + } >> "${ROOT}"/stage1.log bootstrap_stage1 "${@}" 2>&1 | tee -a "${ROOT}"/stage1.log local ret=${PIPESTATUS[0]} [[ ${ret} == 0 ]] && touch "${ROOT}"/.stage1-finished - return ${ret} + return "${ret}" } do_emerge_pkgs() { @@ -1770,6 +1770,15 @@ do_emerge_pkgs() { # defaults). echo "USE=${myuse[*]} PKG=${pkg}" ( + local -a eopts + read -r -a eopts <<< "${opts}" + eopts=( + "--color" "n" + "-v" + "--oneshot" + "--root-deps" + "${eopts[@]}" + ) estatus "${STAGE}: emerge ${pkg}" unset CFLAGS CXXFLAGS [[ -n ${OVERRIDE_CFLAGS} ]] \ @@ -1779,7 +1788,7 @@ do_emerge_pkgs() { PORTAGE_SYNC_STALE=0 \ FEATURES="-news ${FEATURES}" \ USE="${myuse[*]}" \ - emerge --color n -v --oneshot --root-deps ${opts} "${pkg}" + emerge "${eopts[@]}" "${pkg}" ) || return 1 done }