shrub/pkg/arvo/lib/pill.hoon

141 lines
3.2 KiB
Plaintext
Raw Normal View History

:: |pill: helper functions for making pills
::
2018-12-12 00:27:33 +03:00
^?
|%
:: +module-ova: vane load operations.
::
:: sys: full path to /sys directory
::
2019-08-06 03:44:52 +03:00
+$ pill
[boot-ova=* kernel-ova=(list unix-event) userspace-ova=(list unix-event)]
::
+$ unix-event
%+ pair wire
$% [%wack p=@]
[%whom p=ship]
[%boot ? $%($>(%fake task:able:jael) $>(%dawn task:able:jael))]
2019-08-06 03:44:52 +03:00
unix-task
==
::
++ module-ova
|= sys=path
^- (list [wire [%veer term path cord]])
%+ turn
^- (list (pair term path))
:~ :: sys/zuse: standard library
::
[%$ /zuse]
:: sys/vane/alef: network
::
[%a /vane/alef]
:: sys/vane/behn: timer
::
[%b /vane/behn]
:: sys/vane/clay: revision control
::
[%c /vane/clay]
:: sys/vane/dill: console
::
[%d /vane/dill]
2019-07-04 02:01:45 +03:00
:: sys/vane/eyre: http server
::
2019-07-04 02:01:45 +03:00
[%e /vane/eyre]
:: sys/vane/ford: build
::
[%f /vane/ford]
:: sys/vane/gall: applications
::
2019-11-19 07:36:21 +03:00
[%g /vane/gall]
2019-07-04 03:08:23 +03:00
:: sys/vane/iris: http client
::
[%i /vane/iris]
:: sys/vane/kale: security
::
2019-08-07 01:42:37 +03:00
[%j /vane/jael]
==
|= [=term =path]
=/ pax (weld sys path)
=/ txt .^(@ %cx (weld pax /hoon))
[[%vane path] [%veer term pax txt]]
:: +file-ovum: userspace filesystem load
::
:: bas: full path to / directory
::
++ file-ovum
2019-05-23 00:39:12 +03:00
=/ directories
2019-11-19 06:28:59 +03:00
`(list path)`~[/app /ted /gen /lib /mar /ren /sec /sur /sys /tests /web]
|= bas=path
2019-08-07 23:37:57 +03:00
^- unix-event
::
:: /app %gall applications
:: /gen :dojo generators
:: /lib %ford libraries
:: /mar %ford marks
:: /ren %ford renderers
:: /sec %eyre security drivers
:: /sur %ford structures
:: /sys system files
:: /tests unit tests
:: /web %eyre web content
::
2019-05-23 00:39:12 +03:00
%. directories
|= :: sal: all spurs to load from
::
sal/(list spur)
2019-08-07 23:37:57 +03:00
^- unix-event
::
:: hav: all user files
::
=; hav ~& user-files+(lent hav)
[[%$ %sync ~] [%into %$ & hav]]
=| hav/mode:clay
|- ^+ hav
?~ sal ~
=. hav $(sal t.sal)
::
:: tyl: spur
::
=/ tyl i.sal
|- ^+ hav
::
:: pax: full path at `tyl`
:: lon: directory at `tyl`
::
=/ pax (weld bas (flop tyl))
=/ lon .^(arch %cy pax)
:: XX this serialization should use marks
::
=? hav ?=(^ fil.lon)
2019-06-28 03:49:56 +03:00
:: XX this whitelist needs to be reviewed
::
?. ?= ?($css $hoon $html $js $json $md $png $txt $udon $umd)
-.tyl
::
:: install only files with whitelisted marks
::
~& ignoring+pax
hav
::
:: cot: file as plain-text octet-stream
::
=; cot [[(flop `path`tyl) `[/text/plain cot]] hav]
^- octs
?- tyl
{$json *}
=/ dat .^(json %cx pax)
(as-octt:mimes:html (en-json:html dat))
::
{$txt *}
=/ dat .^(wain %cx pax)
(as-octs:mimes:html (of-wain:format dat))
::
*
=/ dat .^(@t %cx pax)
[(met 3 dat) dat]
==
=/ all ~(tap by dir.lon)
|- ^- mode:clay
?~ all hav
$(all t.all, hav ^$(tyl [p.i.all tyl]))
--