From 5e5cdf3372932f00151ceff9388165201ebe5106 Mon Sep 17 00:00:00 2001 From: David Spickett Date: Mon, 27 Apr 2020 14:15:51 +0100 Subject: Shellcheck fixes round 4 Fixes for: https://github.com/koalaman/shellcheck/wiki/SC2207 Are using the bash 4.x 'mapfile' syntax where the input to the array is seperated by newlines. If it's separated by spaces we use 'read' instead. Support for selecting libc in MakeRelease.job was removed in 3fa23da28ad73d0fe4b512c4aab269b5280a6650. So remove references to "libc" which were expanding to nothing anyway. In tcwg-llvm-common.sh PROJECTS->BRANCHED_PROJECTS is not strictly needed. However shellcheck can't tell that the local PROJECTS in this file is different from the PROJECTS in tcwg-llvm-build.sh. Change-Id: Ie55968e3bf185d0bd5795fe48014636cda1009bc --- tcwg-cleanup-stale-containers.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tcwg-cleanup-stale-containers.sh') diff --git a/tcwg-cleanup-stale-containers.sh b/tcwg-cleanup-stale-containers.sh index 854c4233..2fa246cf 100755 --- a/tcwg-cleanup-stale-containers.sh +++ b/tcwg-cleanup-stale-containers.sh @@ -155,10 +155,10 @@ wait $! || res=$? status=$(($status|(2*$res))) if $cleanup_volumes; then - rm_volumes=($($DOCKER volume ls -q -f dangling=true)) + mapfile -t rm_volumes < <($DOCKER volume ls -q -f dangling=true) # Filter-out named volumes like host-home and home-$USER. Leave only volumes # named like a sha1 hash. - rm_volumes=($(echo "${rm_volumes[@]}" | tr " " "\n" | grep "^[a-f0-9]\{64\}\$" | cat)) + mapfile -t rm_volumes < <(echo "${rm_volumes[@]}" | tr " " "\n" | grep "^[a-f0-9]\{64\}\$") if [ ${#rm_volumes[@]} != 0 ]; then echo "Removing dangling volumes" -- cgit v1.2.3