cloud-infra: Fix dependency extraction script 95/6995/1
authorFatih Degirmenci <fdegir@gmail.com>
Mon, 11 Jan 2021 16:26:04 +0000 (17:26 +0100)
committerFatih Degirmenci <fdegir@gmail.com>
Mon, 11 Jan 2021 16:26:04 +0000 (17:26 +0100)
This fix ensures grep doesn't match the wrong word ref when the word
ref is used in commit message and instead greps for "ref" as returned
by curl.

Change-Id: I4e283c524c114150ddb6d4149928348efabfc7d7

jjb/cloud-infra/scripts/generate-change-metadata.sh

index e2c6a0f0de8b5b74bc0705ecdc84f4126cc1835d..cdaef3500803ab65367684e681e290fc6d0498d3 100755 (executable)
@@ -43,7 +43,7 @@ function determine_dependency() {
   echo "Info  : Processing change $DEPENDENT_CHANGE_ID"
   declare -a DEPENDENT_CHANGE_METADATA
   readarray -t DEPENDENT_CHANGE_METADATA < <(curl -s "https://gerrit.nordix.org/changes/?q=$DEPENDENT_CHANGE_ID&o=CURRENT_REVISION" 2>&1 \
-      | grep "project\|status\|current_revision\|ref.*," | sed -e 's/\s//g' -e 's/,//g' -e 's/"//g'| cut -d: -f2)
+      | grep "project\|status\|current_revision\|ref\".*," | sed -e 's/\s//g' -e 's/,//g' -e 's/"//g'| cut -d: -f2)
 
   # NOTE (fdegir): check if the dependeny change exists
   # and ignore if it doesn't