diff --git a/publishing/build.sh b/publishing/build.sh index b30dec0..2e33be6 100755 --- a/publishing/build.sh +++ b/publishing/build.sh @@ -53,7 +53,10 @@ check_toolchain() { case "$req" in ''|\#*) continue ;; esac pkg="${req%%[=<>!~]*}" case "$req" in *==*) want="${req#*==}" ;; *) want="" ;; esac - have="$("$VENV/bin/pip" show "$pkg" 2>/dev/null | sed -n 's/^Version: //p')" + # NB: the substitution must not fail the script under `set -euo pipefail` + # when the package is absent — a missing package is exactly the case this + # gate exists to heal, not an error to die on. + have="$({ "$VENV/bin/pip" show "$pkg" 2>/dev/null || true; } | sed -n 's/^Version: //p')" if [ -z "$have" ] || { [ -n "$want" ] && [ "$have" != "$want" ]; }; then missing="$missing ${pkg}(${want:-any}; have: ${have:-none})" fi