mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-28 11:40:11 +03:00
file-server: use new base hash
This commit is contained in:
parent
4468d79509
commit
794b31ec91
@ -1,5 +1,5 @@
|
||||
/- srv=file-server, glob
|
||||
/+ *server, default-agent, verb, dbug
|
||||
/+ *server, default-agent, verb, dbug, version
|
||||
|%
|
||||
+$ card card:agent:gall
|
||||
+$ serving (map url-base=path [=content public=?])
|
||||
@ -291,24 +291,11 @@
|
||||
++ on-peek
|
||||
|= =path
|
||||
^- (unit (unit cage))
|
||||
|^
|
||||
?+ path (on-peek:def path)
|
||||
[%x %clay %base %hash ~] ``hash+!>(base-hash)
|
||||
[%x %clay %base %hash ~]
|
||||
=/ versions (base-hash:version [our now]:bowl)
|
||||
``hash+!>(?~(versions 0v0 (end 0 25 i.versions)))
|
||||
==
|
||||
:: stolen from +trouble
|
||||
:: TODO: move to a lib?
|
||||
++ base-hash
|
||||
^- @uv
|
||||
=+ .^ ota=(unit [=ship =desk =aeon:clay])
|
||||
%gx /(scot %p our.bowl)/hood/(scot %da now.bowl)/kiln/ota/noun
|
||||
==
|
||||
?~ ota
|
||||
*@uv
|
||||
=/ parent (scot %p ship.u.ota)
|
||||
=+ .^(=cass:clay %cs /[parent]/[desk.u.ota]/1/late/foo)
|
||||
%^ end 0 25
|
||||
.^(@uv %cz /[parent]/[desk.u.ota]/(scot %ud ud.cass))
|
||||
--
|
||||
++ on-agent on-agent:def
|
||||
++ on-fail on-fail:def
|
||||
--
|
||||
|
@ -9,6 +9,7 @@
|
||||
:: children
|
||||
:: glob-hash: hash of the glob, which is the js for landscape
|
||||
::
|
||||
/+ version
|
||||
:- %say
|
||||
|= [[now=time * bec=beak] ~ ~]
|
||||
=* our p.bec
|
||||
@ -16,7 +17,7 @@
|
||||
:- %noun
|
||||
=<
|
||||
:~
|
||||
[%base-hash base-hash]
|
||||
[%base-hash (base-hash:version our now)]
|
||||
[%sour-hash sour-hash]
|
||||
[%home-hash .^(@uv %cz (pathify ~.home ~))]
|
||||
[%kids-hash .^(@uv %cz (pathify ~.kids ~))]
|
||||
@ -53,21 +54,6 @@
|
||||
rift=ryft
|
||||
==
|
||||
::
|
||||
++ base-hash
|
||||
=+ .^ ota=(unit [=ship =desk =aeon:clay])
|
||||
%gx /(scot %p our)/hood/(scot %da now)/kiln/ota/noun
|
||||
==
|
||||
?~ ota
|
||||
~
|
||||
=/ parent (scot %p ship.u.ota)
|
||||
=/ takos
|
||||
.^ (list tako:clay) %cs
|
||||
/(scot %p our)/home/(scot %da now)/base/[parent]/[desk.u.ota]
|
||||
==
|
||||
%+ turn takos
|
||||
|= =tako:clay
|
||||
.^(@uv %cs /(scot %p our)/home/(scot %da now)/hash/(scot %uv tako))
|
||||
::
|
||||
++ sour-hash
|
||||
=+ .^ ota=(unit [=ship =desk =aeon:clay])
|
||||
%gx /(scot %p our)/hood/(scot %da now)/kiln/ota/noun
|
||||
|
18
pkg/arvo/lib/version.hoon
Normal file
18
pkg/arvo/lib/version.hoon
Normal file
@ -0,0 +1,18 @@
|
||||
|%
|
||||
++ base-hash
|
||||
|= [our=@p now=@da]
|
||||
^- (list @uv)
|
||||
=+ .^ ota=(unit [=ship =desk =aeon:clay])
|
||||
%gx /(scot %p our)/hood/(scot %da now)/kiln/ota/noun
|
||||
==
|
||||
?~ ota
|
||||
~
|
||||
=/ parent (scot %p ship.u.ota)
|
||||
=/ takos
|
||||
.^ (list tako:clay) %cs
|
||||
/(scot %p our)/home/(scot %da now)/base/[parent]/[desk.u.ota]
|
||||
==
|
||||
%+ turn takos
|
||||
|= =tako:clay
|
||||
.^(@uv %cs /(scot %p our)/home/(scot %da now)/hash/(scot %uv tako))
|
||||
--
|
Loading…
Reference in New Issue
Block a user