mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
buildgcc: Fix option arguments
As we support `getopt` versions that don't know long options, every option arguments needs a short option. Also add the long options `--urls` and `--nocolor` to the `getopt` string. Change-Id: I11c393c3d90c7a16cdda119594221c85f902ed40 Signed-off-by: Nico Huber <nico.huber@secunet.com> Reviewed-on: https://review.coreboot.org/16682 Reviewed-by: Patrick Georgi <pgeorgi@google.com> Tested-by: build bot (Jenkins)
This commit is contained in:
parent
b6a6bb5393
commit
152e78e794
1 changed files with 6 additions and 6 deletions
|
@ -385,8 +385,8 @@ myhelp()
|
||||||
printf " [-c|--clean] remove temporary files before build\n"
|
printf " [-c|--clean] remove temporary files before build\n"
|
||||||
printf " [-t|--savetemps] don't remove temporary files after build\n"
|
printf " [-t|--savetemps] don't remove temporary files after build\n"
|
||||||
printf " [-y|--ccache] Use ccache when building cross compiler\n"
|
printf " [-y|--ccache] Use ccache when building cross compiler\n"
|
||||||
printf " [--nocolor] don't print color codes in output\n"
|
printf " [-n|--nocolor] don't print color codes in output\n"
|
||||||
printf " [--urls] print the urls for all packages\n"
|
printf " [-u|--urls] print the urls for all packages\n"
|
||||||
printf " [-j|--jobs <num>] run <num> jobs in parallel in make\n"
|
printf " [-j|--jobs <num>] run <num> jobs in parallel in make\n"
|
||||||
printf " [-s]--supported <tool> print supported version of a tool\n"
|
printf " [-s]--supported <tool> print supported version of a tool\n"
|
||||||
printf " [-d|--directory <target dir>] target directory to install cross compiler to\n"
|
printf " [-d|--directory <target dir>] target directory to install cross compiler to\n"
|
||||||
|
@ -690,11 +690,11 @@ getopt - > /dev/null 2>/dev/null || gcc -o getopt getopt.c
|
||||||
getoptbrand="$(getopt -V | sed -e '1!d' -e 's,^\(......\).*,\1,')"
|
getoptbrand="$(getopt -V | sed -e '1!d' -e 's,^\(......\).*,\1,')"
|
||||||
if [ "${getoptbrand}" = "getopt" ]; then
|
if [ "${getoptbrand}" = "getopt" ]; then
|
||||||
# Detected GNU getopt that supports long options.
|
# Detected GNU getopt that supports long options.
|
||||||
args=$(getopt -l version,help,clean,directory:,bootstrap,platform:,languages:,package:,jobs:,destdir:,savetemps,scripting,ccache,supported: Vhcd:bp:l:P:j:D:tSys: -- "$@")
|
args=$(getopt -l version,help,clean,directory:,bootstrap,platform:,languages:,package:,jobs:,destdir:,savetemps,scripting,ccache,supported:,urls,nocolor Vhcd:bp:l:P:j:D:tSys:un -- "$@")
|
||||||
eval set "$args"
|
eval set "$args"
|
||||||
else
|
else
|
||||||
# Detected non-GNU getopt
|
# Detected non-GNU getopt
|
||||||
args=$(getopt Vhcd:bp:l:P:j:D:tSys: $*)
|
args=$(getopt Vhcd:bp:l:P:j:D:tSys:un $*)
|
||||||
set -- $args
|
set -- $args
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -719,8 +719,8 @@ while true ; do
|
||||||
-S|--scripting) shift; SKIPPYTHON=0;;
|
-S|--scripting) shift; SKIPPYTHON=0;;
|
||||||
-y|--ccache) shift; USECCACHE=1;;
|
-y|--ccache) shift; USECCACHE=1;;
|
||||||
-s|--supported) shift; PRINTSTABLE="$1"; shift;;
|
-s|--supported) shift; PRINTSTABLE="$1"; shift;;
|
||||||
--urls) shift; printf "%s\n" "$ALL_ARCHIVES"; exit 0;;
|
-u|--urls) shift; printf "%s\n" "$ALL_ARCHIVES"; exit 0;;
|
||||||
--nocolor) shift; \
|
-n|--nocolor) shift; \
|
||||||
unset red RED green GREEN blue BLUE cyan CYAN NC;;
|
unset red RED green GREEN blue BLUE cyan CYAN NC;;
|
||||||
--) shift; break;;
|
--) shift; break;;
|
||||||
-*) printf "Invalid option\n\n"; myhelp; exit 1;;
|
-*) printf "Invalid option\n\n"; myhelp; exit 1;;
|
||||||
|
|
Loading…
Add table
Reference in a new issue