clone: be less greedy with CLONE_REPOS filtering

Substrings of items in CLONE_REPOS may be accidentally included
with the current filtering expression. Fix that to matching only
on identical names.

Change-Id: Ibd510f3db35d35c83ddafc93baa6fdefd991e6ce
Signed-off-by: Tomás González <tomasagustin.gonzalezorlando@arm.com>
diff --git a/scripts/clone.sh b/scripts/clone.sh
index 98fb51f..25984e6 100755
--- a/scripts/clone.sh
+++ b/scripts/clone.sh
@@ -86,6 +86,7 @@
   ["tf-rmm"]="${GERRIT_HOST};${RMM_GERRIT_PROJECT};${RMM_REFSPEC}"
   ["tf-m-tests"]="${GERRIT_HOST};${TF_M_TESTS_GERRIT_PROJECT};${TF_M_TESTS_GERRIT_REFSPEC}"
   ["tf-m-extras"]="${GERRIT_HOST};${TF_M_EXTRAS_GERRIT_PROJECT};${TF_M_EXTRAS_GERRIT_REFSPEC}"
+  ["rusted-firmware-a"]="${GERRIT_HOST};${RF_GERRIT_PROJECT};${RF_GERRIT_REFSPEC}"
   ["arm-ffa"]="${GERRIT_HOST};${ARM_FFA_GERRIT_PROJECT};${ARM_FFA_GERRIT_REFSPEC}"
   ["arm-pl011-uart"]="${GERRIT_HOST};${ARM_PL011_UART_GERRIT_PROJECT};${ARM_PL011_UART_GERRIT_REFSPEC}"
   ["arm-psci"]="${GERRIT_HOST};${ARM_PSCI_GERRIT_PROJECT};${ARM_PSCI_GERRIT_REFSPEC}"
@@ -155,8 +156,8 @@
 
     # if a list of repos is provided via the CLONE_REPOS build param, only clone
     # those in the list - otherwise all are cloned by default
-    if [[ -n "${CLONE_REPOS}" && "${CLONE_REPOS}" != *"${REPO_NAME}"* ]]; then
-      continue
+    if [[ -n "${CLONE_REPOS}" ]] && ! grep -qw "${REPO_NAME}" <<< "${CLONE_REPOS}"; then
+        continue
     fi
 
     # clone and checkout in case it does not exist