Reduce noise in CI logs from the "for" loop
authorAndrey Alekseenko <al42and@gmail.com>
Sat, 9 Oct 2021 19:07:24 +0000 (21:07 +0200)
committerAndrey Alekseenko <al42and@gmail.com>
Mon, 11 Oct 2021 09:32:48 +0000 (09:32 +0000)
Bash "-x" option reports every iteration of the loop. While we can unset
it temporarily, we can get rid of the loop altogether and user find's
built-in capabilities. It will also be more robust w.r.t. "bad"
filenames.

Follow-up of MR !2008.

admin/ci-scripts/gromacs-base-build.sh

index a49b78b1250f6c0049a485d4b2cce439d1df1916..2ff46293660e8caa4be4c41dd862242abed67a90 100755 (executable)
@@ -9,5 +9,5 @@ awk '/warning/,/warning.*generated|^$/' buildLogFile.log testBuildLogFile.log \
 grep "cannot be built" buildLogFile.log testBuildLogFile.log | tee -a buildErrors.log || true
 $CMAKE --build . --target install 2>&1 | tee installBuildLogFile.log
 if [ -s buildErrors.log ] ; then echo "Found compiler warning during build"; cat buildErrors.log; exit 1; fi
-for file in `find . -mindepth 1 -name "*.o" ! -type l` ; do echo $file ; rm $file ; done 2>&1 > remove-build-objects.log
+find . -mindepth 1 -name '*.o' ! -type l -printf '%p\n' -delete 2>&1 > remove-build-objects.log
 cd ..