From 237fe0ea2f77bd6b2d96b3849580250b384c86c4 Mon Sep 17 00:00:00 2001 From: yosoyubik Date: Tue, 23 Apr 2024 13:44:13 +0200 Subject: [PATCH 1/2] gen: add +commit-event Produces a unix commit event from the provided path. This is useful in situations where a pier is running a buggy version of a hoon file that we cannot recover from. By making a jammed event of the commit, we can inject into the affected pier (using the "-I event.jam" flag) a restored version of the file that fixes the issue. --- pkg/arvo/gen/commit-event.hoon | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 pkg/arvo/gen/commit-event.hoon diff --git a/pkg/arvo/gen/commit-event.hoon b/pkg/arvo/gen/commit-event.hoon new file mode 100644 index 0000000000..442221d210 --- /dev/null +++ b/pkg/arvo/gen/commit-event.hoon @@ -0,0 +1,15 @@ +:: make a unix commit event +:: +:: call as > .event/jam +commit-event /path/to/file +:: to be used with ./urbit-binary -I event.jam pier +:: +:: XX expand with arbitrary user-defined events? +:: +:- %say +|= [[now=@da eny=@uvJ bec=beak] [=path ~] ~] +:- %noun +?~ beam=(de-beam path) + ~|(%path-not-beam !!) +=+ .^(file=@t %cx path) +=+ .^(=tube:clay %cc /(scot %p p.bec)/[q.bec]/(scot %da now)/txt/mime) +[/c/sync %into %base | [s.u.beam [~ !<(mime (tube !>(~[file])))]]~] From 3494a92334b581bf86153ffd1e6fb83664098fce Mon Sep 17 00:00:00 2001 From: yosoyubik Date: Wed, 24 Apr 2024 10:49:22 +0200 Subject: [PATCH 2/2] gen: get desk from beam --- pkg/arvo/gen/commit-event.hoon | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/arvo/gen/commit-event.hoon b/pkg/arvo/gen/commit-event.hoon index 442221d210..4931adc3e8 100644 --- a/pkg/arvo/gen/commit-event.hoon +++ b/pkg/arvo/gen/commit-event.hoon @@ -4,6 +4,8 @@ :: to be used with ./urbit-binary -I event.jam pier :: :: XX expand with arbitrary user-defined events? +:: XX only supports files in which +noun:grab in the mark file returns a @t +:: (e.g. hoon files) :: :- %say |= [[now=@da eny=@uvJ bec=beak] [=path ~] ~] @@ -12,4 +14,4 @@ ~|(%path-not-beam !!) =+ .^(file=@t %cx path) =+ .^(=tube:clay %cc /(scot %p p.bec)/[q.bec]/(scot %da now)/txt/mime) -[/c/sync %into %base | [s.u.beam [~ !<(mime (tube !>(~[file])))]]~] +[/c/sync %into desk=q.u.beam | [s.u.beam [~ !<(mime (tube !>(~[file])))]]~]