package rpmfile
RPM package metadata reader
Install
Dune Dependency
Authors
Maintainers
Sources
0.1.1.tar.gz
md5=74b751e2ef6a18df3c0ff439b4299026
sha512=67b367bc1f0d549b5c1e6aea66ec15d8983f365ca8f29d280eca0da94aa81939792f9d1ec852526afac31b7f3f67418a5f2e570bf741564891c8bd1525192733
README.md.html
rpmfile
A library for reading metadata from RPM packages, providing an Angstrom parser and a simple interface for accessing values.
Usage
Before you can read an RPM package, you must create a Reader
module with a selector (predicate for parsing only necessary tags) passed to it.
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" *)
You can also have “direct” access to values by tag using the get
function. Example of getting file sizes:
Rpmfile.get Rpmfile.D.(array int) 1028 metadata
(* int list = [35000; 0; 93787; ...]*)
If there's a retrieval error, the Rpmfile.Not_found
exception will be thrown.
Custom selector
module SelectNameOnly = struct
include Rpmfile.Selector.All
let select_header_tag = function
| 1000 (* name *) -> true
| _ -> false
end
module _ = Rpmfile.Reader (SelectNameOnly)
CLI utility
You can also use rpmfile as a CLI utility to get information about a package, similar to rpm -qi
.
rpmfile hello-2.12.1-1.7.x86_64.rpm
Documentation
Lookup documentation using the odig
:
odig doc rpmfile
References
Related
Alternative my implementation in TypeScript — rpm-parser
Live coding stream (in Russian) demo version of the parser
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>