Add --restore option to clean up but not necessarily run components

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
Gilles Peskine 2021-08-06 11:51:59 +02:00 committed by Thomas Daubney
parent 6702ce9f73
commit 8eb3c95590

View file

@ -247,6 +247,9 @@ General options:
Prefix for a cross-compiler for arm-linux-gnueabi Prefix for a cross-compiler for arm-linux-gnueabi
(default: "${ARM_LINUX_GNUEABI_GCC_PREFIX}") (default: "${ARM_LINUX_GNUEABI_GCC_PREFIX}")
--armcc Run ARM Compiler builds (on by default). --armcc Run ARM Compiler builds (on by default).
--restore First clean up the build tree, restoring backed up
files. Do not run any components unless they are
explicitly specified.
--error-test Error test mode: run a failing function in addition --error-test Error test mode: run a failing function in addition
to any specified component. May be repeated. to any specified component. May be repeated.
--except Exclude the COMPONENTs listed on the command line, --except Exclude the COMPONENTs listed on the command line,
@ -382,6 +385,7 @@ pre_parse_command_line () {
COMMAND_LINE_COMPONENTS= COMMAND_LINE_COMPONENTS=
all_except=0 all_except=0
error_test=0 error_test=0
restore_first=0
no_armcc= no_armcc=
# Note that legacy options are ignored instead of being omitted from this # Note that legacy options are ignored instead of being omitted from this
@ -421,6 +425,7 @@ pre_parse_command_line () {
--quiet|-q) QUIET=1;; --quiet|-q) QUIET=1;;
--random-seed) unset SEED;; --random-seed) unset SEED;;
--release-test|-r) SEED=$RELEASE_SEED;; --release-test|-r) SEED=$RELEASE_SEED;;
--restore) restore_first=1;;
--seed|-s) shift; SEED="$1";; --seed|-s) shift; SEED="$1";;
-*) -*)
echo >&2 "Unknown option: $1" echo >&2 "Unknown option: $1"
@ -433,7 +438,7 @@ pre_parse_command_line () {
done done
# With no list of components, run everything. # With no list of components, run everything.
if [ -z "$COMMAND_LINE_COMPONENTS" ]; then if [ -z "$COMMAND_LINE_COMPONENTS" ] && [ $restore_first -eq 0 ]; then
all_except=1 all_except=1
fi fi