diff --git a/tools/srctree-stage.sh b/tools/srctree-stage.sh index 05caa4dc37..11b64b423a 100755 --- a/tools/srctree-stage.sh +++ b/tools/srctree-stage.sh @@ -120,6 +120,30 @@ mkdir -p "$DIR/pkgsrc" (cd "$TOP/pkgsrc" && "$PAX" -rw -pm "$DIR/pkgsrc") \ || die "copying pkgsrc into $DIR/pkgsrc failed" +# The recipes of the forks (ext/src//pkgsrc) are tracked files of the +# submodules, so the set already has them. What is missing is the mirror that +# makes pkgsrc build one: a recipe builds only from inside pkgsrc's own tree, +# so tools/ext-sync.sh places it at pkgsrc//. That mirror is +# named in pkgsrc's .git/info/exclude, so the copy above does not carry it -- +# and without it a tree built from this set rebuilds itself without splinter, +# mcde and the servers. The files are written, not linked: a link that stayed +# a link would point out of the set once it is unpacked somewhere else. +if [ -x "$TOP/tools/ext-sync.sh" ]; then + "$TOP/tools/ext-sync.sh" >/dev/null || die "tools/ext-sync.sh failed" + for d in "$TOP"/pkgsrc/*/*/; do + d=${d%/} + [ -L "$d/Makefile" ] || continue + rel=${d#$TOP/pkgsrc/} + mkdir -p "$DIR/pkgsrc/$rel" + (cd "$d" && find . \( -type f -o -type l \) | sed 's|^\./||') | + while read -r f; do + mkdir -p "$DIR/pkgsrc/$rel/$(dirname "$f")" + cp -pL "$d/$f" "$DIR/pkgsrc/$rel/$f" || + die "copying $rel/$f into the source set failed" + done + done +fi + "$TOP/tools/makronix-distfiles.sh" stage "$DIR" # ustar is the format of every set, and the installer's tar (bin/pax built