Fix: bashisms - step 1 66/102066/2
authorguillaume.lambert <guillaume.lambert@orange.com>
Fri, 12 Aug 2022 10:32:37 +0000 (12:32 +0200)
committerguillaume.lambert <guillaume.lambert@orange.com>
Sun, 14 Aug 2022 19:24:51 +0000 (21:24 +0200)
Signed-off-by: guillaume.lambert <guillaume.lambert@orange.com>
Change-Id: I8656682794a3fe65f5644f027471c382ced73826

jenkins-init-scripts/ubuntu-docker-ovs.sh
jjb/docs/docs-post-rtd.sh
jjb/generate-csit-status-report.sh
jjb/integration/integration-install-robotframework.sh
jjb/netvirt/run-reports.sh
scripts/rename-jobs.sh

index 743255b6975c2575f00207d485e7411f14f7b767..2bcbd073d9cdb8a9bdc7feefa4cea3742a4af6b1 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 # make sure we don't require tty for sudo operations
 cat <<EOF >/etc/sudoers.d/89-jenkins-user-defaults
@@ -14,8 +14,7 @@ sed -i "/127.0.0.1/s/$/\t$(hostname)/" /etc/hosts
 
 # Do the final install of OVS that the has to be done at boot time for
 # some reason due to how the snapshots keep behaving.
-dpkg --install /root/openvswitch-datapath-dkms* && \
-dpkg --install /root/openvswitch-{common,switch}*
+dpkg --install /root/openvswitch-datapath-dkms* /root/openvswitch-common* /root/openvswitch-switch*
 
 # add user jenkins to docker group
 /usr/sbin/usermod -a -G docker jenkins
index 5c8d8c52f516feac6581b2dde1f72f2248fe62d3..6f5aa6be14c81b08f1358d2b298d054e42776425 100644 (file)
@@ -1,8 +1,8 @@
-#!/bin/bash
-if [ "$GERRIT_BRANCH" == "master" ]; then
+#!/bin/sh
+if [ "$GERRIT_BRANCH" = "master" ]; then
     RTD_BUILD_VERSION=latest
 else
-    RTD_BUILD_VERSION="${{GERRIT_BRANCH/\//-}}"
+    RTD_BUILD_VERSION=$(echo $GERRIT_BRANCH | sed 's@/@-@g')
 fi
 
 # shellcheck disable=SC1083
index ae2133001e620c276b0a5e0003ce0ea6dc2dddb9..25c50c2a7a031e1788bf788577c05476f7ad1a7f 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 # SPDX-License-Identifier: EPL-1.0
 ##############################################################################
 # Copyright (c) 2017 The Linux Foundation and others.
@@ -53,7 +53,7 @@ EOF
 
 python3 -m venv "/tmp/v/jenkins"
 # shellcheck source=/tmp/v/jenkins/bin/activate disable=SC1091
-source "/tmp/v/jenkins/bin/activate"
+. "/tmp/v/jenkins/bin/activate"
 # Remove pip cache to avoid cache entry deserialization failures
 rm -rf ~/.cache/pip/
 pip install --quiet --upgrade pip setuptools
index 0a814db6cdfd883963dad933a38f35cd23265bb4..5f909177a065fa3cd094e8fedcb9b3e2a5fa7ebf 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash -l
+#!/bin/sh -l
 # SPDX-License-Identifier: EPL-1.0
 ##############################################################################
 # Copyright (c) 2015 The Linux Foundation and others.
@@ -18,7 +18,7 @@ echo ROBOT_VENV="${ROBOT_VENV}" >> "${WORKSPACE}/env.properties"
 # to install into the image.
 python3 -m venv "${ROBOT_VENV}"
 # shellcheck disable=SC1090
-source "${ROBOT_VENV}/bin/activate"
+. "${ROBOT_VENV}/bin/activate"
 
 set -exu
 
index 97f6413e2582e0ad6b5007ccdcb90fd256b297c0..1b004e0c51807c0b7100b99dc43bf39b7b0e8ef3 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 # SPDX-License-Identifier: EPL-1.0
 ##############################################################################
 # Copyright (c) 2018 Red Hat, Inc. and others.
@@ -15,7 +15,7 @@ set -x # Enable trace
 
 virtualenv --quiet "/tmp/v/odltools"
 # shellcheck disable=SC1091
-source /tmp/v/odltools/bin/activate
+. /tmp/v/odltools/bin/activate
 pip install odltools
 mkdir "$REPORT_PATH"
 python -m odltools csit reports --numjobs "$NUM_JOBS" --path "$REPORT_PATH" --url "$LOG_URL" --jobnames "$JOB_NAMES" || true
index 95b387676a2190de417661e8d3e06ffb60321a0a..9187edf5a29d0d3b26b011b58bb12776e473ab71 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 # Script to rename Jenkins jobs by searching and replacing a string with a new
 # string.
@@ -28,7 +28,7 @@ jobs=$(xmlstarlet sel -t -m '//hudson/job' \
       grep "$search_string")
 
 for job in $(echo "$jobs" | tr "\n" " "); do
-    new_job="${job//$search_string/$replace_string}"
+    new_job=$(echo $job | sed "s@$search_string@$replace_string@g")
     echo "Renaming $job to $new_job"
     #curl --data "newName=${new_job}" "https://$username:$password@jenkins.opendaylight.org/$system/job/${job}/doRename"
 done