srctree-stage: a submodule that is not checked out is not fatal

A fresh clone has empty directories where the submodules would be, and the
source set only needs the ones the build reads (the forks of ext/ and pkgsrc).
The rest -- krang, sshcrypt, kidstube, CNCL, mikronix -- are repositories whose
remotes ask for a password, so 'git submodule update --recursive' aborts on
them (measured 2026-11-23 on the MacBook, ext/src/mikronix) and step 5 of
make release then died on 'submodule ... is not checked out'.

Test: dash -n; the check is ls -A on the directory, and the root file list
already drops each submodule path before pax runs.
This commit is contained in:
lotherk committed 2026-11-23 12:07:05 +00:00
1 parent a1e2829a21
commit 183d10171f
1 file changed
+11 -2
+11 -2
View File
@@ -94,9 +94,18 @@ done
(cd "$TOP" && "$PAX" -rw -pm "$DIR") < "$rootlist" \
|| die "copying the repository into $DIR failed"
# Each submodule: its tracked files, no .git, no build output.
# Each submodule: its tracked files, no .git, no build output. A submodule
# that is not checked out is left out of the set: the ones the build needs are
# the forks of ext/ (ext/AGENTS.md) and pkgsrc, and the rest (krang, sshcrypt,
# kidstube, CNCL, mikronix) carry no file the release reads. A fresh clone
# that did not run `git submodule update --init' for them must not stop the
# release in this step (measured 2026-11-23: `git submodule update --recursive'
# on the MacBook aborted on ext/src/mikronix, whose remote wants a password).
for sub in $SUBMODULES; do
[ -d "$TOP/$sub" ] || die "submodule $sub is not checked out"
if [ ! -d "$TOP/$sub" ] || [ -z "$(ls -A "$TOP/$sub" 2>/dev/null)" ]; then
echo "srctree-stage: $sub is not checked out, not in the source set" >&2
continue
fi
mkdir -p "$DIR/$sub"
(cd "$TOP/$sub" && git ls-files) |
(cd "$TOP/$sub" && "$PAX" -rw -pm "$DIR/$sub") \