Skip to content

johnlepikhin/rpm-tool

Repository files navigation

About

rpm-tool is yet another tool to work with RPM files and RPM repositories. Key features:

  • Fast repository index generator (yes, faster than createrepo and even createrepo_c)
  • Provide RPM files metadata in easy-to-parse formats: YAML, JSON, and XML

What to be done

  • Support for other.xml.gz repodata
  • Support for modules repositories index (new feature in Centos 8)

Note that *.sqlite.gz formats of repodata are deprecated since 2015 and will not be supported by utility.

Build

cargo build --release

For backward compatibility with older systems, XML files are compressed in single thread. To build with parallel gzip enabled:

cargo build --release --features parallel-zip

Usage

Configuration file

Currently, the configuration file is minimalistic and self-documented.

Command line options

All command line options are well self-documented. Below are a few examples with comments:

Get help

rpm-tool --help
rpm-tool rpm --help
rpm-tool rpm dump --help
rpm-tool repository --help

Show information about RPM package in JSON format

rpm-tool rpm dump -f json /path/to/file.rpm

Generate repository index with fileslists

rpm-tool repository generate --fileslists /path/to/repository/directory/

Tool use already existing repodata to safely skip heavy operations like calculating checksums or even reading RPM file headers,

To effectively utilize CPU usage rpm-tool creates a thread pool, which is used to calculate checksums, read RPM headers, gzip resulting metadata, and so on. The pool size can be configured via config file, see repodata→concurrency.

Add new files to index

rpm-tool repository add-files --fileslists --repository-path /path/to/repository/directory/ file1.rpm file2.rpm

Full rescan of huge repository just to add a couple of new files doesn’t seem to be effective. In order to optimize such a frequent operation, sub-command “add-files” was added.

Log to console

The tool can write a log to STDOUT instead of syslog. Just define the environment variable RUST_LOG with the desired log level:

RUST_LOG=info rpm-tool repository generate ...

Performance

Here is benchmark results of indexing RPM repository. Repository had 1200 packages of total size 12GB. All files are cached in page cache before starting benchmark.

createrepo_crpm-tool
create index from scratch46 s24 s
add one new package34 s0.11 s

About

yet another tool to work with RPM files and RPM repositories

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages