[ANN] first release of rpmfile

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.

5 Likes

If you are aiming to do a rewrite of the messy mergerepo_c, then I am very interested and would like to follow and help if possible.

Some time ago I had an idea to make an alternative implementation of createrepo. But it turned out to be too difficult for me. I’m sorry.

No prob. I have it in the back of my mind for some time to try it using only the SQLite version of the repodata. Your package will I think make it a bit easier to do. Thanks.

1 Like