diff --git a/PINS b/PINS index c474c1708d..67763e3b29 100644 --- a/PINS +++ b/PINS @@ -1,3 +1,4 @@ +# $Makronix$ # The commits this tree belongs to (tools/makronix-pins.sh). # src/ is a tracked fork, not a repository: this is the upstream NetBSD commit # it was taken from (also src/BASE). refs/netbsd/src is upstream trunk, for diff --git a/distfiles.lst b/distfiles.lst index 022fb19ba4..c3a893f002 100644 --- a/distfiles.lst +++ b/distfiles.lst @@ -1,3 +1,6 @@ +# $Makronix$ +# +# Written by tools/makronix-distfiles.sh list -- do not edit by hand. archivers/brotli brotli/brotli-1.2.1.tar.gz 646598 460591287d428c8b5a8a2766b5b424d14501fcda12c7118b8f3cc4bfae44b90ac75ca156557f07b6e22542612724d904533e5f70019be07dbbb604c46f03ab69 archivers/gtar-base tar-1.35.tar.xz 2317208 8b84ed661e6c878fa33eb5c1808d20351e6f40551ac63f96014fb0d0b9c72d5d94d8865d39e36bcb184fd250f84778a3b271bbd8bd2ceb69eece0c3568577510 archivers/libzip libzip-1.12.1.tar.xz 813384 acc848242e8c0fc85c7e7984f633d898443156024cb67ee4facb657c80dd397b01326e5c32bc3955eba7ffcecdc39bebabfd27ea2d38e80603dae15581cf00e1 @@ -1484,6 +1487,7 @@ emulators/qemu palcode-clipper-qemu-5.2.0nb8 159808 33695d6001d86a19793a92d5e317 emulators/qemu qemu-11.1.3.tar.xz 141819712 6bcade0af849e6a7f124e2b07d07e8a6e1fd160dcdc7f3c9c968cbdbc8922b2ddfa68493105ac14516f8eea83db6ef4dba07cc6776a61aa023508b31e53b9ef7 emulators/retroarch retroarch-1.9.0/retroarch-assets.tar.gz 159084018 ba31152fa526b23f44aead13d8d3975c480b9748443233b2fa7501b697a7b49bf00de8a16669858124f511a1c1fd8ae6f1f8f019c68b3c08e687be6404717f9c emulators/retroarch retroarch-1.9.0/retroarch.tar.gz 39152024 228312424325fae12f5647e8774fb546e9a379d7a61a831d84e4c45b0a8ad9c3a2c2d0fd6442347842a71f39be2e0ef9d4302900279fe7e61d5def2966b636c3 +filesystems/afpfs-ng afpfs-ng-0.8.1.tar.gz 460185 0abcb76e32d11c330eab357a7ab8feeccede68953ed6b8400a282a098c82105476f4b052f8c1b69e96f91a2a22657f9dacc5d35f5a65b72112ecb7addbd94751 filesystems/fuse-sshfs sshfs-3.7.5.tar.xz 51604 c76d8d725c4f8ef8b95c699ae25407fd6789cd5ce94b36d241a6754e4e6d8cae9729bbe9b1e21e421f6148bf822c9441cf6626206ec7540e7b26d298e2616929 fonts/Xft2 libXft-2.1.7.tar.bz2 237056 51c4395a04a9434b21c26b9eb8bda8c4e2926d74774581d81c162b7dd1918e3aca57d2d6cf370f410757130edc7ca31c36fb06be965f3695442e398f4d4e26f6 fonts/bdftopcf bdftopcf-1.1.2.tar.xz 146188 b3dde8d73084b7ec23ea47491321d12fa8f4a0a9ce0f61f2f89460fdc98f05d135ba11d8588d9debb8c2639ac68a7434a0cf80d9d548cd7328cbcb2339b4c0a6 diff --git a/distfiles/pkgin-26.4.0.tar.gz b/distfiles/pkgin-26.4.0.tar.gz new file mode 100644 index 0000000000..e51d2cba24 Binary files /dev/null and b/distfiles/pkgin-26.4.0.tar.gz differ diff --git a/ext/AGENTS.md b/ext/AGENTS.md index 49843ef1a6..743beee82c 100644 --- a/ext/AGENTS.md +++ b/ext/AGENTS.md @@ -40,6 +40,21 @@ its recipe in `pkgsrc-/` and becomes `/-` - An update to a newer upstream is a merge onto the fork with `IMPORT` renewed, never a silent overwrite. +## Header + +A file Makronix wrote carries `$Makronix$` in its first three lines: +`#\t$Makronix$` in a shell script, Makefile or PLIST, `/*\t$Makronix$\t*/` in +C. A file taken from pkgsrc keeps pkgsrc's `$NetBSD: ,v ... Exp $` +-- the revision says where it came from and is not a template to fill in. + +The unfilled `$NetBSD$` is neither: it is what pkgsrc's recipe skeleton has +before the revision is set, it means nothing in this tree, and it reads as if +the file were pkgsrc's when it is ours (`ext/src/mcde/pkgsrc-motif/ +buildlink3.mk` carried it until 2026-11-23; `tools/test-tools.sh` fails if one +comes back). A recipe written here -- Makefile, options.mk, buildlink3.mk, +PLIST -- takes `$Makronix$`; that includes the files modelled on a pkgsrc +recipe, because the content is ours. + ## What must not be touched - The first commit of a tree is the upstream archive and recipe, unchanged diff --git a/ext/src/mcde b/ext/src/mcde index 91967e9f0d..7dd90490b4 160000 --- a/ext/src/mcde +++ b/ext/src/mcde @@ -1 +1 @@ -Subproject commit 91967e9f0d006d7f31694116c4ebe066eb797279 +Subproject commit 7dd90490b4c1da641579a242153d9ceb2bd86f0b diff --git a/tools/install-simple.sh b/tools/install-simple.sh index 5395e3ff7a..befe912c39 100755 --- a/tools/install-simple.sh +++ b/tools/install-simple.sh @@ -477,11 +477,8 @@ else if [ $SRCDVD = yes ] || [ -n "${USBGZ:-}" ]; then # the DVD and the stick check '^SRC_OK' "/usr/src holds the tree (src/sys, src/build.sh)" check '^MXSRC_OK' "/usr/src has PINS and pkgsrc" - want=$(cut -d' ' -f2 "$TOP/distfiles.lst" | sort -u | wc -l | tr -d ' ') - # the archives of the forks (wm/mcde, x11/mcde-motif, afpfs-ng) are not - # in distfiles.lst: tools/makronix-distfiles.sh stage adds them, so the - # set carries want + one line per fork - want=$((want + $(tools/makronix-distfiles.sh forks 2>/dev/null | wc -l))) + # `#' lines are the file's header (tools/makronix-distfiles.sh list) + want=$(grep -v '^#' "$TOP/distfiles.lst" | cut -d' ' -f2 | sort -u | wc -l | tr -d ' ') check "DISTFILES= *$want\$" "all $want Makronix distfiles are in /usr/src/distfiles" check "^src $(cat "$TOP/src/BASE")" "PINS on the disk names the upstream base of this tree" else diff --git a/tools/makronix-distfiles.sh b/tools/makronix-distfiles.sh index cc08bf426b..66023b5613 100755 --- a/tools/makronix-distfiles.sh +++ b/tools/makronix-distfiles.sh @@ -84,6 +84,14 @@ sha512_of() fi } +# distfiles.lst without its header: every reader below goes through this, so a +# comment line can never be read as a package path (the file starts with three +# `#' lines, cmd_list). +list_lines() +{ + grep -v '^#' "$LIST" +} + # write the list the recipes imply to $1 # every package of packages.list -- the ones built here AND the ones used as the # NetBSD project's binaries (fetch, games) -- and everything they need, one @@ -108,10 +116,17 @@ gen_list() trap 'rm -rf "$tmp"' EXIT closure_paths > "$tmp/all" - # The forks of ext/ have no archive to list: their recipe builds from - # ext/src/, which is in the repository and travels with the source - # set (ext/src//pkgsrc/Makefile, do-extract). - fork_recipes | cut -d' ' -f1 | LC_ALL=C sort -u > "$tmp/forks" + # A fork whose recipe builds from its own tree has no archive to list: + # `DISTFILES= # empty' and a `do-extract' that copies ext/src/ into + # WRKSRC (ext/src//pkgsrc/Makefile). It travels with the source set + # already. A fork that still builds from an upstream archive -- afpfs-ng + # -- does have one, and dropping it here left the source set without a + # tarball its recipe needs (found 2026-11-23 while reading this file). + : > "$tmp/forks" + fork_recipes | while read -r p recipe; do + grep -q '^DISTFILES=[[:space:]]*# empty' "$recipe/Makefile" && + echo "$p" + done | LC_ALL=C sort -u > "$tmp/forks" LC_ALL=C comm -23 "$tmp/all" "$tmp/forks" > "$tmp/paths" [ -s "$tmp/paths" ] || die "no packages" @@ -169,14 +184,6 @@ fork_recipes() done } -# The forks of ext/ contribute no archive: their recipe builds from the source -# tree itself (do-extract copies ext/src/ into WRKSRC), and that tree is -# part of the repository and of the source set. Nothing to fetch, nothing to -# stage. The function stays so check, stage and the list keep one shape. -fork_archives() -{ - : -} cmd_list() { @@ -193,14 +200,25 @@ cmd_list() gen_list "$tmpf" if [ -f "$LIST" ]; then before=$(wc -l < "$tmpf") - LC_ALL=C sort -u "$LIST" "$tmpf" > "$tmpf.u" + { list_lines; cat "$tmpf"; } | LC_ALL=C sort -u > "$tmpf.u" kept=$(( $(wc -l < "$tmpf.u") - before )) cat "$tmpf.u" > "$tmpf" else kept=0 fi - cat "$tmpf" > "$LIST" - echo "makronix-distfiles: $(wc -l < "$LIST" | tr -d ' ') archives" \ + # The file is generated, but it is also read by hand (which archive is + # this, why is it 600 MB), so the first three lines say what it is and + # carry the tree's header like every other file of ours. The header is + # written here, not into the file: `list' rewrites the file, and PINS and + # the makronix mi list are commented the same way -- every reader here + # skips `#' (see list_lines). + printf '%s\n' \ + '# $Makronix$' \ + '# ' \ + '# Written by tools/makronix-distfiles.sh list -- do not edit by hand.' > "$tmpf.h" + cat "$tmpf" >> "$tmpf.h" + cat "$tmpf.h" > "$LIST" + echo "makronix-distfiles: $(grep -vc '^#' "$LIST" | tr -d ' ') archives" \ "-> ${LIST#$TOP/}, $kept kept from the earlier list (another platform's closure)" } @@ -218,7 +236,7 @@ cmd_verify() # tool itself has it in the closure, a host with the tool in PATH does # not. What must hold is that every line the recipes imply is there, # with the same hash -- an extra line from another platform is fine. - LC_ALL=C sort -u "$LIST" > "$vtmp/have" || die "cannot read $LIST" + list_lines | LC_ALL=C sort -u > "$vtmp/have" || die "cannot read $LIST" LC_ALL=C sort -u "$vtmp/list" > "$vtmp/want" || die "cannot read the generated list" LC_ALL=C comm -23 "$vtmp/want" "$vtmp/have" > "$vtmp/missing" || true if [ -s "$vtmp/missing" ]; then @@ -239,6 +257,10 @@ cmd_fetch() [ -f "$LIST" ] || die "no $LIST; run: $0 list" [ -x "$BMAKE" ] || die "no bmake at $BMAKE" mkdir -p "$MXDIST" || exit 1 + # the list without its header, once: the two loops below read it + ll=$(mktemp "${TMPDIR:-/tmp}/mxll.XXXXXX") || exit 1 + trap 'rm -f "$ll"' EXIT + list_lines > "$ll" # 1. what the shared directory already has, with the right hash linked=0 @@ -249,16 +271,16 @@ cmd_fetch() ln "$SHARED/$f" "$MXDIST/$f" 2>/dev/null || cp -p "$SHARED/$f" "$MXDIST/$f" || exit 1 linked=$((linked + 1)) fi - done < "$LIST" + done < "$ll" echo "makronix-distfiles: $linked archives taken from $SHARED" # 2. fetch the rest, package by package, with pkgsrc's own `make fetch' - cut -d' ' -f1 "$LIST" | LC_ALL=C sort -u | while read -r p; do + cut -d' ' -f1 "$ll" | LC_ALL=C sort -u | while read -r p; do need=0 while read -r q f size sum; do [ "$q" = "$p" ] || continue have "$f" "$sum" || need=1 - done < "$LIST" + done < "$ll" [ $need -eq 1 ] || continue echo "makronix-distfiles: fetch $p" (cd "$PKGSRC/$p" && "$BMAKE" fetch DISTDIR="$MXDIST" > /dev/null 2>&1) \ @@ -270,9 +292,8 @@ cmd_fetch() cmd_check() { [ -f "$LIST" ] || die "no $LIST; run: $0 list" - # the list and the archives of the forks of ext/ (fork_archives) clist=$(mktemp "${TMPDIR:-/tmp}/mxdist.XXXXXX") || exit 1 - { cat "$LIST"; fork_archives; } > "$clist" + list_lines > "$clist" missing=0 bad=0 total=0 while read -r p f size sum; do total=$((total + 1)) @@ -294,7 +315,7 @@ cmd_stage() [ $# -eq 1 ] || die "usage: $0 stage DIR" cmd_check > /dev/null || die "build/distfiles is not complete; run: $0 fetch" slist=$(mktemp "${TMPDIR:-/tmp}/mxdist.XXXXXX") || exit 1 - { cat "$LIST"; fork_archives; } > "$slist" + list_lines > "$slist" while read -r p f size sum; do [ -e "$1/distfiles/$f" ] && continue # two packages, one archive mkdir -p "$1/distfiles/$(dirname "$f")" diff --git a/tools/makronix-pins.sh b/tools/makronix-pins.sh index 9fba1a94ef..cf7bf2878e 100755 --- a/tools/makronix-pins.sh +++ b/tools/makronix-pins.sh @@ -35,6 +35,7 @@ emit() case ${1:-} in write) { + echo '# $Makronix$' echo "# The commits this tree belongs to (tools/makronix-pins.sh)." echo "# src/ is a tracked fork, not a repository: this is the upstream NetBSD commit" echo "# it was taken from (also src/BASE). refs/netbsd/src is upstream trunk, for" diff --git a/tools/test-tools.sh b/tools/test-tools.sh index 62fdd1d4a6..9654210549 100755 --- a/tools/test-tools.sh +++ b/tools/test-tools.sh @@ -381,5 +381,53 @@ else bad "ext-extract drops a copy a file left" "c.h is still there" fi +# --- headers of the recipes in ext/ --------------------------------------- +# A recipe that Makronix wrote carries `$Makronix$', not the pkgsrc template +# `$NetBSD$' (which marks a file as pkgsrc's own; it has no meaning in ours +# and misleads the next reader about where the file came from). The forks' +# recipes are `ext/src//pkgsrc*/'; afpfs-ng's is upstream, unchanged, and +# keeps its `$NetBSD: ...,v ... Exp $' with the revision, which is a different +# thing from the unfilled template. +stray= +for f in "$R"/ext/src/*/pkgsrc/*.mk "$R"/ext/src/*/pkgsrc-*/*.mk \ + "$R"/ext/src/*/pkgsrc/Makefile "$R"/ext/src/*/pkgsrc-*/Makefile \ + "$R"/ext/src/*/pkgsrc/PLIST "$R"/ext/src/*/pkgsrc-*/PLIST; do + [ -f "$f" ] || continue + # pkgsrc's own revision form is fine: it names where the file came from. + head -n 3 "$f" | grep -q '\$NetBSD:' && continue + head -n 3 "$f" | grep -q '\$NetBSD\$' && stray="$stray $f" +done +if [ -z "$stray" ]; then + pass "recipes in ext/ carry \$Makronix\$, not the pkgsrc template" +else + bad "recipes in ext/ carry \$Makronix\$, not the pkgsrc template" \ + "unfilled \$NetBSD\$ in:$stray" +fi + +# --- distfiles.lst --------------------------------------------------------- +# The header lines are `#'; a reader that takes every line as a package path +# would see "#" and break (install-simple.sh counts DISTFILES= lines from this +# file, verify and stage read it as data). The generator writes them, so they +# survive `list'. +if head -1 "$R/distfiles.lst" | grep -q '^\s*#.*\$Makronix\$'; then + pass "distfiles.lst carries the header" +else + bad "distfiles.lst carries the header" "first line: $(head -1 "$R/distfiles.lst")" +fi +if grep -v '^#' "$R/distfiles.lst" | awk 'NF && NF != 4 { n++ } END { exit n ? 1 : 0 }'; then + pass "distfiles.lst has four fields a line below the header" +else + bad "distfiles.lst has four fields a line below the header" \ + "$(grep -v '^#' "$R/distfiles.lst" | awk 'NF && NF != 4' | head -3)" +fi +# afpfs-ng still builds from an upstream archive (unlike the forks that build +# from their tree): its tarball has to be in the list, or the source set +# carries a recipe whose distfile it does not ship. +if grep -q '^filesystems/afpfs-ng ' "$R/distfiles.lst"; then + pass "distfiles.lst carries afpfs-ng's archive" +else + bad "distfiles.lst carries afpfs-ng's archive" "no filesystems/afpfs-ng line" +fi + printf 'result: %s ok, %s bad\n' "$ok" "$fail" [ "$fail" -eq 0 ]