[edk2-devel] [edk2-sct PATCH 2/3] edk2-test: use bash 'shift' in build.sh to manage arguments
Grant Likely
grant.likely at arm.com
Thu Feb 11 17:46:04 UTC 2021
The script was using a big list of numerical argument to pass on extra
parameters. Use the bash 'shift' command to carve of arguments for the
script so that $@ can be used for the remainder.
Signed-off-by: Grant Likely <grant.likely at arm.com>
---
uefi-sct/SctPkg/build.sh | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/uefi-sct/SctPkg/build.sh b/uefi-sct/SctPkg/build.sh
index 22cf9667..3b1414ca 100755
--- a/uefi-sct/SctPkg/build.sh
+++ b/uefi-sct/SctPkg/build.sh
@@ -189,13 +189,16 @@ case `uname` in
;;
esac
+# Drop parsed command line arguments
+shift 2
+
echo "TOOLCHAIN is ${TARGET_TOOLS}"
export ${TARGET_TOOLS}_${SCT_TARGET_ARCH}_PREFIX=$CROSS_COMPILE
echo "Toolchain prefix: ${TARGET_TOOLS}_${SCT_TARGET_ARCH}_PREFIX=$CROSS_COMPILE"
SCT_BUILD=DEBUG
-if [ "$3" = "RELEASE" -o "$3" = "DEBUG" ]; then
- SCT_BUILD=$3
+if [ "$1" = "RELEASE" -o "$1" = "DEBUG" ]; then
+ SCT_BUILD=$1
shift
fi
@@ -254,7 +257,7 @@ cp $EDK_TOOLS_PATH/Source/C/bin/GenBin $DEST_DIR/GenBin
#
for DSC in SctPkg/UEFI/UEFI_SCT.dsc SctPkg/UEFI/IHV_SCT.dsc $DSC_EXTRA
do
- build -p $DSC -a $SCT_TARGET_ARCH -t $TARGET_TOOLS -b $SCT_BUILD $3 $4 $5 $6 $7 $8 $9
+ build -p $DSC -a $SCT_TARGET_ARCH -t $TARGET_TOOLS -b $SCT_BUILD $@
# Check if there is any error
status=$?
if test $status -ne 0
--
2.20.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71613): https://edk2.groups.io/g/devel/message/71613
Mute This Topic: https://groups.io/mt/80563675/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-
More information about the edk2-devel-archive
mailing list