src/sha/dump.bend relies on unsafe/foreign
raw source on the hub · import 0x886223f5c47e4983fe57d887c034bc7f/src/sha/dump.bend as Dump
sha/dump: a directory read off the disk and handed to sha/nar, which builds
its NAR and names it. The listing is one find, run through snap's foreign
effect, and every regular file is then read. This half lives apart from
sha/nar because bend 2.0.32 fails a proof whose imports reach foreign code,
so a law may import sha/nar but never this.
4 imports
import Base import 0xabe575924687afad4cee1a2c1194d639/main.bend as R import ../io/file.bend as F import ./nar.bend as Nar
Definitions
def said source · line 12 · raw
@ok:Bool -> @+why:String -> @+text:String -> IO(String)
a command's output as it printed it, or the walk stopped with why it failed
def printed.at source · line 21 · raw
@ends:Bool -> @tail:String -> @rest:(@_:Unit -> String) -> String
what a program printed, with the status line in front of it taken off and nothing else touched
def printed source · line 29 · raw
@out:String -> String
the output after its first newline
def under.top source · line 37 · raw
@+top:String -> @+at:String -> String
a path of the tree, as the file effect is to open it
def file.got source · line 40 · raw
@got:Maybe<&2, String> -> @+path:String -> IO(String)
def file.of source · line 48 · raw
@+path:String -> IO(String)
a regular file's text, by its path from the top
def ent.other source · line 55 · raw
@known:Bool -> @+kind:String -> @+name:String -> @+at:String -> @+target:String -> @+path:String -> IO(0x886223f5c47e4983fe57d887c034bc7f/src/sha/nar.Ent)
a path of the listing with what the NAR needs of it: a file's text read, a symlink's target as the listing printed it
def ent.read source · line 70 · raw
@file:Bool -> @+kind:String -> @+mode:String -> @+name:String -> @+at:String -> @+target:String -> @+path:String -> IO(0x886223f5c47e4983fe57d887c034bc7f/src/sha/nar.Ent)
a regular file's text read, or anything else as the listing gave it
def ent.of source · line 89 · raw
@+top:String -> @row:0x886223f5c47e4983fe57d887c034bc7f/src/sha/nar.Row -> IO(0x886223f5c47e4983fe57d887c034bc7f/src/sha/nar.Ent)
one path of the listing, read
def ents source · line 94 · raw
@+top:String -> @rs:List<&2, 0x886223f5c47e4983fe57d887c034bc7f/src/sha/nar.Row> -> IO(List<&2, 0x886223f5c47e4983fe57d887c034bc7f/src/sha/nar.Ent>)
every path of the listing, read
def built source · line 105 · raw
@got:Maybe<&2, String> -> @+path:String -> IO(String)
the tree's node, or the walk stopped when the listing made none
def dump source · line 113 · raw
@+path:String -> IO(String)
the NAR serial of one path
def path source · line 121 · raw
@+work:String -> IO(String)
the SRI narHash of a path, the same string nix hash path --sri prints