clay: extend %tomb to delete all unneeded blobs

This commit is contained in:
Philip Monk 2022-03-26 14:37:46 -07:00
parent ee3951e2df
commit 90098067f2
2 changed files with 79 additions and 45 deletions

View File

@ -773,7 +773,7 @@
[%park des=desk yok=yoki ran=rang] :: synchronous commit
[%perm des=desk pax=path rit=rite] :: change permissions
[%pork ~] :: resume commit
[%tomb =lobe] :: tombstone specific
[%tomb =clue] :: tombstone specific
$>(%trim vane-task) :: trim state
$>(%vega vane-task) :: report upgrade
[%warp wer=ship rif=riff] :: internal file req
@ -808,6 +808,10 @@
[%ud p=@ud] :: number
== ::
+$ cass [ud=@ud da=@da] :: cases for revision
+$ clue :: murder weapon
$% [%lobe =lobe] :: specific lobe
[%all ~] :: all safe targets
== ::
+$ crew (set ship) :: permissions group
+$ dict [src=path rul=real] :: effective permission
+$ dome :: project state

View File

@ -4402,50 +4402,7 @@
abet:(perm:den pax.req rit.req)
[mos ..^$]
::
%tomb
=/ used=(unit beam)
=/ desks=(list [=desk =dojo]) ~(tap by dos.rom.ruf)
|-
=* desk-loop $
?~ desks
~
?: =(0 let.dom.dojo.i.desks)
desk-loop(desks t.desks)
=/ =yaki
%- ~(got by hut.ran.ruf)
%- ~(got by hit.dom.dojo.i.desks)
let.dom.dojo.i.desks
=/ paths=(list [=path =lobe]) ~(tap by q.yaki)
|-
=* path-loop $
?~ paths
desk-loop(desks t.desks)
?: =(lobe.req lobe.i.paths)
`[[our desk.i.desks ud+let.dom.dojo.i.desks] path.i.paths]
path-loop(paths t.paths)
::
?^ used
%- (slog leaf+"clay: file used in {<(en-beam u.used)>}" ~)
[~ ..^$]
::
=/ based=(unit lobe)
=/ lobes=(list [=lobe =blob]) ~(tap by lat.ran.ruf)
|-
?~ lobes
~
?: ?& ?=(%delta -.blob.i.lobes)
=(lobe.req q.q.blob.i.lobes)
==
`p.blob.i.lobes
$(lobes t.lobes)
::
?^ based
%- (slog leaf+"clay: file is base of delta for {<u.based>}" ~)
[~ ..^$]
::
=. lat.ran.ruf (~(put by lat.ran.ruf) lobe.req %dead lobe.req ~)
[~ ..^$]
::
%tomb (tomb clue.req)
%trim [~ ..^$]
::
%vega
@ -5165,4 +5122,77 @@
blobs+&+lat.ran.ruf
==
==
:: +tomb: safely remove objects
::
++ tomb
|= =clue
^- [(list move) _..^$]
|^
?- -.clue
%lobe `(tomb-lobe lobe.clue &)
%all
=/ lobes=(list [=lobe =blob]) ~(tap by lat.ran.ruf)
|-
?~ lobes
`..^^^$
=. ..^^^$ (tomb-lobe lobe.i.lobes &)
$(lobes t.lobes)
==
::
++ tomb-lobe
|= [lob=lobe veb=?]
^+ ..^^^$
=/ bol (~(get by lat.ran.ruf) lob)
?~ bol
(noop veb leaf+"clay: lobe doesn't exist" ~)
?: ?=(%dead -.u.bol)
(noop veb leaf+"clay: file already tombstoned" ~)
::
=/ used=(unit beam)
=/ desks=(list [=desk =dojo]) ~(tap by dos.rom.ruf)
|-
=* desk-loop $
?~ desks
~
?: =(0 let.dom.dojo.i.desks)
desk-loop(desks t.desks)
=/ =yaki
%- ~(got by hut.ran.ruf)
%- ~(got by hit.dom.dojo.i.desks)
let.dom.dojo.i.desks
=/ paths=(list [=path =lobe]) ~(tap by q.yaki)
|-
=* path-loop $
?~ paths
desk-loop(desks t.desks)
?: =(lob lobe.i.paths)
`[[our desk.i.desks ud+let.dom.dojo.i.desks] path.i.paths]
path-loop(paths t.paths)
::
?^ used
(noop veb leaf+"clay: file used in {<(en-beam u.used)>}" ~)
::
=/ based=(unit lobe)
=/ lobes=(list [=lobe =blob]) ~(tap by lat.ran.ruf)
|-
?~ lobes
~
?: ?& ?=(%delta -.blob.i.lobes)
=(lob q.q.blob.i.lobes)
==
`p.blob.i.lobes
$(lobes t.lobes)
::
?^ based
(noop veb leaf+"clay: file is base of delta for {<u.based>}" ~)
::
=. lat.ran.ruf (~(put by lat.ran.ruf) lob %dead lob ~)
(noop veb leaf+"clay: file successfully tombstoned" ~)
::
++ noop
|= [veb=? =tang]
?. veb
..^^^$
((slog tang) ..^^^$)
--
--