Merge "Fix: bashisms - step 2"
authorRobert Varga <nite@hq.sk>
Sat, 20 Aug 2022 14:35:57 +0000 (14:35 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Sat, 20 Aug 2022 14:35:57 +0000 (14:35 +0000)
jenkins-init-scripts/system_type.sh
jjb/autorelease/autorelease-gerrit-branch-lock.sh
jjb/netvirt/quagga-build.sh
jjb/opendaylight-infra-stack.sh
jjb/opendaylight-infra-update-image-list.sh
jjb/packaging/helm-repo-init.sh

index c5b141afd47d859d9384915f0247f905c0bd2748..897e694db520f5f27287442f9d498dec017d024d 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 # SPDX-License-Identifier: EPL-1.0
 ##############################################################################
 # Copyright (c) 2016 The Linux Foundation and others.
@@ -22,7 +22,7 @@ for i in "java-builder,builder" \
          "robot,robot" \
          "mininet,mininet-ubuntu"
 do set -- $i
-    if [[ $HOST == *"$1"* ]]; then
+    if expr $HOST : ".*$1.*" ; then
         SYSTEM_TYPE="$2"
         break
     fi
index e3c6a8bfe17c9f4eb8f26ec94968173da861a9eb..1d196496f5f6fe6fec0a968e1a898f0da2d26002 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 # SPDX-License-Identifier: EPL-1.0
 ##############################################################################
 # Copyright (c) 2022 The Linux Foundation and others.
@@ -48,7 +48,7 @@ mode="${GERRIT_ACCESS_MODE}"
 set -x
 case $mode in
     branch-cut)
-        if [ "${GERRIT_BRANCH}" == "master" ] && [[ "${GERRIT_BRANCH_NEXT}" =~ stable ]]; then
+        if [ "${GERRIT_BRANCH}" = "master" ] && expr "${GERRIT_BRANCH_NEXT}" : "stable/.*"; then
             echo "INFO: Locking branch for new branch cutting: ${GERRIT_BRANCH_NEXT}"
             git config -f project.config "access.refs/for/refs/heads/${GERRIT_BRANCH_NEXT}.exclusiveGroupPermissions" "create"
             git config -f project.config "access.refs/for/refs/heads/${GERRIT_BRANCH_NEXT}.create" "block group Registered Users"
index 294601ebd8a159ae1f0f5b0f505b5bf9d40c6f7e..63199dc6cf28bd6f6e75967b85af2522664463a7 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 # SPDX-License-Identifier: EPL-1.0
 ##############################################################################
 # Copyright (c) 2018 The Linux Foundation and others.
@@ -15,7 +15,8 @@ set -e -x
 # The script builds 6wind/quagga source and binary packages from zrpcd
 # repository for testing router functionalities with Netvirt jobs, .
 
-pushd "$(pwd)/zrpcd"
+initdir=$(pwd)
+cd "$(pwd)/zrpcd"
 
 chmod a+x "$(pwd)/pkgsrc/dev_compile_script.sh"
 cd "$(pwd)/pkgsrc" && sudo "./dev_compile_script.sh" -p -d -b -v "$QUAGGA_VERSION"
@@ -38,7 +39,7 @@ case "$OS" in
     ;;
 esac
 
-popd
+cd $initdir
 
 # todo: remove below lines once the scripts in zrpcd repos build the src packages.
 # Ref: https://lists.opendaylight.org/pipermail/integration-dev/2018-July/012330.html
index e1e398ab05395f568510efa5272ed674a5979ed8..734a01b0fbc5617a24fb9ddb40dfb1640e9fe841 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash -l
+#!/bin/sh -l
 # SPDX-License-Identifier: EPL-1.0
 ##############################################################################
 # Copyright (c) 2017 The Linux Foundation and others.
@@ -60,7 +60,7 @@ for try in $(seq $STACK_RETRIES); do
                     sleep 30
                     delete_status=$(openstack stack show "$STACK_NAME" -f value -c stack_status)
                     echo "$j: $delete_status"
-                    if [[ $delete_status == "DELETE_FAILED" ]]; then
+                    if [ "$delete_status" = "DELETE_FAILED" ]; then
                         reason=$(openstack stack show "$STACK_NAME" -f value -c stack_status_reason)
                         echo "ERROR: Failed to delete $STACK_NAME. Reason: $reason"
 
index bc507cda592d64cdb830bf15531076b5f71b7f94..9497dbdb29f71e5f2e1fc045c550ba3b9b89dd16 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash -l
+#!/bin/sh -l
 # SPDX-License-Identifier: EPL-1.0
 ##############################################################################
 # Copyright (c) 2017 The Linux Foundation and others.
@@ -17,12 +17,13 @@ Following are the list of published images available to Jenkins jobs.
 EOF
 # Blank line before EOF is on purpose to ensure there is spacing.
 
-IFS=$'\n'
+IFS='
+'
 # We purposely want globbing here to build images list
 # shellcheck disable=SC2207
-IMAGES=($(openstack image list --long -f value -c Name -c Protected \
-    | grep 'ZZCI.*True' | sed 's/ True//'))
-for i in "${IMAGES[@]}"; do
+IMAGES="$(openstack image list --long -f value -c Name -c Protected \
+    | grep 'ZZCI.*True' | sed 's/ True//')"
+for i in $IMAGES; do
     echo "Adding image $i"
     echo "* $i" >> "$WORKSPACE/docs/cloud-images.rst"
 done
index 5d584d2dbab812001f7d51a8ea545fa03caead0f..54e5d67f85eaa4eae81dcd6cc89f80cea0011ec8 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 # SPDX-License-Identifier: EPL-1.0
 ##############################################################################
 # Copyright (c) 2017 The Linux Foundation and others.
@@ -14,7 +14,7 @@ set -e -o pipefail
 
 mkdir -p ".chartstorage"
 
-chartmuseum --port=6464 --storage="local" --storage-local-rootdir=".chartstorage" &> /dev/null &
+chartmuseum --port=6464 --storage="local" --storage-local-rootdir=".chartstorage" >/dev/null 2>&1 &
 . helm.prop
 $HELM_BIN plugin install --version v0.9.0 https://github.com/chartmuseum/helm-push.git || true
 $HELM_BIN repo add local http://localhost:6464