tfa-next: fix copyright check script for TF-A
Commit 1150fb80 ("tfa-next: adapt for Rusted Copyright") enhanced the
TF-A copyright check script so that it can also check the copyright
style we use in the RF-A project. However, in the process, it broke the
script for TF-A.
What happens is that when we run the script for the TF-A code base, we
only pass it one argument - the path to the directoty to scan. However,
the script still expects a second argument, which it captures in the
COPYRIGHT_FLAGS variable. In the case of TF-A, $COPYRIGHT_FLAGS ends up
being the empty string.
Later when we invoke the check-copyright.py helper script, we pass it
the copyright flags as a string. For TF-A, this means we end up invoking
the script like that:
$ check-copyright.py --tree "/path/to/tfa" "" --patch # ...
Note the "" extra argument passed in between --tree and --patch, which
gets rejected by check-copyright.py ("error: unrecognized arguments").
To fix this, stop quoting the copyright flags variable in the
check_copyright.py script invokation. The resulting behaviour is as
expected:
- (TF-A case) If COPYRIGHT_FLAGS is the empty string, $COPYRIGHT_FLAGS
"disappears" entirely.
- (RF-A case) If COPYRIGHT_FLAGS is --rusted, it gets correctly passed
to check_copyright.py.
Signed-off-by: Sandrine Afsa <sandrine.afsa@arm.com>
Change-Id: I4e016d353eb3a8878534840732725cbe9a0ee70f
diff --git a/script/static-checks/static-checks-check-copyright.sh b/script/static-checks/static-checks-check-copyright.sh
index f943bf1..9027811 100755
--- a/script/static-checks/static-checks-check-copyright.sh
+++ b/script/static-checks/static-checks-check-copyright.sh
@@ -20,7 +20,7 @@
LOG_FILE=`mktemp -t common.XXXX`
-"$CI_ROOT"/script/static-checks/check-copyright.py --tree "$DIRECTORY" "$COPYRIGHT_FLAGS" --patch --from-ref $(get_merge_base) &> "$LOG_FILE"
+"$CI_ROOT"/script/static-checks/check-copyright.py --tree "$DIRECTORY" $COPYRIGHT_FLAGS --patch --from-ref $(get_merge_base) &> "$LOG_FILE"
RES=$?
if [ -s "$LOG_FILE" ]; then