userland: the submodule filter must not stop the script under set -e

grep exits 1 when every line is filtered out -- which is exactly the good
case, every submodule at its pin.  Under set -e the script died there in
silence (measured 2026-11-23: step 2, exit 1, no message, no work done).
`|| true' on the pipeline.
This commit is contained in:
lotherk committed 2026-11-23 14:06:03 +00:00
1 parent c80760883f
commit 5428918198
1 file changed
+6 -1
+6 -1
View File
@@ -444,9 +444,14 @@ ensure_submodules()
# tens of gigabytes) that tools/srctree-stage.sh keeps out of the source
# set and no build step reads. Checking them out turned a fresh clone's
# `make release` into a 36 GB download (measured 2026-11-23).
#
# `|| true' on the pipeline: this script runs under `set -e', and grep
# exits 1 when the filter leaves nothing -- which is the good case, every
# submodule at its pin. Without it the build stopped here in silence
# (measured 2026-11-23: step 2, exit 1, no message).
need=$(cd "$TOP" && git submodule status 2>/dev/null |
awk 'substr($0, 1, 1) == "-" || substr($0, 1, 1) == "+" { print $2 }' |
grep -v '^refs/')
grep -v '^refs/' || true)
[ -n "$need" ] || return 0
echo "userland: submodules at their pin: $(echo $need)"
# A submodule that cannot be fetched (a private tree this build does not