From 1e4ac1135cd794d78e9ea7c4f87f83e2bd4bb142 Mon Sep 17 00:00:00 2001 From: lotherk Date: Tue, 24 Nov 2026 07:04:11 +0000 Subject: [PATCH] pkgchroot: the staleness key survives a recipe without options.mk Under set -e the cat of the absent options.mk ended the key's group before the source id was written: a commit in ext/src/mcde never changed the key, so the MacBook kept building the old work directory (UilLexPars.h: File exists, three runs). Optional files get '|| :'; find -L, because the recipe mirror is symlinks and PLIST/patches were not hashed. Co-Authored-By: Claude Sonnet 5.5 --- tools/pkgchroot.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/pkgchroot.sh b/tools/pkgchroot.sh index b80403424e..4723f3446a 100755 --- a/tools/pkgchroot.sh +++ b/tools/pkgchroot.sh @@ -198,11 +198,15 @@ sandbox_stale() elif [ -f "$TOP/pkgsrc/$sr_path/distinfo" ]; then srcid=$(sha256_in < "$TOP/pkgsrc/$sr_path/distinfo") fi + # `|| :' on every optional file: this script runs under `set -e', and a + # recipe without options.mk made cat fail and end the group before the + # source id was printed, so the commit never reached the key (measured + # 2026-11-24, x11/mcde-motif). find -L: a mirrored recipe is symlinks. key=$( { cat "$TOP/pkgsrc/$sr_path"/Makefile \ - "$TOP/pkgsrc/$sr_path"/options.mk 2>/dev/null - find "$TOP/pkgsrc/$sr_path" -type f \( -name '*.patch' -o -name 'PLIST*' \) \ - -exec cat {} + 2>/dev/null - cat "$TOP/pkgsrc/$sr_path"/distinfo 2>/dev/null + "$TOP/pkgsrc/$sr_path"/options.mk 2>/dev/null || : + find -L "$TOP/pkgsrc/$sr_path" -type f \( -name '*.patch' -o -name 'PLIST*' \) \ + -exec cat {} + 2>/dev/null || : + cat "$TOP/pkgsrc/$sr_path"/distinfo 2>/dev/null || : printf '%s\n' "$srcid" } | sha256_in ) kf=$TOP/build/pkgsrc-work/$sr_path/.makronix-build-key