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:
parent
5003bb100d
commit
4cb7539a9f
@ -53,7 +53,7 @@ git_repo_project() {
|
|||||||
cd ${DIR}
|
cd ${DIR}
|
||||||
|
|
||||||
GIT_RELATIVE_DIR=$(git_repo_rel_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}
|
cd ${DIR}
|
||||||
|
|
||||||
GIT_RELATIVE_DIR=$(git_repo_rel_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}
|
cd ${DIR}
|
||||||
|
|
||||||
GIT_RELATIVE_DIR=$(git_repo_rel_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
|
if git_is_branch ${REF} ; then
|
||||||
echo ${REF}
|
echo ${REF}
|
||||||
else
|
else
|
||||||
@ -107,7 +107,7 @@ git_repo_remote_ref() {
|
|||||||
cd ${DIR}
|
cd ${DIR}
|
||||||
|
|
||||||
GIT_RELATIVE_DIR=$(git_repo_rel_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"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,7 +122,7 @@ repo_project_list () {
|
|||||||
else
|
else
|
||||||
for remote in ${remote_list[@]}; do
|
for remote in ${remote_list[@]}; do
|
||||||
repo forall -c \
|
repo forall -c \
|
||||||
'if [ "$REPO_REMOTE" == "'${remote}'" ]; then echo $REPO_PROJECT; fi' \
|
'if [ "$REPO_REMOTE" = "'${remote}'" ]; then echo $REPO_PROJECT; fi' \
|
||||||
| sort --unique
|
| sort --unique
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user