2020-12-02 09:27:52 +03:00
|
|
|
/+ version
|
2016-12-07 06:13:33 +03:00
|
|
|
=, clay
|
2016-12-02 02:59:17 +03:00
|
|
|
=, space:userlib
|
|
|
|
=, format
|
2020-06-17 09:36:09 +03:00
|
|
|
|%
|
2021-07-01 04:03:47 +03:00
|
|
|
+$ state [%2 pith-2]
|
|
|
|
+$ state-2 state
|
|
|
|
+$ state-1 [%1 pith-1]
|
|
|
|
+$ state-0 [%0 pith-0]
|
2020-06-17 09:36:09 +03:00
|
|
|
+$ any-state
|
2021-07-01 04:03:47 +03:00
|
|
|
$% state-2
|
|
|
|
state-1
|
|
|
|
state-0
|
2020-06-17 09:36:09 +03:00
|
|
|
==
|
2021-07-01 04:03:47 +03:00
|
|
|
+$ pith-2 ::
|
|
|
|
$: rem=(map desk per-desk) ::
|
|
|
|
syn=(map kiln-sync let=@ud) ::
|
|
|
|
ota=(unit [=ship =desk =aeon]) ::
|
|
|
|
ark=(map desk arak) ::
|
|
|
|
commit-timer=[way=wire nex=@da tim=@dr mon=term] ::
|
|
|
|
== ::
|
2020-06-17 09:36:09 +03:00
|
|
|
+$ pith-1 ::
|
|
|
|
$: rem=(map desk per-desk) ::
|
|
|
|
syn=(map kiln-sync let=@ud) ::
|
|
|
|
ota=(unit [=ship =desk =aeon]) ::
|
|
|
|
commit-timer=[way=wire nex=@da tim=@dr mon=term] ::
|
|
|
|
== ::
|
|
|
|
+$ pith-0 ::
|
|
|
|
$: rem=(map desk per-desk) ::
|
|
|
|
syn=(map kiln-sync let=@ud) ::
|
|
|
|
autoload-on=? ::
|
|
|
|
cur-hoon=@uvI ::
|
|
|
|
cur-arvo=@uvI ::
|
|
|
|
cur-zuse=@uvI ::
|
|
|
|
cur-vanes=(map @tas @uvI) ::
|
|
|
|
commit-timer=[way=wire nex=@da tim=@dr mon=term] ::
|
|
|
|
==
|
2021-07-01 04:03:47 +03:00
|
|
|
:: $arak: foreign vat tracker
|
|
|
|
::
|
|
|
|
+$ arak
|
|
|
|
$: =ship
|
|
|
|
=desk
|
|
|
|
=aeon
|
|
|
|
next=(list [=aeon kelvin=[@tas @ud]])
|
|
|
|
==
|
2020-06-17 09:36:09 +03:00
|
|
|
+$ per-desk :: per-desk state
|
|
|
|
$: auto=? :: escalate on failure
|
2020-08-28 10:24:25 +03:00
|
|
|
gem=?(%this %that germ) :: strategy
|
2020-06-17 09:36:09 +03:00
|
|
|
her=@p :: from ship
|
|
|
|
sud=@tas :: from desk
|
|
|
|
cas=case :: at case
|
|
|
|
==
|
|
|
|
+$ kiln-commit term ::
|
|
|
|
+$ kiln-mount ::
|
|
|
|
$: pax=path ::
|
|
|
|
pot=term ::
|
|
|
|
==
|
|
|
|
+$ kiln-unmount $@(term [knot path]) ::
|
|
|
|
+$ kiln-sync ::
|
|
|
|
$: syd=desk ::
|
|
|
|
her=ship ::
|
|
|
|
sud=desk ::
|
|
|
|
==
|
|
|
|
+$ kiln-unsync ::
|
|
|
|
$: syd=desk ::
|
|
|
|
her=ship ::
|
|
|
|
sud=desk ::
|
|
|
|
==
|
|
|
|
+$ kiln-merge ::
|
2020-08-28 10:24:25 +03:00
|
|
|
$@ ~
|
2020-06-17 09:36:09 +03:00
|
|
|
$: syd=desk ::
|
|
|
|
ali=ship ::
|
|
|
|
sud=desk ::
|
|
|
|
cas=case ::
|
2020-08-28 10:24:25 +03:00
|
|
|
gim=?(%auto germ) ::
|
2020-06-17 09:36:09 +03:00
|
|
|
==
|
2021-04-20 06:46:46 +03:00
|
|
|
+$ kiln-fuse
|
2021-05-02 06:04:19 +03:00
|
|
|
$@ ~
|
2021-04-20 06:46:46 +03:00
|
|
|
$: syd=desk
|
2021-04-25 03:50:50 +03:00
|
|
|
bas=beak
|
|
|
|
con=(list [beak germ])
|
2021-04-20 06:46:46 +03:00
|
|
|
==
|
2020-06-17 09:36:09 +03:00
|
|
|
--
|
|
|
|
|= [bowl:gall state]
|
2015-09-02 01:20:17 +03:00
|
|
|
?> =(src our)
|
2020-06-17 09:36:09 +03:00
|
|
|
|_ moz=(list card:agent:gall)
|
2020-06-17 10:54:27 +03:00
|
|
|
+$ state ^state :: proxy
|
|
|
|
+$ any-state ^any-state :: proxy
|
2015-12-09 04:54:26 +03:00
|
|
|
++ abet :: resolve
|
2020-06-17 09:36:09 +03:00
|
|
|
[(flop moz) `state`+<+.$]
|
2015-09-02 01:20:17 +03:00
|
|
|
::
|
2019-11-14 21:39:50 +03:00
|
|
|
++ emit
|
2019-11-19 07:36:21 +03:00
|
|
|
|= card:agent:gall
|
2019-11-14 21:39:50 +03:00
|
|
|
%_(+> moz [+< moz])
|
|
|
|
::
|
|
|
|
++ emil :: return cards
|
2019-11-19 07:36:21 +03:00
|
|
|
|= (list card:agent:gall)
|
2015-09-02 01:20:17 +03:00
|
|
|
^+ +>
|
|
|
|
?~(+< +> $(+< t.+<, +> (emit i.+<)))
|
|
|
|
::
|
|
|
|
++ render
|
2020-11-26 17:09:31 +03:00
|
|
|
|= [mez=tape sud=desk who=ship syd=desk]
|
2020-05-20 11:36:16 +03:00
|
|
|
:^ %palm [" " ~ ~ ~] leaf+(weld "kiln: " mez)
|
2015-12-21 00:16:39 +03:00
|
|
|
~[leaf+"from {<sud>}" leaf+"on {<who>}" leaf+"to {<syd>}"]
|
2015-09-02 01:20:17 +03:00
|
|
|
::
|
2020-06-10 02:21:30 +03:00
|
|
|
++ on-load
|
2020-07-18 02:58:28 +03:00
|
|
|
|= [hood-version=@ud old=any-state]
|
2020-06-10 02:21:30 +03:00
|
|
|
=< abet
|
2020-06-17 09:36:09 +03:00
|
|
|
=? . ?=(%0 -.old)
|
2020-06-10 02:21:30 +03:00
|
|
|
=/ recognized-ota=(unit [syd=desk her=ship sud=desk])
|
|
|
|
=/ syncs=(list [[syd=desk her=ship sud=desk] =aeon])
|
2020-06-17 09:36:09 +03:00
|
|
|
~(tap by syn.old)
|
2020-06-10 02:21:30 +03:00
|
|
|
|- ^- (unit [syd=desk her=ship sud=desk])
|
|
|
|
?~ syncs
|
|
|
|
~
|
|
|
|
?: &(=(%base syd.i.syncs) !=(our her.i.syncs) =(%kids sud.i.syncs))
|
|
|
|
`[syd her sud]:i.syncs
|
|
|
|
$(syncs t.syncs)
|
|
|
|
::
|
2021-07-01 04:03:47 +03:00
|
|
|
=/ sen=(map kiln-sync let=@ud)
|
2020-06-17 09:36:09 +03:00
|
|
|
?~ recognized-ota
|
2021-07-01 04:03:47 +03:00
|
|
|
syn.old
|
|
|
|
(~(del by syn.old) [syd her sud]:u.recognized-ota)
|
|
|
|
:: note that the new state has not yet been initialized
|
2020-06-10 02:21:30 +03:00
|
|
|
::
|
|
|
|
=? ..abet ?=(^ recognized-ota)
|
2021-07-01 04:03:47 +03:00
|
|
|
(poke:update `[her sud]:u.recognized-ota)
|
|
|
|
::
|
|
|
|
+>(old [%1 rem.old syn=sen ota=~ commit-timer.old])
|
2020-06-10 02:21:30 +03:00
|
|
|
::
|
2021-07-01 04:03:47 +03:00
|
|
|
=? old ?=(%1 -.old)
|
|
|
|
:* %2
|
|
|
|
rem.old
|
|
|
|
syn.old
|
|
|
|
ota.old
|
|
|
|
ark=~
|
|
|
|
commit-timer.old
|
|
|
|
==
|
|
|
|
::
|
|
|
|
?> ?=(%2 -.old)
|
2020-06-17 09:36:09 +03:00
|
|
|
=. +<+.$.abet old
|
2020-06-10 02:21:30 +03:00
|
|
|
..abet
|
|
|
|
::
|
2020-07-01 02:10:12 +03:00
|
|
|
++ on-peek
|
|
|
|
|= =path
|
|
|
|
^- (unit (unit cage))
|
2020-12-04 11:37:28 +03:00
|
|
|
?+ path [~ ~]
|
|
|
|
[%x %kiln %ota ~] ``noun+!>(ota)
|
|
|
|
[%x %kiln %our ~] ``noun+!>(our)
|
|
|
|
[%x %kiln %base-hash ~]
|
|
|
|
=/ ver (base-hash:version our now)
|
|
|
|
``noun+!>(?~(ver 0v0 i.ver))
|
2020-12-02 09:27:52 +03:00
|
|
|
==
|
2020-07-01 02:10:12 +03:00
|
|
|
::
|
2021-07-01 04:03:47 +03:00
|
|
|
++ vats
|
|
|
|
|_ [loc=desk rak=arak]
|
|
|
|
::
|
|
|
|
++ abet ..vats(ark (~(put by ark) loc rak))
|
|
|
|
++ abed
|
|
|
|
|= lac=desk
|
|
|
|
~_ leaf/"kiln: {<lac>} not installed"
|
|
|
|
..abet(loc lac, rak (~(got by ark) lac))
|
|
|
|
::
|
|
|
|
++ emit |=(card:agent:gall ..abet(..vats (^emit +<)))
|
|
|
|
++ emil |=((list card:agent:gall) ..abet(..vats (^emil +<)))
|
|
|
|
++ here "{<loc>} from {<[ship desk]:rak>}"
|
|
|
|
++ make-wire |=(step=@tas /kiln/vats/[loc]/[step])
|
|
|
|
++ from-wire
|
|
|
|
|= =wire
|
|
|
|
?> ?=([%kiln %vats @ @ ~] wire)
|
|
|
|
(abed i.t.t.wire)
|
|
|
|
::
|
|
|
|
++ uninstall
|
|
|
|
|= lac=desk
|
|
|
|
^+ ..vats
|
|
|
|
=. ..abet (abed lac)
|
|
|
|
~> %slog.0^leaf/"kiln: uninstalling {here}"
|
|
|
|
:: TODO: ask gall to doze
|
|
|
|
..vats(ark (~(del by ark) lac))
|
|
|
|
::
|
|
|
|
++ install
|
|
|
|
|= [lac=desk her=ship rem=desk]
|
|
|
|
^+ ..abet
|
2021-07-02 02:10:03 +03:00
|
|
|
=/ got (~(get by ark) lac)
|
|
|
|
?: =(`[her rem] got)
|
|
|
|
~> %slog.0^leaf/"kiln: already tracking {here:(abed lac)}, ignoring"
|
|
|
|
..abet
|
|
|
|
=? ..vats ?=(^ got) (uninstall lac)
|
2021-07-01 04:03:47 +03:00
|
|
|
=: loc lac
|
|
|
|
rak [her rem *aeon next=~]
|
|
|
|
==
|
|
|
|
~> %slog.0^leaf/"kiln: beginning install into {here}"
|
|
|
|
%: emit
|
|
|
|
%pass (make-wire %find) %arvo %c
|
|
|
|
%warp ship.rak desk.rak `[%sing %y ud+1 /]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ take
|
|
|
|
|= [=wire syn=sign-arvo]
|
|
|
|
^+ ..abet
|
|
|
|
=. ..abet (from-wire wire)
|
|
|
|
?> ?=([%kiln %vats @ @ ~] wire)
|
|
|
|
?+ i.t.t.t.wire
|
|
|
|
~> %slog.0^leaf/"kiln: vats-bad-take {<t.t.t.wire>}"
|
|
|
|
..abet
|
|
|
|
%find (take-find syn)
|
|
|
|
%sync (take-sync syn)
|
|
|
|
%download (take-download syn)
|
|
|
|
%merge (take-merge syn)
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ take-find
|
|
|
|
|= syn=sign-arvo
|
|
|
|
?> ?=(%writ +<.syn)
|
|
|
|
~> %slog.0^leaf/"kiln: activated install into {here}"
|
|
|
|
%: emit
|
|
|
|
%pass (make-wire %sync) %arvo %c
|
|
|
|
%warp ship.rak desk.rak `[%sing %w da+now /]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ take-sync
|
|
|
|
|= syn=sign-arvo
|
|
|
|
?> ?=(%writ +<.syn)
|
|
|
|
?~ p.syn
|
|
|
|
~> %slog.0^leaf/"kiln: cancelled (1) install into {here}, retrying"
|
|
|
|
(install loc [ship desk]:rak) :: TODO reset aeon?
|
|
|
|
~> %slog.0^leaf/"kiln: downloading update for {here}"
|
|
|
|
=? aeon.rak ?=(%w p.p.u.p.syn) ud:;;(cass:clay q.q.r.u.p.syn)
|
|
|
|
%: emit
|
|
|
|
%pass (make-wire %download) %arvo %c
|
|
|
|
%warp ship.rak desk.rak `[%sing %v ud+aeon.rak /]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ take-download
|
|
|
|
|= syn=sign-arvo
|
|
|
|
?> ?=(%writ +<.syn)
|
|
|
|
?~ p.syn
|
|
|
|
~> %slog.0^leaf/"kiln: cancelled (2) install into {here}, retrying"
|
|
|
|
(install loc [ship desk]:rak) :: TODO reset aeon?
|
|
|
|
~> %slog.0^leaf/"kiln: finished downloading update for {here}"
|
|
|
|
:: TODO: check kelvin here
|
|
|
|
=. aeon.rak +(aeon.rak)
|
|
|
|
=/ =germ (get-germ loc)
|
|
|
|
~> %slog.0^leaf/"kiln: merging into {here}"
|
|
|
|
%- emil
|
|
|
|
:~ :* %pass (make-wire %merge) %arvo %c
|
|
|
|
%merg loc ship.rak desk.rak ud+(dec aeon.rak) germ
|
|
|
|
==
|
|
|
|
:* %pass (make-wire %sync) %arvo %c
|
|
|
|
%warp ship.rak desk.rak `[%sing %z ud+aeon.rak /]
|
|
|
|
== ==
|
|
|
|
::
|
|
|
|
++ take-merge
|
|
|
|
|= syn=sign-arvo
|
|
|
|
?> ?=(%mere +<.syn)
|
|
|
|
?: ?=([%| %ali-unavailable *] p.syn)
|
|
|
|
%- %+ slog
|
|
|
|
:- %leaf
|
|
|
|
"kiln: merge into {here} failed, maybe because sunk; restarting"
|
|
|
|
p.p.syn
|
|
|
|
(install loc [ship desk]:rak) :: TODO reset aeon?
|
|
|
|
?: ?=(%| -.p.syn)
|
|
|
|
%- %+ slog
|
|
|
|
:- %leaf
|
|
|
|
"kiln: merge into {here} failed, waiting for next revision"
|
|
|
|
p.p.syn
|
|
|
|
..abet
|
|
|
|
::
|
|
|
|
~> %slog.0^leaf/"merge into {here} succeeded"
|
|
|
|
..abet
|
|
|
|
--
|
|
|
|
:: +get-germ: select merge strategy into local desk
|
|
|
|
::
|
|
|
|
:: If destination desk doesn't exist, need a %init merge. If this is
|
|
|
|
:: its first revision, it probably doesn't have a mergebase yet, so
|
|
|
|
:: use %take-that.
|
|
|
|
::
|
|
|
|
++ get-germ
|
|
|
|
|= =desk
|
|
|
|
=+ .^(=cass:clay %cw /(scot %p our)/[desk]/(scot %da now))
|
|
|
|
?- ud.cass
|
|
|
|
%0 %init
|
|
|
|
%1 %take-that
|
|
|
|
* %mate
|
|
|
|
==
|
2016-01-07 01:08:46 +03:00
|
|
|
::
|
2020-05-22 09:05:42 +03:00
|
|
|
++ update
|
|
|
|
|%
|
2021-07-01 04:03:47 +03:00
|
|
|
++ poke
|
|
|
|
|= arg=(unit [=ship =desk])
|
|
|
|
^+ ..abet
|
|
|
|
=? ..abet =(arg (bind ota |=([=ship =desk =aeon] [ship desk])))
|
|
|
|
(render "restarting OTA sync" ~)
|
|
|
|
=? ..abet ?=(^ ota)
|
|
|
|
=. ..abet (render-ket "cancelling OTA sync" ~)
|
|
|
|
..abet(ota ~)
|
|
|
|
?~ arg
|
|
|
|
..abet
|
|
|
|
=. ota `[ship.u.arg desk.u.arg *aeon]
|
|
|
|
=. ..abet (render "starting OTA sync" ~)
|
|
|
|
%: emit
|
|
|
|
%pass (make-wire /find) %arvo %c
|
|
|
|
%warp ship.u.arg desk.u.arg `[%sing %y ud+1 /]
|
|
|
|
==
|
|
|
|
::
|
2020-05-22 09:05:42 +03:00
|
|
|
++ make-wire
|
|
|
|
|= =path
|
2021-07-01 04:03:47 +03:00
|
|
|
^- wire
|
2020-05-22 09:05:42 +03:00
|
|
|
?> ?=(^ ota)
|
2021-07-01 04:03:47 +03:00
|
|
|
%- welp :_ path
|
2020-05-22 09:05:42 +03:00
|
|
|
/kiln/ota/(scot %p ship.u.ota)/[desk.u.ota]/(scot %ud aeon.u.ota)
|
|
|
|
::
|
|
|
|
++ check-ota
|
|
|
|
|= =wire
|
2021-07-01 04:03:47 +03:00
|
|
|
^- ?
|
2020-05-22 09:05:42 +03:00
|
|
|
?~ ota
|
|
|
|
|
|
|
|
|
?& ?=([@ @ @ *] wire)
|
|
|
|
=(i.wire (scot %p ship.u.ota))
|
|
|
|
=(i.t.wire desk.u.ota)
|
|
|
|
=(i.t.t.wire (scot %ud aeon.u.ota))
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ render
|
|
|
|
|= [mez=tape error=(unit (pair term tang))]
|
|
|
|
%+ spam
|
|
|
|
?~ ota
|
|
|
|
leaf+mez
|
|
|
|
:^ %palm [" " ~ ~ ~] leaf+(weld "kiln: " mez)
|
|
|
|
~[leaf+"from {<desk.u.ota>}" leaf+"on {<ship.u.ota>}"]
|
|
|
|
?~ error
|
|
|
|
~
|
|
|
|
[>p.u.error< q.u.error]
|
|
|
|
::
|
|
|
|
++ render-ket
|
|
|
|
|= [mez=tape error=(unit (pair term tang))]
|
|
|
|
?> ?=(^ ota)
|
|
|
|
=< ?>(?=(^ ota) .)
|
|
|
|
%+ spam
|
|
|
|
:^ %palm [" " ~ ~ ~] leaf+(weld "kiln: " mez)
|
|
|
|
~[leaf+"from {<desk.u.ota>}" leaf+"on {<ship.u.ota>}"]
|
|
|
|
?~ error
|
|
|
|
~
|
|
|
|
[>p.u.error< q.u.error]
|
|
|
|
::
|
|
|
|
++ take
|
|
|
|
|= [=wire =sign-arvo]
|
|
|
|
^+ ..abet
|
|
|
|
?> ?=(^ ota)
|
|
|
|
?. (check-ota wire)
|
|
|
|
..abet
|
|
|
|
?. ?=([@ @ @ @ *] wire)
|
|
|
|
..abet
|
|
|
|
?+ i.t.t.t.wire ~&([%strange-ota-take t.t.t.wire] ..abet)
|
|
|
|
%find (take-find sign-arvo)
|
|
|
|
%sync (take-sync sign-arvo)
|
2020-06-29 23:25:10 +03:00
|
|
|
%download (take-download sign-arvo)
|
2020-05-22 09:05:42 +03:00
|
|
|
%merge-home (take-merge-home sign-arvo)
|
|
|
|
%merge-kids (take-merge-kids sign-arvo)
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ take-find
|
|
|
|
|= =sign-arvo
|
|
|
|
?> ?=(%writ +<.sign-arvo)
|
|
|
|
?> ?=(^ ota)
|
|
|
|
=. ..abet (render-ket "activated OTA" ~)
|
|
|
|
%: emit
|
|
|
|
%pass (make-wire /sync) %arvo %c
|
|
|
|
%warp ship.u.ota desk.u.ota `[%sing %w da+now /]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ take-sync
|
|
|
|
|= =sign-arvo
|
|
|
|
?> ?=(%writ +<.sign-arvo)
|
|
|
|
?> ?=(^ ota)
|
|
|
|
?~ p.sign-arvo
|
2020-06-29 23:25:10 +03:00
|
|
|
=. ..abet (render-ket "OTA cancelled (1), retrying" ~)
|
2021-07-01 04:03:47 +03:00
|
|
|
(poke `[ship desk]:u.ota)
|
2020-06-29 23:25:10 +03:00
|
|
|
=. ..abet (render-ket "downloading OTA update" ~)
|
2020-11-25 22:39:13 +03:00
|
|
|
=? aeon.u.ota ?=(%w p.p.u.p.sign-arvo)
|
2020-05-22 09:05:42 +03:00
|
|
|
ud:;;(cass:clay q.q.r.u.p.sign-arvo)
|
|
|
|
%: emit
|
2020-06-29 23:25:10 +03:00
|
|
|
%pass (make-wire /download) %arvo %c
|
|
|
|
%warp ship.u.ota desk.u.ota `[%sing %v ud+aeon.u.ota /]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ take-download
|
|
|
|
|= =sign-arvo
|
|
|
|
^+ ..abet
|
|
|
|
?> ?=(%writ +<.sign-arvo)
|
|
|
|
?> ?=(^ ota)
|
|
|
|
?~ p.sign-arvo
|
|
|
|
=. ..abet (render-ket "OTA cancelled (2), retrying" ~)
|
2021-07-01 04:03:47 +03:00
|
|
|
(poke `[ship desk]:u.ota)
|
2020-06-29 23:25:10 +03:00
|
|
|
=. ..abet (render-ket "finished downloading OTA" ~)
|
|
|
|
=. aeon.u.ota +(aeon.u.ota)
|
|
|
|
=/ =germ (get-germ %home)
|
|
|
|
=. ..abet (render-ket "applying OTA to %home" ~)
|
|
|
|
%- emil
|
|
|
|
:~ :* %pass (make-wire /merge-home) %arvo %c
|
|
|
|
%merg %home ship.u.ota desk.u.ota ud+(dec aeon.u.ota) germ
|
|
|
|
==
|
|
|
|
:* %pass (make-wire /sync) %arvo %c
|
|
|
|
%warp ship.u.ota desk.u.ota `[%sing %z ud+aeon.u.ota /]
|
|
|
|
==
|
2020-05-22 09:05:42 +03:00
|
|
|
==
|
|
|
|
::
|
|
|
|
++ take-merge-home
|
|
|
|
|= =sign-arvo
|
|
|
|
?> ?=(%mere +<.sign-arvo)
|
|
|
|
?> ?=(^ ota)
|
|
|
|
?: ?=([%| %ali-unavailable *] p.sign-arvo)
|
|
|
|
=. ..abet
|
|
|
|
=/ =tape "OTA to %home failed, maybe because sunk; restarting"
|
|
|
|
(render-ket tape `p.p.sign-arvo)
|
2021-07-01 04:03:47 +03:00
|
|
|
(poke `[ship desk]:u.ota)
|
2020-05-22 09:05:42 +03:00
|
|
|
::
|
|
|
|
?: ?=(%| -.p.sign-arvo)
|
2020-06-29 23:25:10 +03:00
|
|
|
=/ =tape "OTA to %home failed, waiting for next revision"
|
|
|
|
(render-ket tape `p.p.sign-arvo)
|
2020-05-22 09:05:42 +03:00
|
|
|
=. ..abet (render-ket "OTA to %home succeeded" ~)
|
2020-06-29 23:25:10 +03:00
|
|
|
=. ..abet (render-ket "applying OTA to %kids" ~)
|
2020-05-23 00:32:32 +03:00
|
|
|
=/ =germ (get-germ %kids)
|
2020-05-22 09:05:42 +03:00
|
|
|
%: emit
|
|
|
|
%pass (make-wire /merge-kids) %arvo %c
|
2020-06-29 23:25:10 +03:00
|
|
|
%merg %kids ship.u.ota desk.u.ota ud+(dec aeon.u.ota) germ
|
2020-05-22 09:05:42 +03:00
|
|
|
==
|
|
|
|
::
|
|
|
|
++ take-merge-kids
|
|
|
|
|= =sign-arvo
|
|
|
|
?> ?=(%mere +<.sign-arvo)
|
|
|
|
?> ?=(^ ota)
|
|
|
|
?: ?=([%| %ali-unavailable *] p.sign-arvo)
|
|
|
|
=. ..abet
|
|
|
|
=/ =tape "OTA to %kids failed, maybe because sunk; restarting"
|
|
|
|
(render-ket tape `p.p.sign-arvo)
|
2021-07-01 04:03:47 +03:00
|
|
|
(poke `[ship desk]:u.ota)
|
2020-05-22 09:05:42 +03:00
|
|
|
::
|
2020-06-29 23:25:10 +03:00
|
|
|
?- -.p.sign-arvo
|
|
|
|
%& (render-ket "OTA to %kids succeeded" ~)
|
|
|
|
%| (render-ket "OTA to %kids failed" `p.p.sign-arvo)
|
2020-05-22 09:05:42 +03:00
|
|
|
==
|
|
|
|
--
|
|
|
|
::
|
2021-07-01 04:03:47 +03:00
|
|
|
++ poke
|
|
|
|
|= [=mark =vase]
|
|
|
|
?+ mark ~|([%poke-kiln-bad-mark mark] !!)
|
|
|
|
%kiln-autocommit =;(f (f !<(_+<.f vase)) poke-autocommit)
|
|
|
|
%kiln-cancel =;(f (f !<(_+<.f vase)) poke-cancel)
|
|
|
|
%kiln-cancel-autocommit =;(f (f !<(_+<.f vase)) poke-cancel-autocommit)
|
|
|
|
%kiln-commit =;(f (f !<(_+<.f vase)) poke-commit)
|
|
|
|
%kiln-fuse =;(f (f !<(_+<.f vase)) poke-fuse)
|
|
|
|
%kiln-gall-sear =;(f (f !<(_+<.f vase)) poke-gall-sear)
|
|
|
|
%kiln-goad-gall =;(f (f !<(_+<.f vase)) poke-goad-gall)
|
|
|
|
%kiln-info =;(f (f !<(_+<.f vase)) poke-info)
|
|
|
|
%kiln-install =;(f (f !<(_+<.f vase)) poke-install)
|
|
|
|
%kiln-label =;(f (f !<(_+<.f vase)) poke-label)
|
|
|
|
%kiln-merge =;(f (f !<(_+<.f vase)) poke-merge)
|
|
|
|
%kiln-mount =;(f (f !<(_+<.f vase)) poke-mount)
|
|
|
|
%kiln-ota =;(f (f !<(_+<.f vase)) poke-ota)
|
|
|
|
%kiln-ota-info =;(f (f !<(_+<.f vase)) poke-ota-info)
|
|
|
|
%kiln-permission =;(f (f !<(_+<.f vase)) poke-permission)
|
|
|
|
%kiln-rm =;(f (f !<(_+<.f vase)) poke-rm)
|
|
|
|
%kiln-schedule =;(f (f !<(_+<.f vase)) poke-schedule)
|
|
|
|
%kiln-sync =;(f (f !<(_+<.f vase)) poke-sync)
|
|
|
|
%kiln-syncs =;(f (f !<(_+<.f vase)) poke-syncs)
|
|
|
|
%kiln-track =;(f (f !<(_+<.f vase)) poke-track)
|
|
|
|
%kiln-uninstall =;(f (f !<(_+<.f vase)) poke-uninstall)
|
|
|
|
%kiln-unmount =;(f (f !<(_+<.f vase)) poke-unmount)
|
|
|
|
%kiln-unsync =;(f (f !<(_+<.f vase)) poke-unsync)
|
|
|
|
==
|
2016-02-26 02:19:44 +03:00
|
|
|
::
|
2021-07-01 04:03:47 +03:00
|
|
|
++ poke-autocommit
|
|
|
|
|= [mon=kiln-commit auto=?]
|
|
|
|
=< abet
|
|
|
|
=. +>.$ (emit %pass /commit %arvo %c [%dirk mon])
|
|
|
|
?. auto
|
|
|
|
+>.$
|
|
|
|
=/ recur ~s1
|
|
|
|
=. commit-timer
|
|
|
|
[/kiln/autocommit (add now recur) recur mon]
|
|
|
|
(emit %pass way.commit-timer %arvo %b [%wait nex.commit-timer])
|
2020-07-23 02:27:02 +03:00
|
|
|
::
|
2021-07-01 04:03:47 +03:00
|
|
|
++ poke-cancel
|
|
|
|
|= a=@tas
|
|
|
|
abet:(emit %pass /cancel %arvo %c [%drop a])
|
2020-07-23 02:27:02 +03:00
|
|
|
::
|
2021-07-01 04:03:47 +03:00
|
|
|
++ poke-cancel-autocommit
|
2018-03-19 07:18:20 +03:00
|
|
|
|= ~
|
2021-07-01 04:03:47 +03:00
|
|
|
abet:(emit %pass way.commit-timer %arvo %b [%rest nex.commit-timer])
|
2015-09-02 01:20:17 +03:00
|
|
|
::
|
2021-07-01 04:03:47 +03:00
|
|
|
++ poke-commit
|
|
|
|
|= [mon=kiln-commit auto=?]
|
|
|
|
=< abet
|
|
|
|
=. +>.$ (emit %pass /commit %arvo %c [%dirk mon])
|
|
|
|
?. auto
|
|
|
|
+>.$
|
|
|
|
=/ recur ~s1
|
|
|
|
=. commit-timer
|
|
|
|
[/kiln/autocommit (add now recur) recur mon]
|
|
|
|
(emit %pass way.commit-timer %arvo %b [%wait nex.commit-timer])
|
2015-09-02 01:20:17 +03:00
|
|
|
::
|
2021-04-20 06:46:46 +03:00
|
|
|
++ poke-fuse
|
|
|
|
|= k=kiln-fuse
|
2021-05-02 06:04:19 +03:00
|
|
|
?~ k abet
|
2021-04-25 03:50:50 +03:00
|
|
|
abet:(emit [%pass /kiln/fuse/[syd.k] %arvo %c [%fuse syd.k bas.k con.k]])
|
2021-04-20 06:46:46 +03:00
|
|
|
::
|
2021-07-01 04:03:47 +03:00
|
|
|
++ poke-gall-sear
|
|
|
|
|= =ship
|
|
|
|
abet:(emit %pass /kiln %arvo %g %sear ship)
|
|
|
|
::
|
|
|
|
++ poke-goad-gall
|
|
|
|
|= [force=? agent=(unit dude:gall)]
|
|
|
|
abet:(emit %pass /kiln %arvo %g %goad force agent)
|
2015-09-16 03:24:44 +03:00
|
|
|
::
|
2016-05-07 02:21:29 +03:00
|
|
|
++ poke-info
|
2020-11-26 17:09:31 +03:00
|
|
|
|= [mez=tape tor=(unit toro)]
|
2016-07-20 01:21:21 +03:00
|
|
|
?~ tor
|
|
|
|
abet:(spam leaf+mez ~)
|
2019-11-14 21:39:50 +03:00
|
|
|
abet:(emit:(spam leaf+mez ~) %pass /kiln %arvo %c [%info u.tor])
|
2015-09-02 01:20:17 +03:00
|
|
|
::
|
2021-07-01 04:03:47 +03:00
|
|
|
++ poke-install
|
|
|
|
|= [loc=desk her=ship rem=desk]
|
|
|
|
abet:abet:(install:vats +<)
|
|
|
|
::
|
|
|
|
++ poke-label
|
|
|
|
|= [syd=desk lab=@tas]
|
|
|
|
=+ pax=/(scot %p our)/[syd]/[lab]
|
|
|
|
(poke-info "labeled {(spud pax)}" `[syd %| lab])
|
|
|
|
::
|
|
|
|
++ poke-merge
|
|
|
|
|= kiln-merge
|
|
|
|
?~ +< abet
|
|
|
|
abet:abet:(merge:(work syd) ali sud cas gim)
|
|
|
|
::
|
|
|
|
++ poke-mount
|
|
|
|
|= kiln-mount
|
|
|
|
=+ bem=(de-beam pax)
|
|
|
|
?~ bem
|
|
|
|
=+ "can't mount bad path: {<pax>}"
|
|
|
|
abet:(spam leaf+- ~)
|
|
|
|
abet:(emit %pass /mount %arvo %c [%mont pot u.bem])
|
|
|
|
::
|
|
|
|
++ poke-ota
|
|
|
|
|= arg=(unit [=ship =desk])
|
|
|
|
abet:(poke:update arg)
|
|
|
|
::
|
|
|
|
++ poke-ota-info
|
|
|
|
|= *
|
|
|
|
=< abet %- spam
|
|
|
|
:~ [%leaf get-ota-info]
|
|
|
|
[%leaf "use |ota %disable or |ota ~sponsor %kids to reset it"]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ poke-permission
|
|
|
|
|= [syd=desk pax=path pub=?]
|
|
|
|
=< abet
|
|
|
|
%- emit
|
|
|
|
=/ =rite [%r ~ ?:(pub %black %white) ~]
|
|
|
|
[%pass /kiln/permission %arvo %c [%perm syd pax rite]]
|
|
|
|
::
|
2016-07-16 04:56:50 +03:00
|
|
|
++ poke-rm
|
2020-11-25 23:22:55 +03:00
|
|
|
|= a=path
|
2016-07-16 04:56:50 +03:00
|
|
|
=+ b=.^(arch %cy a)
|
|
|
|
?~ fil.b
|
|
|
|
=+ ~[leaf+"No such file:" leaf+"{<a>}"]
|
|
|
|
abet:(spam -)
|
2016-07-20 01:21:21 +03:00
|
|
|
(poke-info "removed" `(fray a))
|
2016-07-16 04:56:50 +03:00
|
|
|
::
|
2015-09-02 01:20:17 +03:00
|
|
|
++ poke-schedule
|
2020-11-26 17:09:31 +03:00
|
|
|
|= [where=path tym=@da eve=@t]
|
2015-09-02 01:20:17 +03:00
|
|
|
=. where (welp where /sched)
|
2016-05-07 02:21:29 +03:00
|
|
|
%+ poke-info "scheduled"
|
2015-12-09 04:54:26 +03:00
|
|
|
=+ old=;;((map @da cord) (fall (file where) ~))
|
2016-07-20 01:21:21 +03:00
|
|
|
`(foal where %sched !>((~(put by old) tym eve)))
|
2015-09-02 01:20:17 +03:00
|
|
|
::
|
2021-07-01 04:03:47 +03:00
|
|
|
++ poke-sync
|
|
|
|
|= hos=kiln-sync
|
|
|
|
?: (~(has by syn) hos)
|
|
|
|
abet:(spam (render "already syncing" [sud her syd]:hos) ~)
|
|
|
|
abet:abet:start-sync:(auto hos)
|
2018-02-14 01:29:16 +03:00
|
|
|
::
|
2021-07-01 04:03:47 +03:00
|
|
|
++ poke-syncs :: print sync config
|
|
|
|
|= ~
|
|
|
|
=< abet %- spam
|
|
|
|
:- [%leaf get-ota-info]
|
|
|
|
?: =(0 ~(wyt by syn))
|
|
|
|
[%leaf "no other syncs configured"]~
|
|
|
|
%+ turn ~(tap in ~(key by syn))
|
|
|
|
|=(a=kiln-sync (render "sync configured" [sud her syd]:a))
|
2015-09-17 02:40:53 +03:00
|
|
|
::
|
2021-07-01 04:03:47 +03:00
|
|
|
++ poke-track
|
|
|
|
|= hos=kiln-sync
|
|
|
|
?: (~(has by syn) hos)
|
|
|
|
abet:(spam (render "already tracking" [sud her syd]:hos) ~)
|
|
|
|
abet:abet:start-track:(auto hos)
|
2019-11-05 10:37:58 +03:00
|
|
|
::
|
2021-07-01 04:03:47 +03:00
|
|
|
++ poke-uninstall
|
|
|
|
|= loc=desk
|
|
|
|
abet:(uninstall:vats +<)
|
2020-03-19 02:06:33 +03:00
|
|
|
::
|
2021-07-01 04:03:47 +03:00
|
|
|
++ poke-unmount
|
|
|
|
|= mon=kiln-unmount
|
|
|
|
?^ mon
|
|
|
|
=+ bem=(de-beam mon)
|
|
|
|
?~ bem
|
|
|
|
=+ "can't unmount bad path: {<mon>}"
|
|
|
|
abet:(spam leaf+- ~)
|
|
|
|
abet:(emit %pass /unmount-beam %arvo %c [%ogre [[p q r] s]:u.bem])
|
|
|
|
abet:(emit %pass /unmount-point %arvo %c [%ogre mon])
|
|
|
|
::
|
|
|
|
++ poke-unsync
|
|
|
|
|= hus=kiln-unsync
|
|
|
|
?. (~(has by syn) hus)
|
|
|
|
abet:(spam (render "not syncing" [sud her syd]:hus) ~)
|
|
|
|
%* . abet:abet:stop:(auto hus)
|
|
|
|
syn (~(del by syn) hus)
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ get-ota-info
|
|
|
|
?~ ota
|
|
|
|
"OTAs disabled"
|
|
|
|
"OTAs enabled from {<desk.u.ota>} on {<ship.u.ota>}"
|
2018-02-14 01:29:16 +03:00
|
|
|
::
|
2019-11-14 21:39:50 +03:00
|
|
|
++ take-agent
|
2019-11-19 07:36:21 +03:00
|
|
|
|= [=wire =sign:agent:gall]
|
2019-11-14 21:39:50 +03:00
|
|
|
?+ wire ~|([%kiln-bad-take-agent wire -.sign] !!)
|
2020-01-04 00:06:42 +03:00
|
|
|
[%kiln %fancy *] ?> ?=(%poke-ack -.sign)
|
2019-11-14 21:39:50 +03:00
|
|
|
(take-coup-fancy t.t.wire p.sign)
|
2020-01-04 00:06:42 +03:00
|
|
|
[%kiln %spam *] ?> ?=(%poke-ack -.sign)
|
2019-11-14 21:39:50 +03:00
|
|
|
(take-coup-spam t.t.wire p.sign)
|
|
|
|
==
|
|
|
|
::
|
2020-06-16 10:29:17 +03:00
|
|
|
++ take-arvo
|
2019-11-14 21:39:50 +03:00
|
|
|
|= [=wire =sign-arvo]
|
|
|
|
?- wire
|
|
|
|
[%sync %merg *] %+ take-mere-sync t.t.wire
|
|
|
|
?>(?=(%mere +<.sign-arvo) +>.sign-arvo)
|
|
|
|
[%find-ship *] %+ take-writ-find-ship t.wire
|
|
|
|
?>(?=(%writ +<.sign-arvo) +>.sign-arvo)
|
|
|
|
[%sync *] %+ take-writ-sync t.wire
|
|
|
|
?>(?=(%writ +<.sign-arvo) +>.sign-arvo)
|
|
|
|
[%autocommit *] %+ take-wake-autocommit t.wire
|
|
|
|
?>(?=(%wake +<.sign-arvo) +>.sign-arvo)
|
2020-05-22 09:05:42 +03:00
|
|
|
[%ota *] abet:(take:update t.wire sign-arvo)
|
2019-11-14 21:39:50 +03:00
|
|
|
*
|
2020-06-27 05:21:09 +03:00
|
|
|
?+ +<.sign-arvo
|
|
|
|
((slog leaf+"kiln: strange card {<+<.sign-arvo wire>}" ~) abet)
|
2019-11-20 00:03:07 +03:00
|
|
|
%done %+ done wire
|
|
|
|
?>(?=(%done +<.sign-arvo) +>.sign-arvo)
|
2019-11-14 21:39:50 +03:00
|
|
|
%mere %+ take-mere wire
|
|
|
|
?>(?=(%mere +<.sign-arvo) +>.sign-arvo)
|
|
|
|
==
|
|
|
|
==
|
2020-11-26 17:09:31 +03:00
|
|
|
++ take |=(way=wire ?>(?=([@ ~] way) (work i.way))) :: general handler
|
2021-07-01 04:03:47 +03:00
|
|
|
++ done
|
|
|
|
|= [way=wire saw=(unit error:ames)]
|
|
|
|
~? ?=(^ saw) [%kiln-nack u.saw]
|
|
|
|
abet
|
|
|
|
::
|
2015-09-02 01:20:17 +03:00
|
|
|
++ take-mere ::
|
2020-11-26 17:09:31 +03:00
|
|
|
|= [way=wire are=(each (set path) (pair term tang))]
|
2021-05-18 22:09:22 +03:00
|
|
|
?. ?=([@ ~] way)
|
|
|
|
abet
|
2015-09-02 01:20:17 +03:00
|
|
|
abet:abet:(mere:(take way) are)
|
|
|
|
::
|
|
|
|
++ take-coup-fancy ::
|
2020-11-26 17:09:31 +03:00
|
|
|
|= [way=wire saw=(unit tang)]
|
2015-09-02 01:20:17 +03:00
|
|
|
abet:abet:(coup-fancy:(take way) saw)
|
|
|
|
::
|
2017-11-30 07:31:13 +03:00
|
|
|
++ take-coup-spam ::
|
2020-11-26 17:09:31 +03:00
|
|
|
|= [way=wire saw=(unit tang)]
|
2017-11-30 07:31:13 +03:00
|
|
|
~? ?=(^ saw) [%kiln-spam-lame u.saw]
|
|
|
|
abet
|
|
|
|
::
|
2015-09-02 01:20:17 +03:00
|
|
|
++ take-mere-sync ::
|
2020-11-26 17:09:31 +03:00
|
|
|
|= [way=wire mes=(each (set path) (pair term tang))]
|
|
|
|
?> ?=([@ @ @ *] way)
|
2020-11-25 23:22:55 +03:00
|
|
|
=/ hos=kiln-sync
|
2015-09-02 01:20:17 +03:00
|
|
|
:* syd=(slav %tas i.way)
|
|
|
|
her=(slav %p i.t.way)
|
|
|
|
sud=(slav %tas i.t.t.way)
|
|
|
|
==
|
2020-06-27 05:21:09 +03:00
|
|
|
?. (~(has by syn) hos)
|
|
|
|
abet
|
2018-12-04 09:59:41 +03:00
|
|
|
abet:abet:(mere:(auto hos) mes)
|
2015-09-02 01:20:17 +03:00
|
|
|
::
|
2019-04-30 20:40:38 +03:00
|
|
|
++ take-writ-find-ship ::
|
2020-11-26 17:09:31 +03:00
|
|
|
|= [way=wire rot=riot]
|
|
|
|
?> ?=([@ @ @ *] way)
|
2020-11-25 23:22:55 +03:00
|
|
|
=/ hos=kiln-sync
|
2019-04-30 20:40:38 +03:00
|
|
|
:* syd=(slav %tas i.way)
|
|
|
|
her=(slav %p i.t.way)
|
|
|
|
sud=(slav %tas i.t.t.way)
|
|
|
|
==
|
2020-06-27 05:21:09 +03:00
|
|
|
?. (~(has by syn) hos)
|
|
|
|
abet
|
2019-04-30 20:40:38 +03:00
|
|
|
abet:abet:(take-find-ship:(auto hos) rot)
|
|
|
|
::
|
2015-09-17 01:39:11 +03:00
|
|
|
++ take-writ-sync ::
|
2020-11-26 17:09:31 +03:00
|
|
|
|= [way=wire rot=riot]
|
|
|
|
?> ?=([@ @ @ *] way)
|
2020-11-25 23:22:55 +03:00
|
|
|
=/ hos=kiln-sync
|
2015-09-02 01:20:17 +03:00
|
|
|
:* syd=(slav %tas i.way)
|
|
|
|
her=(slav %p i.t.way)
|
|
|
|
sud=(slav %tas i.t.t.way)
|
|
|
|
==
|
2020-06-27 05:21:09 +03:00
|
|
|
?. (~(has by syn) hos)
|
|
|
|
abet
|
2018-12-04 09:59:41 +03:00
|
|
|
abet:abet:(writ:(auto hos) rot)
|
2015-09-02 01:20:17 +03:00
|
|
|
::
|
2019-08-25 12:00:26 +03:00
|
|
|
++ take-wake-autocommit
|
|
|
|
|= [way=wire error=(unit tang)]
|
|
|
|
?^ error
|
|
|
|
%- (slog u.error)
|
|
|
|
~& %kiln-wake-autocommit-fail
|
|
|
|
abet
|
|
|
|
=. nex.commit-timer (add now tim.commit-timer)
|
|
|
|
=< abet
|
|
|
|
%- emil
|
2019-11-14 21:39:50 +03:00
|
|
|
:~ [%pass /commit %arvo %c [%dirk mon.commit-timer]]
|
|
|
|
[%pass way.commit-timer %arvo %b [%wait nex.commit-timer]]
|
2019-08-25 12:00:26 +03:00
|
|
|
==
|
|
|
|
::
|
|
|
|
::
|
2015-09-02 01:20:17 +03:00
|
|
|
++ spam
|
2020-11-25 23:22:55 +03:00
|
|
|
|= mes=(list tank)
|
2015-09-02 01:20:17 +03:00
|
|
|
((slog mes) ..spam)
|
|
|
|
::
|
|
|
|
++ auto
|
|
|
|
|= kiln-sync
|
2019-11-14 21:39:50 +03:00
|
|
|
=+ (~(gut by syn) [syd her sud] let=*@ud)
|
2015-09-02 01:20:17 +03:00
|
|
|
|%
|
|
|
|
++ abet
|
2019-11-14 21:39:50 +03:00
|
|
|
..auto(syn (~(put by syn) [syd her sud] let))
|
2015-06-18 02:44:00 +03:00
|
|
|
::
|
2015-09-02 01:20:17 +03:00
|
|
|
++ blab
|
2020-11-25 23:22:55 +03:00
|
|
|
|= new=(list card:agent:gall)
|
2015-09-02 01:20:17 +03:00
|
|
|
^+ +>
|
|
|
|
+>.$(moz (welp new moz))
|
2015-05-12 03:31:37 +03:00
|
|
|
::
|
2019-11-14 21:39:50 +03:00
|
|
|
++ warp
|
|
|
|
|= [=wire =ship =riff]
|
|
|
|
(blab [%pass wire %arvo %c [%warp ship riff]] ~)
|
|
|
|
::
|
2015-09-02 01:20:17 +03:00
|
|
|
++ spam |*(* %_(+> ..auto (^spam +<)))
|
|
|
|
++ stop
|
|
|
|
=> (spam (render "ended autosync" sud her syd) ~)
|
2018-12-13 21:23:26 +03:00
|
|
|
=/ =wire /kiln/sync/[syd]/(scot %p her)/[sud]
|
2019-11-14 21:39:50 +03:00
|
|
|
(warp wire her sud ~)
|
2018-12-04 09:59:41 +03:00
|
|
|
:: XX duplicate of start-sync? see |track
|
2015-06-04 00:18:13 +03:00
|
|
|
::
|
2016-01-07 01:08:46 +03:00
|
|
|
++ start-track
|
|
|
|
=> (spam (render "activated track" sud her syd) ~)
|
|
|
|
=. let 1
|
2018-12-13 21:23:26 +03:00
|
|
|
=/ =wire /kiln/sync/[syd]/(scot %p her)/[sud]
|
2019-11-14 21:39:50 +03:00
|
|
|
(warp wire her sud `[%sing %y ud+let /])
|
2016-01-07 01:08:46 +03:00
|
|
|
::
|
|
|
|
++ start-sync
|
2019-04-30 20:40:38 +03:00
|
|
|
=> (spam (render "finding ship and desk" sud her syd) ~)
|
|
|
|
=/ =wire /kiln/find-ship/[syd]/(scot %p her)/[sud]
|
2019-11-14 21:39:50 +03:00
|
|
|
(warp wire her sud `[%sing %y ud+1 /])
|
2019-04-30 20:40:38 +03:00
|
|
|
::
|
|
|
|
++ take-find-ship
|
|
|
|
|= rot=riot
|
2019-05-14 00:45:53 +03:00
|
|
|
=> (spam (render "activated sync" sud her syd) ~)
|
2018-12-04 09:59:41 +03:00
|
|
|
=/ =wire /kiln/sync/[syd]/(scot %p her)/[sud]
|
2019-11-14 21:39:50 +03:00
|
|
|
(warp wire her sud `[%sing %w [%da now] /])
|
2015-05-12 03:31:37 +03:00
|
|
|
::
|
2015-09-02 01:20:17 +03:00
|
|
|
++ writ
|
2018-12-04 09:59:41 +03:00
|
|
|
|= rot=riot
|
2015-09-02 01:20:17 +03:00
|
|
|
?~ rot
|
2019-01-31 05:48:30 +03:00
|
|
|
=. +>.$
|
|
|
|
%^ spam
|
|
|
|
leaf+"sync cancelled, retrying"
|
|
|
|
(render "on sync" sud her syd)
|
|
|
|
~
|
|
|
|
start-sync
|
2020-11-25 22:39:13 +03:00
|
|
|
=. let ?. ?=(%w p.p.u.rot) let ud:;;(cass:clay q.q.r.u.rot)
|
2019-11-14 21:39:50 +03:00
|
|
|
=/ =wire /kiln/sync/merg/[syd]/(scot %p her)/[sud]
|
2018-12-19 09:56:34 +03:00
|
|
|
:: germ: merge mode for sync merges
|
2018-12-04 21:11:43 +03:00
|
|
|
::
|
2018-12-19 09:56:34 +03:00
|
|
|
:: Initial merges from any source must use the %init germ.
|
|
|
|
:: Subsequent merges may use any germ, but if the source is
|
|
|
|
:: a remote ship with which we have not yet merged, we won't
|
2020-08-28 10:24:25 +03:00
|
|
|
:: share a merge-base commit and all germs but %only-that will
|
|
|
|
:: fail.
|
2018-12-04 21:11:43 +03:00
|
|
|
::
|
2020-08-28 10:24:25 +03:00
|
|
|
:: We want to always use %only-that for the first remote merge.
|
|
|
|
:: But we also want local syncs (%base to %home or %kids) to
|
|
|
|
:: succeed after that first remote sync. To accomplish both we
|
|
|
|
:: simply use %only-that for the first three sync merges. (The
|
|
|
|
:: first two are from the pill.)
|
2018-12-19 09:56:34 +03:00
|
|
|
::
|
|
|
|
=/ =germ
|
|
|
|
=/ =cass
|
|
|
|
.^(cass:clay %cw /(scot %p our)/[syd]/(scot %da now))
|
|
|
|
?: =(0 ud.cass)
|
|
|
|
%init
|
2020-08-28 10:24:25 +03:00
|
|
|
?:((gth 2 ud.cass) %only-that %mate)
|
2018-12-04 21:11:43 +03:00
|
|
|
=< %- spam
|
|
|
|
?: =(our her) ~
|
|
|
|
[(render "beginning sync" sud her syd) ~]
|
2019-11-14 21:39:50 +03:00
|
|
|
(blab [%pass wire %arvo %c [%merg syd her sud ud+let germ]] ~)
|
2015-06-04 00:18:13 +03:00
|
|
|
::
|
2015-09-02 01:20:17 +03:00
|
|
|
++ mere
|
2018-12-04 09:59:41 +03:00
|
|
|
|= mes=(each (set path) (pair term tang))
|
2020-05-22 09:05:42 +03:00
|
|
|
?: ?=([%| %ali-unavailable *] mes)
|
2019-02-02 00:46:09 +03:00
|
|
|
=. +>.$
|
|
|
|
%^ spam
|
2019-05-03 04:06:31 +03:00
|
|
|
leaf+"merge cancelled, maybe because sunk; restarting"
|
2019-02-02 00:46:09 +03:00
|
|
|
(render "on sync" sud her syd)
|
|
|
|
~
|
|
|
|
start-sync:stop
|
2015-09-02 01:20:17 +03:00
|
|
|
=. let +(let)
|
|
|
|
=. +>.$
|
|
|
|
%- spam
|
2018-03-19 06:54:47 +03:00
|
|
|
?: ?=(%& -.mes)
|
2015-09-02 01:20:17 +03:00
|
|
|
[(render "sync succeeded" sud her syd) ~]
|
|
|
|
?+ p.p.mes
|
|
|
|
:* (render "sync failed" sud her syd)
|
2015-12-21 00:16:39 +03:00
|
|
|
leaf+"please manually merge the desks with"
|
|
|
|
leaf+"|merge %{(trip syd)} {(scow %p her)} %{(trip sud)}"
|
|
|
|
leaf+""
|
|
|
|
leaf+"error code: {<p.p.mes>}"
|
2015-09-02 01:20:17 +03:00
|
|
|
q.p.mes
|
|
|
|
==
|
|
|
|
::
|
2020-11-25 22:39:13 +03:00
|
|
|
%no-ali-disc
|
2016-12-16 09:34:01 +03:00
|
|
|
:~ (render "sync activated" sud her syd)
|
2015-12-21 00:16:39 +03:00
|
|
|
leaf+"note: blank desk {<sud>} on {<her>}"
|
2015-09-02 01:20:17 +03:00
|
|
|
==
|
|
|
|
==
|
2018-12-04 09:59:41 +03:00
|
|
|
=/ =wire /kiln/sync/[syd]/(scot %p her)/[sud]
|
2019-11-14 21:39:50 +03:00
|
|
|
(warp wire her sud `[%sing %y ud+let /])
|
2015-09-02 01:20:17 +03:00
|
|
|
--
|
|
|
|
::
|
|
|
|
++ work :: state machine
|
2020-11-25 23:22:55 +03:00
|
|
|
|= syd=desk
|
2019-12-18 03:48:08 +03:00
|
|
|
=/ ,per-desk
|
2019-06-30 15:50:00 +03:00
|
|
|
%+ ~(gut by rem) syd
|
2017-11-30 00:29:35 +03:00
|
|
|
=+ *per-desk
|
2015-09-02 01:20:17 +03:00
|
|
|
%_(- cas [%da now])
|
|
|
|
|%
|
|
|
|
++ abet :: resolve
|
|
|
|
..work(rem (~(put by rem) syd auto gem her sud cas))
|
2015-05-28 05:46:58 +03:00
|
|
|
::
|
2015-09-02 01:20:17 +03:00
|
|
|
++ blab
|
2020-11-25 23:22:55 +03:00
|
|
|
|= new=(list card:agent:gall)
|
2015-09-02 01:20:17 +03:00
|
|
|
^+ +>
|
|
|
|
+>.$(moz (welp new moz))
|
2015-05-28 05:46:58 +03:00
|
|
|
::
|
2015-09-02 01:20:17 +03:00
|
|
|
++ win . :: successful poke
|
|
|
|
++ lose
|
|
|
|
^+ .
|
|
|
|
~| %kiln-work-fail
|
|
|
|
.
|
2015-06-24 21:30:28 +03:00
|
|
|
::
|
2016-12-16 09:34:01 +03:00
|
|
|
++ perform ::
|
2015-09-02 01:20:17 +03:00
|
|
|
^+ .
|
2020-08-28 10:24:25 +03:00
|
|
|
?< ?=(%this gem)
|
|
|
|
?< ?=(%that gem)
|
2019-11-14 21:39:50 +03:00
|
|
|
(blab [%pass /kiln/[syd] %arvo %c [%merg syd her sud cas gem]] ~)
|
2015-05-26 04:20:45 +03:00
|
|
|
::
|
2015-09-02 01:20:17 +03:00
|
|
|
++ fancy-merge :: send to self
|
2020-11-26 17:09:31 +03:00
|
|
|
|= [syd=desk her=@p sud=desk gem=?(%auto germ)]
|
2015-09-02 01:20:17 +03:00
|
|
|
^+ +>
|
2019-11-14 21:39:50 +03:00
|
|
|
=/ =cage [%kiln-merge !>([syd her sud cas gem])]
|
2015-09-02 01:20:17 +03:00
|
|
|
%- blab :_ ~
|
2019-11-14 21:39:50 +03:00
|
|
|
[%pass /kiln/fancy/[^syd] %agent [our %hood] %poke cage]
|
2015-05-26 04:20:45 +03:00
|
|
|
::
|
2015-09-02 01:20:17 +03:00
|
|
|
++ spam ::|=(tang ((slog +<) ..spam))
|
|
|
|
|*(* +>(..work (^spam +<)))
|
|
|
|
++ merge
|
2020-11-26 17:09:31 +03:00
|
|
|
|= [her=@p sud=@tas cas=case gim=?(%auto germ)]
|
2015-09-02 01:20:17 +03:00
|
|
|
^+ +>
|
2020-11-25 22:39:13 +03:00
|
|
|
?. ?=(%auto gim)
|
2016-01-07 01:08:46 +03:00
|
|
|
perform(auto |, gem gim, her her, cas cas, sud sud)
|
2018-05-03 00:38:01 +03:00
|
|
|
?: =(0 ud:.^(cass:clay %cw /(scot %p our)/[syd]/(scot %da now)))
|
2015-09-02 01:20:17 +03:00
|
|
|
=> $(gim %init)
|
|
|
|
.(auto &)
|
|
|
|
=> $(gim %fine)
|
|
|
|
.(auto &)
|
2015-05-26 04:20:45 +03:00
|
|
|
::
|
2015-09-02 01:20:17 +03:00
|
|
|
++ coup-fancy
|
2020-11-25 23:22:55 +03:00
|
|
|
|= saw=(unit tang)
|
2015-09-02 01:20:17 +03:00
|
|
|
?~ saw
|
2020-05-14 05:28:04 +03:00
|
|
|
+>
|
2015-09-02 01:20:17 +03:00
|
|
|
=+ :- "failed to set up conflict resolution scratch space"
|
|
|
|
"I'm out of ideas"
|
2015-12-21 00:16:39 +03:00
|
|
|
lose:(spam leaf+-< leaf+-> u.saw)
|
2015-05-26 04:20:45 +03:00
|
|
|
::
|
2015-09-02 01:20:17 +03:00
|
|
|
++ mere
|
2020-11-25 23:22:55 +03:00
|
|
|
|= are=(each (set path) (pair term tang))
|
2015-09-02 01:20:17 +03:00
|
|
|
^+ +>
|
|
|
|
?: =(%meld gem)
|
2018-03-19 06:54:47 +03:00
|
|
|
?: ?=(%& -.are)
|
2015-09-02 01:20:17 +03:00
|
|
|
?. auto
|
|
|
|
=+ "merged with strategy {<gem>}"
|
2015-12-21 00:16:39 +03:00
|
|
|
win:(spam leaf+- ?~(p.are ~ [>`(set path)`p.are< ~]))
|
2015-09-02 01:20:17 +03:00
|
|
|
:: ~? > =(~ p.are) [%mere-no-conflict syd]
|
2020-05-14 05:28:04 +03:00
|
|
|
=> .(+>.$ (spam leaf+"mashing conflicts" ~))
|
2015-09-02 01:20:17 +03:00
|
|
|
=+ tic=(cat 3 syd '-scratch')
|
2020-05-14 05:28:04 +03:00
|
|
|
=/ notations=(list [path (unit [mark vase])])
|
|
|
|
%+ turn ~(tap in p.are)
|
|
|
|
|= =path
|
|
|
|
=/ =mark -:(flop path)
|
|
|
|
=/ =dais .^(dais %cb /(scot %p our)/[syd]/(scot cas)/[mark])
|
|
|
|
=/ base .^(vase %cr (weld /(scot %p our)/[tic]/(scot cas) path))
|
|
|
|
=/ ali .^(vase %cr (weld /(scot %p her)/[sud]/(scot cas) path))
|
|
|
|
=/ bob .^(vase %cr (weld /(scot %p our)/[syd]/(scot cas) path))
|
|
|
|
=/ ali-dif (~(diff dais base) ali)
|
|
|
|
=/ bob-dif (~(diff dais base) bob)
|
|
|
|
=/ mash (~(mash dais base) [her sud ali-dif] [our syd bob-dif])
|
|
|
|
:- path
|
|
|
|
?~ mash
|
|
|
|
~
|
|
|
|
`[mark (~(pact dais base) u.mash)]
|
|
|
|
=/ [annotated=(list [path *]) unnotated=(list [path *])]
|
|
|
|
(skid notations |=([* v=*] ?=(^ v)))
|
|
|
|
=/ tic=desk (cat 3 syd '-scratch')
|
|
|
|
=/ tan=(list tank)
|
|
|
|
%- zing
|
|
|
|
^- (list (list tank))
|
|
|
|
:~ %- tape-to-tanks
|
|
|
|
"""
|
|
|
|
done setting up scratch space in {<[tic]>}
|
|
|
|
please resolve the following conflicts and run
|
|
|
|
|merge {<syd>} our {<[tic]>}
|
|
|
|
"""
|
|
|
|
%^ tanks-if-any
|
|
|
|
"annotated conflicts in:" (turn annotated head)
|
|
|
|
""
|
|
|
|
%^ tanks-if-any
|
|
|
|
"unannotated conflicts in:" (turn unnotated head)
|
|
|
|
"""
|
|
|
|
some conflicts could not be annotated.
|
|
|
|
for these, the scratch space contains
|
|
|
|
the most recent common ancestor of the
|
|
|
|
conflicting content.
|
|
|
|
"""
|
|
|
|
==
|
|
|
|
=< win
|
|
|
|
%- blab:(spam tan)
|
|
|
|
:_ ~
|
|
|
|
:* %pass /kiln/[syd] %arvo %c
|
|
|
|
%info
|
|
|
|
tic %&
|
|
|
|
%+ murn notations
|
|
|
|
|= [=path dif=(unit [=mark =vase])]
|
|
|
|
^- (unit [^path miso])
|
|
|
|
?~ dif
|
|
|
|
~
|
|
|
|
`[path %mut mark.u.dif vase.u.dif]
|
|
|
|
==
|
2015-09-02 01:20:17 +03:00
|
|
|
=+ "failed to merge with strategy meld"
|
2015-12-21 00:16:39 +03:00
|
|
|
lose:(spam leaf+- >p.p.are< q.p.are)
|
2018-03-19 06:54:47 +03:00
|
|
|
?: ?=(%& -.are)
|
2015-09-02 01:20:17 +03:00
|
|
|
=+ "merged with strategy {<gem>}"
|
2015-12-21 00:16:39 +03:00
|
|
|
win:(spam leaf+- ?~(p.are ~ [>`(set path)`p.are< ~]))
|
2015-09-02 01:20:17 +03:00
|
|
|
?. auto
|
|
|
|
=+ "failed to merge with strategy {<gem>}"
|
2015-12-21 00:16:39 +03:00
|
|
|
lose:(spam leaf+- >p.p.are< q.p.are)
|
2015-09-02 01:20:17 +03:00
|
|
|
?+ gem
|
2015-12-21 00:16:39 +03:00
|
|
|
(spam leaf+"strange auto" >gem< ~)
|
2015-09-02 01:20:17 +03:00
|
|
|
::
|
2020-11-25 22:39:13 +03:00
|
|
|
%init
|
2015-09-02 01:20:17 +03:00
|
|
|
=+ :- "auto merge failed on strategy %init"
|
2015-05-12 03:31:37 +03:00
|
|
|
"I'm out of ideas"
|
2015-12-21 00:16:39 +03:00
|
|
|
lose:(spam leaf+-< leaf+-> [>p.p.are< q.p.are])
|
2015-05-12 03:31:37 +03:00
|
|
|
::
|
2020-11-25 22:39:13 +03:00
|
|
|
%fine
|
|
|
|
?. ?=(%bad-fine-merge p.p.are)
|
2015-09-02 01:20:17 +03:00
|
|
|
=+ "auto merge failed on strategy %fine"
|
2015-12-21 00:16:39 +03:00
|
|
|
lose:(spam leaf+- >p.p.are< q.p.are)
|
|
|
|
=> (spam leaf+"%fine merge failed, trying %meet" ~)
|
2015-09-02 01:20:17 +03:00
|
|
|
perform(gem %meet)
|
2015-07-28 01:39:36 +03:00
|
|
|
::
|
2020-11-25 22:39:13 +03:00
|
|
|
%meet
|
|
|
|
?. ?=(%meet-conflict p.p.are)
|
2015-09-02 01:20:17 +03:00
|
|
|
=+ "auto merge failed on strategy %meet"
|
2015-12-21 00:16:39 +03:00
|
|
|
lose:(spam leaf+- >p.p.are< q.p.are)
|
|
|
|
=> (spam leaf+"%meet merge failed, trying %mate" ~)
|
2015-09-02 01:20:17 +03:00
|
|
|
perform(gem %mate)
|
2015-07-28 01:39:36 +03:00
|
|
|
::
|
2020-11-25 22:39:13 +03:00
|
|
|
%mate
|
|
|
|
?. ?=(%mate-conflict p.p.are)
|
2015-09-02 01:20:17 +03:00
|
|
|
=+ "auto merge failed on strategy %mate"
|
2015-12-21 00:16:39 +03:00
|
|
|
lose:(spam leaf+- >p.p.are< q.p.are)
|
2015-09-02 01:20:17 +03:00
|
|
|
=> .(gem %meld)
|
|
|
|
=+ tic=(cat 3 syd '-scratch')
|
|
|
|
=> =+ :- "%mate merge failed with conflicts,"
|
|
|
|
"setting up scratch space at %{(trip tic)}"
|
2015-12-21 00:16:39 +03:00
|
|
|
[tic=tic (spam leaf+-< leaf+-> q.p.are)]
|
2020-05-14 05:28:04 +03:00
|
|
|
=. ..mere (fancy-merge tic our syd %init)
|
|
|
|
=> (spam leaf+"%melding %{(trip sud)} into scratch space" ~)
|
|
|
|
%- blab :_ ~
|
2020-08-28 10:24:25 +03:00
|
|
|
?< ?=(%this gem)
|
|
|
|
?< ?=(%that gem)
|
2020-05-14 05:28:04 +03:00
|
|
|
=/ note [%merg (cat 3 syd '-scratch') her sud cas gem]
|
|
|
|
[%pass /kiln/[syd] %arvo %c note]
|
2015-09-02 01:20:17 +03:00
|
|
|
==
|
|
|
|
::
|
|
|
|
++ tape-to-tanks
|
2020-11-25 23:22:55 +03:00
|
|
|
|= a=tape ^- (list tank)
|
|
|
|
(scan a (more (just '\0a') (cook |=(a=tape leaf+a) (star prn))))
|
2015-09-02 01:20:17 +03:00
|
|
|
::
|
|
|
|
++ tanks-if-any
|
2020-11-26 17:09:31 +03:00
|
|
|
|= [a=tape b=(list path) c=tape] ^- (list tank)
|
2015-09-02 01:20:17 +03:00
|
|
|
?: =(~ b) ~
|
|
|
|
(welp (tape-to-tanks "\0a{c}{a}") >b< ~)
|
2015-05-12 03:31:37 +03:00
|
|
|
--
|
|
|
|
--
|