; Run through vpac --recipe-run so the target recipe uses makepkg's real evaluator. ; Only the declared metadata is read. Its build and package closures stay in the VM. emit-field := fn(key, value) { display(key) display("\t") display(value) newline() } defpkgbuild(metadata-reader, #:pkgname, "metadata-reader", #:pkgdesc, "Read the dependency fields from a trusted native recipe", #:pkgver, "1", #:pkgrel, 1, #:arch, [#:any], #:check, fn() { path := get-environment-variable("VINIX_RECIPE") recipe := eval(list(string->symbol("include"), path), interaction-environment()) fields := list("pkgname", "pkgver", "pkgrel", "epoch", "arch", "depends", "makedepends", "checkdepends", "provides") for-each(fn(key, value) { if member(key, fields) { if procedure?(value) { error("the source version must be resolved by a build", path) } if list?(value) { for-each(fn(item) { emit-field(key, item) }, value) } else { emit-field(key, value) } } }, vector->list(vpac-pkgbuild-keys(recipe)), vector->list(vpac-pkgbuild-values(recipe))) }, #:package, fn() { true })