Skip to content

Commit

Permalink
get-template-library: code modernization
Browse files Browse the repository at this point in the history
- Replace -a by &&
  • Loading branch information
jouvin committed Nov 9, 2024
1 parent 65ead6f commit 309a2bd
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/scripts/get-template-library
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ do
# In fact branch_pattern can be a regexp matched against existing branch names
if [ ${use_tags} -eq 1 ]
then
if [ -n "${quattor_version}" -a ${ignore_version} -eq 0 ]
if [ -n "${quattor_version}" ] && [ ${ignore_version} -eq 0 ]
then
if [ ${tags_ignore_pattern} -eq 1 ]
then
Expand Down Expand Up @@ -422,7 +422,7 @@ do
if [ ${use_tags} -eq 0 ]
then
pr_actual_target=${branch_or_tag}
if [ "${branch_or_tag}" = "master" -a $?{master_dir_name} ]
if [ "${branch_or_tag}" = "master" ] && [ $?{master_dir_name} ]
then
branch_dir=${master_dir_name}
else
Expand All @@ -434,7 +434,7 @@ do
pr_actual_target=${tag_dir}
# master is normally not a tag name but master branch can be added to
# other tags when the version is HEAD (for example for template-library-core)
if [ "${tag_dir}" = "master" -a $?{master_dir_name} ]
if [ "${tag_dir}" = "master" ] && [ $?{master_dir_name} ]
then
tag_dir=${master_dir_name}
fi
Expand All @@ -446,7 +446,7 @@ do
# If branch_dir is not tag_dir or master, indicates a repository without a master
# branch (e.g. template-library-grid). In this case, pr_actual_target must be
# redefined as branch_dir-tag_dir, as the tag name is prefixed by the branch name (branch_dir).
if [ "${branch_dir}" != "master" -a "${branch_dir}" != "${tag_dir}" ]
if [ "${branch_dir}" != "master" ] && [ "${branch_dir}" != "${tag_dir}" ]
then
pr_actual_target="${branch_dir}-${tag_dir}"
fi
Expand All @@ -459,7 +459,7 @@ do
for ignore_pattern in ${ignore_branch_patterns}
do
[ ${verbose} -eq 1 ] && echo "Branch=${remote_branch}, ignore_pattern = >>${ignore_pattern}<<"
if [ -n "$(echo ${branch_dir} | egrep -- ${ignore_pattern})" -a "${branch_dir}" != "${quattor_version}" ]
if [ -n "$(echo ${branch_dir} | egrep -- ${ignore_pattern})" ] && [ "${branch_dir}" != "${quattor_version}" ]
then
[ ${verbose} -eq 1 ] && echo "Branch ${remote_branch} ignored"
ignore_branch=1
Expand All @@ -470,7 +470,7 @@ do
for ignore_pattern in ${ignore_version_patterns}
do
[ ${verbose} -eq 1 ] && echo "Branch=${remote_branch}, version=${tag_dir}, ignore_version_pattern = >>${ignore_pattern}<<"
if [ -n "$(echo ${tag_dir} | egrep -- ${ignore_pattern})" -a "${tag_dir}" != "${quattor_version}" ]
if [ -n "$(echo ${tag_dir} | egrep -- ${ignore_pattern})" ] && [ "${tag_dir}" != "${quattor_version}" ]
then
[ ${verbose} -eq 1 ] && echo "Branch ${remote_branch} (version ${tag_dir}) ignored"
ignore_branch=1
Expand All @@ -486,7 +486,7 @@ do
# If --continuous-inegration and the current repo/target matches the CI context, just define src_dir
# to be what has been checked out as part of the CI.
[ ${verbose} -eq 1 ] && echo "use_ci_work_dir=${use_ci_work_dir}, repo_name=${repo_name}, pr_repo=${pr_repo}, pr_target=${pr_target}, pr_actual_target=${pr_actual_target}"
if [ ${use_ci_work_dir} -eq 1 -a "${pr_repo}" = "${repo_name}" -a "${pr_target}" = "${pr_actual_target}" ]
if [ ${use_ci_work_dir} -eq 1 ] && [ "${pr_repo}" = "${repo_name}" ] && [ "${pr_target}" = "${pr_actual_target}" ]
then
src_dir=${ci_work_dir}

Expand All @@ -500,7 +500,7 @@ do
if [ -n "${pull_request}" ]
then
[ ${verbose} -eq 1 ] && echo "Checking if pull request applies to current branch/tag (pr_repo=${pr_repo}, pr_target=${pr_target}, pr_actual_target=${pr_actual_target})..."
if [ "${pr_repo}" = "${repo_name}" -a "${pr_target}" = "${pr_actual_target}" ]
if [ "${pr_repo}" = "${repo_name}" ] && [ "${pr_target}" = "${pr_actual_target}" ]
then
echo "Merging pull request from ${pr_user}/${pr_branch} into branch/tag ${branch_or_tag}..."
pr_remote=${git_url_root}/${pr_user}/${pr_repo}
Expand Down Expand Up @@ -567,7 +567,7 @@ do
fi

# Except if --debug has been specified, remove Git clone created
if [ ${verbose} -eq 0 -a -d ${repo_dir} ]
if [ ${verbose} -eq 0 ] && [ -d ${repo_dir} ]
then
rm -Rf ${repo_dir}
fi
Expand All @@ -577,7 +577,7 @@ done # repository loop
# cluster.build.properties: update version used to the requested Quattor version.
# Ine the case of HEAD, use the directory the master branch has been checkout to/

if [ ${list_branches} -eq 0 -a ${cluster_build_properties_update} -eq 1 ]
if [ ${list_branches} -eq 0 ] && [ ${cluster_build_properties_update} -eq 1 ]
then
property_files=$(find ${template_lib_root}/clusters -name cluster.build.properties)
if [ -n "${property_files}" ]
Expand Down

0 comments on commit 309a2bd

Please sign in to comment.