mirror of
https://github.com/urbit/shrub.git
synced 2024-12-20 09:21:42 +03:00
clay: extend %tomb to delete all unneeded blobs
This commit is contained in:
parent
ee3951e2df
commit
90098067f2
@ -773,7 +773,7 @@
|
|||||||
[%park des=desk yok=yoki ran=rang] :: synchronous commit
|
[%park des=desk yok=yoki ran=rang] :: synchronous commit
|
||||||
[%perm des=desk pax=path rit=rite] :: change permissions
|
[%perm des=desk pax=path rit=rite] :: change permissions
|
||||||
[%pork ~] :: resume commit
|
[%pork ~] :: resume commit
|
||||||
[%tomb =lobe] :: tombstone specific
|
[%tomb =clue] :: tombstone specific
|
||||||
$>(%trim vane-task) :: trim state
|
$>(%trim vane-task) :: trim state
|
||||||
$>(%vega vane-task) :: report upgrade
|
$>(%vega vane-task) :: report upgrade
|
||||||
[%warp wer=ship rif=riff] :: internal file req
|
[%warp wer=ship rif=riff] :: internal file req
|
||||||
@ -808,6 +808,10 @@
|
|||||||
[%ud p=@ud] :: number
|
[%ud p=@ud] :: number
|
||||||
== ::
|
== ::
|
||||||
+$ cass [ud=@ud da=@da] :: cases for revision
|
+$ cass [ud=@ud da=@da] :: cases for revision
|
||||||
|
+$ clue :: murder weapon
|
||||||
|
$% [%lobe =lobe] :: specific lobe
|
||||||
|
[%all ~] :: all safe targets
|
||||||
|
== ::
|
||||||
+$ crew (set ship) :: permissions group
|
+$ crew (set ship) :: permissions group
|
||||||
+$ dict [src=path rul=real] :: effective permission
|
+$ dict [src=path rul=real] :: effective permission
|
||||||
+$ dome :: project state
|
+$ dome :: project state
|
||||||
|
@ -4402,50 +4402,7 @@
|
|||||||
abet:(perm:den pax.req rit.req)
|
abet:(perm:den pax.req rit.req)
|
||||||
[mos ..^$]
|
[mos ..^$]
|
||||||
::
|
::
|
||||||
%tomb
|
%tomb (tomb clue.req)
|
||||||
=/ 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 ~)
|
|
||||||
[~ ..^$]
|
|
||||||
::
|
|
||||||
%trim [~ ..^$]
|
%trim [~ ..^$]
|
||||||
::
|
::
|
||||||
%vega
|
%vega
|
||||||
@ -5165,4 +5122,77 @@
|
|||||||
blobs+&+lat.ran.ruf
|
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) ..^^^$)
|
||||||
|
--
|
||||||
--
|
--
|
||||||
|
Loading…
Reference in New Issue
Block a user