I’m happy to announce the first release of rpmfile, a small library for reading meta information from RPM packages (version 3.0). It uses the Angstrom combinator parser library, which allows it to perform streaming parsing using Lwt or Async.
How to get a package summary:
module Rpm_reader = Rpmfile.Reader (Rpmfile.Selector.All)
let metadata = Rpm_reader.of_file_exn "hello-2.12.1-1.7.x86_64.rpm"
Rpmfile.summary metadata
(* - : string = "A Friendly Greeting Program" *)
The default reader module can read from a string or file, but has poor performance. It needs a selector module to select the tags to parse. The example uses Selector.All
to parse all tags.
I am developing this library for my pet project to create a self-hosted RPM repository management solution.
Thank you for your attention!
P.S. I found a few bugs, including incorrect parsing of the string array. I will fix them in the next version.