ports: zsh reinstalled on every make, and eventually stopped working

licence-check is .PHONY, and I had put it on the left of the colon as a
prerequisite of the install rule. A phony prerequisite is always out of date,
so `make` reinstalled the whole of zsh every single time -- slow, and
eventually fatal: zsh's installfns.sh trips over the installfnsdir its own
previous run left behind, so the build failed outright with

    install: cannot stat 'installfnsdir/_vcs_info_hooks'

It runs inside the rule now, which is what it always should have done, and the
stale directory is removed first.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VQ7Qx8E1q1M1bbCq8QLHS2
This commit is contained in:
Nexoniarz 2026-09-13 13:57:26 +02:00
commit 6ff84e5bf4

View file

@ -195,7 +195,15 @@ licence-check: | $(SRCDIR)
if [ $$bad -ne 0 ]; then echo "zsh: refusing to install" >&2; exit 1; fi; \
echo "zsh: no GPL-licensed files in the tree"
$(SYSROOT)/bin/zsh: $(BUILDDIR)/Src/zsh licence-check | $(SYSROOT)/bin
# licence-check runs *inside* the rule, not as a prerequisite.
#
# It is .PHONY, and a phony prerequisite is always out of date -- so having it
# on the left of the colon re-ran the whole install on every `make`, which is
# slow, and which eventually failed outright when zsh's installfns.sh tripped
# over the installfnsdir its previous run had left behind.
$(SYSROOT)/bin/zsh: $(BUILDDIR)/Src/zsh | $(SYSROOT)/bin
$(MAKE) licence-check
rm -rf $(BUILDDIR)/installfnsdir
$(MAKE) -C $(BUILDDIR) install DESTDIR=$(SYSROOT)
rm -rf $(SYSROOT)/usr/share/man $(SYSROOT)/usr/share/zsh/$(ZSH_VERSION)/help
chmod 755 $@