From cb4a8048702d464abf19dc1f7f31f6cd7e540554 Mon Sep 17 00:00:00 2001 From: nazunalika Date: Tue, 6 Jul 2021 13:33:22 -0700 Subject: [PATCH 1/2] disable tests with comments --- func/core/pkg_network/20-configure-bridge.sh | 2 +- sync/minor-release-sync-to-staging.sh | 2 +- sync/prep-staging-8.sh | 4 ++-- sync/sync-to-prod.sh | 7 +++++-- sync/sync-to-staging-sig.sh | 7 +++++-- sync/sync-to-staging.sh | 7 +++++-- 6 files changed, 19 insertions(+), 10 deletions(-) diff --git a/func/core/pkg_network/20-configure-bridge.sh b/func/core/pkg_network/20-configure-bridge.sh index e147c27..ac3e79f 100755 --- a/func/core/pkg_network/20-configure-bridge.sh +++ b/func/core/pkg_network/20-configure-bridge.sh @@ -2,7 +2,7 @@ r_log "network" "Test bridging functionality (non-network manager)" bridge=dummybr0 -# shellcheck disable=SC1091 +# shellcheck disable=SC1091,1090 . "$(dirname "$0")"/imports.sh r_log "network" "Add a dummy bridge $bridge" diff --git a/sync/minor-release-sync-to-staging.sh b/sync/minor-release-sync-to-staging.sh index 6a28eab..dccd422 100644 --- a/sync/minor-release-sync-to-staging.sh +++ b/sync/minor-release-sync-to-staging.sh @@ -2,7 +2,7 @@ # Performs a full on sync of a minor release, directories and all. It calls the # other scripts in this directory to assist. # Source common variables -# shellcheck disable=SC2046,1091 +# shellcheck disable=SC2046,1091,1090 source $(dirname "$0")/common # sync all pieces of a release, including extras, nfv, etc diff --git a/sync/prep-staging-8.sh b/sync/prep-staging-8.sh index b4347d1..bc7f20d 100644 --- a/sync/prep-staging-8.sh +++ b/sync/prep-staging-8.sh @@ -12,8 +12,8 @@ # Compose dir example: /mnt/repos-staging/mirror/pub/rocky/8.4-RC2 # Source common variables -# shellcheck disable=SC2046,1091 -source $(dirname "$0")/common +# shellcheck disable=SC2046,1091,1090 +source "$(dirname "$0")/common" echo "** Updating source repos" for y in "${ALL_REPOS[@]}"; do diff --git a/sync/sync-to-prod.sh b/sync/sync-to-prod.sh index 2a75fa5..4edf198 100644 --- a/sync/sync-to-prod.sh +++ b/sync/sync-to-prod.sh @@ -2,8 +2,8 @@ # Syncs everything from staging to production # Source common variables -# shellcheck disable=SC2046,1091 -source $(dirname "$0")/common +# shellcheck disable=SC2046,1091,1090 +source "$(dirname "$0")/common" REV=${1} @@ -13,6 +13,9 @@ ret_val=$? if [ $ret_val -eq "0" ]; then TARGET="${PRODUCTION_ROOT}/${CATEGORY_STUB}/${REV:0:3}" mkdir -p "${TARGET}" + # disabling because none of our files should be starting with dashes. If they + # are something is *seriously* wrong here. + # shellcheck disable=SC2035 sudo -l && find **/* -maxdepth 0 -type d | parallel --will-cite -j 18 sudo rsync -av --chown=10004:10005 --progress --relative --human-readable \ {} "${TARGET}" fi diff --git a/sync/sync-to-staging-sig.sh b/sync/sync-to-staging-sig.sh index dc59e5a..2741f19 100644 --- a/sync/sync-to-staging-sig.sh +++ b/sync/sync-to-staging-sig.sh @@ -1,8 +1,8 @@ #!/bin/bash # Source common variables -# shellcheck disable=SC2046,1091 -source $(dirname "$0")/common +# shellcheck disable=SC2046,1091,1090 +source "$(dirname "$0")/common" # Major Version (eg, 8) MAJ=${1} @@ -19,6 +19,9 @@ ret_val=$? if [ $ret_val -eq "0" ]; then TARGET=${STAGING_ROOT}/${CATEGORY_STUB}/${REV}/${SIG} mkdir -p "${TARGET}" + # disabling because none of our files should be starting with dashes. If they + # are something is *seriously* wrong here. + # shellcheck disable=SC2035 sudo -l && find **/* -maxdepth 0 -type d | parallel --will-cite -j 18 sudo rsync -av --chown=10004:10005 --progress --relative --human-readable \ {} "${TARGET}" fi diff --git a/sync/sync-to-staging.sh b/sync/sync-to-staging.sh index 15af985..07d8652 100644 --- a/sync/sync-to-staging.sh +++ b/sync/sync-to-staging.sh @@ -1,8 +1,8 @@ #!/bin/bash # Source common variables -# shellcheck disable=SC2046,1091 -source $(dirname "$0")/common +# shellcheck disable=SC2046,1091,1090 +source "$(dirname "$0")/common" # Major Version (eg, 8) MAJ=${1} @@ -17,6 +17,9 @@ ret_val=$? if [ $ret_val -eq "0" ]; then TARGET="${STAGING_ROOT}/${CATEGORY_STUB}/${REV}" mkdir -p "${TARGET}" + # disabling because none of our files should be starting with dashes. If they + # are something is *seriously* wrong here. + # shellcheck disable=SC2035 sudo -l && find **/* -maxdepth 0 -type d | parallel --will-cite -j 18 sudo rsync -av --chown=10004:10005 --progress --relative --human-readable \ {} "${TARGET}" fi From 9a77fb5d08dbb052e691c862f886f358919c4fdd Mon Sep 17 00:00:00 2001 From: Neil Hanlon Date: Tue, 6 Jul 2021 17:19:43 -0400 Subject: [PATCH 2/2] fix: shellcheck for validate repos --- mangle/validate_repos | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mangle/validate_repos b/mangle/validate_repos index 07192f6..88dd2e3 100755 --- a/mangle/validate_repos +++ b/mangle/validate_repos @@ -1,9 +1,9 @@ #!/usr/bin/env bash # Source mangle vars -source $(dirname "$0")/common +source "$(dirname "$0")/common" # Source sync / migrate vars for repository information -source $(dirname "$0")/../sync/common +source "$(dirname "$0")/../sync/common" # How many ARG1=${1} @@ -11,7 +11,7 @@ NUM=$(( ${ARG1:-${MIRROR_DISPLAY_COUNT}} + 2)) print_result () { if [[ "${result}" =~ "invalid repo or arch" ]]; then - printf "# repo = %s arch = %s\n" "${_repo}" "${arch}" + printf "# repo = %s arch = %s\n" "${repo}" "${arch}" printf "# FAIL: invalid repo or arch\n\n" else printf "%s\n# number of mirrors returned: %s\n\n" "$( echo "$result" | head -${NUM})" "$(( $(echo "$result" | wc -l) - 2 ))" @@ -39,7 +39,7 @@ for repo in "${ALL_REPOS[@]}"; do cleanup_repo "${repo}" # Print a nice header - printf "================\n${repo}\n================\n" + printf "================\n%s\n================\n" "${repo}" for arch in "${ARCHES[@]}" "source"; do # Source is treated as its own architecture if [[ "${arch}" == "source" ]]; then