From a017c02c4f92827867ecbbba79cef31b23e8f67d Mon Sep 17 00:00:00 2001 From: John Franklin Date: Thu, 27 Apr 2023 18:23:34 -0500 Subject: [PATCH 1/2] hood: +report-vat: handle desks with multiple base hashes (=verb |) --- pkg/base-dev/sur/hood.hoon | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/pkg/base-dev/sur/hood.hoon b/pkg/base-dev/sur/hood.hoon index f186235821..322382e749 100644 --- a/pkg/base-dev/sur/hood.hoon +++ b/pkg/base-dev/sur/hood.hoon @@ -16,6 +16,12 @@ :: +$ sync-state [nun=@ta kid=(unit desk) let=@ud] +$ sink (unit [her=@p sud=desk kid=(unit desk) let=@ud]) +:: +truncate-hash: get last 5 digits of hash and convert to tape +:: +++ truncate-hash + |= hash=@uv + ^- tape + (slag 2 <`@uv`(mod hash 0v1.00000)>) :: +report-prep: get data required for reports :: ++ report-prep @@ -138,10 +144,13 @@ |= [=weft =tape] (welp " {<[lal num]:weft>}" tape) ?. verb - =/ base-hash ?.(=(1 (lent meb)) <(head meb)>) + =/ cut=(list tape) (turn meb truncate-hash) + =/ base-hash + ?: =(1 (lent cut)) (head cut) + "~[{`tape`(zing (join " " `(list tape)`cut))}]" :~ leaf/"/sys/kelvin: {kul}" - leaf/"base hash ends in: {(slag (sub (lent base-hash) 5) base-hash)}" - leaf/"%cz hash ends in: {(slag (sub (lent ) 5) )}" + leaf/"base hash ends in: {base-hash}" + leaf/"%cz hash ends in: {(truncate-hash hash)}" leaf/"app status: {sat}" leaf/"pending updates: {<`(list [@tas @ud])`~(tap in wic.dek)>}" == From 249eb50d4207c95123600d2a55ed32d54c59a90f Mon Sep 17 00:00:00 2001 From: John Franklin Date: Thu, 27 Apr 2023 20:10:53 -0500 Subject: [PATCH 2/2] hood: +report-vat: handle desks with null base hash (=verb |) --- pkg/base-dev/sur/hood.hoon | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/base-dev/sur/hood.hoon b/pkg/base-dev/sur/hood.hoon index 322382e749..e103a199cf 100644 --- a/pkg/base-dev/sur/hood.hoon +++ b/pkg/base-dev/sur/hood.hoon @@ -145,8 +145,10 @@ (welp " {<[lal num]:weft>}" tape) ?. verb =/ cut=(list tape) (turn meb truncate-hash) + =/ len (lent cut) =/ base-hash - ?: =(1 (lent cut)) (head cut) + ?: =(0 len) "~" + ?: =(1 len) (head cut) "~[{`tape`(zing (join " " `(list tape)`cut))}]" :~ leaf/"/sys/kelvin: {kul}" leaf/"base hash ends in: {base-hash}"