diff --git a/tools/pkgchroot.sh b/tools/pkgchroot.sh index 5c8642deac..e2e2ceae19 100755 --- a/tools/pkgchroot.sh +++ b/tools/pkgchroot.sh @@ -79,9 +79,13 @@ sandbox_mount() # into /usr/pkg -- which, inside the chroot, is the sysroot's /usr/pkg. sandbox_run() { - c=$1 - p=${1%/*} - mkdir -p "$SB/work/$p" + # The names are prefixed on purpose: a plain `p=$1` here overwrote the + # caller's loop variable, so `force wm/mcde` ran its second sandbox_run + # with p=wm and reinstalled the whole category instead of the package + # (measured 2026-11-22, the MacBook began to build 2bwm and afterstep). + sr_path=$1 + sr_dir=${1%/*} + mkdir -p "$SB/work/$sr_dir" # docbook's stylesheets are local: without the catalog libxslt resolves the # URL in the stylesheet PI and stops with "failed to load external entity # http://docbook.sourceforge.net/..." when the build host has no route to it @@ -93,7 +97,7 @@ sandbox_run() HOME=/mnt/work \ TMPDIR=/mnt/tmp \ XML_CATALOG_FILES=$catalog \ - /usr/bin/make -C "/mnt/pkgsrc/$c" \ + /usr/bin/make -C "/mnt/pkgsrc/$sr_path" \ WRKOBJDIR=/mnt/work \ PACKAGES=/mnt/packages \ DISTDIR=/mnt/distfiles \