use single '=' for string equality in repo forall

The sub-script fails when a double '==' is used inside of a repo
forall -c option. The single '=' is preferred when used in 'test'
or '['.

The error is similar to this:
if [ $REPO_PATH == cgcs-root ]; then echo $REPO_PROJECT; fi: 1: [: cgcs-root: unexpected operator

Closes-Bug: 1883772
Change-Id: If17de30a03939240f0cc329179d452820a691e32
Signed-off-by: Saul Wold <sgw@linux.intel.com>
This commit is contained in:
Saul Wold 2020-06-16 11:34:51 -07:00
parent 5003bb100d
commit 4cb7539a9f
2 changed files with 5 additions and 5 deletions

View File

@ -53,7 +53,7 @@ git_repo_project() {
cd ${DIR}
GIT_RELATIVE_DIR=$(git_repo_rel_dir)
repo forall -c "if [ \$REPO_PATH == ${GIT_RELATIVE_DIR} ]; then echo \$REPO_PROJECT; fi"
repo forall -c "if [ \$REPO_PATH = ${GIT_RELATIVE_DIR} ]; then echo \$REPO_PROJECT; fi"
)
}
@ -69,7 +69,7 @@ git_repo_remote() {
cd ${DIR}
GIT_RELATIVE_DIR=$(git_repo_rel_dir)
repo forall -c "if [ \$REPO_PATH == ${GIT_RELATIVE_DIR} ]; then echo \$REPO_REMOTE; fi"
repo forall -c "if [ \$REPO_PATH = ${GIT_RELATIVE_DIR} ]; then echo \$REPO_REMOTE; fi"
)
}
@ -86,7 +86,7 @@ git_repo_remote_branch() {
cd ${DIR}
GIT_RELATIVE_DIR=$(git_repo_rel_dir)
REF=$(repo forall -c "if [ \$REPO_PATH == ${GIT_RELATIVE_DIR} ]; then echo \$REPO_RREV; fi")
REF=$(repo forall -c "if [ \$REPO_PATH = ${GIT_RELATIVE_DIR} ]; then echo \$REPO_RREV; fi")
if git_is_branch ${REF} ; then
echo ${REF}
else
@ -107,7 +107,7 @@ git_repo_remote_ref() {
cd ${DIR}
GIT_RELATIVE_DIR=$(git_repo_rel_dir)
repo forall -c "if [ \$REPO_PATH == ${GIT_RELATIVE_DIR} ]; then echo \$REPO_RREV; fi"
repo forall -c "if [ \$REPO_PATH = ${GIT_RELATIVE_DIR} ]; then echo \$REPO_RREV; fi"
)
}

View File

@ -122,7 +122,7 @@ repo_project_list () {
else
for remote in ${remote_list[@]}; do
repo forall -c \
'if [ "$REPO_REMOTE" == "'${remote}'" ]; then echo $REPO_PROJECT; fi' \
'if [ "$REPO_REMOTE" = "'${remote}'" ]; then echo $REPO_PROJECT; fi' \
| sort --unique
done
fi