From e59868c6b6b69262adad27686f8fbf410edba6d0 Mon Sep 17 00:00:00 2001 From: Martin Roth Date: Sun, 20 Aug 2023 20:21:17 -0600 Subject: [PATCH] util/crossgcc: Add --fetch option to download tarballs The -f|--fetch option is being added to download and verify the tarballs without doing a build. This will be used specifically to archive the toolchain tarballs for the release. Signed-off-by: Martin Roth Change-Id: Ia68dbdcbf2d0fa4bb433511dc5e2f980f6762204 Reviewed-on: https://review.coreboot.org/c/coreboot/+/77333 Tested-by: build bot (Jenkins) Reviewed-by: Felix Singer --- util/crossgcc/buildgcc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc index 575073c603..1abb4a901a 100755 --- a/util/crossgcc/buildgcc +++ b/util/crossgcc/buildgcc @@ -30,6 +30,7 @@ DESTDIR= SAVETEMPS=0 BOOTSTRAP=0 THREADS=1 +FETCH_ONLY=0 USE_COREBOOT_MIRROR=0 COREBOOT_MIRROR_URL="https://www.coreboot.org/releases/crossgcc-sources" @@ -581,6 +582,7 @@ myhelp() printf " (defaults to $TARGETDIR)\n\n" printf " [-D|--destdir ] destination directory to install cross compiler to\n" printf " (for RPM builds, default unset)\n" + printf " [-f|--fetch] Download tarballs, but don't build anything\n" printf " [-P|--package ] Build a specific package: GCC, CLANG, IASL\n" printf " (defaults to $PACKAGE)\n" printf "GCC specific options:\n" @@ -928,7 +930,7 @@ getopt - > /dev/null 2>/dev/null || gcc -o getopt getopt.c getoptbrand="$(getopt -V 2>/dev/null | sed -e '1!d' -e 's,^\(......\).*,\1,')" if [ "${getoptbrand}" = "getopt" ]; then # Detected GNU getopt that supports long options. - args=$(getopt -l print-version,version,help,clean,directory:,bootstrap,bootstrap-only,platform:,languages:,package:,jobs:,destdir:,savetemps,scripting,ccache,supported:,urls,nocolor,mirror -o WVhcd:bBp:l:P:j:D:tSys:unm -- "$@") + args=$(getopt -l print-version,version,help,clean,directory:,bootstrap,bootstrap-only,platform:,languages:,package:,jobs:,destdir:,savetemps,scripting,ccache,supported:,urls,nocolor,mirror,fetch -o WVhcd:bBp:l:P:j:D:tSys:unmf -- "$@") getopt_ret=$? eval set -- "$args" else @@ -958,6 +960,7 @@ while true ; do -l|--languages) shift; LANGUAGES="$1"; shift;; -m|--mirror) shift; USE_COREBOOT_MIRROR=1;; -D|--destdir) shift; DESTDIR="$1"; shift;; + -f|--fetch) shift; FETCH_ONLY=1;; -j|--jobs) shift; THREADS="$1"; JOBS="-j $1"; shift;; -P|--package) shift; PACKAGE="$1"; shift;; -y|--ccache) shift; USECCACHE=1;; @@ -1224,6 +1227,10 @@ for P in $PACKAGES; do done printf "Downloaded tarballs ... ${green}ok${NC}\n" +if [ ${FETCH_ONLY} -eq 1 ]; then + exit 0 +fi + printf "Unpacking and patching ...\n" for P in $PACKAGES; do unpack_and_patch $P || exit 1