2023-02-10 07:48:30 +03:00
|
|
|
:: Perform minimal norm change to delete a file, use =dry & for dry run
|
2022-04-09 07:20:02 +03:00
|
|
|
::
|
2023-02-10 07:48:30 +03:00
|
|
|
/+ *generators
|
|
|
|
=, space:userlib
|
2022-05-15 08:49:10 +03:00
|
|
|
=, clay
|
2023-02-10 07:48:30 +03:00
|
|
|
:- %ask
|
2022-04-09 07:20:02 +03:00
|
|
|
|= [[now=@da eny=@uvJ bec=beak] [target=path ~] dry=_|]
|
2022-11-06 04:21:18 +03:00
|
|
|
|^
|
2022-05-15 08:49:10 +03:00
|
|
|
=+ .^(=rang %cx /(scot %p p.bec)//(scot %da now)/rang)
|
|
|
|
=+ .^(=cone %cx /(scot %p p.bec)//(scot %da now)/domes)
|
2023-02-10 07:48:30 +03:00
|
|
|
=/ =beam (need (de-beam target))
|
|
|
|
=/ dusk=desk q:beam
|
2023-02-09 19:35:17 +03:00
|
|
|
=/ domes=(list [[=ship =desk] foam])
|
2022-05-15 08:49:10 +03:00
|
|
|
~(tap by cone)
|
2023-02-10 07:48:30 +03:00
|
|
|
=+ .^(=cass %cw (en-beam beam(r da+now)))
|
|
|
|
=+ .^(do=dome %cv target)
|
|
|
|
=/ used=(list [desk path])
|
|
|
|
=- (murn lobes -)
|
|
|
|
|= lob=lobe
|
|
|
|
^- (unit [desk path])
|
|
|
|
=/ doms=(list [[=ship =desk] foam]) domes
|
|
|
|
|-
|
|
|
|
=* dome-loop $
|
|
|
|
?~ doms ~
|
|
|
|
?: =(0 let.i.doms) dome-loop(doms t.doms)
|
|
|
|
?: =(dusk desk.i.doms) dome-loop(doms t.doms)
|
|
|
|
=/ latest=yaki
|
|
|
|
%- ~(got by hut.rang)
|
|
|
|
%- ~(got by hit.i.doms)
|
|
|
|
let.i.doms
|
|
|
|
=/ yakies=(list [=path =lobe]) ~(tap by q.latest)
|
|
|
|
|-
|
|
|
|
=* path-loop $
|
|
|
|
?~ yakies dome-loop(doms t.doms)
|
|
|
|
?: =(lob lobe.i.yakies)
|
|
|
|
`[desk.i.doms path.i.yakies]
|
|
|
|
path-loop(yakies t.yakies)
|
|
|
|
?: |(=(let.do ud.cass) !=(0 (lent used)))
|
|
|
|
%+ print (rap 3 'used in ' (crip <?~(used dusk used)>) ' already.' ~)
|
|
|
|
%+ prompt [%& %prompt "|rm from head of {<dusk>}? (y/N) "]
|
|
|
|
|= in=tape
|
|
|
|
?. |(=("y" in) =("Y" in) =("yes" in))
|
|
|
|
%+ prompt [%& %prompt "|rm from head of each desk instead? (y/N) "]
|
|
|
|
|= inn=tape
|
|
|
|
?. |(=("y" inn) =("Y" inn) =("yes" inn))
|
|
|
|
no-product
|
|
|
|
(produce %helm-pans (turn used |=([=desk =path] (rm (en-beam beam(q desk, s path))))))
|
|
|
|
(produce %helm-pans ~[(rm (en-beam beam(q dusk, s +>+:target)))])
|
|
|
|
::
|
|
|
|
%- produce
|
|
|
|
:- %helm-pans
|
|
|
|
=- (snoc `(list note-arvo)`- [%c %tomb [%pick ~]])
|
2022-11-06 04:21:18 +03:00
|
|
|
%- zing
|
|
|
|
=- (turn - notes)
|
|
|
|
=- (turn lobes -)
|
|
|
|
|= =lobe
|
2022-04-09 07:20:02 +03:00
|
|
|
|^
|
2022-05-15 08:49:10 +03:00
|
|
|
|- ^- (set [ship desk tako norm path])
|
2022-04-09 07:20:02 +03:00
|
|
|
?~ domes
|
|
|
|
~
|
2022-05-15 08:49:10 +03:00
|
|
|
=/ =aeon 1
|
2022-04-09 07:20:02 +03:00
|
|
|
%- ~(uni in $(domes t.domes))
|
2022-05-15 08:49:10 +03:00
|
|
|
|- ^- (set [ship desk tako norm path])
|
2022-09-14 04:52:32 +03:00
|
|
|
?: (lth let.i.domes aeon)
|
2022-04-09 07:20:02 +03:00
|
|
|
~
|
2022-09-14 04:52:32 +03:00
|
|
|
=/ =tako (~(got by hit.i.domes) aeon)
|
2022-05-15 08:49:10 +03:00
|
|
|
=/ paths (draw-tako ship.i.domes desk.i.domes +.i.domes tako)
|
2022-04-09 07:20:02 +03:00
|
|
|
(~(uni in paths) $(aeon +(aeon)))
|
|
|
|
::
|
|
|
|
++ draw-tako
|
2022-09-14 04:52:32 +03:00
|
|
|
|= [=ship =desk foam =tako]
|
2022-05-15 08:49:10 +03:00
|
|
|
^- (set [^ship ^desk ^tako norm path])
|
2022-04-09 07:20:02 +03:00
|
|
|
~+
|
2022-05-15 08:49:10 +03:00
|
|
|
=/ =yaki (~(got by hut.rang) tako)
|
2022-04-09 07:20:02 +03:00
|
|
|
=/ takos
|
2022-05-15 08:49:10 +03:00
|
|
|
|- ^- (set [^ship ^desk ^tako norm path])
|
2022-04-09 07:20:02 +03:00
|
|
|
?~ p.yaki
|
|
|
|
~
|
|
|
|
(~(uni in $(p.yaki t.p.yaki)) ^$(tako i.p.yaki))
|
2022-05-15 08:49:10 +03:00
|
|
|
|- ^- (set [^ship ^desk ^tako norm path])
|
2022-04-09 07:20:02 +03:00
|
|
|
?~ q.yaki
|
|
|
|
takos
|
|
|
|
%- ~(uni in $(q.yaki l.q.yaki))
|
|
|
|
%- ~(uni in $(q.yaki r.q.yaki))
|
2022-05-15 08:49:10 +03:00
|
|
|
^- (set [^ship ^desk ^tako norm path])
|
2022-04-09 07:20:02 +03:00
|
|
|
?. =(lobe q.n.q.yaki)
|
|
|
|
~
|
2022-05-15 08:49:10 +03:00
|
|
|
[[ship desk tako (~(gut by tom) tako nor) p.n.q.yaki] ~ ~]
|
2022-04-09 07:20:02 +03:00
|
|
|
--
|
2022-11-06 04:21:18 +03:00
|
|
|
::
|
|
|
|
++ lobes
|
2023-02-10 07:48:30 +03:00
|
|
|
=| lubs=(list lobe)
|
|
|
|
|- ^- (list lobe)
|
|
|
|
=+ b=.^(arch %cy target)
|
|
|
|
?: ?=([^ ~] b) (snoc lubs u.fil.b)
|
2023-02-09 19:35:17 +03:00
|
|
|
%- zing
|
2023-02-10 07:48:30 +03:00
|
|
|
%+ turn ~(tap by dir.b)
|
2023-02-09 19:35:17 +03:00
|
|
|
|= [kid=@ta ~]
|
2023-02-10 07:48:30 +03:00
|
|
|
^$(target (weld target /[kid]))
|
2022-11-06 04:21:18 +03:00
|
|
|
::
|
|
|
|
++ notes
|
|
|
|
|= norms=(set [ship desk tako norm path])
|
|
|
|
^- (list note-arvo)
|
2022-04-13 07:02:37 +03:00
|
|
|
%+ murn ~(tap in norms)
|
2022-05-15 08:49:10 +03:00
|
|
|
|= [=ship =desk =tako =norm =path]
|
2022-04-23 03:55:42 +03:00
|
|
|
?: ?=([~ %|] (~(fit of norm) path))
|
2022-04-13 07:02:37 +03:00
|
|
|
~
|
2022-04-09 07:20:02 +03:00
|
|
|
%- (slog leaf+"tomb: {<ship desk path `@uv`tako norm path>}" ~)
|
|
|
|
?: dry
|
2022-04-13 07:02:37 +03:00
|
|
|
~
|
2022-04-23 03:55:42 +03:00
|
|
|
`[%c %tomb %worn ship desk tako (~(put of norm) path %|)]
|
2023-02-10 07:48:30 +03:00
|
|
|
::
|
|
|
|
++ info
|
|
|
|
|= tor=(unit toro)
|
|
|
|
^- note-arvo
|
|
|
|
~| [%tomb-error "tomb: failed to delete {<target>}"]
|
|
|
|
[%c [%info (need tor)]]
|
|
|
|
::
|
|
|
|
++ rm
|
|
|
|
|= a=path
|
|
|
|
=| c=(list (unit toro))
|
|
|
|
%- info
|
|
|
|
=- %+ roll -
|
|
|
|
|= [a=(unit toro) b=(unit toro)]
|
|
|
|
(clap a b furl)
|
|
|
|
|- ^- (list (unit toro))
|
|
|
|
=+ b=.^(arch %cy a)
|
|
|
|
?: ?=([^ ~] b) (snoc c `(fray a))
|
|
|
|
=? c ?=(^ fil.b) (snoc c `(fray a))
|
|
|
|
%- zing
|
|
|
|
%+ turn ~(tap by dir.b)
|
|
|
|
|= [kid=@ta ~]
|
|
|
|
^$(a (weld a /[kid]))
|
2022-11-06 04:21:18 +03:00
|
|
|
--
|