def hash.ok
import ezx@1.11.0.0/src/ledger/render.bend as Renderimport Base
import ezx@1.11.0.0/src/ledger/manifest.bend as M
179# whether a dependency's hash can be written: one is there, which the reader
180# asks every dependency for but a workspace member's, whose ledger records
181# none and whose hash only the joint ledger gives
182def hash.ok(src: M.Source, +hash: String) -> Bool:
183 match src:
184 case M.Hub{_named}:
185 Bool.and(Bool.not(String.is_empty(hash)), clean(hash))
186 case M.Git{_url, _rev, _tag, _root, _nar, _vend}:
187 Bool.and(Bool.not(String.is_empty(hash)), clean(hash))
188 case M.Member{_path, _named}:
189 clean(hash)