From 292506ec985fb077d5b0e8bb788d77a64079e560 Mon Sep 17 00:00:00 2001 From: Michal Date: Sun, 9 Aug 2026 20:07:55 +0100 Subject: [PATCH] fix(install): rebuild when any packaged input changes, not just src/*.ts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit installlocal.sh decided the package was up to date by looking only for `src/**/*.ts` newer than it. nfpm.yaml also packages stack/claude-vllm, the shell completions and the systemd unit — none of which are TypeScript — so editing any of those installed a stale package that reported success. Caught by claude-vllm's new --init being absent from /usr/bin after a clean install. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01BVwuCjuMoA13gmzYEfcrNP --- installlocal.sh | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/installlocal.sh b/installlocal.sh index 0418811..a68de85 100755 --- a/installlocal.sh +++ b/installlocal.sh @@ -28,6 +28,14 @@ fi echo "==> Detected package format: $PKG_FORMAT (arch: $NFPM_ARCH)" +# Any packaged input newer than $1. Mirrors nfpm.yaml's `contents:` — keep the +# two in step, or the build silently serves a stale binary again. +newer_inputs() { + find src/ -name '*.ts' -newer "$1" 2>/dev/null | head -1 + find stack/ completions/ deploy/ -type f -newer "$1" 2>/dev/null | head -1 + find nfpm.yaml -newer "$1" 2>/dev/null | head -1 +} + # Find package matching the target architecture # RPM uses x86_64/aarch64, DEB uses amd64/arm64 find_pkg() { @@ -38,8 +46,11 @@ find_pkg() { if [ "$PKG_FORMAT" = "rpm" ]; then PKG_FILE=$(find_pkg "dist/mcpctl-*.rpm") - # Build if no package exists or if source is newer - if [[ -z "$PKG_FILE" ]] || [[ $(find src/ -name '*.ts' -newer "$PKG_FILE" 2>/dev/null | head -1) ]]; then + # Build if no package exists or if any PACKAGED input is newer. + # Watching only src/*.ts silently shipped a stale package whenever a + # non-TypeScript artifact changed — stack/claude-vllm, the completions, the + # systemd unit are all in nfpm.yaml's contents and none of them are .ts. + if [[ -z "$PKG_FILE" ]] || [[ $(newer_inputs "$PKG_FILE") ]]; then echo "==> Building RPM..." bash scripts/build-rpm.sh PKG_FILE=$(find_pkg "dist/mcpctl-*.rpm") @@ -52,8 +63,11 @@ if [ "$PKG_FORMAT" = "rpm" ]; then else PKG_FILE=$(find_pkg "dist/mcpctl*.deb") - # Build if no package exists or if source is newer - if [[ -z "$PKG_FILE" ]] || [[ $(find src/ -name '*.ts' -newer "$PKG_FILE" 2>/dev/null | head -1) ]]; then + # Build if no package exists or if any PACKAGED input is newer. + # Watching only src/*.ts silently shipped a stale package whenever a + # non-TypeScript artifact changed — stack/claude-vllm, the completions, the + # systemd unit are all in nfpm.yaml's contents and none of them are .ts. + if [[ -z "$PKG_FILE" ]] || [[ $(newer_inputs "$PKG_FILE") ]]; then echo "==> Building DEB..." bash scripts/build-deb.sh PKG_FILE=$(find_pkg "dist/mcpctl*.deb")