Implement most of the spec reusing scribe & nefthera code
This commit is contained in:
parent
e8b489dd6f
commit
612a98cfde
16 changed files with 225 additions and 25 deletions
15
ocaml/lib/system/package.ml
Normal file
15
ocaml/lib/system/package.ml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
let merge (schema: Schema.schema) (packages: string list) =
|
||||
|
||||
match packages with
|
||||
| [] -> { schema with output = { message = "No packages provided" } }
|
||||
| _ ->
|
||||
|
||||
let in_targets = List.flatten [["doas"; "apk"; "-i"; "add"]; packages] and
|
||||
out_targets = List.flatten [["doas"; "apk"; "-i"; "del"]; packages] in
|
||||
|
||||
Process.Fork.run "doas" in_targets;
|
||||
Process.Fork.run "doas" out_targets;
|
||||
|
||||
{ schema with output = {
|
||||
message = "Done: " ^ (String.concat "\n" packages)
|
||||
}}
|
||||
Loading…
Add table
Add a link
Reference in a new issue