From 85b1492555d765b14864e0d2d59db7a50cdccaf0 Mon Sep 17 00:00:00 2001 From: Guillaume Lambert Date: Fri, 12 Mar 2021 13:53:18 +0100 Subject: [COMMON] Enforce checkbashisms tox profile - add checkbahims to tox.ini default profiles - remove -f options to unforce bashisms detection in explicit bash scripts and to differentiate treatments between bash and sh - migrate #!/bin/bash shebangs to #!/bin/sh for scripts without bashisms The following scripts have not been migrated since they still use bashisms difficult to migrate (mostly arrays - more details below) ./kubernetes/common/mariadb-init/resources/config/db_init.sh ./kubernetes/portal/components/portal-mariadb/resources/config/ \ mariadb/docker-entrypoint.sh ./kubernetes/helm/plugins/deploy/deploy.sh ./kubernetes/helm/plugins/undeploy/undeploy.sh ./kubernetes/sdnc/components/sdnc-prom/resources/bin/ensureSdncActive.sh $ find . -not -path '*/\.*' -name *.sh -exec checkbashisms -f {} + 2>&1\ | grep line | cut -d' ' -f 7- | sort | uniq -c | sort -k1,1nr 18 (bash arrays, ${name[0|*|@]}): 2 (declare): 1 ($FUNCNAME): 1 (shopt): 1 (trap with ERR|DEBUG|RETURN): https://mywiki.wooledge.org/Bashism#Arrays https://mywiki.wooledge.org/Bashism#Special_Variables https://mywiki.wooledge.org/Bashism#Builtins https://www.oilshell.org/release/0.5.alpha2/test/spec.wwz/builtin-trap.html Issue-ID: OOM-2643 Signed-off-by: Guillaume Lambert Change-Id: Id06ad1d45004321a293bdd26038d8da5f7b6b4ac --- .../appc/resources/config/appc/opt/onap/appc/bin/health_check.sh | 3 ++- kubernetes/appc/resources/config/appc/opt/onap/appc/bin/startODL.sh | 4 ++-- .../appc/resources/config/appc/opt/onap/ccsdk/bin/installSdncDb.sh | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) (limited to 'kubernetes/appc/resources/config') diff --git a/kubernetes/appc/resources/config/appc/opt/onap/appc/bin/health_check.sh b/kubernetes/appc/resources/config/appc/opt/onap/appc/bin/health_check.sh index f2675b0404..424074aa8c 100755 --- a/kubernetes/appc/resources/config/appc/opt/onap/appc/bin/health_check.sh +++ b/kubernetes/appc/resources/config/appc/opt/onap/appc/bin/health_check.sh @@ -1,4 +1,5 @@ -#!/bin/bash -x +#!/bin/sh -x + {{/* # Copyright © 2018 AT&T, Amdocs, Bell Canada Intellectual Property. All rights reserved. # diff --git a/kubernetes/appc/resources/config/appc/opt/onap/appc/bin/startODL.sh b/kubernetes/appc/resources/config/appc/opt/onap/appc/bin/startODL.sh index 97df772ba7..789f1b38a1 100755 --- a/kubernetes/appc/resources/config/appc/opt/onap/appc/bin/startODL.sh +++ b/kubernetes/appc/resources/config/appc/opt/onap/appc/bin/startODL.sh @@ -1,6 +1,6 @@ -#!/bin/bash -x -{{/* +#!/bin/sh -x +{{/* ### # ============LICENSE_START======================================================= # APPC diff --git a/kubernetes/appc/resources/config/appc/opt/onap/ccsdk/bin/installSdncDb.sh b/kubernetes/appc/resources/config/appc/opt/onap/ccsdk/bin/installSdncDb.sh index 29761a0200..7257d186e6 100755 --- a/kubernetes/appc/resources/config/appc/opt/onap/ccsdk/bin/installSdncDb.sh +++ b/kubernetes/appc/resources/config/appc/opt/onap/ccsdk/bin/installSdncDb.sh @@ -1,4 +1,5 @@ -#!/bin/bash +#!/bin/sh + {{/* ### -- cgit 1.2.3-korg