def tool.pin
import ezx@1.11.0.0/src/lock/up.bend as Upimport Base
import ezx@1.11.0.0/src/ledger/manifest.bend as M
869# a commit and its NAR hash written into the pin. A pin with either one empty
870# is short, and an upgrade that wrote one would fill it again on the next run,
871# so a weighing that names no commit or no NAR hash pins nothing.
872def tool.pin(short: Bool, +tool: M.Tool, +rev: String, +tag: String, +nar: String, says: List<&2, String>) -> Pinned:
873 match short:
874 case True{}:
875 PinHalt{"ez: tools." ++ M.tool.name(tool) ++ ": weighing " ++ rev ++ " gave no narHash"}
876 case False{}:
877 Pinned{set(tool, rev, tag, nar), True{}, says}