Fix: sourced files w/o arg bashisms 82/102082/1
authorguillaume.lambert <guillaume.lambert@orange.com>
Tue, 16 Aug 2022 09:16:51 +0000 (11:16 +0200)
committerguillaume.lambert <guillaume.lambert@orange.com>
Tue, 16 Aug 2022 09:41:05 +0000 (11:41 +0200)
The "source" command is only supported by a limited number of shells.
It is normally equivalent to the POSIX "." (pronounced "dot") command.
Contrary to sourced files, dotted files in bash does not allow any
extra argument since it is normally not supported in POSIX.
If no argument is specified, "source" and "." are strictly equivalent.
And sourced files can be straightforward migrated to the dot syntax.

Signed-off-by: guillaume.lambert <guillaume.lambert@orange.com>
Change-Id: Id902674c3eef31ce9633c2fc4fc2678da428f832

21 files changed:
jenkins-init-scripts/local-init.sh
jjb/autorelease/autorelease-macros.yaml
jjb/autorelease/branch-cut.sh
jjb/autorelease/generate-release-notes.sh
jjb/autorelease/version-bump.sh
jjb/docs/docs_version_bump.sh
jjb/docs/docs_version_bump_projects.sh
jjb/integration/common-functions.sh
jjb/integration/integration-apex-run-tests.sh
jjb/integration/integration-configure-clustering.sh
jjb/integration/integration-deploy-controller-run-test.sh
jjb/integration/integration-deploy-openstack-run-test.sh
jjb/integration/integration-run-test.sh
jjb/integration/integration-start-cluster-run-test.sh
jjb/netvirt/quagga-build.sh
jjb/packaging/helm-repo-init.sh
jjb/packaging/helm.yaml
jjb/packaging/openstack-k8s-cluster-delete.sh
jjb/packaging/openstack-k8s-config-export.sh
jjb/packaging/openstack-k8s-create-with-template.sh
jjb/packaging/openstack-k8s-deploy-helm.sh

index d55974cae491e060aedf2156cb01708dd9ea541e..ff15325beddfa3eb289b70622a931fd2881c1568 100755 (executable)
@@ -12,5 +12,5 @@
 INIT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
 "${INIT_DIR}/system_type.sh"
 # shellcheck disable=SC1091
-source /tmp/system_type.sh
+. /tmp/system_type.sh
 "${INIT_DIR}/${SYSTEM_TYPE}.sh"
index cdfe01cdc6339c754c83bf5b169326274c9c9308..2cc67e01d42c31d91eaff7e020ffd9f9f91b895d 100644 (file)
@@ -46,7 +46,7 @@
           #!/bin/bash -l
           set -xe -o pipefail
           python3 -m venv $WORKSPACE/venv
-          source $WORKSPACE/venv/bin/activate
+          . $WORKSPACE/venv/bin/activate
           PYTHON="$WORKSPACE/venv/bin/python"
           $PYTHON -m pip install --upgrade networkx
           $PYTHON -m pip freeze
index 0c24b27c94f342d62a78328fb4dd521c2336952d..6d458b509dd6b5b8ac591f17575caf76d58c8bfa 100644 (file)
@@ -29,7 +29,7 @@ LOG_FILE="$WORKSPACE/archives/branch-cut.log"
 set -eu -o pipefail
 
 # shellcheck disable=SC1090
-source ~/lf-env.sh
+. ~/lf-env.sh
 
 lf-activate-venv "git-review==1.28"
 
index 6f42692cf9fd96a496102d44078b953c512c2fbe..48bd517d5d0655b0803c5e06eacda8ebb6357ac3 100644 (file)
@@ -14,7 +14,7 @@
 set -x
 
 # shellcheck disable=SC1090
-source ~/lf-env.sh
+. ~/lf-env.sh
 
 lf-activate-venv "git-review==1.28"
 
index f54e0a3e85a6c5f853b9edb6013a35e6c4ec223f..a95f9b32f592843547bc4ed991e6f9e9c96a0908 100644 (file)
@@ -27,7 +27,7 @@ BRANCH="$GERRIT_BRANCH"
 set -eu -o pipefail
 
 # shellcheck disable=SC1090
-source ~/lf-env.sh
+. ~/lf-env.sh
 
 lf-activate-venv "git-review==1.28"
 
index 90021ed03ad428670b8c11b743e1521bb7b51b58..54b241ec3d0a6724a3d5e5a375ef7e61fe29d6ef 100644 (file)
@@ -31,7 +31,7 @@ done
 set +u  # Allow unbound variables for virtualenv
 virtualenv --quiet "/tmp/v/git-review"
 # shellcheck source=/tmp/v/git-review/bin/activate disable=SC1091
-source "/tmp/v/git-review/bin/activate"
+. "/tmp/v/git-review/bin/activate"
 pip install --quiet --upgrade "pip==9.0.3" setuptools
 pip install --quiet --upgrade git-review
 git config --global --add gitreview.username "jenkins-$SILO"
index 31cb15994bb7b9a2270e840df0d2237b3f7f3f4e..05a2b8b0025df224b56a47c6d12a250a5eff94e5 100644 (file)
@@ -30,7 +30,7 @@ while getopts :h: opts; do
 done
 
 # shellcheck disable=SC1090
-source ~/lf-env.sh
+. ~/lf-env.sh
 
 lf-activate-venv "git-review==1.28"
 
index 801aa9c84ce44c7de20d713c4e62e4bd876a6fdc..6c967d0cb00c1d18940143b25126de8631bbcd8a 100644 (file)
@@ -279,7 +279,7 @@ function run_plan() {
         for line in $( grep -E -v '(^[[:space:]]*#|^[[:space:]]*$)' "${type}plan.txt" ); do
             printf "Executing %s...\\n" "${line}"
             # shellcheck source=${line} disable=SC1091
-            source "${line}"
+            . "${line}"
         done
     fi
     printf "Finished running %s plans\\n" "${type}"
index 84d06e59a3a3ab84b54103d52e55734fed7366eb..980f590a0cc79eb00f46c3a8548f8c7e62e24fdd 100644 (file)
@@ -3,7 +3,7 @@
 # ${ROBOT_VENV} comes from the integration-install-robotframework.sh
 # script.
 # shellcheck source=${ROBOT_VENV}/bin/activate disable=SC1091
-source "${ROBOT_VENV}/bin/activate"
+. "${ROBOT_VENV}/bin/activate"
 source /tmp/common-functions.sh "${BUNDLEFOLDER}"
 # Ensure we fail the job if any steps fail.
 set -ex -o pipefail
@@ -45,7 +45,7 @@ ssh "$OPENSTACK_COMPUTE_NODE_2_IP" "sudo bash /tmp/extra_node_configs.sh"
 
 USER=heat-admin
 openstack object save OPNFV-APEX-SNAPSHOTS overcloudrc
-source overcloudrc
+. overcloudrc
 cat overcloudrc
 openstack hypervisor list
 
index 0fdcb9c587be2a2771f24f313e26e19dd0e6a16e..42f73e40a3c6ada706b24cc1c74a79b1c1f81b10 100644 (file)
@@ -4,7 +4,7 @@
 # ${ROBOT_VENV} comes from the integration-install-robotframework.sh
 # script.
 # shellcheck disable=SC1090,SC1091
-source "${ROBOT_VENV}/bin/activate"
+. "${ROBOT_VENV}/bin/activate"
 source /tmp/common-functions.sh "${BUNDLEFOLDER}"
 
 echo "#################################################"
index 825194e9c970c082144fced0f65e8de7f8981d2c..ee5e91fc7e953b5cf8515156529d23e62ea254ee 100755 (executable)
@@ -9,7 +9,7 @@ fi
 # ${ROBOT_VENV} comes from the integration-install-robotframework.sh
 # script.
 # shellcheck source=${ROBOT_VENV}/bin/activate disable=SC1091
-source "${ROBOT_VENV}/bin/activate"
+. "${ROBOT_VENV}/bin/activate"
 source /tmp/common-functions.sh "${BUNDLEFOLDER}"
 
 
index 3520c7baff0c3db3fe638da432831cc2961bad4e..25bd8ecc4c9b199701631bed2a71db639d54254a 100644 (file)
@@ -3,7 +3,7 @@
 # ${ROBOT_VENV} comes from the integration-install-robotframework.sh
 # script.
 # shellcheck source=${ROBOT_VENV}/bin/activate disable=SC1091
-source "${ROBOT_VENV}/bin/activate"
+. "${ROBOT_VENV}/bin/activate"
 source /tmp/common-functions.sh "${BUNDLEFOLDER}"
 # Ensure we fail the job if any steps fail.
 set -ex -o pipefail
@@ -1148,7 +1148,7 @@ export OS_TENANT_NAME=admin
 unset OS_CLOUD
 EOF
 
-source /tmp/os_netvirt_client_rc
+. /tmp/os_netvirt_client_rc
 
 echo "Get all versions before executing robot"
 echo "openstack --version"
index fa9db12048a4b96073e225c07f2abbb21ac0528f..d1277b2b2adbee24501f7eacb11be70d514b7da5 100755 (executable)
@@ -8,7 +8,7 @@ fi
 # ${ROBOT_VENV} comes from the integration-install-robotframework.sh
 # script.
 # shellcheck source=${ROBOT_VENV}/bin/activate disable=SC1091
-source "${ROBOT_VENV}/bin/activate"
+. "${ROBOT_VENV}/bin/activate"
 source /tmp/common-functions.sh "${BUNDLEFOLDER}"
 echo "#################################################"
 echo "## invoke Tests for non-karaf Controllers      ##"
index 03c2335fb5d1da1228eb00b444f11a0c530ad5a8..81c30c927114b60789466e1b6f18cdce98848e31 100644 (file)
@@ -4,7 +4,7 @@
 # ${ROBOT_VENV} comes from the integration-install-robotframework.sh
 # script.
 # shellcheck source=${ROBOT_VENV}/bin/activate disable=SC1091
-source "${ROBOT_VENV}/bin/activate"
+. "${ROBOT_VENV}/bin/activate"
 source /tmp/common-functions.sh "${BUNDLEFOLDER}"
 # Ensure we fail the job if any steps fail.
 set -ex -o pipefail
index ca46597d1ec04386c46f4dc831d49eebe3ce43a4..294601ebd8a159ae1f0f5b0f505b5bf9d40c6f7e 100644 (file)
@@ -40,7 +40,6 @@ esac
 
 popd
 
-# todo: remove below lines once the scripts in zrpcd repos build the
-# source packages.
+# 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
 tar cvzf "$WORKSPACE/upload_files/zrpcd.$(date +%F).tar.gz" "$(pwd)/zrpcd"
index 60ef6352409812fc8c06529d75c08db0fb51bf56..5d584d2dbab812001f7d51a8ea545fa03caead0f 100644 (file)
@@ -15,7 +15,7 @@ set -e -o pipefail
 mkdir -p ".chartstorage"
 
 chartmuseum --port=6464 --storage="local" --storage-local-rootdir=".chartstorage" &> /dev/null &
-source helm.prop
+. 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
 $HELM_BIN repo add opendaylight http://localhost:6464
index 5726b36d68c538e050fa350257246770614ef810..9d95315a303055bf811b702f9779a99bbf514f7e 100644 (file)
     helm_build_script: |
       #!/bin/bash
       set -x
-      source helm.prop
+      . helm.prop
       set -e -o pipefail
       cd helm/opendaylight
       helm3.7 version
index 7550ded663a8b5086f52ea4bc62bbbfe6b753dc3..a43a457e3fbde1d4cb76623efd14c36e3e0f0e19 100644 (file)
@@ -13,7 +13,7 @@ echo "---> Delete K8S cluster"
 
 set -eux -o pipefail
 # shellcheck disable=SC1090
-source ~/lf-env.sh
+. ~/lf-env.sh
 
 os_cloud="${OS_CLOUD:-vex}"
 cluster_name="${CLUSTER_NAME}"
index 883df0014f6fe39ffefe317b4056b456872543c8..5f834c7abf4abc5fa72ada980605e6780fc2918c 100644 (file)
@@ -13,7 +13,7 @@ echo "---> Export K8S cluster config and view nodes"
 set -eux -o pipefail
 
 # shellcheck disable=SC1090
-source ~/lf-env.sh
+. ~/lf-env.sh
 
 OS_TIMEOUT=5             # Wait time in minutes for OpenStack cluster nodes to come up.
 CLUSTER_NODE_RETRIES=15  # Number of times to retry waiting for a cluster nodes.
index 7513c9f5e59de9804b3bd9509bf27909c070b5c0..4adcf8f91c1dcd54f562ae2522128a18d85bcb19 100644 (file)
@@ -13,7 +13,7 @@ echo "---> Create K8S cluster with pre-existing template"
 
 set -eux -o pipefail
 # shellcheck disable=SC1090
-source ~/lf-env.sh
+. ~/lf-env.sh
 lf-activate-venv python-openstackclient python-magnumclient
 
 OS_TIMEOUT=20       # Wait time in minutes for OpenStack cluster to come up.
index d418168938fcaa5110189256d4d0ed82ab93b0e3..cf27ce4098d109420084915e58f6cc6f15ac97fe 100644 (file)
@@ -15,7 +15,7 @@ set -eux -o pipefail
 set -x
 
 # shellcheck disable=SC1090
-source ~/lf-env.sh
+. ~/lf-env.sh
 
 K8S_DEPLOY_LOG="$WORKSPACE/archives/k8s-kubectl-file.log"
 mkdir -p "$WORKSPACE/archives"