From 5ed49ab7f1cb9f4fc027134a24a62ef313e38255 Mon Sep 17 00:00:00 2001 From: Simon Halvorsen Date: Wed, 7 Jan 2026 16:57:51 +0100 Subject: [PATCH] changes ls | grep to rather use find unpack-tarballs: formatted script with shfmt --- build-scripts/unpack-tarballs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/build-scripts/unpack-tarballs b/build-scripts/unpack-tarballs index 89c2e2d11..9130c973b 100755 --- a/build-scripts/unpack-tarballs +++ b/build-scripts/unpack-tarballs @@ -29,10 +29,7 @@ . compile-options SOURCE_TARBALL="$BASEDIR/output/tarballs/cfengine-3.*.tar.gz" -# shellcheck disable=SC2010 -# > Don't use ls | grep. Use a glob or a for loop with a condition to allow non-alphanumeric filenames. -# TODO: CFE-4587 -MASTERFILES_TARBALL=$(ls "$BASEDIR"/output/tarballs/cfengine-masterfiles*.tar.gz | grep -v 'pkg.tar.gz$') +MASTERFILES_TARBALL=$(find "$BASEDIR"/output/tarballs/ -name 'cfengine-masterfiles*.tar.gz' -a ! \( -name '*pkg.tar.gz' \)) # DELETE the git-checked-out directories, they are tainted with # ./configure artifacts anyway. The tarballs are unpacked and symlinked