$Makronix$ in the files that carry it, and afpfs-ng's archive back
Two things, both found by reading the whole list of files that call
themselves pkgsrc's.
1. The header. `ext/AGENTS.md` now says what the rule is: a file Makronix
wrote carries `#\t$Makronix$' in its first lines, a file taken from pkgsrc
keeps pkgsrc's `$NetBSD: <file>,v <rev> ... Exp $' (the revision says where
it came from), and the unfilled `$NetBSD$' is neither -- it is pkgsrc's
recipe skeleton before the revision is set. Three files carried it:
- ext/src/mcde/pkgsrc-motif/buildlink3.mk, ours throughout
(MCDE_MOTIF_BUILDLINK3_MK, BUILDLINK_TREE mcde-motif, PKGSRCDIR
../../x11/mcde-motif) -- committed there, pushed to kropa.
- PINS: makronix-pins.sh write now writes the header with it, check
still matches.
- distfiles.lst: cmd_list writes three `#' lines; every reader goes
through list_lines() (verify, fetch, stage, the superset merge) and
install-simple.sh skips them, so a comment cannot be read as a package
path. afpfs-ng keeps `$NetBSD: Makefile,v ... wiz Exp $' in its recipe:
that file is upstream's, unchanged (diff against
pkgsrc/filesystems/afpfs-ng is empty), not the template.
2. afpfs-ng's tarball was missing from distfiles.lst. gen_list dropped every
recipe under ext/ -- written when all of them build from their tree -- but
afpfs-ng still builds from afpfs-ng-0.8.1.tar.gz, so the source set
carried a recipe whose distfile it did not. The filter now drops only a
recipe with `DISTFILES= # empty' (the eight that build from ext/src/<name>)
and keeps the one with an archive. distfiles.lst: 2088 archives.
install-simple.sh counted `stage's fork lines on top of distfiles.lst; that
command is gone (nothing is fetched or staged for a tree recipe), the
archive now counts in distfiles.lst itself.
Tested: tools/test-tools.sh 42 ok, 0 bad (six cases added: the header rule
over ext/src/*/pkgsrc*, distfiles.lst's header, four fields a line, afpfs-ng
present). makronix-pins.sh check matches; makronix-distfiles.sh list, verify,
check, stage all green; stage carries distfiles/afpfs-ng-0.8.1.tar.gz and none
of the tree recipes; bmake -C pkgsrc/wm/mcde -V MOTIFLIB still resolves through
mcde-motif's buildlink3.mk.
This commit is contained in:
1 parent
c4836c7213
commit
1529fce6db
9 files changed
+115
-28
No files matched your search
@@ -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
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
# $Makronix$
|
||||
# <pkgpath> <path below DISTDIR> <size in bytes> <sha512>
|
||||
# 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
|
||||
|
||||
Binary file not shown.
@@ -40,6 +40,21 @@ its recipe in `pkgsrc-<part>/` and becomes `<category>/<name>-<part>`
|
||||
- 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: <file>,v <rev> ... 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
|
||||
|
||||
+1
-1
Submodule ext/src/mcde updated: 91967e9f0d...7dd90490b4.
@@ -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
|
||||
|
||||
+43
-22
@@ -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/<name>, which is in the repository and travels with the source
|
||||
# set (ext/src/<name>/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/<name> into
|
||||
# WRKSRC (ext/src/<name>/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/<name> 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$' \
|
||||
'# <pkgpath> <path below DISTDIR> <size in bytes> <sha512>' \
|
||||
'# 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")"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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/<name>/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 ]
|
||||
Reference in new issue
Block a user