clay: add +get-changes

This commit is contained in:
Philip Monk 2020-04-16 14:05:19 -07:00
parent bc0238fb3a
commit a479618a23
No known key found for this signature in database
GPG Key ID: B66E1F02604E44EC

View File

@ -3392,7 +3392,6 @@
|= [=tako =rang =ankh mim=(map path (unit mime))] |= [=tako =rang =ankh mim=(map path (unit mime))]
|^ |^
^+ ..park ^+ ..park
=. ..park print
=: ank.dom ankh =: ank.dom ankh
let.dom +(let.dom) let.dom +(let.dom)
hit.dom (~(put by hit.dom) +(let.dom) tako) hit.dom (~(put by hit.dom) +(let.dom) tako)
@ -3400,8 +3399,41 @@
hut.ran (~(uni by hut.rang) hut.ran) hut.ran (~(uni by hut.rang) hut.ran)
lat.ran (~(uni by lat.rang) lat.ran) lat.ran (~(uni by lat.rang) lat.ran)
== ==
=/ [deletes=(set path) changes=(set path)]
=/ previous-yaki (aeon-to-yaki:ze (dec let.dom))
=/ next-yaki (aeon-to-yaki:ze let.dom)
(get-changes previous-yaki next-yaki)
=. ..park (emil (print deletes changes))
::
wake:ergo wake:ergo
:: ::
:: Find which files changed or were deleted
::
++ get-changes
|= [old=yaki new=yaki]
:* %- silt ^- (list path)
%+ murn ~(tap by (~(uni by q.old) q.new))
|= [=path =lobe]
^- (unit ^path)
=/ a (~(get by q.new) path)
=/ b (~(get by q.old) path)
?: |(=(a b) !=(~ a))
~
`path
::
%- silt ^- (list path)
%+ murn ~(tap by (~(uni by q.old) q.new))
|= [=path =lobe]
^- (unit ^path)
=/ a (~(get by q.new) path)
=/ b (~(get by q.old) path)
?: |(=(a b) =(~ a))
~
`path
==
::
:: Keep any parts of the ford cache whose dependencies didn't change
::
++ promote-ford ++ promote-ford
|= [=ford-cache deletes=(set path) changes=(map path (each page lobe))] |= [=ford-cache deletes=(set path) changes=(map path (each page lobe))]
^+ ford-cache ^+ ford-cache
@ -3422,6 +3454,8 @@
$(builds t.builds) $(builds t.builds)
(~(put by $(builds t.builds)) i.builds) (~(put by $(builds t.builds)) i.builds)
:: ::
:: Emit update to unix sync
::
++ ergo ++ ergo
^+ ..park ^+ ..park
=/ must (must-ergo:util her syd mon (turn ~(tap by mim) head)) =/ must (must-ergo:util her syd mon (turn ~(tap by mim) head))
@ -3434,21 +3468,25 @@
[(slag len pax) (~(got by mim) pax)] [(slag len pax) (~(got by mim) pax)]
== ==
:: ::
:: Print notification to console
::
++ print ++ print
^+ ..park |= [deletes=(set path) changes=(set path)]
^- (list move)
|^
?~ hun ?~ hun
..park ~
%- emil %+ weld
%+ turn ~(tap by mim) %+ turn ~(tap in deletes)
|= [=path change=(unit mime)] |= =path
=/ car=@tD [u.hun %give %note '-' (path-to-tank path)]
?~ change %+ turn ~(tap in changes)
'-' |= =path
?: (~(has by mim.dom) path) [u.hun %give %note '+' (path-to-tank path)]
':' ::
'+' ++ path-to-tank
=/ =tank |= =path
=/ pre=^path ~[(scot %p our) syd (scot %ud +(let.dom))] =/ pre=^path ~[(scot %p our) syd (scot %ud let.dom)]
:+ %rose ["/" "/" ~] :+ %rose ["/" "/" ~]
%+ turn (weld pre path) %+ turn (weld pre path)
|= a=cord |= a=cord
@ -3456,7 +3494,7 @@
?: ((sane %ta) a) ?: ((sane %ta) a)
[%leaf (trip a)] [%leaf (trip a)]
[%leaf (dash:us (trip a) '\'' ~)] [%leaf (dash:us (trip a) '\'' ~)]
[u.hun %give %note car tank] --
-- --
:: ::
:: Set permissions for a node. :: Set permissions for a node.